Browse Source

Merge branch 'master' of http://git.huxiukeji.com/lizhen/lanjingling

lizhen_gitee 1 year ago
parent
commit
10118e55a0
100 changed files with 4754 additions and 14 deletions
  1. 0 0
      addons/summernote/assets/css/summernote.css
  2. 0 0
      addons/summernote/assets/css/summernote.min.css
  3. 0 0
      addons/summernote/assets/font/summernote.eot
  4. 0 0
      addons/summernote/assets/font/summernote.ttf
  5. 0 0
      addons/summernote/assets/font/summernote.woff
  6. 0 0
      addons/summernote/assets/font/summernote.woff2
  7. 0 0
      addons/summernote/assets/js/summernote.js
  8. 0 0
      addons/summernote/assets/js/summernote.min.js
  9. 0 0
      addons/summernote/assets/lang/summernote-zh-CN.js
  10. 0 0
      addons/summernote/assets/lang/summernote-zh-CN.min.js
  11. 0 0
      addons/summernote/assets/lang/summernote-zh-TW.js
  12. 0 0
      addons/summernote/assets/lang/summernote-zh-TW.min.js
  13. 1 1
      addons/summernote/info.ini
  14. 0 0
      addons/umeditor/.addonrc
  15. 44 0
      addons/umeditor/Umeditor.php
  16. 161 0
      addons/umeditor/bootstrap.js
  17. 55 0
      addons/umeditor/config.php
  18. 34 0
      addons/umeditor/controller/Index.php
  19. 10 0
      addons/umeditor/info.ini
  20. 88 0
      application/admin/controller/Company.php
  21. 76 0
      application/admin/controller/Order.php
  22. 72 0
      application/admin/controller/Package.php
  23. 71 0
      application/admin/controller/RechargeConfig.php
  24. 71 0
      application/admin/controller/RechargeGift.php
  25. 37 0
      application/admin/controller/ShoproArea.php
  26. 50 0
      application/admin/lang/zh-cn/order.php
  27. 23 0
      application/admin/lang/zh-cn/package.php
  28. 1 0
      application/admin/lang/zh-cn/pre_order.php
  29. 12 0
      application/admin/lang/zh-cn/recharge_config.php
  30. 11 0
      application/admin/lang/zh-cn/recharge_gift.php
  31. 10 0
      application/admin/lang/zh-cn/shopro_area.php
  32. 181 0
      application/admin/model/Order.php
  33. 67 0
      application/admin/model/Package.php
  34. 53 0
      application/admin/model/RechargeConfig.php
  35. 44 0
      application/admin/model/RechargeGift.php
  36. 40 0
      application/admin/model/ShoproArea.php
  37. 12 0
      application/admin/model/company/Staff.php
  38. 12 0
      application/admin/model/pre/Order.php
  39. 27 0
      application/admin/validate/Order.php
  40. 27 0
      application/admin/validate/Package.php
  41. 27 0
      application/admin/validate/RechargeConfig.php
  42. 27 0
      application/admin/validate/RechargeGift.php
  43. 27 0
      application/admin/validate/ShoproArea.php
  44. 5 5
      application/admin/view/company/add.html
  45. 5 5
      application/admin/view/company/edit.html
  46. 216 0
      application/admin/view/order/add.html
  47. 216 0
      application/admin/view/order/edit.html
  48. 45 0
      application/admin/view/order/index.html
  49. 104 0
      application/admin/view/package/add.html
  50. 104 0
      application/admin/view/package/edit.html
  51. 45 0
      application/admin/view/package/index.html
  52. 40 0
      application/admin/view/recharge_config/add.html
  53. 41 0
      application/admin/view/recharge_config/edit.html
  54. 45 0
      application/admin/view/recharge_config/index.html
  55. 28 0
      application/admin/view/recharge_gift/add.html
  56. 28 0
      application/admin/view/recharge_gift/edit.html
  57. 35 0
      application/admin/view/recharge_gift/index.html
  58. 52 0
      application/admin/view/shopro_area/add.html
  59. 52 0
      application/admin/view/shopro_area/edit.html
  60. 35 0
      application/admin/view/shopro_area/index.html
  61. 1 0
      application/api/controller/Companys.php
  62. 1 1
      application/api/controller/Order.php
  63. 1 1
      application/api/controller/Pay.php
  64. 1 0
      application/api/controller/PreOrder.php
  65. 1 0
      application/common/service/OrderService.php
  66. 1 1
      application/extra/addons.php
  67. 87 0
      public/assets/addons/umeditor/dialogs/emotion/emotion.css
  68. 272 0
      public/assets/addons/umeditor/dialogs/emotion/emotion.js
  69. BIN
      public/assets/addons/umeditor/dialogs/emotion/images/0.gif
  70. BIN
      public/assets/addons/umeditor/dialogs/emotion/images/bface.gif
  71. BIN
      public/assets/addons/umeditor/dialogs/emotion/images/cface.gif
  72. BIN
      public/assets/addons/umeditor/dialogs/emotion/images/fface.gif
  73. BIN
      public/assets/addons/umeditor/dialogs/emotion/images/jxface2.gif
  74. BIN
      public/assets/addons/umeditor/dialogs/emotion/images/neweditor-tab-bg.png
  75. BIN
      public/assets/addons/umeditor/dialogs/emotion/images/tface.gif
  76. BIN
      public/assets/addons/umeditor/dialogs/emotion/images/wface.gif
  77. BIN
      public/assets/addons/umeditor/dialogs/emotion/images/yface.gif
  78. 32 0
      public/assets/addons/umeditor/dialogs/formula/formula.css
  79. 168 0
      public/assets/addons/umeditor/dialogs/formula/formula.html
  80. 124 0
      public/assets/addons/umeditor/dialogs/formula/formula.js
  81. BIN
      public/assets/addons/umeditor/dialogs/formula/images/formula.png
  82. 42 0
      public/assets/addons/umeditor/dialogs/image/image.css
  83. 499 0
      public/assets/addons/umeditor/dialogs/image/image.js
  84. BIN
      public/assets/addons/umeditor/dialogs/image/images/close.png
  85. BIN
      public/assets/addons/umeditor/dialogs/image/images/upload1.png
  86. BIN
      public/assets/addons/umeditor/dialogs/image/images/upload2.png
  87. 73 0
      public/assets/addons/umeditor/dialogs/link/link.js
  88. 185 0
      public/assets/addons/umeditor/dialogs/map/map.html
  89. 294 0
      public/assets/addons/umeditor/dialogs/map/map.js
  90. BIN
      public/assets/addons/umeditor/dialogs/video/images/center_focus.jpg
  91. BIN
      public/assets/addons/umeditor/dialogs/video/images/left_focus.jpg
  92. BIN
      public/assets/addons/umeditor/dialogs/video/images/none_focus.jpg
  93. BIN
      public/assets/addons/umeditor/dialogs/video/images/right_focus.jpg
  94. 77 0
      public/assets/addons/umeditor/dialogs/video/video.css
  95. 278 0
      public/assets/addons/umeditor/dialogs/video/video.js
  96. 150 0
      public/assets/addons/umeditor/lang/en/en.js
  97. BIN
      public/assets/addons/umeditor/lang/en/images/addimage.png
  98. BIN
      public/assets/addons/umeditor/lang/en/images/alldeletebtnhoverskin.png
  99. BIN
      public/assets/addons/umeditor/lang/en/images/alldeletebtnupskin.png
  100. BIN
      public/assets/addons/umeditor/lang/en/images/background.png

+ 0 - 0
public/assets/addons/summernote/css/summernote.css → addons/summernote/assets/css/summernote.css


+ 0 - 0
public/assets/addons/summernote/css/summernote.min.css → addons/summernote/assets/css/summernote.min.css


+ 0 - 0
public/assets/addons/summernote/font/summernote.eot → addons/summernote/assets/font/summernote.eot


+ 0 - 0
public/assets/addons/summernote/font/summernote.ttf → addons/summernote/assets/font/summernote.ttf


+ 0 - 0
public/assets/addons/summernote/font/summernote.woff → addons/summernote/assets/font/summernote.woff


+ 0 - 0
public/assets/addons/summernote/font/summernote.woff2 → addons/summernote/assets/font/summernote.woff2


+ 0 - 0
public/assets/addons/summernote/js/summernote.js → addons/summernote/assets/js/summernote.js


+ 0 - 0
public/assets/addons/summernote/js/summernote.min.js → addons/summernote/assets/js/summernote.min.js


+ 0 - 0
public/assets/addons/summernote/lang/summernote-zh-CN.js → addons/summernote/assets/lang/summernote-zh-CN.js


+ 0 - 0
public/assets/addons/summernote/lang/summernote-zh-CN.min.js → addons/summernote/assets/lang/summernote-zh-CN.min.js


+ 0 - 0
public/assets/addons/summernote/lang/summernote-zh-TW.js → addons/summernote/assets/lang/summernote-zh-TW.js


+ 0 - 0
public/assets/addons/summernote/lang/summernote-zh-TW.min.js → addons/summernote/assets/lang/summernote-zh-TW.min.js


+ 1 - 1
addons/summernote/info.ini

@@ -5,6 +5,6 @@ author = FastAdmin
 website = http://www.fastadmin.net
 version = 1.1.0
 url = /addons/summernote
-state = 1
+state = 0
 license = regular
 licenseto = 38239

File diff suppressed because it is too large
+ 0 - 0
addons/umeditor/.addonrc


+ 44 - 0
addons/umeditor/Umeditor.php

@@ -0,0 +1,44 @@
+<?php
+
+namespace addons\umeditor;
+
+use think\Addons;
+
+/**
+ * 插件
+ */
+class Umeditor extends Addons
+{
+
+    /**
+     * 插件安装方法
+     * @return bool
+     */
+    public function install()
+    {
+        return true;
+    }
+
+    /**
+     * 插件卸载方法
+     * @return bool
+     */
+    public function uninstall()
+    {
+        return true;
+    }
+
+    /**
+     * @param $params
+     */
+    public function configInit(&$params)
+    {
+        $config = $this->getConfig();
+        $params['umeditor'] = [
+            'classname'      => $config['classname'] ?? '.editor',
+            'baidumapkey'    => $config['baidumapkey'] ?? '',
+            'baidumapcenter' => $config['baidumapcenter'] ?? ''
+        ];
+    }
+
+}

+ 161 - 0
addons/umeditor/bootstrap.js

@@ -0,0 +1,161 @@
+window.UMEDITOR_HOME_URL = Config.__CDN__ + "/assets/addons/umeditor/";
+require.config({
+    paths: {
+        'umeditor': '../addons/umeditor/umeditor.min',
+        'umeditor.config': '../addons/umeditor/umeditor.config',
+        'umeditor.lang': '../addons/umeditor/lang/zh-cn/zh-cn',
+    },
+    shim: {
+        'umeditor': {
+            deps: [
+                'umeditor.config',
+                'css!../addons/umeditor/themes/default/css/umeditor.min.css'
+            ],
+            exports: 'UM',
+        },
+        'umeditor.lang': ['umeditor']
+    }
+});
+
+require(['form', 'upload'], function (Form, Upload) {
+    var getFileFromBase64, uploadFiles;
+    uploadFiles = async function (files, callback) {
+        var self = this;
+        for (var i = 0; i < files.length; i++) {
+            try {
+                await new Promise(function (resolve) {
+                    var url, html, file;
+                    file = files[i];
+                    Upload.api.send(file, function (data) {
+                        url = Fast.api.cdnurl(data.url, true);
+                        if (typeof callback === 'function') {
+                            callback.call(this, url, data)
+                        } else {
+                            if (file.type.indexOf("image") !== -1) {
+                                self.execCommand('insertImage', {
+                                    src: url,
+                                    title: file.name || "",
+                                });
+                            } else {
+                                self.execCommand('link', {
+                                    href: url,
+                                    title: file.name || "",
+                                    target: '_blank'
+                                });
+                            }
+                        }
+                        resolve();
+                    }, function () {
+                        resolve();
+                    });
+                });
+            } catch (e) {
+
+            }
+        }
+    };
+    getFileFromBase64 = function (data, url) {
+        var arr = data.split(','), mime = arr[0].match(/:(.*?);/)[1],
+            bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
+        while (n--) {
+            u8arr[n] = bstr.charCodeAt(n);
+        }
+        var filename, suffix;
+        if (typeof url != 'undefined') {
+            var urlArr = url.split('.');
+            filename = url.substr(url.lastIndexOf('/') + 1);
+            suffix = urlArr.pop();
+        } else {
+            filename = Math.random().toString(36).substring(5, 15);
+        }
+        if (!suffix) {
+            suffix = data.substring("data:image/".length, data.indexOf(";base64"));
+        }
+
+        var exp = new RegExp("\\." + suffix + "$", "i");
+        filename = exp.test(filename) ? filename : filename + "." + suffix;
+        var file = new File([u8arr], filename, {type: mime});
+        return file;
+    };
+
+    //监听上传文本框的事件
+    $(document).on("edui.file.change", ".edui-image-file", function (e, up, me, input, callback) {
+        uploadFiles.call(me.editor, this.files, function (url, data) {
+            me.uploadComplete(JSON.stringify({url: url, state: "SUCCESS"}));
+        });
+        up.updateInput(input);
+        me.toggleMask("上传中....");
+        callback && callback();
+    });
+    var _bindevent = Form.events.bindevent;
+    Form.events.bindevent = function (form) {
+        _bindevent.apply(this, [form]);
+        require(['umeditor', 'umeditor.lang'], function (UME, undefined) {
+
+            //重写编辑器加载
+            UME.plugins['autoupload'] = function () {
+                var that = this;
+                that.addListener('ready', function () {
+                    if (window.FormData && window.FileReader) {
+                        that.getOpt('pasteImageEnabled') && that.$body.on('paste', function (event) {
+                            var originalEvent;
+                            originalEvent = event.originalEvent;
+                            if (originalEvent.clipboardData && originalEvent.clipboardData.files.length > 0) {
+                                uploadFiles.call(that, originalEvent.clipboardData.files);
+                                return false;
+                            }
+                        });
+                        that.getOpt('dropFileEnabled') && that.$body.on('drop', function (event) {
+                            var originalEvent;
+                            originalEvent = event.originalEvent;
+                            if (originalEvent.dataTransfer && originalEvent.dataTransfer.files.length > 0) {
+                                uploadFiles.call(that, originalEvent.dataTransfer.files);
+                                return false;
+                            }
+                        });
+
+                        //取消拖放图片时出现的文字光标位置提示
+                        that.$body.on('dragover', function (e) {
+                            if (e.originalEvent.dataTransfer.types[0] == 'Files') {
+                                return false;
+                            }
+                        });
+                    }
+                });
+
+            };
+            $.extend(window.UMEDITOR_CONFIG.whiteList, {
+                div: ['style', 'class', 'id', 'data-tpl', 'data-source', 'data-id'],
+                span: ['style', 'class', 'id', 'data-id']
+            });
+            $(Config.umeditor.classname || '.editor', form).each(function () {
+                var id = $(this).attr("id");
+                $(this).removeClass('form-control');
+                var options = $(this).data("umeditor-options");
+                UME.list[id] = UME.getEditor(id, $.extend(true, {}, {
+                    initialFrameWidth: '100%',
+                    zIndex: 90,
+                    autoHeightEnabled: true,
+                    initialFrameHeight: 300,
+                    xssFilterRules: false,
+                    outputXssFilter: false,
+                    inputXssFilter: false,
+                    autoFloatEnabled: false,
+                    pasteImageEnabled: true,
+                    dropFileEnabled: true,
+                    baiduMapKey: Config.umeditor.baidumapkey || '',
+                    baiduMapCenter: Config.umeditor.baidumapcenter || '',
+                    imageUrl: '',
+                    imagePath: '',
+                    imageUploadCallback: function (file, fn) {
+                        var me = this;
+                        Upload.api.send(file, function (data) {
+                            var url = data.url;
+                            fn && fn.call(me, url, data);
+                        });
+                    }
+                }, options || {}));
+            });
+        });
+    }
+});

+ 55 - 0
addons/umeditor/config.php

@@ -0,0 +1,55 @@
+<?php
+
+return [
+    [
+        'name'    => 'classname',
+        'title'   => '渲染文本框元素',
+        'type'    => 'string',
+        'content' => [],
+        'value'   => '.editor',
+        'rule'    => 'required',
+        'msg'     => '',
+        'tip'     => '用于对指定的元素渲染,一般情况下无需修改',
+        'ok'      => '',
+        'extend'  => '',
+    ],
+    [
+        'name'    => 'baidumapkey',
+        'title'   => '百度地图API密钥',
+        'type'    => 'string',
+        'content' => [
+        ],
+        'value'   => '',
+        'rule'    => '',
+        'msg'     => '',
+        'tip'     => '',
+        'ok'      => '',
+        'extend'  => ''
+    ],
+    [
+        'name'    => 'baidumapcenter',
+        'title'   => '百度地图中心点经纬度',
+        'type'    => 'string',
+        'content' => [
+        ],
+        'value'   => '116.404413,39.903536',
+        'rule'    => '',
+        'msg'     => '',
+        'tip'     => '',
+        'ok'      => '',
+        'extend'  => ''
+    ],
+    [
+        'name'    => '__tips__',
+        'title'   => '温馨提示',
+        'type'    => 'string',
+        'content' => [
+        ],
+        'value'   => '百度地图API密钥申请地址:http://lbsyun.baidu.com/apiconsole/key<br>百度地图经纬度坐标获取:https://api.map.baidu.com/lbsapi/getpoint/index.html',
+        'rule'    => '',
+        'msg'     => '',
+        'tip'     => '',
+        'ok'      => '',
+        'extend'  => ''
+    ],
+];

+ 34 - 0
addons/umeditor/controller/Index.php

@@ -0,0 +1,34 @@
+<?php
+
+namespace addons\umeditor\controller;
+
+use think\addons\Controller;
+use think\Config;
+
+/**
+ * Umeditor
+ *
+ */
+class Index extends Controller
+{
+
+    public function _initialize()
+    {
+        parent::_initialize();
+    }
+
+    public function index()
+    {
+        $this->error("当前插件暂无前台页面");
+    }
+
+    public function get_map_config()
+    {
+        $config = get_addon_config('umeditor');
+        $params = [
+            'baidumapkey' => $config['baidumapkey'] ?? ''
+        ];
+        return json($params);
+    }
+
+}

+ 10 - 0
addons/umeditor/info.ini

@@ -0,0 +1,10 @@
+name = umeditor
+title = 百度UMeditor编辑器
+intro = 百度出品的UMeditor编辑器
+author = FastAdmin
+website = https://www.fastadmin.net
+version = 1.1.1
+state = 1
+url = /addons/umeditor
+license = basic
+licenseto = 19079

+ 88 - 0
application/admin/controller/Company.php

@@ -3,6 +3,7 @@
 namespace app\admin\controller;
 
 use app\common\controller\Backend;
+use think\Db;
 
 /**
  * 门店
@@ -34,5 +35,92 @@ class Company extends Backend
      * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
      */
 
+    /**
+     * 添加
+     */
+    public function add()
+    {
+        if ($this->request->isPost()) {
+            $params = $this->request->post("row/a");
+            $params = $this->preExcludeFields($params);
+            if (!$params) {
+                $this->error(__('Parameter %s can not be empty', ''));
+            }
+            $result = false;
+            try {
+                //是否采用模型验证
+                if ($this->modelValidate) {
+                    $name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
+                    $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate;
+                    $this->model->validateFailException(true)->validate($validate);
+                }
+                if(isset($params['area_id'])) {
+                    $areaWhere['id'] = $params['area_id'];
+                    $areaData = Db::name('shopro_area')->where($areaWhere)->find();
+                    $params['province_name'] = isset($areaData['province_name']) ? $areaData['province_name'] : '';
+                    $params['city_name'] = isset($areaData['city_name']) ? $areaData['city_name'] : '';
+                    $params['area_name'] = isset($areaData['name']) ? $areaData['name'] : '';
+                    $params['full_address'] = $params['province_name'].$params['city_name'].$params['area_name'].$params['address'];
+                }
+                $result = $this->model->allowField(true)->save($params);
+            } catch (ValidateException|PDOException|Exception $e) {
+                $this->error($e->getMessage());
+            }
+            if ($result == false) {
+               $this->error(__('No rows were inserted'));
+            }
+            $this->success();
+        }
+        return $this->view->fetch();
+    }
 
+    /**
+     * 编辑
+     */
+    public function edit($ids = null)
+    {
+        $row = $this->model->get($ids);
+        if (!$row) {
+            $this->error(__('No Results were found'));
+        }
+        $adminIds = $this->getDataLimitAdminIds();
+        if (is_array($adminIds)) {
+            if (!in_array($row[$this->dataLimitField], $adminIds)) {
+                $this->error(__('You have no permission'));
+            }
+        }
+        if ($this->request->isPost()) {
+            $params = $this->request->post("row/a");
+            if (!$params) {
+                $this->error(__('Parameter %s can not be empty', ''));
+            }
+            $params = $this->preExcludeFields($params);
+            $result = false;
+            try {
+                //是否采用模型验证
+                if ($this->modelValidate) {
+                    $name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
+                    $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
+                    $row->validateFailException(true)->validate($validate);
+                }
+                if(isset($params['area_id'])) {
+                    $areaWhere['id'] = $params['area_id'];
+                    $areaData = Db::name('shopro_area')->where($areaWhere)->find();
+                    $params['province_name'] = isset($areaData['province_name']) ? $areaData['province_name'] : '';
+                    $params['city_name'] = isset($areaData['city_name']) ? $areaData['city_name'] : '';
+                    $params['area_name'] = isset($areaData['name']) ? $areaData['name'] : '';
+                    $params['full_address'] = $params['province_name'].$params['city_name'].$params['area_name'].$params['address'];
+                }
+                $result = $row->allowField(true)->save($params);
+            } catch (ValidateException|PDOException|Exception $e) {
+                $this->error($e->getMessage());
+            }
+            if ($result == false) {
+                $this->error(__('No rows were updated'));
+            }
+            $this->success();
+        }
+        $this->view->assign("row", $row);
+        return $this->view->fetch();
+    }
 }

+ 76 - 0
application/admin/controller/Order.php

@@ -0,0 +1,76 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\common\controller\Backend;
+
+/**
+ * 用户订单
+ *
+ * @icon fa fa-circle-o
+ */
+class Order extends Backend
+{
+
+    /**
+     * Order模型对象
+     * @var \app\admin\model\Order
+     */
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new \app\admin\model\Order;
+        $this->view->assign("ordertypeList", $this->model->getOrdertypeList());
+        $this->view->assign("statusList", $this->model->getStatusList());
+        $this->view->assign("paytypeList", $this->model->getPaytypeList());
+    }
+
+
+
+    /**
+     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     */
+
+
+    /**
+     * 查看
+     */
+    public function index()
+    {
+        //当前是否为关联查询
+        $this->relationSearch = true;
+        //设置过滤方法
+        $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();
+
+            $list = $this->model
+                    ->with(['company','staff','user','preOrder','servicetype'])
+                    ->where($where)
+                    ->order($sort, $order)
+                    ->paginate($limit);
+
+            foreach ($list as $row) {
+                $row->getRelation('company')->visible(['name']);
+				$row->getRelation('staff')->visible(['truename']);
+				$row->getRelation('user')->visible(['nickname']);
+				$row->getRelation('pre_order')->visible(['pre_order_no']);
+				$row->getRelation('servicetype')->visible(['title']);
+            }
+
+            $result = array("total" => $list->total(), "rows" => $list->items());
+
+            return json($result);
+        }
+        return $this->view->fetch();
+    }
+
+}

+ 72 - 0
application/admin/controller/Package.php

@@ -0,0 +1,72 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\common\controller\Backend;
+
+/**
+ * 套餐管理
+ *
+ * @icon fa fa-circle-o
+ */
+class Package extends Backend
+{
+
+    /**
+     * Package模型对象
+     * @var \app\admin\model\Package
+     */
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new \app\admin\model\Package;
+        $this->view->assign("statusList", $this->model->getStatusList());
+    }
+
+
+
+    /**
+     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     */
+
+
+    /**
+     * 查看
+     */
+    public function index()
+    {
+        //当前是否为关联查询
+        $this->relationSearch = true;
+        //设置过滤方法
+        $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();
+
+            $list = $this->model
+                    ->with(['company','servicetype'])
+                    ->where($where)
+                    ->order($sort, $order)
+                    ->paginate($limit);
+
+            foreach ($list as $row) {
+                
+                $row->getRelation('company')->visible(['name']);
+				$row->getRelation('servicetype')->visible(['title']);
+            }
+
+            $result = array("total" => $list->total(), "rows" => $list->items());
+
+            return json($result);
+        }
+        return $this->view->fetch();
+    }
+
+}

+ 71 - 0
application/admin/controller/RechargeConfig.php

@@ -0,0 +1,71 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\common\controller\Backend;
+
+/**
+ * 储值卡
+ *
+ * @icon fa fa-circle-o
+ */
+class RechargeConfig extends Backend
+{
+
+    /**
+     * RechargeConfig模型对象
+     * @var \app\admin\model\RechargeConfig
+     */
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new \app\admin\model\RechargeConfig;
+        $this->view->assign("statusList", $this->model->getStatusList());
+    }
+
+
+
+    /**
+     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     */
+
+
+    /**
+     * 查看
+     */
+    public function index()
+    {
+        //当前是否为关联查询
+        $this->relationSearch = true;
+        //设置过滤方法
+        $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();
+
+            $list = $this->model
+                    ->with(['company'])
+                    ->where($where)
+                    ->order($sort, $order)
+                    ->paginate($limit);
+
+            foreach ($list as $row) {
+                
+                $row->getRelation('company')->visible(['name']);
+            }
+
+            $result = array("total" => $list->total(), "rows" => $list->items());
+
+            return json($result);
+        }
+        return $this->view->fetch();
+    }
+
+}

+ 71 - 0
application/admin/controller/RechargeGift.php

@@ -0,0 +1,71 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\common\controller\Backend;
+
+/**
+ * 储值卡赠送卡券管理
+ *
+ * @icon fa fa-circle-o
+ */
+class RechargeGift extends Backend
+{
+
+    /**
+     * RechargeGift模型对象
+     * @var \app\admin\model\RechargeGift
+     */
+    protected $model = null;
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new \app\admin\model\RechargeGift;
+
+    }
+
+
+
+    /**
+     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     */
+
+
+    /**
+     * 查看
+     */
+    public function index()
+    {
+        //当前是否为关联查询
+        $this->relationSearch = true;
+        //设置过滤方法
+        $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();
+
+            $list = $this->model
+                    ->with(['coupons'])
+                    ->where($where)
+                    ->order($sort, $order)
+                    ->paginate($limit);
+
+            foreach ($list as $row) {
+                
+                $row->getRelation('coupons')->visible(['name','info','days']);
+            }
+
+            $result = array("total" => $list->total(), "rows" => $list->items());
+
+            return json($result);
+        }
+        return $this->view->fetch();
+    }
+
+}

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

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

+ 50 - 0
application/admin/lang/zh-cn/order.php

@@ -0,0 +1,50 @@
+<?php
+
+return [
+    'Id'                 => '主键ID',
+    'Orderno'            => '订单号',
+    'Ordertype'          => '类型',
+    'Ordertype 1'        => '预约下单',
+    'Ordertype 2'        => '在线下单',
+    'Ordertype 3'        => '套餐订单',
+    'Company_id'         => '门店ID',
+    'Staff_id'           => '员工ID',
+    'User_id'            => '用户ID',
+    'User_name'          => '用户姓名',
+    'User_car_id'        => '车辆ID',
+    'User_car_number'    => '用户车牌',
+    'User_mobile'        => '用户手机',
+    'User_address'       => '用户地址',
+    'Pre_order_id'       => '预约单ID',
+    'Servicetype_id'     => '服务类型ID',
+    'Server_time'        => '服务时间',
+    'Server_info'        => '服务内容(套餐内容)',
+    'Server_images'      => '服务图片(套餐图片)',
+    'Package_id'         => '套餐ID',
+    'Package_endtime'    => '套餐到期时间',
+    'Status'             => '状态',
+    'Status 2'           => '待处理',
+    'Status 3'           => '已完成',
+    'Status 4'           => '已取消',
+    'Pay_time'           => '套餐支付时间',
+    'Paytype'            => '支付方式',
+    'Paytype 1'          => '线下',
+    'Paytype 2'          => '余额',
+    'Paytype 3'          => '微信',
+    'Pay_fee'            => '支付总额(套餐价格)',
+    'Appen_fee'          => '追加付费总计',
+    'Total_fee'          => '订单总额',
+    'Createtime'         => '下单时间',
+    'Hexiao_time'        => '核销时间',
+    'Cancel_time'        => '取消时间',
+    'Cancel_reason'      => '取消原因',
+    'Finish_time'        => '完成时间',
+    'Next_date'          => '下次保养日期',
+    'Next_carlicheng'    => '汽车公里数',
+    'Pay_order_id'       => '支付ID',
+    'Company.name'       => '店铺名称',
+    'Staff.truename'     => '员工姓名',
+    'User.nickname'      => '昵称',
+    'Order.pre_order_no' => '预约单号',
+    'Servicetype.title'  => '标题'
+];

+ 23 - 0
application/admin/lang/zh-cn/package.php

@@ -0,0 +1,23 @@
+<?php
+
+return [
+    'Id'                => 'ID',
+    'Company_id'        => '门店ID',
+    'Title'             => '主标题',
+    'Info'              => '副标题',
+    'Servicetype_id'    => '服务类型ID',
+    'Images'            => '主图',
+    'Days'              => '有效期天数',
+    'Price'             => '套餐价格',
+    'Oldprice'          => '原价',
+    'Content'           => '套餐详情',
+    'Content_images'    => '套餐图集',
+    'Weigh'             => '权重排序',
+    'Status'            => '状态',
+    'Status 1'          => '上架',
+    'Status 0'          => '下架',
+    'Createtime'        => '创建时间',
+    'Updatetime'        => '更新时间',
+    'Company.name'      => '店铺名称',
+    'Servicetype.title' => '标题'
+];

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

@@ -2,6 +2,7 @@
 
 return [
     'Id'                 => '主键ID',
+    'Pre_order_no'       => '预约单号',
     'Company_id'         => '门店ID',
     'Company_name'       => '门店名称',
     'User_id'            => '用户ID',

+ 12 - 0
application/admin/lang/zh-cn/recharge_config.php

@@ -0,0 +1,12 @@
+<?php
+
+return [
+    'Id'           => 'ID',
+    'Company_id'   => '门店ID',
+    'Price'        => '充值金额',
+    'Giftprice'    => '赠送金额',
+    'Status'       => '状态',
+    'Status 1'     => '上架',
+    'Status 0'     => '下架',
+    'Company.name' => '门店名称'
+];

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

@@ -0,0 +1,11 @@
+<?php
+
+return [
+    'Id'           => 'ID',
+    'Config_id'    => '储值卡id',
+    'Coupon_id'    => '卡券ID',
+    'Number'       => '卡券数量',
+    'Coupons.name' => '卡券名称',
+    'Coupons.info' => '卡券说明',
+    'Coupons.days' => '有效期(天)',
+];

+ 10 - 0
application/admin/lang/zh-cn/shopro_area.php

@@ -0,0 +1,10 @@
+<?php
+
+return [
+    'Name'          => '名称',
+    'Pid'           => '上级',
+    'Province_id'   => '省ID',
+    'Province_name' => '省名',
+    'City_id'       => '市ID',
+    'City_name'     => '市名'
+];

+ 181 - 0
application/admin/model/Order.php

@@ -0,0 +1,181 @@
+<?php
+
+namespace app\admin\model;
+
+use think\Model;
+
+
+class Order extends Model
+{
+
+    
+
+    
+
+    // 表名
+    protected $name = 'order';
+    
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = 'integer';
+
+    // 定义时间戳字段名
+    protected $createTime = 'createtime';
+    protected $updateTime = false;
+    protected $deleteTime = false;
+
+    // 追加属性
+    protected $append = [
+        'ordertype_text',
+        'server_time_text',
+        'package_endtime_text',
+        'status_text',
+        'pay_time_text',
+        'paytype_text',
+        'hexiao_time_text',
+        'cancel_time_text',
+        'finish_time_text'
+    ];
+    
+
+    
+    public function getOrdertypeList()
+    {
+        return ['1' => __('Ordertype 1'), '2' => __('Ordertype 2'), '3' => __('Ordertype 3')];
+    }
+
+    public function getStatusList()
+    {
+        return ['2' => __('Status 2'), '3' => __('Status 3'), '4' => __('Status 4')];
+    }
+
+    public function getPaytypeList()
+    {
+        return ['1' => __('Paytype 1'), '2' => __('Paytype 2'), '3' => __('Paytype 3')];
+    }
+
+
+    public function getOrdertypeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['ordertype']) ? $data['ordertype'] : '');
+        $list = $this->getOrdertypeList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
+
+
+    public function getServerTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['server_time']) ? $data['server_time'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+
+    public function getPackageEndtimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['package_endtime']) ? $data['package_endtime'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+
+    public function getStatusTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+        $list = $this->getStatusList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
+
+
+    public function getPayTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['pay_time']) ? $data['pay_time'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+
+    public function getPaytypeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['paytype']) ? $data['paytype'] : '');
+        $list = $this->getPaytypeList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
+
+
+    public function getHexiaoTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['hexiao_time']) ? $data['hexiao_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 getFinishTimeTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['finish_time']) ? $data['finish_time'] : '');
+        return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
+    }
+
+    protected function setServerTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+    protected function setPackageEndtimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+    protected function setPayTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+    protected function setHexiaoTimeAttr($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);
+    }
+
+    protected function setFinishTimeAttr($value)
+    {
+        return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
+    }
+
+
+    public function company()
+    {
+        return $this->belongsTo('Company', 'company_id', 'id', [], 'LEFT')->setEagerlyType(0);
+    }
+
+
+    public function staff()
+    {
+        return $this->belongsTo('app\admin\model\company\Staff', 'staff_id', 'id', [], 'LEFT')->setEagerlyType(0);
+    }
+
+
+    public function user()
+    {
+        return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
+    }
+
+
+    public function preOrder()
+    {
+        return $this->belongsTo('app\admin\model\pre\Order', 'pre_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
+    }
+
+
+    public function servicetype()
+    {
+        return $this->belongsTo('Servicetype', 'servicetype_id', 'id', [], 'LEFT')->setEagerlyType(0);
+    }
+}

+ 67 - 0
application/admin/model/Package.php

@@ -0,0 +1,67 @@
+<?php
+
+namespace app\admin\model;
+
+use think\Model;
+
+
+class Package extends Model
+{
+
+    
+
+    
+
+    // 表名
+    protected $name = 'package';
+    
+    // 自动写入时间戳字段
+    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 ['1' => __('Status 1'), '0' => __('Status 0')];
+    }
+
+
+    public function getStatusTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+        $list = $this->getStatusList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
+
+
+
+
+    public function company()
+    {
+        return $this->belongsTo('Company', 'company_id', 'id', [], 'LEFT')->setEagerlyType(0);
+    }
+
+
+    public function servicetype()
+    {
+        return $this->belongsTo('Servicetype', 'servicetype_id', 'id', [], 'LEFT')->setEagerlyType(0);
+    }
+}

+ 53 - 0
application/admin/model/RechargeConfig.php

@@ -0,0 +1,53 @@
+<?php
+
+namespace app\admin\model;
+
+use think\Model;
+
+
+class RechargeConfig extends Model
+{
+
+    
+
+    
+
+    // 表名
+    protected $name = 'recharge_config';
+    
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = false;
+
+    // 定义时间戳字段名
+    protected $createTime = false;
+    protected $updateTime = false;
+    protected $deleteTime = false;
+
+    // 追加属性
+    protected $append = [
+        'status_text'
+    ];
+    
+
+    
+    public function getStatusList()
+    {
+        return ['1' => __('Status 1'), '0' => __('Status 0')];
+    }
+
+
+    public function getStatusTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
+        $list = $this->getStatusList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
+
+
+
+
+    public function company()
+    {
+        return $this->belongsTo('Company', 'company_id', 'id', [], 'LEFT')->setEagerlyType(0);
+    }
+}

+ 44 - 0
application/admin/model/RechargeGift.php

@@ -0,0 +1,44 @@
+<?php
+
+namespace app\admin\model;
+
+use think\Model;
+
+
+class RechargeGift extends Model
+{
+
+    
+
+    
+
+    // 表名
+    protected $name = 'recharge_gift';
+    
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = false;
+
+    // 定义时间戳字段名
+    protected $createTime = false;
+    protected $updateTime = false;
+    protected $deleteTime = false;
+
+    // 追加属性
+    protected $append = [
+
+    ];
+    
+
+    
+
+
+
+
+
+
+
+    public function coupons()
+    {
+        return $this->belongsTo('Coupons', 'coupon_id', 'id', [], 'LEFT')->setEagerlyType(0);
+    }
+}

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

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

+ 12 - 0
application/admin/model/company/Staff.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace app\admin\model\company;
+
+use think\Model;
+
+class Staff extends Model
+{
+    // 表名
+    protected $name = 'company_staff';
+    
+}

+ 12 - 0
application/admin/model/pre/Order.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace app\admin\model\pre;
+
+use think\Model;
+
+class Order extends Model
+{
+    // 表名
+    protected $name = 'pre_order';
+    
+}

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

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

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

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

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

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

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

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

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

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

+ 5 - 5
application/admin/view/company/add.html

@@ -32,7 +32,7 @@
             <input id="c-mobile" class="form-control" name="row[mobile]" type="text" value="">
         </div>
     </div>
-    <div class="form-group">
+    <!--<div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Province_name')}:</label>
         <div class="col-xs-12 col-sm-8">
             <input id="c-province_name" class="form-control" name="row[province_name]" type="text" value="">
@@ -49,23 +49,23 @@
         <div class="col-xs-12 col-sm-8">
             <input id="c-area_name" class="form-control" name="row[area_name]" type="text" value="">
         </div>
-    </div>
+    </div>-->
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Province_id')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-province_id" data-rule="required" data-source="province/index" class="form-control selectpage" name="row[province_id]" type="text" value="">
+            <input id="c-province_id" data-rule="required" data-source="shopro_area/index" data-params='{"custom[level]":1}' class="form-control selectpage" name="row[province_id]" type="text" value="">
         </div>
     </div>
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('City_id')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-city_id" data-rule="required" data-source="city/index" class="form-control selectpage" name="row[city_id]" type="text" value="">
+            <input id="c-city_id" data-rule="required" data-source="shopro_area/index" data-params='{"custom[level]":2}' class="form-control selectpage" name="row[city_id]" type="text" value="">
         </div>
     </div>
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Area_id')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-area_id" data-rule="required" data-source="area/index" class="form-control selectpage" name="row[area_id]" type="text" value="">
+            <input id="c-area_id" data-rule="required" data-source="shopro_area/index" data-params='{"custom[level]":3}' class="form-control selectpage" name="row[area_id]" type="text" value="">
         </div>
     </div>
     <div class="form-group">

+ 5 - 5
application/admin/view/company/edit.html

@@ -32,7 +32,7 @@
             <input id="c-mobile" class="form-control" name="row[mobile]" type="text" value="{$row.mobile|htmlentities}">
         </div>
     </div>
-    <div class="form-group">
+    <!--<div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Province_name')}:</label>
         <div class="col-xs-12 col-sm-8">
             <input id="c-province_name" class="form-control" name="row[province_name]" type="text" value="{$row.province_name|htmlentities}">
@@ -49,23 +49,23 @@
         <div class="col-xs-12 col-sm-8">
             <input id="c-area_name" class="form-control" name="row[area_name]" type="text" value="{$row.area_name|htmlentities}">
         </div>
-    </div>
+    </div>-->
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Province_id')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-province_id" data-rule="required" data-source="province/index" class="form-control selectpage" name="row[province_id]" type="text" value="{$row.province_id|htmlentities}">
+            <input id="c-province_id" data-rule="required" data-source="shopro_area/index" data-params='{"custom[level]":1}' class="form-control selectpage" name="row[province_id]" type="text" value="{$row.province_id|htmlentities}">
         </div>
     </div>
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('City_id')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-city_id" data-rule="required" data-source="city/index" class="form-control selectpage" name="row[city_id]" type="text" value="{$row.city_id|htmlentities}">
+            <input id="c-city_id" data-rule="required" data-source="shopro_area/index" data-params='{"custom[level]":2}' class="form-control selectpage" name="row[city_id]" type="text" value="{$row.city_id|htmlentities}">
         </div>
     </div>
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Area_id')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-area_id" data-rule="required" data-source="area/index" class="form-control selectpage" name="row[area_id]" type="text" value="{$row.area_id|htmlentities}">
+            <input id="c-area_id" data-rule="required" data-source="shopro_area/index" data-params='{"custom[level]":3}' class="form-control selectpage" name="row[area_id]" type="text" value="{$row.area_id|htmlentities}">
         </div>
     </div>
     <div class="form-group">

+ 216 - 0
application/admin/view/order/add.html

@@ -0,0 +1,216 @@
+<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">{:__('Orderno')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-orderno" data-rule="required" class="form-control" name="row[orderno]" type="text">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Ordertype')}:</label>
+        <div class="col-xs-12 col-sm-8">
+                        
+            <select  id="c-ordertype" data-rule="required" class="form-control selectpicker" name="row[ordertype]">
+                {foreach name="ordertypeList" item="vo"}
+                    <option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
+    <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">{:__('Staff_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-staff_id" data-rule="required" data-source="staff/index" class="form-control selectpage" name="row[staff_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">{:__('User_name')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-user_name" class="form-control" name="row[user_name]" type="text">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('User_car_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-user_car_id" data-rule="required" data-source="user/car/index" class="form-control selectpage" name="row[user_car_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('User_car_number')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-user_car_number" class="form-control" name="row[user_car_number]" type="text">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('User_mobile')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-user_mobile" class="form-control" name="row[user_mobile]" type="text">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('User_address')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-user_address" class="form-control" name="row[user_address]" type="text">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Pre_order_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-pre_order_id" data-rule="required" data-source="pre/order/index" class="form-control selectpage" name="row[pre_order_id]" 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" 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">{:__('Server_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-server_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[server_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Server_info')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-server_info" class="form-control" name="row[server_info]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Server_images')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-server_images" class="form-control" size="50" name="row[server_images]" type="text">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-server_images" class="btn btn-danger faupload" data-input-id="c-server_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-server_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-server_images" class="btn btn-primary fachoose" data-input-id="c-server_images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-server_images"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-server_images"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Package_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-package_id" data-rule="required" data-source="package/index" class="form-control selectpage" name="row[package_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Package_endtime')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-package_endtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[package_endtime]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </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="2"}checked{/in} /> {$vo}</label> 
+            {/foreach}
+            </div>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Pay_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-pay_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[pay_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Paytype')}:</label>
+        <div class="col-xs-12 col-sm-8">
+                        
+            <select  id="c-paytype" class="form-control selectpicker" name="row[paytype]">
+                {foreach name="paytypeList" item="vo"}
+                    <option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Pay_fee')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-pay_fee" class="form-control" step="0.01" name="row[pay_fee]" type="number" value="0.00">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Appen_fee')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-appen_fee" class="form-control" step="0.01" name="row[appen_fee]" type="number" value="0.00">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Total_fee')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-total_fee" class="form-control" step="0.01" name="row[total_fee]" type="number">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Hexiao_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-hexiao_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[hexiao_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </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="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[cancel_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </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="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Finish_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-finish_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[finish_time]" type="text" value="{:date('Y-m-d H:i:s')}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Next_date')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-next_date" class="form-control" name="row[next_date]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Next_carlicheng')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-next_carlicheng" class="form-control" name="row[next_carlicheng]" type="text">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Pay_order_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-pay_order_id" data-rule="required" data-source="pay/order/index" class="form-control selectpage" name="row[pay_order_id]" 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>

+ 216 - 0
application/admin/view/order/edit.html

@@ -0,0 +1,216 @@
+<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">{:__('Orderno')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-orderno" data-rule="required" class="form-control" name="row[orderno]" type="text" value="{$row.orderno|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Ordertype')}:</label>
+        <div class="col-xs-12 col-sm-8">
+                        
+            <select  id="c-ordertype" data-rule="required" class="form-control selectpicker" name="row[ordertype]">
+                {foreach name="ordertypeList" item="vo"}
+                    <option value="{$key}" {in name="key" value="$row.ordertype"}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
+    <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">{:__('Staff_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-staff_id" data-rule="required" data-source="staff/index" class="form-control selectpage" name="row[staff_id]" type="text" value="{$row.staff_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">{:__('User_name')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-user_name" class="form-control" name="row[user_name]" type="text" value="{$row.user_name|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('User_car_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-user_car_id" data-rule="required" data-source="user/car/index" class="form-control selectpage" name="row[user_car_id]" type="text" value="{$row.user_car_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('User_car_number')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-user_car_number" class="form-control" name="row[user_car_number]" type="text" value="{$row.user_car_number|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('User_mobile')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-user_mobile" class="form-control" name="row[user_mobile]" type="text" value="{$row.user_mobile|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('User_address')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-user_address" class="form-control" name="row[user_address]" type="text" value="{$row.user_address|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Pre_order_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-pre_order_id" data-rule="required" data-source="pre/order/index" class="form-control selectpage" name="row[pre_order_id]" type="text" value="{$row.pre_order_id|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" 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">{:__('Server_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-server_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[server_time]" type="text" value="{:$row.server_time?datetime($row.server_time):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Server_info')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-server_info" class="form-control" name="row[server_info]" type="text" value="{$row.server_info|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Server_images')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-server_images" class="form-control" size="50" name="row[server_images]" type="text" value="{$row.server_images|htmlentities}">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-server_images" class="btn btn-danger faupload" data-input-id="c-server_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-server_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-server_images" class="btn btn-primary fachoose" data-input-id="c-server_images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-server_images"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-server_images"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Package_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-package_id" data-rule="required" data-source="package/index" class="form-control selectpage" name="row[package_id]" type="text" value="{$row.package_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Package_endtime')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-package_endtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[package_endtime]" type="text" value="{:$row.package_endtime?datetime($row.package_endtime):''}">
+        </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">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Pay_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-pay_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[pay_time]" type="text" value="{:$row.pay_time?datetime($row.pay_time):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Paytype')}:</label>
+        <div class="col-xs-12 col-sm-8">
+                        
+            <select  id="c-paytype" class="form-control selectpicker" name="row[paytype]">
+                {foreach name="paytypeList" item="vo"}
+                    <option value="{$key}" {in name="key" value="$row.paytype"}selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Pay_fee')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-pay_fee" class="form-control" step="0.01" name="row[pay_fee]" type="number" value="{$row.pay_fee|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Appen_fee')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-appen_fee" class="form-control" step="0.01" name="row[appen_fee]" type="number" value="{$row.appen_fee|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Total_fee')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-total_fee" class="form-control" step="0.01" name="row[total_fee]" type="number" value="{$row.total_fee|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Hexiao_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-hexiao_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[hexiao_time]" type="text" value="{:$row.hexiao_time?datetime($row.hexiao_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="required" 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">{:__('Finish_time')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-finish_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[finish_time]" type="text" value="{:$row.finish_time?datetime($row.finish_time):''}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Next_date')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-next_date" class="form-control" name="row[next_date]" type="text" value="{$row.next_date|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Next_carlicheng')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-next_carlicheng" class="form-control" name="row[next_carlicheng]" type="text" value="{$row.next_carlicheng|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Pay_order_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-pay_order_id" data-rule="required" data-source="pay/order/index" class="form-control selectpage" name="row[pay_order_id]" type="text" value="{$row.pay_order_id|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>

+ 45 - 0
application/admin/view/order/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('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('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('order/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
+                        
+
+                        <div class="dropdown btn-group {:$auth->check('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('order/edit')}"
+                           data-operate-del="{:$auth->check('order/del')}"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 104 - 0
application/admin/view/package/add.html

@@ -0,0 +1,104 @@
+<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">{:__('Title')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-title" 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">{:__('Info')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-info" class="form-control" name="row[info]" 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">{:__('Images')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-images" 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="false" 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>
+                </div>
+                <span class="msg-box n-right" for="c-images"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-images"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Days')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-days" class="form-control" name="row[days]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-price" class="form-control" step="0.01" name="row[price]" type="number" value="0.00">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Oldprice')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-oldprice" class="form-control" step="0.01" name="row[oldprice]" type="number" value="0.00">
+        </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">{:__('Content_images')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-content_images" class="form-control" size="50" name="row[content_images]" type="textarea">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-content_images" class="btn btn-danger faupload" data-input-id="c-content_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-content_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-content_images" class="btn btn-primary fachoose" data-input-id="c-content_images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-content_images"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-content_images"></ul>
+        </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="1">
+        </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="1"}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>

+ 104 - 0
application/admin/view/package/edit.html

@@ -0,0 +1,104 @@
+<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">{:__('Title')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-title" 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">{:__('Info')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-info" class="form-control" name="row[info]" type="text" value="{$row.info|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">{:__('Images')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-images" 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="false" 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>
+                </div>
+                <span class="msg-box n-right" for="c-images"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-images"></ul>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Days')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-days" class="form-control" name="row[days]" type="number" value="{$row.days|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-price" class="form-control" step="0.01" name="row[price]" type="number" value="{$row.price|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Oldprice')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-oldprice" class="form-control" step="0.01" name="row[oldprice]" type="number" value="{$row.oldprice|htmlentities}">
+        </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">{:__('Content_images')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="input-group">
+                <input id="c-content_images" class="form-control" size="50" name="row[content_images]" type="textarea" value="{$row.content_images|htmlentities}">
+                <div class="input-group-addon no-border no-padding">
+                    <span><button type="button" id="faupload-content_images" class="btn btn-danger faupload" data-input-id="c-content_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-content_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
+                    <span><button type="button" id="fachoose-content_images" class="btn btn-primary fachoose" data-input-id="c-content_images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
+                </div>
+                <span class="msg-box n-right" for="c-content_images"></span>
+            </div>
+            <ul class="row list-inline faupload-preview" id="p-content_images"></ul>
+        </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/package/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('package/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('package/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('package/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
+                        
+
+                        <div class="dropdown btn-group {:$auth->check('package/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('package/edit')}"
+                           data-operate-del="{:$auth->check('package/del')}"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 40 - 0
application/admin/view/recharge_config/add.html

@@ -0,0 +1,40 @@
+<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">{:__('Price')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-price" data-rule="required" class="form-control" step="0.01" name="row[price]" type="number" value="0.00">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Giftprice')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-giftprice" data-rule="required" class="form-control" step="0.01" name="row[giftprice]" type="number" value="0.00">
+        </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="1"}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>

+ 41 - 0
application/admin/view/recharge_config/edit.html

@@ -0,0 +1,41 @@
+<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">{:__('Price')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-price" data-rule="required" class="form-control" step="0.01" name="row[price]" type="number" value="{$row.price|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Giftprice')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-giftprice" data-rule="required" class="form-control" step="0.01" name="row[giftprice]" type="number" value="{$row.giftprice|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/recharge_config/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('recharge_config/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('recharge_config/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('recharge_config/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
+                        
+
+                        <div class="dropdown btn-group {:$auth->check('recharge_config/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('recharge_config/edit')}"
+                           data-operate-del="{:$auth->check('recharge_config/del')}"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 28 - 0
application/admin/view/recharge_gift/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">{:__('Config_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-config_id" data-rule="required" data-source="config/index" class="form-control selectpage" name="row[config_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Coupon_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-coupon_id" data-rule="required" data-source="coupon/index" class="form-control selectpage" name="row[coupon_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Number')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-number" class="form-control" name="row[number]" type="number">
+        </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/recharge_gift/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">{:__('Config_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-config_id" data-rule="required" data-source="config/index" class="form-control selectpage" name="row[config_id]" type="text" value="{$row.config_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Coupon_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-coupon_id" data-rule="required" data-source="coupon/index" class="form-control selectpage" name="row[coupon_id]" type="text" value="{$row.coupon_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Number')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-number" class="form-control" name="row[number]" type="number" value="{$row.number|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/recharge_gift/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('recharge_gift/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('recharge_gift/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('recharge_gift/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
+                        
+
+                        <div class="dropdown btn-group {:$auth->check('recharge_gift/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('recharge_gift/edit')}"
+                           data-operate-del="{:$auth->check('recharge_gift/del')}"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 52 - 0
application/admin/view/shopro_area/add.html

@@ -0,0 +1,52 @@
+<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">{:__('Name')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-name" class="form-control" name="row[name]" type="text">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Pid')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-pid" class="form-control" name="row[pid]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Level')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-level" class="form-control" name="row[level]" type="number" value="1">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Province_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-province_id" data-rule="required" data-source="province/index" class="form-control selectpage" name="row[province_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Province_name')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-province_name" class="form-control" name="row[province_name]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('City_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-city_id" data-rule="required" data-source="city/index" class="form-control selectpage" name="row[city_id]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('City_name')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-city_name" class="form-control" name="row[city_name]" 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>

+ 52 - 0
application/admin/view/shopro_area/edit.html

@@ -0,0 +1,52 @@
+<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">{:__('Name')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-name" 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">{:__('Pid')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-pid" class="form-control" name="row[pid]" type="number" value="{$row.pid|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Level')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-level" class="form-control" name="row[level]" type="number" value="{$row.level|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Province_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-province_id" data-rule="required" data-source="province/index" class="form-control selectpage" name="row[province_id]" type="text" value="{$row.province_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Province_name')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-province_name" class="form-control" name="row[province_name]" type="text" value="{$row.province_name|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('City_id')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-city_id" data-rule="required" data-source="city/index" class="form-control selectpage" name="row[city_id]" type="text" value="{$row.city_id|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('City_name')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-city_name" class="form-control" name="row[city_name]" type="text" value="{$row.city_name|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/shopro_area/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('shopro_area/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('shopro_area/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('shopro_area/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
+                        
+
+                        <div class="dropdown btn-group {:$auth->check('shopro_area/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('shopro_area/edit')}"
+                           data-operate-del="{:$auth->check('shopro_area/del')}"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 1 - 0
application/api/controller/Companys.php

@@ -191,6 +191,7 @@ class Companys extends Api
             $areaData = getProvince($this->request->param());
             $fullAddress = $areaData['full_address'];
             $data = [
+                'image' => '/assets/img/avatar.png',//默认头像
                 'contacts' => $this->request->param('contacts', ''),
                 'mobile'  => $this->request->param('mobile', ''),
                 'province_id'  => $this->request->param('province_id', 0),

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

@@ -138,7 +138,7 @@ class Order extends Api
             $text = 'hexiaoorder_'.$id;
             $logo = '';
             $filRoute = '/uploads/temp/';
-            $saveDir = ROOT_PATH.'public\uploads\temp'.DS;
+            $saveDir = ROOT_PATH.'public/uploads/temp'.DS;
             $fileStr = md5('order_'.$id);
             $localpng = $saveDir.$fileStr.'.png';
             //验证存在直接返回

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

@@ -235,7 +235,7 @@ class Pay extends Api
             //创建订单
             $data['company_id'] = $companyId;
             $data['user_id'] = $uid;
-            $data['out_trade_no'] = createUniqueNo('R',$uid); // 数据库订单号加密
+            $data['out_trade_no'] = createUniqueNo('P',$uid); // 数据库订单号加密
             $data['order_amount'] = $order_amount;
             $data['gift_amount'] = $gift_amount;
             $data['createtime'] = time();

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

@@ -92,6 +92,7 @@ class PreOrder extends Api
                 'pre_time'       => $preTime,
             ];
             if (empty($id)) {
+                $data['pre_order_no'] = createUniqueNo('PO',$userId);
                 $data['user_id'] = $userId;
                 $data['createtime'] = $time;
                 $res = $this->model->insertGetId($data);

+ 1 - 0
application/common/service/OrderService.php

@@ -135,6 +135,7 @@ class OrderService
                 }
                 //生成订单
                 $params['order_paytype'] = 2;//支付方式:1=线下,2=余额,3=微信
+                $params['pay_order_id'] = $payOrderId;
                 $orderRes = $this->addOrder($params);
                 if (!$orderRes['status']) {
                     throw new Exception($orderRes['msg']);

+ 1 - 1
application/extra/addons.php

@@ -18,7 +18,7 @@ return [
         ],
         'config_init' => [
             'qcloudsms',
-            'summernote',
+            'umeditor',
         ],
         'sms_send' => [
             'qcloudsms',

+ 87 - 0
public/assets/addons/umeditor/dialogs/emotion/emotion.css

@@ -0,0 +1,87 @@
+.edui-popup-emotion .edui-emotion-jd img{
+    background:transparent url(images/jxface2.gif?v=1.1) no-repeat scroll left top;
+    cursor:pointer;width:35px;height:35px;display:block;
+}
+.edui-popup-emotion .edui-emotion-pp img{
+    background:transparent url(images/fface.gif?v=1.1) no-repeat scroll left top;
+    cursor:pointer;width:25px;height:25px;display:block;
+}
+
+.edui-popup-emotion .edui-emotion-ldw img{
+    background:transparent url(images/wface.gif?v=1.1) no-repeat scroll left top;
+    cursor:pointer;width:35px;height:35px;display:block;
+}
+
+.edui-popup-emotion .edui-emotion-tsj img{
+    background:transparent url(images/tface.gif?v=1.1) no-repeat scroll left top;
+    cursor:pointer;width:35px;height:35px;display:block;
+}
+
+.edui-popup-emotion .edui-emotion-cat img{
+    background:transparent url(images/cface.gif?v=1.1) no-repeat scroll left top;
+    cursor:pointer;width:35px;height:35px;display:block;
+}
+
+.edui-popup-emotion .edui-emotion-bb img{
+    background:transparent url(images/bface.gif?v=1.1) no-repeat scroll left top;
+    cursor:pointer;width:35px;height:35px;display:block;
+}
+
+.edui-popup-emotion .edui-emotion-youa img{
+    background:transparent url(images/yface.gif?v=1.1) no-repeat scroll left top;
+    cursor:pointer;width:35px;height:35px;display:block;
+}
+
+.edui-popup-emotion .edui-emotion-smileytable {
+    width: 100%;
+    border-spacing: 0;
+    border-collapse: collapse;
+    table-layout: fixed;
+}
+
+.edui-popup-emotion .edui-emotion-wrapper {
+    padding: 15px;
+}
+
+.edui-popup-emotion .edui-tab-nav{
+    height: auto;
+    *height: 31px;
+}
+.edui-popup-emotion .edui-emotion-tabs{
+    clear: both;
+    width: 0;
+    height: 0;
+}
+
+.edui-popup-emotion .edui-tab-content {
+    padding: 15px 0;
+}
+
+.edui-popup-emotion .edui-emotion-preview-box {
+    width:90px;
+    height:76px;
+    border:2px solid #9cb945;
+    background:#FFFFFF;
+    background-position:center;
+    background-repeat:no-repeat;
+    position: absolute;
+    top: 67px;
+    left: 494px;
+    display: none;
+}
+
+.edui-popup-emotion .edui-tab-text {
+    font-size: 12px;
+}
+
+.edui-popup-emotion .edui-emotion-preview-left {
+    left: 15px;
+}
+
+.edui-popup-emotion .edui-emotion-preview-img {
+    width: 100%;
+    height: 100%;
+    display: block;
+    background-repeat: no-repeat;
+    background-position: center center;
+}

+ 272 - 0
public/assets/addons/umeditor/dialogs/emotion/emotion.js

@@ -0,0 +1,272 @@
+(function(){
+
+    var editor = null;
+
+    UM.registerWidget('emotion',{
+
+        tpl: "<link type=\"text/css\" rel=\"stylesheet\" href=\"<%=emotion_url%>emotion.css\">" +
+            "<div class=\"edui-emotion-tab-Jpanel edui-emotion-wrapper\">" +
+            "<ul class=\"edui-emotion-Jtabnav edui-tab-nav\">" +
+            "<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab0\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_choice%></a></li>" +
+            "<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab1\" class=\"edui-tab-text\"><%=lang_input_Tuzki%></a></li>" +
+            "<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab2\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_lvdouwa%></a></li>" +
+            "<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab3\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_BOBO%></a></li>" +
+            "<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab4\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_babyCat%></a></li>" +
+            "<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab5\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_bubble%></a></li>" +
+            "<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab6\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_youa%></a></li>" +
+            "<li class=\"edui-emotion-tabs\"></li>" +
+            "</ul>" +
+            "<div class=\"edui-tab-content edui-emotion-JtabBodys\">" +
+            "<div class=\"edui-emotion-Jtab0 edui-tab-pane\"></div>" +
+            "<div class=\"edui-emotion-Jtab1 edui-tab-pane\"></div>" +
+            "<div class=\"edui-emotion-Jtab2 edui-tab-pane\"></div>" +
+            "<div class=\"edui-emotion-Jtab3 edui-tab-pane\"></div>" +
+            "<div class=\"edui-emotion-Jtab4 edui-tab-pane\"></div>" +
+            "<div class=\"edui-emotion-Jtab5 edui-tab-pane\"></div>" +
+            "<div class=\"edui-emotion-Jtab6 edui-tab-pane\"></div>" +
+            "</div>" +
+            "<div class=\"edui-emotion-JtabIconReview edui-emotion-preview-box\">" +
+            "<img src=\"<%=cover_img%>\" class=\'edui-emotion-JfaceReview edui-emotion-preview-img\'/>" +
+            "</div>",
+
+        sourceData: {
+            emotion: {
+                tabNum:7, //切换面板数量
+                SmilmgName:{ 'edui-emotion-Jtab0':['j_00', 84], 'edui-emotion-Jtab1':['t_00', 40], 'edui-emotion-Jtab2':['w_00', 52], 'edui-emotion-Jtab3':['B_00', 63], 'edui-emotion-Jtab4':['C_00', 20], 'edui-emotion-Jtab5':['i_f', 50], 'edui-emotion-Jtab6':['y_00', 40] }, //图片前缀名
+                imageFolders:{ 'edui-emotion-Jtab0':'jx2/', 'edui-emotion-Jtab1':'tsj/', 'edui-emotion-Jtab2':'ldw/', 'edui-emotion-Jtab3':'bobo/', 'edui-emotion-Jtab4':'babycat/', 'edui-emotion-Jtab5':'face/', 'edui-emotion-Jtab6':'youa/'}, //图片对应文件夹路径
+                imageCss:{'edui-emotion-Jtab0':'jd', 'edui-emotion-Jtab1':'tsj', 'edui-emotion-Jtab2':'ldw', 'edui-emotion-Jtab3':'bb', 'edui-emotion-Jtab4':'cat', 'edui-emotion-Jtab5':'pp', 'edui-emotion-Jtab6':'youa'}, //图片css类名
+                imageCssOffset:{'edui-emotion-Jtab0':35, 'edui-emotion-Jtab1':35, 'edui-emotion-Jtab2':35, 'edui-emotion-Jtab3':35, 'edui-emotion-Jtab4':35, 'edui-emotion-Jtab5':25, 'edui-emotion-Jtab6':35}, //图片偏移
+                SmileyInfor:{
+                    'edui-emotion-Jtab0':['Kiss', 'Love', 'Yeah', '啊!', '背扭', '顶', '抖胸', '88', '汗', '瞌睡', '鲁拉', '拍砖', '揉脸', '生日快乐', '大笑', '瀑布汗~', '惊讶', '臭美', '傻笑', '抛媚眼', '发怒', '打酱油', '俯卧撑', '气愤', '?', '吻', '怒', '胜利', 'HI', 'KISS', '不说', '不要', '扯花', '大心', '顶', '大惊', '飞吻', '鬼脸', '害羞', '口水', '狂哭', '来', '发财了', '吃西瓜', '套牢', '害羞', '庆祝', '我来了', '敲打', '晕了', '胜利', '臭美', '被打了', '贪吃', '迎接', '酷', '微笑', '亲吻', '调皮', '惊恐', '耍酷', '发火', '害羞', '汗水', '大哭', '', '加油', '困', '你NB', '晕倒', '开心', '偷笑', '大哭', '滴汗', '叹气', '超赞', '??', '飞吻', '天使', '撒花', '生气', '被砸', '吓傻', '随意吐'],
+                    'edui-emotion-Jtab1':['Kiss', 'Love', 'Yeah', '啊!', '背扭', '顶', '抖胸', '88', '汗', '瞌睡', '鲁拉', '拍砖', '揉脸', '生日快乐', '摊手', '睡觉', '瘫坐', '无聊', '星星闪', '旋转', '也不行', '郁闷', '正Music', '抓墙', '撞墙至死', '歪头', '戳眼', '飘过', '互相拍砖', '砍死你', '扔桌子', '少林寺', '什么?', '转头', '我爱牛奶', '我踢', '摇晃', '晕厥', '在笼子里', '震荡'],
+                    'edui-emotion-Jtab2':['大笑', '瀑布汗~', '惊讶', '臭美', '傻笑', '抛媚眼', '发怒', '我错了', 'money', '气愤', '挑逗', '吻', '怒', '胜利', '委屈', '受伤', '说啥呢?', '闭嘴', '不', '逗你玩儿', '飞吻', '眩晕', '魔法', '我来了', '睡了', '我打', '闭嘴', '打', '打晕了', '刷牙', '爆揍', '炸弹', '倒立', '刮胡子', '邪恶的笑', '不要不要', '爱恋中', '放大仔细看', '偷窥', '超高兴', '晕', '松口气', '我跑', '享受', '修养', '哭', '汗', '啊~', '热烈欢迎', '打酱油', '俯卧撑', '?'],
+                    'edui-emotion-Jtab3':['HI', 'KISS', '不说', '不要', '扯花', '大心', '顶', '大惊', '飞吻', '鬼脸', '害羞', '口水', '狂哭', '来', '泪眼', '流泪', '生气', '吐舌', '喜欢', '旋转', '再见', '抓狂', '汗', '鄙视', '拜', '吐血', '嘘', '打人', '蹦跳', '变脸', '扯肉', '吃To', '吃花', '吹泡泡糖', '大变身', '飞天舞', '回眸', '可怜', '猛抽', '泡泡', '苹果', '亲', '', '骚舞', '烧香', '睡', '套娃娃', '捅捅', '舞倒', '西红柿', '爱慕', '摇', '摇摆', '杂耍', '招财', '被殴', '被球闷', '大惊', '理想', '欧打', '呕吐', '碎', '吐痰'],
+                    'edui-emotion-Jtab4':['发财了', '吃西瓜', '套牢', '害羞', '庆祝', '我来了', '敲打', '晕了', '胜利', '臭美', '被打了', '贪吃', '迎接', '酷', '顶', '幸运', '爱心', '躲', '送花', '选择'],
+                    'edui-emotion-Jtab5':['微笑', '亲吻', '调皮', '惊讶', '耍酷', '发火', '害羞', '汗水', '大哭', '得意', '鄙视', '困', '夸奖', '晕倒', '疑问', '媒婆', '狂吐', '青蛙', '发愁', '亲吻', '', '爱心', '心碎', '玫瑰', '礼物', '哭', '奸笑', '可爱', '得意', '呲牙', '暴汗', '楚楚可怜', '困', '哭', '生气', '惊讶', '口水', '彩虹', '夜空', '太阳', '钱钱', '灯泡', '咖啡', '蛋糕', '音乐', '爱', '胜利', '赞', '鄙视', 'OK'],
+                    'edui-emotion-Jtab6':['男兜', '女兜', '开心', '乖乖', '偷笑', '大笑', '抽泣', '大哭', '无奈', '滴汗', '叹气', '狂晕', '委屈', '超赞', '??', '疑问', '飞吻', '天使', '撒花', '生气', '被砸', '口水', '泪奔', '吓傻', '吐舌头', '点头', '随意吐', '旋转', '困困', '鄙视', '狂顶', '篮球', '再见', '欢迎光临', '恭喜发财', '稍等', '我在线', '恕不议价', '库房有货', '货在路上']
+                }
+            }
+        },
+        initContent:function( _editor, $widget ){
+
+            var me = this,
+                emotion = me.sourceData.emotion,
+                lang = _editor.getLang( 'emotion' )['static'],
+                emotionUrl = UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/emotion/',
+                options = $.extend( {}, lang, {
+                    emotion_url: emotionUrl
+                }),
+                $root = me.root();
+
+            if( me.inited ) {
+                me.preventDefault();
+                this.switchToFirst();
+                return;
+            }
+
+            me.inited = true;
+
+            editor = _editor;
+            this.widget = $widget;
+
+            emotion.SmileyPath = _editor.options.emotionLocalization === true ? emotionUrl + 'images/' : "http://img.baidu.com/hi/";
+            emotion.SmileyBox = me.createTabList( emotion.tabNum );
+            emotion.tabExist = me.createArr( emotion.tabNum );
+
+            options['cover_img'] = emotion.SmileyPath + (editor.options.emotionLocalization ? '0.gif' : 'default/0.gif');
+
+            $root.html( $.parseTmpl( me.tpl, options ) );
+
+            me.tabs = $.eduitab({selector:".edui-emotion-tab-Jpanel"});
+
+            //缓存预览对象
+            me.previewBox = $root.find(".edui-emotion-JtabIconReview");
+            me.previewImg = $root.find(".edui-emotion-JfaceReview");
+
+            me.initImgName();
+
+        },
+        initEvent:function(){
+
+            var me = this;
+
+            //防止点击过后关闭popup
+            me.root().on('click', function(e){
+                return false;
+            });
+
+            //移动预览
+            me.root().delegate( 'td', 'mouseover mouseout', function( evt ){
+
+                var $td = $( this),
+                    url = $td.attr('data-surl') || null;
+
+                if( url ) {
+                    me[evt.type]( this, url , $td.attr('data-posflag') );
+                }
+
+                return false;
+
+            } );
+
+            //点击选中
+            me.root().delegate( 'td', 'click', function( evt ){
+
+                var $td = $( this),
+                    realUrl = $td.attr('data-realurl') || null;
+
+                if( realUrl ) {
+                    me.insertSmiley( realUrl.replace( /'/g, "\\'" ), evt );
+                }
+
+                return false;
+
+            } );
+
+            //更新模板
+            me.tabs.edui().on("beforeshow", function( evt ){
+
+                var contentId = $(evt.target).attr('data-context').replace( /^.*\.(?=[^\s]*$)/, '' );
+
+                evt.stopPropagation();
+
+                me.updateTab( contentId );
+
+            });
+
+            this.switchToFirst();
+
+        },
+        initImgName: function() {
+
+            var emotion = this.sourceData.emotion;
+
+            for ( var pro in emotion.SmilmgName ) {
+                var tempName = emotion.SmilmgName[pro],
+                    tempBox = emotion.SmileyBox[pro],
+                    tempStr = "";
+
+                if ( tempBox.length ) return;
+
+                for ( var i = 1; i <= tempName[1]; i++ ) {
+                    tempStr = tempName[0];
+                    if ( i < 10 ) tempStr = tempStr + '0';
+                    tempStr = tempStr + i + '.gif';
+                    tempBox.push( tempStr );
+                }
+            }
+
+        },
+        /**
+         * 切换到第一个tab
+         */
+        switchToFirst: function(){
+            this.root().find(".edui-emotion-Jtabnav .edui-tab-text:first").trigger('click');
+        },
+        updateTab: function( contentBoxId ) {
+
+            var me = this,
+                emotion = me.sourceData.emotion;
+
+            me.autoHeight( contentBoxId );
+
+            if ( !emotion.tabExist[ contentBoxId ] ) {
+
+                emotion.tabExist[ contentBoxId ] = true;
+                me.createTab( contentBoxId );
+
+            }
+
+        },
+        autoHeight: function( ) {
+            this.widget.height(this.root() + 2);
+        },
+        createTabList: function( tabNum ) {
+            var obj = {};
+            for ( var i = 0; i < tabNum; i++ ) {
+                obj["edui-emotion-Jtab" + i] = [];
+            }
+            return obj;
+        },
+        mouseover: function( td, srcPath, posFlag ) {
+
+            posFlag -= 0;
+
+            $(td).css( 'backgroundColor', '#ACCD3C' );
+
+            this.previewImg.css( "backgroundImage", "url(" + srcPath + ")" );
+            posFlag && this.previewBox.addClass('edui-emotion-preview-left');
+            this.previewBox.show();
+
+        },
+        mouseout: function( td ) {
+            $(td).css( 'backgroundColor', 'transparent' );
+            this.previewBox.removeClass('edui-emotion-preview-left').hide();
+        },
+        insertSmiley: function( url, evt ) {
+            var obj = {
+                src: url
+            };
+            obj._src = obj.src;
+            editor.execCommand( 'insertimage', obj );
+            if ( !evt.ctrlKey ) {
+                //关闭预览
+                this.previewBox.removeClass('edui-emotion-preview-left').hide();
+                this.widget.edui().hide();
+            }
+        },
+        createTab: function( contentBoxId ) {
+
+            var faceVersion = "?v=1.1", //版本号
+                me = this,
+                $contentBox = this.root().find("."+contentBoxId),
+                emotion = me.sourceData.emotion,
+                imagePath = emotion.SmileyPath + emotion.imageFolders[ contentBoxId ], //获取显示表情和预览表情的路径
+                positionLine = 11 / 2, //中间数
+                iWidth = iHeight = 35, //图片长宽
+                iColWidth = 3, //表格剩余空间的显示比例
+                tableCss = emotion.imageCss[ contentBoxId ],
+                cssOffset = emotion.imageCssOffset[ contentBoxId ],
+                textHTML = ['<table border="1" class="edui-emotion-smileytable">'],
+                i = 0, imgNum = emotion.SmileyBox[ contentBoxId ].length, imgColNum = 11, faceImage,
+                sUrl, realUrl, posflag, offset, infor;
+
+            for ( ; i < imgNum; ) {
+                textHTML.push( '<tr>' );
+                for ( var j = 0; j < imgColNum; j++, i++ ) {
+                    faceImage = emotion.SmileyBox[ contentBoxId ][i];
+                    if ( faceImage ) {
+                        sUrl = imagePath + faceImage + faceVersion;
+                        realUrl = imagePath + faceImage;
+                        posflag = j < positionLine ? 0 : 1;
+                        offset = cssOffset * i * (-1) - 1;
+                        infor = emotion.SmileyInfor[ contentBoxId ][i];
+
+                        textHTML.push( '<td  class="edui-emotion-' + tableCss + '" data-surl="'+ sUrl +'" data-realurl="'+ realUrl +'" data-posflag="'+ posflag +'" align="center">' );
+                        textHTML.push( '<span>' );
+                        textHTML.push( '<img  style="background-position:left ' + offset + 'px;" title="' + infor + '" src="' + emotion.SmileyPath + (editor.options.emotionLocalization ? '0.gif" width="' : 'default/0.gif" width="') + iWidth + '" height="' + iHeight + '"></img>' );
+                        textHTML.push( '</span>' );
+                    } else {
+                        textHTML.push( '<td bgcolor="#FFFFFF">' );
+                    }
+                    textHTML.push( '</td>' );
+                }
+                textHTML.push( '</tr>' );
+            }
+            textHTML.push( '</table>' );
+            textHTML = textHTML.join( "" );
+            $contentBox.html( textHTML );
+        },
+        createArr: function( tabNum ) {
+            var arr = [];
+            for ( var i = 0; i < tabNum; i++ ) {
+                arr[i] = 0;
+            }
+            return arr;
+        },
+        width:603,
+        height:400
+    });
+
+})();
+

BIN
public/assets/addons/umeditor/dialogs/emotion/images/0.gif


BIN
public/assets/addons/umeditor/dialogs/emotion/images/bface.gif


BIN
public/assets/addons/umeditor/dialogs/emotion/images/cface.gif


BIN
public/assets/addons/umeditor/dialogs/emotion/images/fface.gif


BIN
public/assets/addons/umeditor/dialogs/emotion/images/jxface2.gif


BIN
public/assets/addons/umeditor/dialogs/emotion/images/neweditor-tab-bg.png


BIN
public/assets/addons/umeditor/dialogs/emotion/images/tface.gif


BIN
public/assets/addons/umeditor/dialogs/emotion/images/wface.gif


BIN
public/assets/addons/umeditor/dialogs/emotion/images/yface.gif


+ 32 - 0
public/assets/addons/umeditor/dialogs/formula/formula.css

@@ -0,0 +1,32 @@
+.edui-popup-formula .edui-formula-wrapper {
+    padding: 15px;
+}
+.edui-popup-formula .edui-formula-wrapper .edui-tab-nav{
+    height: auto;
+    *height: 31px;
+}
+.edui-popup-formula .edui-formula-wrapper .edui-tab-text {
+    font-size: 12px;
+}
+.edui-popup-formula .edui-formula-wrapper .edui-formula-clearboth {
+    clear: both;
+    width: 0;
+    height: 0;
+}
+.edui-popup-formula .edui-formula-wrapper .edui-tab-pane ul {
+    margin: 0px;
+    padding: 0px;
+}
+.edui-popup-formula .edui-formula-wrapper .edui-tab-content {
+    padding: 5px 0px 0px 0px;
+}
+.edui-popup-formula .edui-formula-wrapper .edui-tab-pane .edui-formula-latex-item {
+    display: block;
+    float: left;
+    margin: 0px 3px 3px 0px;
+    width: 30px;
+    height: 30px;
+    border:1px solid #cccccc;
+    background-image: url("images/formula.png");
+    cursor: pointer;
+}

+ 168 - 0
public/assets/addons/umeditor/dialogs/formula/formula.html

@@ -0,0 +1,168 @@
+<!doctype html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>Document</title>
+    <link rel="stylesheet" href="../../third-party/mathquill/mathquill.css"/>
+    <style>
+        html, body, .main{
+            margin: 0;
+            padding: 0;
+            overflow: hidden;
+        }
+        .main{
+            width:1024px;
+            height:1024px;
+        }
+        .mathquill-editable,
+        .mathquill-rendered-math{
+            border: 0px;
+            padding: 0px;
+            margin:4px;
+        }
+    </style>
+</head>
+<body>
+
+<div class="main">
+    <div class="mathquill-editable"></div>
+</div>
+
+<div>
+    <input id="blurHelper" />
+</div>
+
+<script src="../../third-party/jquery.min.js"></script>
+<script src="../../third-party/mathquill/mathquill.js"></script>
+<script>
+    $(function(){
+
+        var UM = parent.UM,
+            $iframe = $(getSelfIframe());
+
+        /* 获得当前公式所在的iframe节点 */
+        function getSelfIframe(){
+            var iframes = parent.document.getElementsByTagName('iframe');
+            for (var key in iframes) {
+                if (iframes[key].contentWindow == window) {
+                    return iframes[key];
+                }
+            }
+            return null;
+        }
+        /* 获得当前url上的hash存储的参数值 */
+        function getLatex() {
+            return $iframe.attr('data-latex') || '';
+        }
+        /* 保存场景 */
+        function saveScene(){
+
+        }
+        /* 设置编辑器可编辑 */
+        function enableEditor(){
+        }
+        /* 设置编辑器不可编辑 */
+        function disableEditor(){
+        }
+
+        /* 公式 */
+        var Formula = function(){
+            var _this = this,
+                latex = getLatex();
+
+            this.isFocus = false;
+            this.isDisabled = false;
+
+            /* 加载公式内容 */
+            this.$mathquill = $('.mathquill-editable').mathquill('latex', latex);
+
+            /* 设置活动状态的公式iframe */
+            this.$mathquill.on('mousedown', function(){
+                /* 编辑器不可用时,公式也不可用 */
+                if(_this.disabled) return false;
+
+                /* 第一次点击当前公式,设置公式活动 */
+                if(!$iframe.hasClass('edui-formula-active')) {
+                }
+                _this.focus();
+            });
+
+            /* 设置更新外层iframe的大小和属性 */
+            $(document.body).on('keydown', function(){
+                _this.updateIframe();
+            }).on('keyup', function(){
+                _this.updateIframe();
+            });
+
+            /* 清除初始化的高亮状态 */
+            this.$mathquill.removeClass('hasCursor');
+
+            /* 初始化后延迟刷新外层iframe大小 */
+            setTimeout(function(){
+                _this.updateIframe();
+            }, 300);
+        };
+
+        Formula.prototype = {
+            focus:function(){
+                $iframe.addClass('edui-formula-active');
+                this.isFocus = true;
+            },
+            blur:function(){
+                $iframe.removeClass('edui-formula-active');
+                this.removeCursor();
+                this.isFocus = false;
+            },
+            removeCursor: function(){
+                this.$mathquill.find('span.cursor').hide();
+                this.$mathquill.parent().find('.hasCursor').removeClass('hasCursor');
+            },
+            updateIframe: function(){
+                $iframe.width(this.$mathquill.width()+8).height(this.$mathquill.height()+8);
+                var latex = $iframe.attr('data-latex'),
+                    newLatex = this.getLatex();
+                if(latex != newLatex) {
+                    $iframe.attr('data-latex', this.getLatex());
+                    saveScene();
+                }
+            },
+            insertLatex: function(latex){
+                this.$mathquill.mathquill('write', latex);
+                this.updateIframe();
+                this.removeCursor();
+            },
+            setLatex: function(latex){
+                this.$mathquill.mathquill('latex', latex);
+                this.updateIframe();
+            },
+            getLatex: function(){
+                return this.$mathquill.mathquill('latex');
+            },
+            redraw: function(){
+                this.$mathquill.mathquill('redraw');
+            },
+            setDisabled: function(){
+                this.blur();
+                var latex = this.getLatex();
+                this.$mathquill.mathquill('revert').text(latex).mathquill();
+                this.updateIframe();
+                this.isDisabled = true;
+            },
+            setEnabled: function(){
+                this.$mathquill.removeClass('mathquill-rendered-math');
+                this.refresh();
+                this.isDisabled = false;
+            },
+            refresh: function(){
+                var latex = this.getLatex();
+                this.$mathquill.mathquill('revert').text(latex).mathquill('editable');
+                this.updateIframe();
+            }
+        };
+
+        /* 绑定到window上,给上级window调用 */
+        window.formula = new Formula();
+    });
+</script>
+</body>
+</html>

+ 124 - 0
public/assets/addons/umeditor/dialogs/formula/formula.js

@@ -0,0 +1,124 @@
+(function () {
+
+    var editor = null;
+
+    UM.registerWidget('formula', {
+
+        tpl: "<link type=\"text/css\" rel=\"stylesheet\" href=\"<%=formula_url%>formula.css\">" +
+            "<div class=\"edui-formula-wrapper\">" +
+            "<ul class=\"edui-tab-nav\"></ul>" +
+            "<div class=\"edui-tab-content\"></div>" +
+            "</div>",
+
+        sourceData: {
+            formula: {
+                'common': [
+                    "{/}frac{ }{ }", "^{ }/_{ }", "x^{ }", "x_{ }", "x^{ }_{ }", "{/}bar{ }", "{/}sqrt{ }", "{/}nthroot{ }{ }",
+                    "{/}sum^{ }_{n=}", "{/}sum", "{/}log_{ }", "{/}ln", "{/}int_{ }^{ }", "{/}oint_{ }^{ }"
+                ],
+                'symbol': [
+                    "+", "-", "{/}pm", "{/}times", "{/}ast", "{/}div", "/", "{/}bigtriangleup",
+                    "=", "{/}ne", "{/}approx", ">", "<", "{/}ge", "{/}le", "{/}infty",
+                    "{/}cap", "{/}cup", "{/}because", "{/}therefore", "{/}subset", "{/}supset", "{/}subseteq", "{/}supseteq",
+                    "{/}nsubseteq", "{/}nsupseteq", "{/}in", "{/}ni", "{/}notin", "{/}mapsto", "{/}leftarrow", "{/}rightarrow",
+                    "{/}Leftarrow", "{/}Rightarrow", "{/}leftrightarrow", "{/}Leftrightarrow"
+                ],
+                'letter': [
+                    "{/}alpha", "{/}beta", "{/}gamma", "{/}delta", "{/}varepsilon", "{/}varphi", "{/}lambda", "{/}mu",
+                    "{/}rho", "{/}sigma", "{/}omega", "{/}Gamma", "{/}Delta", "{/}Theta", "{/}Lambda", "{/}Xi",
+                    "{/}Pi", "{/}Sigma", "{/}Upsilon", "{/}Phi", "{/}Psi", "{/}Omega"
+                ]
+            }
+        },
+        initContent: function (_editor, $widget) {
+
+            var me = this,
+                formula = me.sourceData.formula,
+                lang = _editor.getLang('formula').static,
+                formulaUrl = UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/formula/',
+                options = $.extend({}, lang, { 'formula_url': formulaUrl }),
+                $root = me.root();
+
+            if (me.inited) {
+                me.preventDefault();
+                return;
+            }
+            me.inited = true;
+
+            editor = _editor;
+            me.$widget = $widget;
+
+            $root.html($.parseTmpl(me.tpl, options));
+            me.tabs = $.eduitab({selector: "#edui-formula-tab-Jpanel"});
+
+            /* 初始化popup的内容 */
+            var headHtml = [], xMax = 0, yMax = 0,
+                $tabContent = me.root().find('.edui-tab-content');
+            $.each(formula, function (k, v) {
+                var contentHtml = [];
+                $.each(v, function (i, f) {
+                    contentHtml.push('<li class="edui-formula-latex-item" data-latex="' + f + '" style="background-position:-' + (xMax * 30) + 'px -' + (yMax * 30) + 'px"></li>');
+                    if (++xMax >=8) {
+                        ++yMax; xMax = 0;
+                    }
+                });
+                yMax++; xMax = 0;
+                $tabContent.append('<div class="edui-tab-pane"><ul>' + contentHtml.join('') + '</ul>');
+                headHtml.push('<li class="edui-tab-item"><a href="javascript:void(0);" class="edui-tab-text">' + lang['lang_tab_' + k] + '</a></li>');
+            });
+            headHtml.push('<li class="edui-formula-clearboth"></li>');
+            $root.find('.edui-tab-nav').html(headHtml.join(''));
+            $root.find('.edui-tab-content').append('<div class="edui-formula-clearboth"></div>');
+
+            /* 选中第一个tab */
+            me.switchTab(0);
+        },
+        initEvent: function () {
+            var me = this;
+
+            //防止点击过后关闭popup
+            me.root().on('click', function (e) {
+                return false;
+            });
+
+            //点击tab切换菜单
+            me.root().find('.edui-tab-nav').delegate('.edui-tab-item', 'click', function (evt) {
+                me.switchTab(this);
+                return false;
+            });
+
+            //点击选中公式
+            me.root().find('.edui-tab-pane').delegate('.edui-formula-latex-item', 'click', function (evt) {
+                var $item = $(this),
+                    latex = $item.attr('data-latex') || '';
+
+                if (latex) {
+                    me.insertLatex(latex.replace("{/}", "\\"));
+                }
+                me.$widget.edui().hide();
+                return false;
+            });
+        },
+        switchTab:function(index){
+            var me = this,
+                $root = me.root(),
+                index = $.isNumeric(index) ? index:$.inArray(index, $root.find('.edui-tab-nav .edui-tab-item'));
+
+            $root.find('.edui-tab-nav .edui-tab-item').removeClass('edui-active').eq(index).addClass('edui-active');
+            $root.find('.edui-tab-content .edui-tab-pane').removeClass('edui-active').eq(index).addClass('edui-active');
+
+            /* 自动长高 */
+            me.autoHeight(0);
+        },
+        autoHeight: function () {
+            this.$widget.height(this.root() + 2);
+        },
+        insertLatex: function (latex) {
+            editor.execCommand('formula', latex );
+        },
+        width: 350,
+        height: 400
+    });
+
+})();
+

BIN
public/assets/addons/umeditor/dialogs/formula/images/formula.png


+ 42 - 0
public/assets/addons/umeditor/dialogs/image/image.css

@@ -0,0 +1,42 @@
+.edui-dialog-image .edui-image-wrapper{font-size: 12px;margin: 15px;}
+
+/*upload*/
+.edui-dialog-image .edui-image-upload1{position: absolute;top:50%;left:50%;width:44px;height:38px;margin-top:-19px; margin-left: -22px;}
+.edui-dialog-image .edui-image-upload2,.edui-dialog-image .edui-image-select{position:relative;float:left;width:120px;height:120px;margin:5px 0 0 5px;}
+
+.edui-dialog-image .edui-image-form{position: absolute;left: 0px;top: 0px;width: 100%;height: 100%;opacity: 0;cursor: pointer;}
+.edui-dialog-image .edui-image-form .edui-image-file{width: 100%;height:100%;filter: alpha(opacity=0)}
+
+.edui-dialog-image .edui-image-upload1 .edui-image-icon{display: inline-block;width:44px;height:38px;background-image: url('images/upload1.png')}
+.edui-dialog-image .edui-image-upload1 .edui-image-icon.hover{background-position: -50px 0;}
+.edui-dialog-image .edui-image-upload2 .edui-image-icon,.edui-dialog-image .edui-image-select .edui-image-icon{display: inline-block;width:120px;height:120px;background-image: url('images/upload2.png')}
+
+.edui-dialog-image .edui-image-dragTip{position: absolute;display:none;top:50%;left:50%;margin-top:30px;margin-left: -60px;
+    color: #222;font-size:14px;}
+
+.edui-dialog-image .edui-image-content{height:330px;width:100%;position: relative;}
+
+.edui-dialog-image .edui-image-mask{display: none;position: absolute;top:0;left:0;width: 100%; height: 100%;background-color:#fff;
+    text-align: center;line-height:300px;color:#000;font-size:14px;font-weight:bold;opacity: 0.6;filter: alpha(opacity=60);}
+.edui-dialog-image .edui-image-mask.edui-active{display: block;}
+
+/*network*/
+.edui-dialog-image .edui-image-searchBar{margin: 10px;}
+.edui-dialog-image .edui-image-searchBar .edui-image-searchTxt{display: inline-block !important;*display: inline !important;*zoom:1;width:400px; border: 1px solid #c5d2ff; height: 20px; line-height: 18px; font-size: 14px; padding: 3px; margin: 0;outline:0;}
+.edui-dialog-image .edui-image-searchBar .edui-image-searchAdd{display: inline-block !important;*display: inline !important;*zoom:1;
+    width:60px; text-align:center;height: 25px;text-align: center;line-height: 25px;
+    background-color: #ffffff;padding: 0; border: 1px solid #ababab;margin-left: 20px;cursor: pointer;
+}
+.edui-dialog-image .edui-image-searchBar .edui-image-searchAdd.hover{
+    background-color: #d5e1f2;
+    padding: 0;
+    border: 1px solid #a3bde3;
+}
+.edui-dialog-image .edui-image-searchRes{height:280px;overflow:auto;}
+
+
+/*common*/
+.edui-dialog-image .edui-image-item{position:relative;float:left;width:120px;height:120px;border: 1px solid #CCC;cursor: default;margin: 5px 0 0 5px;}
+.edui-dialog-image .edui-image-item .edui-image-pic{position: absolute;left:-9999px;}
+.edui-dialog-image .edui-image-item .edui-image-close{position:absolute;right:0;background: url('images/close.png');width:17px;height:17px;cursor:pointer;z-index:1}
+.edui-dialog-image .edui-image-item.hover .edui-image-close{display: block;}

+ 499 - 0
public/assets/addons/umeditor/dialogs/image/image.js

@@ -0,0 +1,499 @@
+(function () {
+
+    var utils = UM.utils,
+        browser = UM.browser,
+        Base = {
+            checkURL: function (url) {
+                if (!url) return false;
+                url = utils.trim(url);
+                if (url.length <= 0) {
+                    return false;
+                }
+                if (url.search(/http:\/\/|https:\/\//) !== 0) {
+                    url += 'http://';
+                }
+
+                url = url.replace(/\?[\s\S]*$/, "");
+
+                if (!/(.gif|.jpg|.jpeg|.png)$/i.test(url)) {
+                    return false;
+                }
+                return url;
+            },
+            getAllPic: function (sel, $w, editor) {
+                var me = this,
+                    arr = [],
+                    $imgs = $(sel, $w);
+
+                $.each($imgs, function (index, node) {
+                    $(node).removeAttr("width").removeAttr("height");
+
+//                if (node.width > editor.options.initialFrameWidth) {
+//                    me.scale(node, editor.options.initialFrameWidth -
+//                        parseInt($(editor.body).css("padding-left"))  -
+//                        parseInt($(editor.body).css("padding-right")));
+//                }
+
+                    return arr.push({
+                        _src: node.src,
+                        src: node.src
+                    });
+                });
+
+                return arr;
+            },
+            scale: function (img, max, oWidth, oHeight) {
+                var width = 0, height = 0, percent, ow = img.width || oWidth, oh = img.height || oHeight;
+                if (ow > max || oh > max) {
+                    if (ow >= oh) {
+                        if (width = ow - max) {
+                            percent = (width / ow).toFixed(2);
+                            img.height = oh - oh * percent;
+                            img.width = max;
+                        }
+                    } else {
+                        if (height = oh - max) {
+                            percent = (height / oh).toFixed(2);
+                            img.width = ow - ow * percent;
+                            img.height = max;
+                        }
+                    }
+                }
+
+                return this;
+            },
+            close: function ($img) {
+
+                $img.css({
+                    top: ($img.parent().height() - $img.height()) / 2,
+                    left: ($img.parent().width() - $img.width()) / 2
+                }).prev().on("click", function () {
+
+                    if ($(this).parent().remove().hasClass("edui-image-upload-item")) {
+                        //显示图片计数-1
+                        Upload.showCount--;
+                        Upload.updateView();
+                    }
+
+                });
+
+                return this;
+            },
+            createImgBase64: function (img, file, $w) {
+                if (browser.webkit) {
+                    //Chrome8+
+                    img.src = window.webkitURL.createObjectURL(file);
+                } else if (browser.gecko) {
+                    //FF4+
+                    img.src = window.URL.createObjectURL(file);
+                } else {
+                    //实例化file reader对象
+                    var reader = new FileReader();
+                    reader.onload = function (e) {
+                        img.src = this.result;
+                        $w.append(img);
+                    };
+                    reader.readAsDataURL(file);
+                }
+            },
+            callback: function (editor, $w, url, state) {
+
+                if (state == "SUCCESS") {
+                    //显示图片计数+1
+                    Upload.showCount++;
+                    var $img = $("<img src='" + editor.options.imagePath + url + "' class='edui-image-pic' />"),
+                        $item = $("<div class='edui-image-item edui-image-upload-item'><div class='edui-image-close'></div></div>").append($img);
+
+                    if ($(".edui-image-upload2", $w).length < 1) {
+                        $(".edui-image-content", $w).append($item);
+
+                        Upload.render(".edui-image-content", 2)
+                            .config(".edui-image-upload2");
+                    } else {
+                        $(".edui-image-upload2", $w).before($item).show();
+                    }
+
+                    $img.on("load", function () {
+                        Base.scale(this, 120);
+                        Base.close($(this));
+                        $(".edui-image-content", $w).focus();
+                    });
+
+                } else {
+                    currentDialog.showTip(state);
+                    window.setTimeout(function () {
+
+                        currentDialog.hideTip();
+
+                    }, 3000);
+                }
+
+                Upload.toggleMask();
+
+            }
+        };
+
+    /*
+     * 本地上传
+     * */
+    var Upload = {
+        showCount: 0,
+        uploadTpl: '<div class="edui-image-upload%%">' +
+            '<span class="edui-image-icon"></span>' +
+            '<form class="edui-image-form" method="post" enctype="multipart/form-data" target="up">' +
+            '<input style=\"filter: alpha(opacity=0);\" class="edui-image-file" type="file" hidefocus name="upfile" accept="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp"/>' +
+            '</form>' +
+
+            '</div>',
+        init: function (editor, $w) {
+            var me = this;
+
+            me.editor = editor;
+            me.dialog = $w;
+            me.render(".edui-image-local", 1);
+            me.config(".edui-image-upload1");
+            me.submit();
+            me.drag();
+
+            $(".edui-image-upload1").hover(function () {
+                $(".edui-image-icon", this).toggleClass("hover");
+            });
+
+            if (!(UM.browser.ie && UM.browser.version <= 9)) {
+                $(".edui-image-dragTip", me.dialog).css("display", "block");
+            }
+
+
+            return me;
+        },
+        render: function (sel, t) {
+            var me = this;
+
+            $(sel, me.dialog).append($(me.uploadTpl.replace(/%%/g, t)));
+
+            return me;
+        },
+        config: function (sel) {
+            var me = this,
+                url = me.editor.options.imageUrl;
+
+            url = url + (url.indexOf("?") == -1 ? "?" : "&") + "editorid=" + me.editor.id;//初始form提交地址;
+
+            $("form", $(sel, me.dialog)).attr("action", url);
+
+            return me;
+        },
+        uploadComplete: function (r) {
+            var me = this;
+            try {
+                var json = eval('(' + r + ')');
+                Base.callback(me.editor, me.dialog, json.url, json.state);
+            } catch (e) {
+                var lang = me.editor.getLang('image');
+                Base.callback(me.editor, me.dialog, '', (lang && lang.uploadError) || 'Error!');
+            }
+        },
+        submit: function (callback) {
+
+            var me = this,
+                input = $('<input style="filter: alpha(opacity=0);" class="edui-image-file" type="file" hidefocus="" name="upfile" accept="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp">'),
+                input = input[0];
+
+            $(me.dialog).delegate(".edui-image-file", "change", function (e) {
+
+                $(this).trigger("edui.file.change", [Upload, me, input, callback]);
+                return;
+
+                if (!this.parentNode) {
+                    return;
+                }
+
+                $('<iframe name="up"  style="display: none"></iframe>').insertBefore(me.dialog).on('load', function () {
+                    var r = this.contentWindow.document.body.innerHTML;
+                    if (r == '') return;
+                    me.uploadComplete(r);
+                    $(this).unbind('load');
+                    $(this).remove();
+
+                });
+
+                $(this).parent()[0].submit();
+                Upload.updateInput(input);
+                me.toggleMask("Loading....");
+                callback && callback();
+
+            });
+
+            return me;
+        },
+        //更新input
+        updateInput: function (inputField) {
+
+            $(".edui-image-file", this.dialog).each(function (index, ele) {
+
+                ele.parentNode.replaceChild(inputField.cloneNode(true), ele);
+
+            });
+
+        },
+        //更新上传框
+        updateView: function () {
+
+            if (Upload.showCount !== 0) {
+                return;
+            }
+
+            $(".edui-image-upload2", this.dialog).hide();
+            $(".edui-image-dragTip", this.dialog).show();
+            $(".edui-image-upload1", this.dialog).show();
+
+        },
+        drag: function () {
+            var me = this;
+            //做拽上传的支持
+            if (!UM.browser.ie9below) {
+                me.dialog.find('.edui-image-content').on('drop', function (e) {
+
+                    //获取文件列表
+                    var fileList = e.originalEvent.dataTransfer.files;
+                    var img = document.createElement('img');
+                    var hasImg = false;
+                    $.each(fileList, function (i, f) {
+                        if (/^image/.test(f.type)) {
+                            var uploadCallback = me.editor.getOpt('imageUploadCallback');
+                            if (uploadCallback && typeof uploadCallback === 'function') {
+                                uploadCallback.call(me, f, function (url, data) {
+                                    me.uploadComplete(JSON.stringify({url: url, state: "SUCCESS"}));
+                                });
+                            } else {
+                                //创建图片的base64
+                                Base.createImgBase64(img, f, me.dialog);
+
+                                var xhr = new XMLHttpRequest();
+                                xhr.open("post", me.editor.getOpt('imageUrl') + "?type=ajax", true);
+                                xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
+
+                                //模拟数据
+                                var fd = new FormData();
+                                fd.append(me.editor.getOpt('imageFieldName'), f);
+
+                                xhr.send(fd);
+                                xhr.addEventListener('load', function (e) {
+                                    var r = e.target.response, json;
+                                    me.uploadComplete(r);
+                                    if (i == fileList.length - 1) {
+                                        $(img).remove()
+                                    }
+                                });
+                            }
+                            hasImg = true;
+                        }
+                    });
+                    if (hasImg) {
+                        e.preventDefault();
+                        me.toggleMask("Loading....");
+                    }
+
+                }).on('dragover', function (e) {
+                    e.preventDefault();
+                });
+            }
+        },
+        toggleMask: function (html) {
+            var me = this;
+
+            var $mask = $(".edui-image-mask", me.dialog);
+            if (html) {
+                if (!(UM.browser.ie && UM.browser.version <= 9)) {
+                    $(".edui-image-dragTip", me.dialog).css("display", "none");
+                }
+                $(".edui-image-upload1", me.dialog).css("display", "none");
+                $mask.addClass("edui-active").html(html);
+            } else {
+
+                $mask.removeClass("edui-active").html();
+
+                if (Upload.showCount > 0) {
+                    return me;
+                }
+
+                if (!(UM.browser.ie && UM.browser.version <= 9)) {
+                    $(".edui-image-dragTip", me.dialog).css("display", "block");
+                }
+                $(".edui-image-upload1", me.dialog).css("display", "block");
+            }
+
+            return me;
+        }
+    };
+
+    /*
+     * 网络图片
+     * */
+    var NetWork = {
+        init: function (editor, $w) {
+            var me = this;
+
+            me.editor = editor;
+            me.dialog = $w;
+
+            me.initEvt();
+        },
+        initEvt: function () {
+            var me = this,
+                url,
+                $ele = $(".edui-image-searchTxt", me.dialog);
+
+            $(".edui-image-searchAdd", me.dialog).on("click", function () {
+                url = Base.checkURL($ele.val());
+
+                if (url) {
+
+                    $("<img src='" + url + "' class='edui-image-pic' />").on("load", function () {
+
+
+                        var $item = $("<div class='edui-image-item'><div class='edui-image-close'></div></div>").append(this);
+
+                        $(".edui-image-searchRes", me.dialog).append($item);
+
+                        Base.scale(this, 120);
+
+                        $item.width($(this).width());
+
+                        Base.close($(this));
+
+                        $ele.val("");
+                    });
+                }
+            })
+                .hover(function () {
+                    $(this).toggleClass("hover");
+                });
+        }
+    };
+
+    /*
+     * 选择图片
+     * */
+    var Select = {
+        init: function (editor, $w) {
+            var me = this;
+
+            me.editor = editor;
+            me.dialog = $w;
+
+            me.initEvt();
+        },
+        initEvt: function () {
+            var me = this;
+
+            $(".edui-image-select", me.dialog).on("click", function () {
+                var selectUrl = typeof Config !== 'undefined' && Config.modulename === 'index' ? 'user/attachment' : 'general/attachment/select';
+                parent.Fast.api.open(selectUrl + "?element_id=&multiple=true&mimetype=image/*", "选择", {
+                    callback: function (data) {
+                        var urlArr = data.url.split(/\,/);
+                        urlArr.forEach(function (item, index) {
+                            var url = Fast.api.cdnurl(item);
+                            $("<img src='" + url + "' class='edui-image-pic' />").on("load", function () {
+                                var $item = $("<div class='edui-image-item'><div class='edui-image-close'></div></div>").append(this);
+                                $(".edui-image-selectRes", me.dialog).append($item);
+                                Base.scale(this, 120);
+                                $item.width($(this).width());
+                                Base.close($(this));
+                            });
+                        });
+                    }
+                });
+                return false;
+            });
+        }
+    };
+    var $tab = null,
+        currentDialog = null;
+
+    UM.registerWidget('image', {
+        tpl: "<link rel=\"stylesheet\" type=\"text/css\" href=\"<%=image_url%>image.css\">" +
+            "<div class=\"edui-image-wrapper\">" +
+            "<ul class=\"edui-tab-nav\">" +
+            "<li class=\"edui-tab-item edui-active\"><a data-context=\".edui-image-local\" class=\"edui-tab-text\"><%=lang_tab_local%></a></li>" +
+            "<li  class=\"edui-tab-item\"><a data-context=\".edui-image-JimgSearch\" class=\"edui-tab-text\"><%=lang_tab_imgSearch%></a></li>" +
+            "<li  class=\"edui-tab-item\"><a data-context=\".edui-image-JimgSelect\" class=\"edui-tab-text\"><%=lang_tab_imgSelect%></a></li>" +
+            "</ul>" +
+            "<div class=\"edui-tab-content\">" +
+            "<div class=\"edui-image-local edui-tab-pane edui-active\">" +
+            "<div class=\"edui-image-content\"></div>" +
+            "<div class=\"edui-image-mask\"></div>" +
+            "<div class=\"edui-image-dragTip\"><%=lang_input_dragTip%></div>" +
+            "</div>" +
+            "<div class=\"edui-image-JimgSearch edui-tab-pane\">" +
+            "<div class=\"edui-image-searchBar\">" +
+            "<table><tr><td><input class=\"edui-image-searchTxt\" type=\"text\"></td>" +
+            "<td><div class=\"edui-image-searchAdd\"><%=lang_btn_add%></div></td></tr></table>" +
+            "</div>" +
+            "<div class=\"edui-image-searchRes\"></div>" +
+            "</div>" +
+            "<div class=\"edui-image-JimgSelect edui-tab-pane\">" +
+            "<div class=\"edui-image-selectBar\"><div class=\"edui-image-select\"><span class=\"edui-image-icon\"></span></div></div>" +
+            "<div class=\"edui-image-selectRes\"></div>" +
+            "<div class=\"edui-image-mask\"></div>" +
+            "</div>" +
+            "</div>" +
+            "</div>",
+        initContent: function (editor, $dialog) {
+            var lang = editor.getLang('image')["static"],
+                opt = $.extend({}, lang, {
+                    image_url: UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/image/'
+                });
+
+            Upload.showCount = 0;
+
+            if (lang) {
+                var html = $.parseTmpl(this.tpl, opt);
+            }
+
+            currentDialog = $dialog.edui();
+
+            this.root().html(html);
+
+        },
+        initEvent: function (editor, $w) {
+            $tab = $.eduitab({selector: ".edui-image-wrapper"})
+                .edui().on("beforeshow", function (e) {
+                    e.stopPropagation();
+                });
+
+            Upload.init(editor, $w);
+
+            NetWork.init(editor, $w);
+
+            Select.init(editor, $w);
+        },
+        buttons: {
+            'ok': {
+                exec: function (editor, $w) {
+                    var sel = "",
+                        index = $tab.activate();
+
+                    if (index == 0) {
+                        sel = ".edui-image-content .edui-image-pic";
+                    } else if (index == 1) {
+                        sel = ".edui-image-searchRes .edui-image-pic";
+                    } else if (index == 2) {
+                        sel = ".edui-image-selectRes .edui-image-pic";
+                    }
+                    var list = Base.getAllPic(sel, $w, editor);
+
+                    if (index != -1) {
+                        editor.execCommand('insertimage', list);
+                    }
+                }
+            },
+            'cancel': {}
+        },
+        width: 700,
+        height: 408
+    }, function (editor, $w, url, state) {
+        Base.callback(editor, $w, url, state)
+    })
+})();
+

BIN
public/assets/addons/umeditor/dialogs/image/images/close.png


BIN
public/assets/addons/umeditor/dialogs/image/images/upload1.png


BIN
public/assets/addons/umeditor/dialogs/image/images/upload2.png


+ 73 - 0
public/assets/addons/umeditor/dialogs/link/link.js

@@ -0,0 +1,73 @@
+(function(){
+    var utils = UM.utils;
+    function hrefStartWith(href, arr) {
+        href = href.replace(/^\s+|\s+$/g, '');
+        for (var i = 0, ai; ai = arr[i++];) {
+            if (href.indexOf(ai) == 0) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    UM.registerWidget('link', {
+        tpl: "<style type=\"text/css\">" +
+            ".edui-dialog-link .edui-link-table{font-size: 12px;margin: 10px;line-height: 30px}" +
+            ".edui-dialog-link .edui-link-txt{width:300px;height:21px;line-height:21px;border:1px solid #d7d7d7;}" +
+            "</style>" +
+            "<table class=\"edui-link-table\">" +
+            "<tr>" +
+            "<td><label for=\"href\"><%=lang_input_url%></label></td>" +
+            "<td><input class=\"edui-link-txt\" id=\"edui-link-Jhref\" type=\"text\" /></td>" +
+            "</tr>" +
+            "<tr>" +
+            "<td><label for=\"title\"><%=lang_input_title%></label></td>" +
+            "<td><input class=\"edui-link-txt\" id=\"edui-link-Jtitle\" type=\"text\"/></td>" +
+            "</tr>" +
+            "<tr>" +
+            "<td colspan=\"2\">" +
+            "<label for=\"target\"><%=lang_input_target%></label>" +
+            "<input id=\"edui-link-Jtarget\" type=\"checkbox\"/>" +
+            "</td>" +
+            "</tr>" +
+//            "<tr>" +
+//            "<td colspan=\"2\" id=\"edui-link-Jmsg\"></td>" +
+//            "</tr>" +
+            "</table>",
+        initContent: function (editor) {
+            var lang = editor.getLang('link');
+            if (lang) {
+                var html = $.parseTmpl(this.tpl, lang.static);
+            }
+            this.root().html(html);
+        },
+        initEvent: function (editor, $w) {
+            var link = editor.queryCommandValue('link');
+            if(link){
+                $('#edui-link-Jhref',$w).val(utils.html($(link).attr('href')));
+                $('#edui-link-Jtitle',$w).val($(link).attr('title'));
+                $(link).attr('target') == '_blank' && $('#edui-link-Jtarget').attr('checked',true)
+            }
+            $('#edui-link-Jhref',$w).focus();
+        },
+        buttons: {
+            'ok': {
+                exec: function (editor, $w) {
+                    var href = $('#edui-link-Jhref').val().replace(/^\s+|\s+$/g, '');
+
+                    if (href) {
+                        editor.execCommand('link', {
+                            'href': href,
+                            'target': $("#edui-link-Jtarget:checked").length ? "_blank" : '_self',
+                            'title': $("#edui-link-Jtitle").val().replace(/^\s+|\s+$/g, ''),
+                            '_href': href
+                        });
+                    }
+                }
+            },
+            'cancel':{}
+        },
+        width: 400
+    })
+})();
+

+ 185 - 0
public/assets/addons/umeditor/dialogs/map/map.html

@@ -0,0 +1,185 @@
+<!doctype html>
+<html>
+<head>
+    <meta charset="utf-8"/>
+    <title>Map</title>
+    <style>
+        html {
+            height: 100%
+        }
+
+        body {
+            height: 100%;
+            margin: 0;
+            padding: 0;
+            background-color: #FFF
+        }
+    </style>
+</head>
+<body>
+<div id="mapContent" style="width:100%; height:100%"></div>
+
+<!--<script charset="utf-8" src="//api.map.baidu.com/api?ak=&v=1.3&services=true&s=1"></script>-->
+<script>
+    window.onload = function () {
+        var req = new XMLHttpRequest();
+        req.open('GET', "/addons/umeditor/index/get_map_config", false);
+        req.onreadystatechange = function () {
+            if (req.readyState == 4) {
+                try {
+                    var params = JSON.parse(req.responseText);
+                    loadScript(params.baidumapkey || '');
+                } catch (e) {
+
+                }
+            }
+        };
+        req.send(null);
+    };
+
+    function loadScript(key) {
+        var script = document.createElement("script");
+        script.src = "https://api.map.baidu.com/api?v=3.0&ak=" + (getParam("key") || key) + "&callback=initialize";
+        document.body.appendChild(script);
+    }
+
+    // window.onload = loadScript;
+
+    var centerParam = getParam('center') || '116.404413,39.903536';
+    var zoomParam = getParam('zoom') || 11;
+    var widthParam = getParam('width') || 558;
+    var heightParam = getParam('height') || 360;
+    var markersParam = getParam('markers') || '';
+
+    //创建和初始化地图函数:
+    function initialize() {
+        var mapContent = document.getElementById('mapContent');
+        mapContent.style.width = widthParam + 'px';
+        mapContent.style.height = heightParam + 'px';
+
+        createMap();//创建地图
+        setMapEvent();//设置地图事件
+        addMapControl();//向地图添加控件
+
+        // 创建标注
+        if (markersParam) {
+            var markersArr = markersParam.replace(/[\s]+/g, '').split(',');
+            var point = new BMap.Point(markersArr[0], markersArr[1]);
+            var marker = new BMap.Marker(point);
+            map.addOverlay(marker); // 将标注添加到地图中
+        }
+
+        var iframe = getSelfIframe();
+        var UM = parent.UM;
+        var editor = getEditor();
+        if (iframe && UM && editor) { //在编辑状态下
+            setMapListener();//地图改变修改外层的iframe标签src属性
+        } else {
+            // document.focus();
+        }
+
+    }
+
+    //创建地图函数:
+    function createMap() {
+        var map = new BMap.Map("mapContent");//在百度地图容器中创建一个地图
+        var centerArr = centerParam.replace(/[\s]+/g, '').split(',');
+        var point = new BMap.Point(centerArr[0], centerArr[1]);//定义一个中心点坐标
+        map.centerAndZoom(point, zoomParam);//设定地图的中心点和坐标并将地图显示在地图容器中
+        window.map = map;//将map变量存储在全局
+    }
+
+    //地图事件设置函数:
+    function setMapEvent() {
+        map.enableDragging();//启用地图拖拽事件,默认启用(可不写)
+        map.enableScrollWheelZoom();//启用地图滚轮放大缩小
+        map.enableDoubleClickZoom();//启用鼠标双击放大,默认启用(可不写)
+        map.enableKeyboard();//启用键盘上下左右键移动地图
+    }
+
+    //地图控件添加函数:
+    function addMapControl() {
+        //向地图中添加缩放控件
+        var ctrl_nav = new BMap.NavigationControl({anchor: BMAP_ANCHOR_TOP_LEFT, type: BMAP_NAVIGATION_CONTROL_LARGE});
+        map.addControl(ctrl_nav);
+        //向地图中添加缩略图控件
+        var ctrl_ove = new BMap.OverviewMapControl({anchor: BMAP_ANCHOR_BOTTOM_RIGHT, isOpen: 1});
+        map.addControl(ctrl_ove);
+        //向地图中添加比例尺控件
+        var ctrl_sca = new BMap.ScaleControl({anchor: BMAP_ANCHOR_BOTTOM_LEFT});
+        map.addControl(ctrl_sca);
+    }
+
+    //获取URL参数
+    function getParam(name) {
+        return location.href.match(new RegExp('[?&]' + name + '=([^?&]+)', 'i')) ? decodeURIComponent(RegExp.$1) : '';
+    }
+
+    //执行搜索
+    function search(address) {
+        if (!map) return;
+        var local = new BMap.LocalSearch(map, {
+            renderOptions: {
+                map: map,
+                autoViewport: true,
+                selectFirstResult: false
+            }
+        });
+        local.search(address);
+    }
+
+    function setMapListener() {
+        var timer;
+
+        map.addEventListener('moveend', mapListenerHandler);
+        map.addEventListener('zoomend', mapListenerHandler);
+        marker.addEventListener('dragend', mapListenerHandler);
+
+        function mapListenerHandler() {
+            var zoom = map.getZoom(),
+                center = map.getCenter(),
+                marker = window.marker.point;
+
+            iframe.src = iframe.src.replace(new RegExp('([?#&])center=([^?#&]+)', 'i'), '$1center=' + center.lng + ',' + center.lat).replace(new RegExp('([?#&])markers=([^?#&]+)', 'i'), '$1markers=' + marker.lng + ',' + marker.lat).replace(new RegExp('([?#&])zoom=([^?#&]+)', 'i'), '$1zoom=' + zoom);
+            editor.fireEvent('saveScene');
+            saveScene(editor);
+        }
+
+        function saveScene() {
+            if (!timer) {
+                timer = setTimeout(function () {
+                    editor.fireEvent('savescene');
+                    editor.fireEvent('contentchange');
+                    timer = null;
+                }, 1000);
+            }
+        }
+    }
+
+    function getSelfIframe() {
+        var iframes = parent.document.getElementsByTagName('iframe');
+        for (var key in iframes) {
+            if (iframes[key].contentWindow == window) {
+                return iframes[key];
+            }
+        }
+        return null;
+    }
+
+    function getEditor() {
+        try {
+            var parentNode = iframe.parentNode;
+            while (parentNode && parentNode.tagName && parentNode.tagName.toLowerCase() != 'body') {
+                if (parentNode.className && parentNode.className.indexOf('edui-body-container') != -1) {
+                    return UM.getEditor(parentNode.nextSibling.id ? parentNode.nextSibling.id : parentNode.id);
+                }
+                parentNode = parentNode.parentNode;
+            }
+        } catch (e) {
+
+        }
+        return null;
+    }
+</script>
+</body>
+</html>

+ 294 - 0
public/assets/addons/umeditor/dialogs/map/map.js

@@ -0,0 +1,294 @@
+(function () {
+
+    var widgetName = 'map';
+
+    UM.registerWidget(widgetName, {
+
+        tpl: "<style type=\"text/css\">" +
+            ".edui-dialog-map .edui-map-content{width:530px; height: 350px;margin: 10px auto;}" +
+            ".edui-dialog-map .edui-map-content table{width: 100%}" +
+            ".edui-dialog-map .edui-map-content table td{vertical-align: middle;}" +
+            ".edui-dialog-map .edui-map-button { border: 1px solid #ccc; float: left; cursor: default; height: 23px; width: 70px; cursor: pointer; margin: 0; font-size: 12px; line-height: 24px; text-align: center; color:#444; }" +
+            ".edui-dialog-map .edui-map-button:hover {background:#eee;}" +
+            ".edui-dialog-map .edui-map-city,.edui-dialog-map .edui-map-address{height:21px;background: #FFF;border:1px solid #d7d7d7; line-height: 21px;}" +
+            ".edui-dialog-map .edui-map-city{width:90px}" +
+            ".edui-dialog-map .edui-map-address{width:150px}" +
+            ".edui-dialog-map .edui-map-dynamic-label span{vertical-align:middle;margin: 3px 0px 3px 3px;}" +
+            ".edui-dialog-map .edui-map-dynamic-label input{vertical-align:middle;margin: 3px;}" +
+            "</style>" +
+            "<div class=\"edui-map-content\">" +
+            "<table>" +
+            "<tr>" +
+            "<td><%=lang_city%>:</td>" +
+            "<td><input class=\"edui-map-city\" type=\"text\" value=\"<%=city.value%>\"/></td>" +
+            "<td><%=lang_address%>:</td>" +
+            "<td><input class=\"edui-map-address\" type=\"text\" value=\"\" /></td>" +
+            "<td><a class=\"edui-map-button\"><%=lang_search%></a></td>" +
+            "<td><label class=\"edui-map-dynamic-label\"><input class=\"edui-map-dynamic\" type=\"checkbox\" name=\"edui-map-dynamic\" /><span><%=lang_dynamicmap%></span></label></td>" +
+            "</tr>" +
+            "</table>" +
+            "<div style=\"width:100%;height:340px;margin:5px auto;border:1px solid gray\" class=\"edui-map-container\"></div>" +
+            "</div>" +
+            "<script class=\"edui-tpl-container\" type=\"text/plain\">" +
+            "<!DOCTYPE html>" +
+            "<html>" +
+            "<head>" +
+            "<title></title>" +
+            "</head>" +
+            "<body>" +
+            "<scr_ipt>" +
+            "window.onload = function(){" +
+            "var scripts = document.scripts || document.getElementsByTagName(\"script\")," +
+            "src = [];" +
+            "for( var i = 1, len = scripts.length; i<len; i++ ) {" +
+            "src.push( scripts[i].src );" +
+            "}" +
+            "parent.UM.getEditor(<<id>>).getWidgetData(\'map\').requestMapApi( src );" +
+            "};" +
+            "function mapReadyStateChange ( state ) { " +
+            " if ( state === 'complete' || state === 'loaded' ) {" +
+            " document.close(); " +
+            " } }" +
+            "</scr_ipt>" +
+            "<scr_ipt onreadystatechange='mapReadyStateChange(this.readyState);' onload='mapReadyStateChange(\"loaded\");' src=\"//api.map.baidu.com/api?v=2.0&ak=<%=key%>&services=true\"></scr_ipt>" +
+            "</body>" +
+            "</html>" +
+            "</script>",
+        initContent: function (editor, $widget) {
+            if (!editor.options.baiduMapKey) {
+                setTimeout(function () {
+                    $widget.edui().hide();
+                    alert("请在配置中配置百度地图API密钥");
+                }, 10);
+                return;
+            }
+            var me = this,
+                lang = editor.getLang(widgetName),
+                theme_url = editor.options.themePath + editor.options.theme;
+
+            if (me.inited) {
+                me.map.clearOverlays();
+                var img = $(me.editor.selection.getRange().getClosedNode());
+                if (img.length && /api[.]map[.]baidu[.]com/ig.test(img.attr("src"))) {
+                    var url = img.attr("src"),
+                        centerPos = me.getPars("center", url).split(","),
+                        markerPos = me.getPars("markers", url).split(",");
+                    var zoom = Number(me.getPars('zoom', url) || 11);
+                    var point = new BMap.Point(Number(centerPos[0]), Number(centerPos[1]));
+                    if (markerPos.length == 2) {
+                        setTimeout(function () {
+                            var marker = new BMap.Marker(new BMap.Point(Number(markerPos[0]), Number(markerPos[1])));
+                            marker.enableDragging();
+                            me.map.setCenter(point, zoom);
+                            me.map.addOverlay(marker);
+                        }, 100);
+                    }
+                    me.preventDefault();
+                    return false;
+                } else {
+                    me.preventDefault();
+                    return false;
+                }
+            }
+
+            me.inited = true;
+
+            me.lang = lang;
+            me.editor = editor;
+
+            me.root().html($.parseTmpl(me.tpl, $.extend({}, lang['static'], {
+                'key': editor.options.baiduMapKey,
+                'theme_url': theme_url
+            })));
+
+            me.initRequestApi();
+
+        },
+        /**
+         * 初始化请求API
+         */
+        initRequestApi: function () {
+
+            var $ifr = null;
+            //已经初始化过, 不用再次初始化
+            if (window.BMap && window.BMap.Map) {
+                this.initBaiduMap();
+            } else {
+                $ifr = $('<iframe style="display: none;"></iframe>');
+                $ifr.appendTo(this.root());
+
+                $ifr = $ifr[0].contentWindow.document;
+
+                $ifr.open();
+                $ifr.write(this.root().find(".edui-tpl-container").html().replace(/scr_ipt/g, 'script').replace('<<id>>', "'" + this.editor.id + "'"));
+            }
+
+        },
+        requestMapApi: function (src) {
+            var me = this;
+            if (src.length) {
+                var _src = src[0];
+                src = src.slice(1);
+                if (_src) {
+                    $.getScript(_src, function () {
+                        me.requestMapApi(src);
+                    });
+                } else {
+                    me.requestMapApi(src);
+                }
+            } else {
+                me.initBaiduMap();
+            }
+
+        },
+        initBaiduMap: function () {
+            var $root = this.root(),
+                map = new BMap.Map($root.find(".edui-map-container")[0]),
+                me = this,
+                marker,
+                point,
+                imgcss,
+                img = $(me.editor.selection.getRange().getClosedNode());
+
+            map.enableInertialDragging();
+            map.enableScrollWheelZoom();
+            map.enableContinuousZoom();
+
+            var url = '';
+            if (img.length && /api[.]map[.]baidu[.]com/ig.test(img.attr("src"))) {
+                url = img.attr("src");
+                imgcss = img.attr('style');
+            }
+
+            var centerParam = me.getPars("center", url) || me.editor.options.baiduMapCenter || '116.404362,39.904768';
+            var markerParam = me.getPars("markers", url) || '';
+            var zoom = Number(me.getPars('zoom', url) || 11);
+            var centerPos = centerParam.replace(/[\s]+/g, '').split(",");
+            var markerPos = markerParam ? markerParam.replace(/[\s]+/g, '').split(",") : [];
+
+            point = new BMap.Point(Number(centerPos[0]), Number(centerPos[1]));
+            map.addControl(new BMap.NavigationControl());
+            map.centerAndZoom(point, zoom);
+
+            if (markerPos.length == 2) {
+                marker = new BMap.Marker(new BMap.Point(Number(markerPos[0]), Number(markerPos[1])));
+                marker.enableDragging();
+                map.addOverlay(marker);
+            }
+            map.addEventListener('click', function (e, type, target, point, overlay) {
+                map.clearOverlays();
+                me.marker = new BMap.Marker(e.point);
+                map.addOverlay(me.marker);
+            });
+
+            me.map = map;
+            me.marker = marker;
+            me.imgcss = imgcss;
+        },
+        doSearch: function () {
+            var me = this,
+                city = me.root().find('.edui-map-city').val(),
+                address = me.root().find('.edui-map-address').val();
+
+            if (!city) {
+                alert(me.lang.cityMsg);
+                return;
+            }
+            var search = new BMap.LocalSearch(city, {
+                onSearchComplete: function (results) {
+                    if (results && results.getNumPois()) {
+                        var points = [];
+                        for (var i = 0; i < results.getCurrentNumPois(); i++) {
+                            points.push(results.getPoi(i).point);
+                        }
+                        if (points.length > 1) {
+                            me.map.setViewport(points);
+                        } else {
+                            me.map.centerAndZoom(points[0], 11);
+                        }
+                        point = me.map.getCenter();
+                    } else {
+                        alert(me.lang.errorMsg);
+                    }
+                }
+            });
+            search.search(address || city);
+        },
+        getPars: function (name, url) {
+            url = url || location.href;
+            return url.match(new RegExp('[?&]' + name + '=([^?&]+)', 'i')) ? decodeURIComponent(RegExp.$1) : '';
+        },
+        reset: function () {
+            this.map && this.map.reset();
+        },
+        initEvent: function () {
+            var me = this,
+                $root = me.root();
+
+            $root.find('.edui-map-address').on('keydown', function (evt) {
+                evt = evt || event;
+                if (evt.keyCode == 13) {
+                    me.doSearch();
+                    return false;
+                }
+            });
+
+            $root.find(".edui-map-button").on('click', function (evt) {
+                me.doSearch();
+            });
+
+            $root.find(".edui-map-address").focus();
+
+            $root.on("mousewheel DOMMouseScroll", function (e) {
+                return false;
+            });
+
+        },
+        width: 580,
+        height: 408,
+        buttons: {
+            ok: {
+                exec: function (editor) {
+                    var widget = editor.getWidgetData(widgetName),
+                        center = widget.map.getCenter(),
+                        zoom = widget.map.getZoom(),
+                        size = widget.map.getSize(),
+                        markerPoint = widget.marker ? widget.marker.point : null;
+                    if (widget.root().find(".edui-map-dynamic")[0].checked) {
+
+                        var URL = editor.getOpt('UMEDITOR_HOME_URL'),
+                            url = [URL + (/\/$/.test(URL) ? '' : '/') + "dialogs/map/map.html" +
+                            '?center=' + center.lng + ',' + center.lat,
+                                '&zoom=' + zoom,
+                                '&width=' + size.width,
+                                '&height=' + size.height,
+                                '&markers=' + (markerPoint ? markerPoint.lng + ',' + markerPoint.lat : '')].join('');
+                        editor.execCommand('inserthtml', '<iframe class="ueditor_baidumap" src="' + url + '" frameborder="0" width="' + (size.width + 4) + '" height="' + (size.height + 4) + '"></iframe>', true);
+                    } else {
+                        url = "https://api.map.baidu.com/staticimage?center=" + center.lng + ',' + center.lat +
+                            "&zoom=" + zoom + "&width=" + size.width + '&height=' + size.height + "&markers=" + (markerPoint ? markerPoint.lng + ',' + markerPoint.lat : '');
+                        editor.execCommand('inserthtml', '<img width="' + size.width + '" height="' + size.height + '" src="' + url + '"' + (widget.imgcss ? ' style="' + widget.imgcss + '"' : '') + '/>', true);
+                    }
+                    try {
+                        widget.reset();
+                    } catch (e) {
+
+                    }
+                }
+            },
+            cancel: {
+                exec: function (editor) {
+                    try {
+                        editor.getWidgetData(widgetName).reset();
+                    } catch (e) {
+
+                    }
+                }
+            }
+        }
+    }, function () {
+        console.log(122);
+    });
+
+})();
+

BIN
public/assets/addons/umeditor/dialogs/video/images/center_focus.jpg


BIN
public/assets/addons/umeditor/dialogs/video/images/left_focus.jpg


BIN
public/assets/addons/umeditor/dialogs/video/images/none_focus.jpg


BIN
public/assets/addons/umeditor/dialogs/video/images/right_focus.jpg


+ 77 - 0
public/assets/addons/umeditor/dialogs/video/video.css

@@ -0,0 +1,77 @@
+@charset "utf-8";
+.edui-dialog-video .edui-video-wrapper{ width: 570px;_width:575px;margin: 10px auto; zoom:1;position: relative}
+.edui-dialog-video .edui-video-tabbody{height:335px;}
+.edui-dialog-video .edui-video-panel { position: absolute;width:100%; height:100%;background: #fff;}
+.edui-dialog-video .edui-video-panel table td{vertical-align: middle;}
+.edui-dialog-video .video-btn-container {overflow:hidden;position: relative;height:24px;width:80px;}
+.edui-dialog-video .video-btn-container input{text-indent:-9999px;position:absolute;top:0;left:0;width:100%;height:100%;z-index:99;background:transparent;}
+.edui-dialog-video .video-btn-container p{position:absolute;top:0;left:0;width:76px;height:22px;z-index:98;line-height: 22px;text-align: center;}
+.edui-dialog-video #eduiVideoUrl {
+    width: 330px;
+    height: 21px;
+    line-height: 21px;
+    margin: 8px 5px;
+    background: #FFF;
+    border: 1px solid #d7d7d7;
+}
+.edui-dialog-video #eduiVideoSearchTxt{margin-left:15px;background: #FFF;width:200px;height:21px;line-height:21px;border: 1px solid #d7d7d7;}
+.edui-dialog-video #searchList{width: 570px;overflow: auto;zoom:1;height: 270px;}
+.edui-dialog-video #searchList div{float: left;width: 120px;height: 135px;margin: 5px 15px;}
+.edui-dialog-video #searchList img{margin: 2px 8px;cursor: pointer;border: 2px solid #fff} /*不用缩略图*/
+.edui-dialog-video #searchList p{margin-left: 10px;}
+.edui-dialog-video #eduiVideoType{
+    width: 65px;
+    height: 23px;
+    line-height: 22px;
+    border: 1px solid #d7d7d7;
+}
+.edui-dialog-video #eduiVideoSearchBtn,.edui-dialog-video #eduiVideoSearchReset{
+    /*width: 80px;*/
+    height: 25px;
+    line-height: 25px;
+    background: #eee;
+    border: 1px solid #d7d7d7;
+    cursor: pointer;
+    padding: 0 5px;
+}
+
+
+
+.edui-dialog-video #eduiVideoPreview{width: 420px; height: 280px;background-color: #ddd;float: left}
+.edui-dialog-video #eduiVideoInfo {width: 120px;float: left;margin-left: 10px;_margin-left:7px;}
+.edui-dialog-video .edui-video-wrapper fieldset{
+    border: 1px solid #ddd;
+    padding-left: 5px;
+    margin-bottom: 20px;
+    padding-bottom: 5px;
+    width: 115px;
+}
+.edui-dialog-video .edui-video-wrapper fieldset legend{font-weight: bold;}
+.edui-dialog-video .edui-video-wrapper fieldset p{line-height: 30px;}
+.edui-dialog-video .edui-video-wrapper fieldset input.edui-video-txt{
+    width: 65px;
+    height: 21px;
+    line-height: 21px;
+    margin: 8px 5px;
+    background: #FFF;
+    border: 1px solid #d7d7d7;
+}
+.edui-dialog-video .edui-video-wrapper label.edui-video-url{font-size:14px;}
+.edui-dialog-video #eduiVideoFloat div{cursor:pointer;opacity: 0.5;filter: alpha(opacity = 50);margin:9px;_margin:5px;width:38px;height:36px;float:left;}
+.edui-dialog-video #eduiVideoFloat .edui-video-focus{opacity: 1;filter: alpha(opacity = 100)}
+.edui-dialog-video .edui-video-wrapper span.edui-video-view{display: inline-block;width: 30px;float: right;cursor: pointer;color: blue}
+.edui-dialog-video #edui-video-input {margin-bottom:5px;}
+.edui-dialog-video #edui-video-input .edui-btn {
+    float: left;
+    height: 22px;
+    width: 76px;
+    margin: 0;
+    background-color: #ffffff;
+    padding: 0;
+    border: 1px solid #ababab;
+    font-size: 12px;
+    line-height: 22px;
+    text-align: center;
+    cursor: pointer;
+    color:#444;
+}

+ 278 - 0
public/assets/addons/umeditor/dialogs/video/video.js

@@ -0,0 +1,278 @@
+(function () {
+    var domUtils = UM.dom.domUtils;
+    var widgetName = 'video';
+
+    UM.registerWidget(widgetName, {
+
+        tpl: "<link rel=\"stylesheet\" type=\"text/css\" href=\"<%=video_url%>video.css\" />" +
+            "<div class=\"edui-video-wrapper\">" +
+            "<div id=\"eduiVideoTab\">" +
+            "<div id=\"eduiVideoTabBodys\" class=\"edui-video-tabbody\">" +
+            "<div id=\"eduiVideoPanel\" class=\"edui-video-panel\">" +
+            "<table id='edui-video-input'><tr><td><label for=\"eduiVideoUrl\" class=\"edui-video-url\"><%=lang_video_url%></label></td><td><input id=\"eduiVideoUrl\" type=\"text\"></td><td><div class='video-btn-container'><input type='file' name='videofile' accept='video/mp4, video/webm, application/octet-stream, .mp4, .webm, .flv' id='uploadvideo'><p class='edui-btn edui-btn-primary'>上传视频</p></div></td><td><a href='javascript:' id='choosevideo' class='edui-btn edui-btn-primary'>选择视频</a></td></tr></table>" +
+            "<div id=\"eduiVideoPreview\"></div>" +
+            "<div id=\"eduiVideoInfo\">" +
+            "<fieldset>" +
+            "<legend style='font-size:14px;width:auto;border-bottom:none;padding:0 5px;margin-bottom:5px;'><%=lang_video_size%></legend>" +
+            "<table>" +
+            "<tr><td><label for=\"eduiVideoWidth\"><%=lang_videoW%></label></td><td><input class=\"edui-video-txt\" id=\"eduiVideoWidth\" type=\"text\"/></td></tr>" +
+            "<tr><td><label for=\"eduiVideoHeight\"><%=lang_videoH%></label></td><td><input class=\"edui-video-txt\" id=\"eduiVideoHeight\" type=\"text\"/></td></tr>" +
+            "</table>" +
+            "</fieldset>" +
+            "<fieldset>" +
+            "<legend style='font-size:14px;width:auto;border-bottom:none;padding:0 5px;margin-bottom:5px;'><%=lang_alignment%></legend>" +
+            "<div id=\"eduiVideoFloat\"></div>" +
+            "</fieldset>" +
+            "</div>" +
+            "</div>" +
+            "</div>" +
+            "</div>" +
+            "</div>",
+        initContent: function (editor, $widget) {
+
+            var me = this,
+                lang = editor.getLang(widgetName),
+                video_url = UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/video/';
+
+            me.lang = lang;
+            me.editor = editor;
+            me.$widget = $widget;
+            me.root().html($.parseTmpl(me.tpl, $.extend({video_url: video_url}, lang['static'])));
+
+            me.initController(lang);
+
+        },
+        initEvent: function (editor, $w) {
+
+            var me = this,
+                url = $("#eduiVideoUrl", me.$widget)[0];
+
+            if ('oninput' in url) {
+                url.oninput = function () {
+                    me.createPreviewVideo(this.value);
+                };
+            } else {
+                url.onpropertychange = function () {
+                    me.createPreviewVideo(this.value);
+                }
+            }
+            me.editor = editor;
+            me.dialog = $w;
+
+            $(me.dialog).delegate("#choosevideo", "click", function (e) {
+                var selectUrl = typeof Config !== 'undefined' && Config.modulename === 'index' ? 'user/attachment' : 'general/attachment/select';
+                parent.Fast.api.open(selectUrl + "?element_id=&multiple=false&mimetype=video/*", "选择", {
+                    callback: function (data) {
+                        var fullurl = Fast.api.cdnurl(data.url, true);
+                        $("#eduiVideoUrl").val(fullurl);
+                        me.createPreviewVideo(fullurl);
+                    }
+                });
+                return false;
+            });
+            $(me.dialog).delegate("#uploadvideo", "change", function (e) {
+                var files = $(this).prop('files');
+                if (files.length > 0) {
+                    var uploadCallback = me.editor.getOpt('imageUploadCallback');
+                    uploadCallback.call(me, files[0], function (url, data) {
+                        $("#eduiVideoUrl").val(data.fullurl);
+                        me.createPreviewVideo(data.fullurl);
+                    });
+                }
+                return;
+            });
+
+        },
+        initController: function (lang) {
+
+            var me = this,
+                img = me.editor.selection.getRange().getClosedNode(),
+                url;
+
+            me.createAlignButton(["eduiVideoFloat"]);
+
+            //编辑视频时初始化相关信息
+            if (img && img.className == "edui-faked-video") {
+                $("#eduiVideoUrl", me.$widget)[0].value = url = img.getAttribute("_url");
+                $("#eduiVideoWidth", me.$widget)[0].value = img.width;
+                $("#eduiVideoHeight", me.$widget)[0].value = img.height;
+                var align = domUtils.getComputedStyle(img, "float"),
+                    parentAlign = domUtils.getComputedStyle(img.parentNode, "text-align");
+                me.updateAlignButton(parentAlign === "center" ? "center" : align);
+            }
+            me.createPreviewVideo(url);
+
+        },
+        /**
+         * 根据url生成视频预览
+         */
+        createPreviewVideo: function (url) {
+
+            if (!url) return;
+
+            var me = this,
+                lang = me.lang,
+                conUrl = me.convert_url(url);
+
+            $("#eduiVideoPreview", me.$widget)[0].innerHTML = '<video ' +
+                ' src="' + url + '"' +
+                ' width="' + 420 + '"' +
+                ' height="' + 280 + '"' +
+                ' controls autoplay preload="auto"></video><br>';
+
+        },
+        /**
+         * 将单个视频信息插入编辑器中
+         */
+        insertSingle: function () {
+
+            var me = this,
+                width = $("#eduiVideoWidth", me.$widget)[0],
+                height = $("#eduiVideoHeight", me.$widget)[0],
+                url = $('#eduiVideoUrl', me.$widget)[0].value,
+                align = this.findFocus("eduiVideoFloat", "name");
+
+            if (!url) return false;
+            if (!me.checkNum([width, height])) return false;
+            this.editor.execCommand('insertvideo', {
+                url: me.convert_url(url),
+                width: width.value,
+                height: height.value,
+                align: align
+            });
+
+        },
+        /**
+         * URL转换
+         */
+        convert_url: function (url) {
+            if (!url) return '';
+            return url;
+        },
+        /**
+         * 检测传入的所有input框中输入的长宽是否是正数
+         */
+        checkNum: function checkNum(nodes) {
+
+            var me = this;
+
+            for (var i = 0, ci; ci = nodes[i++];) {
+                var value = ci.value;
+                if (!me.isNumber(value) && value) {
+                    alert(me.lang.numError);
+                    ci.value = "";
+                    ci.focus();
+                    return false;
+                }
+            }
+            return true;
+        },
+        /**
+         * 数字判断
+         * @param value
+         */
+        isNumber: function (value) {
+            return /(0|^[1-9]\d*$)/.test(value);
+        },
+        updateAlignButton: function (align) {
+            var aligns = $("#eduiVideoFloat", this.$widget)[0].children;
+
+            for (var i = 0, ci; ci = aligns[i++];) {
+                if (ci.getAttribute("name") == align) {
+                    if (ci.className != "edui-video-focus") {
+                        ci.className = "edui-video-focus";
+                    }
+                } else {
+                    if (ci.className == "edui-video-focus") {
+                        ci.className = "";
+                    }
+                }
+            }
+
+        },
+        /**
+         * 创建图片浮动选择按钮
+         * @param ids
+         */
+        createAlignButton: function (ids) {
+            var lang = this.lang,
+                vidoe_home = UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/video/';
+
+            for (var i = 0, ci; ci = ids[i++];) {
+                var floatContainer = $("#" + ci, this.$widget) [0],
+                    nameMaps = {"none": lang['default'], "left": lang.floatLeft, "right": lang.floatRight};
+                for (var j in nameMaps) {
+                    var div = document.createElement("div");
+                    div.setAttribute("name", j);
+                    if (j == "none") div.className = "edui-video-focus";
+                    div.style.cssText = "background:url(" + vidoe_home + "images/" + j + "_focus.jpg);";
+                    div.setAttribute("title", nameMaps[j]);
+                    floatContainer.appendChild(div);
+                }
+                this.switchSelect(ci);
+            }
+        },
+        /**
+         * 选择切换
+         */
+        switchSelect: function (selectParentId) {
+            var selects = $("#" + selectParentId, this.$widget)[0].children;
+            for (var i = 0, ci; ci = selects[i++];) {
+                $(ci).on("click", function () {
+                    for (var j = 0, cj; cj = selects[j++];) {
+                        cj.className = "";
+                        cj.removeAttribute && cj.removeAttribute("class");
+                    }
+                    this.className = "edui-video-focus";
+                })
+            }
+        },
+        /**
+         * 找到id下具有focus类的节点并返回该节点下的某个属性
+         * @param id
+         * @param returnProperty
+         */
+        findFocus: function (id, returnProperty) {
+            var tabs = $("#" + id, this.$widget)[0].children,
+                property;
+            for (var i = 0, ci; ci = tabs[i++];) {
+                if (ci.className == "edui-video-focus") {
+                    property = ci.getAttribute(returnProperty);
+                    break;
+                }
+            }
+            return property;
+        },
+        /**
+         * 末尾字符检测
+         */
+        endWith: function (str, endStrArr) {
+            for (var i = 0, len = endStrArr.length; i < len; i++) {
+                var tmp = endStrArr[i];
+                if (str.length - tmp.length < 0) return false;
+
+                if (str.substring(str.length - tmp.length) == tmp) {
+                    return true;
+                }
+            }
+            return false;
+        },
+        width: 610,
+        height: 358,
+        buttons: {
+            ok: {
+                exec: function (editor, $w) {
+                    $("#eduiVideoPreview", $w).html("");
+                    editor.getWidgetData(widgetName).insertSingle();
+                }
+            },
+            cancel: {
+                exec: function () {
+                    //清除视频
+                    $("#eduiVideoPreview").html("");
+                }
+            }
+        }
+    });
+
+})();

+ 150 - 0
public/assets/addons/umeditor/lang/en/en.js

@@ -0,0 +1,150 @@
+/**
+ * English language package
+ */
+UM.I18N['en'] = {
+    'labelMap':{
+        'anchor':'Anchor', 'undo':'Undo', 'redo':'Redo', 'bold':'Bold', 'indent':'Indent', 'snapscreen':'SnapScreen',
+        'italic':'Italic', 'underline':'Underline', 'strikethrough':'Strikethrough', 'subscript':'SubScript','fontborder':'text border',
+        'superscript':'SuperScript', 'formatmatch':'Format Match', 'source':'Source', 'blockquote':'BlockQuote',
+        'pasteplain':'PastePlain', 'selectall':'SelectAll', 'print':'Print', 'preview':'Preview',
+        'horizontal':'Horizontal', 'removeformat':'RemoveFormat', 'time':'Time', 'date':'Date',
+        'unlink':'Unlink', 'insertrow':'InsertRow', 'insertcol':'InsertCol', 'mergeright':'MergeRight', 'mergedown':'MergeDown',
+        'deleterow':'DeleteRow', 'deletecol':'DeleteCol', 'splittorows':'SplitToRows','insertcode':'insert code',
+        'splittocols':'SplitToCols', 'splittocells':'SplitToCells','deletecaption':'DeleteCaption','inserttitle':'InsertTitle',
+        'mergecells':'MergeCells', 'deletetable':'DeleteTable', 'cleardoc':'Clear', 'insertparagraphbeforetable':"InsertParagraphBeforeTable",
+        'fontfamily':'FontFamily', 'fontsize':'FontSize', 'paragraph':'Paragraph', 'image':'Image','edittable':'Edit Table', 'edittd':'Edit Td','link':'Link',
+        'emotion':'Emotion', 'spechars':'Spechars', 'searchreplace':'SearchReplace', 'map':'BaiduMap', 'gmap':'GoogleMap',
+        'video':'Video', 'help':'Help', 'justifyleft':'JustifyLeft', 'justifyright':'JustifyRight', 'justifycenter':'JustifyCenter',
+        'justifyjustify':'Justify', 'forecolor':'FontColor', 'backcolor':'BackColor', 'insertorderedlist':'OL',
+        'insertunorderedlist':'UL', 'fullscreen':'FullScreen', 'directionalityltr':'EnterFromLeft', 'directionalityrtl':'EnterFromRight',
+        'rowspacingtop':'RowSpacingTop', 'rowspacingbottom':'RowSpacingBottom', 'highlightcode':'Code', 'pagebreak':'PageBreak', 'insertframe':'Iframe', 'imagenone':'Default',
+        'imageleft':'ImageLeft', 'imageright':'ImageRight', 'attachment':'Attachment', 'imagecenter':'ImageCenter', 'wordimage':'WordImage',
+        'lineheight':'LineHeight','edittip':'EditTip','customstyle':'CustomStyle', 'scrawl':'Scrawl', 'autotypeset':'AutoTypeset',
+        'webapp':'WebAPP', 'touppercase':'UpperCase', 'tolowercase':'LowerCase','template':'Template','background':'Background','inserttable':'InsertTable',
+        'drafts': 'drafts', 'formula':'formula'
+    },
+    'paragraph':{'p':'Paragraph', 'h1':'Title 1', 'h2':'Title 2', 'h3':'Title 3', 'h4':'Title 4', 'h5':'Title 5', 'h6':'Title 6'},
+    'fontfamily':{
+        'songti':'Sim sun',
+        'kaiti':'Sim kai',
+        'heiti':'Sim hei',
+        'lishu':'Sim li',
+        'yahei': 'Microsoft yahei',
+        'andaleMono':'Andale mono',
+        'arial': 'Arial',
+        'arialBlack':'Arial black',
+        'comicSansMs':'Comic sans ms',
+        'impact':'Impact',
+        'timesNewRoman':'Times new roman'
+    },
+    'ok':"OK",
+    'cancel':"Cancel",
+    'closeDialog':"closeDialog",
+    'tableDrag':"You must import the file uiUtils.js before drag! ",
+    'autofloatMsg':"The plugin AutoFloat depends on EditorUI!",
+    'anthorMsg':"Link",
+    'clearColor':'Clear',
+    'standardColor':'Standard color',
+    'themeColor':'Theme color',
+    'property':'Property',
+    'default':'Default',
+    'modify':'Modify',
+    'justifyleft':'Justify Left',
+    'justifyright':'Justify Right',
+    'justifycenter':'Justify Center',
+    'justify':'Default',
+    'clear':'Clear',
+    'anchorMsg':'Anchor',
+    'delete':'Delete',
+    'clickToUpload':"Click to upload",
+    'unset':"Language hasn't been set!",
+    't_row':'row',
+    't_col':'col',
+    'more':'More',
+    'pasteOpt':'Paste Option',
+    'pasteSourceFormat':"Keep Source Formatting",
+    'tagFormat':'Keep tag',
+    'pasteTextFormat':'Keep Text only',
+
+    //===============dialog i18N=======================
+    'image':{
+        'static':{
+            'lang_tab_local':"Local Upload",
+            'lang_tab_imgSearch':"Network Pictures",
+            'lang_input_dragTip':"Support drag upload",
+            'lang_btn_add':"Add"
+        },
+        'uploadError': 'Upload Error'
+    },
+    'emotion':{
+        'static':{
+            'lang_input_choice':'Choice',
+            'lang_input_Tuzki':'Tuzki',
+            'lang_input_lvdouwa':'LvDouWa',
+            'lang_input_BOBO':'BOBO',
+            'lang_input_babyCat':'BabyCat',
+            'lang_input_bubble':'Bubble',
+            'lang_input_youa':'YouA'
+        }
+    },
+    'gmap':{
+        'static':{
+            'lang_input_address':'Address:',
+            'lang_input_search':'Search',
+            'address':{'value':"Beijing"}
+        },
+        'searchError':'Unable to locate the address!'
+    },
+    'link':{
+        'static':{
+            'lang_input_text':'Text:',
+            'lang_input_url':'URL:',
+            'lang_input_title':'Title:',
+            'lang_input_target':'open in new window:'
+        },
+        'validLink':'Supports only effective when a link is selected',
+        'httpPrompt':'The hyperlink you enter should start with "http|https|ftp://"!'
+    },
+    'map':{
+        'static':{
+            'lang_city':"City",
+            'lang_address':"Address",
+            'city':{'value':"Beijing"},
+            'lang_search':"Search",
+            'lang_dynamicmap':"Dynamic map"
+        },
+        'cityMsg':"Please enter the city name!",
+        'errorMsg':"Can't find the place!"
+    },
+    'video':{
+        'static':{
+            'lang_tab_insertV':"Video",
+            'lang_video_url':" URL ",
+            'lang_video_size':"Video Size",
+            'lang_videoW':"Width",
+            'lang_videoH':"Height",
+            'lang_alignment':"Alignment",
+            'videoSearchTxt':{'value':"Enter the search keyword!"},
+            'videoType':{'options':["All", "Hot", "Entertainment", "Funny", "Sports", "Science", "variety"]},
+            'videoSearchBtn':{'value':"Search in Baidu"},
+            'videoSearchReset':{'value':"Clear result"}
+        },
+        'numError':"Please enter the correct Num. e.g 123,400",
+        'floatLeft':"Float left",
+        'floatRight':"Float right",
+        'default':"Default",
+        'block':"Display in block",
+        'urlError':"The video url format may be wrong!",
+        'loading':" &nbsp;The video is loading, please wait…",
+        'clickToSelect':"Click to select",
+        'goToSource':'Visit source video ',
+        'noVideo':" &nbsp; &nbsp;Sorry,can't find the video,please try again!"
+    },
+    'formula':{
+        'static':{
+            'lang_tab_common':'Common',
+            'lang_tab_symbol':'Symbol',
+            'lang_tab_letter':'Letter'
+        }
+    }
+};

BIN
public/assets/addons/umeditor/lang/en/images/addimage.png


BIN
public/assets/addons/umeditor/lang/en/images/alldeletebtnhoverskin.png


BIN
public/assets/addons/umeditor/lang/en/images/alldeletebtnupskin.png


BIN
public/assets/addons/umeditor/lang/en/images/background.png


Some files were not shown because too many files changed in this diff