From 05b6c5183dac0603980dbacc07a25a09fe49b502 Mon Sep 17 00:00:00 2001
From: 刘朕 <liuzhen@bronet.cn>
Date: Tue, 24 Sep 2019 10:39:21 +0800
Subject: [PATCH] 统一配送订单新增备用地址

---
 app/portal/controller/OrderSalesmanController.php                        |  887 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 app/portal/controller/OrderpageController.php                            |    1 +
 public/themes/admin_simpleboot3/admin/salesmanorder/sale_order_list.html |  252 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------------------------------------------------------------------------------------------------------
 public/themes/admin_simpleboot3/admin/salesmanorder/sale_order_show.html |  105 +++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------
 public/themes/simpleboot3/portal/order_salesman/get_one.html             | 1215 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 public/themes/simpleboot3/portal/orderpage/order_salesman_ty.html        |  908 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 6 files changed, 1698 insertions(+), 1670 deletions(-)

diff --git a/app/portal/controller/OrderSalesmanController.php b/app/portal/controller/OrderSalesmanController.php
index 3cdf54e..d2dabf9 100644
--- a/app/portal/controller/OrderSalesmanController.php
+++ b/app/portal/controller/OrderSalesmanController.php
@@ -1,444 +1,445 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: Administrator
- * Date: 2019/6/9
- * Time: 15:34
- */
-
-namespace app\portal\controller;
-
-
-use app\portal\model\AddressModel;
-use app\portal\model\IndentGoodsModel;
-use app\portal\model\IndentModel;
-use cmf\controller\WeChatBaseController;
-use think\Db;
-use think\Image;
-use think\Session;
-
-class OrderSalesmanController extends WeChatBaseController
-{
-    protected $user_id;
-    protected $my_user;
-    protected $status;
-    protected $pid;
-    protected $beforeActionList = [
-        'check'             => ['except' => 'getGradeClass'],
-    ];
-
-    protected function check() {
-        $user_id = cmf_get_current_user_id();
-        $this->user_id = $user_id;
-        $this->my_user = Db::name('my_user')->where(['uid'=>$user_id])->find();
-        if(empty($this->my_user)){
-            $this->error('查无此人','','','');
-        }
-        $this->status = $this->my_user['status'];
-        $this->pid = $this->my_user['id'];
-        if($this->my_user['status'] != 2 && $this->my_user['status'] != 3){
-            $this->error('您还没有权限查看','','','');
-        }
-        $this->assign('my_user',$this->my_user);
-    }
-    public function get_all(){
-        $param = $this->request->param();
-        if(!empty($param['is_courier'])){
-            $where['is_courier'] = ['eq',$param['is_courier']];
-        }
-        $user_id = $this->user_id;
-        if($this->status == 2){
-            $where['salesman_uid'] = ['eq',$user_id];
-        }else{
-            //获取当前用户的所有下级
-            $user_child = Db::name('my_user')->where(['pid'=>$this->pid])->select();
-            $user_ids = [];
-            foreach($user_child as $key => $u_c){
-                $user_ids[] = $u_c['uid'];
-            }
-            $where['uid'] = ['in',$user_ids];
-        }
-        $where['indent_type'] = ['eq',2];
-        $where['state'] = ['eq',2];
-        $indentModel = new IndentModel();
-        $data = $indentModel->selectData($where);
-        $indentGoodsModel = new IndentGoodsModel();
-        $indent_ids = [];
-        foreach($data as $key => $vo){
-            $indent_goods = $indentGoodsModel->selectData(['indent_id'=>$vo['id']]);
-            $data[$key]['indent_goods'] = $indent_goods;
-            //判断订单是不是平台订单
-            if($vo['indent_type'] == 1){
-                $data[$key]['dizhi'] = Db::name('address') -> where('id',$vo['indent_address']) -> find();
-            }
-            $indent_ids[] = $vo['id'];
-        }
-        $goods_count = $indentGoodsModel->where(['indent_id'=>['in',$indent_ids]])->group('goods_id')->order('indent_id desc')->select()->toArray();
-        foreach($goods_count as $key => $g_c){
-            $number_sum = $indentGoodsModel->where(['indent_id'=>['in',$indent_ids],'goods_id'=>$g_c['goods_id']])->sum('number');
-            $goods_count[$key]['number_sum'] = $number_sum;
-        }
-        $this->assign('goods_count',$goods_count);
-        // 身份为老师,获取上级业务员的id
-        $school_uid = $user_id;
-        if($this->my_user['status'] == 3) {
-            $school_uid = Db::name('my_user')->where('id',$this->my_user['pid'])->value('uid');
-        }
-        $school = Db::name('school')->where('uid',$school_uid)->order('create_time desc')->select()->toArray();
-        if(count($school)!=0){
-            $schools = [];
-            foreach ($school as $key => $val){
-                $schools[$key]['value'] = $val['id'];
-                $schools[$key]['text'] = $val['school'];
-            }
-            $this->assign('school',json_encode($schools));
-        }else{
-            $this->assign('school','');
-        }
-        foreach ($data as $k=>$v) {
-            foreach ($v['indent_goods'] as $ki=>$vi) {
-                $data[$k]['indent_goods'][$ki]['thumbnail'] = cmf_get_image_url($vi['thumbnail']);
-            }
-        }
-        $this->assign('data',$data);
-        $this->assign('count',count($data));
-        return $this->fetch();
-    }
-    public function getGradeClass(){
-        $school_id = $this->request->param('school_id',0,'intval');
-        if(empty($school_id)){
-            $this->error('缺少必要参数');
-        }
-        $grade = Db::name('grade_class')->where(['school_id'=>$school_id])->select()->toArray();
-        foreach($grade as $key => $g){
-            $class = explode('-',$g['class']);
-            $grade[$key]['start'] = $class[0];
-            $grade[$key]['end'] = $class[1];
-        }
-        $this->success('SUCCESS','',$grade);
-    }
-    public function getOrderSalesman(){
-        $param = $this->request->param();
-        if(!empty($param['school'])){
-            $where['school'] = ['like',"%$param[school]%"];
-        }
-        if(!empty($param['grade'])){
-            $param['grade'] = explode(' - ',$param['grade']);
-            $where['grade'] = ['eq',$param['grade'][0]];
-            $where['class'] = ['eq',$param['grade'][1]];
-        }
-        if(!empty($param['state'])){
-            $where['state'] = ['eq',$param['state']];
-        }else{
-            $where['state'] = ['eq',2];
-        }
-        if(!empty($param['is_courier'])){
-            $where['is_courier'] = ['eq',$param['is_courier']];
-        }
-//        else{
-//            $where['is_courier'] = ['eq',1];
-//        }//
-        $user_id = $this->user_id;
-        // 身份为老师,获取上级业务员的id
-        $school_uid = $user_id;
-//        if($this->my_user['status'] == 3) {
-//            $school_uid = Db::name('my_user')->where('id',$this->my_user['pid'])->value('uid');
-//        }
-        if($this->status == 2){
-            $where['salesman_uid'] = ['eq',$school_uid];
-        }else{
-            //获取当前用户的所有下级
-            $user_child = Db::name('my_user')->where(['pid'=>$this->pid])->select();
-            $user_ids = [];
-            foreach($user_child as $key => $u_c){
-                $user_ids[] = $u_c['uid'];
-            }
-            $where['uid'] = ['in',$user_ids];
-        }
-        $where['indent_type'] = ['eq',2];
-        $indentModel = new IndentModel();
-        $data = $indentModel->selectData($where);
-        $indentGoodsModel = new IndentGoodsModel();
-        $indent_ids = [];
-        foreach($data as $key => $vo){
-            $indent_goods = $indentGoodsModel->selectData(['indent_id'=>$vo['id']]);
-            $data[$key]['indent_goods'] = $indent_goods;
-            if($vo['is_courier'] == 2){
-                $address = Db::name('address')->where(['id'=>$vo['indent_address']])->find();
-                $data[$key]['region'] = $address['region'];
-                $data[$key]['detailed'] = $address['detailed'];
-                $data[$key]['phone'] = $address['phone'];
-            }
-            $indent_ids[] = $vo['id'];
-        }
-        $goods_count = $indentGoodsModel->where(['indent_id'=>['in',$indent_ids]])->group('goods_id')->order('indent_id desc')->select()->toArray();
-        foreach($goods_count as $key => $g_c){
-            $number_sum = $indentGoodsModel->where(['indent_id'=>['in',$indent_ids],'goods_id'=>$g_c['goods_id']])->sum('number');
-            $goods_count[$key]['number_sum'] = $number_sum;
-        }
-        $result['data'] = $data;
-        $result['goods_count'] = $goods_count;
-        $this->success('SUCCESS','',$result);
-    }
-    public function send(){
-        $param = $this->request->param();
-        if(empty($param['is_courier'])){
-            $this->error('缺少必要参数1');
-        }
-        if($param['is_courier'] == 1){
-            if(empty($param['start_time'])){
-                $this->error('缺少必要参数2');
-            }
-//            if(empty($param['end_time'])){
-//                $this->error('缺少必要参数3');
-//            }
-        }else if($param['is_courier'] == 2){
-            if(empty($param['logistic_name'])){
-                $this->error('缺少必要参数4');
-            }
-            if(empty($param['logistic_code'])){
-                $this->error('缺少必要参数5');
-            }
-        }
-        if(empty($param['indent_id'])){
-            $this->error('缺少必要参数6');
-        }
-        $where['id'] = ['eq',$param['indent_id']];
-        $indentModel = new IndentModel();
-        $indent = $indentModel->findData($where);
-        if(empty($indent)){
-            $this->error('查询为空');
-        }
-        if($indent['state'] != 2){
-            $this->error('订单不是待支付状态');
-        }
-        $arr = [];
-        if($param['is_courier'] == 1){
-            $arr['start_time'] = $param['start_time'];
-//            $arr['end_time'] = $param['end_time'];
-        }else if($param['is_courier'] == 2){
-            $arr['logistic_name'] = $param['logistic_name'];
-            $arr['logistic_code'] = $param['logistic_code'];
-        }
-        $arr['state'] = 5;
-        $result = $indentModel->updateData($where,$arr);////
-        $this->success('发货成功');
-    }
-    public function send_all(){
-        $param = $this->request->param();
-        if(empty($param['start_time2']) || empty($param['indent_ids'])){
-            $this->error('缺少必要参数');
-        }
-        $indent_ids = explode(',',$param['indent_ids']);
-        $data['start_time'] = $param['start_time2'];
-//        $data['end_time'] = $param['end_time2'];
-        $data['state'] = 5;
-        $indentModel = new IndentModel();
-        $result = $indentModel->updateData(['id'=>['in',$indent_ids]],$data);
-        if(empty($result)){
-            $this->error('更新失败');
-        }else{
-            $this->success('发货成功');
-        }
-    }
-    public function get_one(){
-        $id = $this->request->param('id',0,'intval');
-        if(empty($id)){
-            $this->error('缺少必参数','','','');
-        }
-        $indentModel = new IndentModel();
-        $indent = $indentModel->findData(['id'=>$id])->toArray();
-        if(empty($indent)){
-            $this->error('查询为空');
-        }
-        $indentGoodsModel = new IndentGoodsModel();
-        $indent_goods = $indentGoodsModel->selectData(['indent_id'=>$indent['id']]);
-        if(!empty($indent['indent_address'])){
-            $addressModel = new AddressModel();
-            $indent_address = $addressModel->findData(['id'=>$indent['indent_address']])->toArray();
-            $indent['indent_address'] = $indent_address;
-        }
-        $indent['indent_goods'] = $indent_goods;
-        $this->assign('data',$indent);
-        return $this->fetch();
-    }
-    public function take_all(){
-        $indent_ids = $this->request->param('indent_ids');
-        $data['state'] = 3;
-        $indent_ids = explode(',',$indent_ids);
-        $where['id'] = ['in',$indent_ids];
-        $indentModel = new IndentModel();
-        $result = $indentModel->updateData($where,$data);
-        if(empty($result)){
-            $this->error('更新失败');
-        }else{
-            $this->success('更新成功');
-        }
-    }
-    public function take_one(){
-        $indent_id = $this->request->param('indent_id');
-        $data['state'] = 3;
-        $where['id'] = ['eq',$indent_id];
-        $indentModel = new IndentModel();
-        $result = $indentModel->updateData($where,$data);
-        if(empty($result)){
-            $this->error('更新失败');
-        }else{
-            $this->success('更新成功');
-        }
-    }
-
-    public function upload_img() {
-        if($this->request->isAjax()) {
-            set_time_limit(0);
-            ini_set('memory_limit', '512M');
-            ini_set("max_execution_time", 0);
-            $img = $this->request->param('img');
-            $top = $this->request->param('top');
-            if($img) {
-                $img_url = $this->base64_image_content($img,'./upload');
-                $new_img = Image::open('./upload/'.$img_url);
-                $width = $new_img->width();
-                $height = $new_img->height();
-                $new_img->thumb($width,$height - intval($top) * 2,5);
-                $new_img->thumb($width/2,($height - intval($top) * 2)/2);
-                $new_img->save('./upload/'.$img_url,'jpg',100);
-                $this->success('成功','',cmf_get_asset_url($img_url));
-            }
-        }
-    }
-
-    /**
-     * [将Base64图片转换为本地图片并保存]
-     * @E-mial wuliqiang_aa@163.com
-     * @TIME   2017-04-07
-     * @WEB    http://blog.iinu.com.cn
-     * @param  [Base64] $base64_image_content [要保存的Base64]
-     * @param  [目录] $path [要保存的路径]
-     */
-    private function base64_image_content($base64_image_content,$path){
-        //匹配出图片的格式
-        if (preg_match('/^(data:\s*image\/(\w+);base64,)/', $base64_image_content, $result)){
-            $type = $result[2];
-            $file_path = "order_img/";
-            $new_file = $path."/".$file_path;
-            if(!file_exists($new_file)){
-                //检查是否有该文件夹,如果没有就创建,并给予最高权限
-                mkdir($new_file, 0777,true);
-            }
-            $time = time();
-            $new_file = $new_file.cmf_get_current_user_id().$time.".{$type}";
-            if (file_put_contents($new_file, base64_decode(str_replace($result[1], '', $base64_image_content)))){
-                $file = $file_path.cmf_get_current_user_id().$time.".{$type}";
-                $session_img = Session::get('img_url');
-                if(file_exists('./upload/'.$session_img)) {
-                    @unlink('./upload/'.$session_img);
-                }
-                Session::set('img_url',$file);
-                return $file;
-            }else{
-                return false;
-            }
-        }else{
-            return false;
-        }
-    }
-
-    public function updatePost(){
-        $param = $this->request->param();
-        $indent_id = $this->request->param('indent_id',0,'intval');
-        if(empty($indent_id)){
-            $this->error('缺少必要参数123');
-        }
-        $indentModel = new IndentModel();
-        $data = $indentModel->findData(['id'=>$indent_id]);
-        if($data['is_courier'] == 1){
-            if(empty($param['name']) || empty($param['region']) || empty($param['school']) || empty($param['grade_class']) || empty($param['phone'])){
-                $this->error('缺少必要参数');
-            }
-            $grade_class = explode('-',$param['grade_class']);
-            $arr['name'] = $param['name'];
-            $arr['phone'] = $param['phone'];
-            $arr['region'] = $param['region'];
-            $arr['school'] = preg_replace('# #','',$param['school']);
-            $arr['grade'] = $grade_class[0];
-            $arr['class'] = $grade_class[1];
-            $result = $indentModel ->updateData(['id'=>$indent_id],$arr);
-        }else if($data['is_courier'] == 2){
-            if(empty($param['name']) || empty($param['phone']) || empty($param['region']) || empty($param['region_detail'])){
-                $this->error('缺少必要参数123');
-            }
-            $arr['name'] = $param['name'];
-            $arr['phone'] = $param['phone'];
-            $arr['region'] = $param['region'];
-            $arr['region_detail'] = $param['region_detail'];
-            $result = $indentModel ->updateData(['id'=>$indent_id],$arr);
-        }
-        $this->success('SUCCESS');
-    }
-
-    // 订单截图
-    public function get_jietu(){
-        $param = $this->request->param();
-        if(!empty($param['is_courier'])){
-            $where['is_courier'] = ['eq',$param['is_courier']];
-        }
-        $user_id = $this->user_id;
-        if($this->status == 2){
-            $where['salesman_uid'] = ['eq',$user_id];
-        }else{
-            //获取当前用户的所有下级
-            $user_child = Db::name('my_user')->where(['pid'=>$this->pid])->select();
-            $user_ids = [];
-            foreach($user_child as $key => $u_c){
-                $user_ids[] = $u_c['uid'];
-            }
-            $where['uid'] = ['in',$user_ids];
-        }
-        $where['indent_type'] = ['eq',2];
-        $where['state'] = ['eq',2];
-        $indentModel = new IndentModel();
-        $data = $indentModel->selectData($where);
-        $indentGoodsModel = new IndentGoodsModel();
-        $indent_ids = [];
-        foreach($data as $key => $vo){
-            $indent_goods = $indentGoodsModel->selectData(['indent_id'=>$vo['id']]);
-            $data[$key]['indent_goods'] = $indent_goods;
-            //判断订单是不是平台订单
-            if($vo['indent_type'] == 1){
-                $data[$key]['dizhi'] = Db::name('address') -> where('id',$vo['indent_address']) -> find();
-            }
-            $indent_ids[] = $vo['id'];
-        }
-        $goods_count = $indentGoodsModel->where(['indent_id'=>['in',$indent_ids]])->group('goods_id')->order('indent_id desc')->select()->toArray();
-        foreach($goods_count as $key => $g_c){
-            $number_sum = $indentGoodsModel->where(['indent_id'=>['in',$indent_ids],'goods_id'=>$g_c['goods_id']])->sum('number');
-            $goods_count[$key]['number_sum'] = $number_sum;
-        }
-        $this->assign('goods_count',$goods_count);
-        // 身份为老师,获取上级业务员的id
-        $school_uid = $user_id;
-        if($this->my_user['status'] == 3) {
-            $school_uid = Db::name('my_user')->where('id',$this->my_user['pid'])->value('uid');
-        }
-        $school = Db::name('school')->where('uid',$school_uid)->order('create_time desc')->select()->toArray();
-        if(count($school)!=0){
-            $schools = [];
-            foreach ($school as $key => $val){
-                $schools[$key]['value'] = $val['id'];
-                $schools[$key]['text'] = $val['school'];
-            }
-            $this->assign('school',json_encode($schools));
-        }else{
-            $this->assign('school','');
-        }
-        foreach ($data as $k=>$v) {
-            foreach ($v['indent_goods'] as $ki=>$vi) {
-                $data[$k]['indent_goods'][$ki]['thumbnail'] = cmf_get_image_url($vi['thumbnail']);
-            }
-        }
-        $this->assign('data',$data);
-        $this->assign('count',count($data));
-        return $this->fetch();
-    }
+<?php
+/**
+ * Created by PhpStorm.
+ * User: Administrator
+ * Date: 2019/6/9
+ * Time: 15:34
+ */
+
+namespace app\portal\controller;
+
+
+use app\portal\model\AddressModel;
+use app\portal\model\IndentGoodsModel;
+use app\portal\model\IndentModel;
+use cmf\controller\WeChatBaseController;
+use think\Db;
+use think\Image;
+use think\Session;
+
+class OrderSalesmanController extends WeChatBaseController
+{
+    protected $user_id;
+    protected $my_user;
+    protected $status;
+    protected $pid;
+    protected $beforeActionList = [
+        'check'             => ['except' => 'getGradeClass'],
+    ];
+
+    protected function check() {
+        $user_id = cmf_get_current_user_id();
+        $this->user_id = $user_id;
+        $this->my_user = Db::name('my_user')->where(['uid'=>$user_id])->find();
+        if(empty($this->my_user)){
+            $this->error('查无此人','','','');
+        }
+        $this->status = $this->my_user['status'];
+        $this->pid = $this->my_user['id'];
+        if($this->my_user['status'] != 2 && $this->my_user['status'] != 3){
+            $this->error('您还没有权限查看','','','');
+        }
+        $this->assign('my_user',$this->my_user);
+    }
+    public function get_all(){
+        $param = $this->request->param();
+        if(!empty($param['is_courier'])){
+            $where['is_courier'] = ['eq',$param['is_courier']];
+        }
+        $user_id = $this->user_id;
+        if($this->status == 2){
+            $where['salesman_uid'] = ['eq',$user_id];
+        }else{
+            //获取当前用户的所有下级
+            $user_child = Db::name('my_user')->where(['pid'=>$this->pid])->select();
+            $user_ids = [];
+            foreach($user_child as $key => $u_c){
+                $user_ids[] = $u_c['uid'];
+            }
+            $where['uid'] = ['in',$user_ids];
+        }
+        $where['indent_type'] = ['eq',2];
+        $where['state'] = ['eq',2];
+        $indentModel = new IndentModel();
+        $data = $indentModel->selectData($where);
+        $indentGoodsModel = new IndentGoodsModel();
+        $indent_ids = [];
+        foreach($data as $key => $vo){
+            $indent_goods = $indentGoodsModel->selectData(['indent_id'=>$vo['id']]);
+            $data[$key]['indent_goods'] = $indent_goods;
+            //判断订单是不是平台订单
+            if($vo['indent_type'] == 1){
+                $data[$key]['dizhi'] = Db::name('address') -> where('id',$vo['indent_address']) -> find();
+            }
+            $indent_ids[] = $vo['id'];
+        }
+        $goods_count = $indentGoodsModel->where(['indent_id'=>['in',$indent_ids]])->group('goods_id')->order('indent_id desc')->select()->toArray();
+        foreach($goods_count as $key => $g_c){
+            $number_sum = $indentGoodsModel->where(['indent_id'=>['in',$indent_ids],'goods_id'=>$g_c['goods_id']])->sum('number');
+            $goods_count[$key]['number_sum'] = $number_sum;
+        }
+        $this->assign('goods_count',$goods_count);
+        // 身份为老师,获取上级业务员的id
+        $school_uid = $user_id;
+        if($this->my_user['status'] == 3) {
+            $school_uid = Db::name('my_user')->where('id',$this->my_user['pid'])->value('uid');
+        }
+        $school = Db::name('school')->where('uid',$school_uid)->order('create_time desc')->select()->toArray();
+        if(count($school)!=0){
+            $schools = [];
+            foreach ($school as $key => $val){
+                $schools[$key]['value'] = $val['id'];
+                $schools[$key]['text'] = $val['school'];
+            }
+            $this->assign('school',json_encode($schools));
+        }else{
+            $this->assign('school','');
+        }
+        foreach ($data as $k=>$v) {
+            foreach ($v['indent_goods'] as $ki=>$vi) {
+                $data[$k]['indent_goods'][$ki]['thumbnail'] = cmf_get_image_url($vi['thumbnail']);
+            }
+        }
+        $this->assign('data',$data);
+        $this->assign('count',count($data));
+        return $this->fetch();
+    }
+    public function getGradeClass(){
+        $school_id = $this->request->param('school_id',0,'intval');
+        if(empty($school_id)){
+            $this->error('缺少必要参数');
+        }
+        $grade = Db::name('grade_class')->where(['school_id'=>$school_id])->select()->toArray();
+        foreach($grade as $key => $g){
+            $class = explode('-',$g['class']);
+            $grade[$key]['start'] = $class[0];
+            $grade[$key]['end'] = $class[1];
+        }
+        $this->success('SUCCESS','',$grade);
+    }
+    public function getOrderSalesman(){
+        $param = $this->request->param();
+        if(!empty($param['school'])){
+            $where['school'] = ['like',"%$param[school]%"];
+        }
+        if(!empty($param['grade'])){
+            $param['grade'] = explode(' - ',$param['grade']);
+            $where['grade'] = ['eq',$param['grade'][0]];
+            $where['class'] = ['eq',$param['grade'][1]];
+        }
+        if(!empty($param['state'])){
+            $where['state'] = ['eq',$param['state']];
+        }else{
+            $where['state'] = ['eq',2];
+        }
+        if(!empty($param['is_courier'])){
+            $where['is_courier'] = ['eq',$param['is_courier']];
+        }
+//        else{
+//            $where['is_courier'] = ['eq',1];
+//        }//
+        $user_id = $this->user_id;
+        // 身份为老师,获取上级业务员的id
+        $school_uid = $user_id;
+//        if($this->my_user['status'] == 3) {
+//            $school_uid = Db::name('my_user')->where('id',$this->my_user['pid'])->value('uid');
+//        }
+        if($this->status == 2){
+            $where['salesman_uid'] = ['eq',$school_uid];
+        }else{
+            //获取当前用户的所有下级
+            $user_child = Db::name('my_user')->where(['pid'=>$this->pid])->select();
+            $user_ids = [];
+            foreach($user_child as $key => $u_c){
+                $user_ids[] = $u_c['uid'];
+            }
+            $where['uid'] = ['in',$user_ids];
+        }
+        $where['indent_type'] = ['eq',2];
+        $indentModel = new IndentModel();
+        $data = $indentModel->selectData($where);
+        $indentGoodsModel = new IndentGoodsModel();
+        $indent_ids = [];
+        foreach($data as $key => $vo){
+            $indent_goods = $indentGoodsModel->selectData(['indent_id'=>$vo['id']]);
+            $data[$key]['indent_goods'] = $indent_goods;
+            if($vo['is_courier'] == 2){
+                $address = Db::name('address')->where(['id'=>$vo['indent_address']])->find();
+                $data[$key]['region'] = $address['region'];
+                $data[$key]['detailed'] = $address['detailed'];
+                $data[$key]['phone'] = $address['phone'];
+            }
+            $indent_ids[] = $vo['id'];
+        }
+        $goods_count = $indentGoodsModel->where(['indent_id'=>['in',$indent_ids]])->group('goods_id')->order('indent_id desc')->select()->toArray();
+        foreach($goods_count as $key => $g_c){
+            $number_sum = $indentGoodsModel->where(['indent_id'=>['in',$indent_ids],'goods_id'=>$g_c['goods_id']])->sum('number');
+            $goods_count[$key]['number_sum'] = $number_sum;
+        }
+        $result['data'] = $data;
+        $result['goods_count'] = $goods_count;
+        $this->success('SUCCESS','',$result);
+    }
+    public function send(){
+        $param = $this->request->param();
+        if(empty($param['is_courier'])){
+            $this->error('缺少必要参数1');
+        }
+        if($param['is_courier'] == 1){
+            if(empty($param['start_time'])){
+                $this->error('缺少必要参数2');
+            }
+//            if(empty($param['end_time'])){
+//                $this->error('缺少必要参数3');
+//            }
+        }else if($param['is_courier'] == 2){
+            if(empty($param['logistic_name'])){
+                $this->error('缺少必要参数4');
+            }
+            if(empty($param['logistic_code'])){
+                $this->error('缺少必要参数5');
+            }
+        }
+        if(empty($param['indent_id'])){
+            $this->error('缺少必要参数6');
+        }
+        $where['id'] = ['eq',$param['indent_id']];
+        $indentModel = new IndentModel();
+        $indent = $indentModel->findData($where);
+        if(empty($indent)){
+            $this->error('查询为空');
+        }
+        if($indent['state'] != 2){
+            $this->error('订单不是待支付状态');
+        }
+        $arr = [];
+        if($param['is_courier'] == 1){
+            $arr['start_time'] = $param['start_time'];
+//            $arr['end_time'] = $param['end_time'];
+        }else if($param['is_courier'] == 2){
+            $arr['logistic_name'] = $param['logistic_name'];
+            $arr['logistic_code'] = $param['logistic_code'];
+        }
+        $arr['state'] = 5;
+        $result = $indentModel->updateData($where,$arr);////
+        $this->success('发货成功');
+    }
+    public function send_all(){
+        $param = $this->request->param();
+        if(empty($param['start_time2']) || empty($param['indent_ids'])){
+            $this->error('缺少必要参数');
+        }
+        $indent_ids = explode(',',$param['indent_ids']);
+        $data['start_time'] = $param['start_time2'];
+//        $data['end_time'] = $param['end_time2'];
+        $data['state'] = 5;
+        $indentModel = new IndentModel();
+        $result = $indentModel->updateData(['id'=>['in',$indent_ids]],$data);
+        if(empty($result)){
+            $this->error('更新失败');
+        }else{
+            $this->success('发货成功');
+        }
+    }
+    public function get_one(){
+        $id = $this->request->param('id',0,'intval');
+        if(empty($id)){
+            $this->error('缺少必参数','','','');
+        }
+        $indentModel = new IndentModel();
+        $indent = $indentModel->findData(['id'=>$id])->toArray();
+        if(empty($indent)){
+            $this->error('查询为空');
+        }
+        $indentGoodsModel = new IndentGoodsModel();
+        $indent_goods = $indentGoodsModel->selectData(['indent_id'=>$indent['id']]);
+        if(!empty($indent['indent_address'])){
+            $addressModel = new AddressModel();
+            $indent_address = $addressModel->findData(['id'=>$indent['indent_address']])->toArray();
+            $indent['indent_address'] = $indent_address;
+        }
+        $indent['indent_goods'] = $indent_goods;
+        $this->assign('data',$indent);
+        return $this->fetch();
+    }
+    public function take_all(){
+        $indent_ids = $this->request->param('indent_ids');
+        $data['state'] = 3;
+        $indent_ids = explode(',',$indent_ids);
+        $where['id'] = ['in',$indent_ids];
+        $indentModel = new IndentModel();
+        $result = $indentModel->updateData($where,$data);
+        if(empty($result)){
+            $this->error('更新失败');
+        }else{
+            $this->success('更新成功');
+        }
+    }
+    public function take_one(){
+        $indent_id = $this->request->param('indent_id');
+        $data['state'] = 3;
+        $where['id'] = ['eq',$indent_id];
+        $indentModel = new IndentModel();
+        $result = $indentModel->updateData($where,$data);
+        if(empty($result)){
+            $this->error('更新失败');
+        }else{
+            $this->success('更新成功');
+        }
+    }
+
+    public function upload_img() {
+        if($this->request->isAjax()) {
+            set_time_limit(0);
+            ini_set('memory_limit', '512M');
+            ini_set("max_execution_time", 0);
+            $img = $this->request->param('img');
+            $top = $this->request->param('top');
+            if($img) {
+                $img_url = $this->base64_image_content($img,'./upload');
+                $new_img = Image::open('./upload/'.$img_url);
+                $width = $new_img->width();
+                $height = $new_img->height();
+                $new_img->thumb($width,$height - intval($top) * 2,5);
+                $new_img->thumb($width/2,($height - intval($top) * 2)/2);
+                $new_img->save('./upload/'.$img_url,'jpg',100);
+                $this->success('成功','',cmf_get_asset_url($img_url));
+            }
+        }
+    }
+
+    /**
+     * [将Base64图片转换为本地图片并保存]
+     * @E-mial wuliqiang_aa@163.com
+     * @TIME   2017-04-07
+     * @WEB    http://blog.iinu.com.cn
+     * @param  [Base64] $base64_image_content [要保存的Base64]
+     * @param  [目录] $path [要保存的路径]
+     */
+    private function base64_image_content($base64_image_content,$path){
+        //匹配出图片的格式
+        if (preg_match('/^(data:\s*image\/(\w+);base64,)/', $base64_image_content, $result)){
+            $type = $result[2];
+            $file_path = "order_img/";
+            $new_file = $path."/".$file_path;
+            if(!file_exists($new_file)){
+                //检查是否有该文件夹,如果没有就创建,并给予最高权限
+                mkdir($new_file, 0777,true);
+            }
+            $time = time();
+            $new_file = $new_file.cmf_get_current_user_id().$time.".{$type}";
+            if (file_put_contents($new_file, base64_decode(str_replace($result[1], '', $base64_image_content)))){
+                $file = $file_path.cmf_get_current_user_id().$time.".{$type}";
+                $session_img = Session::get('img_url');
+                if(file_exists('./upload/'.$session_img)) {
+                    @unlink('./upload/'.$session_img);
+                }
+                Session::set('img_url',$file);
+                return $file;
+            }else{
+                return false;
+            }
+        }else{
+            return false;
+        }
+    }
+
+    public function updatePost(){
+        $param = $this->request->param();
+        $indent_id = $this->request->param('indent_id',0,'intval');
+        if(empty($indent_id)){
+            $this->error('缺少必要参数123');
+        }
+        $indentModel = new IndentModel();
+        $data = $indentModel->findData(['id'=>$indent_id]);
+        if($data['is_courier'] == 1){
+            if(empty($param['name']) || empty($param['region']) || empty($param['school']) || empty($param['grade_class']) || empty($param['phone']) || empty($param['beiyong_address'])){
+                $this->error('缺少必要参数');
+            }
+            $grade_class = explode('-',$param['grade_class']);
+            $arr['name'] = $param['name'];
+            $arr['phone'] = $param['phone'];
+            $arr['region'] = $param['region'];
+            $arr['school'] = preg_replace('# #','',$param['school']);
+            $arr['grade'] = $grade_class[0];
+            $arr['class'] = $grade_class[1];
+            $arr['beiyong_address'] = $param['beiyong_address'];
+            $result = $indentModel ->updateData(['id'=>$indent_id],$arr);
+        }else if($data['is_courier'] == 2){
+            if(empty($param['name']) || empty($param['phone']) || empty($param['region']) || empty($param['region_detail'])){
+                $this->error('缺少必要参数123');
+            }
+            $arr['name'] = $param['name'];
+            $arr['phone'] = $param['phone'];
+            $arr['region'] = $param['region'];
+            $arr['region_detail'] = $param['region_detail'];
+            $result = $indentModel ->updateData(['id'=>$indent_id],$arr);
+        }
+        $this->success('SUCCESS');
+    }
+
+    // 订单截图
+    public function get_jietu(){
+        $param = $this->request->param();
+        if(!empty($param['is_courier'])){
+            $where['is_courier'] = ['eq',$param['is_courier']];
+        }
+        $user_id = $this->user_id;
+        if($this->status == 2){
+            $where['salesman_uid'] = ['eq',$user_id];
+        }else{
+            //获取当前用户的所有下级
+            $user_child = Db::name('my_user')->where(['pid'=>$this->pid])->select();
+            $user_ids = [];
+            foreach($user_child as $key => $u_c){
+                $user_ids[] = $u_c['uid'];
+            }
+            $where['uid'] = ['in',$user_ids];
+        }
+        $where['indent_type'] = ['eq',2];
+        $where['state'] = ['eq',2];
+        $indentModel = new IndentModel();
+        $data = $indentModel->selectData($where);
+        $indentGoodsModel = new IndentGoodsModel();
+        $indent_ids = [];
+        foreach($data as $key => $vo){
+            $indent_goods = $indentGoodsModel->selectData(['indent_id'=>$vo['id']]);
+            $data[$key]['indent_goods'] = $indent_goods;
+            //判断订单是不是平台订单
+            if($vo['indent_type'] == 1){
+                $data[$key]['dizhi'] = Db::name('address') -> where('id',$vo['indent_address']) -> find();
+            }
+            $indent_ids[] = $vo['id'];
+        }
+        $goods_count = $indentGoodsModel->where(['indent_id'=>['in',$indent_ids]])->group('goods_id')->order('indent_id desc')->select()->toArray();
+        foreach($goods_count as $key => $g_c){
+            $number_sum = $indentGoodsModel->where(['indent_id'=>['in',$indent_ids],'goods_id'=>$g_c['goods_id']])->sum('number');
+            $goods_count[$key]['number_sum'] = $number_sum;
+        }
+        $this->assign('goods_count',$goods_count);
+        // 身份为老师,获取上级业务员的id
+        $school_uid = $user_id;
+        if($this->my_user['status'] == 3) {
+            $school_uid = Db::name('my_user')->where('id',$this->my_user['pid'])->value('uid');
+        }
+        $school = Db::name('school')->where('uid',$school_uid)->order('create_time desc')->select()->toArray();
+        if(count($school)!=0){
+            $schools = [];
+            foreach ($school as $key => $val){
+                $schools[$key]['value'] = $val['id'];
+                $schools[$key]['text'] = $val['school'];
+            }
+            $this->assign('school',json_encode($schools));
+        }else{
+            $this->assign('school','');
+        }
+        foreach ($data as $k=>$v) {
+            foreach ($v['indent_goods'] as $ki=>$vi) {
+                $data[$k]['indent_goods'][$ki]['thumbnail'] = cmf_get_image_url($vi['thumbnail']);
+            }
+        }
+        $this->assign('data',$data);
+        $this->assign('count',count($data));
+        return $this->fetch();
+    }
 }
\ No newline at end of file
diff --git a/app/portal/controller/OrderpageController.php b/app/portal/controller/OrderpageController.php
index 397f669..f3069f8 100644
--- a/app/portal/controller/OrderpageController.php
+++ b/app/portal/controller/OrderpageController.php
@@ -289,6 +289,7 @@ class OrderpageController extends WeChatBaseController{
         $indent_data['grade'] = $_POST['grade'];
         $indent_data['class'] = $_POST['class'];
         $indent_data['leave_word'] = $_POST['leave_word'];
+        $indent_data['beiyong_address'] = $_POST['beiyong_address'];
         $data = Db::name('indent') -> update($indent_data);
         if($data){
            return true;
diff --git a/public/themes/admin_simpleboot3/admin/salesmanorder/sale_order_list.html b/public/themes/admin_simpleboot3/admin/salesmanorder/sale_order_list.html
index 9e95675..63e3462 100755
--- a/public/themes/admin_simpleboot3/admin/salesmanorder/sale_order_list.html
+++ b/public/themes/admin_simpleboot3/admin/salesmanorder/sale_order_list.html
@@ -1,126 +1,128 @@
-<include file="public@header"/>
-</head>
-<body>
-<style>
-    .pagination{text-align:center;margin-top:20px;margin-bottom: 20px;}
-    .pagination li{margin:0px 10px; border:1px solid #e6e6e6;padding: 3px 8px;display: inline-block;}
-    .pagination .active{background-color: #dd1a20;color: #fff;}
-    .pagination .disabled{color:#aaa;}
-</style>
-<div class="wrap js-check-wrap">
-    <ul class="nav nav-tabs">
-        <li class="active"><a href="#">业务员订单列表</a></li>
-    </ul>
-    <form class="well form-inline margin-top-20" method="post" action="{:url('Salesmanorder/sale_order_list')}">
-        关键字:
-        <input type="text" class="form-control" name="keyword" style="width: 200px;"
-               value="{$keyword|default=''}" placeholder="请输入订单号/姓名/手机号">
-        订单状态:
-        <select name="state"  class="form-control">
-            <option value="">全部</option>
-            <option value="3" <eq name="state" value="3">selected</eq> >已完成</option>
-            <option value="2" <eq name="state" value="2">selected</eq> >未完成</option>
-            <option value="4" <eq name="state" value="4">selected</eq> >待付款</option>
-            <option value="5" <eq name="state" value="5">selected</eq> >已发货</option>
-        </select>
-        业务员:
-        <select name="uid"  class="form-control">
-            <option value="">全部</option>
-            <volist name="sales" id="vo">
-                <option value="{$vo.uid}" <eq name="uid" value="$vo['uid']">selected</eq> >{$vo.user_nickname}</option>
-            </volist>
-        </select>
-        学校:
-        <select name="school"  class="form-control">
-            <option value="">全部</option>
-            <volist name="school" id="val">
-                <option value="{$val}" <eq name="school_val" value="$val">selected</eq> >{$val}</option>
-            </volist>
-        </select>
-        年级:
-        <select name="grade"  class="form-control">
-            <option value="">全部</option>
-            <volist name="grade_array" id="vo">
-                <option value="{$vo}" <eq name="grade" value="$vo">selected</eq> >{$vo}</option>
-            </volist>
-        </select>
-        <input type="submit" class="btn btn-primary" value="搜索"/>
-        <a class="btn btn-danger" href="{:url('Salesmanorder/sale_order_list')}">清空</a>
-    </form>
-    <div style="margin-left: 1200px;">
-        <span>总盈利:¥{$money}</span>
-    </div>
-    <table class="table table-hover table-bordered table-list" style="margin-top: 20px;">
-        <thead>
-        <tr>
-            <th>序号</th>
-            <th>订单号</th>
-            <th>姓名</th>
-            <th>手机号</th>
-            <th>地区</th>
-            <th>业务员</th>
-            <th>数量</th>
-            <th>价钱</th>
-            <th>学校-班级</th>
-            <th>订单状态</th>
-            <th>创建时间</th>
-            <th>操作</th>
-        </tr>
-        </thead>
-        <tbody>
-        <volist name="data" id="vo">
-            <tr class="tr{$vo.id}">
-                <td>{$vo.id}</td>
-                <td>{$vo.order_number}</td>
-                <td>{$vo.name}</td>
-                <td>{$vo.phone}</td>
-                <td>{$vo.region}</td>
-                <td>{$vo.nickname}</td>
-                <td>{$vo.book_num}</td>
-                <td>{$vo.money}</td>
-                <td>{$vo.grade_class}</td>
-                <if condition="$vo.state eq 4">
-                    <td>待付款</td>
-                    <elseif condition="$vo.state eq 1"/>
-                    <td>已付款</td>
-                    <elseif condition="$vo.state eq 2"/>
-                    <td>未完成</td>
-                    <elseif condition="$vo.state eq 3"/>
-                    <td>已完成</td>
-                    <elseif condition="$vo.state eq 5"/>
-                    <td>已发货</td>
-                </if>
-                <td>{$vo.create_time|date="Y-m-d H:i:s",###}</td>
-                <td style="width: 130px;">
-                    <a href="{:url('Salesmanorder/sale_order_show',array('id'=>$vo.id))}"><button type="button" class="btn btn-default">查看</button></a>
-                    <button type="button" class="btn btn-default" onclick="sale_order_del({$vo.id})">删除</button>
-                </td>
-            </tr>
-        </volist>
-        </tbody>
-    </table>
-</div>
-<div class="pagination">
-    {$data_arr->render()}
-</div>
-<script src="__STATIC__/js/admin.js"></script>
-<script>
-
-    /**
-     *点击删除
-     */
-    function sale_order_del(id){
-        ccc = window.confirm('是否删除这条订单?');
-        if(ccc){
-            $.post("{:url('Salesmanorder/sale_order_del')}",{id:id},function(data){
-                if(data){
-                    $('.tr'+id).remove();
-                }else{
-                    alert('删除失败!');
-                }
-            });
-        }
-    }
-</script>
-</body>
+<include file="public@header"/>
+</head>
+<body>
+<style>
+    .pagination{text-align:center;margin-top:20px;margin-bottom: 20px;}
+    .pagination li{margin:0px 10px; border:1px solid #e6e6e6;padding: 3px 8px;display: inline-block;}
+    .pagination .active{background-color: #dd1a20;color: #fff;}
+    .pagination .disabled{color:#aaa;}
+</style>
+<div class="wrap js-check-wrap">
+    <ul class="nav nav-tabs">
+        <li class="active"><a href="#">业务员订单列表</a></li>
+    </ul>
+    <form class="well form-inline margin-top-20" method="post" action="{:url('Salesmanorder/sale_order_list')}">
+        关键字:
+        <input type="text" class="form-control" name="keyword" style="width: 200px;"
+               value="{$keyword|default=''}" placeholder="请输入订单号/姓名/手机号">
+        订单状态:
+        <select name="state"  class="form-control">
+            <option value="">全部</option>
+            <option value="3" <eq name="state" value="3">selected</eq> >已完成</option>
+            <option value="2" <eq name="state" value="2">selected</eq> >未完成</option>
+            <option value="4" <eq name="state" value="4">selected</eq> >待付款</option>
+            <option value="5" <eq name="state" value="5">selected</eq> >已发货</option>
+        </select>
+        业务员:
+        <select name="uid"  class="form-control">
+            <option value="">全部</option>
+            <volist name="sales" id="vo">
+                <option value="{$vo.uid}" <eq name="uid" value="$vo['uid']">selected</eq> >{$vo.user_nickname}</option>
+            </volist>
+        </select>
+        学校:
+        <select name="school"  class="form-control">
+            <option value="">全部</option>
+            <volist name="school" id="val">
+                <option value="{$val}" <eq name="school_val" value="$val">selected</eq> >{$val}</option>
+            </volist>
+        </select>
+        年级:
+        <select name="grade"  class="form-control">
+            <option value="">全部</option>
+            <volist name="grade_array" id="vo">
+                <option value="{$vo}" <eq name="grade" value="$vo">selected</eq> >{$vo}</option>
+            </volist>
+        </select>
+        <input type="submit" class="btn btn-primary" value="搜索"/>
+        <a class="btn btn-danger" href="{:url('Salesmanorder/sale_order_list')}">清空</a>
+    </form>
+    <div style="margin-left: 1200px;">
+        <span>总盈利:¥{$money}</span>
+    </div>
+    <table class="table table-hover table-bordered table-list" style="margin-top: 20px;">
+        <thead>
+        <tr>
+            <th>序号</th>
+            <th>订单号</th>
+            <th>姓名</th>
+            <th>手机号</th>
+            <th>地区</th>
+            <th>业务员</th>
+            <th>数量</th>
+            <th>价钱</th>
+            <th>学校-班级</th>
+            <th>备用地址</th>
+            <th>订单状态</th>
+            <th>创建时间</th>
+            <th>操作</th>
+        </tr>
+        </thead>
+        <tbody>
+        <volist name="data" id="vo">
+            <tr class="tr{$vo.id}">
+                <td>{$vo.id}</td>
+                <td>{$vo.order_number}</td>
+                <td>{$vo.name}</td>
+                <td>{$vo.phone}</td>
+                <td>{$vo.region}</td>
+                <td>{$vo.nickname}</td>
+                <td>{$vo.book_num}</td>
+                <td>{$vo.money}</td>
+                <td>{$vo.grade_class}</td>
+                <td>{$vo.beiyong_address}</td>
+                <if condition="$vo.state eq 4">
+                    <td>待付款</td>
+                    <elseif condition="$vo.state eq 1"/>
+                    <td>已付款</td>
+                    <elseif condition="$vo.state eq 2"/>
+                    <td>未完成</td>
+                    <elseif condition="$vo.state eq 3"/>
+                    <td>已完成</td>
+                    <elseif condition="$vo.state eq 5"/>
+                    <td>已发货</td>
+                </if>
+                <td>{$vo.create_time|date="Y-m-d H:i:s",###}</td>
+                <td style="width: 130px;">
+                    <a href="{:url('Salesmanorder/sale_order_show',array('id'=>$vo.id))}"><button type="button" class="btn btn-default">查看</button></a>
+                    <button type="button" class="btn btn-default" onclick="sale_order_del({$vo.id})">删除</button>
+                </td>
+            </tr>
+        </volist>
+        </tbody>
+    </table>
+</div>
+<div class="pagination">
+    {$data_arr->render()}
+</div>
+<script src="__STATIC__/js/admin.js"></script>
+<script>
+
+    /**
+     *点击删除
+     */
+    function sale_order_del(id){
+        ccc = window.confirm('是否删除这条订单?');
+        if(ccc){
+            $.post("{:url('Salesmanorder/sale_order_del')}",{id:id},function(data){
+                if(data){
+                    $('.tr'+id).remove();
+                }else{
+                    alert('删除失败!');
+                }
+            });
+        }
+    }
+</script>
+</body>
 </html>
\ No newline at end of file
diff --git a/public/themes/admin_simpleboot3/admin/salesmanorder/sale_order_show.html b/public/themes/admin_simpleboot3/admin/salesmanorder/sale_order_show.html
index 73e6a01..67e9946 100755
--- a/public/themes/admin_simpleboot3/admin/salesmanorder/sale_order_show.html
+++ b/public/themes/admin_simpleboot3/admin/salesmanorder/sale_order_show.html
@@ -1,53 +1,54 @@
-<include file="public@header"/>
-</head>
-<body>
-<div class="wrap js-check-wrap">
-    <ul class="nav nav-tabs">
-        <li><a href="{:url('Salesmanorder/sale_order_list')}">业务员订单列表</a></li>
-        <li class="active"><a href="#">订单查看</a></li>
-    </ul>
-    <volist name="data_content" id="vo">
-        <div style="margin-top: 10px;">
-            <notempty name="$vo.thumbnail">
-                <img src="{:cmf_get_image_preview_url($vo.thumbnail)}"
-                     style="height:36px;width: 36px;"
-                     onclick="parent.imagePreviewDialog(this.src);">
-            </notempty>
-            <h4>书籍:{$vo.book_name}&nbsp;&nbsp;X&nbsp;&nbsp;{$vo.number}本</h4>
-            <h4>定价:{$vo.pricing}</h4>
-            <h4>售价:{$vo.price}</h4>
-        </div>
-    </volist>
-    <div style="margin-top: 10px;">
-        <h4>姓名:{$data.name}</h4>
-        <h4>手机号:{$data.phone}</h4>
-        <h4>
-            配送方式:
-            <if condition="$data.is_courier eq 1">
-                统一配送
-                <else/>
-                快递配送
-            </if>
-        </h4>
-        <h4>
-            <if condition="$data.is_courier eq 1">
-                预计送达:{$logistics}
-                <else/>
-                物流信息:
-                <if condition="$logistics eq 4">
-                    未发货
-                    <else/>
-                    <ul>
-                        <volist name="logistics" id="vo">
-                            <li>{$vo.AcceptStation}-{$vo.AcceptTime}</li>
-                        </volist>
-                    </ul>
-                </if>
-            </if>
-        </h4>
-        <h4>买家留言:{$data.leave_word}</h4>
-        <h4>收货地址:{$address_region}</h4>
-    </div>
-</div>
-</body>
+<include file="public@header"/>
+</head>
+<body>
+<div class="wrap js-check-wrap">
+    <ul class="nav nav-tabs">
+        <li><a href="{:url('Salesmanorder/sale_order_list')}">业务员订单列表</a></li>
+        <li class="active"><a href="#">订单查看</a></li>
+    </ul>
+    <volist name="data_content" id="vo">
+        <div style="margin-top: 10px;">
+            <notempty name="$vo.thumbnail">
+                <img src="{:cmf_get_image_preview_url($vo.thumbnail)}"
+                     style="height:36px;width: 36px;"
+                     onclick="parent.imagePreviewDialog(this.src);">
+            </notempty>
+            <h4>书籍:{$vo.book_name}&nbsp;&nbsp;X&nbsp;&nbsp;{$vo.number}本</h4>
+            <h4>定价:{$vo.pricing}</h4>
+            <h4>售价:{$vo.price}</h4>
+        </div>
+    </volist>
+    <div style="margin-top: 10px;">
+        <h4>姓名:{$data.name}</h4>
+        <h4>手机号:{$data.phone}</h4>
+        <h4>
+            配送方式:
+            <if condition="$data.is_courier eq 1">
+                统一配送
+                <else/>
+                快递配送
+            </if>
+        </h4>
+        <h4>
+            <if condition="$data.is_courier eq 1">
+                预计送达:{$logistics}
+                <else/>
+                物流信息:
+                <if condition="$logistics eq 4">
+                    未发货
+                    <else/>
+                    <ul>
+                        <volist name="logistics" id="vo">
+                            <li>{$vo.AcceptStation}-{$vo.AcceptTime}</li>
+                        </volist>
+                    </ul>
+                </if>
+            </if>
+        </h4>
+        <h4>买家留言:{$data.leave_word}</h4>
+        <h4>收货地址:{$address_region}</h4>
+        <h4>备用地址:{$data.beiyong_address}</h4>
+    </div>
+</div>
+</body>
 </html>
\ No newline at end of file
diff --git a/public/themes/simpleboot3/portal/order_salesman/get_one.html b/public/themes/simpleboot3/portal/order_salesman/get_one.html
index 25e0285..0a4fcb8 100755
--- a/public/themes/simpleboot3/portal/order_salesman/get_one.html
+++ b/public/themes/simpleboot3/portal/order_salesman/get_one.html
@@ -1,604 +1,613 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
-    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport"/>
-    <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
-    <title>学考无忧-订单确认-选择地址信息</title>
-    <link rel="stylesheet" href="__TMPL__/public/assets/css/mui.min.css">
-    <link rel="stylesheet" href="__TMPL__/public/assets/css/mui.picker.min.css">
-    <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css"/>
-    <link rel="stylesheet" href="__TMPL__/public/assets/css/log.css"/>
-    <style type="text/css">
-        .mui-poppicker-header,
-        .mui-picker {
-            background-color: white;
-        }
-
-        .mui-btn-blue,
-        .mui-btn-primary,
-        input[type=submit] {
-            background-color: #FF7700;
-            border: 0;
-        }
-
-        .mui-pciker-list li.highlight {
-            color: #FF7700;
-        }
-
-        .log_four_input_one_left {
-            width: 2.14rem;
-        }
-
-        .log_four_input_one_center {
-            margin-left: 0;
-            flex: 1;
-        }
-
-        .log_four_input_one_right {
-            margin-left: auto;
-        }
-    </style>
-</head>
-
-<body style="background-color: #F7F7F7;">
-<div class="log_top_co" style="background-color: white;">
-    <!-- 顶部 -->
-    <div class=" order_top log_top_co">
-        <a href="javascript:history.back(-1)">
-            <img src="__TMPL__/public/assets/images/left.png" alt=""/>
-        </a>
-        <p>订单确认</p>
-    </div>
-</div>
-<div class="tx_maskone" onclick="$(this).hide()">
-    <div class="tx_maskCon" onclick="zZFun(this)">
-        <div class="tx_maskConImg">
-            <img src="__TMPL__/public/assets/images/91.png" alt=""/>
-        </div>
-        <div class="tx_maskCon2">
-            <div class="log_three_model">
-                <div class="log_three_model_one time">
-                    <div class="log_three_model_left">配送时间</div>
-                    <div class="log_psong tongyi_start_time" style="color: #CCCCCC;">
-                        请选择配送到达时间
-                    </div>
-                    <input type="hidden" id="start_time" value="" placeholder="请输入开配送时间"/>
-                </div>
-                <!--<div class="log_three_model_one time">
-                    <div class="log_three_model_left">配送时间</div>
-                    <div class="log_psong">
-                        <input type="text" id="end_time" value="" placeholder="请输入结束配送时间"/>
-                    </div>
-                </div>-->
-                <div class="log_three_model_one logistic excompany">
-                    <div class="log_three_model_left">选择快递</div>
-                    <div class="log_psong log_psong_select">
-                        <div class="log_ps_title excompany_word">请选择快递公司</div>
-                        <div class="log_ps_img">
-                            <img src="__TMPL__/public/assets/images/29.png"/>
-                            <input type="hidden" id="logistic_name" placeholder="请选择快递公司"/>
-                        </div>
-                    </div>
-                </div>
-                <div class="log_three_model_one logistic" style="padding-bottom: 0;">
-                    <div class="log_three_model_left" style="margin-top: -0.3rem;">快递单号</div>
-                    <div class="log_three_model_right">
-                        <input type="text" id="logistic_code" placeholder="请输入快递单号"/>
-                    </div>
-                </div>
-            </div>
-            <!-- 确定 -->
-            <div class="tx_maskOk confirm" data-is_courier="" data-id="" data-indent-id="">确定</div>
-        </div>
-    </div>
-</div>
-<!--选择快递-->
-<!--<div class="tx_mask_kuaidi">-->
-    <!--<div class="tx_maskCon_school">-->
-        <!--<div class="three_model_school">-->
-            <!--<div class="three_model_school_title">-->
-                <!--选择快递-->
-            <!--</div>-->
-            <!--<div>-->
-                <!--<div class="three_model_school_data" style="display: block;">-->
-                    <!--<div class="three_model_school_name" data-name="SF">顺丰快递</div>-->
-                    <!--<div class="three_model_school_name" data-name="YTO">圆通快递</div>-->
-                    <!--<div class="three_model_school_name" data-name="ZTO">中通快递</div>-->
-                    <!--<div class="three_model_school_name there_unActive" data-name="STO">申通快递</div>-->
-                    <!--<div class="three_model_school_name" data-name="YD">韵达快递</div>-->
-                    <!--<div class="three_model_school_name" data-name="HHTT">天天快递</div>-->
-                    <!--<div class="three_model_school_name" data-name="HTKY">百世快递</div>-->
-                    <!--<div class="three_model_school_name" data-name="YZPY">邮政快递包裹</div>-->
-                    <!--<div class="three_model_school_name" data-name="EMS">EMS</div>-->
-                    <!--<div class="three_model_school_name" data-name="DBL">德邦快递</div>-->
-                    <!--<div class="three_model_school_name" data-name="ZJS">宅急送</div>-->
-                    <!--<div class="three_model_school_name" data-name="TNT">TNT快递</div>-->
-                <!--</div>-->
-            <!--</div>-->
-        <!--</div>-->
-    <!--</div>-->
-<!--</div>-->
-<!-- 地址信息 -->
-<div class="log_four_input">
-    <div class="log_four_input_title" style="margin-bottom: 0.2rem;">
-        地址信息
-    </div>
-    <if condition="$data.is_courier eq 2">
-        <div class="log_four_input_one">
-            <div class="log_four_input_one_left">
-                姓名
-            </div>
-            <div class="log_four_input_one_center">
-                <!--<div id="city_text">-->
-                    <!--{$data.indent_address.name}-->
-                <!--</div>-->
-                <input type="text" class="name" value="{$data.name}" />
-            </div>
-            <div class="log_four_input_one_right">
-                <img src="__TMPL__/public/assets/images/29.png" alt=""/>
-            </div>
-        </div>
-        <div class="log_four_input_one">
-            <div class="log_four_input_one_left">
-                电话
-            </div>
-            <div class="log_four_input_one_center">
-                <!--<div id="city_text">{$data.indent_address.phone}</div>-->
-                <input type="text" class="phone" value="{$data.phone}" />
-            </div>
-            <div class="log_four_input_one_right">
-                <img src="__TMPL__/public/assets/images/29.png" alt=""/>
-            </div>
-        </div>
-        <div class="log_four_input_one city_word1">
-            <div class="log_four_input_one_left">
-                地址
-            </div>
-            <div class="log_four_input_one_center">
-                <div id="city_text1" class="region">{$data.region}</div>
-            </div>
-            <div class="log_four_input_one_right">
-                <img src="__TMPL__/public/assets/images/29.png" alt=""/>
-            </div>
-        </div>
-        <div class="log_four_input_one">
-            <div class="log_four_input_one_left">
-                详细地址
-            </div>
-            <div class="log_four_input_one_center">
-                <div class="region_detail">{$data.region_detail}</div>
-<!--                <input type="text" class="region_detail" value="{$data.region_detail}" />-->
-            </div>
-            <div class="log_four_input_one_right">
-                <img src="__TMPL__/public/assets/images/29.png" alt=""/>
-            </div>
-        </div>
-        <else/>
-        <div class="log_four_input_one city_word">
-            <div class="log_four_input_one_left">
-                地区
-            </div>
-            <div class="log_four_input_one_center">
-                <div id="city_text" class="region" style="color: black;">
-                    {$data.region}
-                </div>
-            </div>
-            <div class="log_four_input_one_right">
-                <img src="__TMPL__/public/assets/images/29.png" alt=""/>
-            </div>
-        </div>
-        <div class="log_four_input_one log_three_select_school2">
-            <div class="log_four_input_one_left">
-                学校
-            </div>
-            <div class="log_four_input_one_center school">
-                {$data.school}
-            </div>
-            <div class="log_four_input_one_right">
-                <img src="__TMPL__/public/assets/images/29.png" alt=""/>
-            </div>
-        </div>
-        <div class="log_four_input_one log_three_select_class2">
-            <div class="log_four_input_one_left">
-                班级
-            </div>
-            <div class="log_four_input_one_center">
-                <div class="grade_class_text">{$data.grade}-{$data.class}</div>
-            </div>
-            <input type="hidden" class="grade_class" value="{$data.grade}-{$data.class}"/>
-            <div class="log_four_input_one_right">
-                <img src="__TMPL__/public/assets/images/29.png" alt=""/>
-            </div>
-        </div>
-        <div class="log_four_input_one">
-            <div class="log_four_input_one_left">
-                姓名
-            </div>
-            <div class="log_four_input_one_center">
-                <input style="width: 200px;text-align: left" class="name" type="text" value="{$data.name}"/>
-            </div>
-            <div class="log_four_input_one_right">
-                <img src="__TMPL__/public/assets/images/29.png" alt=""/>
-            </div>
-        </div>
-        <div class="log_four_input_one">
-            <div class="log_four_input_one_left">
-                手机号
-            </div>
-            <div class="log_four_input_one_center">
-                <input style="width: 200px;text-align: left" class="phone" type="text" value="{$data.phone}"/>
-            </div>
-        </div>
-    </if>
-
-
-</div>
-<!-- 订单信息 -->
-<div class="log_four_order">
-
-    <div class="log_four_order_details">
-        <div class="log_four_input_title" style="padding-bottom: 0.34rem;">
-            订单信息
-        </div>
-        <div class="log_four_order_details_one">
-            <foreach name="$data.indent_goods" item="i_g">
-                <div class="log_four_order_one">
-                    <div class="log_four_order_left">
-                        <img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
-                    </div>
-                    <div class="log_four_order_center">
-                        <div class="log_four_order_center_one txt-cut" style="-webkit-line-clamp: 1">
-                            {$i_g.book_name}
-                        </div>
-                        <div class="log_four_order_center_two">
-                            ×{$i_g.number}
-                        </div>
-                    </div>
-                    <div class="log_four_order_right">
-                        <span>¥</span>{$i_g.price}
-                    </div>
-                </div>
-            </foreach>
-        </div>
-    </div>
-</div>
-<!-- 支付方式 -->
-<div class="log_four_pash">
-    <div class="log_four_pash_bottom">
-        <div class="log_four_pash_top_one">
-            买家留言
-        </div>
-        <div class="log_four_pash_bottom_two" style="margin-top: 0.06rem">
-            <textarea name="" id="" cols="20" rows="3" placeholder="">{$data.leave_word}</textarea>
-        </div>
-    </div>
-</div>
-<!-- 底部按钮 -->
-<div class="log_seven_btn log_seven_btn9" style="margin-top: 0.36rem;">
-    <if condition="$data.state eq 2">
-        <div class="log_seven_btn_contant update" style="margin: 15px;" data-indent-id="{$data.id}">
-            确认修改
-        </div>
-        <div class="log_seven_btn_contant send" style="margin: 15px;" data-is_courier="{$data.is_courier}" data-indent-id="{$data.id}">
-            立即发货
-        </div>
-        <elseif condition="$data.state eq 5"/>
-        <a href="{:url('logistics/index',array('indent_id'=>$data['id']))}">
-            <div class="log_seven_btn_contant">
-                查看物流
-            </div>
-        </a>
-    </if>
-</div>
-<script src="__TMPL__/public/assets/js/jquery.js"></script>
-<script src="__TMPL__/public/assets/js/base.js"></script>
-<script src="__TMPL__/public/assets/js/mui.min.js"></script>
-<script src="__TMPL__/public/assets/js/mui.picker.min.js"></script>
-<script src="__TMPL__/public/assets/js/city.data-3.js"></script>
-<script>
-</script>
-<script>
-    <notempty name='$school'>
-    var myschool = {$school};
-    school_s(myschool);
-    </notempty>
-    var excompanypicker = new mui.PopPicker();
-    excompanypicker.setData([{
-        value: 'SF',
-        text: '顺丰快递'
-    }, {
-        value: 'YTO',
-        text: '圆通快递'
-    }, {
-        value: 'ZTO',
-        text: '中通快递'
-    }, {
-        value: 'STO',
-        text: '申通快递'
-    }, {
-        value: 'YD',
-        text: '韵达快递'
-    }, {
-        value: 'HHTT',
-        text: '天天快递'
-    }, {
-        value: 'HTKY',
-        text: '百世快递'
-    }, {
-        value: 'YZPY',
-        text: '邮政快递包裹'
-    }, {
-        value: 'EMS',
-        text: 'EMS'
-    }, {
-        value: 'DBL',
-        text: '德邦快递'
-    }, {
-        value: 'ZJS',
-        text: '宅急送'
-    }, {
-        value: 'TNT',
-        text: 'TNT快递'
-    }]);
-    var excompany_word
-    $(".excompany").click(function () {
-        excompanypicker.show(function (e) {
-            console.log(e, '3333')
-            console.log(e[0].value);
-            console.log(e[0].text);
-            school_name = e[0].value
-            $(".excompany_word").text(e[0].text);
-            $("#logistic_name").val(e[0].value);
-            $('.excompany_word').css('color', '#333333');
-        });
-    })
-    var schoolpicker = new mui.PopPicker();
-    var classpicker = new mui.PopPicker();
-    function school_s(myschool){
-        (function($, doc) {
-            console.log(myschool);
-            $.init();
-            $.ready(function() {
-                schoolpicker.setData(myschool);
-            });
-        })(mui, document);
-    }
-    function grade_s(mygrade){
-        (function($, doc) {
-            $.init();
-            $.ready(function() {
-                classpicker.setData(mygrade);
-            });
-        })(mui, document);
-    }
-    var city_picker = new mui.PopPicker({
-        layer: 3
-    });
-    city_picker.setData(cityData3);
-    $(".city_word").on("tap", function() {
-        setTimeout(function() {
-            city_picker.show(function(items) {
-                $("#city_text").text((items[0] || {}).text + "," + (items[1] || {}).text + "," + (items[2] || {}).text); //该ID为接收城市ID字段
-                $('#city_text').css('color', '#333333');
-                $("#city_text").html((items[0] || {}).text + " " + (items[1] || {}).text + " " + (items[2] || {}).text);
-                var area = items[0].text+" "+items[1].text+" "+items[2].text;
-                $('.region').val(area);
-                $.get("{:url('orderpage/get_school')}",{'area':area,'user_id':{$data.uid}},function(res){
-                    $('.xuexiao_name').text('请选择学校');
-                    $('.xuexiao_name').removeAttr("style");
-                    $('.banji_name').text('请选择班级');
-                    $('.banji_name').removeAttr("style");
-                    if(res){
-                        myschool = JSON.parse(res);
-                        console.log(myschool);
-                        school_s(myschool);
-                    }else{
-                        school_s('');
-                        grade_s('');
-                    }
-
-                });
-            });
-        }, 200);
-    });
-    $(".city_word1").on("tap", function() {
-        setTimeout(function() {
-            city_picker.show(function(items) {
-                $("#city_text1").text((items[0] || {}).text + "," + (items[1] || {}).text + "," + (items[2] || {}).text); //该ID为接收城市ID字段
-                $('#city_text1').css('color', '#333333');
-                $("#city_text1").html((items[0] || {}).text + " " + (items[1] || {}).text + " " + (items[2] || {}).text);
-                var area = items[0].text+" "+items[1].text+" "+items[2].text;
-            });
-        }, 200);
-    });
-
-    var school_name
-    $(".log_three_select_school2").click(function() {
-        schoolpicker.show(function(e) {
-            console.log(e, '3333')
-            console.log(e[0].value);
-            console.log(e[0].text);
-            $('.school').text(e[0].text);
-            school_name = e[0].value
-            $(".xuexiao_name").text(e[0].text);
-            $('.xuexiao_name').css('color', '#333333');
-
-            $.post("{:url('Personalcenter/get_grade_class')}", {id: school_name}, function (data) {
-                if (data) {
-                    data = JSON.parse(data);
-                    $('.banji_name').text('请选择班级').css("color","#CCCCCC");
-                    grade_s(data);
-                }
-
-            });
-
-        });
-    })
-
-    $(".log_three_select_class2").click(function() {
-        if(school_name != undefined) {
-            classpicker.show(function(e) {
-                console.log(e)
-                console.log(e[0].value);
-                console.log(e[0].text);
-                $('.grade_class_text').text(e[0].text)
-                $('.grade_class').val(e[0].text)
-                $(".banji_name").text(e[0].text);
-                $('.banji_name').css('color', '#333333');
-            });
-        } else {
-            alert("请先选择学校")
-        }
-    })
-</script>
-<script>
-    function zZFun(e) {
-        window.event ? (window.event.cancelBubble = true) : e.stopPropagation();
-    }
-
-    //选择快递方式
-    $(".log_psong_select").click(function () {
-        $(".tx_mask_kuaidi").css({
-            display: "block"
-        });
-    });
-    $(".tx_mask_kuaidi .three_model_school_name").click(function () {
-        var index = $(this).index();
-        $(this).addClass('there_unActive').siblings().removeClass('there_unActive');
-        $('.log_ps_title').text($(this).text()).css("color", "#333");
-        $(".tx_mask_kuaidi").hide();
-        $('#logistic_name').val($(this).attr('data-name'))
-    });
-    $(function () {
-        $('body').on('click', '.send', function () {
-            var indent_id = $(this).attr('data-indent-id');
-            var is_courier = $(this).attr('data-is_courier');
-            console.log(indent_id);
-            console.log(is_courier);
-            if (is_courier == 1) {
-                //统一配送
-                $('.time').show();
-                $('.logistic').hide();
-            } else if (is_courier == 2) {
-                //快递
-                $('.time').hide();
-                $('.logistic').show();
-            }
-            $('.tx_maskone').show();
-            $('.confirm').attr('data-indent-id', indent_id);
-            $('.confirm').attr('data-is_courier', is_courier);
-        });
-        $('.confirm').click(function () {
-            var is_courier = $(this).attr('data-is_courier');
-            var indent_id = $(this).attr('data-indent-id');
-            var logistic_name = $('#logistic_name').val();
-            var logistic_code = $('#logistic_code').val();
-            var start_time = $('#start_time').val();
-            // var end_time = $('#end_time').val();
-            if (is_courier == 1) {
-                if (start_time == '') {
-                    alert('请填写配送时间');
-                    return false;
-                }
-                // else if (end_time == '') {
-                //     alert('请填写配送时间');
-                //     return false;
-                // }
-            } else if (is_courier == 2) {
-                if (logistic_name == '') {
-                    alert('请填写快递公司');
-                    return false;
-                } else if (logistic_code == '') {
-                    alert('请填写快递单号');
-                    return false;
-                }
-            } else if (is_courier == '') {
-                alert('未知错误');
-                return false;
-            }
-            $.ajax({
-                url: "{:url('send')}",
-                type: "GET",
-                data: {
-                    'indent_id': indent_id,
-                    'is_courier': is_courier,
-                    'logistic_name': logistic_name,
-                    'logistic_code': logistic_code,
-                    'start_time': start_time,
-                    // 'end_time': end_time
-                },
-                success: function (res) {
-                    console.log(res);
-                    if (res.code == 1) {
-                        $('.order_' + indent_id).remove();
-                        $(".tx_maskone").css({
-                            display: "none"
-                        });
-                        $(".tx_mask").css({
-                            display: "none"
-                        });
-                        $('.send').remove();
-                        var html = "<a href=\"{:url('logistics/index','',false,true)}/indent_id/" + indent_id + "\">\n" +
-                            "            <div class=\"log_seven_btn_contant\">\n" +
-                            "                查看物流\n" +
-                            "            </div>\n" +
-                            "        </a>";
-                        $('.log_seven_btn9').html(html)
-                        window.location.href = "{:url('get_all')}";
-                    }
-                    alert(res.msg)
-                }
-            })
-        })
-    })
-</script>
-<script>
-    var dtpicker = new mui.DtPicker({
-        type: "date", //设置日历初始视图模式
-        beginDate: new Date(), //设置开始日期
-        labels: ['年', '月', '日'], //设置默认标签区域提示语
-    })
-    //统一配送选择时间
-    $(".tongyi_start_time").click(function () {
-        dtpicker.show(function (e) {
-            console.log(e);
-            $('.tongyi_start_time').text(e.text);
-            $('#start_time').val(e.text);
-            $('.tongyi_start_time').css('color', '#333333');
-        });
-    })
-
-    function zZFun(e) {
-        window.event ? (window.event.cancelBubble = true) : e.stopPropagation();
-    }
-    $('.update').click(function(){
-        var indent_id = $(this).attr('data-indent-id');
-        var name = $('.name').val();
-        var phone = $('.phone').val();
-        var region = $('.region').text();
-        var region_detail = $('.region_detail').val();
-
-        var school = $('.school').text();
-        var grade_class = $('.grade_class_text').text();
-        console.log(school);
-        console.log(grade_class)
-        $.ajax({
-            url:"{:url('updatePost')}",
-            type:"GET",
-            data:{'indent_id':indent_id,'name':name,'phone':phone,'region':region,'region_detail':region_detail,'school':school,'grade_class':grade_class},
-            success:function(res){
-                if(res.code == 1){
-                    alert('修改成功')
-                }
-            },
-            error:function(res){
-                alert('与服务器断开链接')
-            }
-        })
-    })
-</script>
-</body>
-
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
+    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport"/>
+    <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
+    <title>学考无忧-订单确认-选择地址信息</title>
+    <link rel="stylesheet" href="__TMPL__/public/assets/css/mui.min.css">
+    <link rel="stylesheet" href="__TMPL__/public/assets/css/mui.picker.min.css">
+    <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css"/>
+    <link rel="stylesheet" href="__TMPL__/public/assets/css/log.css"/>
+    <style type="text/css">
+        .mui-poppicker-header,
+        .mui-picker {
+            background-color: white;
+        }
+
+        .mui-btn-blue,
+        .mui-btn-primary,
+        input[type=submit] {
+            background-color: #FF7700;
+            border: 0;
+        }
+
+        .mui-pciker-list li.highlight {
+            color: #FF7700;
+        }
+
+        .log_four_input_one_left {
+            width: 2.14rem;
+        }
+
+        .log_four_input_one_center {
+            margin-left: 0;
+            flex: 1;
+        }
+
+        .log_four_input_one_right {
+            margin-left: auto;
+        }
+    </style>
+</head>
+
+<body style="background-color: #F7F7F7;">
+<div class="log_top_co" style="background-color: white;">
+    <!-- 顶部 -->
+    <div class=" order_top log_top_co">
+        <a href="javascript:history.back(-1)">
+            <img src="__TMPL__/public/assets/images/left.png" alt=""/>
+        </a>
+        <p>订单确认</p>
+    </div>
+</div>
+<div class="tx_maskone" onclick="$(this).hide()">
+    <div class="tx_maskCon" onclick="zZFun(this)">
+        <div class="tx_maskConImg">
+            <img src="__TMPL__/public/assets/images/91.png" alt=""/>
+        </div>
+        <div class="tx_maskCon2">
+            <div class="log_three_model">
+                <div class="log_three_model_one time">
+                    <div class="log_three_model_left">配送时间</div>
+                    <div class="log_psong tongyi_start_time" style="color: #CCCCCC;">
+                        请选择配送到达时间
+                    </div>
+                    <input type="hidden" id="start_time" value="" placeholder="请输入开配送时间"/>
+                </div>
+                <!--<div class="log_three_model_one time">
+                    <div class="log_three_model_left">配送时间</div>
+                    <div class="log_psong">
+                        <input type="text" id="end_time" value="" placeholder="请输入结束配送时间"/>
+                    </div>
+                </div>-->
+                <div class="log_three_model_one logistic excompany">
+                    <div class="log_three_model_left">选择快递</div>
+                    <div class="log_psong log_psong_select">
+                        <div class="log_ps_title excompany_word">请选择快递公司</div>
+                        <div class="log_ps_img">
+                            <img src="__TMPL__/public/assets/images/29.png"/>
+                            <input type="hidden" id="logistic_name" placeholder="请选择快递公司"/>
+                        </div>
+                    </div>
+                </div>
+                <div class="log_three_model_one logistic" style="padding-bottom: 0;">
+                    <div class="log_three_model_left" style="margin-top: -0.3rem;">快递单号</div>
+                    <div class="log_three_model_right">
+                        <input type="text" id="logistic_code" placeholder="请输入快递单号"/>
+                    </div>
+                </div>
+            </div>
+            <!-- 确定 -->
+            <div class="tx_maskOk confirm" data-is_courier="" data-id="" data-indent-id="">确定</div>
+        </div>
+    </div>
+</div>
+<!--选择快递-->
+<!--<div class="tx_mask_kuaidi">-->
+    <!--<div class="tx_maskCon_school">-->
+        <!--<div class="three_model_school">-->
+            <!--<div class="three_model_school_title">-->
+                <!--选择快递-->
+            <!--</div>-->
+            <!--<div>-->
+                <!--<div class="three_model_school_data" style="display: block;">-->
+                    <!--<div class="three_model_school_name" data-name="SF">顺丰快递</div>-->
+                    <!--<div class="three_model_school_name" data-name="YTO">圆通快递</div>-->
+                    <!--<div class="three_model_school_name" data-name="ZTO">中通快递</div>-->
+                    <!--<div class="three_model_school_name there_unActive" data-name="STO">申通快递</div>-->
+                    <!--<div class="three_model_school_name" data-name="YD">韵达快递</div>-->
+                    <!--<div class="three_model_school_name" data-name="HHTT">天天快递</div>-->
+                    <!--<div class="three_model_school_name" data-name="HTKY">百世快递</div>-->
+                    <!--<div class="three_model_school_name" data-name="YZPY">邮政快递包裹</div>-->
+                    <!--<div class="three_model_school_name" data-name="EMS">EMS</div>-->
+                    <!--<div class="three_model_school_name" data-name="DBL">德邦快递</div>-->
+                    <!--<div class="three_model_school_name" data-name="ZJS">宅急送</div>-->
+                    <!--<div class="three_model_school_name" data-name="TNT">TNT快递</div>-->
+                <!--</div>-->
+            <!--</div>-->
+        <!--</div>-->
+    <!--</div>-->
+<!--</div>-->
+<!-- 地址信息 -->
+<div class="log_four_input">
+    <div class="log_four_input_title" style="margin-bottom: 0.2rem;">
+        地址信息
+    </div>
+    <if condition="$data.is_courier eq 2">
+        <div class="log_four_input_one">
+            <div class="log_four_input_one_left">
+                姓名
+            </div>
+            <div class="log_four_input_one_center">
+                <!--<div id="city_text">-->
+                    <!--{$data.indent_address.name}-->
+                <!--</div>-->
+                <input type="text" class="name" value="{$data.name}" />
+            </div>
+            <div class="log_four_input_one_right">
+                <img src="__TMPL__/public/assets/images/29.png" alt=""/>
+            </div>
+        </div>
+        <div class="log_four_input_one">
+            <div class="log_four_input_one_left">
+                电话
+            </div>
+            <div class="log_four_input_one_center">
+                <!--<div id="city_text">{$data.indent_address.phone}</div>-->
+                <input type="text" class="phone" value="{$data.phone}" />
+            </div>
+            <div class="log_four_input_one_right">
+                <img src="__TMPL__/public/assets/images/29.png" alt=""/>
+            </div>
+        </div>
+        <div class="log_four_input_one city_word1">
+            <div class="log_four_input_one_left">
+                地址
+            </div>
+            <div class="log_four_input_one_center">
+                <div id="city_text1" class="region">{$data.region}</div>
+            </div>
+            <div class="log_four_input_one_right">
+                <img src="__TMPL__/public/assets/images/29.png" alt=""/>
+            </div>
+        </div>
+        <div class="log_four_input_one">
+            <div class="log_four_input_one_left">
+                详细地址
+            </div>
+            <div class="log_four_input_one_center">
+                <div class="region_detail">{$data.region_detail}</div>
+<!--                <input type="text" class="region_detail" value="{$data.region_detail}" />-->
+            </div>
+            <div class="log_four_input_one_right">
+                <img src="__TMPL__/public/assets/images/29.png" alt=""/>
+            </div>
+        </div>
+        <else/>
+        <div class="log_four_input_one city_word">
+            <div class="log_four_input_one_left">
+                地区
+            </div>
+            <div class="log_four_input_one_center">
+                <div id="city_text" class="region" style="color: black;">
+                    {$data.region}
+                </div>
+            </div>
+            <div class="log_four_input_one_right">
+                <img src="__TMPL__/public/assets/images/29.png" alt=""/>
+            </div>
+        </div>
+        <div class="log_four_input_one log_three_select_school2">
+            <div class="log_four_input_one_left">
+                学校
+            </div>
+            <div class="log_four_input_one_center school">
+                {$data.school}
+            </div>
+            <div class="log_four_input_one_right">
+                <img src="__TMPL__/public/assets/images/29.png" alt=""/>
+            </div>
+        </div>
+        <div class="log_four_input_one log_three_select_class2">
+            <div class="log_four_input_one_left">
+                班级
+            </div>
+            <div class="log_four_input_one_center">
+                <div class="grade_class_text">{$data.grade}-{$data.class}</div>
+            </div>
+            <input type="hidden" class="grade_class" value="{$data.grade}-{$data.class}"/>
+            <div class="log_four_input_one_right">
+                <img src="__TMPL__/public/assets/images/29.png" alt=""/>
+            </div>
+        </div>
+        <div class="log_four_input_one">
+            <div class="log_four_input_one_left">
+                姓名
+            </div>
+            <div class="log_four_input_one_center">
+                <input style="width: 200px;text-align: left" class="name" type="text" value="{$data.name}"/>
+            </div>
+            <div class="log_four_input_one_right">
+                <img src="__TMPL__/public/assets/images/29.png" alt=""/>
+            </div>
+        </div>
+        <div class="log_four_input_one">
+            <div class="log_four_input_one_left">
+                手机号
+            </div>
+            <div class="log_four_input_one_center">
+                <input style="width: 200px;text-align: left" class="phone" type="text" value="{$data.phone}"/>
+            </div>
+        </div>
+        <div class="log_four_input_one">
+            <div class="log_four_input_one_left">
+                备用地址
+            </div>
+            <div class="log_four_input_one_center">
+                <input style="width: 200px;text-align: left" class="beiyong_address" type="text" value="{$data.beiyong_address}"/>
+            </div>
+        </div>
+    </if>
+
+
+</div>
+<!-- 订单信息 -->
+<div class="log_four_order">
+
+    <div class="log_four_order_details">
+        <div class="log_four_input_title" style="padding-bottom: 0.34rem;">
+            订单信息
+        </div>
+        <div class="log_four_order_details_one">
+            <foreach name="$data.indent_goods" item="i_g">
+                <div class="log_four_order_one">
+                    <div class="log_four_order_left">
+                        <img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
+                    </div>
+                    <div class="log_four_order_center">
+                        <div class="log_four_order_center_one txt-cut" style="-webkit-line-clamp: 1">
+                            {$i_g.book_name}
+                        </div>
+                        <div class="log_four_order_center_two">
+                            ×{$i_g.number}
+                        </div>
+                    </div>
+                    <div class="log_four_order_right">
+                        <span>¥</span>{$i_g.price}
+                    </div>
+                </div>
+            </foreach>
+        </div>
+    </div>
+</div>
+<!-- 支付方式 -->
+<div class="log_four_pash">
+    <div class="log_four_pash_bottom">
+        <div class="log_four_pash_top_one">
+            买家留言
+        </div>
+        <div class="log_four_pash_bottom_two" style="margin-top: 0.06rem">
+            <textarea name="" id="" cols="20" rows="3" placeholder="">{$data.leave_word}</textarea>
+        </div>
+    </div>
+</div>
+<!-- 底部按钮 -->
+<div class="log_seven_btn log_seven_btn9" style="margin-top: 0.36rem;">
+    <if condition="$data.state eq 2">
+        <div class="log_seven_btn_contant update" style="margin: 15px;" data-indent-id="{$data.id}">
+            确认修改
+        </div>
+        <div class="log_seven_btn_contant send" style="margin: 15px;" data-is_courier="{$data.is_courier}" data-indent-id="{$data.id}">
+            立即发货
+        </div>
+        <elseif condition="$data.state eq 5"/>
+        <a href="{:url('logistics/index',array('indent_id'=>$data['id']))}">
+            <div class="log_seven_btn_contant">
+                查看物流
+            </div>
+        </a>
+    </if>
+</div>
+<script src="__TMPL__/public/assets/js/jquery.js"></script>
+<script src="__TMPL__/public/assets/js/base.js"></script>
+<script src="__TMPL__/public/assets/js/mui.min.js"></script>
+<script src="__TMPL__/public/assets/js/mui.picker.min.js"></script>
+<script src="__TMPL__/public/assets/js/city.data-3.js"></script>
+<script>
+</script>
+<script>
+    <notempty name='$school'>
+    var myschool = {$school};
+    school_s(myschool);
+    </notempty>
+    var excompanypicker = new mui.PopPicker();
+    excompanypicker.setData([{
+        value: 'SF',
+        text: '顺丰快递'
+    }, {
+        value: 'YTO',
+        text: '圆通快递'
+    }, {
+        value: 'ZTO',
+        text: '中通快递'
+    }, {
+        value: 'STO',
+        text: '申通快递'
+    }, {
+        value: 'YD',
+        text: '韵达快递'
+    }, {
+        value: 'HHTT',
+        text: '天天快递'
+    }, {
+        value: 'HTKY',
+        text: '百世快递'
+    }, {
+        value: 'YZPY',
+        text: '邮政快递包裹'
+    }, {
+        value: 'EMS',
+        text: 'EMS'
+    }, {
+        value: 'DBL',
+        text: '德邦快递'
+    }, {
+        value: 'ZJS',
+        text: '宅急送'
+    }, {
+        value: 'TNT',
+        text: 'TNT快递'
+    }]);
+    var excompany_word
+    $(".excompany").click(function () {
+        excompanypicker.show(function (e) {
+            console.log(e, '3333')
+            console.log(e[0].value);
+            console.log(e[0].text);
+            school_name = e[0].value
+            $(".excompany_word").text(e[0].text);
+            $("#logistic_name").val(e[0].value);
+            $('.excompany_word').css('color', '#333333');
+        });
+    })
+    var schoolpicker = new mui.PopPicker();
+    var classpicker = new mui.PopPicker();
+    function school_s(myschool){
+        (function($, doc) {
+            console.log(myschool);
+            $.init();
+            $.ready(function() {
+                schoolpicker.setData(myschool);
+            });
+        })(mui, document);
+    }
+    function grade_s(mygrade){
+        (function($, doc) {
+            $.init();
+            $.ready(function() {
+                classpicker.setData(mygrade);
+            });
+        })(mui, document);
+    }
+    var city_picker = new mui.PopPicker({
+        layer: 3
+    });
+    city_picker.setData(cityData3);
+    $(".city_word").on("tap", function() {
+        setTimeout(function() {
+            city_picker.show(function(items) {
+                $("#city_text").text((items[0] || {}).text + "," + (items[1] || {}).text + "," + (items[2] || {}).text); //该ID为接收城市ID字段
+                $('#city_text').css('color', '#333333');
+                $("#city_text").html((items[0] || {}).text + " " + (items[1] || {}).text + " " + (items[2] || {}).text);
+                var area = items[0].text+" "+items[1].text+" "+items[2].text;
+                $('.region').val(area);
+                $.get("{:url('orderpage/get_school')}",{'area':area,'user_id':{$data.uid}},function(res){
+                    $('.xuexiao_name').text('请选择学校');
+                    $('.xuexiao_name').removeAttr("style");
+                    $('.banji_name').text('请选择班级');
+                    $('.banji_name').removeAttr("style");
+                    if(res){
+                        myschool = JSON.parse(res);
+                        console.log(myschool);
+                        school_s(myschool);
+                    }else{
+                        school_s('');
+                        grade_s('');
+                    }
+
+                });
+            });
+        }, 200);
+    });
+    $(".city_word1").on("tap", function() {
+        setTimeout(function() {
+            city_picker.show(function(items) {
+                $("#city_text1").text((items[0] || {}).text + "," + (items[1] || {}).text + "," + (items[2] || {}).text); //该ID为接收城市ID字段
+                $('#city_text1').css('color', '#333333');
+                $("#city_text1").html((items[0] || {}).text + " " + (items[1] || {}).text + " " + (items[2] || {}).text);
+                var area = items[0].text+" "+items[1].text+" "+items[2].text;
+            });
+        }, 200);
+    });
+
+    var school_name
+    $(".log_three_select_school2").click(function() {
+        schoolpicker.show(function(e) {
+            console.log(e, '3333')
+            console.log(e[0].value);
+            console.log(e[0].text);
+            $('.school').text(e[0].text);
+            school_name = e[0].value
+            $(".xuexiao_name").text(e[0].text);
+            $('.xuexiao_name').css('color', '#333333');
+
+            $.post("{:url('Personalcenter/get_grade_class')}", {id: school_name}, function (data) {
+                if (data) {
+                    data = JSON.parse(data);
+                    $('.banji_name').text('请选择班级').css("color","#CCCCCC");
+                    grade_s(data);
+                }
+
+            });
+
+        });
+    })
+
+    $(".log_three_select_class2").click(function() {
+        if(school_name != undefined) {
+            classpicker.show(function(e) {
+                console.log(e)
+                console.log(e[0].value);
+                console.log(e[0].text);
+                $('.grade_class_text').text(e[0].text)
+                $('.grade_class').val(e[0].text)
+                $(".banji_name").text(e[0].text);
+                $('.banji_name').css('color', '#333333');
+            });
+        } else {
+            alert("请先选择学校")
+        }
+    })
+</script>
+<script>
+    function zZFun(e) {
+        window.event ? (window.event.cancelBubble = true) : e.stopPropagation();
+    }
+
+    //选择快递方式
+    $(".log_psong_select").click(function () {
+        $(".tx_mask_kuaidi").css({
+            display: "block"
+        });
+    });
+    $(".tx_mask_kuaidi .three_model_school_name").click(function () {
+        var index = $(this).index();
+        $(this).addClass('there_unActive').siblings().removeClass('there_unActive');
+        $('.log_ps_title').text($(this).text()).css("color", "#333");
+        $(".tx_mask_kuaidi").hide();
+        $('#logistic_name').val($(this).attr('data-name'))
+    });
+    $(function () {
+        $('body').on('click', '.send', function () {
+            var indent_id = $(this).attr('data-indent-id');
+            var is_courier = $(this).attr('data-is_courier');
+            console.log(indent_id);
+            console.log(is_courier);
+            if (is_courier == 1) {
+                //统一配送
+                $('.time').show();
+                $('.logistic').hide();
+            } else if (is_courier == 2) {
+                //快递
+                $('.time').hide();
+                $('.logistic').show();
+            }
+            $('.tx_maskone').show();
+            $('.confirm').attr('data-indent-id', indent_id);
+            $('.confirm').attr('data-is_courier', is_courier);
+        });
+        $('.confirm').click(function () {
+            var is_courier = $(this).attr('data-is_courier');
+            var indent_id = $(this).attr('data-indent-id');
+            var logistic_name = $('#logistic_name').val();
+            var logistic_code = $('#logistic_code').val();
+            var start_time = $('#start_time').val();
+            // var end_time = $('#end_time').val();
+            if (is_courier == 1) {
+                if (start_time == '') {
+                    alert('请填写配送时间');
+                    return false;
+                }
+                // else if (end_time == '') {
+                //     alert('请填写配送时间');
+                //     return false;
+                // }
+            } else if (is_courier == 2) {
+                if (logistic_name == '') {
+                    alert('请填写快递公司');
+                    return false;
+                } else if (logistic_code == '') {
+                    alert('请填写快递单号');
+                    return false;
+                }
+            } else if (is_courier == '') {
+                alert('未知错误');
+                return false;
+            }
+            $.ajax({
+                url: "{:url('send')}",
+                type: "GET",
+                data: {
+                    'indent_id': indent_id,
+                    'is_courier': is_courier,
+                    'logistic_name': logistic_name,
+                    'logistic_code': logistic_code,
+                    'start_time': start_time,
+                    // 'end_time': end_time
+                },
+                success: function (res) {
+                    console.log(res);
+                    if (res.code == 1) {
+                        $('.order_' + indent_id).remove();
+                        $(".tx_maskone").css({
+                            display: "none"
+                        });
+                        $(".tx_mask").css({
+                            display: "none"
+                        });
+                        $('.send').remove();
+                        var html = "<a href=\"{:url('logistics/index','',false,true)}/indent_id/" + indent_id + "\">\n" +
+                            "            <div class=\"log_seven_btn_contant\">\n" +
+                            "                查看物流\n" +
+                            "            </div>\n" +
+                            "        </a>";
+                        $('.log_seven_btn9').html(html)
+                        window.location.href = "{:url('get_all')}";
+                    }
+                    alert(res.msg)
+                }
+            })
+        })
+    })
+</script>
+<script>
+    var dtpicker = new mui.DtPicker({
+        type: "date", //设置日历初始视图模式
+        beginDate: new Date(), //设置开始日期
+        labels: ['年', '月', '日'], //设置默认标签区域提示语
+    })
+    //统一配送选择时间
+    $(".tongyi_start_time").click(function () {
+        dtpicker.show(function (e) {
+            console.log(e);
+            $('.tongyi_start_time').text(e.text);
+            $('#start_time').val(e.text);
+            $('.tongyi_start_time').css('color', '#333333');
+        });
+    })
+
+    function zZFun(e) {
+        window.event ? (window.event.cancelBubble = true) : e.stopPropagation();
+    }
+    $('.update').click(function(){
+        var indent_id = $(this).attr('data-indent-id');
+        var name = $('.name').val();
+        var phone = $('.phone').val();
+        var region = $('.region').text();
+        var region_detail = $('.region_detail').val();
+        var beiyong_address = $('.beiyong_address').val();
+
+        var school = $('.school').text();
+        var grade_class = $('.grade_class_text').text();
+        console.log(school);
+        console.log(grade_class)
+        $.ajax({
+            url:"{:url('updatePost')}",
+            type:"GET",
+            data:{'indent_id':indent_id,'name':name,'phone':phone,'region':region,'region_detail':region_detail,'school':school,'grade_class':grade_class,beiyong_address:beiyong_address},
+            success:function(res){
+                if(res.code == 1){
+                    alert('修改成功')
+                }
+            },
+            error:function(res){
+                alert('与服务器断开链接')
+            }
+        })
+    })
+</script>
+</body>
+
 </html>
\ No newline at end of file
diff --git a/public/themes/simpleboot3/portal/orderpage/order_salesman_ty.html b/public/themes/simpleboot3/portal/orderpage/order_salesman_ty.html
index adcab70..22aa21d 100755
--- a/public/themes/simpleboot3/portal/orderpage/order_salesman_ty.html
+++ b/public/themes/simpleboot3/portal/orderpage/order_salesman_ty.html
@@ -1,448 +1,462 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
-    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
-    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
-    <title>学考无忧-订单确认-选择地址信息</title>
-    <link rel="stylesheet" href="__TMPL__/public/assets/css/mui.min.css">
-    <link rel="stylesheet" href="__TMPL__/public/assets/css/mui.picker.min.css">
-    <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css" />
-    <link rel="stylesheet" href="__TMPL__/public/assets/css/log.css" />
-    <style type="text/css">
-        .mui-poppicker-header,
-        .mui-picker {
-            background-color: white;
-        }
-
-        .mui-btn-blue,
-        .mui-btn-primary,
-        input[type=submit] {
-            background-color: #FF7700;
-            border: 0;
-        }
-
-        .mui-pciker-list li.highlight {
-            color: #FF7700;
-        }
-    </style>
-</head>
-
-<body style="background-color: #F7F7F7;">
-<!--<div class="tx_mask_school">-->
-    <!--<div class="tx_maskCon_school">-->
-        <!--<div class="three_model_school">-->
-            <!--<div class="three_model_school_title">-->
-                <!--选择学校-班级-->
-            <!--</div>-->
-            <!--<div class="three_model_school_tab">-->
-                <!--<div class="three_model_school_left three_model_school_hover word_color" style="cursor: pointer;">-->
-                    <!--学校-->
-                <!--</div>-->
-                <!--<div class="three_model_school_left" style="cursor: pointer;">-->
-                    <!--班级-->
-                <!--</div>-->
-            <!--</div>-->
-            <!--<div>-->
-                <!--<div class="three_model_school_data there_university" style="display: block;cursor: pointer;">-->
-                    <!--&lt;!&ndash;<volist name="school" id="vo">-->
-                        <!--<div class="three_model_school_name  <eq name='key' value='0'>there_unActive</eq>" onclick="click_school({$vo.id})" style="cursor: pointer;">{$vo.school}</div>-->
-                    <!--</volist>&ndash;&gt;-->
-                <!--</div>-->
-                <!--<div class="three_model_school_data there_class banjiadd" style="cursor: pointer;">-->
-                    <!--&lt;!&ndash;<volist name="grade_class_show" id="vo">&ndash;&gt;-->
-                        <!--&lt;!&ndash;<div class="three_model_school_name banji">{$vo}</div>&ndash;&gt;-->
-                    <!--&lt;!&ndash;</volist>&ndash;&gt;-->
-                <!--</div>-->
-            <!--</div>-->
-        <!--</div>-->
-    <!--</div>-->
-<!--</div>-->
-<div class="log_top_co" style="background-color: white;">
-    <!-- 顶部 -->
-    <div class=" order_top log_top_co">
-        <a href="{:url('shopcart/shop_cart')}">
-            <img src="__TMPL__/public/assets/images/left.png" alt="" />
-        </a>
-        <p>订单确认</p>
-    </div>
-</div>
-<!-- 配送方式 -->
-<div class="log_four_top">
-    <div class="log_four_top_left">
-        配送方式
-    </div>
-    <div class="log_four_top_right">
-        <div class="log_four_top_right_one log_four_top_right_bg">统一配送</div>
-        <div class="log_four_top_right_two" onclick="go_courier()">
-            快递配送({$courier}元)
-        </div>
-    </div>
-</div>
-<!-- 地址信息 -->
-<div class="log_four_input">
-    <div class="log_four_input_title">
-        地址信息
-    </div>
-    <div class="log_four_input_one city_word">
-        <div class="log_four_input_one_left">
-            地区
-        </div>
-        <div class="log_four_input_one_center">
-            <div id="city_text">请选择省市区</div>
-        </div>
-        <div class="log_four_input_one_right">
-            <img src="__TMPL__/public/assets/images/29.png" alt="" />
-        </div>
-    </div>
-    <!--<div class="log_four_input_one log_banjis">-->
-        <!--<div class="log_four_input_one_left">-->
-            <!--学校-->
-        <!--</div>-->
-        <!--<div class="log_four_input_one_center">-->
-            <!--<div class="city_text school_grade_class" id="school_class">请选择学校和班级</div>-->
-        <!--</div>-->
-        <!--<div class="log_four_input_one_right">-->
-            <!--<img src="__TMPL__/public/assets/images/29.png" alt="" />-->
-        <!--</div>-->
-
-    <!--</div>-->
-    <div class="log_four_input_one log_banjis log_three_select_school2">
-        <div class="log_four_input_one_left">
-            学校
-        </div>
-        <div class="log_four_input_one_center ">
-            <div class="city_text xuexiao_name">请选择学校</div>
-        </div>
-        <div class="log_four_input_one_right">
-            <img src="__TMPL__/public/assets/images/29.png" alt="" />
-        </div>
-
-    </div>
-    <div class="log_four_input_one log_banjis log_three_select_class2">
-        <div class="log_four_input_one_left">
-            班级
-        </div>
-        <div class="log_four_input_one_center">
-            <div class="city_text banji_name">请选择班级</div>
-        </div>
-        <div class="log_four_input_one_right">
-            <img src="__TMPL__/public/assets/images/29.png" alt="" />
-        </div>
-    </div>
-
-    <div class="log_four_input_one">
-        <div class="log_four_input_one_left">
-            姓名
-        </div>
-        <div class="log_four_input_one_center">
-            <input type="text" placeholder="请输入姓名" id="name"/>
-        </div>
-        <div class="log_four_input_one_right">
-            <img src="__TMPL__/public/assets/images/29.png" alt="" />
-        </div>
-    </div>
-    <div class="log_four_input_one">
-        <div class="log_four_input_one_left">
-            手机号
-        </div>
-        <div class="log_four_input_one_center">
-            <input type="text" placeholder="输入手机号" maxlength="11" id="phone"/>
-        </div>
-        <div class="log_four_input_one_right" style="opacity: 0;">
-            <img src="__TMPL__/public/assets/images/29.png" alt="" />
-        </div>
-    </div>
-</div>
-<!-- 订单信息 -->
-<div class="log_four_order">
-
-    <div class="log_four_order_details">
-        <div class="log_four_input_title" style="padding-bottom: 0.34rem;">
-            订单信息
-        </div>
-        <div class="log_four_order_details_one">
-            <volist name="data" id="vo">
-                <div class="log_four_order_one">
-                    <div class="log_four_order_left">
-                        <img src="{:cmf_get_image_url($vo.thumbnail)}" alt="" />
-                    </div>
-                    <div class="log_four_order_center">
-                        <div class="log_four_order_center_one txt-cut" style="-webkit-line-clamp: 1">
-                            {$vo.book_name}
-                        </div>
-                        <div class="log_four_order_center_two">
-                            ×{$vo.number}
-                        </div>
-                    </div>
-                    <div class="log_four_order_right">
-                        <span>¥</span>{$vo.price0}.<span>{$vo.price1}</span>
-                    </div>
-                </div>
-            </volist>
-        </div>
-    </div>
-</div>
-<!-- 支付方式 -->
-<div class="log_four_pash">
-    <div class="log_four_pash_top">
-        <div class="log_four_pash_top_one">
-            支付方式
-        </div>
-        <div class="log_four_pash_top_two">
-            <img src="__TMPL__/public/assets/images/34.png" alt="" />
-        </div>
-    </div>
-    <div class="log_four_pash_bottom">
-        <div class="log_four_pash_top_one">
-            买家留言
-        </div>
-        <div class="log_four_pash_bottom_two">
-            <textarea cols="20" rows="3" placeholder="在此填写您的留言" id="liuyan"></textarea>
-        </div>
-    </div>
-</div>
-<!-- 底部按钮 -->
-<div class="log_three_list_fixed">
-    <div class="log_three_fixed_left">
-        <div class="log_four_zong_qian">合计金额:</div>
-        <div class="log_four_zong_shu"><span>¥</span>{$money.0}.<span>{$money.1}</span></div>
-    </div>
-    <div class="log_three_fixed_right" onclick="go_pay()">
-        立即支付
-    </div>
-</div>
-<script src="__TMPL__/public/assets/js/jquery.js"></script>
-<script src="__TMPL__/public/assets/js/base.js"></script>
-<script src="__TMPL__/public/assets/js/mui.min.js"></script>
-<script src="__TMPL__/public/assets/js/mui.picker.min.js"></script>
-<script src="__TMPL__/public/assets/js/city.data-3.js"></script>
-<script>
-    var schoolpicker = new mui.PopPicker();
-    var classpicker = new mui.PopPicker();
-    function school_s(myschool){
-        (function($, doc) {
-            console.log(myschool);
-            $.init();
-            $.ready(function() {
-                schoolpicker.setData(myschool);
-            });
-        })(mui, document);
-    }
-
-    function grade_s(mygrade){
-        (function($, doc) {
-            $.init();
-            $.ready(function() {
-                classpicker.setData(mygrade);
-            });
-        })(mui, document);
-    }
-
-    var school_name
-    $(".log_three_select_school2").click(function() {
-        schoolpicker.show(function(e) {
-            console.log(e, '3333')
-            console.log(e[0].value);
-            console.log(e[0].text);
-            school_name = e[0].value
-            $(".xuexiao_name").text(e[0].text);
-            $('.xuexiao_name').css('color', '#333333');
-
-            $.post("{:url('Personalcenter/get_grade_class')}", {id: school_name}, function (data) {
-                if (data) {
-                    data = JSON.parse(data);
-                    $('.banji_name').text('请选择班级').css("color","#CCCCCC");
-                    grade_s(data);
-                }
-
-            });
-
-        });
-    })
-    console.log(school_name)
-    $(".log_three_select_class2").click(function() {
-        if(school_name != undefined) {
-            classpicker.show(function(e) {
-                console.log(e)
-                console.log(e[0].value);
-                console.log(e[0].text);
-                $(".banji_name").text(e[0].text);
-                $('.banji_name').css('color', '#333333');
-            });
-        } else {
-            alert("请先选择学校")
-        }
-    })
-    /**
-     *快递配送
-     */
-    function go_courier(){
-        window.location.href = "{:url('Orderpage/order_salesman_kd')}?indet_id="+{$indent_id};
-    }
-
-    /**
-     *当点击学校时
-     */
-    function click_school(id){
-        $.post("{:url('Orderpage/get_grade_class')}",{id:id},function(data){
-            if(data){
-                grade = JSON.parse(data);
-                $('.banji').remove();
-                for(i=0;i<grade.length;i++){
-                    $('.banjiadd').append("<div class='three_model_school_name banji'>"+grade[i]+"</div>");
-                }
-            }else{
-                $('.banji').remove();
-            }
-        });
-    }
-
-    /**
-     *点击班级时
-     */
-    $(document).on('click','.banji',function(){
-        grade = $(this).text();
-        $('.school_grade_class').text($xuexiao+" "+grade);
-    })
-
-    /**
-     *点击去支付
-     */
-    function go_pay(){
-        indnet_id = "{$indent_id}";
-        $.post("{:url('Order/is_my_salesman')}",{indent_id:indnet_id},function(data){
-            if(data){
-                region = $('#city_text').text();
-//                school_class = $('#school_class').text();
-                school = $('.xuexiao_name').text();
-                grade = $('.banji_name').text();
-                name = $('#name').val();
-                phone = $('#phone').val();
-                if(region == '请选择省市区'){
-                    alert('地区不能为空');
-                }else if(school == '请选择学校'){
-                    alert('学校不能为空');
-                }else if(grade == '请选择班级'){
-                    alert('班级不能为空');
-                }else if(name == ''){
-                    alert('姓名不能为空');
-                }else if(phone == ''){
-                    alert('手机号不能为空');
-                }else{
-                    liuyan = $('#liuyan').val();
-                    indet_id = {$indent_id};
-                    money = {$money.0};
-                    $.post("{:url('Orderpage/salesman_ty_go_pay')}",{leave_word:liuyan,id:indet_id,money:money,region:region,school:school,name:name,phone:phone,grade:grade},function(data){
-                        if(data){
-                            window.location.href = "{:url('Pay/index',array('id'=>$indent_id))}";
-                        }else{
-                            alert('更新订单失败');
-                        }
-                    });
-                }
-            }else{
-                alert('不再此区域销售');
-            }
-        });
-
-
-    }
-
-    $(".log_four_top_right>div").click(function() {
-        $(this)
-            .addClass("log_four_top_right_bg")
-            .css({
-                border: "none"
-            })
-            .siblings()
-            .removeClass("log_four_top_right_bg");
-    });
-
-
-
-    //mui 地址
-    var city_picker = new mui.PopPicker({
-        layer: 3
-    });
-    city_picker.setData(cityData3);
-    $(".city_word").on("tap", function() {
-        setTimeout(function() {
-            city_picker.show(function(items) {
-                $("#city_text").text((items[0] || {}).text + "," + (items[1] || {}).text + "," + (items[2] || {}).text); //该ID为接收城市ID字段
-                $('#city_text').css('color', '#333333');
-                $("#city_text").html((items[0] || {}).text + " " + (items[1] || {}).text + " " + (items[2] || {}).text);
-                var area = items[0].text+" "+items[1].text+" "+items[2].text;
-
-               $.get("{:url('get_school')}",{'area':area},function(res){
-                   $('.xuexiao_name').text('请选择学校');
-                   $('.xuexiao_name').removeAttr("style");
-                   $('.banji_name').text('请选择班级');
-                   $('.banji_name').removeAttr("style");
-                   if(res){
-                       myschool = JSON.parse(res);
-                       console.log(myschool);
-                       school_s(myschool);
-                   }else{
-                       school_s('');
-                       grade_s('');
-                   }
-
-               });
-            });
-        }, 200);
-    });
-
-    //学校/班级弹窗
-    $(".log_banjis").click(function() {
-        $(".tx_mask_school").css({
-            display: "block"
-        });
-    });
-    //tab弹框
-    $(".three_model_school_tab>div").click(function() {
-        var tabindex = $(this).index();
-        $(this).addClass("three_model_school_hover").addClass("word_color").siblings().removeClass("three_model_school_hover").removeClass("word_color");
-        $('.three_model_school_data').eq(tabindex).css('display', 'block').siblings().css('display', 'none');
-    });
-
-    // tab 大学
-    var $xuexiao
-    $("body").on('click',".there_university div",function() {
-        var index = $(this).index();
-        $(this).addClass("there_unActive").siblings().removeClass("there_unActive");
-        if($(this).hasClass("there_unActive")) {
-            console.log($(this).text());
-            $xuexiao = $(this).text()
-            $(".there_university").hide();
-            $(".there_class").show();
-            $('.three_model_school_left').eq(0).removeClass('word_color').removeClass('three_model_school_hover');
-            $('.three_model_school_left').eq(1).addClass('word_color').addClass('three_model_school_hover');
-        }
-    });
-    $("body").on("click",'.there_class div',function() {
-        console.log($xuexiao)
-        var index2 = $(this).index();
-        $(this).addClass("there_unActive").siblings().removeClass("there_unActive");
-        if($xuexiao == undefined) {
-            alert('请选择学校')
-        } else if($(this).hasClass("there_unActive")) {
-            var banji = $(this).text();
-            $('.city_text').text($xuexiao + ' ' + "—" + ' ' + banji)
-            $('.city_text').css('color', '#333333');
-            $(".tx_mask_school").hide();
-        }
-    })
-    // 关闭弹窗
-    $(document).mouseup(function(e) {
-        var _con = $('.tx_maskCon_school');
-        if(!_con.is(e.target) && _con.has(e.target).length === 0) {
-
-            $('.tx_mask_school').hide()
-        }
-    })
-</script>
-</body>
-
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
+    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
+    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
+    <title>学考无忧-订单确认-选择地址信息</title>
+    <link rel="stylesheet" href="__TMPL__/public/assets/css/mui.min.css">
+    <link rel="stylesheet" href="__TMPL__/public/assets/css/mui.picker.min.css">
+    <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css" />
+    <link rel="stylesheet" href="__TMPL__/public/assets/css/log.css" />
+    <style type="text/css">
+        .mui-poppicker-header,
+        .mui-picker {
+            background-color: white;
+        }
+
+        .mui-btn-blue,
+        .mui-btn-primary,
+        input[type=submit] {
+            background-color: #FF7700;
+            border: 0;
+        }
+
+        .mui-pciker-list li.highlight {
+            color: #FF7700;
+        }
+    </style>
+</head>
+
+<body style="background-color: #F7F7F7;">
+<!--<div class="tx_mask_school">-->
+    <!--<div class="tx_maskCon_school">-->
+        <!--<div class="three_model_school">-->
+            <!--<div class="three_model_school_title">-->
+                <!--选择学校-班级-->
+            <!--</div>-->
+            <!--<div class="three_model_school_tab">-->
+                <!--<div class="three_model_school_left three_model_school_hover word_color" style="cursor: pointer;">-->
+                    <!--学校-->
+                <!--</div>-->
+                <!--<div class="three_model_school_left" style="cursor: pointer;">-->
+                    <!--班级-->
+                <!--</div>-->
+            <!--</div>-->
+            <!--<div>-->
+                <!--<div class="three_model_school_data there_university" style="display: block;cursor: pointer;">-->
+                    <!--&lt;!&ndash;<volist name="school" id="vo">-->
+                        <!--<div class="three_model_school_name  <eq name='key' value='0'>there_unActive</eq>" onclick="click_school({$vo.id})" style="cursor: pointer;">{$vo.school}</div>-->
+                    <!--</volist>&ndash;&gt;-->
+                <!--</div>-->
+                <!--<div class="three_model_school_data there_class banjiadd" style="cursor: pointer;">-->
+                    <!--&lt;!&ndash;<volist name="grade_class_show" id="vo">&ndash;&gt;-->
+                        <!--&lt;!&ndash;<div class="three_model_school_name banji">{$vo}</div>&ndash;&gt;-->
+                    <!--&lt;!&ndash;</volist>&ndash;&gt;-->
+                <!--</div>-->
+            <!--</div>-->
+        <!--</div>-->
+    <!--</div>-->
+<!--</div>-->
+<div class="log_top_co" style="background-color: white;">
+    <!-- 顶部 -->
+    <div class=" order_top log_top_co">
+        <a href="{:url('shopcart/shop_cart')}">
+            <img src="__TMPL__/public/assets/images/left.png" alt="" />
+        </a>
+        <p>订单确认</p>
+    </div>
+</div>
+<!-- 配送方式 -->
+<div class="log_four_top">
+    <div class="log_four_top_left">
+        配送方式
+    </div>
+    <div class="log_four_top_right">
+        <div class="log_four_top_right_one log_four_top_right_bg">统一配送</div>
+        <div class="log_four_top_right_two" onclick="go_courier()">
+            快递配送({$courier}元)
+        </div>
+    </div>
+</div>
+<!-- 地址信息 -->
+<div class="log_four_input">
+    <div class="log_four_input_title">
+        地址信息
+    </div>
+    <div class="log_four_input_one city_word">
+        <div class="log_four_input_one_left">
+            地区
+        </div>
+        <div class="log_four_input_one_center">
+            <div id="city_text">请选择省市区</div>
+        </div>
+        <div class="log_four_input_one_right">
+            <img src="__TMPL__/public/assets/images/29.png" alt="" />
+        </div>
+    </div>
+    <!--<div class="log_four_input_one log_banjis">-->
+        <!--<div class="log_four_input_one_left">-->
+            <!--学校-->
+        <!--</div>-->
+        <!--<div class="log_four_input_one_center">-->
+            <!--<div class="city_text school_grade_class" id="school_class">请选择学校和班级</div>-->
+        <!--</div>-->
+        <!--<div class="log_four_input_one_right">-->
+            <!--<img src="__TMPL__/public/assets/images/29.png" alt="" />-->
+        <!--</div>-->
+
+    <!--</div>-->
+    <div class="log_four_input_one log_banjis log_three_select_school2">
+        <div class="log_four_input_one_left">
+            学校
+        </div>
+        <div class="log_four_input_one_center ">
+            <div class="city_text xuexiao_name">请选择学校</div>
+        </div>
+        <div class="log_four_input_one_right">
+            <img src="__TMPL__/public/assets/images/29.png" alt="" />
+        </div>
+
+    </div>
+    <div class="log_four_input_one log_banjis log_three_select_class2">
+        <div class="log_four_input_one_left">
+            班级
+        </div>
+        <div class="log_four_input_one_center">
+            <div class="city_text banji_name">请选择班级</div>
+        </div>
+        <div class="log_four_input_one_right">
+            <img src="__TMPL__/public/assets/images/29.png" alt="" />
+        </div>
+    </div>
+
+    <div class="log_four_input_one">
+        <div class="log_four_input_one_left">
+            姓名
+        </div>
+        <div class="log_four_input_one_center">
+            <input type="text" placeholder="请输入姓名" id="name"/>
+        </div>
+        <div class="log_four_input_one_right">
+            <img src="__TMPL__/public/assets/images/29.png" alt="" />
+        </div>
+    </div>
+    <div class="log_four_input_one">
+        <div class="log_four_input_one_left">
+            手机号
+        </div>
+        <div class="log_four_input_one_center">
+            <input type="text" placeholder="输入手机号" maxlength="11" id="phone"/>
+        </div>
+        <div class="log_four_input_one_right" style="opacity: 0;">
+            <img src="__TMPL__/public/assets/images/29.png" alt="" />
+        </div>
+    </div>
+    <div class="log_four_input_one">
+        <div class="log_four_input_one_left">
+            备用地址
+        </div>
+        <div class="log_four_input_one_center">
+            <input type="text" placeholder="输入备用地址" maxlength="11" id="beiyong_address"/>
+        </div>
+        <div class="log_four_input_one_right" style="opacity: 0;">
+            <img src="__TMPL__/public/assets/images/29.png" alt="" />
+        </div>
+    </div>
+</div>
+<!-- 订单信息 -->
+<div class="log_four_order">
+
+    <div class="log_four_order_details">
+        <div class="log_four_input_title" style="padding-bottom: 0.34rem;">
+            订单信息
+        </div>
+        <div class="log_four_order_details_one">
+            <volist name="data" id="vo">
+                <div class="log_four_order_one">
+                    <div class="log_four_order_left">
+                        <img src="{:cmf_get_image_url($vo.thumbnail)}" alt="" />
+                    </div>
+                    <div class="log_four_order_center">
+                        <div class="log_four_order_center_one txt-cut" style="-webkit-line-clamp: 1">
+                            {$vo.book_name}
+                        </div>
+                        <div class="log_four_order_center_two">
+                            ×{$vo.number}
+                        </div>
+                    </div>
+                    <div class="log_four_order_right">
+                        <span>¥</span>{$vo.price0}.<span>{$vo.price1}</span>
+                    </div>
+                </div>
+            </volist>
+        </div>
+    </div>
+</div>
+<!-- 支付方式 -->
+<div class="log_four_pash">
+    <div class="log_four_pash_top">
+        <div class="log_four_pash_top_one">
+            支付方式
+        </div>
+        <div class="log_four_pash_top_two">
+            <img src="__TMPL__/public/assets/images/34.png" alt="" />
+        </div>
+    </div>
+    <div class="log_four_pash_bottom">
+        <div class="log_four_pash_top_one">
+            买家留言
+        </div>
+        <div class="log_four_pash_bottom_two">
+            <textarea cols="20" rows="3" placeholder="在此填写您的留言" id="liuyan"></textarea>
+        </div>
+    </div>
+</div>
+<!-- 底部按钮 -->
+<div class="log_three_list_fixed">
+    <div class="log_three_fixed_left">
+        <div class="log_four_zong_qian">合计金额:</div>
+        <div class="log_four_zong_shu"><span>¥</span>{$money.0}.<span>{$money.1}</span></div>
+    </div>
+    <div class="log_three_fixed_right" onclick="go_pay()">
+        立即支付
+    </div>
+</div>
+<script src="__TMPL__/public/assets/js/jquery.js"></script>
+<script src="__TMPL__/public/assets/js/base.js"></script>
+<script src="__TMPL__/public/assets/js/mui.min.js"></script>
+<script src="__TMPL__/public/assets/js/mui.picker.min.js"></script>
+<script src="__TMPL__/public/assets/js/city.data-3.js"></script>
+<script>
+    var schoolpicker = new mui.PopPicker();
+    var classpicker = new mui.PopPicker();
+    function school_s(myschool){
+        (function($, doc) {
+            console.log(myschool);
+            $.init();
+            $.ready(function() {
+                schoolpicker.setData(myschool);
+            });
+        })(mui, document);
+    }
+
+    function grade_s(mygrade){
+        (function($, doc) {
+            $.init();
+            $.ready(function() {
+                classpicker.setData(mygrade);
+            });
+        })(mui, document);
+    }
+
+    var school_name
+    $(".log_three_select_school2").click(function() {
+        schoolpicker.show(function(e) {
+            console.log(e, '3333')
+            console.log(e[0].value);
+            console.log(e[0].text);
+            school_name = e[0].value
+            $(".xuexiao_name").text(e[0].text);
+            $('.xuexiao_name').css('color', '#333333');
+
+            $.post("{:url('Personalcenter/get_grade_class')}", {id: school_name}, function (data) {
+                if (data) {
+                    data = JSON.parse(data);
+                    $('.banji_name').text('请选择班级').css("color","#CCCCCC");
+                    grade_s(data);
+                }
+
+            });
+
+        });
+    })
+    console.log(school_name)
+    $(".log_three_select_class2").click(function() {
+        if(school_name != undefined) {
+            classpicker.show(function(e) {
+                console.log(e)
+                console.log(e[0].value);
+                console.log(e[0].text);
+                $(".banji_name").text(e[0].text);
+                $('.banji_name').css('color', '#333333');
+            });
+        } else {
+            alert("请先选择学校")
+        }
+    })
+    /**
+     *快递配送
+     */
+    function go_courier(){
+        window.location.href = "{:url('Orderpage/order_salesman_kd')}?indet_id="+{$indent_id};
+    }
+
+    /**
+     *当点击学校时
+     */
+    function click_school(id){
+        $.post("{:url('Orderpage/get_grade_class')}",{id:id},function(data){
+            if(data){
+                grade = JSON.parse(data);
+                $('.banji').remove();
+                for(i=0;i<grade.length;i++){
+                    $('.banjiadd').append("<div class='three_model_school_name banji'>"+grade[i]+"</div>");
+                }
+            }else{
+                $('.banji').remove();
+            }
+        });
+    }
+
+    /**
+     *点击班级时
+     */
+    $(document).on('click','.banji',function(){
+        grade = $(this).text();
+        $('.school_grade_class').text($xuexiao+" "+grade);
+    })
+
+    /**
+     *点击去支付
+     */
+    function go_pay(){
+        indnet_id = "{$indent_id}";
+        $.post("{:url('Order/is_my_salesman')}",{indent_id:indnet_id},function(data){
+            if(data){
+                region = $('#city_text').text();
+//                school_class = $('#school_class').text();
+                school = $('.xuexiao_name').text();
+                grade = $('.banji_name').text();
+                name = $('#name').val();
+                phone = $('#phone').val();
+                var beiyong_address = $('#beiyong_address').val();
+                if(region == '请选择省市区'){
+                    alert('地区不能为空');
+                }else if(school == '请选择学校'){
+                    alert('学校不能为空');
+                }else if(grade == '请选择班级'){
+                    alert('班级不能为空');
+                }else if(name == ''){
+                    alert('姓名不能为空');
+                }else if(phone == ''){
+                    alert('手机号不能为空');
+                }else if(beiyong_address == ''){
+                    alert('备用地址不能为空');
+                }else{
+                    liuyan = $('#liuyan').val();
+                    indet_id = {$indent_id};
+                    money = {$money.0};
+                    $.post("{:url('Orderpage/salesman_ty_go_pay')}",{leave_word:liuyan,id:indet_id,money:money,region:region,school:school,name:name,phone:phone,grade:grade,beiyong_address:beiyong_address},function(data){
+                        if(data){
+                            window.location.href = "{:url('Pay/index',array('id'=>$indent_id))}";
+                        }else{
+                            alert('更新订单失败');
+                        }
+                    });
+                }
+            }else{
+                alert('不再此区域销售');
+            }
+        });
+
+
+    }
+
+    $(".log_four_top_right>div").click(function() {
+        $(this)
+            .addClass("log_four_top_right_bg")
+            .css({
+                border: "none"
+            })
+            .siblings()
+            .removeClass("log_four_top_right_bg");
+    });
+
+
+
+    //mui 地址
+    var city_picker = new mui.PopPicker({
+        layer: 3
+    });
+    city_picker.setData(cityData3);
+    $(".city_word").on("tap", function() {
+        setTimeout(function() {
+            city_picker.show(function(items) {
+                $("#city_text").text((items[0] || {}).text + "," + (items[1] || {}).text + "," + (items[2] || {}).text); //该ID为接收城市ID字段
+                $('#city_text').css('color', '#333333');
+                $("#city_text").html((items[0] || {}).text + " " + (items[1] || {}).text + " " + (items[2] || {}).text);
+                var area = items[0].text+" "+items[1].text+" "+items[2].text;
+
+               $.get("{:url('get_school')}",{'area':area},function(res){
+                   $('.xuexiao_name').text('请选择学校');
+                   $('.xuexiao_name').removeAttr("style");
+                   $('.banji_name').text('请选择班级');
+                   $('.banji_name').removeAttr("style");
+                   if(res){
+                       myschool = JSON.parse(res);
+                       console.log(myschool);
+                       school_s(myschool);
+                   }else{
+                       school_s('');
+                       grade_s('');
+                   }
+
+               });
+            });
+        }, 200);
+    });
+
+    //学校/班级弹窗
+    $(".log_banjis").click(function() {
+        $(".tx_mask_school").css({
+            display: "block"
+        });
+    });
+    //tab弹框
+    $(".three_model_school_tab>div").click(function() {
+        var tabindex = $(this).index();
+        $(this).addClass("three_model_school_hover").addClass("word_color").siblings().removeClass("three_model_school_hover").removeClass("word_color");
+        $('.three_model_school_data').eq(tabindex).css('display', 'block').siblings().css('display', 'none');
+    });
+
+    // tab 大学
+    var $xuexiao
+    $("body").on('click',".there_university div",function() {
+        var index = $(this).index();
+        $(this).addClass("there_unActive").siblings().removeClass("there_unActive");
+        if($(this).hasClass("there_unActive")) {
+            console.log($(this).text());
+            $xuexiao = $(this).text()
+            $(".there_university").hide();
+            $(".there_class").show();
+            $('.three_model_school_left').eq(0).removeClass('word_color').removeClass('three_model_school_hover');
+            $('.three_model_school_left').eq(1).addClass('word_color').addClass('three_model_school_hover');
+        }
+    });
+    $("body").on("click",'.there_class div',function() {
+        console.log($xuexiao)
+        var index2 = $(this).index();
+        $(this).addClass("there_unActive").siblings().removeClass("there_unActive");
+        if($xuexiao == undefined) {
+            alert('请选择学校')
+        } else if($(this).hasClass("there_unActive")) {
+            var banji = $(this).text();
+            $('.city_text').text($xuexiao + ' ' + "—" + ' ' + banji)
+            $('.city_text').css('color', '#333333');
+            $(".tx_mask_school").hide();
+        }
+    })
+    // 关闭弹窗
+    $(document).mouseup(function(e) {
+        var _con = $('.tx_maskCon_school');
+        if(!_con.is(e.target) && _con.has(e.target).length === 0) {
+
+            $('.tx_mask_school').hide()
+        }
+    })
+</script>
+</body>
+
 </html>
\ No newline at end of file
--
libgit2 0.24.0