diff --git a/app/admin/controller/order/Order.php b/app/admin/controller/order/Order.php index f07f6c34..adb74256 100755 --- a/app/admin/controller/order/Order.php +++ b/app/admin/controller/order/Order.php @@ -103,7 +103,7 @@ class Order extends AdminBase { $id = $this->request->get('id'); $detail = OrderLogic::getDetail($id); - $detail['shipping'] = OrderLogic::shippingInfo($detail['id']); +// $detail['shipping'] = OrderLogic::shippingInfo($detail['id']); return view('', [ 'detail' => $detail ]); @@ -128,4 +128,14 @@ class Order extends AdminBase } return JsonServer::success('', $result); } + + // 查看对应商品的物流 + public function seeExpress() + { + $id = $this->request->get('id'); + $express = OrderLogic::seeExpress($id); + return view('', [ + 'express' => $express + ]); + } } \ No newline at end of file diff --git a/app/admin/logic/order/OrderLogic.php b/app/admin/logic/order/OrderLogic.php index 51f37634..85f11fe5 100755 --- a/app/admin/logic/order/OrderLogic.php +++ b/app/admin/logic/order/OrderLogic.php @@ -24,6 +24,7 @@ namespace app\admin\logic\order; use app\common\basics\Logic; use app\common\enum\OrderEnum; use app\common\enum\ShopEnum; +use app\common\model\Delivery; use app\common\model\order\Order; use app\common\enum\OrderLogEnum; use app\common\enum\PayEnum; @@ -235,6 +236,8 @@ class OrderLogic extends Logic $result['confirm_take_time'] = ''; } + // 获取商品物流简略信息 + $result['express_info'] = Delivery::where(['order_id' => $id])->field('id, order_goods_id, shipping_name, invoice_no, create_time')->select()->toArray(); return $result; } @@ -505,4 +508,88 @@ class OrderLogic extends Logic } } + // 查看对应单号的物流 + public static function seeExpress($id) + { + $express_data = array(); + + $delivery = Delivery::find($id); + if (!$delivery['invoice_no']) { + $traces['list'] = ['物流单号为空']; + return $traces; + } + + $express = ConfigServer::get('express', 'way'); + $key = ConfigServer::get($express, 'appkey'); + $app = ConfigServer::get($express, 'appsecret'); + if (empty($express) || empty($app) || empty($key)) { + $traces['list'] = ['暂无物流信息']; + return $traces; + } + + $result = Kd100Logic::expressDetail($id); + + // 如果当前时间大于了api接口限制的时间,则调用api接口 + if (!isset($result) || (time() > $result['sel_time'])) { + //快递配置设置为快递鸟时 + if ($express === 'kdniao') { + $expressage = (new Kdniao($app, $key, true)); + $shipping_field = 'codebird'; + } else { + $expressage = (new Kd100($app, $key, true)); + $shipping_field = 'code100'; + } + + //快递编码 + $shipping_code = Db::name('express') + ->where(['id' => $delivery['shipping_id']]) + ->value($shipping_field); + + //获取物流轨迹 + if ($shipping_code === 'SF' && $express === 'kdniao') { + $expressage->logistics($shipping_code, $delivery['invoice_no'], substr($delivery['mobile'],-4)); + }else { + $phone = ''; + if ($shipping_code === 'shunfeng') { + $phone = $delivery['mobile']; + } + $expressage->logistics($shipping_code, $delivery['invoice_no'], $phone); + } + + $traces = $expressage->logisticsFormat(); + $state = 0; + if (!$traces) { + $traces[] = [$expressage->getError()]; + } else { + $data = $expressage->logisticsFullInfo(); + $data['delivery_id'] = $id; + $data['order_id'] = $delivery['order_id']; + Kd100Logic::saveExpress($data); + $state = $data['state']; + + foreach ($traces as &$item) { + $item = array_values(array_unique($item)); + } + } + + $express_data['create_time'] = $delivery['create_time']; + $express_data['invoice_no'] = $delivery['invoice_no']; + $express_data['shipping_name'] = $delivery['shipping_name']; + $express_data['state'] = $state; + $express_data['state_text'] = Kd100Logic::$EXPRESS_STATE[$state]; + $express_data['list'] = $traces; + } else { + $express_data['create_time'] = $delivery['create_time']; + $express_data['invoice_no'] = $delivery['invoice_no']; + $express_data['shipping_name'] = $delivery['shipping_name']; + $express_data['state'] = $result['state']; + $express_data['state_text'] = Kd100Logic::$EXPRESS_STATE[$result['state']]; + $express_data['list'] = json_decode($result['data'], true); + foreach ($express_data['list'] as &$item) { + $item = array_values(array_unique($item)); + } + } + + return $express_data; + } } \ No newline at end of file diff --git a/app/admin/view/order/order/express.html b/app/admin/view/order/order/express.html index caea08b9..77534840 100755 --- a/app/admin/view/order/order/express.html +++ b/app/admin/view/order/order/express.html @@ -6,6 +6,12 @@ justify-content: left; } + .flex { + display: flex; + align-items: center; + justify-content: space-between; + } + .width-160 { width: 200px; } @@ -35,43 +41,12 @@
-
-
- 快递信息 -
-
- - - {empty name="$detail.shipping"} -
- -
暂无物流信息
-
- {else/} -
- -
{$detail.shipping.create_time_text | default= "未知"}
- {if condition = "$detail.shipping.send_type eq 1"} - -
{$detail.shipping.shipping_name | default="未知"}
- -
{$detail.shipping.invoice_no | default= "未知"}
- -
{$detail.shipping.traces.state_text | default= "未知"}
- {else/} - -
无需快递
- {/if} -
- {/empty} -
商品信息
-
@@ -79,6 +54,7 @@ + @@ -86,6 +62,7 @@ + @@ -106,51 +83,25 @@ + {/foreach}
价格(元) 数量 小计(元)物流
¥{$goods.goods_price} {$goods.goods_num} {$goods.total_pay_price} + {if condition="isset($detail.express_info[$k])"} +
+
+
发货时间:{$detail.express_info[$k]['create_time']}
+
快递方式:{$detail.express_info[$k]['shipping_name']}
+
快递单号:{$detail.express_info[$k]['invoice_no']}
+
+
+ +
+
+ {/if} +
- -
-
- 物流轨迹 -
-
- - -
- - - - - - - - - - - {foreach $detail.shipping.traces.list as $k => $item} - - {if is_array($item)} - {foreach $item as $k1 => $value} - - {/foreach} - {else /} - - {/if} - - {/foreach} - -
轨迹
{$value}{$item}
-
- - -
-
- -
-
@@ -180,5 +131,15 @@ parent.layui.table.reload('order-lists'); return true; }); + + $(document).on('click', '.see-express', function () { + var id = $(this).data('id'); + layer.open({ + type: 2 + ,title: '选择商品' + ,content: '{:url("order.Order/seeExpress")}?id=' + id + ,area: ['90%', '90%'] + }) + }); }); \ No newline at end of file diff --git a/app/admin/view/order/order/see_express.html b/app/admin/view/order/order/see_express.html new file mode 100755 index 00000000..656a1f91 --- /dev/null +++ b/app/admin/view/order/order/see_express.html @@ -0,0 +1,132 @@ +{layout name="layout2" /} + +
+ +
+ +
+
+ 物流轨迹 +
+
+ +
{$express.create_time | default= "未知"}
+ +
{$express.shipping_name | default= "未知"}
+ +
{$express.invoice_no | default= "未知"}
+ +
{$express.state_text | default= "未知"}
+
+
+ +
+ + + + + + + + + + + {foreach $express.list as $k => $item} + + {if is_array($item)} + {foreach $item as $k1 => $value} + + {/foreach} + {else /} + + {/if} + + {/foreach} + +
轨迹
{$value}{$item}
+
+
+
+ + + \ No newline at end of file diff --git a/app/common/logic/expressage/Kd100Logic.php b/app/common/logic/expressage/Kd100Logic.php index 178c0182..8ba63cb7 100755 --- a/app/common/logic/expressage/Kd100Logic.php +++ b/app/common/logic/expressage/Kd100Logic.php @@ -21,28 +21,57 @@ class Kd100Logic extends Logic /* * 添加或更新快递信息 * */ - public static function save($order_id, $data) +// public static function save($order_id, $data) +// { +// $express['order_id'] = $order_id; +// $express['delivery_id'] = $data['delivery_id']; +// $express['state'] = $data['state']; +// $express['com'] = $data['com']; +// $express['nu'] = $data['nu']; +// $express['data'] = json_encode($data['data'], JSON_UNESCAPED_UNICODE); +// $express['sel_time'] = time() + self::$SEL_TIME; +// +// $kd100 = self::detail($order_id); +// if ($kd100) { +// Kd100Expressage::where(['order_id' => $order_id])->update($express); +// } else { +// Kd100Expressage::create($express); +// } +// } + + /* + * 获取物流详情 + * */ +// public static function detail($order_id) +// { +// return Kd100Expressage::where(['order_id' => $order_id])->find(); +// } + + /* + * 获取物流详情 物流模块改版后新的获取物流方式 + * */ + public static function expressDetail($delivery_id) { - $express['order_id'] = $order_id; + return Kd100Expressage::where(['delivery_id' => $delivery_id])->find(); + } + + /* + * 添加或更新快递信息 物流模块改版后新的添加或更新快递信息 + * */ + public static function saveExpress($data) + { + $express['order_id'] = $data['order_id']; + $express['delivery_id'] = $data['delivery_id']; $express['state'] = $data['state']; $express['com'] = $data['com']; $express['nu'] = $data['nu']; $express['data'] = json_encode($data['data'], JSON_UNESCAPED_UNICODE); $express['sel_time'] = time() + self::$SEL_TIME; - - $kd100 = self::detail($order_id); + $kd100 = self::expressDetail($data['delivery_id']); if ($kd100) { - Kd100Expressage::where(['order_id' => $order_id])->update($express); + Kd100Expressage::where(['delivery_id' => $data['delivery_id']])->update($express); } else { Kd100Expressage::create($express); } } - - /* - * 获取物流详情 - * */ - public static function detail($order_id) - { - return Kd100Expressage::where(['order_id' => $order_id])->find(); - } } \ No newline at end of file diff --git a/app/shop/controller/order/Order.php b/app/shop/controller/order/Order.php index 5452c8e9..2e20e735 100755 --- a/app/shop/controller/order/Order.php +++ b/app/shop/controller/order/Order.php @@ -114,7 +114,7 @@ class Order extends ShopBase { $id = $this->request->get('id'); $detail = OrderLogic::getDetail($id); - $detail['shipping'] = OrderLogic::shippingInfo($detail['id']); +// $detail['shipping'] = OrderLogic::shippingInfo($detail['id']); return view('', [ 'detail' => $detail ]); @@ -361,4 +361,14 @@ class Order extends ShopBase return JsonServer::error('操作失败'); } } + + // 查看对应商品的物流 + public function seeExpress() + { + $id = $this->request->get('id'); + $express = OrderLogic::seeExpress($id); + return view('', [ + 'express' => $express + ]); + } } \ No newline at end of file diff --git a/app/shop/logic/order/OrderLogic.php b/app/shop/logic/order/OrderLogic.php index dbe1eddb..61fc970f 100755 --- a/app/shop/logic/order/OrderLogic.php +++ b/app/shop/logic/order/OrderLogic.php @@ -31,9 +31,11 @@ use app\common\enum\VerificationEnum; use app\common\logic\GoodsVirtualLogic; use app\common\logic\OrderLogLogic; use app\common\logic\OrderRefundLogic; +use app\common\model\Delivery; use app\common\model\Express; use app\common\model\order\Order; use app\common\model\DevRegion; +use app\common\model\order\OrderGoods; use app\common\model\printer\Printer; use app\common\model\printer\PrinterConfig; use app\common\model\team\Team; @@ -259,7 +261,6 @@ class OrderLogic extends Logic */ public static function getDetail($id) { - $order = new Order(); $result = $order ->with(['user', 'order_goods', 'invoice']) @@ -293,6 +294,8 @@ class OrderLogic extends Logic $result['confirm_take_time'] = ''; } + // 获取商品物流简略信息 + $result['express_info'] = Delivery::where(['order_id' => $id])->field('id, order_goods_id, shipping_name, invoice_no, create_time')->select()->toArray(); return $result; } @@ -308,13 +311,11 @@ class OrderLogic extends Logic */ public static function shippingInfo($order_id) { - $shipping = Db::name('delivery')->where('order_id', $order_id)->find(); if ($shipping) { $shipping['create_time_text'] = date('Y-m-d H:i:s', $shipping['create_time']); } - $shipping['traces'] = self::getShipping($order_id); - +// $shipping['traces'] = self::getShipping($order_id); return $shipping; } @@ -327,10 +328,10 @@ class OrderLogic extends Logic * @throws \think\db\exception\ModelNotFoundException * @author suny * @date 2021/7/14 10:24 上午 + * note 2024-08-17 11:24 物流模块被修改该功能暂时不用 搁置 */ public static function getShipping($order_id) { - $express_data = array(); $orderModel = new Order(); @@ -436,73 +437,156 @@ class OrderLogic extends Logic */ public static function deliveryHandle($data, $admin_id) { - $order_id = $data['order_id']; $order = Order::where(['del' => 0, 'id' => $order_id])->find(); - + $order_goods = OrderGoods::where(['order_id' => $order_id])->field('id')->select()->toArray(); if ($order['shipping_status'] == 1) { return true; } - $shipping = Db::name('express')->where('id', $data['shipping_id'])->find(); + $count = count($data['send_type']); - //添加发货单 - $delivery_data = [ - 'order_id' => $order_id, - 'order_sn' => $order['order_sn'], - 'user_id' => $order['user_id'], - 'admin_id' => $admin_id, - 'consignee' => $order['consignee'], - 'mobile' => $order['mobile'], - 'province' => $order['province'], - 'city' => $order['city'], - 'district' => $order['district'], - 'address' => $order['address'], - 'invoice_no' => $data['invoice_no'], - 'send_type' => $data['send_type'], - 'create_time' => time(), - ]; - //配送方式->快递配送 - if ($data['send_type'] == 1) { - $delivery_data['shipping_id'] = $data['shipping_id']; - $delivery_data['shipping_name'] = $shipping['name']; - $delivery_data['shipping_status'] = 1; - } - $delivery_id = Db::name('delivery')->insertGetId($delivery_data); + for ($i = 0; $i < $count; $i++) { + $shipping = Db::name('express')->where('id', $data['shipping_id'][$i])->find(); - - //更新订单下商品的发货状态 - $order->update_time = time(); - $order->shipping_time = time(); - $order->shipping_status = 1; - $order->order_status = Order::STATUS_WAIT_RECEIVE; - $order->delivery_id = $delivery_id; - $order->save(); - - //订单日志 - OrderLogLogic::record( - OrderLogEnum::TYPE_SHOP, - OrderLogEnum::SHOP_DELIVERY_ORDER, - $order_id, - $admin_id, - OrderLogEnum::SHOP_DELIVERY_ORDER - ); - - //通知用户发货 - if (!empty($order['mobile'])) { - event('Notice', [ - 'scene' => NoticeEnum::ORDER_DELIVERY_NOTICE, + $delivery_data = [ + 'order_id' => $order_id, + 'order_sn' => $order['order_sn'], + 'order_goods_id' => $order_goods[$i]['id'], + 'user_id' => $order['user_id'], + 'admin_id' => $admin_id, + 'consignee' => $order['consignee'], 'mobile' => $order['mobile'], - 'params' => [ - 'order_id' => $order['id'], - 'user_id' => $order['user_id'], - 'shipping_name' => $delivery_data['shipping_name'] ?? '无需快递', - 'invoice_no' => $data['invoice_no'] ?? '', - ] - ]); + 'province' => $order['province'], + 'city' => $order['city'], + 'district' => $order['district'], + 'address' => $order['address'], + 'invoice_no' => $data['invoice_no'][$i], + 'send_type' => $data['send_type'][$i], + 'create_time' => time(), + ]; + + //配送方式->快递配送 + if ($data['send_type'][$i] == 1) { + $delivery_data['shipping_id'] = $data['shipping_id'][$i]; + $delivery_data['shipping_name'] = $shipping['name']; + $delivery_data['shipping_status'] = 1; + } + + $delivery_id = Db::name('delivery')->insertGetId($delivery_data); + + $order->update_time = time(); + $order->shipping_time = time(); + $order->shipping_status = 1; + $order->order_status = Order::STATUS_WAIT_RECEIVE; + $order->delivery_id = $delivery_id; + $order->save(); + + //订单日志 + OrderLogLogic::record( + OrderLogEnum::TYPE_SHOP, + OrderLogEnum::SHOP_DELIVERY_ORDER, + $order_id, + $admin_id, + OrderLogEnum::SHOP_DELIVERY_ORDER + ); + + //通知用户发货 + if ($data['invoice_no'][$i] && !empty($order['mobile'])) { + event('Notice', [ + 'scene' => NoticeEnum::ORDER_DELIVERY_NOTICE, + 'mobile' => $order['mobile'], + 'params' => [ + 'user_id' => $order['user_id'], + 'nickname' => $order['consignee'], + 'order_sn' => $data['invoice_no'] ?? '', + ] + ]); + } } } + /** + * @notes 发货操作 + * @param $data + * @param $admin_id + * @return bool + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @throws \think\exception\DbException + * @author suny + * @date 2021/7/14 10:24 上午 + */ +// 原本的快递发货 +// public static function deliveryHandle($data, $admin_id) +// { +// $order_id = $data['order_id']; +// $order = Order::where(['del' => 0, 'id' => $order_id])->find(); +// +// if ($order['shipping_status'] == 1) { +// return true; +// } +// +// $shipping = Db::name('express')->where('id', $data['shipping_id'])->find(); +// +// //添加发货单 +// $delivery_data = [ +// 'order_id' => $order_id, +// 'order_sn' => $order['order_sn'], +// 'user_id' => $order['user_id'], +// 'admin_id' => $admin_id, +// 'consignee' => $order['consignee'], +// 'mobile' => $order['mobile'], +// 'province' => $order['province'], +// 'city' => $order['city'], +// 'district' => $order['district'], +// 'address' => $order['address'], +// 'invoice_no' => $data['invoice_no'], +// 'send_type' => $data['send_type'], +// 'create_time' => time(), +// ]; +// //配送方式->快递配送 +// if ($data['send_type'] == 1) { +// $delivery_data['shipping_id'] = $data['shipping_id']; +// $delivery_data['shipping_name'] = $shipping['name']; +// $delivery_data['shipping_status'] = 1; +// } +// $delivery_id = Db::name('delivery')->insertGetId($delivery_data); +// +// +// //更新订单下商品的发货状态 +// $order->update_time = time(); +// $order->shipping_time = time(); +// $order->shipping_status = 1; +// $order->order_status = Order::STATUS_WAIT_RECEIVE; +// $order->delivery_id = $delivery_id; +// $order->save(); +// +// //订单日志 +// OrderLogLogic::record( +// OrderLogEnum::TYPE_SHOP, +// OrderLogEnum::SHOP_DELIVERY_ORDER, +// $order_id, +// $admin_id, +// OrderLogEnum::SHOP_DELIVERY_ORDER +// ); +// +// //通知用户发货 +// if (!empty($order['mobile'])) { +// event('Notice', [ +// 'scene' => NoticeEnum::ORDER_DELIVERY_NOTICE, +// 'mobile' => $order['mobile'], +// 'params' => [ +// 'order_id' => $order['id'], +// 'user_id' => $order['user_id'], +// 'shipping_name' => $delivery_data['shipping_name'] ?? '无需快递', +// 'invoice_no' => $data['invoice_no'] ?? '', +// ] +// ]); +// } +// } + /** * @notes 判断是否可以发货 * @param $post @@ -1100,4 +1184,89 @@ class OrderLogic extends Logic return Order::where('id', $params['id'])->update(['allow_after_sale' => $type, 'update_time' => time()]); } + + // 查看对应单号的物流 + public static function seeExpress($id) + { + $express_data = array(); + + $delivery = Delivery::find($id); + if (!$delivery['invoice_no']) { + $traces['list'] = ['物流单号为空']; + return $traces; + } + + $express = ConfigServer::get('express', 'way'); + $key = ConfigServer::get($express, 'appkey'); + $app = ConfigServer::get($express, 'appsecret'); + if (empty($express) || empty($app) || empty($key)) { + $traces['list'] = ['暂无物流信息']; + return $traces; + } + + $result = Kd100Logic::expressDetail($id); + + // 如果当前时间大于了api接口限制的时间,则调用api接口 + if (!isset($result) || (time() > $result['sel_time'])) { + //快递配置设置为快递鸟时 + if ($express === 'kdniao') { + $expressage = (new Kdniao($app, $key, true)); + $shipping_field = 'codebird'; + } else { + $expressage = (new Kd100($app, $key, true)); + $shipping_field = 'code100'; + } + + //快递编码 + $shipping_code = Db::name('express') + ->where(['id' => $delivery['shipping_id']]) + ->value($shipping_field); + + //获取物流轨迹 + if ($shipping_code === 'SF' && $express === 'kdniao') { + $expressage->logistics($shipping_code, $delivery['invoice_no'], substr($delivery['mobile'],-4)); + }else { + $phone = ''; + if ($shipping_code === 'shunfeng') { + $phone = $delivery['mobile']; + } + $expressage->logistics($shipping_code, $delivery['invoice_no'], $phone); + } + + $traces = $expressage->logisticsFormat(); + $state = 0; + if (!$traces) { + $traces[] = [$expressage->getError()]; + } else { + $data = $expressage->logisticsFullInfo(); + $data['delivery_id'] = $id; + $data['order_id'] = $delivery['order_id']; + Kd100Logic::saveExpress($data); + $state = $data['state']; + + foreach ($traces as &$item) { + $item = array_values(array_unique($item)); + } + } + + $express_data['create_time'] = $delivery['create_time']; + $express_data['invoice_no'] = $delivery['invoice_no']; + $express_data['shipping_name'] = $delivery['shipping_name']; + $express_data['state'] = $state; + $express_data['state_text'] = Kd100Logic::$EXPRESS_STATE[$state]; + $express_data['list'] = $traces; + } else { + $express_data['create_time'] = $delivery['create_time']; + $express_data['invoice_no'] = $delivery['invoice_no']; + $express_data['shipping_name'] = $delivery['shipping_name']; + $express_data['state'] = $result['state']; + $express_data['state_text'] = Kd100Logic::$EXPRESS_STATE[$result['state']]; + $express_data['list'] = json_decode($result['data'], true); + foreach ($express_data['list'] as &$item) { + $item = array_values(array_unique($item)); + } + } + + return $express_data; + } } \ No newline at end of file diff --git a/app/shop/view/order/order/delivery.html b/app/shop/view/order/order/delivery.html index 1d1aebf7..8a5e65e2 100755 --- a/app/shop/view/order/order/delivery.html +++ b/app/shop/view/order/order/delivery.html @@ -31,9 +31,9 @@ -
+
-
+
收货信息 @@ -57,116 +57,164 @@
- - - - - - - - - - - - - - - - - {foreach $detail.order_goods as $k => $goods} - - + {/neq} + + {/foreach} + +
商品信息价格(元)数量小计(元)
-
-
- +
+ + + + + + + + + {neq name="$detail.delivery_type" value="1"} + + {/neq} + + + + + + + + {neq name="$detail.delivery_type" value="1"} + + {/neq} + + + + {foreach $detail.order_goods as $k => $goods} + + + + + + {neq name="$detail.delivery_type" value="1"} + - - - - - {/foreach} - -
商品信息价格(元)数量小计(元)物流
+
+
+ +
+
+

{$goods.goods_name}

+
+

{$goods.spec_value}

+
-
-

{$goods.goods_name}

-
-

{$goods.spec_value}

+
¥{$goods.goods_price}{$goods.goods_num}¥{$goods.total_pay_price} +
+ +
+ +
- -
¥{$goods.goods_price}{$goods.goods_num}¥{$goods.total_pay_price}
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+
+
+
+ + +
+
+
{eq name="$detail.delivery_type" value="1"} - -
- -
-
- 商品发货 -
-
+ +
+ +
+
+ 商品发货 +
+
-
- -
- -
-
- -
-
- - -
+
+ +
+
+ +
+
+ + +
+
+
{else/} - -
- -
-
- 快递配送 -
-
+ + + + + + + + -
- -
- - -
-
+ + + + + + + -
- -
- -
-
+ + + + + + + + + + -
- -
- -
-
+ + + + + + -
-
- - -
-
-
+ + + + + + + {/eq} - - -
@@ -175,7 +223,7 @@ //注意:选项卡 依赖 element 模块,否则无法进行功能性操作 layui.config({ - version:"{$front_version}", + version: "{$front_version}", base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径 }).extend({ index: 'lib/index' //主入口模块 @@ -187,9 +235,18 @@ //主图放大 $(document).on('click', '.image-show', function () { var src = $(this).attr('src'); - like.showImg(src,600); + like.showImg(src, 600); }); + form.on('select(send_type[])', function (data) { + if (data.value == 2) { + data.othis.parent().parent().next()[0].style.display = 'none' + data.othis.parent().parent().next().next()[0].style.display = 'none' + } else { + data.othis.parent().parent().next()[0].style.display = 'block' + data.othis.parent().parent().next().next()[0].style.display = 'flex' + } + }) form.on('radio(express)', function (data) { var checked = data.value; @@ -201,7 +258,7 @@ }); $('.back').click(function () { - var index=parent.layer.getFrameIndex(window.name); //获取当前窗口的name + var index = parent.layer.getFrameIndex(window.name); //获取当前窗口的name parent.layer.close(index); parent.layui.table.reload('order-lists'); return true; @@ -247,7 +304,7 @@ offset: '15px' , icon: 1 , time: 1000 - },function () { + }, function () { var index = parent.layer.getFrameIndex(window.name); parent.location.reload(); parent.updateTabNumber(); diff --git a/app/shop/view/order/order/express.html b/app/shop/view/order/order/express.html index caea08b9..29df7818 100755 --- a/app/shop/view/order/order/express.html +++ b/app/shop/view/order/order/express.html @@ -6,6 +6,12 @@ justify-content: left; } + .flex { + display: flex; + align-items: center; + justify-content: space-between; + } + .width-160 { width: 200px; } @@ -35,43 +41,12 @@
-
-
- 快递信息 -
-
- - - {empty name="$detail.shipping"} -
- -
暂无物流信息
-
- {else/} -
- -
{$detail.shipping.create_time_text | default= "未知"}
- {if condition = "$detail.shipping.send_type eq 1"} - -
{$detail.shipping.shipping_name | default="未知"}
- -
{$detail.shipping.invoice_no | default= "未知"}
- -
{$detail.shipping.traces.state_text | default= "未知"}
- {else/} - -
无需快递
- {/if} -
- {/empty} -
商品信息
-
@@ -79,6 +54,7 @@ + @@ -86,6 +62,7 @@ + @@ -106,46 +83,26 @@ + {/foreach}
价格(元) 数量 小计(元)物流
¥{$goods.goods_price} {$goods.goods_num} {$goods.total_pay_price} + {if condition="isset($detail.express_info[$k])"} +
+
+
发货时间:{$detail.express_info[$k]['create_time']}
+
快递方式:{$detail.express_info[$k]['shipping_name']}
+
快递单号:{$detail.express_info[$k]['invoice_no']}
+
+
+ +
+
+ {/if} +
-
-
- 物流轨迹 -
-
- - -
- - - - - - - - - - - {foreach $detail.shipping.traces.list as $k => $item} - - {if is_array($item)} - {foreach $item as $k1 => $value} - - {/foreach} - {else /} - - {/if} - - {/foreach} - -
轨迹
{$value}{$item}
-
- -
@@ -180,5 +137,15 @@ parent.layui.table.reload('order-lists'); return true; }); + + $(document).on('click', '.see-express', function () { + var id = $(this).data('id'); + layer.open({ + type: 2 + ,title: '选择商品' + ,content: '{:url("order.Order/seeExpress")}?id=' + id + ,area: ['90%', '90%'] + }) + }); }); \ No newline at end of file diff --git a/app/shop/view/order/order/see_express.html b/app/shop/view/order/order/see_express.html new file mode 100755 index 00000000..656a1f91 --- /dev/null +++ b/app/shop/view/order/order/see_express.html @@ -0,0 +1,132 @@ +{layout name="layout2" /} + +
+ +
+ +
+
+ 物流轨迹 +
+
+ +
{$express.create_time | default= "未知"}
+ +
{$express.shipping_name | default= "未知"}
+ +
{$express.invoice_no | default= "未知"}
+ +
{$express.state_text | default= "未知"}
+
+
+ +
+ + + + + + + + + + + {foreach $express.list as $k => $item} + + {if is_array($item)} + {foreach $item as $k1 => $value} + + {/foreach} + {else /} + + {/if} + + {/foreach} + +
轨迹
{$value}{$item}
+
+
+
+ + + \ No newline at end of file