解决手机端地址为空,微信H5支付返回地址优化

This commit is contained in:
devil_gong 2019-04-08 14:57:12 +08:00
parent a5f8515a9e
commit 1e4e7cd60f
4 changed files with 8 additions and 2 deletions

View File

@ -63,7 +63,8 @@ class Buy extends Common
if(isset($ret['code']) && $ret['code'] == 0)
{
// 用户地址
$this->assign('user_address_list', UserService::UserAddressList(['user'=>$this->user])['data']);
$address = UserService::UserAddressList(['user'=>$this->user]);
$this->assign('user_address_list', $address['data']);
// 支付方式
$this->assign('payment_list', PaymentService::BuyPaymentList(['is_enable'=>1, 'is_open_user'=>1]));

View File

@ -26,7 +26,7 @@
{{if !empty($user_address_list)}}
<ul class="address-list">
{{foreach $user_address_list as $address}}
<li class="{{if (isset($params['address_id']) and $params['address_id'] eq $address['id']) or (!isset($params['address_id']) and isset($address['is_default']) and $address['is_default'] eq 1)}}address-default{{/if}}" id="data-list-{{$address.id}}" data-value="{{$address.id}}">
<li class="{{if (isset($params['address_id']) and $params['address_id'] eq $address['id']) or (!isset($params['address_id']) and isset($address['is_default']) and $address['is_default'] eq 1) or (count($user_address_list) eq 1)}}address-default{{/if}}" id="data-list-{{$address.id}}" data-value="{{$address.id}}">
<div class="address-left">
<div class="user-base">
{{if !empty($address.alias)}}

View File

@ -109,6 +109,7 @@ class OrderService
$pay_data = array(
'user' => $params['user'],
'out_user' => md5($params['user']['id']),
'order_id' => $order['id'],
'order_no' => $order['order_no'],
'name' => '订单支付',
'total_price' => $order['total_price'],

View File

@ -183,6 +183,10 @@ class Weixin
// h5支付
case 'MWEB' :
if(!empty($params['order_id']))
{
$data['mweb_url'] .= '&redirect_url='.urlencode(MyUrl('index/order/detail', ['id'=>$params['order_id']]));
}
$result = DataReturn('success', 0, $data['mweb_url']);
break;