修改
This commit is contained in:
parent
0df7c7feb4
commit
b2808b4223
@ -64,7 +64,6 @@
|
||||
},
|
||||
onLoad(options) {
|
||||
this.baseurl = baseurl
|
||||
console.log(options)
|
||||
this.list = JSON.parse(options.list)
|
||||
var ordertimes = this.list.trainingOrderTime.replaceAll(/\-/gi, "/")
|
||||
var time = new Date(this.list.trainingOrderTime).getTime() / 1000 + (60 * 60 * 2)
|
||||
@ -79,65 +78,48 @@
|
||||
//购买
|
||||
tobuy() {
|
||||
var that = this
|
||||
var obj = {
|
||||
"trainingItemId": undefined,
|
||||
"nurseStationId": undefined,
|
||||
"nurseStationPersonId": undefined,
|
||||
"trainingOrderAmount": undefined,
|
||||
"nursePersonName": undefined,
|
||||
}
|
||||
obj.trainingItemId = this.list.trainingItemId
|
||||
obj.nurseStationId = uni.getStorageSync('nurseStationId');
|
||||
obj.nurseStationPersonId = uni.getStorageSync('nursePersonId');
|
||||
obj.nursePersonName = uni.getStorageSync('nursePersonName');
|
||||
obj.trainingOrderAmount = this.list.trainingItemPrice
|
||||
trainingItemOrder(obj).then(res => {
|
||||
if (res.code == 200) {
|
||||
if (res.data.trainingOrderAmount > 0) {
|
||||
let objs = {
|
||||
"openid": uni.getStorageSync('openid'),
|
||||
"nurseStationPersonId": res.data.nurseStationPersonId,
|
||||
"orderNo": res.data.trainingOrderNo,
|
||||
"payType": "WECHAT_PAY",
|
||||
"orderChannel": "WECHAT_APPLET",
|
||||
"buySource": "TRAINING",
|
||||
"paymentPrice": res.data.trainingOrderAmount,
|
||||
}
|
||||
appletTrainingOrderPay(objs).then(response => {
|
||||
if (response.code == 200) {
|
||||
uni.requestPayment({
|
||||
timeStamp: response.data.timeStamp,
|
||||
nonceStr: response.data.nonceStr,
|
||||
package: response.data.prepayId,
|
||||
signType: response.data.signType,
|
||||
paySign: response.data.paySign,
|
||||
success: function(res) {
|
||||
that.$refs.uToast.show({
|
||||
title: '支付成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
that.$refs.uToast.show({
|
||||
title: '取消支付',
|
||||
type: 'error',
|
||||
duration: 1500,
|
||||
})
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$refs.uToast.show({
|
||||
title: response.msg,
|
||||
if (this.list.trainingItemPrice > 0) {
|
||||
let objs = {
|
||||
"openid": uni.getStorageSync('openid'),
|
||||
"nurseStationPersonId": this.list.nurseStationPersonId,
|
||||
"orderNo": this.list.trainingOrderNo,
|
||||
"payType": "WECHAT_PAY",
|
||||
"orderChannel": "WECHAT_APPLET",
|
||||
"buySource": "TRAINING",
|
||||
"paymentPrice": this.list.trainingItemPrice,
|
||||
}
|
||||
appletTrainingOrderPay(objs).then(response => {
|
||||
if (response.code == 200) {
|
||||
uni.requestPayment({
|
||||
timeStamp: response.data.timeStamp,
|
||||
nonceStr: response.data.nonceStr,
|
||||
package: response.data.prepayId,
|
||||
signType: response.data.signType,
|
||||
paySign: response.data.paySign,
|
||||
success: function(res) {
|
||||
that.$refs.uToast.show({
|
||||
title: '支付成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
that.$refs.uToast.show({
|
||||
title: '取消支付',
|
||||
type: 'error',
|
||||
duration: 2000
|
||||
duration: 1500,
|
||||
})
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$refs.uToast.show({
|
||||
title: response.msg,
|
||||
type: 'error',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user