From 463240df80fcf3469c3805a78991ab6f9306e994 Mon Sep 17 00:00:00 2001 From: gcd Date: Sun, 8 Jun 2025 18:16:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=90=8E=E5=8F=B0=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=BD=95=E5=85=A5=E9=A1=B5=E9=9D=A2=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Order.php | 7 +- application/admin/validate/Order.php | 42 +- application/admin/view/order/add.html | 715 +++++++++++++++---------- public/assets/img/automation.png | Bin 0 -> 1740 bytes 4 files changed, 485 insertions(+), 279 deletions(-) create mode 100644 public/assets/img/automation.png diff --git a/application/admin/controller/Order.php b/application/admin/controller/Order.php index e81ec9e..aee0d2f 100644 --- a/application/admin/controller/Order.php +++ b/application/admin/controller/Order.php @@ -204,11 +204,16 @@ class Order extends Backend public function add() { - if (false === $this->request->isPost()) { return $this->view->fetch(); } $params = $this->request->post('row/a'); + + $validate = $this->validate($params, \app\admin\validate\Order::class . '.add'); + if ($validate !== true) { + $this->error($validate); + } + $params = array_filter($params, function ($val) { return $val != ''; }); diff --git a/application/admin/validate/Order.php b/application/admin/validate/Order.php index e0565c2..50ef95c 100644 --- a/application/admin/validate/Order.php +++ b/application/admin/validate/Order.php @@ -10,18 +10,56 @@ class Order extends Validate * 验证规则 */ protected $rule = [ + 'source' => 'require', + 'item_id' => 'require', + 'customer' => 'require|max:32', + 'tel' => 'require|number|max:32', + 'area_id' => 'require', + 'address' => 'require|max:255', + 'lng' => 'require', + 'lat' => 'require', + 'online_amount|收款金额' => 'require|number|between:0.01,10000000', + 'plan_time|上门时间' => 'requireIf:set_time,1|date' ]; /** * 提示消息 */ protected $message = [ + 'source.require' => '请选择订单渠道', + 'item_id.require' => '请选择服务项目', + + 'customer.require' => '请输入客户昵称', + 'customer.max' => '客户昵称不能超过 32 个字符', + + 'tel.require' => '请输入客户电话', + 'area_id.require' => '请选择地区', + + 'address.require' => '请选择详细地址', + 'address.max' => '详细地址不能超过 255 个字符', + + 'lng.require' => '请选择详细地址', + 'lat.require' => '请选择详细地址', + + 'online_amount.require' => '请输入收款金额', + 'online_amount.number' => '收款金额不正确', ]; /** * 验证场景 */ protected $scene = [ - 'add' => [], + 'add' => [ + 'source', + 'item_id', + 'customer', + 'tel', + 'area_id', + 'address', + 'lng', + 'lat', + 'online_amount', + 'plan_time', + ], 'edit' => [], ]; - + } diff --git a/application/admin/view/order/add.html b/application/admin/view/order/add.html index 2644c32..b4feccc 100644 --- a/application/admin/view/order/add.html +++ b/application/admin/view/order/add.html @@ -1,283 +1,446 @@ - -
-
-
- -
-
-
-
-
-
- -
- -
-
-
- -
- -
-
- - -
- -
- - -
-
-
- -
-
- -
地图查找
-
- - - -
-
- -
- -
- - - -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
-
- -
- - -
- -
-
    -
    -
    -
    - -
    - -
    - -
    - -
    -
    - - - -
    - -
    - -
    -
    - -
    - -
    - -
    -
    - - -
    - -
    - -
    -
    - -
    - -
    - -
    -
    - - - -
    - -
    - -
    -
    -
    - -
    - -
    -
    - -
    - -
    - - -
    -
    - - -
    - -
    -
    快速输入:
    -
    -
    - -
    -
    -
    - -
    -
    - -
    -
    -
    +
    +
    +
    +
    + +
    +
    +
    *订单渠道:
    +
    + +
    +
    +
    *服务项目:
    +
    + + +
    +
    +
    +
    +
    +
    *客户昵称:
    +
    + +
    +
    +
    +
    *客户电话:
    +
    + +
    +
    +
    +
    +
    *地区:
    +
    + + +
    +
    +
    +
    +
    *详细地址:
    +
    +
    地图查找
    +
    +
    +
    + + + + +
    +
    +
    +
    +
    收款方式:
    +
    + +
    +
    +
    +
    *收款金额:
    +
    + +
    +
    +
    +
    +
    +
    优惠:
    +
    + +
    +
    +
    + +
    +
    +
    上门时间:
    +
    + {:build_radios('row[set_time]', ['1'=>'有', '0'=>'无'], 1)} +
    +
    +
    +
    *设置时间:
    +
    + +
    +
    +
    +
    +
    +
    订单备注:
    +
    +
    + +
    +
    +
    +
    +
    录单员:
    +
    + +
    +
    +
    +
    +
    图片上传:
    +
    +
    + +
    + + +
    + +
    +
      +
      +
      +
      +
      +
      +
      快速录入:
      +
      +
      +
      +
      + +
      +
      +
      +
      + + 智能识别 +
      +
      +
      +
      + + + + + +
      +
      +
      - - \ No newline at end of file + var items = {:json_encode($items); }; + window.addEventListener('DOMContentLoaded', function () { + setTimeout(function () { + const container = document.querySelector('.body-hidden'); + if (container) { + container.classList.remove('body-hidden'); + container.classList.add('body-shown'); + } + }, 500); + }); + + + + + + + + + + + + + + + + diff --git a/public/assets/img/automation.png b/public/assets/img/automation.png new file mode 100644 index 0000000000000000000000000000000000000000..943f60052b3419ec300d66e66c1875e241bc5bdb GIT binary patch literal 1740 zcmV;-1~d7IP)Px#1am@3R0s$N2z&@+hyVZvc1c7*RCt`_n>}b;M-az}iVWj_o(*Hr5G`492dcb@4Z;dHdw_^tGIk46E`wX~6OZK2m z6}Zph;?IC>($@VUi|Wt=c2`PS18p&&hh;z$`{eE72{0DV?$VM$JP!l4-mm|W*S%uZ{6W|;1+dk!v%@}wpXn5@AUuTiQO&mEoUb_EB zkurjP?0Gy$(;LL!z}Gp%2&@Bd$loLlM_8LO4fco}5f79j={z`eW3EN!92#SGj4`tn z&;2MgXGj7@*qsmIjJZhn2#aIr-IrKBuce}o)$vrE5TgU)lDdf|g$h^Jj4`JQ7Y~dv z8<8CxnsTW*bgcwC#+aJ{8rF<;zO*rC+B+Hpc9fSl0u#!%p-fu3z$RW8UmdnHY0=iP zBl~H`pcKQgDmpsk3GvE_-c>iwZy95J#Ks9deK0A<4m+S=`M>k;NMm2|$);sk!zVeTT+B$$}Cb z^8@bT2O4#%`Z?(|)hY`csj==er|mUiaCzAtnKRY+#>!38$$%~^EiSFOmc7wXC4TQ=eTsMJe#I8n$A3!N=;g*4GArz7 zw-l~P?w2GqBw|U?Lt~|8sO(f~j9hwdiuaCXpH*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