payDocker(id, phone) {
let that = this;
if (uni.getStorageSync('userinfo')) {
let payData = {
userId: uni.getStorageSync('userinfo').id,
doctorId: id,
payType: 1,
payEquipment: 'JSAPI'
};
console.log(payData)
uni.showModal({
title: '支付提示',
content: '确认支付吗?',
success: function(res) {
if (res.confirm) {
that.$LoadingMsg('正在支付')
that.$Request.post(that.$api.userDockerCreateOrder, payData).then(res => {
if (res.code == 200) {
uni.hideLoading()
uni.requestPayment({
timeStamp: res.data.timeStamp,
nonceStr: res.data.nonceStr,
package: res.data.package,
signType: 'MD5',
paySign: res.data.paySign,
success() {
uni.makePhoneCall({
phoneNumber: phone
});
},
fail(res) {
uni.showToast({
title: '取消支付',
icon: 'none'
})
}
})
} else if (res.code == 202) {
uni.showToast({
title: res.msg,
icon: 'none',
success() {
setTimeout(function() {
that.binding()
}, 2000)
}
})
}
if (res.code == 500) {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
})
} else if (res.cancel) {}
}
});
} else {
uni.showModal({
title: '提示',
content: '你还未登录,是否登录?',
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url: '/pages/login/login'
})
}
}
})
}
},**加粗样式**
uniapp 微信支付
最新推荐文章于 2024-08-24 14:14:30 发布