From 05b837a05c3fb4fdfcd7f3fc4fba4e4ab2873ba1 Mon Sep 17 00:00:00 2001 From: gongfuxiang <2499232802@qq.com> Date: Tue, 8 Jan 2019 02:07:14 +0800 Subject: [PATCH] debug --- extend/payment/WeixinMini.php | 8 ++++---- public/appmini/old/wechat/pages/user-order/user-order.js | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/extend/payment/WeixinMini.php b/extend/payment/WeixinMini.php index 26d19f56c..56acabdec 100644 --- a/extend/payment/WeixinMini.php +++ b/extend/payment/WeixinMini.php @@ -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; } diff --git a/public/appmini/old/wechat/pages/user-order/user-order.js b/public/appmini/old/wechat/pages/user-order/user-order.js index 2bc6a9718..41162acb8 100755 --- a/public/appmini/old/wechat/pages/user-order/user-order.js +++ b/public/appmini/old/wechat/pages/user-order/user-order.js @@ -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) {