From 0320f43c0dd2b70a09d96a699278047c9961fb5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=90=E6=98=8E=E6=98=8E?= <970899069@qq.com> Date: Tue, 11 Jul 2023 14:47:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis/interfaces/empower.js | 23 ++++++++++++++++++++++- apis/interfaces/pay.js | 29 ++++++++++++++++++++++++++++- pages.json | 2 +- pages/empower/order.vue | 18 +++++++++++++++++- pages/empower/verification.vue | 3 +++ pages/synthesis/feePay.vue | 21 ++++++++++----------- pages/user/index.vue | 5 ++++- router/index.js | 28 ++++++++++++++-------------- 8 files changed, 99 insertions(+), 30 deletions(-) diff --git a/apis/interfaces/empower.js b/apis/interfaces/empower.js index 15b2ce4..927c2e5 100644 --- a/apis/interfaces/empower.js +++ b/apis/interfaces/empower.js @@ -61,6 +61,25 @@ const orderCancel = order => { }) } +// 核验列表 +const codes = code => { + return request({ + url : "empower/code", + data : { code }, + method : "POST", + }) +} + +// 确认核验 +const sign = item_id => { + return request({ + url : "empower/code/sign", + data : { item_id }, + method : "POST", + }) +} + + export { lists, info, @@ -68,6 +87,8 @@ export { buy, orderInit, orderList, - orderCancel + orderCancel, + codes, + sign } diff --git a/apis/interfaces/pay.js b/apis/interfaces/pay.js index 9fa8edf..9cc2a9e 100644 --- a/apis/interfaces/pay.js +++ b/apis/interfaces/pay.js @@ -154,6 +154,28 @@ const synDiffDg = (diff_price_id, data) =>{ }) } +// 公共收银台支付 +const payWechat = data => { + return request({ + url: "pay/cashier_desk/wechat", + method: 'POST', + data + }) +} +const payUms = data => { + return request({ + url: "pay/cashier_desk/ums", + method: 'POST', + data + }) +} +const payDg = data => { + return request({ + url: "pay/cashier_desk/dg", + method: 'POST', + data + }) +} export { ums, @@ -176,6 +198,11 @@ export { entrustDg, synDiffPay, synDiffUms, - synDiffDg + synDiffDg, + + // 综合收银台 + payWechat, + payUms, + payDg } diff --git a/pages.json b/pages.json index c798295..f56d27a 100644 --- a/pages.json +++ b/pages.json @@ -642,7 +642,7 @@ "style" :{ "navigationBarTitleText": "赋能订单", "enablePullDownRefresh": false, - "navigationBarBackgroundColor": "#FFF" + "navigationBarBackgroundColor": "#FFFFFF" } } ], diff --git a/pages/empower/order.vue b/pages/empower/order.vue index 757ad17..2d35f94 100644 --- a/pages/empower/order.vue +++ b/pages/empower/order.vue @@ -66,7 +66,7 @@ 取消 - 支付 + 支付 报名信息 @@ -228,6 +228,22 @@ if(ListIndex >= 0){ this.orders.splice(ListIndex, 1) } + }, + // 订单支付 + onPay(obj){ + let { order_id, order_type, price } = obj + + console.log(obj) + + this.$Router.replace({ + name: 'FeePay', + params: { + orderId : order_id, + orderType : order_type, + price : price, + payForm : 'entrust', + } + }) } }, onReachBottom() { diff --git a/pages/empower/verification.vue b/pages/empower/verification.vue index 70e67c2..b5844a0 100644 --- a/pages/empower/verification.vue +++ b/pages/empower/verification.vue @@ -88,6 +88,9 @@ }; }, onShow(){ + + console.log(codes) + codes(this.$Route.query.code).then(res => { this.vouchers = res; }) diff --git a/pages/synthesis/feePay.vue b/pages/synthesis/feePay.vue index a90e002..6ed248a 100644 --- a/pages/synthesis/feePay.vue +++ b/pages/synthesis/feePay.vue @@ -122,7 +122,7 @@ return { token : '', // 登录token orderId : '', // 微信支付id - jumpUrlDg : '', // 抖巩支付 + jumpUrlDg : '', // 抖巩支付 tradeId : '', // 微信支付id Payment : 'wechat', // 支付类型 applyData : '', // 支付数据 @@ -134,16 +134,15 @@ } }, onShow() { - console.log(this.$Route.query) - this.token = this.$store.getters.getToken - this.payPrice = this.$Route.query.price - this.payForm = this.$Route.query.payForm - this.orderId = this.$Route.query.id ?this.$Route.query.id: this.$Route.query.orderId + this.orderType = this.$Route.query.orderType + this.token = this.$store.getters.getToken + this.payPrice = this.$Route.query.price + this.payForm = this.$Route.query.payForm + this.orderId = this.$Route.query.id ?this.$Route.query.id: this.$Route.query.orderId }, methods: { // 选择支付方式 payType(type) { - if(this.Payment === type) return this.Payment = type if(type === 'umsMp'){ @@ -164,7 +163,6 @@ // 斗拱支付 dgwxPay(){ let payType = this.Payment == 'dgwx' ? 'mp' : 'mp_alipay' - let NewUrl = '' // 是否是补差价订单 if(this.$Route.query.style == 'diff') { @@ -180,7 +178,7 @@ } NewUrl = apiUrl } - NewUrl(this.orderId, {type: payType, app_schema: 'weixin://'}).then(res => { + NewUrl(this.orderId, {type: payType, app_schema: 'weixin://', order_type: this.orderType}).then(res => { let { params, trade_id } = res; this.getState = true switch (payType){ @@ -222,7 +220,7 @@ NewUrl = apiUrl } - NewUrl(this.orderId, {type: payType}).then(res => { + NewUrl(this.orderId, {type: payType, order_type: this.orderType}).then(res => { this.getState = true switch (payType){ case 'mp': @@ -275,7 +273,8 @@ } NewUrl(this.orderId, { - openid : newOpenId + openid : newOpenId, + order_type : this.orderType }).then(res => { let wxConfig = JSON.parse(res.wechat) jweixin.config({ diff --git a/pages/user/index.vue b/pages/user/index.vue index 08b4380..81d05ca 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -218,7 +218,10 @@ // 综法订单数据数量 synthesisInfo() { - synthesisCount({channel: 'self'}).then(res => { + synthesisCount({channel: 'self'}).then(res => { + + console.log(res) + this.synthesisAll = res }).catch(err => { uni.showToast({ diff --git a/router/index.js b/router/index.js index ebd78bf..ce28b74 100644 --- a/router/index.js +++ b/router/index.js @@ -30,20 +30,20 @@ router.beforeEach((to, from, next) => { return } // 检查用户是否授权了微信 - if(to.name != 'webWechatIndex' && openId === ''){ - authFollow({ - // url: 'https://web.douhuotest.douhuofalv.com/webWechat/index' - url: 'https://web.douhuofalv.com/webWechat/index' - }).then(res => { - window.location.href = res - }).catch(err => { - uni.showToast({ - title: err.message, - icon: "none" - }) - }) - return - } + // if(to.name != 'webWechatIndex' && openId === ''){ + // authFollow({ + // // url: 'https://web.douhuotest.douhuofalv.com/webWechat/index' + // url: 'https://web.douhuofalv.com/webWechat/index' + // }).then(res => { + // window.location.href = res + // }).catch(err => { + // uni.showToast({ + // title: err.message, + // icon: "none" + // }) + // }) + // return + // } // 检查是否需要登录 if(to.auth && token === ''){