idea
This commit is contained in:
parent
d60c3c9b70
commit
5a2e35198b
@ -189,6 +189,35 @@ export default {
|
||||
console.log(res);
|
||||
//拿到开卡有礼订单 TODO 对接支付
|
||||
this.orderInfo = res.data
|
||||
this.goPay(this.orderInfo)
|
||||
|
||||
})
|
||||
},
|
||||
async goPay(data) {
|
||||
let that = this
|
||||
await request({
|
||||
url: '/userClient/pay/toPay',
|
||||
method: 'get',
|
||||
params: {orderId: data.id}
|
||||
}).then((ress) => {
|
||||
wx.requestPayment({
|
||||
timeStamp: ress.data.timeStamp, // 时间戳,从1970年1月1日00:00:00至今的秒数,即当前的时间
|
||||
nonceStr: ress.data.nonceStr, // 随机字符串,长度为32个字符以下。
|
||||
package: ress.data.package, // 统一下单接口返回的 prepay_id 参数值,格式如“prepay_id=*”
|
||||
signType: ress.data.signType, // 签名算法类型,默认为 MD5,支持RSA等其他加密算法
|
||||
paySign: ress.data.paySign, // 签名,详见签名生成算法
|
||||
success: function (res) {
|
||||
console.log('成功',res);
|
||||
if( res.errMsg = 'requestPayment:ok'){
|
||||
uni.showToast({
|
||||
title:'支付成功'
|
||||
})
|
||||
this.getUserInfos()
|
||||
}
|
||||
// 支付成功后的回调函数, res.errMsg = 'requestPayment:ok'
|
||||
},
|
||||
|
||||
})
|
||||
})
|
||||
},
|
||||
/**
|
||||
|
@ -37,7 +37,7 @@
|
||||
<text>{{ formatTimestamp(item.createTime) }}</text>
|
||||
</view>
|
||||
<view class="line3">
|
||||
<!-- <view v-if="item.orderStatus == '0'" @click="goPay(item)" class="showOrder">支付</view> -->
|
||||
<view v-if="item.orderStatus == '0'" @click="goPay(item)" class="showOrder">支付</view>
|
||||
<view v-if="item.goodsType == '2'" @click="gotoDetail(item)" class="showOrder">查看订单</view>
|
||||
<view @click="gotoEvaluate(item)" class="evaluate" v-if="item.goodsType == '2' && item.orderStatus === '1' && !item.commentDesc">评价订单</view>
|
||||
</view>
|
||||
@ -179,19 +179,26 @@ export default {
|
||||
url: '/userClient/pay/toPay',
|
||||
method: 'get',
|
||||
params: {orderId: data.id}
|
||||
}).then((res) => {
|
||||
}).then((ress) => {
|
||||
|
||||
wx.requestPayment({
|
||||
timeStamp: ress.data.timeStamp, // 时间戳,从1970年1月1日00:00:00至今的秒数,即当前的时间
|
||||
nonceStr: ress.data.nonceStr, // 随机字符串,长度为32个字符以下。
|
||||
package: ress.data.package, // 统一下单接口返回的 prepay_id 参数值,格式如“prepay_id=*”
|
||||
signType: ress.data.signType, // 签名算法类型,默认为 MD5,支持RSA等其他加密算法
|
||||
paySign: ress.data.paySign, // 签名,详见签名生成算法
|
||||
success: function (res) {
|
||||
console.log('成功',res);
|
||||
if( res.errMsg = 'requestPayment:ok'){
|
||||
uni.showToast({
|
||||
title:'支付成功'
|
||||
})
|
||||
this.getList()
|
||||
}
|
||||
// 支付成功后的回调函数, res.errMsg = 'requestPayment:ok'
|
||||
},
|
||||
|
||||
this.$refs.popup.open()
|
||||
setTimeout(() => {
|
||||
|
||||
drawQrcode({
|
||||
width: 200,
|
||||
height: 200,
|
||||
canvasId: 'myQrcode',
|
||||
text: res.data.code_url
|
||||
})
|
||||
that.convertToImage()
|
||||
}, 60)
|
||||
})
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user