From ebb015b51c5e2bd2d6f2b6893f9df6533a3d0a6d Mon Sep 17 00:00:00 2001 From: hant Date: Wed, 21 May 2025 23:33:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BE=E5=8D=95=E5=9C=B0=E5=9B=BEdome?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/address/bootstrap.js | 1 - addons/address/controller/Index.php | 1 - .../admin/controller/orders/Dispatch.php | 8 ++ .../admin/view/orders/dispatch/map.html | 79 +++++++++++++++++++ public/assets/js/backend/order.js | 18 +++++ 5 files changed, 105 insertions(+), 2 deletions(-) create mode 100644 application/admin/view/orders/dispatch/map.html diff --git a/addons/address/bootstrap.js b/addons/address/bootstrap.js index c34f4ea..9d832ac 100644 --- a/addons/address/bootstrap.js +++ b/addons/address/bootstrap.js @@ -21,7 +21,6 @@ require([], function () { if (city_code){ url += city_code ? "&city_code=" + city_code : ""; } - console.log(url); Fast.api.open(url, '位置选择', { callback: function (res) { input_id && $("#" + input_id).val(res.address).trigger("change"); diff --git a/addons/address/controller/Index.php b/addons/address/controller/Index.php index 812eac1..9917665 100644 --- a/addons/address/controller/Index.php +++ b/addons/address/controller/Index.php @@ -36,7 +36,6 @@ class Index extends Controller // 加载当前控制器语言包 $this->view->assign('site', $site); $this->view->assign('config', $config); - return $this->view->fetch(); } diff --git a/application/admin/controller/orders/Dispatch.php b/application/admin/controller/orders/Dispatch.php index 1d7799b..d0ad64f 100644 --- a/application/admin/controller/orders/Dispatch.php +++ b/application/admin/controller/orders/Dispatch.php @@ -5,6 +5,7 @@ namespace app\admin\controller\orders; use app\admin\model\Order; use app\admin\model\OrderDispatch; use app\common\controller\Backend; +use think\Config; use think\Db; use think\db\exception\DataNotFoundException; use think\db\exception\ModelNotFoundException; @@ -301,4 +302,11 @@ class Dispatch extends Backend return $workers; } + public function map(){ + // 配置信息 + $config = get_addon_config('address'); + $this->view->assign('mapkey',$config); + return $this->fetch(); + } + } diff --git a/application/admin/view/orders/dispatch/map.html b/application/admin/view/orders/dispatch/map.html new file mode 100644 index 0000000..f135ea8 --- /dev/null +++ b/application/admin/view/orders/dispatch/map.html @@ -0,0 +1,79 @@ + + + + + 地图派单示例 + + + + + +
+ + + + diff --git a/public/assets/js/backend/order.js b/public/assets/js/backend/order.js index 6f71516..66285b8 100644 --- a/public/assets/js/backend/order.js +++ b/public/assets/js/backend/order.js @@ -230,6 +230,24 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'cascader'], function }, refresh: true, }, + { + name: "mapdispatch", + text: "地图派单", + title: "派单", + extend: 'data-toggle="tooltip" data-container="body"', + classname: 'btn btn-xs btn-info btn-dialog', + icon: 'fa fa-add', + url: function (row) { + return 'orders/dispatch/map?order_id=' + row.id; + }, + visible: function (row) { + if (row.status == 10) { + return true; + } + return false; + }, + refresh: true, + }, { name: "reminder", text: "催单",