From 91cf5ce400a69e5ba7927818d184df9d424947f0 Mon Sep 17 00:00:00 2001 From: "Mr.jiang" <714156421@qq.com> Date: Wed, 3 Jul 2024 09:21:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/config.js | 12 +- my/wallet/index.vue | 393 +++++++++++++++++++++------------------- pages.json | 11 +- pages/index/index.vue | 38 +++- pages/my/fuwuxiangm.vue | 20 +- pages/my/index.vue | 2 +- 6 files changed, 265 insertions(+), 211 deletions(-) diff --git a/common/config.js b/common/config.js index 316c71b..fa5d13f 100644 --- a/common/config.js +++ b/common/config.js @@ -1,10 +1,10 @@ -// const ROOTPATH = "http://120.46.52.165/sqx_fast"; -// const ROOTPATH1 = "http://120.46.52.165/sqx_fast"; -// const ROOTPATH3 = "wss://120.46.52.165/wss/websocket/"; +const ROOTPATH = "http://120.46.52.165/sqx_fast"; +const ROOTPATH1 = "http://120.46.52.165/sqx_fast"; +const ROOTPATH3 = "wss://120.46.52.165/wss/websocket/"; -const ROOTPATH3 = "wss://192.168.2.222:8187/wss/websocket/"; -const ROOTPATH = "http://192.168.2.222:8187/sqx_fast"; -const ROOTPATH1 = "http://192.168.2.222:8187/sqx_fast"; +// const ROOTPATH3 = "wss://192.168.2.222:8187/wss/websocket/"; +// const ROOTPATH = "http://192.168.2.222:8187/sqx_fast"; +// const ROOTPATH1 = "http://192.168.2.222:8187/sqx_fast"; // const ROOTPATH3 = "wss://1.92.152.160/wss/websocket/"; // const ROOTPATH = "http://1.92.152.160/sqx_fast"; diff --git a/my/wallet/index.vue b/my/wallet/index.vue index 0e4fc3a..68b69e9 100644 --- a/my/wallet/index.vue +++ b/my/wallet/index.vue @@ -344,7 +344,11 @@ couponId:'', artificerId:'', artificerIdMy:false, - ordersId:'' + ordersId:'', + getJishi:[], + textMoney:'', + getList:[], + activeMoney:'' } }, onLoad(d) { @@ -362,13 +366,17 @@ } else { this.tabIndex = 0; } - + this.getList=d; this.wxTxSel = this.$queue.getData('wxTxSel'); this.ylTxSel = this.$queue.getData('ylTxSel'); this.jsczSel = this.$queue.getData('jsczSel'); this.txMsg = this.$queue.getData('txMsg'); this.avatar = uni.getStorageSync('avatar') - this.renzheng = uni.getStorageSync("renzheng") + this.renzheng = uni.getStorageSync("renzheng"); + this.getJishi=this.$queue.getData('getJishi'); + + + console.log('this.getJishi',this.getJishi) this.nameTxt=d.text; this.ordersId=d.ordersId this.getMoneyList(); @@ -573,7 +581,7 @@ }) }, active(e) { - console.log("sadsadsadsadsad",e) + this.activeMoney=e.price this.wallet.forEach(res => { if (res.payClassifyId == e.payClassifyId) { res.isSelect = true @@ -597,183 +605,201 @@ }, pay() { - if (this.openWay == 2) { - // #ifdef APP-PLUS - // 微信APP支付 根据订单id获取支付信息 - let data = { - payClassifyId: this.thisSelect.payClassifyId, - type: 1, - userId: uni.getStorageSync('userId'), - } - if(this.artificerId){ - data.artificerId=this.artificerId - } - if(this.ordersId){ - data.ordersId=this.ordersId - } - this.$Request.post("/app/wxPay/payMoney", data).then(ret => { - console.log(ret) - this.isCheckPay(ret.code, 'wxpay', JSON.stringify(ret.data)); - }); - // #endif - - // #ifdef MP-WEIXIN - // 微信小程序支付 - let data = { - payClassifyId: this.thisSelect.payClassifyId, - type: 3, - userId: uni.getStorageSync('userId') - } - if(this.artificerId){ - data.artificerId=this.artificerId - } - if(this.ordersId){ - data.ordersId=this.ordersId - } - this.$Request.post('/app/wxPay/payMoney', data).then(ret => { - 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(suc) { - console.log('success:' + JSON.stringify(suc)); - uni.showToast({ - title: '支付成功', - icon: 'success' - }) - this.getMoney() - setTimeout(d => { - uni.navigateBack(1) - }, 1000); - }, - fail: function(err) { - console.log('fail:' + JSON.stringify(err)); - uni.showToast({ - title: '支付失败', - icon: 'none' - }) - } - }); - }); - // #endif - - // #ifdef H5 - let ua = navigator.userAgent.toLowerCase(); - if (ua.indexOf('micromessenger') !== -1) { - let data = { - payClassifyId: this.thisSelect.payClassifyId, - type: 2, - userId: uni.getStorageSync('userId') - } - if(this.artificerId){ - data.artificerId=this.artificerId - } - if(this.ordersId){ - data.ordersId=this.ordersId - } - this.$Request.post('/app/wxPay/payMoney', data).then(res => { - if (res.code == 0) { - this.callPay(res.data); - this.getMoney() - } else { - uni.showToast({ - icon: 'none', - title: '支付失败!' - }); - } - }); - } else { - let data = { - payClassifyId: this.thisSelect.payClassifyId, - type: 4, - userId: uni.getStorageSync('userId') - } - if(this.artificerId){ - data.artificerId=this.artificerId - } - if(this.ordersId){ - data.ordersId=this.ordersId - } - this.$Request.post('/app/wxPay/payMoney', data).then(res => { - if (res.code == 0) { - const urlArr = window.location.href; - const hostUrl = urlArr.split("/"); - const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; - const url = '&redirect_url=' + callBack + 'my/wallet/index'; - window.location = res.data.mweb_url + url - this.getMoney() - } else { - uni.showToast({ - icon: 'none', - title: '支付失败!' - }); - } - }); - } - // #endif - - } else { - // #ifdef H5 - let data = { - payClassifyId: this.thisSelect.payClassifyId, - type: 2, - userId: uni.getStorageSync('userId'), - } - if(this.artificerId){ - data.artificerId=this.artificerId - } - if(this.ordersId){ - data.ordersId=this.ordersId - } - - this.$Request.post('/app/aliPay/payOrderMoney', data).then( - res => { - if (res.code == 0) { - uni.showToast({ - title: '支付成功!' - }); - this.getMoney() - // const div = document.createElement('div') - // div.innerHTML = res.data //此处form就是后台返回接收到的数据 - // document.body.appendChild(div) - // document.forms[0].submit() - - // setTimeout(d => { - // uni.navigateBack(1) - // }, 1000); - } else { - uni.showToast({ - icon: 'none', - title: '支付失败!' - }); - } - }); - // #endif - // #ifdef APP-PLUS - // APP支付宝支付 - let data = { - payClassifyId: this.thisSelect.payClassifyId, - type: 1, - userId: uni.getStorageSync('userId') - } - if(this.artificerId){ - data.artificerId=this.artificerId - } - if(this.ordersId){ - data.ordersId=this.ordersId - } - this.$Request.post("/app/aliPay/payOrderMoney", data).then(ret => { - console.log(ret) - this.getMoney() - this.isCheckPay(ret.code, 'alipay', ret.data); - }); - // #endif + var that=this; + if(that.getList.text=='my'&&that.getList.artificerId){ + that.textMoney='是否确定为技师'+ that.getJishi.artificerName +'充值'+'吗?' + }else{ + that.textMoney='是否确定为充值!' } - + uni.showModal({ + title: '提示', + content: that.textMoney, + success: function(res) { + if (res.confirm) { + console.log('用户点击确定'); + if (that.openWay == 2) { + // #ifdef APP-PLUS + // 微信APP支付 根据订单id获取支付信息 + let data = { + payClassifyId: that.thisSelect.payClassifyId, + type: 1, + userId: uni.getStorageSync('userId'), + } + if(that.artificerId){ + data.artificerId=that.artificerId + } + if(that.ordersId){ + data.ordersId=that.ordersId + } + that.$Request.post("/app/wxPay/payMoney", data).then(ret => { + console.log(ret) + that.isCheckPay(ret.code, 'wxpay', JSON.stringify(ret.data)); + }); + // #endif + + // #ifdef MP-WEIXIN + // 微信小程序支付 + let data = { + payClassifyId: that.thisSelect.payClassifyId, + type: 3, + userId: uni.getStorageSync('userId') + } + if(that.artificerId){ + data.artificerId=that.artificerId + } + if(that.ordersId){ + data.ordersId=that.ordersId + } + that.$Request.post('/app/wxPay/payMoney', data).then(ret => { + 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(suc) { + console.log('success:' + JSON.stringify(suc)); + uni.showToast({ + title: '支付成功', + icon: 'success' + }) + that.getMoney() + setTimeout(d => { + uni.navigateBack(1) + }, 1000); + }, + fail: function(err) { + console.log('fail:' + JSON.stringify(err)); + uni.showToast({ + title: '支付失败', + icon: 'none' + }) + } + }); + }); + // #endif + + // #ifdef H5 + let ua = navigator.userAgent.toLowerCase(); + if (ua.indexOf('micromessenger') !== -1) { + let data = { + payClassifyId: that.thisSelect.payClassifyId, + type: 2, + userId: uni.getStorageSync('userId') + } + if(that.artificerId){ + data.artificerId=that.artificerId + } + if(that.ordersId){ + data.ordersId=that.ordersId + } + that.$Request.post('/app/wxPay/payMoney', data).then(res => { + if (res.code == 0) { + that.callPay(res.data); + that.getMoney() + } else { + uni.showToast({ + icon: 'none', + title: '支付失败!' + }); + } + }); + } else { + let data = { + payClassifyId: that.thisSelect.payClassifyId, + type: 4, + userId: uni.getStorageSync('userId') + } + if(that.artificerId){ + data.artificerId=that.artificerId + } + if(that.ordersId){ + data.ordersId=that.ordersId + } + that.$Request.post('/app/wxPay/payMoney', data).then(res => { + if (res.code == 0) { + const urlArr = window.location.href; + const hostUrl = urlArr.split("/"); + const callBack = hostUrl[0] + "//" + hostUrl[2] + "/"; + const url = '&redirect_url=' + callBack + 'my/wallet/index'; + window.location = res.data.mweb_url + url + that.getMoney() + } else { + uni.showToast({ + icon: 'none', + title: '支付失败!' + }); + } + }); + } + // #endif + + } else { + // #ifdef H5 + let data = { + payClassifyId: this.thisSelect.payClassifyId, + type: 2, + userId: uni.getStorageSync('userId'), + } + if(this.artificerId){ + data.artificerId=this.artificerId + } + if(this.ordersId){ + data.ordersId=this.ordersId + } + + this.$Request.post('/app/aliPay/payOrderMoney', data).then( + res => { + if (res.code == 0) { + uni.showToast({ + title: '支付成功!' + }); + this.getMoney() + // const div = document.createElement('div') + // div.innerHTML = res.data //此处form就是后台返回接收到的数据 + // document.body.appendChild(div) + // document.forms[0].submit() + + // setTimeout(d => { + // uni.navigateBack(1) + // }, 1000); + } else { + uni.showToast({ + icon: 'none', + title: '支付失败!' + }); + } + }); + // #endif + // #ifdef APP-PLUS + // APP支付宝支付 + let data = { + payClassifyId: this.thisSelect.payClassifyId, + type: 1, + userId: uni.getStorageSync('userId') + } + if(this.artificerId){ + data.artificerId=this.artificerId + } + if(this.ordersId){ + data.ordersId=this.ordersId + } + this.$Request.post("/app/aliPay/payOrderMoney", data).then(ret => { + console.log(ret) + this.getMoney() + this.isCheckPay(ret.code, 'alipay', ret.data); + }); + // #endif + } + + } else if (res.cancel) { + console.log('用户点击取消'); + } + } + }); + }, callPay: function(response) { if (typeof WeixinJSBridge === "undefined") { @@ -940,6 +966,9 @@