From ea7911bd7781b752694446fe853d1cfabca50021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E8=BE=89?= <814457906@qq.com> Date: Thu, 4 May 2023 14:02:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/Orderdetails/Orderdetails.vue | 100 +++++++----- .../Ordervideolearning/Ordervideolearning.vue | 153 ++++++++++++----- pages/Videolearning/Videolearning.vue | 154 +++++++++++++----- pages/learning/learning.vue | 146 +++++++++-------- 4 files changed, 352 insertions(+), 201 deletions(-) diff --git a/pages/Orderdetails/Orderdetails.vue b/pages/Orderdetails/Orderdetails.vue index 971ef61..8dccec2 100644 --- a/pages/Orderdetails/Orderdetails.vue +++ b/pages/Orderdetails/Orderdetails.vue @@ -95,52 +95,62 @@ //购买 tobuy() { var that = this - if (this.list.trainingOrderAmount > 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.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) { - uni.setStorageSync("Refresh", '1') - that.$refs.uToast.show({ - title: '支付成功', - type: 'success', - duration: 1500, - }) - setTimeout(e => { - uni.navigateBack({ - delta: 1 - }) - }, 1500) - }, - fail: function(err) { - that.$refs.uToast.show({ - title: '取消支付', - type: 'error', - duration: 1500, - }) - } - }); - } else { - this.$refs.uToast.show({ - title: response.msg, - type: 'error', - duration: 2000 - }) + const nurseStationId = uni.getStorageSync('nurseStationId'); + if (nurseStationId) { + if (this.list.trainingOrderAmount > 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.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) { + uni.setStorageSync("Refresh", '1') + that.$refs.uToast.show({ + title: '支付成功', + type: 'success', + duration: 1500, + }) + setTimeout(e => { + uni.navigateBack({ + delta: 1 + }) + }, 1500) + }, + fail: function(err) { + that.$refs.uToast.show({ + title: '取消支付', + type: 'error', + duration: 1500, + }) + } + }); + } else { + this.$refs.uToast.show({ + title: response.msg, + type: 'error', + duration: 2000 + }) + } + }) + } + } else { + that.$refs.uToast.show({ + title: '请您重新登录', + type: 'error', + duration: 1500, + url: "/pages/login/login" }) } }, diff --git a/pages/Ordervideolearning/Ordervideolearning.vue b/pages/Ordervideolearning/Ordervideolearning.vue index 516736f..04c4c36 100644 --- a/pages/Ordervideolearning/Ordervideolearning.vue +++ b/pages/Ordervideolearning/Ordervideolearning.vue @@ -1,6 +1,9 @@