From 831b28b65e68b57a3d28713cc34f88cbd60a1f37 Mon Sep 17 00:00:00 2001 From: "Mr.jiang" <714156421@qq.com> Date: Tue, 16 Jul 2024 17:20:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- my/order/pay.vue | 1027 ++++++++++++++------------ my/order/payCLDetail.vue | 670 ++++++++++------- my/order/payJaZ.vue | 618 +++++++++------- my/order/payModifyTcMy.vue | 11 +- my/order/payModifyTcMyDaiB.vue | 350 +++++---- my/order/payShengji.vue | 661 +++++++++-------- my/order/payding.vue | 349 +++++---- my/order/paydingCi.vue | 327 ++++---- my/order/paydingDd.vue | 356 ++++----- my/order/paydingLiao.vue | 322 ++++---- my/order/paydingTCX.vue | 379 +++++----- my/order/paydingTc.vue | 320 ++++---- my/order/paydingXiuGai.vue | 215 +++++- pages/therapist/therapistDingdan.vue | 182 +---- 14 files changed, 3115 insertions(+), 2672 deletions(-) diff --git a/my/order/pay.vue b/my/order/pay.vue index 9c8b550..b18398e 100644 --- a/my/order/pay.vue +++ b/my/order/pay.vue @@ -840,15 +840,14 @@ payTc() { let that = this that.showpayL = false - - if (that.openWay == 1) { //零钱支付 - uni.showModal({ - title: '付款提示', - content: '确认支付' + that.order.taxiMoney + '元吗?', - success: function(re) { - if (re.confirm) { - that.$queue.showLoading('支付中...') - console.log('用户点击确定'); + uni.showModal({ + title: '付款提示', + content: '确认支付' + that.order.taxiMoney + '元吗?', + success: function(re) { + if (re.confirm) { + that.$queue.showLoading('支付中...') + console.log('用户点击确定'); + if (that.openWay == 1) { //零钱支付 that.$Request.post("/app/artificer/payOrders", { ordersId: that.order.ordersId, userPackageDetailId : that.order.userPackageDetailId @@ -867,168 +866,190 @@ }) } }); - } else if (re.cancel) { - uni.hideLoading(); - console.log('用户点击取消'); - } - } - - }) - } else if (that.openWay == 2) { //微信支付 - that.$queue.showLoading('支付中...') - // #ifdef MP-WEIXIN - let data = { - ordersId: that.order.ordersId, - type: 3, - userPackageDetailId : that.order.userPackageDetailId - } - that.$Request.post('/app/wxPay/payOrder', data).then(ret => { - console.log(ret) - if (ret.code == 0) { - uni.hideLoading(); - uni.requestPayment({ - provider: 'wxpay', - timeStamp: ret.data.timestamp, - nonceStr: ret.data.noncestr, - package: ret.data.package, - signType: ret.data.signType, - paySign: ret.data.sign, - success: function(ret) { - console.log(ret) - uni.showToast({ - title: '支付成功', - icon: 'none' - }) - that.getOrder() - // this.$queue.showToast('支付成功'); - - that.showpayL = false - }, - fail: function(err) { - uni.hideLoading(); - // this.$queue.showToast('支付失败'); - uni.showToast({ - title: '支付失败', - icon: 'nones' - }); - that.getOrder() + } else if (that.openWay == 2) { //微信支付 + that.$queue.showLoading('支付中...') + // #ifdef MP-WEIXIN + let data = { + ordersId: that.order.ordersId, + type: 3, + userPackageDetailId : that.order.userPackageDetailId } - }); - } - }); - // #endif - - // #ifdef H5 - let ua = navigator.userAgent.toLowerCase(); - if (ua.indexOf('micromessenger') != -1) { - let data = { - ordersId: that.order.ordersId, - type: 2, - userPackageDetailId : that.order.userPackageDetailId - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - - if (rea.code == 0) { - uni.hideLoading(); - that.callPay(rea.data); - that.getOrder() - that.showpayL = false - } else { - uni.hideLoading(); - uni.showToast({ - title: rea.msg, - icon: 'none' - }) + that.$Request.post('/app/wxPay/payOrder', data).then(ret => { + console.log(ret) + if (ret.code == 0) { + uni.hideLoading(); + uni.requestPayment({ + provider: 'wxpay', + timeStamp: ret.data.timestamp, + nonceStr: ret.data.noncestr, + package: ret.data.package, + signType: ret.data.signType, + paySign: ret.data.sign, + success: function(ret) { + console.log(ret) + uni.showToast({ + title: '支付成功', + icon: 'none' + }) + that.getOrder() + // this.$queue.showToast('支付成功'); + + that.showpayL = false + }, + fail: function(err) { + uni.hideLoading(); + // this.$queue.showToast('支付失败'); + uni.showToast({ + title: '支付失败', + icon: 'nones' + }); + that.getOrder() + } + }); + } + }); + // #endif + + // #ifdef H5 + let ua = navigator.userAgent.toLowerCase(); + if (ua.indexOf('micromessenger') != -1) { + let data = { + ordersId: that.order.ordersId, + type: 2, + userPackageDetailId : that.order.userPackageDetailId + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + + if (rea.code == 0) { + uni.hideLoading(); + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + that.showpayL = false + that.callPay(rea.data); + + } else { + uni.hideLoading(); + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } else { + let data = { + ordersId: that.order.ordersId, + type: 4, + userPackageDetailId : that.order.userPackageDetailId + } + // debugger; + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + // const urlArr = window.location.href; + // const hostUrl = urlArr.split("/"); + // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + // const url = '&redirect_url=' + callBack + 'my/order/pay'; + // window.location = rea.mweb_url + url + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + that.showpayL = false + uni.hideLoading(); + const urlArr = window.location.href; + const hostUrl = urlArr.split("/"); + const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + const url = '&redirect_url=' + callBack + 'my/order/pay'; + window.location = rea.data.mweb_url + url + + } else { + uni.hideLoading(); + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } + + // #endif + + // #ifdef APP + let data = { + ordersId: that.order.ordersId, + type: 1, + userPackageDetailId : that.order.userPackageDetailId + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + + if (rea.code == 0) { + uni.hideLoading(); + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + that.showpayL = false + that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); + + }else{ + uni.hideLoading(); + } + }); + // #endif + } else if (that.openWay == 3) { //支付宝支付 + that.$queue.showLoading('支付中...') + // #ifdef H5 + let data = { + ordersId: that.order.ordersId, + type: 2, + userPackageDetailId : that.order.userPackageDetailId + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.hideLoading(); + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + that.showpayL = false + const div = document.createElement('div') + div.innerHTML = rea.data //此处form就是后台返回接收到的数据 + document.body.appendChild(div) + document.forms[0].submit() + + }); + // #endif + + // #ifdef APP-PLUS + let data = { + ordersId: that.order.ordersId, + type: 1, + userPackageDetailId : that.order.userPackageDetailId + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.hideLoading(); + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + that.showpayL = false + that.setPayment('alipay', rea.data); + + }); + // #endif } - }); - } else { - let data = { - ordersId: that.order.ordersId, - type: 4, - userPackageDetailId : that.order.userPackageDetailId + + } else if (re.cancel) { + uni.hideLoading(); + console.log('用户点击取消'); } - // debugger; - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - // const urlArr = window.location.href; - // const hostUrl = urlArr.split("/"); - // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - // const url = '&redirect_url=' + callBack + 'my/order/pay'; - // window.location = rea.mweb_url + url - that.showpay = false - if (rea.code == 0) { - uni.hideLoading(); - const urlArr = window.location.href; - const hostUrl = urlArr.split("/"); - const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - const url = '&redirect_url=' + callBack + 'my/order/pay'; - window.location = rea.data.mweb_url + url - that.getOrder() - that.showpayL = false - } else { - uni.hideLoading(); - uni.showToast({ - title: rea.msg, - icon: 'none' - }) - } - }); } - - // #endif - - // #ifdef APP - let data = { - ordersId: that.order.ordersId, - type: 1, - userPackageDetailId : that.order.userPackageDetailId - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - - if (rea.code == 0) { - uni.hideLoading(); - that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); - that.getOrder() - that.showpayL = false - }else{ - uni.hideLoading(); - } - }); - // #endif - } else if (that.openWay == 3) { //支付宝支付 - that.$queue.showLoading('支付中...') - // #ifdef H5 - let data = { - ordersId: that.order.ordersId, - type: 2, - userPackageDetailId : that.order.userPackageDetailId - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - uni.hideLoading(); - const div = document.createElement('div') - div.innerHTML = rea.data //此处form就是后台返回接收到的数据 - document.body.appendChild(div) - document.forms[0].submit() - that.getOrder() - that.showpayL = false - }); - // #endif - - // #ifdef APP-PLUS - let data = { - ordersId: that.order.ordersId, - type: 1, - userPackageDetailId : that.order.userPackageDetailId - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - uni.hideLoading(); - that.setPayment('alipay', rea.data); - that.getOrder() - that.showpayL = false - }); - // #endif - } + + }) + }, taocanDaiBd(url,item){ @@ -1041,15 +1062,15 @@ // 立即支付订单 payLj() { let that = this - that.showpayL = false - if (that.openWay == 1) { //零钱支付 - uni.showModal({ - title: '付款提示', - content: '确认支付' + that.order.payMoney + '元吗?', - success: function(re) { - if (re.confirm) { - that.$queue.showLoading('支付中...') - console.log('用户点击确定'); + that.showpayL = false; + uni.showModal({ + title: '付款提示', + content: '确认支付' + that.order.payMoney + '元吗?', + success: function(re) { + if (re.confirm) { + that.$queue.showLoading('支付中...') + console.log('用户点击确定'); + if (that.openWay == 1) { //零钱支付 that.$Request.post("/app/artificer/payOrders", { ordersId: that.order.ordersId, }).then(res => { @@ -1069,157 +1090,179 @@ }) } }); - } else if (re.cancel) { - uni.hideLoading(); - console.log('用户点击取消'); - } - } - - }) - } else if (that.openWay == 2) { //微信支付 - that.$queue.showLoading('支付中...') - // #ifdef MP-WEIXIN - let data = { - ordersId: that.order.ordersId, - type: 3 - } - that.$Request.post('/app/wxPay/payOrder', data).then(ret => { - console.log(ret) - if (ret.code == 0) { - uni.hideLoading(); - uni.requestPayment({ - provider: 'wxpay', - timeStamp: ret.data.timestamp, - nonceStr: ret.data.noncestr, - package: ret.data.package, - signType: ret.data.signType, - paySign: ret.data.sign, - success: function(ret) { - console.log(ret) - uni.showToast({ - title: '支付成功', - icon: 'none' - }) - that.getOrder() - console.log(222) - that.showpayL = false - // this.$queue.showToast('支付成功'); - - // uni.switchTab({ - // url: '/pages/my/index' - // }) - }, - fail: function(err) { - // this.$queue.showToast('支付失败'); - uni.showToast({ - title: '支付失败', - icon: 'nones' - }); - that.getOrder() + } else if (that.openWay == 2) { //微信支付 + that.$queue.showLoading('支付中...') + // #ifdef MP-WEIXIN + let data = { + ordersId: that.order.ordersId, + type: 3 } - }); + that.$Request.post('/app/wxPay/payOrder', data).then(ret => { + console.log(ret) + if (ret.code == 0) { + uni.hideLoading(); + uni.requestPayment({ + provider: 'wxpay', + timeStamp: ret.data.timestamp, + nonceStr: ret.data.noncestr, + package: ret.data.package, + signType: ret.data.signType, + paySign: ret.data.sign, + success: function(ret) { + console.log(ret) + uni.showToast({ + title: '支付成功', + icon: 'none' + }) + that.getOrder() + + that.showpayL = false + // this.$queue.showToast('支付成功'); + + // uni.switchTab({ + // url: '/pages/my/index' + // }) + }, + fail: function(err) { + // this.$queue.showToast('支付失败'); + uni.showToast({ + title: '支付失败', + icon: 'nones' + }); + that.getOrder() + } + }); + } + }); + // #endif + + // #ifdef H5 + let ua = navigator.userAgent.toLowerCase(); + if (ua.indexOf('micromessenger') != -1) { + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + that.showpayL = false + that.getOrder() + that.callPay(rea.data); + + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } else { + let data = { + ordersId: that.order.ordersId, + type: 4 + } + // debugger; + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + // const urlArr = window.location.href; + // const hostUrl = urlArr.split("/"); + // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + // const url = '&redirect_url=' + callBack + 'my/order/pay'; + // window.location = rea.mweb_url + url + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + that.showpayL = false + that.getOrder() + const urlArr = window.location.href; + const hostUrl = urlArr.split("/"); + const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + const url = '&redirect_url=' + callBack + 'my/order/pay'; + window.location = rea.data.mweb_url + url + + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } + + // #endif + + // #ifdef APP + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + console.log(rea) + + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + that.showpayL = false + that.getOrder() + that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); + + } + }); + // #endif + } else if (that.openWay == 3) { //支付宝支付 + that.$queue.showLoading('支付中...') + // #ifdef H5 + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + that.showpayL = false + that.getOrder() + const div = document.createElement('div') + div.innerHTML = rea.data //此处form就是后台返回接收到的数据 + document.body.appendChild(div) + document.forms[0].submit() + + }); + // #endif + + // #ifdef APP-PLUS + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + that.showpayL = false + that.getOrder() + that.setPayment('alipay', rea.data); + + }); + // #endif + } + + } else if (re.cancel) { + uni.hideLoading(); + console.log('用户点击取消'); } - }); - // #endif - - // #ifdef H5 - let ua = navigator.userAgent.toLowerCase(); - if (ua.indexOf('micromessenger') != -1) { - let data = { - ordersId: that.order.ordersId, - type: 2 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + } - if (rea.code == 0) { - that.callPay(rea.data); - that.showpayL = false - that.getOrder() - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) - } - }); - } else { - let data = { - ordersId: that.order.ordersId, - type: 4 - } - // debugger; - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - // const urlArr = window.location.href; - // const hostUrl = urlArr.split("/"); - // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - // const url = '&redirect_url=' + callBack + 'my/order/pay'; - // window.location = rea.mweb_url + url - that.showpay = false - if (rea.code == 0) { - const urlArr = window.location.href; - const hostUrl = urlArr.split("/"); - const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - const url = '&redirect_url=' + callBack + 'my/order/pay'; - window.location = rea.data.mweb_url + url - that.showpayL = false - that.getOrder() - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) - } - }); - } - - // #endif - - // #ifdef APP - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - console.log(rea) - - if (rea.code == 0) { - that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); - that.showpayL = false - that.getOrder() - } - }); - // #endif - } else if (that.openWay == 3) { //支付宝支付 - that.$queue.showLoading('支付中...') - // #ifdef H5 - let data = { - ordersId: that.order.ordersId, - type: 2 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - const div = document.createElement('div') - div.innerHTML = rea.data //此处form就是后台返回接收到的数据 - document.body.appendChild(div) - document.forms[0].submit() - that.showpayL = false - that.getOrder() - }); - // #endif - - // #ifdef APP-PLUS - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - that.setPayment('alipay', rea.data); - that.showpayL = false - that.getOrder() - }); - // #endif - } + }) + }, getOrder() { @@ -1369,30 +1412,29 @@ pay() { let that = this this.showpay = false - if (this.paySel != 0) { - this.payJZ(); - return; - } - if (that.openWay == 1) { //零钱支付 - uni.showModal({ - title: '付款提示', - content: '确认支付' + that.tpayMoney + '元吗?', - success: function(re) { - if (re.confirm) { - that.$queue.showLoading('支付中...') - console.log('用户点击确定'); + // if (this.paySel != 0) { + // this.payJZ(); + // return; + // } + uni.showModal({ + title: '付款提示', + content: '确认支付' + that.tpayMoney + '元吗?', + success: function(re) { + if (re.confirm) { + that.$queue.showLoading('支付中...') + console.log('用户点击确定'); + if (that.openWay == 1) { //零钱支付 that.$Request.post("/app/artificer/payOrders", { ordersId: that.tordersId, }).then(res => { uni.hideLoading(); if (res.code == 0) { - console.log(111) - uni.navigateTo({ - url:'/my/order/payShengji?ordersId='+that.tordersId - }) uni.showToast({ title: '支付成功' }) + uni.navigateTo({ + url:'/my/order/payShengji?ordersId='+that.tordersId + }) // that.getOrder() // that.showorderS=false; @@ -1403,146 +1445,179 @@ }) } }); - } else if (re.cancel) { - uni.hideLoading(); - console.log('用户点击取消'); - } - } - - }) - } else if (that.openWay == 2) { //微信支付 - that.$queue.showLoading('支付中...') - // #ifdef MP-WEIXIN - let data = { - ordersId: that.order.ordersId, - type: 3 - } - that.$Request.post('/app/wxPay/payOrder', data).then(ret => { - console.log(ret) - if (ret.code == 0) { - uni.hideLoading(); - uni.requestPayment({ - provider: 'wxpay', - timeStamp: ret.data.timestamp, - nonceStr: ret.data.noncestr, - package: ret.data.package, - signType: ret.data.signType, - paySign: ret.data.sign, - success: function(ret) { - console.log(ret) - uni.showToast({ - title: '支付成功', - icon: 'none' - }) - that.getOrder() - console.log(222) - // this.$queue.showToast('支付成功'); - - // uni.switchTab({ - // url: '/pages/my/index' - // }) - }, - fail: function(err) { - // this.$queue.showToast('支付失败'); - uni.showToast({ - title: '支付失败', - icon: 'nones' - }); - that.getOrder() + } else if (that.openWay == 2) { //微信支付 + that.$queue.showLoading('支付中...') + // #ifdef MP-WEIXIN + let data = { + ordersId: that.order.ordersId, + type: 3 } - }); - } - }); - // #endif - - // #ifdef H5 - let ua = navigator.userAgent.toLowerCase(); - if (ua.indexOf('micromessenger') != -1) { - let data = { - ordersId: that.order.ordersId, - type: 2 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - that.showpay = false - if (rea.code == 0) { - that.callPay(rea.data); - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) + that.$Request.post('/app/wxPay/payOrder', data).then(ret => { + console.log(ret) + if (ret.code == 0) { + uni.hideLoading(); + uni.requestPayment({ + provider: 'wxpay', + timeStamp: ret.data.timestamp, + nonceStr: ret.data.noncestr, + package: ret.data.package, + signType: ret.data.signType, + paySign: ret.data.sign, + success: function(ret) { + console.log(ret) + uni.showToast({ + title: '支付成功' + }) + uni.navigateTo({ + url:'/my/order/payShengji?ordersId='+that.tordersId + }) + + // this.$queue.showToast('支付成功'); + + // uni.switchTab({ + // url: '/pages/my/index' + // }) + }, + fail: function(err) { + // this.$queue.showToast('支付失败'); + uni.showToast({ + title: '支付失败', + icon: 'nones' + }); + that.getOrder() + } + }); + } + }); + // #endif + + // #ifdef H5 + let ua = navigator.userAgent.toLowerCase(); + if (ua.indexOf('micromessenger') != -1) { + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + uni.navigateTo({ + url:'/my/order/payShengji?ordersId='+that.tordersId + }) + + that.callPay(rea.data); + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } else { + let data = { + ordersId: that.order.ordersId, + type: 4 + } + // debugger; + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + // const urlArr = window.location.href; + // const hostUrl = urlArr.split("/"); + // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + // const url = '&redirect_url=' + callBack + 'my/order/pay'; + // window.location = rea.mweb_url + url + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + uni.navigateTo({ + url:'/my/order/payShengji?ordersId='+that.tordersId + }) + const urlArr = window.location.href; + const hostUrl = urlArr.split("/"); + const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + const url = '&redirect_url=' + callBack + 'my/order/pay'; + window.location = rea.data.mweb_url + url + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } + + // #endif + + // #ifdef APP + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + console.log(rea) + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + uni.navigateTo({ + url:'/my/order/payShengji?ordersId='+that.tordersId + }) + that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); + } + }); + // #endif + } else if (that.openWay == 3) { //支付宝支付 + that.$queue.showLoading('支付中...') + // #ifdef H5 + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + uni.navigateTo({ + url:'/my/order/payShengji?ordersId='+that.tordersId + }) + const div = document.createElement('div') + div.innerHTML = rea.data //此处form就是后台返回接收到的数据 + document.body.appendChild(div) + document.forms[0].submit() + }); + // #endif + + // #ifdef APP-PLUS + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + uni.navigateTo({ + url:'/my/order/payShengji?ordersId='+that.tordersId + }) + that.setPayment('alipay', rea.data); + }); + // #endif } - }); - } else { - let data = { - ordersId: that.order.ordersId, - type: 4 + + } else if (re.cancel) { + uni.hideLoading(); + console.log('用户点击取消'); } - // debugger; - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - // const urlArr = window.location.href; - // const hostUrl = urlArr.split("/"); - // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - // const url = '&redirect_url=' + callBack + 'my/order/pay'; - // window.location = rea.mweb_url + url - that.showpay = false - if (rea.code == 0) { - const urlArr = window.location.href; - const hostUrl = urlArr.split("/"); - const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - const url = '&redirect_url=' + callBack + 'my/order/pay'; - window.location = rea.data.mweb_url + url - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) - } - }); } - - // #endif - - // #ifdef APP - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - console.log(rea) - that.showpay = false - if (rea.code == 0) { - that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); - } - }); - // #endif - } else if (that.openWay == 3) { //支付宝支付 - that.$queue.showLoading('支付中...') - // #ifdef H5 - let data = { - ordersId: that.order.ordersId, - type: 2 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - const div = document.createElement('div') - div.innerHTML = rea.data //此处form就是后台返回接收到的数据 - document.body.appendChild(div) - document.forms[0].submit() - }); - // #endif - - // #ifdef APP-PLUS - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - that.setPayment('alipay', rea.data); - }); - // #endif - } + }) + }, getTimeStampWithoutSeconds(date) { diff --git a/my/order/payCLDetail.vue b/my/order/payCLDetail.vue index 9d74709..c65e838 100644 --- a/my/order/payCLDetail.vue +++ b/my/order/payCLDetail.vue @@ -768,26 +768,25 @@ this.payJZ(); return; } - if (that.openWay == 1) { //零钱支付 - uni.showModal({ - title: '付款提示', - content: '确认支付' + that.tpayMoney + '元吗?', - success: function(re) { - if (re.confirm) { - that.$queue.showLoading('支付中...') - console.log('用户点击确定'); + uni.showModal({ + title: '付款提示', + content: '确认支付' + that.tpayMoney + '元吗?', + success: function(re) { + if (re.confirm) { + that.$queue.showLoading('支付中...') + console.log('用户点击确定'); + if (that.openWay == 1) { //零钱支付 that.$Request.post("/app/artificer/payOrders", { ordersId: that.tordersId, }).then(res => { uni.hideLoading(); if (res.code == 0) { - console.log(111) - uni.navigateTo({ - url:'/my/order/payShengji?ordersId='+that.tordersId - }) uni.showToast({ title: '支付成功' }) + uni.navigateTo({ + url:'/my/order/payShengji?ordersId='+that.tordersId + }) // that.getOrder() // that.showorderS=false; @@ -798,146 +797,172 @@ }) } }); - } else if (re.cancel) { - uni.hideLoading(); - console.log('用户点击取消'); - } - } - - }) - } else if (that.openWay == 2) { //微信支付 - that.$queue.showLoading('支付中...') - // #ifdef MP-WEIXIN - let data = { - ordersId: that.order.ordersId, - type: 3 - } - that.$Request.post('/app/wxPay/payOrder', data).then(ret => { - console.log(ret) - if (ret.code == 0) { - uni.hideLoading(); - uni.requestPayment({ - provider: 'wxpay', - timeStamp: ret.data.timestamp, - nonceStr: ret.data.noncestr, - package: ret.data.package, - signType: ret.data.signType, - paySign: ret.data.sign, - success: function(ret) { - console.log(ret) - uni.showToast({ - title: '支付成功', - icon: 'none' - }) - that.getOrder() - console.log(222) - // this.$queue.showToast('支付成功'); - - // uni.switchTab({ - // url: '/pages/my/index' - // }) - }, - fail: function(err) { - // this.$queue.showToast('支付失败'); - uni.showToast({ - title: '支付失败', - icon: 'nones' - }); - that.getOrder() + } else if (that.openWay == 2) { //微信支付 + that.$queue.showLoading('支付中...') + // #ifdef MP-WEIXIN + let data = { + ordersId: that.order.ordersId, + type: 3 } - }); - } - }); - // #endif - - // #ifdef H5 - let ua = navigator.userAgent.toLowerCase(); - if (ua.indexOf('micromessenger') != -1) { - let data = { - ordersId: that.order.ordersId, - type: 2 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - that.showpay = false - if (rea.code == 0) { - that.callPay(rea.data); - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) + that.$Request.post('/app/wxPay/payOrder', data).then(ret => { + console.log(ret) + if (ret.code == 0) { + uni.hideLoading(); + uni.requestPayment({ + provider: 'wxpay', + timeStamp: ret.data.timestamp, + nonceStr: ret.data.noncestr, + package: ret.data.package, + signType: ret.data.signType, + paySign: ret.data.sign, + success: function(ret) { + uni.showToast({ + title: '支付成功' + }) + uni.navigateTo({ + url:'/my/order/payShengji?ordersId='+that.tordersId + }) + }, + fail: function(err) { + // this.$queue.showToast('支付失败'); + uni.showToast({ + title: '支付失败', + icon: 'nones' + }); + that.getOrder() + } + }); + } + }); + // #endif + + // #ifdef H5 + let ua = navigator.userAgent.toLowerCase(); + if (ua.indexOf('micromessenger') != -1) { + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + uni.navigateTo({ + url:'/my/order/payShengji?ordersId='+that.tordersId + }) + that.callPay(rea.data); + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } else { + let data = { + ordersId: that.order.ordersId, + type: 4 + } + // debugger; + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + // const urlArr = window.location.href; + // const hostUrl = urlArr.split("/"); + // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + // const url = '&redirect_url=' + callBack + 'my/order/pay'; + // window.location = rea.mweb_url + url + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + uni.navigateTo({ + url:'/my/order/payShengji?ordersId='+that.tordersId + }) + const urlArr = window.location.href; + const hostUrl = urlArr.split("/"); + const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + const url = '&redirect_url=' + callBack + 'my/order/pay'; + window.location = rea.data.mweb_url + url + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } + + // #endif + + // #ifdef APP + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + console.log(rea) + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + uni.navigateTo({ + url:'/my/order/payShengji?ordersId='+that.tordersId + }) + that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); + } + }); + // #endif + } else if (that.openWay == 3) { //支付宝支付 + that.$queue.showLoading('支付中...') + // #ifdef H5 + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + uni.navigateTo({ + url:'/my/order/payShengji?ordersId='+that.tordersId + }) + const div = document.createElement('div') + div.innerHTML = rea.data //此处form就是后台返回接收到的数据 + document.body.appendChild(div) + document.forms[0].submit() + }); + // #endif + + // #ifdef APP-PLUS + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + uni.navigateTo({ + url:'/my/order/payShengji?ordersId='+that.tordersId + }) + that.setPayment('alipay', rea.data); + }); + // #endif } - }); - } else { - let data = { - ordersId: that.order.ordersId, - type: 4 + + } else if (re.cancel) { + uni.hideLoading(); + console.log('用户点击取消'); } - // debugger; - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - // const urlArr = window.location.href; - // const hostUrl = urlArr.split("/"); - // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - // const url = '&redirect_url=' + callBack + 'my/order/pay'; - // window.location = rea.mweb_url + url - that.showpay = false - if (rea.code == 0) { - const urlArr = window.location.href; - const hostUrl = urlArr.split("/"); - const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - const url = '&redirect_url=' + callBack + 'my/order/pay'; - window.location = rea.data.mweb_url + url - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) - } - }); } - - // #endif - - // #ifdef APP - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - console.log(rea) - that.showpay = false - if (rea.code == 0) { - that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); - } - }); - // #endif - } else if (that.openWay == 3) { //支付宝支付 - that.$queue.showLoading('支付中...') - // #ifdef H5 - let data = { - ordersId: that.order.ordersId, - type: 2 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - const div = document.createElement('div') - div.innerHTML = rea.data //此处form就是后台返回接收到的数据 - document.body.appendChild(div) - document.forms[0].submit() - }); - // #endif - - // #ifdef APP-PLUS - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - that.setPayment('alipay', rea.data); - }); - // #endif - } + + }) + }, getTimeStampWithoutSeconds(date) { @@ -1176,15 +1201,14 @@ payJZ() { let that = this; - if (that.openWay == 1) { //零钱支付 - console.log('1111') - uni.showModal({ - title: '付款提示', - content: '确认支付' + that.tpayMoney + '元吗?', - success: function(re) { - if (re.confirm) { - that.$queue.showLoading('支付中...') - // console.log('用户点击确定'); + uni.showModal({ + title: '付款提示', + content: '确认支付' + that.tpayMoney + '元吗?', + success: function(re) { + if (re.confirm) { + that.$queue.showLoading('支付中...') + // console.log('用户点击确定'); + if (that.openWay == 1) { //零钱支付 that.$Request.post("/app/artificer/payOrders", { ordersId: that.tordersId, }).then(ret => { @@ -1206,7 +1230,7 @@ } that.getOrder() - + } else { uni.showToast({ title: ret.msg, @@ -1214,138 +1238,212 @@ }) } }); - } else if (re.cancel) { - that.getOrder() - } - } - }) - } else if (that.openWay == 2) { //微信支付 - // #ifdef MP-WEIXIN - let data = { - ordersId: that.ordersId, - type: 3 - } - that.$Request.post('/app/wxPay/payOrder', data).then(ret => { - console.log(ret) - if (ret.code == 0) { - uni.hideLoading(); - uni.requestPayment({ - provider: 'wxpay', - timeStamp: ret.data.timestamp, - nonceStr: ret.data.noncestr, - package: ret.data.package, - signType: ret.data.signType, - paySign: ret.data.sign, - success: function(ret) { - console.log(ret) - uni.showToast({ - title: '支付成功', - icon: 'none' - }) - that.getOrder() - // this.$queue.showToast('支付成功'); - - // uni.switchTab({ - // url: '/pages/my/index' - // }) - }, - fail: function(err) { - // this.$queue.showToast('支付失败'); - uni.showToast({ - title: '支付失败', - icon: 'nones' - }); - that.getOrder() + } else if (that.openWay == 2) { //微信支付 + // #ifdef MP-WEIXIN + let data = { + ordersId: that.ordersId, + type: 3 } - }); - } - }); - // #endif - - // #ifdef H5 - let ua = navigator.userAgent.toLowerCase(); - if (ua.indexOf('micromessenger') != -1) { - let data = { - ordersId: that.ordersId, - type: 2 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - that.showpay = false - if (rea.code == 0) { - that.callPay(rea.data); - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) + that.$Request.post('/app/wxPay/payOrder', data).then(ret => { + console.log(ret) + if (ret.code == 0) { + uni.hideLoading(); + uni.requestPayment({ + provider: 'wxpay', + timeStamp: ret.data.timestamp, + nonceStr: ret.data.noncestr, + package: ret.data.package, + signType: ret.data.signType, + paySign: ret.data.sign, + success: function(ret) { + uni.showToast({ + title: '支付成功', + icon: 'none' + }) + + if(that.jiazhong=='加钟'){ + uni.navigateTo({ + url:'/my/order/payJaZ?ordersId='+that.order.ordersId + }) + }else if(that.shengji=='升级'){ + uni.navigateTo({ + url:'/my/order/payShengji?ordersId='+that.tordersId + }) + } + }, + fail: function(err) { + // this.$queue.showToast('支付失败'); + uni.showToast({ + title: '支付失败', + icon: 'nones' + }); + that.getOrder() + } + }); + } + }); + // #endif + + // #ifdef H5 + let ua = navigator.userAgent.toLowerCase(); + if (ua.indexOf('micromessenger') != -1) { + let data = { + ordersId: that.ordersId, + type: 2 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功', + icon: 'none' + }) + + if(that.jiazhong=='加钟'){ + uni.navigateTo({ + url:'/my/order/payJaZ?ordersId='+that.order.ordersId + }) + }else if(that.shengji=='升级'){ + uni.navigateTo({ + url:'/my/order/payShengji?ordersId='+that.tordersId + }) + } + that.callPay(rea.data); + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } else { + let data = { + ordersId: that.ordersId, + type: 4 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功', + icon: 'none' + }) + + if(that.jiazhong=='加钟'){ + uni.navigateTo({ + url:'/my/order/payJaZ?ordersId='+that.order.ordersId + }) + }else if(that.shengji=='升级'){ + uni.navigateTo({ + url:'/my/order/payShengji?ordersId='+that.tordersId + }) + } + const urlArr = window.location.href; + const hostUrl = urlArr.split("/"); + const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + const url = '&redirect_url=' + callBack + 'my/order/pay'; + window.location = rea.data.mweb_url + url + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } + + // #endif + + // #ifdef APP + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + console.log(rea) + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功', + icon: 'none' + }) + + if(that.jiazhong=='加钟'){ + uni.navigateTo({ + url:'/my/order/payJaZ?ordersId='+that.order.ordersId + }) + }else if(that.shengji=='升级'){ + uni.navigateTo({ + url:'/my/order/payShengji?ordersId='+that.tordersId + }) + } + that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); + } + }); + // #endif + } else if (that.openWay == 3) { //支付宝支付 + // #ifdef H5 + let data = { + ordersId: that.ordersId, + type: 2 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功', + icon: 'none' + }) + + if(that.jiazhong=='加钟'){ + uni.navigateTo({ + url:'/my/order/payJaZ?ordersId='+that.order.ordersId + }) + }else if(that.shengji=='升级'){ + uni.navigateTo({ + url:'/my/order/payShengji?ordersId='+that.tordersId + }) + } + that.showpay = false + const div = document.createElement('div') + div.innerHTML = rea.data //此处form就是后台返回接收到的数据 + document.body.appendChild(div) + document.forms[0].submit() + }); + // #endif + + // #ifdef APP-PLUS + let data = { + ordersId: that.ordersId, + type: 1 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功', + icon: 'none' + }) + + if(that.jiazhong=='加钟'){ + uni.navigateTo({ + url:'/my/order/payJaZ?ordersId='+that.order.ordersId + }) + }else if(that.shengji=='升级'){ + uni.navigateTo({ + url:'/my/order/payShengji?ordersId='+that.tordersId + }) + } + that.showpay = false + that.setPayment('alipay', rea.data); + }); + // #endif } - }); - } else { - let data = { - ordersId: that.ordersId, - type: 4 + + } else if (re.cancel) { + that.getOrder() } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - that.showpay = false - if (rea.code == 0) { - const urlArr = window.location.href; - const hostUrl = urlArr.split("/"); - const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - const url = '&redirect_url=' + callBack + 'my/order/pay'; - window.location = rea.data.mweb_url + url - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) - } - }); } - - // #endif - - // #ifdef APP - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - console.log(rea) - that.showpay = false - if (rea.code == 0) { - that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); - } - }); - // #endif - } else if (that.openWay == 3) { //支付宝支付 - // #ifdef H5 - let data = { - ordersId: that.ordersId, - type: 2 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - that.showpay = false - const div = document.createElement('div') - div.innerHTML = rea.data //此处form就是后台返回接收到的数据 - document.body.appendChild(div) - document.forms[0].submit() - }); - // #endif - - // #ifdef APP-PLUS - let data = { - ordersId: that.ordersId, - type: 1 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - that.showpay = false - that.setPayment('alipay', rea.data); - }); - // #endif - } - + }) + }, //支付选择 diff --git a/my/order/payJaZ.vue b/my/order/payJaZ.vue index 2d5f1df..9ef4b50 100644 --- a/my/order/payJaZ.vue +++ b/my/order/payJaZ.vue @@ -926,14 +926,14 @@ this.payJZ(); return; } - if (that.openWay == 1) { //零钱支付 - uni.showModal({ - title: '付款提示', - content: '确认支付' + that.tpayMoney + '元吗?', - success: function(re) { - if (re.confirm) { - that.$queue.showLoading('支付中...') - console.log('用户点击确定'); + uni.showModal({ + title: '付款提示', + content: '确认支付' + that.tpayMoney + '元吗?', + success: function(re) { + if (re.confirm) { + that.$queue.showLoading('支付中...') + console.log('用户点击确定'); + if (that.openWay == 1) { //零钱支付 that.$Request.post("/app/artificer/payOrders", { ordersId: that.tordersId, }).then(res => { @@ -943,10 +943,8 @@ title: '支付成功' }) that.getOrder() - that.showorderS=false; - uni.switchTab({ - url:'/pages/order/index' - }) + that.showorder=false; + } else { uni.showToast({ title: res.msg, @@ -954,145 +952,171 @@ }) } }); - } else if (re.cancel) { - uni.hideLoading(); - console.log('用户点击取消'); - } - } - - }) - } else if (that.openWay == 2) { //微信支付 - that.$queue.showLoading('支付中...') - // #ifdef MP-WEIXIN - let data = { - ordersId: that.order.ordersId, - type: 3 - } - that.$Request.post('/app/wxPay/payOrder', data).then(ret => { - console.log(ret) - if (ret.code == 0) { - uni.hideLoading(); - uni.requestPayment({ - provider: 'wxpay', - timeStamp: ret.data.timestamp, - nonceStr: ret.data.noncestr, - package: ret.data.package, - signType: ret.data.signType, - paySign: ret.data.sign, - success: function(ret) { - console.log(ret) - uni.showToast({ - title: '支付成功', - icon: 'none' - }) - that.getOrder() - // this.$queue.showToast('支付成功'); - - // uni.switchTab({ - // url: '/pages/my/index' - // }) - }, - fail: function(err) { - // this.$queue.showToast('支付失败'); - uni.showToast({ - title: '支付失败', - icon: 'nones' - }); - that.getOrder() + } else if (that.openWay == 2) { //微信支付 + that.$queue.showLoading('支付中...') + // #ifdef MP-WEIXIN + let data = { + ordersId: that.order.ordersId, + type: 3 } - }); - } - }); - // #endif - - // #ifdef H5 - let ua = navigator.userAgent.toLowerCase(); - if (ua.indexOf('micromessenger') != -1) { - let data = { - ordersId: that.order.ordersId, - type: 2 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - that.showpay = false - if (rea.code == 0) { - that.callPay(rea.data); - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) + that.$Request.post('/app/wxPay/payOrder', data).then(ret => { + console.log(ret) + if (ret.code == 0) { + uni.hideLoading(); + uni.requestPayment({ + provider: 'wxpay', + timeStamp: ret.data.timestamp, + nonceStr: ret.data.noncestr, + package: ret.data.package, + signType: ret.data.signType, + paySign: ret.data.sign, + success: function(ret) { + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + that.showorder=false; + // this.$queue.showToast('支付成功'); + + // uni.switchTab({ + // url: '/pages/my/index' + // }) + }, + fail: function(err) { + // this.$queue.showToast('支付失败'); + uni.showToast({ + title: '支付失败', + icon: 'nones' + }); + that.getOrder() + } + }); + } + }); + // #endif + + // #ifdef H5 + let ua = navigator.userAgent.toLowerCase(); + if (ua.indexOf('micromessenger') != -1) { + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + that.showorder=false; + that.callPay(rea.data); + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } else { + let data = { + ordersId: that.order.ordersId, + type: 4 + } + // debugger; + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + // const urlArr = window.location.href; + // const hostUrl = urlArr.split("/"); + // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + // const url = '&redirect_url=' + callBack + 'my/order/pay'; + // window.location = rea.mweb_url + url + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + that.showorder=false; + const urlArr = window.location.href; + const hostUrl = urlArr.split("/"); + const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + const url = '&redirect_url=' + callBack + 'my/order/pay'; + window.location = rea.data.mweb_url + url + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } + + // #endif + + // #ifdef APP + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + console.log(rea) + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + that.showorder=false; + that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); + } + }); + // #endif + } else if (that.openWay == 3) { //支付宝支付 + that.$queue.showLoading('支付中...') + // #ifdef H5 + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + that.showorder=false; + const div = document.createElement('div') + div.innerHTML = rea.data //此处form就是后台返回接收到的数据 + document.body.appendChild(div) + document.forms[0].submit() + }); + // #endif + + // #ifdef APP-PLUS + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + that.showorder=false; + that.setPayment('alipay', rea.data); + }); + // #endif } - }); - } else { - let data = { - ordersId: that.order.ordersId, - type: 4 + + } else if (re.cancel) { + uni.hideLoading(); + console.log('用户点击取消'); } - // debugger; - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - // const urlArr = window.location.href; - // const hostUrl = urlArr.split("/"); - // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - // const url = '&redirect_url=' + callBack + 'my/order/pay'; - // window.location = rea.mweb_url + url - that.showpay = false - if (rea.code == 0) { - const urlArr = window.location.href; - const hostUrl = urlArr.split("/"); - const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - const url = '&redirect_url=' + callBack + 'my/order/pay'; - window.location = rea.data.mweb_url + url - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) - } - }); } - - // #endif - - // #ifdef APP - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - console.log(rea) - that.showpay = false - if (rea.code == 0) { - that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); - } - }); - // #endif - } else if (that.openWay == 3) { //支付宝支付 - that.$queue.showLoading('支付中...') - // #ifdef H5 - let data = { - ordersId: that.order.ordersId, - type: 2 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - const div = document.createElement('div') - div.innerHTML = rea.data //此处form就是后台返回接收到的数据 - document.body.appendChild(div) - document.forms[0].submit() - }); - // #endif - - // #ifdef APP-PLUS - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - that.setPayment('alipay', rea.data); - }); - // #endif - } + + }) + }, getTimeStampWithoutSeconds(date) { @@ -1335,15 +1359,14 @@ payJZ() { let that = this; - if (that.openWay == 1) { //零钱支付 - console.log('1111') - uni.showModal({ - title: '付款提示', - content: '确认支付' + that.tpayMoney + '元吗?', - success: function(re) { - if (re.confirm) { - that.$queue.showLoading('支付中...') - // console.log('用户点击确定'); + uni.showModal({ + title: '付款提示', + content: '确认支付' + that.tpayMoney + '元吗?', + success: function(re) { + if (re.confirm) { + that.$queue.showLoading('支付中...') + // console.log('用户点击确定'); + if (that.openWay == 1) { //零钱支付 that.$Request.post("/app/artificer/payOrders", { ordersId: that.tordersId, }).then(ret => { @@ -1354,7 +1377,7 @@ icon: 'none' }) that.getOrder() - + } else { uni.showToast({ title: ret.msg, @@ -1362,138 +1385,163 @@ }) } }); - } else if (re.cancel) { - that.getOrder() - } - } - }) - } else if (that.openWay == 2) { //微信支付 - // #ifdef MP-WEIXIN - let data = { - ordersId: that.ordersId, - type: 3 - } - that.$Request.post('/app/wxPay/payOrder', data).then(ret => { - console.log(ret) - if (ret.code == 0) { - uni.hideLoading(); - uni.requestPayment({ - provider: 'wxpay', - timeStamp: ret.data.timestamp, - nonceStr: ret.data.noncestr, - package: ret.data.package, - signType: ret.data.signType, - paySign: ret.data.sign, - success: function(ret) { - console.log(ret) - uni.showToast({ - title: '支付成功', - icon: 'none' - }) - that.getOrder() - // this.$queue.showToast('支付成功'); - - // uni.switchTab({ - // url: '/pages/my/index' - // }) - }, - fail: function(err) { - // this.$queue.showToast('支付失败'); - uni.showToast({ - title: '支付失败', - icon: 'nones' - }); - that.getOrder() + } else if (that.openWay == 2) { //微信支付 + // #ifdef MP-WEIXIN + let data = { + ordersId: that.ordersId, + type: 3 } - }); - } - }); - // #endif - - // #ifdef H5 - let ua = navigator.userAgent.toLowerCase(); - if (ua.indexOf('micromessenger') != -1) { - let data = { - ordersId: that.ordersId, - type: 2 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - that.showpay = false - if (rea.code == 0) { - that.callPay(rea.data); - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) + that.$Request.post('/app/wxPay/payOrder', data).then(ret => { + console.log(ret) + if (ret.code == 0) { + uni.hideLoading(); + uni.requestPayment({ + provider: 'wxpay', + timeStamp: ret.data.timestamp, + nonceStr: ret.data.noncestr, + package: ret.data.package, + signType: ret.data.signType, + paySign: ret.data.sign, + success: function(ret) { + uni.showToast({ + title: '支付成功', + icon: 'none' + }) + that.getOrder() + // this.$queue.showToast('支付成功'); + + // uni.switchTab({ + // url: '/pages/my/index' + // }) + }, + fail: function(err) { + // this.$queue.showToast('支付失败'); + uni.showToast({ + title: '支付失败', + icon: 'nones' + }); + that.getOrder() + } + }); + } + }); + // #endif + + // #ifdef H5 + let ua = navigator.userAgent.toLowerCase(); + if (ua.indexOf('micromessenger') != -1) { + let data = { + ordersId: that.ordersId, + type: 2 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功', + icon: 'none' + }) + that.getOrder() + that.callPay(rea.data); + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } else { + let data = { + ordersId: that.ordersId, + type: 4 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功', + icon: 'none' + }) + that.getOrder() + const urlArr = window.location.href; + const hostUrl = urlArr.split("/"); + const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + const url = '&redirect_url=' + callBack + 'my/order/pay'; + window.location = rea.data.mweb_url + url + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } + + // #endif + + // #ifdef APP + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + console.log(rea) + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功', + icon: 'none' + }) + that.getOrder() + that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); + } + }); + // #endif + } else if (that.openWay == 3) { //支付宝支付 + // #ifdef H5 + let data = { + ordersId: that.ordersId, + type: 2 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + that.showpay = false + uni.showToast({ + title: '支付成功', + icon: 'none' + }) + that.getOrder() + const div = document.createElement('div') + div.innerHTML = rea.data //此处form就是后台返回接收到的数据 + document.body.appendChild(div) + document.forms[0].submit() + }); + // #endif + + // #ifdef APP-PLUS + let data = { + ordersId: that.ordersId, + type: 1 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + that.showpay = false + uni.showToast({ + title: '支付成功', + icon: 'none' + }) + that.getOrder() + that.setPayment('alipay', rea.data); + }); + // #endif } - }); - } else { - let data = { - ordersId: that.ordersId, - type: 4 + + } else if (re.cancel) { + that.getOrder() } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - that.showpay = false - if (rea.code == 0) { - const urlArr = window.location.href; - const hostUrl = urlArr.split("/"); - const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - const url = '&redirect_url=' + callBack + 'my/order/pay'; - window.location = rea.data.mweb_url + url - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) - } - }); } - - // #endif - - // #ifdef APP - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - console.log(rea) - that.showpay = false - if (rea.code == 0) { - that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); - } - }); - // #endif - } else if (that.openWay == 3) { //支付宝支付 - // #ifdef H5 - let data = { - ordersId: that.ordersId, - type: 2 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - that.showpay = false - const div = document.createElement('div') - div.innerHTML = rea.data //此处form就是后台返回接收到的数据 - document.body.appendChild(div) - document.forms[0].submit() - }); - // #endif - - // #ifdef APP-PLUS - let data = { - ordersId: that.ordersId, - type: 1 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - that.showpay = false - that.setPayment('alipay', rea.data); - }); - // #endif - } - + }) + }, //支付选择 diff --git a/my/order/payModifyTcMy.vue b/my/order/payModifyTcMy.vue index 2af642e..3ae89cf 100644 --- a/my/order/payModifyTcMy.vue +++ b/my/order/payModifyTcMy.vue @@ -475,12 +475,13 @@ }); }, liliaoshi(){ + var that=this uni.setStorage({ key: 'taocanDd', data: '我的套餐', success: function () { uni.navigateTo({ - url: '/pages/therapist/therapistDingdan' + url: '/pages/therapist/therapistDingdan?technicianType='+that.orderXm.level }) } }); @@ -1201,16 +1202,10 @@ }, // 取消订单 cancelOrder(e) { - let contentName = ''; - let closeKC = this.$queue.getData('closeKC'); - if (e.status == 7 || e.status == 8 && closeKC) { - let money = parseFloat(parseFloat(e.price) * parseFloat(closeKC)).toFixed(2); - contentName = '取消订单将扣除' + money + '元的手续费,并且车费将全部扣除!'; - } let that = this uni.showModal({ title: '温馨提示', - content: '是否确认取消订单?' + contentName, + content: '是否确认取消订单?', success: function(res) { if (res.confirm) { let data = { diff --git a/my/order/payModifyTcMyDaiB.vue b/my/order/payModifyTcMyDaiB.vue index dfb3e85..1f00583 100644 --- a/my/order/payModifyTcMyDaiB.vue +++ b/my/order/payModifyTcMyDaiB.vue @@ -1002,19 +1002,13 @@ pay() { let that = this this.showpay = false - if (this.paySel != 0) { - this.payJZ(); - return; - } - if (that.openWay == 1) { //零钱支付 - console.log("that.order.sumMoney",that.order) - uni.showModal({ - title: '付款提示', - content: '确认支付' + that.order.sumMoney + '元吗?', - success: function(re) { - if (re.confirm) { - that.$queue.showLoading('支付中...') - console.log('用户点击确定'); + uni.showModal({ + title: '付款提示', + content: '确认支付' + that.order.payMoney + '元吗?', + success: function(re) { + if (re.confirm) { + that.$queue.showLoading('支付中...') + if (that.openWay == 1) { //零钱支付 that.$Request.post("/app/artificer/payOrders", { ordersId: that.order.ordersId, }).then(res => { @@ -1034,161 +1028,189 @@ }) } }); - } else if (re.cancel) { - uni.hideLoading(); - console.log('用户点击取消'); - } - } - - }) - } else if (that.openWay == 2) { //微信支付 - that.$queue.showLoading('支付中...') - // #ifdef MP-WEIXIN - let data = { - ordersId: that.order.ordersId, - type: 3 - } - that.$Request.post('/app/wxPay/payOrder', data).then(ret => { - console.log(ret) - if (ret.code == 0) { - uni.hideLoading(); - uni.requestPayment({ - provider: 'wxpay', - timeStamp: ret.data.timestamp, - nonceStr: ret.data.noncestr, - package: ret.data.package, - signType: ret.data.signType, - paySign: ret.data.sign, - success: function(ret) { - console.log(ret) - uni.showToast({ - title: '支付成功', - icon: 'none' - }) - that.getOrder() - // this.$queue.showToast('支付成功'); - - uni.switchTab({ - url:'/pages/order/index' - }) - }, - fail: function(err) { - // this.$queue.showToast('支付失败'); - uni.showToast({ - title: '支付失败', - icon: 'nones' - }); - that.getOrder() + } else if (that.openWay == 2) { //微信支付 + that.$queue.showLoading('支付中...') + // #ifdef MP-WEIXIN + let data = { + ordersId: that.order.ordersId, + type: 3 } - }); - } - }); - // #endif - - // #ifdef H5 - let ua = navigator.userAgent.toLowerCase(); - if (ua.indexOf('micromessenger') != -1) { - let data = { - ordersId: that.order.ordersId, - type: 2 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - that.showpay = false - if (rea.code == 0) { - that.callPay(rea.data); - uni.switchTab({ - url:'/pages/order/index' - }) - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) - } - }); - } else { - let data = { - ordersId: that.order.ordersId, - type: 4 - } - // debugger; - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - // const urlArr = window.location.href; - // const hostUrl = urlArr.split("/"); - // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - // const url = '&redirect_url=' + callBack + 'my/order/pay'; - // window.location = rea.mweb_url + url - that.showpay = false - if (rea.code == 0) { - const urlArr = window.location.href; - const hostUrl = urlArr.split("/"); - const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - const url = '&redirect_url=' + callBack + 'my/order/pay'; - window.location = rea.data.mweb_url + url - uni.switchTab({ - url:'/pages/order/index' - }) - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) - } - }); - } - - // #endif - - // #ifdef APP - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - console.log(rea) - that.showpay = false - if (rea.code == 0) { + that.$Request.post('/app/wxPay/payOrder', data).then(ret => { + console.log(ret) + if (ret.code == 0) { + uni.hideLoading(); + uni.requestPayment({ + provider: 'wxpay', + timeStamp: ret.data.timestamp, + nonceStr: ret.data.noncestr, + package: ret.data.package, + signType: ret.data.signType, + paySign: ret.data.sign, + success: function(ret) { + console.log(ret) + uni.showToast({ + title: '支付成功', + icon: 'none' + }) + uni.switchTab({ + url:'/pages/order/index' + }) + that.getOrder() + }, + fail: function(err) { + uni.showToast({ + title: '支付失败', + icon: 'nones' + }); + that.getOrder() + } + }); + } + }); + // #endif - that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); - uni.switchTab({ - url:'/pages/order/index' - }) + // #ifdef H5 + let ua = navigator.userAgent.toLowerCase(); + if (ua.indexOf('micromessenger') != -1) { + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功', + icon: 'none' + }) + uni.switchTab({ + url:'/pages/order/index' + }) + that.callPay(rea.data); + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } else { + let data = { + ordersId: that.order.ordersId, + type: 4 + } + // debugger; + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + // const urlArr = window.location.href; + // const hostUrl = urlArr.split("/"); + // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + // const url = '&redirect_url=' + callBack + 'my/order/pay'; + // window.location = rea.mweb_url + url + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功', + icon: 'none' + }) + uni.switchTab({ + url:'/pages/order/index' + }) + const urlArr = window.location.href; + const hostUrl = urlArr.split("/"); + const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + const url = '&redirect_url=' + callBack + 'my/order/pay'; + window.location = rea.data.mweb_url + url + + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } + + // #endif + + // #ifdef APP + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + console.log(rea) + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功', + icon: 'none' + }) + uni.switchTab({ + url:'/pages/order/index' + }) + that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); + + }else{ + uni.showToast({ + title: '支付失败', + icon: 'nones' + }); + that.getOrder() + } + }); + // #endif + } else if (that.openWay == 3) { //支付宝支付 + that.$queue.showLoading('支付中...') + // #ifdef H5 + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功', + icon: 'none' + }) + uni.switchTab({ + url:'/pages/order/index' + }) + const div = document.createElement('div') + div.innerHTML = rea.data //此处form就是后台返回接收到的数据 + document.body.appendChild(div) + document.forms[0].submit() + + }); + // #endif + + // #ifdef APP-PLUS + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功', + icon: 'none' + }) + uni.switchTab({ + url:'/pages/order/index' + }) + that.setPayment('alipay', rea.data); + }); + // #endif + } + + + } else if (re.cancel) { + uni.hideLoading(); + console.log('用户点击取消'); } - }); - // #endif - } else if (that.openWay == 3) { //支付宝支付 - that.$queue.showLoading('支付中...') - // #ifdef H5 - let data = { - ordersId: that.order.ordersId, - type: 2 } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - const div = document.createElement('div') - div.innerHTML = rea.data //此处form就是后台返回接收到的数据 - document.body.appendChild(div) - document.forms[0].submit() - uni.switchTab({ - url:'/pages/order/index' - }) - }); - // #endif - - // #ifdef APP-PLUS - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - that.setPayment('alipay', rea.data); - uni.switchTab({ - url:'/pages/order/index' - }) - }); - // #endif - } + + }) + }, callPay: function(response) { if (typeof WeixinJSBridge === "undefined") { diff --git a/my/order/payShengji.vue b/my/order/payShengji.vue index a1324c0..89a4d6a 100644 --- a/my/order/payShengji.vue +++ b/my/order/payShengji.vue @@ -794,6 +794,7 @@ ordersId: '', tpayMoney: '', paySel: 0, + showpayZ:false, showorder: false, showorderS: false, orderList: [], @@ -1025,14 +1026,14 @@ payDzF() { let that = this this.showpay = false - if (that.openWay == 1) { //零钱支付 - uni.showModal({ - title: '付款提示', - content: '确认支付' + that.order.payMoney + '元吗?', - success: function(re) { - if (re.confirm) { - that.$queue.showLoading('支付中...') - console.log('用户点击确定'); + uni.showModal({ + title: '付款提示', + content: '确认支付' + that.order.payMoney + '元吗?', + success: function(re) { + if (re.confirm) { + that.$queue.showLoading('支付中...') + console.log('用户点击确定'); + if (that.openWay == 1) { //零钱支付 that.$Request.post("/app/artificer/payOrders", { ordersId: that.order.ordersId, }).then(res => { @@ -1043,7 +1044,6 @@ }) that.getOrder() that.showorderS=false; - that.showpay = false // uni.switchTab({ // url:'/pages/order/index' // }) @@ -1054,168 +1054,191 @@ }) } }); - } else if (re.cancel) { - uni.hideLoading(); - console.log('用户点击取消'); - } - } - - }) - } else if (that.openWay == 2) { //微信支付 - that.$queue.showLoading('支付中...') - // #ifdef MP-WEIXIN - let data = { - ordersId: that.order.ordersId, - type: 3 - } - that.$Request.post('/app/wxPay/payOrder', data).then(ret => { - console.log(ret) - if (ret.code == 0) { - uni.hideLoading(); - uni.requestPayment({ - provider: 'wxpay', - timeStamp: ret.data.timestamp, - nonceStr: ret.data.noncestr, - package: ret.data.package, - signType: ret.data.signType, - paySign: ret.data.sign, - success: function(ret) { - console.log(ret) - uni.showToast({ - title: '支付成功', - icon: 'none' - }) - that.getOrder() - that.showpay = false - // this.$queue.showToast('支付成功'); - - // uni.switchTab({ - // url: '/pages/my/index' - // }) - }, - fail: function(err) { - // this.$queue.showToast('支付失败'); - uni.showToast({ - title: '支付失败', - icon: 'nones' - }); - that.getOrder() + } else if (that.openWay == 2) { //微信支付 + that.$queue.showLoading('支付中...') + // #ifdef MP-WEIXIN + let data = { + ordersId: that.order.ordersId, + type: 3 } - }); - } - }); - // #endif - - // #ifdef H5 - let ua = navigator.userAgent.toLowerCase(); - if (ua.indexOf('micromessenger') != -1) { - let data = { - ordersId: that.order.ordersId, - type: 2 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - that.showpay = false - if (rea.code == 0) { - that.callPay(rea.data); - that.showpay = false - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) + that.$Request.post('/app/wxPay/payOrder', data).then(ret => { + console.log(ret) + if (ret.code == 0) { + uni.hideLoading(); + uni.requestPayment({ + provider: 'wxpay', + timeStamp: ret.data.timestamp, + nonceStr: ret.data.noncestr, + package: ret.data.package, + signType: ret.data.signType, + paySign: ret.data.sign, + success: function(ret) { + console.log(ret) + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + that.showorderS=false; + // this.$queue.showToast('支付成功'); + + // uni.switchTab({ + // url: '/pages/my/index' + // }) + }, + fail: function(err) { + // this.$queue.showToast('支付失败'); + uni.showToast({ + title: '支付失败', + icon: 'nones' + }); + that.getOrder() + } + }); + } + }); + // #endif + + // #ifdef H5 + let ua = navigator.userAgent.toLowerCase(); + if (ua.indexOf('micromessenger') != -1) { + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + that.showorderS=false; + that.callPay(rea.data); + + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } else { + let data = { + ordersId: that.order.ordersId, + type: 4 + } + // debugger; + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + // const urlArr = window.location.href; + // const hostUrl = urlArr.split("/"); + // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + // const url = '&redirect_url=' + callBack + 'my/order/pay'; + // window.location = rea.mweb_url + url + + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + that.showorderS=false; + const urlArr = window.location.href; + const hostUrl = urlArr.split("/"); + const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + const url = '&redirect_url=' + callBack + 'my/order/pay'; + window.location = rea.data.mweb_url + url + + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } + + // #endif + + // #ifdef APP + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + console.log(rea) + + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + that.showorderS=false; + that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); + + } + }); + // #endif + } else if (that.openWay == 3) { //支付宝支付 + that.$queue.showLoading('支付中...') + // #ifdef H5 + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + that.showorderS=false; + const div = document.createElement('div') + div.innerHTML = rea.data //此处form就是后台返回接收到的数据 + document.body.appendChild(div) + document.forms[0].submit() + + }); + // #endif + + // #ifdef APP-PLUS + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + that.showorderS=false; + that.setPayment('alipay', rea.data); + }); + // #endif } - }); - } else { - let data = { - ordersId: that.order.ordersId, - type: 4 + + } else if (re.cancel) { + uni.hideLoading(); + console.log('用户点击取消'); } - // debugger; - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - // const urlArr = window.location.href; - // const hostUrl = urlArr.split("/"); - // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - // const url = '&redirect_url=' + callBack + 'my/order/pay'; - // window.location = rea.mweb_url + url - that.showpay = false - if (rea.code == 0) { - const urlArr = window.location.href; - const hostUrl = urlArr.split("/"); - const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - const url = '&redirect_url=' + callBack + 'my/order/pay'; - window.location = rea.data.mweb_url + url - that.showpay = false - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) - } - }); } - - // #endif - - // #ifdef APP - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - console.log(rea) - that.showpay = false - if (rea.code == 0) { - that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); - that.showpay = false - } - }); - // #endif - } else if (that.openWay == 3) { //支付宝支付 - that.$queue.showLoading('支付中...') - // #ifdef H5 - let data = { - ordersId: that.order.ordersId, - type: 2 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - const div = document.createElement('div') - div.innerHTML = rea.data //此处form就是后台返回接收到的数据 - document.body.appendChild(div) - document.forms[0].submit() - that.showpay = false - }); - // #endif - - // #ifdef APP-PLUS - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - that.setPayment('alipay', rea.data); - that.showpay = false - }); - // #endif - } + }) + }, // 支付订单 pay() { let that = this this.showpay = false - if (this.paySel != 0) { - this.payJZ(); - return; - } - if (that.openWay == 1) { //零钱支付 - uni.showModal({ - title: '付款提示', - content: '确认支付' + that.tpayMoney + '元吗?', - success: function(re) { - if (re.confirm) { - that.$queue.showLoading('支付中...') - console.log('用户点击确定'); + // if (this.paySel != 0) { + // this.payJZ(); + // return; + // } + uni.showModal({ + title: '付款提示', + content: '确认支付' + that.tpayMoney + '元吗?', + success: function(re) { + if (re.confirm) { + that.$queue.showLoading('支付中...') + console.log('用户点击确定'); + if (that.openWay == 1) { //零钱支付 that.$Request.post("/app/artificer/payOrders", { ordersId: that.tordersId, }).then(res => { @@ -1226,9 +1249,9 @@ }) that.getOrder() that.showpayZ = false; - uni.switchTab({ - url:'/pages/order/index' - }) + // uni.switchTab({ + // url:'/pages/order/index' + // }) } else { uni.showToast({ title: res.msg, @@ -1236,151 +1259,177 @@ }) } }); - } else if (re.cancel) { - uni.hideLoading(); - console.log('用户点击取消'); - } - } - - }) - } else if (that.openWay == 2) { //微信支付 - that.$queue.showLoading('支付中...') - // #ifdef MP-WEIXIN - let data = { - ordersId: that.tordersId, - type: 3 - } - that.$Request.post('/app/wxPay/payOrder', data).then(ret => { - console.log(ret) - if (ret.code == 0) { - uni.hideLoading(); - uni.requestPayment({ - provider: 'wxpay', - timeStamp: ret.data.timestamp, - nonceStr: ret.data.noncestr, - package: ret.data.package, - signType: ret.data.signType, - paySign: ret.data.sign, - success: function(ret) { - console.log(ret) - uni.showToast({ - title: '支付成功', - icon: 'none' - }) - that.getOrder() - that.showpayZ = false; - // this.$queue.showToast('支付成功'); - - // uni.switchTab({ - // url: '/pages/my/index' - // }) - }, - fail: function(err) { - // this.$queue.showToast('支付失败'); - uni.showToast({ - title: '支付失败', - icon: 'nones' - }); - that.getOrder() + } else if (that.openWay == 2) { //微信支付 + that.$queue.showLoading('支付中...') + // #ifdef MP-WEIXIN + let data = { + ordersId: that.tordersId, + type: 3 } - }); - } - }); - // #endif - - // #ifdef H5 - let ua = navigator.userAgent.toLowerCase(); - if (ua.indexOf('micromessenger') != -1) { - let data = { - ordersId: that.tordersId, - type: 2 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - that.showpay = false - if (rea.code == 0) { - that.callPay(rea.data); - that.showpayZ = false; - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) + that.$Request.post('/app/wxPay/payOrder', data).then(ret => { + console.log(ret) + if (ret.code == 0) { + uni.hideLoading(); + uni.requestPayment({ + provider: 'wxpay', + timeStamp: ret.data.timestamp, + nonceStr: ret.data.noncestr, + package: ret.data.package, + signType: ret.data.signType, + paySign: ret.data.sign, + success: function(ret) { + console.log(ret) + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + that.showpayZ = false; + // this.$queue.showToast('支付成功'); + + // uni.switchTab({ + // url: '/pages/my/index' + // }) + }, + fail: function(err) { + // this.$queue.showToast('支付失败'); + uni.showToast({ + title: '支付失败', + icon: 'nones' + }); + that.getOrder() + } + }); + } + }); + // #endif + + // #ifdef H5 + let ua = navigator.userAgent.toLowerCase(); + if (ua.indexOf('micromessenger') != -1) { + let data = { + ordersId: that.tordersId, + type: 2 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + that.showpayZ = false; + that.callPay(rea.data); + + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } else { + let data = { + ordersId: that.tordersId, + type: 4 + } + // debugger; + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + // const urlArr = window.location.href; + // const hostUrl = urlArr.split("/"); + // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + // const url = '&redirect_url=' + callBack + 'my/order/pay'; + // window.location = rea.mweb_url + url + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + that.showpayZ = false; + const urlArr = window.location.href; + const hostUrl = urlArr.split("/"); + const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + const url = '&redirect_url=' + callBack + 'my/order/pay'; + window.location = rea.data.mweb_url + url + + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } + + // #endif + + // #ifdef APP + let data = { + ordersId: that.tordersId, + type: 1 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + console.log(rea) + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + that.showpayZ = false; + that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); + + } + }); + // #endif + } else if (that.openWay == 3) { //支付宝支付 + that.$queue.showLoading('支付中...') + // #ifdef H5 + let data = { + ordersId: that.tordersId, + type: 2 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + that.showpayZ = false; + const div = document.createElement('div') + div.innerHTML = rea.data //此处form就是后台返回接收到的数据 + document.body.appendChild(div) + document.forms[0].submit() + + }); + // #endif + + // #ifdef APP-PLUS + let data = { + ordersId: that.tordersId, + type: 1 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + that.showpayZ = false; + that.setPayment('alipay', rea.data); + + }); + // #endif } - }); - } else { - let data = { - ordersId: that.tordersId, - type: 4 + + } else if (re.cancel) { + uni.hideLoading(); + console.log('用户点击取消'); } - // debugger; - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - // const urlArr = window.location.href; - // const hostUrl = urlArr.split("/"); - // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - // const url = '&redirect_url=' + callBack + 'my/order/pay'; - // window.location = rea.mweb_url + url - that.showpay = false - if (rea.code == 0) { - const urlArr = window.location.href; - const hostUrl = urlArr.split("/"); - const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - const url = '&redirect_url=' + callBack + 'my/order/pay'; - window.location = rea.data.mweb_url + url - that.showpayZ = false; - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) - } - }); } - - // #endif - - // #ifdef APP - let data = { - ordersId: that.tordersId, - type: 1 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - console.log(rea) - that.showpay = false - if (rea.code == 0) { - that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); - that.showpayZ = false; - } - }); - // #endif - } else if (that.openWay == 3) { //支付宝支付 - that.$queue.showLoading('支付中...') - // #ifdef H5 - let data = { - ordersId: that.tordersId, - type: 2 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - const div = document.createElement('div') - div.innerHTML = rea.data //此处form就是后台返回接收到的数据 - document.body.appendChild(div) - document.forms[0].submit() - that.showpayZ = false; - }); - // #endif - - // #ifdef APP-PLUS - let data = { - ordersId: that.tordersId, - type: 1 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - that.setPayment('alipay', rea.data); - that.showpayZ = false; - }); - // #endif - } + + }) + }, getTimeStampWithoutSeconds(date) { diff --git a/my/order/payding.vue b/my/order/payding.vue index f094813..8a1f57b 100644 --- a/my/order/payding.vue +++ b/my/order/payding.vue @@ -1000,19 +1000,14 @@ pay() { let that = this this.showpay = false - if (this.paySel != 0) { - this.payJZ(); - return; - } - if (that.openWay == 1) { //零钱支付 - console.log("that.order.sumMoney",that.order) - uni.showModal({ - title: '付款提示', - content: '确认支付' + that.order.sumMoney + '元吗?', - success: function(re) { - if (re.confirm) { - that.$queue.showLoading('支付中...') - console.log('用户点击确定'); + uni.showModal({ + title: '付款提示', + content: '确认支付' + that.order.payMoney + '元吗?', + success: function(re) { + if (re.confirm) { + that.$queue.showLoading('支付中...') + console.log('用户点击确定'); + if (that.openWay == 1) { //零钱支付 that.$Request.post("/app/artificer/payOrders", { ordersId: that.order.ordersId, }).then(res => { @@ -1032,161 +1027,187 @@ }) } }); - } else if (re.cancel) { - uni.hideLoading(); - console.log('用户点击取消'); - } - } - - }) - } else if (that.openWay == 2) { //微信支付 - that.$queue.showLoading('支付中...') - // #ifdef MP-WEIXIN - let data = { - ordersId: that.order.ordersId, - type: 3 - } - that.$Request.post('/app/wxPay/payOrder', data).then(ret => { - console.log(ret) - if (ret.code == 0) { - uni.hideLoading(); - uni.requestPayment({ - provider: 'wxpay', - timeStamp: ret.data.timestamp, - nonceStr: ret.data.noncestr, - package: ret.data.package, - signType: ret.data.signType, - paySign: ret.data.sign, - success: function(ret) { - console.log(ret) - uni.showToast({ - title: '支付成功', - icon: 'none' - }) - that.getOrder() - // this.$queue.showToast('支付成功'); - - uni.switchTab({ - url:'/pages/order/index' - }) - }, - fail: function(err) { - // this.$queue.showToast('支付失败'); - uni.showToast({ - title: '支付失败', - icon: 'nones' - }); - that.getOrder() + } else if (that.openWay == 2) { //微信支付 + that.$queue.showLoading('支付中...') + // #ifdef MP-WEIXIN + let data = { + ordersId: that.order.ordersId, + type: 3 } - }); - } - }); - // #endif - - // #ifdef H5 - let ua = navigator.userAgent.toLowerCase(); - if (ua.indexOf('micromessenger') != -1) { - let data = { - ordersId: that.order.ordersId, - type: 2 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - that.showpay = false - if (rea.code == 0) { - that.callPay(rea.data); - uni.switchTab({ - url:'/pages/order/index' - }) - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) - } - }); - } else { - let data = { - ordersId: that.order.ordersId, - type: 4 - } - // debugger; - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - // const urlArr = window.location.href; - // const hostUrl = urlArr.split("/"); - // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - // const url = '&redirect_url=' + callBack + 'my/order/pay'; - // window.location = rea.mweb_url + url - that.showpay = false - if (rea.code == 0) { - const urlArr = window.location.href; - const hostUrl = urlArr.split("/"); - const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - const url = '&redirect_url=' + callBack + 'my/order/pay'; - window.location = rea.data.mweb_url + url - uni.switchTab({ - url:'/pages/order/index' - }) - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) - } - }); - } - - // #endif - - // #ifdef APP - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - console.log(rea) - that.showpay = false - if (rea.code == 0) { + that.$Request.post('/app/wxPay/payOrder', data).then(ret => { + console.log(ret) + if (ret.code == 0) { + uni.hideLoading(); + uni.requestPayment({ + provider: 'wxpay', + timeStamp: ret.data.timestamp, + nonceStr: ret.data.noncestr, + package: ret.data.package, + signType: ret.data.signType, + paySign: ret.data.sign, + success: function(ret) { + console.log(ret) + uni.showToast({ + title: '支付成功', + icon: 'none' + }) + that.getOrder() + // this.$queue.showToast('支付成功'); - that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); - uni.switchTab({ - url:'/pages/order/index' - }) + uni.switchTab({ + url:'/pages/order/index' + }) + }, + fail: function(err) { + // this.$queue.showToast('支付失败'); + uni.showToast({ + title: '支付失败', + icon: 'nones' + }); + that.getOrder() + } + }); + } + }); + // #endif + + // #ifdef H5 + let ua = navigator.userAgent.toLowerCase(); + if (ua.indexOf('micromessenger') != -1) { + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + uni.switchTab({ + url:'/pages/order/index' + }) + that.callPay(rea.data); + + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } else { + let data = { + ordersId: that.order.ordersId, + type: 4 + } + // debugger; + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + // const urlArr = window.location.href; + // const hostUrl = urlArr.split("/"); + // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + // const url = '&redirect_url=' + callBack + 'my/order/pay'; + // window.location = rea.mweb_url + url + that.showpay = false; + + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + uni.switchTab({ + url:'/pages/order/index' + }) + const urlArr = window.location.href; + const hostUrl = urlArr.split("/"); + const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + const url = '&redirect_url=' + callBack + 'my/order/pay'; + window.location = rea.data.mweb_url + url + + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } + + // #endif + + // #ifdef APP + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + console.log(rea) + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + uni.switchTab({ + url:'/pages/order/index' + }) + that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); + + }else{ + uni.showToast({ + icon:'error', + title: '支付失败!' + }) + } + }); + // #endif + } else if (that.openWay == 3) { //支付宝支付 + that.$queue.showLoading('支付中...') + // #ifdef H5 + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + uni.switchTab({ + url:'/pages/order/index' + }) + const div = document.createElement('div') + div.innerHTML = rea.data //此处form就是后台返回接收到的数据 + document.body.appendChild(div) + document.forms[0].submit() + + }); + // #endif + + // #ifdef APP-PLUS + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + uni.switchTab({ + url:'/pages/order/index' + }) + that.setPayment('alipay', rea.data); + }); + // #endif + } + + } else if (re.cancel) { + uni.hideLoading(); + console.log('用户点击取消'); } - }); - // #endif - } else if (that.openWay == 3) { //支付宝支付 - that.$queue.showLoading('支付中...') - // #ifdef H5 - let data = { - ordersId: that.order.ordersId, - type: 2 } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - const div = document.createElement('div') - div.innerHTML = rea.data //此处form就是后台返回接收到的数据 - document.body.appendChild(div) - document.forms[0].submit() - uni.switchTab({ - url:'/pages/order/index' - }) - }); - // #endif - - // #ifdef APP-PLUS - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - that.setPayment('alipay', rea.data); - uni.switchTab({ - url:'/pages/order/index' - }) - }); - // #endif - } + + }) + }, callPay: function(response) { if (typeof WeixinJSBridge === "undefined") { diff --git a/my/order/paydingCi.vue b/my/order/paydingCi.vue index 43d3441..86d92fb 100644 --- a/my/order/paydingCi.vue +++ b/my/order/paydingCi.vue @@ -632,18 +632,18 @@ pay() { let that = this this.showpay = false - if (this.paySel != 0) { - this.payJZ(); - return; - } - if (that.openWay == 1) { //零钱支付 - uni.showModal({ - title: '付款提示', - content: '确认支付' + that.order.payMoney + '元吗?', - success: function(re) { - if (re.confirm) { - that.$queue.showLoading('支付中...') - console.log('用户点击确定'); + // if (this.paySel != 0) { + // this.payJZ(); + // return; + // } + uni.showModal({ + title: '付款提示', + content: '确认支付' + that.order.payMoney + '元吗?', + success: function(re) { + if (re.confirm) { + that.$queue.showLoading('支付中...') + console.log('用户点击确定'); + if (that.openWay == 1) { //零钱支付 that.$Request.post("/app/user/package/order/payOrder", { ordersId: that.ordersId, }).then(res => { @@ -663,145 +663,178 @@ }) } }); - } else if (re.cancel) { - uni.hideLoading(); - console.log('用户点击取消'); - } - } - - }) - } else if (that.openWay == 2) { //微信支付 - that.$queue.showLoading('支付中...') - // #ifdef MP-WEIXIN - let data = { - ordersId: that.order.ordersId, - type: 3 - } - that.$Request.post('/app/wxPay/payOrder', data).then(ret => { - console.log(ret) - if (ret.code == 0) { - uni.hideLoading(); - uni.requestPayment({ - provider: 'wxpay', - timeStamp: ret.data.timestamp, - nonceStr: ret.data.noncestr, - package: ret.data.package, - signType: ret.data.signType, - paySign: ret.data.sign, - success: function(ret) { - console.log(ret) - uni.showToast({ - title: '支付成功', - icon: 'none' - }) - that.getOrder() - // this.$queue.showToast('支付成功'); - - // uni.switchTab({ - // url: '/pages/my/index' - // }) - }, - fail: function(err) { - // this.$queue.showToast('支付失败'); - uni.showToast({ - title: '支付失败', - icon: 'nones' - }); - that.getOrder() + } else if (that.openWay == 2) { //微信支付 + that.$queue.showLoading('支付中...') + // #ifdef MP-WEIXIN + let data = { + ordersId: that.order.ordersId, + type: 3 } - }); - } - }); - // #endif - - // #ifdef H5 - let ua = navigator.userAgent.toLowerCase(); - if (ua.indexOf('micromessenger') != -1) { - let data = { - ordersId: that.order.ordersId, - type: 2 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - that.showpay = false - if (rea.code == 0) { - that.callPay(rea.data); - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) + that.$Request.post('/app/wxPay/payOrder', data).then(ret => { + console.log(ret) + if (ret.code == 0) { + uni.hideLoading(); + uni.requestPayment({ + provider: 'wxpay', + timeStamp: ret.data.timestamp, + nonceStr: ret.data.noncestr, + package: ret.data.package, + signType: ret.data.signType, + paySign: ret.data.sign, + success: function(ret) { + uni.showToast({ + title: '支付成功' + }) + uni.redirectTo({ + url:'/pages/my/indextaociliaoList?type='+105+'&name='+'index' + }) + that.getOrder() + // this.$queue.showToast('支付成功'); + + // uni.switchTab({ + // url: '/pages/my/index' + // }) + }, + fail: function(err) { + // this.$queue.showToast('支付失败'); + uni.showToast({ + title: '支付失败', + icon: 'nones' + }); + that.getOrder() + } + }); + } + }); + // #endif + + // #ifdef H5 + let ua = navigator.userAgent.toLowerCase(); + if (ua.indexOf('micromessenger') != -1) { + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + uni.redirectTo({ + url:'/pages/my/indextaociliaoList?type='+105+'&name='+'index' + }) + that.callPay(rea.data); + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } else { + let data = { + ordersId: that.order.ordersId, + type: 4 + } + // debugger; + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + // const urlArr = window.location.href; + // const hostUrl = urlArr.split("/"); + // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + // const url = '&redirect_url=' + callBack + 'my/order/pay'; + // window.location = rea.mweb_url + url + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + uni.redirectTo({ + url:'/pages/my/indextaociliaoList?type='+105+'&name='+'index' + }) + const urlArr = window.location.href; + const hostUrl = urlArr.split("/"); + const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + const url = '&redirect_url=' + callBack + 'my/order/pay'; + window.location = rea.data.mweb_url + url + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } + + // #endif + + // #ifdef APP + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + console.log(rea) + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + uni.redirectTo({ + url:'/pages/my/indextaociliaoList?type='+105+'&name='+'index' + }) + that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); + } + }); + // #endif + } else if (that.openWay == 3) { //支付宝支付 + that.$queue.showLoading('支付中...') + // #ifdef H5 + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + uni.redirectTo({ + url:'/pages/my/indextaociliaoList?type='+105+'&name='+'index' + }) + const div = document.createElement('div') + div.innerHTML = rea.data //此处form就是后台返回接收到的数据 + document.body.appendChild(div) + document.forms[0].submit() + }); + // #endif + + // #ifdef APP-PLUS + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + uni.redirectTo({ + url:'/pages/my/indextaociliaoList?type='+105+'&name='+'index' + }) + that.setPayment('alipay', rea.data); + }); + // #endif } - }); - } else { - let data = { - ordersId: that.order.ordersId, - type: 4 + + } else if (re.cancel) { + uni.hideLoading(); + console.log('用户点击取消'); } - // debugger; - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - // const urlArr = window.location.href; - // const hostUrl = urlArr.split("/"); - // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - // const url = '&redirect_url=' + callBack + 'my/order/pay'; - // window.location = rea.mweb_url + url - that.showpay = false - if (rea.code == 0) { - const urlArr = window.location.href; - const hostUrl = urlArr.split("/"); - const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - const url = '&redirect_url=' + callBack + 'my/order/pay'; - window.location = rea.data.mweb_url + url - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) - } - }); } - - // #endif - - // #ifdef APP - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - console.log(rea) - that.showpay = false - if (rea.code == 0) { - that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); - } - }); - // #endif - } else if (that.openWay == 3) { //支付宝支付 - that.$queue.showLoading('支付中...') - // #ifdef H5 - let data = { - ordersId: that.order.ordersId, - type: 2 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - const div = document.createElement('div') - div.innerHTML = rea.data //此处form就是后台返回接收到的数据 - document.body.appendChild(div) - document.forms[0].submit() - }); - // #endif - - // #ifdef APP-PLUS - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - that.setPayment('alipay', rea.data); - }); - // #endif - } + + }) + }, callPay: function(response) { if (typeof WeixinJSBridge === "undefined") { diff --git a/my/order/paydingDd.vue b/my/order/paydingDd.vue index 9e1c464..83f1929 100644 --- a/my/order/paydingDd.vue +++ b/my/order/paydingDd.vue @@ -1121,19 +1121,18 @@ pay() { let that = this this.showpay = false - if (this.paySel != 0) { - this.payJZ(); - return; - } - if (that.openWay == 1) { //零钱支付 - console.log("that.order.sumMoney",that.order) - uni.showModal({ - title: '付款提示', - content: '确认支付' + that.order.sumMoney + '元吗?', - success: function(re) { - if (re.confirm) { - that.$queue.showLoading('支付中...') - console.log('用户点击确定'); + // if (this.paySel != 0) { + // this.payJZ(); + // return; + // } + uni.showModal({ + title: '付款提示', + content: '确认支付' + that.order.payMoney + '元吗?', + success: function(re) { + if (re.confirm) { + that.$queue.showLoading('支付中...') + console.log('用户点击确定'); + if (that.openWay == 1) { //零钱支付 that.$Request.post("/app/artificer/payOrders", { ordersId: that.order.ordersId, }).then(res => { @@ -1142,10 +1141,11 @@ uni.showToast({ title: '支付成功' }) - that.getOrder() uni.switchTab({ url:'/pages/order/index' }) + that.getOrder() + } else { uni.showToast({ title: res.msg, @@ -1153,163 +1153,185 @@ }) } }); - } else if (re.cancel) { - uni.hideLoading(); - console.log('用户点击取消'); - } - } - - }) - } else if (that.openWay == 2) { //微信支付 - that.$queue.showLoading('支付中...') - // #ifdef MP-WEIXIN - let data = { - ordersId: that.order.ordersId, - type: 3 - } - that.$Request.post('/app/wxPay/payOrder', data).then(ret => { - console.log(ret) - if (ret.code == 0) { - uni.hideLoading(); - uni.requestPayment({ - provider: 'wxpay', - timeStamp: ret.data.timestamp, - nonceStr: ret.data.noncestr, - package: ret.data.package, - signType: ret.data.signType, - paySign: ret.data.sign, - success: function(ret) { - console.log(ret) - uni.showToast({ - title: '支付成功', - icon: 'none' - }) - that.getOrder() - uni.switchTab({ - url:'/pages/order/index' - }) - // this.$queue.showToast('支付成功'); - - // uni.switchTab({ - // url: '/pages/my/index' - // }) - }, - fail: function(err) { - // this.$queue.showToast('支付失败'); - uni.showToast({ - title: '支付失败', - icon: 'nones' - }); - that.getOrder() + } else if (that.openWay == 2) { //微信支付 + that.$queue.showLoading('支付中...') + // #ifdef MP-WEIXIN + let data = { + ordersId: that.order.ordersId, + type: 3 } - }); - } - }); - // #endif - - // #ifdef H5 - let ua = navigator.userAgent.toLowerCase(); - if (ua.indexOf('micromessenger') != -1) { - let data = { - ordersId: that.order.ordersId, - type: 2 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - that.showpay = false - if (rea.code == 0) { - that.callPay(rea.data); - uni.switchTab({ - url:'/pages/order/index' - }) - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) + that.$Request.post('/app/wxPay/payOrder', data).then(ret => { + console.log(ret) + if (ret.code == 0) { + uni.hideLoading(); + uni.requestPayment({ + provider: 'wxpay', + timeStamp: ret.data.timestamp, + nonceStr: ret.data.noncestr, + package: ret.data.package, + signType: ret.data.signType, + paySign: ret.data.sign, + success: function(ret) { + console.log(ret) + uni.showToast({ + title: '支付成功' + }) + uni.switchTab({ + url:'/pages/order/index' + }) + that.getOrder() + + // this.$queue.showToast('支付成功'); + + // uni.switchTab({ + // url: '/pages/my/index' + // }) + }, + fail: function(err) { + // this.$queue.showToast('支付失败'); + uni.showToast({ + title: '支付失败', + icon: 'nones' + }); + that.getOrder() + } + }); + } + }); + // #endif + + // #ifdef H5 + let ua = navigator.userAgent.toLowerCase(); + if (ua.indexOf('micromessenger') != -1) { + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + uni.switchTab({ + url:'/pages/order/index' + }) + that.callPay(rea.data); + + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } else { + let data = { + ordersId: that.order.ordersId, + type: 4 + } + // debugger; + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + // const urlArr = window.location.href; + // const hostUrl = urlArr.split("/"); + // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + // const url = '&redirect_url=' + callBack + 'my/order/pay'; + // window.location = rea.mweb_url + url + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + uni.switchTab({ + url:'/pages/order/index' + }) + const urlArr = window.location.href; + const hostUrl = urlArr.split("/"); + const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + const url = '&redirect_url=' + callBack + 'my/order/pay'; + window.location = rea.data.mweb_url + url + + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } + + // #endif + + // #ifdef APP + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + console.log(rea) + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + uni.switchTab({ + url:'/pages/order/index' + }) + that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); + + } + }); + // #endif + } else if (that.openWay == 3) { //支付宝支付 + that.$queue.showLoading('支付中...') + // #ifdef H5 + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + uni.switchTab({ + url:'/pages/order/index' + }) + const div = document.createElement('div') + div.innerHTML = rea.data //此处form就是后台返回接收到的数据 + document.body.appendChild(div) + document.forms[0].submit() + + }); + // #endif + + // #ifdef APP-PLUS + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + uni.switchTab({ + url:'/pages/order/index' + }) + that.setPayment('alipay', rea.data); + + }); + // #endif } - }); - } else { - let data = { - ordersId: that.order.ordersId, - type: 4 + + } else if (re.cancel) { + uni.hideLoading(); + console.log('用户点击取消'); } - // debugger; - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - // const urlArr = window.location.href; - // const hostUrl = urlArr.split("/"); - // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - // const url = '&redirect_url=' + callBack + 'my/order/pay'; - // window.location = rea.mweb_url + url - that.showpay = false - if (rea.code == 0) { - const urlArr = window.location.href; - const hostUrl = urlArr.split("/"); - const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - const url = '&redirect_url=' + callBack + 'my/order/pay'; - window.location = rea.data.mweb_url + url - uni.switchTab({ - url:'/pages/order/index' - }) - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) - } - }); } - - // #endif - - // #ifdef APP - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - console.log(rea) - that.showpay = false - if (rea.code == 0) { - that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); - uni.switchTab({ - url:'/pages/order/index' - }) - } - }); - // #endif - } else if (that.openWay == 3) { //支付宝支付 - that.$queue.showLoading('支付中...') - // #ifdef H5 - let data = { - ordersId: that.order.ordersId, - type: 2 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - const div = document.createElement('div') - div.innerHTML = rea.data //此处form就是后台返回接收到的数据 - document.body.appendChild(div) - document.forms[0].submit() - uni.switchTab({ - url:'/pages/order/index' - }) - }); - // #endif - - // #ifdef APP-PLUS - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - that.setPayment('alipay', rea.data); - uni.switchTab({ - url:'/pages/order/index' - }) - }); - // #endif - } + + }) + }, callPay: function(response) { if (typeof WeixinJSBridge === "undefined") { diff --git a/my/order/paydingLiao.vue b/my/order/paydingLiao.vue index df59ff9..993cccd 100644 --- a/my/order/paydingLiao.vue +++ b/my/order/paydingLiao.vue @@ -632,18 +632,18 @@ pay() { let that = this this.showpay = false - if (this.paySel != 0) { - this.payJZ(); - return; - } - if (that.openWay == 1) { //零钱支付 - uni.showModal({ - title: '付款提示', - content: '确认支付' + that.order.payMoney + '元吗?', - success: function(re) { - if (re.confirm) { - that.$queue.showLoading('支付中...') - console.log('用户点击确定'); + // if (this.paySel != 0) { + // this.payJZ(); + // return; + // } + uni.showModal({ + title: '付款提示', + content: '确认支付' + that.order.payMoney + '元吗?', + success: function(re) { + if (re.confirm) { + that.$queue.showLoading('支付中...') + console.log('用户点击确定'); + if (that.openWay == 1) { //零钱支付 that.$Request.post("/app/user/package/order/payOrder", { ordersId: that.ordersId, }).then(res => { @@ -663,145 +663,173 @@ }) } }); - } else if (re.cancel) { - uni.hideLoading(); - console.log('用户点击取消'); - } - } - - }) - } else if (that.openWay == 2) { //微信支付 - that.$queue.showLoading('支付中...') - // #ifdef MP-WEIXIN - let data = { - ordersId: that.order.ordersId, - type: 3 - } - that.$Request.post('/app/wxPay/payOrder', data).then(ret => { - console.log(ret) - if (ret.code == 0) { - uni.hideLoading(); - uni.requestPayment({ - provider: 'wxpay', - timeStamp: ret.data.timestamp, - nonceStr: ret.data.noncestr, - package: ret.data.package, - signType: ret.data.signType, - paySign: ret.data.sign, - success: function(ret) { - console.log(ret) - uni.showToast({ - title: '支付成功', - icon: 'none' - }) - that.getOrder() - // this.$queue.showToast('支付成功'); - - // uni.switchTab({ - // url: '/pages/my/index' - // }) - }, - fail: function(err) { - // this.$queue.showToast('支付失败'); - uni.showToast({ - title: '支付失败', - icon: 'nones' - }); - that.getOrder() + } else if (that.openWay == 2) { //微信支付 + that.$queue.showLoading('支付中...') + // #ifdef MP-WEIXIN + let data = { + ordersId: that.order.ordersId, + type: 3 } - }); - } - }); - // #endif - - // #ifdef H5 - let ua = navigator.userAgent.toLowerCase(); - if (ua.indexOf('micromessenger') != -1) { - let data = { - ordersId: that.order.ordersId, - type: 2 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - that.showpay = false - if (rea.code == 0) { - that.callPay(rea.data); - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) + that.$Request.post('/app/wxPay/payOrder', data).then(ret => { + console.log(ret) + if (ret.code == 0) { + uni.hideLoading(); + uni.requestPayment({ + provider: 'wxpay', + timeStamp: ret.data.timestamp, + nonceStr: ret.data.noncestr, + package: ret.data.package, + signType: ret.data.signType, + paySign: ret.data.sign, + success: function(ret) { + console.log(ret) + uni.showToast({ + title: '支付成功' + }) + uni.redirectTo({ + url:'/pages/my/indextaociliaoList?type='+106+'&name='+'index' + }) + }, + fail: function(err) { + // this.$queue.showToast('支付失败'); + uni.showToast({ + title: '支付失败', + icon: 'nones' + }); + that.getOrder() + } + }); + } + }); + // #endif + + // #ifdef H5 + let ua = navigator.userAgent.toLowerCase(); + if (ua.indexOf('micromessenger') != -1) { + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + uni.redirectTo({ + url:'/pages/my/indextaociliaoList?type='+106+'&name='+'index' + }) + that.callPay(rea.data); + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } else { + let data = { + ordersId: that.order.ordersId, + type: 4 + } + // debugger; + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + // const urlArr = window.location.href; + // const hostUrl = urlArr.split("/"); + // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + // const url = '&redirect_url=' + callBack + 'my/order/pay'; + // window.location = rea.mweb_url + url + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + uni.redirectTo({ + url:'/pages/my/indextaociliaoList?type='+106+'&name='+'index' + }) + const urlArr = window.location.href; + const hostUrl = urlArr.split("/"); + const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + const url = '&redirect_url=' + callBack + 'my/order/pay'; + window.location = rea.data.mweb_url + url + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } + + // #endif + + // #ifdef APP + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + console.log(rea) + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + uni.redirectTo({ + url:'/pages/my/indextaociliaoList?type='+106+'&name='+'index' + }) + that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); + } + }); + // #endif + } else if (that.openWay == 3) { //支付宝支付 + that.$queue.showLoading('支付中...') + // #ifdef H5 + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + uni.redirectTo({ + url:'/pages/my/indextaociliaoList?type='+106+'&name='+'index' + }) + const div = document.createElement('div') + div.innerHTML = rea.data //此处form就是后台返回接收到的数据 + document.body.appendChild(div) + document.forms[0].submit() + }); + // #endif + + // #ifdef APP-PLUS + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + uni.redirectTo({ + url:'/pages/my/indextaociliaoList?type='+106+'&name='+'index' + }) + that.setPayment('alipay', rea.data); + }); + // #endif } - }); - } else { - let data = { - ordersId: that.order.ordersId, - type: 4 + + } else if (re.cancel) { + uni.hideLoading(); + console.log('用户点击取消'); } - // debugger; - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - // const urlArr = window.location.href; - // const hostUrl = urlArr.split("/"); - // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - // const url = '&redirect_url=' + callBack + 'my/order/pay'; - // window.location = rea.mweb_url + url - that.showpay = false - if (rea.code == 0) { - const urlArr = window.location.href; - const hostUrl = urlArr.split("/"); - const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - const url = '&redirect_url=' + callBack + 'my/order/pay'; - window.location = rea.data.mweb_url + url - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) - } - }); } - - // #endif - - // #ifdef APP - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - console.log(rea) - that.showpay = false - if (rea.code == 0) { - that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); - } - }); - // #endif - } else if (that.openWay == 3) { //支付宝支付 - that.$queue.showLoading('支付中...') - // #ifdef H5 - let data = { - ordersId: that.order.ordersId, - type: 2 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - const div = document.createElement('div') - div.innerHTML = rea.data //此处form就是后台返回接收到的数据 - document.body.appendChild(div) - document.forms[0].submit() - }); - // #endif - - // #ifdef APP-PLUS - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - that.setPayment('alipay', rea.data); - }); - // #endif - } + + }) + }, callPay: function(response) { if (typeof WeixinJSBridge === "undefined") { diff --git a/my/order/paydingTCX.vue b/my/order/paydingTCX.vue index 9b3be5d..fcef045 100644 --- a/my/order/paydingTCX.vue +++ b/my/order/paydingTCX.vue @@ -999,18 +999,18 @@ pay() { let that = this this.showpay = false - if (this.paySel != 0) { - this.payJZ(); - return; - } - if (that.openWay == 1) { //零钱支付 - uni.showModal({ - title: '付款提示', - content: '确认支付' + that.order.taxiMoney + '元吗?', - success: function(re) { - if (re.confirm) { - that.$queue.showLoading('支付中...') - console.log('用户点击确定'); + // if (this.paySel != 0) { + // this.payJZ(); + // return; + // } + uni.showModal({ + title: '付款提示', + content: '确认支付' + that.order.taxiMoney + '元吗?', + success: function(re) { + if (re.confirm) { + that.$queue.showLoading('支付中...') + console.log('用户点击确定'); + if (that.openWay == 1) { //零钱支付 that.$Request.post("/app/artificer/payOrders", { ordersId: that.order.ordersId, userPackageDetailId : that.order.userPackageDetailId @@ -1031,175 +1031,200 @@ }) } }); - } else if (re.cancel) { - uni.hideLoading(); - console.log('用户点击取消'); - } - } - - }) - } else if (that.openWay == 2) { //微信支付 - that.$queue.showLoading('支付中...') - // #ifdef MP-WEIXIN - let data = { - ordersId: that.order.ordersId, - type: 3, - userPackageDetailId : that.order.userPackageDetailId - } - that.$Request.post('/app/wxPay/payOrder', data).then(ret => { - console.log(ret) - if (ret.code == 0) { - uni.hideLoading(); - uni.requestPayment({ - provider: 'wxpay', - timeStamp: ret.data.timestamp, - nonceStr: ret.data.noncestr, - package: ret.data.package, - signType: ret.data.signType, - paySign: ret.data.sign, - success: function(ret) { - console.log(ret) - uni.showToast({ - title: '支付成功', - icon: 'none' - }) - that.getOrder() - // this.$queue.showToast('支付成功'); - uni.switchTab({ - url:'/pages/order/index' - }) - }, - fail: function(err) { - uni.hideLoading(); - // this.$queue.showToast('支付失败'); - uni.showToast({ - title: '支付失败', - icon: 'nones' - }); - that.getOrder() + } else if (that.openWay == 2) { //微信支付 + that.$queue.showLoading('支付中...') + // #ifdef MP-WEIXIN + let data = { + ordersId: that.order.ordersId, + type: 3, + userPackageDetailId : that.order.userPackageDetailId } - }); - } - }); - // #endif - - // #ifdef H5 - let ua = navigator.userAgent.toLowerCase(); - if (ua.indexOf('micromessenger') != -1) { - let data = { - ordersId: that.order.ordersId, - type: 2, - userPackageDetailId : that.order.userPackageDetailId - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - that.showpay = false - if (rea.code == 0) { - uni.hideLoading(); - that.callPay(rea.data); - uni.switchTab({ - url:'/pages/order/index' - }) - } else { - uni.hideLoading(); - uni.showToast({ - title: rea.msg, - icon: 'none' - }) + that.$Request.post('/app/wxPay/payOrder', data).then(ret => { + console.log(ret) + if (ret.code == 0) { + uni.hideLoading(); + uni.requestPayment({ + provider: 'wxpay', + timeStamp: ret.data.timestamp, + nonceStr: ret.data.noncestr, + package: ret.data.package, + signType: ret.data.signType, + paySign: ret.data.sign, + success: function(ret) { + console.log(ret) + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + uni.switchTab({ + url:'/pages/order/index' + }) + }, + fail: function(err) { + uni.hideLoading(); + // this.$queue.showToast('支付失败'); + uni.showToast({ + title: '支付失败', + icon: 'nones' + }); + that.getOrder() + } + }); + } + }); + // #endif + + // #ifdef H5 + let ua = navigator.userAgent.toLowerCase(); + if (ua.indexOf('micromessenger') != -1) { + let data = { + ordersId: that.order.ordersId, + type: 2, + userPackageDetailId : that.order.userPackageDetailId + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + that.showpay = false + if (rea.code == 0) { + uni.hideLoading(); + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + uni.switchTab({ + url:'/pages/order/index' + }) + that.callPay(rea.data); + + } else { + uni.hideLoading(); + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } else { + let data = { + ordersId: that.order.ordersId, + type: 4, + userPackageDetailId : that.order.userPackageDetailId + } + // debugger; + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + // const urlArr = window.location.href; + // const hostUrl = urlArr.split("/"); + // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + // const url = '&redirect_url=' + callBack + 'my/order/pay'; + // window.location = rea.mweb_url + url + that.showpay = false + if (rea.code == 0) { + uni.hideLoading(); + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + uni.switchTab({ + url:'/pages/order/index' + }) + const urlArr = window.location.href; + const hostUrl = urlArr.split("/"); + const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + const url = '&redirect_url=' + callBack + 'my/order/pay'; + window.location = rea.data.mweb_url + url + + } else { + uni.hideLoading(); + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } + + // #endif + + // #ifdef APP + let data = { + ordersId: that.order.ordersId, + type: 1, + userPackageDetailId : that.order.userPackageDetailId + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + console.log(rea) + that.showpay = false + if (rea.code == 0) { + uni.hideLoading(); + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + uni.switchTab({ + url:'/pages/order/index' + }) + that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); + + }else{ + uni.hideLoading(); + } + }); + // #endif + } else if (that.openWay == 3) { //支付宝支付 + that.$queue.showLoading('支付中...') + // #ifdef H5 + let data = { + ordersId: that.order.ordersId, + type: 2, + userPackageDetailId : that.order.userPackageDetailId + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.hideLoading(); + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + uni.switchTab({ + url:'/pages/order/index' + }) + const div = document.createElement('div') + div.innerHTML = rea.data //此处form就是后台返回接收到的数据 + document.body.appendChild(div) + document.forms[0].submit() + + }); + // #endif + + // #ifdef APP-PLUS + let data = { + ordersId: that.order.ordersId, + type: 1, + userPackageDetailId : that.order.userPackageDetailId + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.hideLoading(); + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + uni.switchTab({ + url:'/pages/order/index' + }) + that.setPayment('alipay', rea.data); + + }); + // #endif } - }); - } else { - let data = { - ordersId: that.order.ordersId, - type: 4, - userPackageDetailId : that.order.userPackageDetailId + + } else if (re.cancel) { + uni.hideLoading(); + console.log('用户点击取消'); } - // debugger; - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - // const urlArr = window.location.href; - // const hostUrl = urlArr.split("/"); - // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - // const url = '&redirect_url=' + callBack + 'my/order/pay'; - // window.location = rea.mweb_url + url - that.showpay = false - if (rea.code == 0) { - uni.hideLoading(); - const urlArr = window.location.href; - const hostUrl = urlArr.split("/"); - const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - const url = '&redirect_url=' + callBack + 'my/order/pay'; - window.location = rea.data.mweb_url + url - uni.switchTab({ - url:'/pages/order/index' - }) - } else { - uni.hideLoading(); - uni.showToast({ - title: rea.msg, - icon: 'none' - }) - } - }); } - - // #endif - - // #ifdef APP - let data = { - ordersId: that.order.ordersId, - type: 1, - userPackageDetailId : that.order.userPackageDetailId - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - console.log(rea) - that.showpay = false - if (rea.code == 0) { - uni.hideLoading(); - that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); - uni.switchTab({ - url:'/pages/order/index' - }) - }else{ - uni.hideLoading(); - } - }); - // #endif - } else if (that.openWay == 3) { //支付宝支付 - that.$queue.showLoading('支付中...') - // #ifdef H5 - let data = { - ordersId: that.order.ordersId, - type: 2, - userPackageDetailId : that.order.userPackageDetailId - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - uni.hideLoading(); - const div = document.createElement('div') - div.innerHTML = rea.data //此处form就是后台返回接收到的数据 - document.body.appendChild(div) - document.forms[0].submit() - uni.switchTab({ - url:'/pages/order/index' - }) - }); - // #endif - - // #ifdef APP-PLUS - let data = { - ordersId: that.order.ordersId, - type: 1, - userPackageDetailId : that.order.userPackageDetailId - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - uni.hideLoading(); - that.setPayment('alipay', rea.data); - uni.switchTab({ - url:'/pages/order/index' - }) - }); - // #endif - } + + }) + }, //支付选择 diff --git a/my/order/paydingTc.vue b/my/order/paydingTc.vue index 8f2ef3f..12771b7 100644 --- a/my/order/paydingTc.vue +++ b/my/order/paydingTc.vue @@ -694,18 +694,14 @@ pay() { let that = this this.showpay = false - if (this.paySel != 0) { - this.payJZ(); - return; - } - if (that.openWay == 1) { //零钱支付 - uni.showModal({ - title: '付款提示', - content: '确认支付' + that.order.payMoney + '元吗?', - success: function(re) { - if (re.confirm) { - that.$queue.showLoading('支付中...') - console.log('用户点击确定'); + uni.showModal({ + title: '付款提示', + content: '确认支付' + that.order.payMoney + '元吗?', + success: function(re) { + if (re.confirm) { + that.$queue.showLoading('支付中...') + console.log('用户点击确定'); + if (that.openWay == 1) { //零钱支付 that.$Request.post("/app/user/package/order/payOrder", { ordersId: that.ordersId, }).then(res => { @@ -725,145 +721,175 @@ }) } }); - } else if (re.cancel) { - uni.hideLoading(); - console.log('用户点击取消'); - } - } - - }) - } else if (that.openWay == 2) { //微信支付 - that.$queue.showLoading('支付中...') - // #ifdef MP-WEIXIN - let data = { - ordersId: that.order.ordersId, - type: 3 - } - that.$Request.post('/app/wxPay/payOrder', data).then(ret => { - console.log(ret) - if (ret.code == 0) { - uni.hideLoading(); - uni.requestPayment({ - provider: 'wxpay', - timeStamp: ret.data.timestamp, - nonceStr: ret.data.noncestr, - package: ret.data.package, - signType: ret.data.signType, - paySign: ret.data.sign, - success: function(ret) { - console.log(ret) - uni.showToast({ - title: '支付成功', - icon: 'none' - }) - that.getOrder() - // this.$queue.showToast('支付成功'); - - // uni.switchTab({ - // url: '/pages/my/index' - // }) - }, - fail: function(err) { - // this.$queue.showToast('支付失败'); - uni.showToast({ - title: '支付失败', - icon: 'nones' - }); - that.getOrder() + } else if (that.openWay == 2) { //微信支付 + that.$queue.showLoading('支付中...') + // #ifdef MP-WEIXIN + let data = { + ordersId: that.order.ordersId, + type: 3 } - }); - } - }); - // #endif - - // #ifdef H5 - let ua = navigator.userAgent.toLowerCase(); - if (ua.indexOf('micromessenger') != -1) { - let data = { - ordersId: that.order.ordersId, - type: 2 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - that.showpay = false - if (rea.code == 0) { - that.callPay(rea.data); - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) + that.$Request.post('/app/wxPay/payOrder', data).then(ret => { + console.log(ret) + if (ret.code == 0) { + uni.hideLoading(); + uni.requestPayment({ + provider: 'wxpay', + timeStamp: ret.data.timestamp, + nonceStr: ret.data.noncestr, + package: ret.data.package, + signType: ret.data.signType, + paySign: ret.data.sign, + success: function(ret) { + console.log(ret) + uni.showToast({ + title: '支付成功' + }) + uni.redirectTo({ + url:'/pages/my/indextaociliaoList?type='+that.orderXm.type+'&name='+'index' + }) + // this.$queue.showToast('支付成功'); + + // uni.switchTab({ + // url: '/pages/my/index' + // }) + }, + fail: function(err) { + // this.$queue.showToast('支付失败'); + uni.showToast({ + title: '支付失败', + icon: 'nones' + }); + that.getOrder() + } + }); + } + }); + // #endif + + // #ifdef H5 + let ua = navigator.userAgent.toLowerCase(); + if (ua.indexOf('micromessenger') != -1) { + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + uni.redirectTo({ + url:'/pages/my/indextaociliaoList?type='+that.orderXm.type+'&name='+'index' + }) + that.callPay(rea.data); + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } else { + let data = { + ordersId: that.order.ordersId, + type: 4 + } + // debugger; + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + // const urlArr = window.location.href; + // const hostUrl = urlArr.split("/"); + // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + // const url = '&redirect_url=' + callBack + 'my/order/pay'; + // window.location = rea.mweb_url + url + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + uni.redirectTo({ + url:'/pages/my/indextaociliaoList?type='+that.orderXm.type+'&name='+'index' + }) + const urlArr = window.location.href; + const hostUrl = urlArr.split("/"); + const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + const url = '&redirect_url=' + callBack + 'my/order/pay'; + window.location = rea.data.mweb_url + url + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } + + // #endif + + // #ifdef APP + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + console.log(rea) + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + uni.redirectTo({ + url:'/pages/my/indextaociliaoList?type='+that.orderXm.type+'&name='+'index' + }) + that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); + } + }); + // #endif + } else if (that.openWay == 3) { //支付宝支付 + that.$queue.showLoading('支付中...') + // #ifdef H5 + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + uni.redirectTo({ + url:'/pages/my/indextaociliaoList?type='+that.orderXm.type+'&name='+'index' + }) + const div = document.createElement('div') + div.innerHTML = rea.data //此处form就是后台返回接收到的数据 + document.body.appendChild(div) + document.forms[0].submit() + }); + // #endif + + // #ifdef APP-PLUS + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + uni.redirectTo({ + url:'/pages/my/indextaociliaoList?type='+that.orderXm.type+'&name='+'index' + }) + that.setPayment('alipay', rea.data); + }); + // #endif } - }); - } else { - let data = { - ordersId: that.order.ordersId, - type: 4 + + } else if (re.cancel) { + uni.hideLoading(); + console.log('用户点击取消'); } - // debugger; - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - // const urlArr = window.location.href; - // const hostUrl = urlArr.split("/"); - // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - // const url = '&redirect_url=' + callBack + 'my/order/pay'; - // window.location = rea.mweb_url + url - that.showpay = false - if (rea.code == 0) { - const urlArr = window.location.href; - const hostUrl = urlArr.split("/"); - const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - const url = '&redirect_url=' + callBack + 'my/order/pay'; - window.location = rea.data.mweb_url + url - } else { - uni.showToast({ - title: rea.msg, - icon: 'none' - }) - } - }); } - - // #endif - - // #ifdef APP - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/wxPay/payOrder', data).then(rea => { - console.log(rea) - that.showpay = false - if (rea.code == 0) { - that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); - } - }); - // #endif - } else if (that.openWay == 3) { //支付宝支付 - that.$queue.showLoading('支付中...') - // #ifdef H5 - let data = { - ordersId: that.order.ordersId, - type: 2 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - const div = document.createElement('div') - div.innerHTML = rea.data //此处form就是后台返回接收到的数据 - document.body.appendChild(div) - document.forms[0].submit() - }); - // #endif - - // #ifdef APP-PLUS - let data = { - ordersId: that.order.ordersId, - type: 1 - } - that.$Request.post('/app/aliPay/payOrder', data).then( - rea => { - that.setPayment('alipay', rea.data); - }); - // #endif - } + + }) + }, callPay: function(response) { if (typeof WeixinJSBridge === "undefined") { diff --git a/my/order/paydingXiuGai.vue b/my/order/paydingXiuGai.vue index 4781bd5..325cd74 100644 --- a/my/order/paydingXiuGai.vue +++ b/my/order/paydingXiuGai.vue @@ -1144,19 +1144,18 @@ pay() { let that = this this.showpay = false - if (this.paySel != 0) { - this.payJZ(); - return; - } - if (that.openWay == 1) { //零钱支付 - console.log("that.order.sumMoney",that.order) - uni.showModal({ - title: '付款提示', - content: '确认支付' + that.order.sumMoney + '元吗?', - success: function(re) { - if (re.confirm) { - that.$queue.showLoading('支付中...') - console.log('用户点击确定'); + // if (this.paySel != 0) { + // this.payJZ(); + // return; + // } + uni.showModal({ + title: '付款提示', + content: '确认支付' + that.order.sumMoney + '元吗?', + success: function(re) { + if (re.confirm) { + that.$queue.showLoading('支付中...') + console.log('用户点击确定'); + if (that.openWay == 1) { //零钱支付 that.$Request.post("/app/artificer/payOrders", { ordersId: that.order.ordersId, }).then(res => { @@ -1165,6 +1164,9 @@ uni.showToast({ title: '支付成功' }) + uni.switchTab({ + url:'/pages/order/index' + }) that.getOrder() } else { uni.showToast({ @@ -1173,13 +1175,189 @@ }) } }); - } else if (re.cancel) { - uni.hideLoading(); - console.log('用户点击取消'); + } else if (that.openWay == 2) { //微信支付 + that.$queue.showLoading('支付中...') + // #ifdef MP-WEIXIN + let data = { + ordersId: that.order.ordersId, + type: 3 + } + that.$Request.post('/app/wxPay/payOrder', data).then(ret => { + console.log(ret) + if (ret.code == 0) { + uni.hideLoading(); + uni.requestPayment({ + provider: 'wxpay', + timeStamp: ret.data.timestamp, + nonceStr: ret.data.noncestr, + package: ret.data.package, + signType: ret.data.signType, + paySign: ret.data.sign, + success: function(ret) { + console.log(ret) + uni.showToast({ + title: '支付成功' + }) + uni.switchTab({ + url:'/pages/order/index' + }) + that.getOrder() + // this.$queue.showToast('支付成功'); + + // uni.switchTab({ + // url: '/pages/my/index' + // }) + }, + fail: function(err) { + // this.$queue.showToast('支付失败'); + uni.showToast({ + title: '支付失败', + icon: 'nones' + }); + that.getOrder() + } + }); + } + }); + // #endif + + // #ifdef H5 + let ua = navigator.userAgent.toLowerCase(); + if (ua.indexOf('micromessenger') != -1) { + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + uni.switchTab({ + url:'/pages/order/index' + }) + that.callPay(rea.data); + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } else { + let data = { + ordersId: that.order.ordersId, + type: 4 + } + // debugger; + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + // const urlArr = window.location.href; + // const hostUrl = urlArr.split("/"); + // const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + // const url = '&redirect_url=' + callBack + 'my/order/pay'; + // window.location = rea.mweb_url + url + that.showpay = false + if (rea.code == 0) { + uni.showToast({ + title: '支付成功' + }) + uni.switchTab({ + url:'/pages/order/index' + }) + const urlArr = window.location.href; + const hostUrl = urlArr.split("/"); + const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + const url = '&redirect_url=' + callBack + 'my/order/pay'; + window.location = rea.data.mweb_url + url + } else { + uni.showToast({ + title: rea.msg, + icon: 'none' + }) + } + }); + } + + // #endif + + // #ifdef APP + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/wxPay/payOrder', data).then(rea => { + console.log(rea) + that.showpay = false + if (rea.code == 0) { + that.isCheckPay(rea.code, 'wxpay', JSON.stringify(rea.data)); + } + }); + // #endif + } else if (that.openWay == 3) { //支付宝支付 + that.$queue.showLoading('支付中...') + // #ifdef H5 + let data = { + ordersId: that.order.ordersId, + type: 2 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + uni.switchTab({ + url:'/pages/order/index' + }) + const div = document.createElement('div') + div.innerHTML = rea.data //此处form就是后台返回接收到的数据 + document.body.appendChild(div) + document.forms[0].submit() + }); + // #endif + + // #ifdef APP-PLUS + let data = { + ordersId: that.order.ordersId, + type: 1 + } + that.$Request.post('/app/aliPay/payOrder', data).then( + rea => { + uni.showToast({ + title: '支付成功' + }) + uni.switchTab({ + url:'/pages/order/index' + }) + that.setPayment('alipay', rea.data); + }); + // #endif } + + } else if (re.cancel) { + uni.hideLoading(); + console.log('用户点击取消'); } - - }) + } + + }) + if (that.openWay == 1) { //零钱支付 + that.$Request.post("/app/artificer/payOrders", { + ordersId: that.order.ordersId, + }).then(res => { + uni.hideLoading(); + if (res.code == 0) { + uni.showToast({ + title: '支付成功' + }) + that.getOrder() + } else { + uni.showToast({ + title: res.msg, + icon: 'none' + }) + } + }); } else if (that.openWay == 2) { //微信支付 that.$queue.showLoading('支付中...') // #ifdef MP-WEIXIN @@ -1312,6 +1490,7 @@ }); // #endif } + }, callPay: function(response) { if (typeof WeixinJSBridge === "undefined") { diff --git a/pages/therapist/therapistDingdan.vue b/pages/therapist/therapistDingdan.vue index 94060a4..3cbb293 100644 --- a/pages/therapist/therapistDingdan.vue +++ b/pages/therapist/therapistDingdan.vue @@ -10,9 +10,6 @@ - @@ -24,16 +21,6 @@ - - - - @@ -55,7 +42,7 @@ - + {{ item.distance }} @@ -105,127 +92,6 @@ - - -
 
- -
- - - - - - - - - - - - - - - - - - - {{ getOrderByCurrentMarkerIndex().artificerName }} - - - - {{getOrderByCurrentMarkerIndex().state == 1?"可服务":getOrderByCurrentMarkerIndex().state == 2?"今日可约":"休息中"}} - - {{ getOrderByCurrentMarkerIndex().time}} - - - - - - - - - - - - - 评论 - - {{ getOrderByCurrentMarkerIndex().commentCount ? getOrderByCurrentMarkerIndex().commentCount : 0 }} - - - - - 收藏 - - {{ getOrderByCurrentMarkerIndex().collectCount ? getOrderByCurrentMarkerIndex().collectCount : 0 }} - - - - - - - - {{getOrderByCurrentMarkerIndex().consortiaName}} - - - - - {{ getOrderByCurrentMarkerIndex().distance }} - - - - - 确认 - - - 确认 - - - - - - - -
- - - - - {{ - tpCount }}人已投票 - 投票 - 已投票 - - -
@@ -460,9 +326,6 @@ this.initMap(); //this.initMapPointThread(); }, - onUnload() { - //this.closeSocket(); - }, methods: { // 跳转订单 goOrder(e) { @@ -709,25 +572,7 @@ } }); }, - // selectCity(longitude, latitude) { - // this.$Request.get('/app/Login/selectCity?lat=' + latitude + '&lng=' + longitude).then(res => { - // if (res.code == 0) { - // // this.city = res.data.city ? res.data.city : '未知' - // // uni.setStorageSync('city', res.data.city) - // let data = { - // num: 1, - // size: 10 - // } - // this.getData(data) - // } - // }); - // }, - tanChange(index, item) { - this.orderIndex = index - this.tabIndex = item.id - this.page = 1 - this.getlist() - }, + // 开启订阅消息 openMsg() { console.log('订阅消息') @@ -793,13 +638,6 @@ this.getlist() }, getlist() { - // if (this.city === '请选择城市') { - // return; - // } - // if (this.tabIndex == 0) { - // return; - // } - // let index = this.list[this.listIndex].id let index = 2 let data = { // id: curTab, @@ -837,22 +675,6 @@ } else { this.orderList = [...this.orderList, ...res.data.list] } - //加载到地图里 - if (this.amap) { - // debugger; - console.log(this.orderList) - if (this.orderList.length > 0) { - let rmap = {}; - let onLineArtificerList = this.orderList.filter((item) => item.status == 1); - onLineArtificerList.forEach(x => { - rmap[x.userId] = x.latitude + ',' + x.longitude; //没有给个签到坐标 - }); - console.log('在orderList初始化:', JSON.parse(JSON.stringify(rmap))); - this.pointMap = rmap; - this.creatMarker(rmap); - } - } - } uni.stopPullDownRefresh(); })