This commit is contained in:
gongfuxiang 2019-01-08 02:07:14 +08:00
parent e2ec6c869a
commit 05b837a05c
2 changed files with 8 additions and 7 deletions

View File

@ -214,10 +214,10 @@ class WeixinMini
{
$result = empty($GLOBALS['HTTP_RAW_POST_DATA']) ? $this->XmlToArray(file_get_contents('php://input')) : $this->XmlToArray($GLOBALS['HTTP_RAW_POST_DATA']);
//file_put_contents(ROOT.'gggggg.txt', json_encode($result));
if(isset($result['sign']) && $result['sign'] == $this->GetSign($result))
if(isset($result['result_code']) && $result['result_code'] == 'SUCCESS' && $result['sign'] == $this->GetSign($result))
{
file_put_contents(ROOT.'gggggg.txt', json_encode($result));
return DataReturn('支付成功', 0, $this->ReturnData($data));
}
return DataReturn('处理异常错误', -100);
@ -241,7 +241,7 @@ class WeixinMini
$data['buyer_user'] = $data['openid']; // 支付平台 - 用户
$data['out_trade_no'] = $out_trade_no; // 本系统发起支付的 - 订单号
$data['subject'] = $data['attach']; // 本系统发起支付的 - 商品名称
$data['pay_price'] = $data['cash_fee']/100; // 本系统发起支付的 - 总价
$data['pay_price'] = $data['total_fee']/100; // 本系统发起支付的 - 总价
return $data;
}

View File

@ -210,6 +210,7 @@ Page({
// 支付方法
pay_handle(order_id, index) {
var $this = this;
// 加载loding
wx.showLoading({title: "请求中..." });
@ -242,15 +243,15 @@ Page({
paySign: res.data.data.data.paySign,
success: function(res) {
// 数据设置
var temp_data_list = this.data.data_list;
var temp_data_list = $this.data.data_list;
temp_data_list[index]['status'] = 2;
temp_data_list[index]['status_name'] = '待发货';
this.setData({ data_list: temp_data_list });
$this.setData({ data_list: temp_data_list });
// 跳转支付页面
wx.navigateTo({
url: "/pages/paytips/paytips?code=9000&total_price=" +
this.data.data_list[index]['total_price']
$this.data.data_list[index]['total_price']
});
},
fail: function (res) {