细节优化

feat/task1-c-wallet
devil_gong 2019-12-03 17:16:25 +08:00
parent 9c928176d5
commit f63e13896d
6 changed files with 71 additions and 21 deletions

View File

@ -461,7 +461,7 @@
{{/if}} {{/if}}
{{if $v['status'] eq 2}} {{if $v['status'] eq 2}}
{{if $v['order_model'] eq 2}} {{if $v['order_model'] eq 2}}
<button class="am-btn am-btn-secondary am-btn-xs am-radius am-icon-check am-btn-block submit-take" data-url="{{:MyUrl('admin/order/delivery')}}" data-id="{{$v.id}}" data-user-id="{{$v.user_id}}" data-extraction-code="" data-am-modal="{target: '#order-take-modal', closeViaDimmer: 0, width: 200, height: 160}"> 取货</button> <button class="am-btn am-btn-secondary am-btn-xs am-radius am-icon-check am-btn-block submit-take" data-id="{{$v.id}}" data-user-id="{{$v.user_id}}" data-am-modal="{target: '#order-take-modal', closeViaDimmer: 0, width: 200, height: 160}"> 取货</button>
{{else /}} {{else /}}
<button class="am-btn am-btn-secondary am-btn-xs am-radius am-icon-send-o am-btn-block submit-delivery" data-url="{{:MyUrl('admin/order/delivery')}}" data-id="{{$v.id}}" data-user-id="{{$v.user_id}}" data-express-id="{{$v.express_id}}" data-am-modal="{target: '#order-delivery-popup'}"> 发货</button> <button class="am-btn am-btn-secondary am-btn-xs am-radius am-icon-send-o am-btn-block submit-delivery" data-url="{{:MyUrl('admin/order/delivery')}}" data-id="{{$v.id}}" data-user-id="{{$v.user_id}}" data-express-id="{{$v.express_id}}" data-am-modal="{target: '#order-delivery-popup'}"> 发货</button>
{{/if}} {{/if}}

View File

@ -871,6 +871,7 @@ class BuyService
} }
// 销售型,自提点 地址处理 // 销售型,自提点 地址处理
$address = [];
if(in_array($common_site_type, [0, 2])) if(in_array($common_site_type, [0, 2]))
{ {
if(empty($buy['data']['base']['address'])) if(empty($buy['data']['base']['address']))
@ -909,6 +910,7 @@ class BuyService
'hook_name' => $hook_name, 'hook_name' => $hook_name,
'is_backend' => true, 'is_backend' => true,
'order' => &$order, 'order' => &$order,
'goods' => &$buy['data']['goods'],
'params' => $params, 'params' => $params,
])); ]));
@ -934,7 +936,7 @@ class BuyService
return $ret; return $ret;
} }
// 自提模式 - 虚拟信息添加 // 订单模式 - 虚拟信息添加
if($common_site_type == 3) if($common_site_type == 3)
{ {
$ret = self::OrderFictitiousValueInsert($order_id, $detail_ret['data'], $params['user']['id'], $v['goods_id']); $ret = self::OrderFictitiousValueInsert($order_id, $detail_ret['data'], $params['user']['id'], $v['goods_id']);
@ -989,15 +991,30 @@ class BuyService
} }
} }
// 订单添加成功钩子
$hook_name = 'plugins_service_buy_order_insert_end';
$ret = HookReturnHandle(Hook::listen($hook_name, [
'hook_name' => $hook_name,
'is_backend' => true,
'order_id' => $order_id,
'order' => $order,
'goods' => $buy['data']['goods'],
'address' => $address,
'params' => $params,
]));
if(isset($ret['code']) && $ret['code'] != 0)
{
// 事务回滚
Db::rollback();
return $ret;
}
// 订单提交成功 // 订单提交成功
Db::commit(); Db::commit();
// 删除购物车 // 删除购物车
self::BuyCartDelete($params); self::BuyCartDelete($params);
// 获取数据库订单信息
$order = Db::name('Order')->find($order_id);
// 订单添加成功钩子, 不校验返回值 // 订单添加成功钩子, 不校验返回值
$hook_name = 'plugins_service_buy_order_insert_success'; $hook_name = 'plugins_service_buy_order_insert_success';
Hook::listen($hook_name, [ Hook::listen($hook_name, [
@ -1005,9 +1022,14 @@ class BuyService
'is_backend' => true, 'is_backend' => true,
'order_id' => $order_id, 'order_id' => $order_id,
'order' => $order, 'order' => $order,
'goods' => $buy['data']['goods'],
'address' => $address,
'params' => $params, 'params' => $params,
]); ]);
// 获取数据库订单信息
$order = Db::name('Order')->find($order_id);
// 返回信息 // 返回信息
$result = [ $result = [
'order' => $order, 'order' => $order,
@ -1070,7 +1092,7 @@ class BuyService
// 订单详情添加前钩子 // 订单详情添加前钩子
$hook_name = 'plugins_service_buy_order_detail_insert_begin'; $hook_name = 'plugins_service_buy_order_detail_insert_begin';
$ret = HHookReturnHandle(ook::listen($hook_name, [ $ret = HookReturnHandle(Hook::listen($hook_name, [
'hook_name' => $hook_name, 'hook_name' => $hook_name,
'is_backend' => true, 'is_backend' => true,
'user_id' => $user_id, 'user_id' => $user_id,
@ -1212,7 +1234,7 @@ class BuyService
]; ];
// 订单地址添加前钩子 // 订单地址添加前钩子
$hook_name = 'plugins_service_buy_order_receive_address_insert_begin'; $hook_name = 'plugins_service_buy_order_address_insert_begin';
$ret = HookReturnHandle(Hook::listen($hook_name, [ $ret = HookReturnHandle(Hook::listen($hook_name, [
'hook_name' => $hook_name, 'hook_name' => $hook_name,
'is_backend' => true, 'is_backend' => true,

View File

@ -530,7 +530,7 @@ class Weixin
// 请求接口处理 // 请求接口处理
$result = $this->XmlToArray($this->HttpRequest('https://api.mch.weixin.qq.com/secapi/pay/refund', $this->ArrayToXml($data), true)); $result = $this->XmlToArray($this->HttpRequest('https://api.mch.weixin.qq.com/secapi/pay/refund', $this->ArrayToXml($data), true));
if(!empty($result['return_code']) && $result['return_code'] == 'SUCCESS' && !empty($result['return_msg']) && $result['return_msg'] == 'OK') if(isset($result['result_code']) && $result['result_code'] == 'SUCCESS' && isset($result['return_code']) && $result['return_code'] == 'SUCCESS')
{ {
// 统一返回格式 // 统一返回格式
$data = [ $data = [
@ -542,10 +542,10 @@ class Weixin
]; ];
return DataReturn('退款成功', 0, $data); return DataReturn('退款成功', 0, $data);
} }
$msg = is_string($result) ? $result : (empty($result['return_msg']) ? '退款接口异常' : $result['return_msg']); $msg = is_string($result) ? $result : (empty($result['err_code_des']) ? '退款接口异常' : $result['err_code_des']);
if(!empty($result['err_code_des'])) if(!empty($result['return_msg']))
{ {
$msg .= '-'.$result['err_code_des']; $msg .= '-'.$result['return_msg'];
} }
return DataReturn($msg, -1); return DataReturn($msg, -1);
} }

View File

@ -14,11 +14,6 @@
.am-table .goods-item:not(:last-child), .am-table .order-no { border-bottom: 1px solid #eee; } .am-table .goods-item:not(:last-child), .am-table .order-no { border-bottom: 1px solid #eee; }
.am-table .order-no { font-weight: 700; color: #333;} .am-table .order-no { font-weight: 700; color: #333;}
/**
*
*/
form.am-form .am-form-group { padding-right: 5px; }
/** /**
* *

View File

@ -83,9 +83,6 @@ iframe { width: 100%; height: 100%; border: 0; }
border-bottom: 1px dashed #ccc; border-bottom: 1px dashed #ccc;
padding: 10px 20% 10px 5px; padding: 10px 20% 10px 5px;
} }
.am-popup .am-form-group, .business-form-block {
padding: 10px 5px !important;
}
form.am-form .am-form-group-refreshing, .plug-file-upload-view, .content-app-items { form.am-form .am-form-group-refreshing, .plug-file-upload-view, .content-app-items {
border-bottom: 0px; border-bottom: 0px;
} }
@ -93,6 +90,11 @@ iframe { width: 100%; height: 100%; border: 0; }
background: none; background: none;
} }
/* 弹窗 */
.am-popup .am-form-group, .am-modal form.am-form .am-form-group, .business-form-block {
padding: 10px 5px !important;
}
/* 地址联动 */ /* 地址联动 */
.region-linkage select { width: 33%; display: -webkit-inline-box; } .region-linkage select { width: 33%; display: -webkit-inline-box; }

View File

@ -610,9 +610,40 @@ ul.am-dropdown-content > .am-active > a:focus,
} }
.am-pagination > .am-active > a, .am-pagination > .am-active > a:hover { background-color: #d13b49; border-color: #d13b49; } .am-pagination > .am-active > a, .am-pagination > .am-active > a:hover { background-color: #d13b49; border-color: #d13b49; }
.am-popup-bd { padding: 5px; background: none; } .am-popup-bd {
padding: 5px;
background: none; }
.am-badge { padding: 0.25em 0.5em;} .am-badge {
padding: 0.25em 0.5em;
}
/**
* tabs
*/
.am-tabs-d2 {
margin: 0;
}
.am-tabs-d2 .am-tabs-nav a {
text-decoration: none;
}
.am-tabs-d2 .am-tabs-nav > .am-active {
border-bottom: 2px solid #ed5563;
background-color: #fff1f5;
}
.am-tabs-d2 .am-tabs-nav > .am-active a {
color: #d2364c;
}
.am-tabs-d2 .am-tabs-nav > .am-active:after {
border-bottom-color: #ed5563;
}
.am-tabs-d2 .am-tabs-bd {
border: none;
z-index: 0;
}
.am-tabs-d2 .am-tabs-bd .am-tab-panel {
padding: 0;
}
/** /**