JS代码部分
zhifu(){ //支付方法 //微信支付 // #ifdef MP-WEIXIN uni.showLoading({title: '加载中',}) uni.request({ url: getApp().globalData.https + '/wap.php/Order/pay_course_order',//支付订单接口链接 data: { oid:data.oid,//订单ID }, method: 'POST', header: getApp().globalData.header, dataType: 'json', success: function (res) { var data = res.data;、 if(data.status == 1){、 uni.requestPayment({ provider: 'wxpay', orderInfo: { "appid": data.data.appid, "noncestr": data.data.noncestr, "package": "Sign=WXPay", "partnerid": data.data.partnerid, "prepayid": data.data.prepayid, "timestamp": data.data.timestamp, "sign": data.data.sign }, success: function (res) { setTimeout(function () {uni.hideLoading();}, 100); uni.showLoading({ title: '跳转中', }) setTimeout(() => { uni.redirectTo({ url: '/pages/user/order_list?order_type=' +order_type }); }, 1000); }, fail: function (err) { uni.redirectTo({ url: '/pages/user/order_list' }); }, }) } if(data.status == 0){ uni.showToast({ title: data.msg, icon: "none" }); return false; } } }) } // #endif八七站长 http://www.19870125.xyz/