|
@@ -107,12 +107,17 @@ const handleOk= async () =>{
|
|
|
let data = JSON.stringify(res.data)
|
|
|
console.log("res.data:"+JSON.stringify(res.data))
|
|
|
console.log("data.appId:"+data.appId)
|
|
|
- let appId = res.data.appId;
|
|
|
- let timeStamp = res.data.timeStamp;
|
|
|
- let nonceStr = res.data.nonceStr;
|
|
|
- let packageX = res.data.packageX;
|
|
|
- let signType = res.data.signType;
|
|
|
- let paySign = res.data.paySign;
|
|
|
+ pay(res.data)
|
|
|
+
|
|
|
+ })
|
|
|
+}
|
|
|
+const pay= (data) =>{
|
|
|
+ let appId = data.appId;
|
|
|
+ let timeStamp = data.timeStamp;
|
|
|
+ let nonceStr = data.nonceStr;
|
|
|
+ let packageX = data.packageX;
|
|
|
+ let signType = data.signType;
|
|
|
+ let paySign = data.paySign;
|
|
|
console.log(appId, "appId")
|
|
|
console.log(timeStamp, "timeStamp")
|
|
|
console.log(nonceStr, "nonceStr")
|
|
@@ -126,21 +131,23 @@ const handleOk= async () =>{
|
|
|
package: packageX, // 固定值
|
|
|
signType: signType,
|
|
|
paySign: paySign, // 签名,这里用的 MD5/RSA 签名
|
|
|
- success(res) {
|
|
|
+ success : function (res) {
|
|
|
console.log("success" + JSON.stringify(res))
|
|
|
- uni.reLaunch({
|
|
|
- url: 'pages/order/list'
|
|
|
- });
|
|
|
+ // uni.navigateTo({url: '/pages/order/detail'});
|
|
|
+ sheep.$router.go('/pages/order/detail', {
|
|
|
+ id:data.orderId,
|
|
|
+ });
|
|
|
sheep.$helper.toast('支付成功')
|
|
|
},
|
|
|
- fail(res) {
|
|
|
+ fail: function (res) {
|
|
|
console.log("fail" + JSON.stringify(res))
|
|
|
sheep.$helper.toast('支付失败')
|
|
|
- }
|
|
|
+ // pay(data)
|
|
|
+ },
|
|
|
+ complete: function (res){
|
|
|
+ console.log("调用完成")
|
|
|
+ }
|
|
|
});
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
const tabSelect= (e) =>{
|
|
|
console.log(e.currentTarget.dataset.id)
|