Browse Source

平台相关

zhangxiaobin 1 year ago
parent
commit
34f94054bd
47 changed files with 1880 additions and 36 deletions
  1. 37 0
      application/admin/controller/PlatformSelect.php
  2. 73 0
      application/admin/controller/PreOrder.php
  3. 37 0
      application/admin/controller/Servicetype.php
  4. 64 0
      application/admin/controller/UserCar.php
  5. 1 0
      application/admin/lang/zh-cn/platform_article.php
  6. 14 0
      application/admin/lang/zh-cn/platform_select.php
  7. 26 0
      application/admin/lang/zh-cn/pre_order.php
  8. 9 0
      application/admin/lang/zh-cn/servicetype.php
  9. 11 0
      application/admin/lang/zh-cn/user_car.php
  10. 0 14
      application/admin/model/PlatformArticle.php
  11. 57 0
      application/admin/model/PlatformSelect.php
  12. 86 0
      application/admin/model/PreOrder.php
  13. 48 0
      application/admin/model/Servicetype.php
  14. 40 0
      application/admin/model/UserCar.php
  15. 27 0
      application/admin/validate/PlatformSelect.php
  16. 27 0
      application/admin/validate/PreOrder.php
  17. 27 0
      application/admin/validate/Servicetype.php
  18. 27 0
      application/admin/validate/UserCar.php
  19. 13 5
      application/admin/view/platform_article/add.html
  20. 13 5
      application/admin/view/platform_article/edit.html
  21. 54 0
      application/admin/view/platform_select/add.html
  22. 54 0
      application/admin/view/platform_select/edit.html
  23. 45 0
      application/admin/view/platform_select/index.html
  24. 70 0
      application/admin/view/pre_order/add.html
  25. 94 0
      application/admin/view/pre_order/edit.html
  26. 35 0
      application/admin/view/pre_order/index.html
  27. 22 0
      application/admin/view/servicetype/add.html
  28. 22 0
      application/admin/view/servicetype/edit.html
  29. 35 0
      application/admin/view/servicetype/index.html
  30. 28 0
      application/admin/view/user_car/add.html
  31. 28 0
      application/admin/view/user_car/edit.html
  32. 35 0
      application/admin/view/user_car/index.html
  33. 1 1
      application/api/controller/Banner.php
  34. 58 8
      application/api/controller/PlatformArticle.php
  35. 63 0
      application/api/controller/PlatformSelect.php
  36. 67 0
      application/api/controller/PreOrder.php
  37. 35 0
      application/api/controller/Servicetype.php
  38. 123 0
      application/api/controller/UserCar.php
  39. 41 0
      application/common.php
  40. 45 0
      application/common/validate/PreOrder.php
  41. 30 0
      application/common/validate/UserCar.php
  42. 2 0
      application/extra/site.php
  43. 9 3
      public/assets/js/backend/platform_article.js
  44. 55 0
      public/assets/js/backend/platform_select.js
  45. 82 0
      public/assets/js/backend/pre_order.js
  46. 54 0
      public/assets/js/backend/servicetype.js
  47. 56 0
      public/assets/js/backend/user_car.js

+ 37 - 0
application/admin/controller/PlatformSelect.php

@@ -0,0 +1,37 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\common\controller\Backend;
+
+/**
+ * 平台甄选
+ *
+ * @icon fa fa-circle-o
+ */
+class PlatformSelect extends Backend
+{
+
+    /**
+     * PlatformSelect模型对象
+     * @var \app\admin\model\PlatformSelect
+     */
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new \app\admin\model\PlatformSelect;
+        $this->view->assign("statusList", $this->model->getStatusList());
+    }
+
+
+
+    /**
+     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     */
+
+
+}

+ 73 - 0
application/admin/controller/PreOrder.php

@@ -0,0 +1,73 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\common\controller\Backend;
+
+/**
+ * 预约单
+ *
+ * @icon fa fa-circle-o
+ */
+class PreOrder extends Backend
+{
+
+    /**
+     * PreOrder模型对象
+     * @var \app\admin\model\PreOrder
+     */
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new \app\admin\model\PreOrder;
+        $this->view->assign("preOrderStatusList", $this->model->getPreOrderStatusList());
+    }
+
+
+
+    /**
+     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     */
+
+    /**
+     * 查看
+     */
+    public function index()
+    {
+        //设置过滤方法
+        $this->request->filter(['strip_tags', 'trim']);
+        if ($this->request->isAjax()) {
+            //如果发送的来源是Selectpage,则转发到Selectpage
+            if ($this->request->request('keyField')) {
+                return $this->selectpage();
+            }
+            list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+            $p = 'pre_order';
+            $u = 'user';
+            $c = 'company';
+            $s = 'servicetype';
+            $uNickname = $u.'.nickname';
+            $cName = $c.'.name';
+            $sTitle = $s.'.title';
+            $field = $p.'.id,'.$p.'.company_id,'.$p.'.user_id,'.$p.'.name,'.$p.'.mobile,'.$p.'.remark,'.$p.'.car_id,'.
+            $p.'.car_number,'.$p.'.servicetype_id,'.$p.'.pre_time,'.$p.'.order_time,'.$p.'.cancel_time,'.$p.'.cancel_reason,'.
+            $p.'.pre_order_status,'.$p.'.createtime,'.$p.'.updatetime,'.$uNickname.' as `'.$uNickname.'`,'.
+            $cName.' as `'.$cName.'`,'.$sTitle.' as `'.$sTitle.'`';
+            $list = $this->model->alias($p)->field($field)
+                ->join($u,$u.'.id = '.$p.'.user_id','LEFT')
+                ->join($c,$c.'.id = '.$p.'.company_id','LEFT')
+                ->join($s,$s.'.id = '.$p.'.servicetype_id','LEFT')
+                ->where($where)
+                ->order($sort, $order)
+                ->paginate($limit);
+            $result = array("total" => $list->total(), "rows" => $list->items());
+
+            return json($result);
+        }
+        return $this->view->fetch();
+    }
+}

+ 37 - 0
application/admin/controller/Servicetype.php

@@ -0,0 +1,37 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\common\controller\Backend;
+
+/**
+ * 保养服务类型
+ *
+ * @icon fa fa-circle-o
+ */
+class Servicetype extends Backend
+{
+
+    /**
+     * Servicetype模型对象
+     * @var \app\admin\model\Servicetype
+     */
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new \app\admin\model\Servicetype;
+
+    }
+
+
+
+    /**
+     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     */
+
+
+}

+ 64 - 0
application/admin/controller/UserCar.php

@@ -0,0 +1,64 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\common\controller\Backend;
+
+/**
+ * 用户车辆
+ *
+ * @icon fa fa-circle-o
+ */
+class UserCar extends Backend
+{
+
+    /**
+     * UserCar模型对象
+     * @var \app\admin\model\UserCar
+     */
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new \app\admin\model\UserCar;
+
+    }
+
+
+
+    /**
+     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     */
+
+    /**
+     * 查看
+     */
+    public function index()
+    {
+        //设置过滤方法
+        $this->request->filter(['strip_tags', 'trim']);
+        if ($this->request->isAjax()) {
+            //如果发送的来源是Selectpage,则转发到Selectpage
+            if ($this->request->request('keyField')) {
+                return $this->selectpage();
+            }
+            list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+            $uc = 'user_car';
+            $u = 'user';
+            $uNickname = $u.'.nickname';
+            $field = $uc.'.id,user_id,car_number,car_model,'.$uc.'.createtime,'.$uc.'.updatetime,'.$uNickname.' as `'.$uNickname.'`';
+            $list = $this->model->alias($uc)->field($field)
+                ->join($u,$u.'.id = '.$uc.'.user_id','LEFT')
+                ->where($where)
+                ->order($sort, $order)
+                ->paginate($limit);
+            $result = array("total" => $list->total(), "rows" => $list->items());
+
+            return json($result);
+        }
+        return $this->view->fetch();
+    }
+}

+ 1 - 0
application/admin/lang/zh-cn/platform_article.php

@@ -6,6 +6,7 @@ return [
     'Title'      => '标题',
     'Desc'       => '描述',
     'Images'     => '图片',
+    'Video'      => '视频',
     'Content'    => '内容',
     'Weigh'      => '权重排序',
     'Status'     => '是否显示',

+ 14 - 0
application/admin/lang/zh-cn/platform_select.php

@@ -0,0 +1,14 @@
+<?php
+
+return [
+    'Id'         => '主键ID',
+    'Title'      => '标题',
+    'Image'      => '图片',
+    'Content'    => '内容',
+    'Weigh'      => '权重排序',
+    'Status'     => '是否显示',
+    'Status 0'   => '隐藏',
+    'Status 1'   => '显示',
+    'Createtime' => '创建时间',
+    'Updatetime' => '更新时间'
+];

+ 26 - 0
application/admin/lang/zh-cn/pre_order.php

@@ -0,0 +1,26 @@
+<?php
+
+return [
+    'Id'                 => '主键ID',
+    'Company_id'         => '门店ID',
+    'Company_name'       => '门店名称',
+    'User_id'            => '用户ID',
+    'User_nickname'      => '昵称',
+    'Name'               => '联系人',
+    'Mobile'             => '手机号',
+    'Remark'             => '预约备注',
+    'Car_id'             => '车辆ID',
+    'Car_number'         => '车牌号',
+    'Servicetype_id'     => '服务类型ID',
+    'Servicetype_title'  => '服务类型',
+    'Pre_time'           => '预约时间',
+    'Order_time'         => '开单时间',
+    'Cancel_time'        => '取消时间',
+    'Cancel_reason'      => '取消原因',
+    'Pre_order_status'   => '预约状态',
+    'Pre_order_status 0' => '已取消',
+    'Pre_order_status 1' => '待处理',
+    'Pre_order_status 2' => '已开单',
+    'Createtime'         => '创建时间',
+    'Updatetime'         => '更新时间'
+];

+ 9 - 0
application/admin/lang/zh-cn/servicetype.php

@@ -0,0 +1,9 @@
+<?php
+
+return [
+    'Id'         => '主键ID',
+    'Title'      => '标题',
+    'Weigh'      => '权重排序',
+    'Createtime' => '创建时间',
+    'Updatetime' => '更新时间'
+];

+ 11 - 0
application/admin/lang/zh-cn/user_car.php

@@ -0,0 +1,11 @@
+<?php
+
+return [
+    'Id'         => '主键ID',
+    'User_id'    => '用户ID',
+    'User_nickname' => '昵称',
+    'Car_number' => '车牌号',
+    'Car_model'  => '车辆型号',
+    'Createtime' => '创建时间',
+    'Updatetime' => '更新时间'
+];

+ 0 - 14
application/admin/model/PlatformArticle.php

@@ -28,22 +28,11 @@ class PlatformArticle extends Model
         'status_text'
     ];
     
-
-    protected static function init()
-    {
-        self::afterInsert(function ($row) {
-            $pk = $row->getPk();
-            $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
-        });
-    }
-
-    
     public function getStatusList()
     {
         return ['0' => __('Status 0'), '1' => __('Status 1')];
     }
 
-
     public function getStatusTextAttr($value, $data)
     {
         $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
@@ -51,7 +40,4 @@ class PlatformArticle extends Model
         return isset($list[$value]) ? $list[$value] : '';
     }
 
-
-
-
 }

+ 57 - 0
application/admin/model/PlatformSelect.php

@@ -0,0 +1,57 @@
+<?php
+
+namespace app\admin\model;
+
+use think\Model;
+
+
+class PlatformSelect extends Model
+{
+
+    
+
+    
+
+    // 表名
+    protected $name = 'platform_select';
+    
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = 'integer';
+
+    // 定义时间戳字段名
+    protected $createTime = 'createtime';
+    protected $updateTime = 'updatetime';
+    protected $deleteTime = false;
+
+    // 追加属性
+    protected $append = [
+        'status_text'
+    ];
+    
+
+    protected static function init()
+    {
+        self::afterInsert(function ($row) {
+            $pk = $row->getPk();
+            $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+        });
+    }
+
+    
+    public function getStatusList()
+    {
+        return ['0' => __('Status 0'), '1' => __('Status 1')];
+    }
+
+
+    public function getStatusTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+        $list = $this->getStatusList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
+
+
+
+
+}

+ 86 - 0
application/admin/model/PreOrder.php

@@ -0,0 +1,86 @@
+<?php
+
+namespace app\admin\model;
+
+use think\Model;
+
+
+class PreOrder extends Model
+{
+
+    
+
+    
+
+    // 表名
+    protected $name = 'pre_order';
+    
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = 'integer';
+
+    // 定义时间戳字段名
+    protected $createTime = 'createtime';
+    protected $updateTime = 'updatetime';
+    protected $deleteTime = false;
+
+    // 追加属性
+    protected $append = [
+        'pre_time_text',
+        'order_time_text',
+        'cancel_time_text',
+        'pre_order_status_text'
+    ];
+    
+
+    
+    public function getPreOrderStatusList()
+    {
+        return ['0' => __('Pre_order_status 0'), '1' => __('Pre_order_status 1'), '2' => __('Pre_order_status 2')];
+    }
+
+
+    public function getPreTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['pre_time']) ? $data['pre_time'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+
+    public function getOrderTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['order_time']) ? $data['order_time'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+
+    public function getCancelTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['cancel_time']) ? $data['cancel_time'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+
+    public function getPreOrderStatusTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['pre_order_status']) ? $data['pre_order_status'] : '');
+        $list = $this->getPreOrderStatusList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
+
+    protected function setPreTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+    protected function setOrderTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+    protected function setCancelTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+
+}

+ 48 - 0
application/admin/model/Servicetype.php

@@ -0,0 +1,48 @@
+<?php
+
+namespace app\admin\model;
+
+use think\Model;
+
+
+class Servicetype extends Model
+{
+
+    
+
+    
+
+    // 表名
+    protected $name = 'servicetype';
+    
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = 'integer';
+
+    // 定义时间戳字段名
+    protected $createTime = 'createtime';
+    protected $updateTime = 'updatetime';
+    protected $deleteTime = false;
+
+    // 追加属性
+    protected $append = [
+
+    ];
+    
+
+    protected static function init()
+    {
+        self::afterInsert(function ($row) {
+            $pk = $row->getPk();
+            $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
+        });
+    }
+
+    
+
+
+
+
+
+
+
+}

+ 40 - 0
application/admin/model/UserCar.php

@@ -0,0 +1,40 @@
+<?php
+
+namespace app\admin\model;
+
+use think\Model;
+
+
+class UserCar extends Model
+{
+
+    
+
+    
+
+    // 表名
+    protected $name = 'user_car';
+    
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = 'integer';
+
+    // 定义时间戳字段名
+    protected $createTime = 'createtime';
+    protected $updateTime = 'updatetime';
+    protected $deleteTime = false;
+
+    // 追加属性
+    protected $append = [
+
+    ];
+    
+
+    
+
+
+
+
+
+
+
+}

+ 27 - 0
application/admin/validate/PlatformSelect.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace app\admin\validate;
+
+use think\Validate;
+
+class PlatformSelect extends Validate
+{
+    /**
+     * 验证规则
+     */
+    protected $rule = [
+    ];
+    /**
+     * 提示消息
+     */
+    protected $message = [
+    ];
+    /**
+     * 验证场景
+     */
+    protected $scene = [
+        'add'  => [],
+        'edit' => [],
+    ];
+    
+}

+ 27 - 0
application/admin/validate/PreOrder.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace app\admin\validate;
+
+use think\Validate;
+
+class PreOrder extends Validate
+{
+    /**
+     * 验证规则
+     */
+    protected $rule = [
+    ];
+    /**
+     * 提示消息
+     */
+    protected $message = [
+    ];
+    /**
+     * 验证场景
+     */
+    protected $scene = [
+        'add'  => [],
+        'edit' => [],
+    ];
+    
+}

+ 27 - 0
application/admin/validate/Servicetype.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace app\admin\validate;
+
+use think\Validate;
+
+class Servicetype extends Validate
+{
+    /**
+     * 验证规则
+     */
+    protected $rule = [
+    ];
+    /**
+     * 提示消息
+     */
+    protected $message = [
+    ];
+    /**
+     * 验证场景
+     */
+    protected $scene = [
+        'add'  => [],
+        'edit' => [],
+    ];
+    
+}

+ 27 - 0
application/admin/validate/UserCar.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace app\admin\validate;
+
+use think\Validate;
+
+class UserCar extends Validate
+{
+    /**
+     * 验证规则
+     */
+    protected $rule = [
+    ];
+    /**
+     * 提示消息
+     */
+    protected $message = [
+    ];
+    /**
+     * 验证场景
+     */
+    protected $scene = [
+        'add'  => [],
+        'edit' => [],
+    ];
+    
+}

+ 13 - 5
application/admin/view/platform_article/add.html

@@ -22,7 +22,7 @@
         <label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
         <div class="col-xs-12 col-sm-8">
             <div class="input-group">
-                <input id="c-images" data-rule="required" class="form-control" size="50" name="row[images]" type="text" value="">
+                <input id="c-images" data-rule="" class="form-control" size="50" name="row[images]" type="text" value="">
                 <div class="input-group-addon no-border no-padding">
                     <span><button type="button" id="faupload-images" class="btn btn-danger faupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                     <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
@@ -33,15 +33,23 @@
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
+        <label for="c-video" class="control-label col-xs-12 col-sm-2">{:__('Video')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
+            <div class="input-group">
+                <input id="c-video" data-rule="" class="form-control" size="50" name="row[video]" type="text" value="">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-video" class="btn btn-danger faupload" data-input-id="c-video" data-mimetype="mp4,avi,flv,wmv" data-multiple="false" data-maxsize="55M" data-preview-id="p-video"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-video" class="btn btn-primary fachoose" data-input-id="c-video" data-mimetype="mp4,avi,flv,wmv" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-video"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-video"></ul>
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="0">
+            <textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
         </div>
     </div>
     <div class="form-group">

+ 13 - 5
application/admin/view/platform_article/edit.html

@@ -22,7 +22,7 @@
         <label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
         <div class="col-xs-12 col-sm-8">
             <div class="input-group">
-                <input id="c-images" data-rule="required" class="form-control" size="50" name="row[images]" type="text" value="{$row.images|htmlentities}">
+                <input id="c-images" data-rule="" class="form-control" size="50" name="row[images]" type="text" value="{$row.images|htmlentities}">
                 <div class="input-group-addon no-border no-padding">
                     <span><button type="button" id="faupload-images" class="btn btn-danger faupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                     <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
@@ -33,15 +33,23 @@
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
+        <label for="c-video" class="control-label col-xs-12 col-sm-2">{:__('Video')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
+            <div class="input-group">
+                <input id="c-video" data-rule="" class="form-control" size="50" name="row[video]" type="text" value="{$row.video|htmlentities}">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-video" class="btn btn-danger faupload" data-input-id="c-video" data-mimetype="mp4,avi,flv,wmv" data-multiple="false" data-maxsize="55M" data-preview-id="p-video"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-video" class="btn btn-primary fachoose" data-input-id="c-video" data-mimetype="mp4,avi,flv,wmv" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-video"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-video"></ul>
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
+            <textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
         </div>
     </div>
     <div class="form-group">

+ 54 - 0
application/admin/view/platform_select/add.html

@@ -0,0 +1,54 @@
+<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-image"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-image"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
+        </div>
+    </div>
+    <!--<div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="0">
+        </div>
+    </div>-->
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="radio">
+            {foreach name="statusList" item="vo"}
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="0"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
+        </div>
+    </div>
+</form>

+ 54 - 0
application/admin/view/platform_select/edit.html

@@ -0,0 +1,54 @@
+<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-image"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-image"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
+        </div>
+    </div>
+    <!--<div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
+        </div>
+    </div>-->
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="radio">
+            {foreach name="statusList" item="vo"}
+            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
+        </div>
+    </div>
+</form>

+ 45 - 0
application/admin/view/platform_select/index.html

@@ -0,0 +1,45 @@
+<div class="panel panel-default panel-intro">
+    
+    <div class="panel-heading">
+        {:build_heading(null,FALSE)}
+        <ul class="nav nav-tabs" data-field="status">
+            <li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
+            {foreach name="statusList" item="vo"}
+            <li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
+            {/foreach}
+        </ul>
+    </div>
+
+
+    <div class="panel-body">
+        <div id="myTabContent" class="tab-content">
+            <div class="tab-pane fade active in" id="one">
+                <div class="widget-body no-padding">
+                    <div id="toolbar" class="toolbar">
+                        <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
+                        <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('platform_select/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
+                        <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('platform_select/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
+                        <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('platform_select/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
+                        
+
+                        <div class="dropdown btn-group {:$auth->check('platform_select/multi')?'':'hide'}">
+                            <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
+                            <ul class="dropdown-menu text-left" role="menu">
+                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
+                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
+                            </ul>
+                        </div>
+
+                        
+                    </div>
+                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
+                           data-operate-edit="{:$auth->check('platform_select/edit')}"
+                           data-operate-del="{:$auth->check('platform_select/del')}"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 70 - 0
application/admin/view/pre_order/add.html

@@ -0,0 +1,70 @@
+<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Company_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-company_id" data-rule="required" data-source="company/index" class="form-control selectpage" name="row[company_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-mobile" data-rule="required" class="form-control" name="row[mobile]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Remark')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-remark" data-rule="" class="form-control" name="row[remark]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Car_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-car_id" data-rule="required" data-source="user_car/index" data-field="car_number" class="form-control selectpage" name="row[car_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group" hidden>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Car_number')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-car_number" data-rule="required" class="form-control" name="row[car_number]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Servicetype_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-servicetype_id" data-rule="required" data-source="servicetype/index" data-field="title" class="form-control selectpage" name="row[servicetype_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Pre_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-pre_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[pre_time]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Order_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-order_time" data-rule="" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[order_time]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
+        </div>
+    </div>
+</form>

+ 94 - 0
application/admin/view/pre_order/edit.html

@@ -0,0 +1,94 @@
+<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Company_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-company_id" data-rule="required" data-source="company/index" class="form-control selectpage" name="row[company_id]" type="text" value="{$row.company_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-mobile" data-rule="required" class="form-control" name="row[mobile]" type="text" value="{$row.mobile|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Remark')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-remark" data-rule="" class="form-control" name="row[remark]" type="text" value="{$row.remark|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Car_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-car_id" data-rule="required" data-source="user_car/index" data-field="car_number" class="form-control selectpage" name="row[car_id]" type="text" value="{$row.car_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group" hidden>
+        <label class="control-label col-xs-12 col-sm-2">{:__('Car_number')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-car_number" data-rule="required" class="form-control" name="row[car_number]" type="text" value="{$row.car_number|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Servicetype_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-servicetype_id" data-rule="required" data-source="servicetype/index" data-field="title" class="form-control selectpage" name="row[servicetype_id]" type="text" value="{$row.servicetype_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Pre_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-pre_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[pre_time]" type="text" value="{:$row.pre_time?datetime($row.pre_time):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Order_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-order_time" data-rule="" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[order_time]" type="text" value="{:$row.order_time?datetime($row.order_time):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Cancel_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-cancel_time" data-rule="" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[cancel_time]" type="text" value="{:$row.cancel_time?datetime($row.cancel_time):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Cancel_reason')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-cancel_reason" class="form-control" name="row[cancel_reason]" type="text" value="{$row.cancel_reason|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Pre_order_status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            
+            <div class="radio">
+            {foreach name="preOrderStatusList" item="vo"}
+            <label for="row[pre_order_status]-{$key}"><input id="row[pre_order_status]-{$key}" name="row[pre_order_status]" type="radio" value="{$key}" {in name="key" value="$row.pre_order_status"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
+        </div>
+    </div>
+</form>

+ 35 - 0
application/admin/view/pre_order/index.html

@@ -0,0 +1,35 @@
+<div class="panel panel-default panel-intro">
+    {:build_heading()}
+
+    <div class="panel-body">
+        <div id="myTabContent" class="tab-content">
+            <div class="tab-pane fade active in" id="one">
+                <div class="widget-body no-padding">
+                    <div id="toolbar" class="toolbar">
+                        <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
+                        <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('pre_order/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
+                        <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('pre_order/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
+                        <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('pre_order/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
+                        
+
+                        <div class="dropdown btn-group {:$auth->check('pre_order/multi')?'':'hide'}">
+                            <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
+                            <ul class="dropdown-menu text-left" role="menu">
+                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
+                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
+                            </ul>
+                        </div>
+
+                        
+                    </div>
+                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
+                           data-operate-edit="{:$auth->check('pre_order/edit')}"
+                           data-operate-del="{:$auth->check('pre_order/del')}"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 22 - 0
application/admin/view/servicetype/add.html

@@ -0,0 +1,22 @@
+<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
+        </div>
+    </div>
+</form>

+ 22 - 0
application/admin/view/servicetype/edit.html

@@ -0,0 +1,22 @@
+<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
+        </div>
+    </div>
+</form>

+ 35 - 0
application/admin/view/servicetype/index.html

@@ -0,0 +1,35 @@
+<div class="panel panel-default panel-intro">
+    {:build_heading()}
+
+    <div class="panel-body">
+        <div id="myTabContent" class="tab-content">
+            <div class="tab-pane fade active in" id="one">
+                <div class="widget-body no-padding">
+                    <div id="toolbar" class="toolbar">
+                        <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
+                        <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('servicetype/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
+                        <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('servicetype/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
+                        <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('servicetype/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
+                        
+
+                        <div class="dropdown btn-group {:$auth->check('servicetype/multi')?'':'hide'}">
+                            <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
+                            <ul class="dropdown-menu text-left" role="menu">
+                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
+                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
+                            </ul>
+                        </div>
+
+                        
+                    </div>
+                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
+                           data-operate-edit="{:$auth->check('servicetype/edit')}"
+                           data-operate-del="{:$auth->check('servicetype/del')}"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 28 - 0
application/admin/view/user_car/add.html

@@ -0,0 +1,28 @@
+<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Car_number')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-car_number" data-rule="required" class="form-control" name="row[car_number]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Car_model')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-car_model" data-rule="required" class="form-control" name="row[car_model]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
+        </div>
+    </div>
+</form>

+ 28 - 0
application/admin/view/user_car/edit.html

@@ -0,0 +1,28 @@
+<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Car_number')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-car_number" data-rule="required" class="form-control" name="row[car_number]" type="text" value="{$row.car_number|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Car_model')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-car_model" data-rule="required" class="form-control" name="row[car_model]" type="text" value="{$row.car_model|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
+        </div>
+    </div>
+</form>

+ 35 - 0
application/admin/view/user_car/index.html

@@ -0,0 +1,35 @@
+<div class="panel panel-default panel-intro">
+    {:build_heading()}
+
+    <div class="panel-body">
+        <div id="myTabContent" class="tab-content">
+            <div class="tab-pane fade active in" id="one">
+                <div class="widget-body no-padding">
+                    <div id="toolbar" class="toolbar">
+                        <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
+                        <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('user_car/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
+                        <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('user_car/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
+                        <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('user_car/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
+                        
+
+                        <div class="dropdown btn-group {:$auth->check('user_car/multi')?'':'hide'}">
+                            <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
+                            <ul class="dropdown-menu text-left" role="menu">
+                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
+                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
+                            </ul>
+                        </div>
+
+                        
+                    </div>
+                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
+                           data-operate-edit="{:$auth->check('user_car/edit')}"
+                           data-operate-del="{:$auth->check('user_car/del')}"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 1 - 1
application/api/controller/Banner.php

@@ -7,7 +7,7 @@ use think\Db;
 
 class Banner extends Api
 {
-    protected $noNeedLogin = [];
+    protected $noNeedLogin = '*';
     protected $noNeedRight = '*';
     protected $model = null;
 

+ 58 - 8
application/api/controller/PlatformArticle.php

@@ -7,7 +7,7 @@ use think\Db;
 
 class PlatformArticle extends Api
 {
-    protected $noNeedLogin = [];
+    protected $noNeedLogin = '*';
     protected $noNeedRight = '*';
     protected $model = null;
 
@@ -24,17 +24,67 @@ class PlatformArticle extends Api
     public function getTypeList()
     {
         try {
-            $companyId = $this->request->param('company_id',0);
-            $position = $this->request->param('position',0);//位置:0=首页,1=门店印象
-            $field = 'id,title,image,url';
+            $field = 'id,title';
             $where['status'] = 1;
-            $where['position'] = $position;
-            $where['company_id'] = $companyId;
-            $result = $this->model->field($field)->where($where)->order('weigh asc')->select();
+            $result = Db::name('platform_article_type')->field($field)->where($where)->order('weigh asc')->select();
+
+            $this->success('获取成功',$result);
+        } catch (Exception $e) {
+            $this->error($e->getMessage());
+        }
+    }
+
+    /**
+     * 资讯列表
+     * @return void
+     */
+    public function getList()
+    {
+        try {
+            $typeId = $this->request->param('type_id',0);
+            $field = 'id,title,desc,images,video,createtime';
+            $where['status'] = 1;
+            $where['type_id'] = $typeId;
+            $result = Db::name('platform_article')->field($field)
+                ->where($where)->order('createtime desc')->autopage()->select();
+            $userName = config('site.article_name') ? config('site.article_name') : '';
+            $avatar = config('site.article_avatar') ? cdnurl(config('site.article_avatar')) : '';
             if (!empty($result)) {
                 foreach ($result as $key => &$value) {
-                    !empty($value['image']) && $value['image'] = cdnurl($value['image']);
+                    $value['handeltime'] = weixinDate($value['createtime']);
+                    $value['createtime'] = !empty($value['createtime']) ? date('Y-m-d H:i',$value['createtime']) : '';
+                    $value['avatar'] = $avatar;
+                    $value['name'] = $userName;
+
                 }
+                $result = list_domain_image($result,['images','video']);
+            }
+            $this->success('获取成功',$result);
+        } catch (Exception $e) {
+            $this->error($e->getMessage());
+        }
+    }
+
+    /**
+     * 资讯详情
+     * @return void
+     */
+    public function getInfo()
+    {
+        try {
+            $id = $this->request->param('id',0);
+            $field = 'id,title,desc,images,video,createtime';
+            $where['status'] = 1;
+            $where['id'] = $id;
+            $result = Db::name('platform_article')->field($field)->where($where)->find();
+            $userName = config('site.article_name') ? config('site.article_name') : '';
+            $avatar = config('site.article_avatar') ? cdnurl(config('site.article_avatar')) : '';
+            if (!empty($result)) {
+                $result['handeltime'] = weixinDate($result['createtime']);
+                $result['createtime'] = !empty($result['createtime']) ? date('Y.m.d H:i',$result['createtime']) : '';
+                $result['avatar'] = $avatar;
+                $result['name'] = $userName;
+                $result = info_domain_image($result,['images','video']);
             }
             $this->success('获取成功',$result);
         } catch (Exception $e) {

+ 63 - 0
application/api/controller/PlatformSelect.php

@@ -0,0 +1,63 @@
+<?php
+
+namespace app\api\controller;
+
+use app\common\controller\Api;
+use think\Db;
+
+class PlatformSelect extends Api
+{
+    protected $noNeedLogin = '*';
+    protected $noNeedRight = '*';
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = Db::name('platform_select');
+    }
+
+    /**
+     * 平台甄选列表
+     * @return void
+     */
+    public function getList()
+    {
+        try {
+            $field = 'id,title,image,createtime';
+            $where['status'] = 1;
+            $result = $this->model->field($field)->where($where)->order('createtime desc')->autopage()->select();
+            if (!empty($result)) {
+                foreach ($result as $key => &$value) {
+                    $value['createtime'] = !empty($value['createtime']) ? date('Y-m-d H:i:s',$value['createtime']) : '';
+                }
+                $result = list_domain_image($result,['image']);
+            }
+            $this->success('获取成功',$result);
+        } catch (Exception $e) {
+            $this->error($e->getMessage());
+        }
+    }
+
+    /**
+     * 平台甄选详情
+     * @return void
+     */
+    public function getInfo()
+    {
+        try {
+            $id = $this->request->param('id',0);
+            $field = 'id,title,image,content,createtime';
+            $where['status'] = 1;
+            $where['id'] = $id;
+            $result = $this->model->field($field)->where($where)->find();
+            if (!empty($result)) {
+                $result['createtime'] = !empty($result['createtime']) ? date('Y.m.d H:i:s',$result['createtime']) : '';
+                $result = info_domain_image($result,['image']);
+            }
+            $this->success('获取成功',$result);
+        } catch (Exception $e) {
+            $this->error($e->getMessage());
+        }
+    }
+}

+ 67 - 0
application/api/controller/PreOrder.php

@@ -0,0 +1,67 @@
+<?php
+
+namespace app\api\controller;
+
+use app\common\controller\Api;
+use think\Db;
+
+class PreOrder extends Api
+{
+    protected $noNeedLogin = [];
+    protected $noNeedRight = '*';
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = Db::name('pre_order');
+    }
+
+    /**
+     * 保存
+     * @return void
+     */
+    public function save()
+    {
+        try {
+            //验证参数
+            $id = $this->request->param('id',0);
+            $carId = $this->request->param('car_id',0);
+            $preTime = $this->request->param('pre_time','');
+            $userId = $this->auth->id;
+            $scene = !empty($id) ? 'edit' : 'add';
+            $validate = validate('PreOrder');
+            if(!$validate->check($this->request->param(),[],$scene)){
+                throw new Exception($validate->getError());
+            }
+
+            $time = time();
+            $data = [
+                'company_id' => $this->request->param('company_id', 0),
+                'name' => $this->request->param('name', ''),
+                'mobile'  => $this->request->param('mobile', ''),
+                'remark'  => $this->request->param('remark', ''),
+                'car_id'  => $carId,
+                'car_number'  => $this->request->param('car_model', ''),
+                'servicetype_id'  => $this->request->param('servicetype_id', ''),
+                'pre_time'  => $this->request->param('pre_time', ''),
+            ];
+            if (empty($id)) {
+                $data['user_id'] = $userId;
+                $data['create'] = $time;
+                $res = $this->model->insertGetId($data);
+            } else {
+                $data['updatetime'] = $time;
+                $where['id'] = $id;
+                $where['user_id'] = $userId;
+                $res = $this->model->where($where)->update($data);
+            }
+            if (!$res) {
+                throw new Exception('操作失败');
+            }
+            $this->success('操作成功');
+        } catch (Exception $e) {
+            $this->error($e->getMessage());
+        }
+    }
+}

+ 35 - 0
application/api/controller/Servicetype.php

@@ -0,0 +1,35 @@
+<?php
+
+namespace app\api\controller;
+
+use app\common\controller\Api;
+use think\Db;
+
+class Servicetype extends Api
+{
+    protected $noNeedLogin = '*';
+    protected $noNeedRight = '*';
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = Db::name('servicetype');
+    }
+
+    /**
+     * 服务类型列表
+     * @return void
+     */
+    public function getList()
+    {
+        try {
+            $field = 'id,title';
+            $result = $this->model->field($field)->order('weigh asc createtime desc')->select();
+
+            $this->success('获取成功',$result);
+        } catch (Exception $e) {
+            $this->error($e->getMessage());
+        }
+    }
+}

+ 123 - 0
application/api/controller/UserCar.php

@@ -0,0 +1,123 @@
+<?php
+
+namespace app\api\controller;
+
+use app\common\controller\Api;
+use think\Db;
+use think\Exception;
+
+class UserCar extends Api
+{
+    protected $noNeedLogin = [];
+    protected $noNeedRight = '*';
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = Db::name('user_car');
+    }
+
+    /**
+     * 车辆列表
+     * @return void
+     */
+    public function getList()
+    {
+        try {
+            $userId = $this->auth->id;
+            $field = 'id,car_number,car_model';
+            $where['user_id'] = $userId;
+            $result = $this->model->field($field)->where($where)->order('createtime desc')->autopage()->select();
+
+            $this->success('获取成功',$result);
+        } catch (Exception $e) {
+            $this->error($e->getMessage());
+        }
+    }
+
+    /**
+     * 车辆详情
+     * @return void
+     */
+    public function getInfo()
+    {
+        try {
+            $id = $this->request->param('id',0);
+            $userId = $this->auth->id;
+            $field = 'id,car_number,car_model';
+            $where['user_id'] = $userId;
+            $where['id'] = $id;
+            $result = $this->model->field($field)->where($where)->find();
+
+            $this->success('获取成功',$result);
+        } catch (Exception $e) {
+            $this->error($e->getMessage());
+        }
+    }
+    
+    /**
+     * 保存
+     * @return void
+     */
+    public function save()
+    {
+        try {
+            //验证参数
+            $id = $this->request->param('id',0);
+            $userId = $this->auth->id;
+            $scene = !empty($id) ? 'edit' : 'add';
+            $validate = validate('UserCar');
+            if(!$validate->check($this->request->param(),[],$scene)){
+                throw new Exception($validate->getError());
+            }
+            $time = time();
+            $data = [
+                'car_number' => $this->request->param('car_number', ''),
+                'car_model'  => $this->request->param('car_model', ''),
+            ];
+            if (empty($id)) {
+                $data['user_id'] = $userId;
+                $data['createtime'] = $time;
+                $res = $this->model->insertGetId($data);
+            } else {
+                $data['updatetime'] = $time;
+                $where['id'] = $id;
+                $where['user_id'] = $userId;
+                $res = $this->model->where($where)->update($data);
+            }
+            if (!$res) {
+                throw new Exception('操作失败');
+            }
+            $this->success('操作成功');
+        } catch (Exception $e) {
+            $this->error($e->getMessage());
+        }
+    }
+
+    /**
+     * 删除
+     * @return void
+     */
+    public function del()
+    {
+        try {
+            //验证参数
+            $id = $this->request->param('id',0);
+            $userId = $this->auth->id;
+            $where['id'] = $id;
+            $where['user_id'] = $userId;
+            $userCar = $this->model->where($where)->find();
+            if (empty($userCar)) {
+                throw new Exception('未找到车辆信息');
+            }
+            $res = $this->model->where($where)->delete();
+            if (!$res) {
+                throw new Exception('操作失败');
+            }
+            $this->success('操作成功');
+        } catch (Exception $e) {
+            $this->error($e->getMessage());
+        }
+    }
+}

+ 41 - 0
application/common.php

@@ -938,4 +938,45 @@ if (!function_exists('getDistance')) {
         }
         return round($distance, $decimal);
     }
+}
+
+
+/**
+ * 文章时间友好化
+ * @param null $time 添加时间,时间戳
+ * @return string
+ */
+if (!function_exists('weixinDate')) {
+    function weixinDate($time = null)
+    {
+        if (!$time) {
+            return '';
+        }
+        // 获取当前时间戳
+        $cTime = time();
+        $date = date('Y.m.d', $time);
+        $xyh = intval(($cTime - $time) / 24 / 3600);
+        // 获取当前时间戳与$time的差
+        $dTime = $cTime - $time;
+        if ($dTime < 1) {
+            return '刚刚';
+        } elseif ($dTime < 60) {
+            return intval($dTime) . "秒前";
+        } elseif ($dTime < 3600) {
+            return intval($dTime / 60) . "分钟前";
+        } elseif ($dTime >= 3600 && $xyh < 1) {
+            return intval($dTime / 3600) . "小时前";
+        } elseif ($xyh > 365) {
+            // 如果时间大于1年,返回具体日期
+            return $date;
+        } elseif ($xyh == 1) {
+            return "昨天";
+        } elseif ($xyh >= 2 && $xyh <= 13) {
+            return intval($xyh) . "天前";
+        } elseif ($xyh > 13 && $xyh <= 60) {
+            return intval($xyh / 7) . "周前";
+        } elseif ($xyh > 60) {
+            return intval($xyh / 30) . "月前";
+        }
+    }
 }

+ 45 - 0
application/common/validate/PreOrder.php

@@ -0,0 +1,45 @@
+<?php
+
+namespace app\common\validate;
+use think\Validate;
+
+class PreOrder extends Validate
+{
+    // 验证规则
+    protected $rule = [
+        'id' => 'require|number',
+        'company_id' => 'require|number',
+        'name' => 'require|max:32',
+        'mobile' => 'require|max:32',
+        'car_id' => 'require|number',
+        'servicetype_id' => 'require|number',
+        'pre_time' => 'require',
+        'remark' => 'max:256',
+        'cancel_reason' => 'max:128',
+    ];
+
+    // 验证提示
+    protected $message = [
+        'id.require' => '请输入预约单ID',
+        'id.number' => '您输入的预约单ID,必须是数字类型',
+        'company_id.require' => '请输入门店',
+        'company_id.number' => '您输入的门店,必须是数字类型',
+        'name.require' => '请输入联系人',
+        'name.max' => '您输入的联系人,必须小于32字符',
+        'mobile.require' => '请输入联系电话',
+        'mobile.max' => '您输入的联系电话,必须小于32字符',
+        'car_id.require' => '请输入车辆',
+        'car_id.number' => '您输入的车辆,必须是数字类型',
+        'servicetype_id.require' => '请输入服务类型',
+        'servicetype_id.number' => '您输入的服务类型,必须是数字类型',
+        'pre_time.require' => '请输入预约时间',
+        'remark.max' => '您输入的备注,必须小于256字符',
+        'cancel_reason.max' => '您输入的备注,必须小于128字符',
+    ];
+
+    // 应用场景
+    protected $scene = [
+        'add' => ['company_id','name','mobile','car_id','servicetype_id','pre_time','remark','cancel_reason'],
+        'edit' => ['id','company_id','name','mobile','car_id','servicetype_id','pre_time','remark','cancel_reason'],
+    ];
+}

+ 30 - 0
application/common/validate/UserCar.php

@@ -0,0 +1,30 @@
+<?php
+
+namespace app\common\validate;
+use think\Validate;
+
+class UserCar extends Validate
+{
+    // 验证规则
+    protected $rule = [
+        'id' => 'require|number',
+        'car_number' => 'require|max:64',
+        'car_model' => 'require|max:128',
+    ];
+
+    // 验证提示
+    protected $message = [
+        'id.require' => '请输入车辆ID',
+        'id.number' => '您输入的车辆ID,必须是数字类型',
+        'car_number.require' => '请输入车牌号',
+        'car_number.max' => '您输入的车牌号,必须小于64字符',
+        'car_model.require' => '请输入车辆型号',
+        'car_model.max' => '您输入的车辆型号,必须小于128字符',
+    ];
+
+    // 应用场景
+    protected $scene = [
+        'add' => ['car_number', 'car_model'],
+        'edit' => ['id','car_number', 'car_model'],
+    ];
+}

+ 2 - 0
application/extra/site.php

@@ -43,4 +43,6 @@ return array (
   'withdrawal_service_fee' => '2',
   'min_withdrawal_money' => '0.3',
   'max_withdrawal_money' => '1000000',
+  'article_name' => '蓝精灵官方',
+  'article_avatar' => '/uploads/20230531/68bab200ae016db0fbe31e91ff370ecf.png',
 );

+ 9 - 3
public/assets/js/backend/platform_article.js

@@ -21,7 +21,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             table.bootstrapTable({
                 url: $.fn.bootstrapTable.defaults.extend.index_url,
                 pk: 'id',
-                sortName: 'weigh',
+                sortName: 'id',
                 fixedColumns: true,
                 fixedRightNumber: 1,
                 columns: [
@@ -31,8 +31,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'type_id', title: __('Type_id')},
                         {field: 'title', title: __('Title'), operate: 'LIKE'},
                         {field: 'desc', title: __('Desc'), operate: 'LIKE'},
-                        {field: 'images', title: __('Images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
-                        {field: 'weigh', title: __('Weigh'), operate: false},
+                        {field: 'images', title: __('Images'), operate: false, events: Table.api.events.images, formatter: Table.api.formatter.images},
+                        {field: 'video', title: __('Video'), operate: false, formatter: function(val, row) {
+                            if(val) {
+                                return '<video width="120" height="90" controls>'+'<source src="'+val+'" type="video/ogg">'+'</video>';
+                            } else {
+                                return '暂无';
+                            }
+                        }},
                         {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1')}, formatter: Table.api.formatter.status},
                         {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},

+ 55 - 0
public/assets/js/backend/platform_select.js

@@ -0,0 +1,55 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+    var Controller = {
+        index: function () {
+            // 初始化表格参数配置
+            Table.api.init({
+                extend: {
+                    index_url: 'platform_select/index' + location.search,
+                    add_url: 'platform_select/add',
+                    edit_url: 'platform_select/edit',
+                    del_url: 'platform_select/del',
+                    multi_url: 'platform_select/multi',
+                    import_url: 'platform_select/import',
+                    table: 'platform_select',
+                }
+            });
+
+            var table = $("#table");
+
+            // 初始化表格
+            table.bootstrapTable({
+                url: $.fn.bootstrapTable.defaults.extend.index_url,
+                pk: 'id',
+                sortName: 'weigh',
+                columns: [
+                    [
+                        {checkbox: true},
+                        {field: 'id', title: __('Id')},
+                        {field: 'title', title: __('Title'), operate: 'LIKE'},
+                        {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+                        {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1')}, formatter: Table.api.formatter.status},
+                        {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                    ]
+                ]
+            });
+
+            // 为表格绑定事件
+            Table.api.bindevent(table);
+        },
+        add: function () {
+            Controller.api.bindevent();
+        },
+        edit: function () {
+            Controller.api.bindevent();
+        },
+        api: {
+            bindevent: function () {
+                Form.api.bindevent($("form[role=form]"));
+            }
+        }
+    };
+    return Controller;
+});

+ 82 - 0
public/assets/js/backend/pre_order.js

@@ -0,0 +1,82 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+    var Controller = {
+        index: function () {
+            // 初始化表格参数配置
+            Table.api.init({
+                extend: {
+                    index_url: 'pre_order/index' + location.search,
+                    add_url: 'pre_order/add',
+                    edit_url: 'pre_order/edit',
+                    del_url: 'pre_order/del',
+                    multi_url: 'pre_order/multi',
+                    import_url: 'pre_order/import',
+                    table: 'pre_order',
+                }
+            });
+
+            var table = $("#table");
+
+            // 初始化表格
+            table.bootstrapTable({
+                url: $.fn.bootstrapTable.defaults.extend.index_url,
+                pk: 'id',
+                sortName: 'id',
+                fixedColumns: true,
+                fixedRightNumber: 1,
+                columns: [
+                    [
+                        {checkbox: true},
+                        {field: 'id', title: __('Id')},
+                        {field: 'company_id', title: __('Company_id')},
+                        {field: 'company.name', title: __('Company_name'), operate: 'LIKE'},
+                        {field: 'user_id', title: __('User_id')},
+                        {field: 'user.nickname', title: __('User_nickname'), operate: 'LIKE'},
+                        {field: 'name', title: __('Name'), operate: 'LIKE'},
+                        {field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
+                        {field: 'remark', title: __('Remark'), operate: 'LIKE'},
+                        {field: 'car_id', title: __('Car_id'), operate: false, visible:false},
+                        {field: 'car_number', title: __('Car_number'), operate: 'LIKE'},
+                        {field: 'servicetype_id', title: __('Servicetype_id'), operate: false, visible:false},
+                        {field: 'servicetype.title', title: __('Servicetype_title')},
+                        {field: 'pre_time', title: __('Pre_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'order_time', title: __('Order_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'cancel_time', title: __('Cancel_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'cancel_reason', title: __('Cancel_reason'), operate: 'LIKE'},
+                        {field: 'pre_order_status', title: __('Pre_order_status'), searchList: {"0":__('Pre_order_status 0'),"1":__('Pre_order_status 1'),"2":__('Pre_order_status 2')}, formatter: Table.api.formatter.status},
+                        {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                    ]
+                ]
+            });
+
+            // 为表格绑定事件
+            Table.api.bindevent(table);
+        },
+        add: function () {
+            Controller.api.bindevent();
+        },
+        edit: function () {
+            Controller.api.bindevent();
+        },
+        api: {
+            bindevent: function () {
+                $("#c-car_id").on('change', function () {
+                    var carId = $('#c-car_id').val();
+                    $.ajax({
+                        url:'user_car/index?filter={"id":"'+carId+'"}&op={"id":"="}',
+                        method:'get',
+                        success:function(res){
+                            var rows = res.rows[0];
+                            var carNumber = rows["car_number"];
+                            $("#c-car_number").val(carNumber);
+                        }
+                    });
+                });
+                Form.api.bindevent($("form[role=form]"));
+            }
+        }
+    };
+    return Controller;
+});

+ 54 - 0
public/assets/js/backend/servicetype.js

@@ -0,0 +1,54 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+    var Controller = {
+        index: function () {
+            // 初始化表格参数配置
+            Table.api.init({
+                extend: {
+                    index_url: 'servicetype/index' + location.search,
+                    add_url: 'servicetype/add',
+                    edit_url: 'servicetype/edit',
+                    del_url: 'servicetype/del',
+                    multi_url: 'servicetype/multi',
+                    import_url: 'servicetype/import',
+                    table: 'servicetype',
+                }
+            });
+
+            var table = $("#table");
+
+            // 初始化表格
+            table.bootstrapTable({
+                url: $.fn.bootstrapTable.defaults.extend.index_url,
+                pk: 'id',
+                sortName: 'weigh',
+                columns: [
+                    [
+                        {checkbox: true},
+                        {field: 'id', title: __('Id')},
+                        {field: 'title', title: __('Title'), operate: 'LIKE'},
+                        {field: 'weigh', title: __('Weigh'), operate: false},
+                        {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                    ]
+                ]
+            });
+
+            // 为表格绑定事件
+            Table.api.bindevent(table);
+        },
+        add: function () {
+            Controller.api.bindevent();
+        },
+        edit: function () {
+            Controller.api.bindevent();
+        },
+        api: {
+            bindevent: function () {
+                Form.api.bindevent($("form[role=form]"));
+            }
+        }
+    };
+    return Controller;
+});

+ 56 - 0
public/assets/js/backend/user_car.js

@@ -0,0 +1,56 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+    var Controller = {
+        index: function () {
+            // 初始化表格参数配置
+            Table.api.init({
+                extend: {
+                    index_url: 'user_car/index' + location.search,
+                    add_url: 'user_car/add',
+                    edit_url: 'user_car/edit',
+                    del_url: 'user_car/del',
+                    multi_url: 'user_car/multi',
+                    import_url: 'user_car/import',
+                    table: 'user_car',
+                }
+            });
+
+            var table = $("#table");
+
+            // 初始化表格
+            table.bootstrapTable({
+                url: $.fn.bootstrapTable.defaults.extend.index_url,
+                pk: 'id',
+                sortName: 'id',
+                columns: [
+                    [
+                        {checkbox: true},
+                        {field: 'id', title: __('Id')},
+                        {field: 'user_id', title: __('User_id')},
+                        {field: 'user.nickname', title: __('User_nickname'), operate: 'LIKE'},
+                        {field: 'car_number', title: __('Car_number'), operate: 'LIKE'},
+                        {field: 'car_model', title: __('Car_model'), operate: 'LIKE'},
+                        {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
+                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                    ]
+                ]
+            });
+
+            // 为表格绑定事件
+            Table.api.bindevent(table);
+        },
+        add: function () {
+            Controller.api.bindevent();
+        },
+        edit: function () {
+            Controller.api.bindevent();
+        },
+        api: {
+            bindevent: function () {
+                Form.api.bindevent($("form[role=form]"));
+            }
+        }
+    };
+    return Controller;
+});