From af31fc3a0cd37b96e28a6399d5818eb2fa8da53e Mon Sep 17 00:00:00 2001 From: Sliverber <2622874537@qq.com> Date: Thu, 22 Feb 2024 13:15:51 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=AE=9D=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/order.js | 4 +- config/app.js | 2 +- manifest.json | 2 +- pages.json | 8 + .../activity/goods_seckill_details/index.vue | 12 +- pages/goods_details/index.vue | 4 +- pages/order_details/index.vue | 6 +- pages/user/index.vue | 8 +- pages/users/alipay_return/alipay_return.vue | 1846 +++++++++++++++-- pages/users/order_confirm/index.vue | 2 +- pages/users/order_list/index.vue | 10 + pages/users/repayment/index.vue | 91 +- pages/users/signin/index.vue | 18 +- template.html | 73 +- utils/checkOverdue.js | 10 +- utils/request.js | 2 +- 16 files changed, 1849 insertions(+), 249 deletions(-) diff --git a/api/order.js b/api/order.js index 0c445ba..703f1e9 100644 --- a/api/order.js +++ b/api/order.js @@ -81,7 +81,9 @@ export function orderComment(data) { export function orderPay(data) { return request.post('pay/payment', data); } - +export function orderPays(data) { + return request.post('user/aliPayRepayment', data); +} /** * 订单统计数据 */ diff --git a/config/app.js b/config/app.js index 428cbe9..f85ef8c 100644 --- a/config/app.js +++ b/config/app.js @@ -1,7 +1,7 @@ //移动端商城API // let domain = 'http://117.50.163.143:20410' // let domain = 'http://117.50.215.20:20410' -// let domain = 'http://192.168.2.14:8081' +// let domain = 'http://192.168.2.26:20411' // let domain = 'http://106.75.49.247:20410' let domain = 'https://yruibao.com/prod' module.exports = { diff --git a/manifest.json b/manifest.json index 8ecc5b1..3f5a1c3 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name" : "先享后付", - "appid" : "__UNI__C7D69AA", //wxb74514b47a2f29d4 wx46c3a73d8c4f7051 __UNI__EB8A7B + "appid" : "__UNI__EA8F22D", //wxb74514b47a2f29d4 wx46c3a73d8c4f7051 __UNI__EB8A7B "description" : "crmeb商城", "versionName" : "2.1", "versionCode" : 2, diff --git a/pages.json b/pages.json index 52ed79f..dfbcdd5 100644 --- a/pages.json +++ b/pages.json @@ -820,6 +820,14 @@ "enablePullDownRefresh": false } } + ,{ + "path" : "alipay_returns/alipay_return", + "style" : + { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + } ,{ "path" : "alipay_invoke/index", "style" : diff --git a/pages/activity/goods_seckill_details/index.vue b/pages/activity/goods_seckill_details/index.vue index 506a680..3185284 100644 --- a/pages/activity/goods_seckill_details/index.vue +++ b/pages/activity/goods_seckill_details/index.vue @@ -108,20 +108,20 @@ - - + diff --git a/pages/order_details/index.vue b/pages/order_details/index.vue index 7396ebb..e5e427e 100644 --- a/pages/order_details/index.vue +++ b/pages/order_details/index.vue @@ -113,17 +113,17 @@
- 联系客服 +
-
diff --git a/pages/user/index.vue b/pages/user/index.vue index a940210..635daaa 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -111,14 +111,14 @@
- + - + -->
diff --git a/pages/users/alipay_return/alipay_return.vue b/pages/users/alipay_return/alipay_return.vue index 6725eca..1638a42 100644 --- a/pages/users/alipay_return/alipay_return.vue +++ b/pages/users/alipay_return/alipay_return.vue @@ -1,239 +1,1711 @@ - - \ No newline at end of file diff --git a/pages/users/order_confirm/index.vue b/pages/users/order_confirm/index.vue index 6220366..a1730c5 100644 --- a/pages/users/order_confirm/index.vue +++ b/pages/users/order_confirm/index.vue @@ -1110,7 +1110,7 @@ uid: this.$store.getters.uid } getidentity(data).then(res=>{ - if (res.message == '操作成功') { + if (res.message == '操作成功' && res.data!=null){ this.sfxx = '已完成' this.identification = res.data } diff --git a/pages/users/order_list/index.vue b/pages/users/order_list/index.vue index a4f7654..b84754a 100644 --- a/pages/users/order_list/index.vue +++ b/pages/users/order_list/index.vue @@ -76,8 +76,10 @@ 驳回原因: {{item.auditRejectReason}} + 立即签约 + + 待还款 已结清 @@ -18,10 +21,14 @@ {{item.repaymentStatus == 'Pending'? '待还款' : 'Partial' ? '部分还款' : 'Paid' ? '已还款' : '逾期'}} + - {{title}} + {{title}} + + + @@ -30,19 +37,49 @@ import { getreceivable } from '@/api/api.js' + import payment from '@/components/payments'; export default { data() { return { index: 0, binglist: [], - title: '还款' + title: '还款', + pay_close: false, + pay_order_id: '', + totalPrice: '0', } }, + components: { + payment, + + }, onLoad() { + uni.webView.postMessage({ + data: { + action: 'authorize' + } + }) + this.getData() // console.log(this.$Cache.get('orderno')) + // window.my.postMessage({ action: 'authorize' }); + + // step 4. 接受小程序发过来的用户信息 + }, methods: { + toreturn(){ + console.log('点击了'); + + // uni.navigateTo({ + // url: '/pages/users/alipay_return/alipay_return' + // }) + }, + ispayok(num){ + uni.navigateTo({ + url: '/pages/users/alipay_return/alipay_return' + }) + }, btnhk() { this.index = 0 this.title = '还款' @@ -57,13 +94,59 @@ getData: function() { let data = { uid:this.$store.getters.uid, - orderId:this.$Cache.get('ordernobh'), + // orderId:this.$Cache.get('ordernobh'), type: this.index } getreceivable(data).then(res => { this.binglist = res.data }) - } + }, + /** + * 事件回调 + * + */ + onChangeFun: function(e) { + + let opt = e; + let action = opt.action || null; + let value = opt.value != undefined ? opt.value : null; + (action && this[action]) && this[action](value); + }, + /** + * 关闭支付组件 + * + */ + payClose: function() { + this.pay_close = false; + }, + /** + * 打开支付组件 + * + */ + goPay(pay_price, order_id) { + this.$set(this, 'pay_close', true); + this.$set(this, 'pay_order_id', order_id); + this.$set(this, 'totalPrice', pay_price); + }, + /** + * 支付成功回调 + * + */ + pay_complete: function() { + this.loadend = false; + this.page = 1; + this.$set(this, 'orderList', []); + this.$set(this, 'pay_close', false); + this.getOrderData(); + this.getOrderList(); + }, + /** + * 支付失败回调 + * + */ + pay_fail: function() { + this.pay_close = false; + }, } } diff --git a/pages/users/signin/index.vue b/pages/users/signin/index.vue index 9d05c42..dbc6df9 100644 --- a/pages/users/signin/index.vue +++ b/pages/users/signin/index.vue @@ -52,12 +52,17 @@ } }, onLoad(option) { - this.orderNo = this.$Cache.get('qyids') + // this.orderNo = this.$Cache.get('qyids') // console.log(this.id) - // this.orderNo = option.orderId + this.orderNo = option.orderId + let token =option.token + console.log(token,'tokentokentokentokentoken'); + this.$store.commit("LOGIN", { + 'token': token + }); // this.shopobj = JSON.parse(option.shopobj) - this.getnews(this.orderNo) - this.logoflag = true + // this.getnews() + // this.logoflag = true this.timer = setInterval(() => { this.getnews() @@ -67,14 +72,15 @@ }, methods: { - getnews(orderNo) { - getqianyue(orderNo).then(res => { + getnews() { + getqianyue(this.orderNo).then(res => { console.log(res) this.signStatus = res.data.signStatus if (this.signStatus == 2) { this.flag = true this.text = '成功' this.logoflag = false + clearInterval(this.timer); } }) }, diff --git a/template.html b/template.html index 44d80ec..68ea06a 100644 --- a/template.html +++ b/template.html @@ -1,29 +1,48 @@ - - - - - - <%= htmlWebpackPlugin.options.title %> - - - - - - - - - - - - -
- - - + + + + + <%= htmlWebpackPlugin.options.title %> + + + + + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/utils/checkOverdue.js b/utils/checkOverdue.js index 5bd6c31..3609acf 100644 --- a/utils/checkOverdue.js +++ b/utils/checkOverdue.js @@ -6,10 +6,10 @@ export function checkOverdue(data) { url: Url + '/api/front/user', method: 'GET', header: header, - success:(res) =>{ - if([410000, 410001, 410002, 401].indexOf(res.data.code) !== -1){ - store.commit("LOGOUT"); - } - } + // success:(res) =>{ + // if([410000, 410001, 410002, 401].indexOf(res.data.code) !== -1){ + // store.commit("LOGOUT"); + // } + // } }) } \ No newline at end of file diff --git a/utils/request.js b/utils/request.js index 603eaf4..2cf733d 100644 --- a/utils/request.js +++ b/utils/request.js @@ -46,7 +46,7 @@ function baseRequest(url, method, data, { else if (res.data.code == 200) reslove(res.data, res); else if ([410000, 410001, 410002, 401].indexOf(res.data.code) !== -1) { - toLogin(); + // toLogin(); reject(res.data); }else if (res.data.code == 500){ reject(res.data.message || '系统异常'); From 559ee026fb446e144687796c9d2703ef891eabf8 Mon Sep 17 00:00:00 2001 From: Sliverber <2622874537@qq.com> Date: Thu, 22 Feb 2024 13:17:16 +0800 Subject: [PATCH 2/3] 111 --- components/payments/index.vue | 588 +++++++++++++++++++ pages/users/alipay_returns/alipay_return.vue | 242 ++++++++ 2 files changed, 830 insertions(+) create mode 100644 components/payments/index.vue create mode 100644 pages/users/alipay_returns/alipay_return.vue diff --git a/components/payments/index.vue b/components/payments/index.vue new file mode 100644 index 0000000..4736166 --- /dev/null +++ b/components/payments/index.vue @@ -0,0 +1,588 @@ + + + + + + \ No newline at end of file diff --git a/pages/users/alipay_returns/alipay_return.vue b/pages/users/alipay_returns/alipay_return.vue new file mode 100644 index 0000000..07587bf --- /dev/null +++ b/pages/users/alipay_returns/alipay_return.vue @@ -0,0 +1,242 @@ + + + + \ No newline at end of file From dac94a6e6bca81d0b080f832feabcde1e0ca579a Mon Sep 17 00:00:00 2001 From: Sliverber <2622874537@qq.com> Date: Thu, 22 Feb 2024 18:06:29 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/payments/index.vue | 74 ++++++++++++++++-------------- config/app.js | 4 +- pages/users/repayment/index.vue | 8 +++- pages/users/wechat_login/index.vue | 2 +- 4 files changed, 49 insertions(+), 39 deletions(-) diff --git a/components/payments/index.vue b/components/payments/index.vue index 4736166..dcdcba1 100644 --- a/components/payments/index.vue +++ b/components/payments/index.vue @@ -59,13 +59,13 @@ intervalId: null, // 用于存储定时器的ID //支付方式 payMode: [ - // { - // "name": "微信支付", - // "icon": "icon-weixin2", - // value: 'weixin', - // title: '微信快捷支付', - // payStatus: 1, - // }, + { + "name": "微信支付", + "icon": "icon-weixin2", + value: 'weixin', + title: '微信快捷支付', + payStatus: 1, + }, // { // "name": "余额支付", // "icon": "icon-yuezhifu", @@ -74,15 +74,15 @@ // payStatus: 1, // number: 0 // }, - // #ifndef MP - { - "name": "支付宝支付", - "icon": "icon-zhifubao", - value: 'alipay', - title: '支付宝快捷支付', - payStatus: 1, - } - // #endif + // // #ifndef MP + // { + // "name": "支付宝支付", + // "icon": "icon-zhifubao", + // value: 'alipay', + // title: '支付宝快捷支付', + // payStatus: 1, + // } + // // #endif ], }; }, @@ -156,7 +156,7 @@ }, // 调用支付宝支付 aliPay(id) { - + console.log('支付宝小程序支付'); let that = this console.log(that.order_id, 'idididiid'); @@ -245,13 +245,13 @@ // // #ifndef MP // payChannel:that.payChannel, // // #endif - // payType: paytype, + payType: paytype, // scene: that.productType === 'normal' ? 0 : 1177 //下单时小程序的场景值 }).then(res => { let jsConfig = res.data.jsConfig; that.order_id = res.data.tradeNo; that.checkid = res.data.orderNo - console.log(that.checkid,'that.checkidthat.checkid'); + // console.log(that.checkid,'that.checkidthat.checkid'); switch (res.data.payType) { case 'weixin': that.weixinPay(jsConfig); @@ -281,23 +281,29 @@ }); break; case 'alipay': - this.aliPay(that.order_id) + // // uni.hideLoading(); + if(that.openId==''){ + if (this.$wechat.isWeixin()) { + //微信公众号内支付 + } else { + //h5支付 + console.log('进入h5支付宝'); + uni.hideLoading(); + that.formContent = res.data.alipayRequest; + uni.setStorage({ + key: 'orderNo', + data: that.order_id + }); + that.$nextTick(() => { + document.forms['punchout_form'].submit(); + }) + } + }else{ + this.aliPay(that.order_id) + } //#ifdef H5 - // if (this.$wechat.isWeixin()) { - // //微信公众号内支付 - // } else { - // //h5支付 - // uni.hideLoading(); - // that.formContent = res.data.alipayRequest; - // uni.setStorage({ - // key: 'orderNo', - // data: that.order_id - // }); - // that.$nextTick(() => { - // document.forms['punchout_form'].submit(); - // }) - // } + //#endif //#ifdef MP-ALIPAY diff --git a/config/app.js b/config/app.js index f85ef8c..eab6b24 100644 --- a/config/app.js +++ b/config/app.js @@ -1,9 +1,9 @@ //移动端商城API // let domain = 'http://117.50.163.143:20410' // let domain = 'http://117.50.215.20:20410' -// let domain = 'http://192.168.2.26:20411' +let domain = 'http://192.168.2.26:20411' // let domain = 'http://106.75.49.247:20410' -let domain = 'https://yruibao.com/prod' +// let domain = 'https://yruibao.com/prod' module.exports = { // 请求域名 格式: https://您的域名 // #ifdef MP || APP-PLUS diff --git a/pages/users/repayment/index.vue b/pages/users/repayment/index.vue index 29d321f..7dc98d8 100644 --- a/pages/users/repayment/index.vue +++ b/pages/users/repayment/index.vue @@ -54,13 +54,17 @@ }, onLoad() { + this.getData() uni.webView.postMessage({ data: { action: 'authorize' } }) - - this.getData() + //#ifdef MP-ALIPAY + + // this.aliPay(that.order_id) + //#endif + // console.log(this.$Cache.get('orderno')) // window.my.postMessage({ action: 'authorize' }); diff --git a/pages/users/wechat_login/index.vue b/pages/users/wechat_login/index.vue index 4ceaaa4..de3283d 100644 --- a/pages/users/wechat_login/index.vue +++ b/pages/users/wechat_login/index.vue @@ -28,7 +28,7 @@ + class='iconfont icon-weixin2' v-if="false">手机号快捷登录