diff --git a/pages.json b/pages.json index 3525afd..9c9184f 100644 --- a/pages.json +++ b/pages.json @@ -1,17 +1,6 @@ { "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages { - "path" : "pages/user/bindingCardList/bindingCardList", - "style" : - { - "navigationBarTitleText": "卡列表", - "navigationBarBackgroundColor": "#0083f5", - "backgroundColorTop": "#0083f5", - "navigationBarTextStyle": "white", - "enablePullDownRefresh": false - } - - },{ "path": "pages/tabBar/home/home", "style": { "navigationBarTextStyle": "white", @@ -30,6 +19,17 @@ } } },{ + "path" : "pages/user/bindingCardList/bindingCardList", + "style" : + { + "navigationBarTitleText": "卡列表", + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", + "navigationBarTextStyle": "white", + "enablePullDownRefresh": false + } + + },{ "path": "pages/login/login", "style": { "navigationBarBackgroundColor": "#0083f5", @@ -289,26 +289,32 @@ }, { "path": "pages/user/deposit/deposit", "style": { - "navigationBarBackgroundColor": "#ffffff", + "enablePullDownRefresh": false, "navigationBarTitleText": "充值", - "backgroundColorTop": "#ffffff", - "backgroundColorBottom": "#ffffff" + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", + "navigationBarTextStyle": "white" } }, { "path": "pages/pay/payment/payment", "style": { - "navigationBarBackgroundColor": "#ffffff", + "enablePullDownRefresh": false, "navigationBarTitleText": "订单支付", - "backgroundColorTop": "#ffffff", - "backgroundColorBottom": "#ffffff" + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", + "navigationBarTextStyle": "white" } }, { "path": "pages/pay/success/success", "style": { - "navigationBarBackgroundColor": "#ffffff", + "enablePullDownRefresh": false, "navigationBarTitleText": "支付成功", - "backgroundColorTop": "#ffffff", - "backgroundColorBottom": "#ffffff" + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", + "navigationBarTextStyle": "white" } }, { diff --git a/pages/order/confirmation.vue b/pages/order/confirmation.vue index 794895b..6d9ff0a 100644 --- a/pages/order/confirmation.vue +++ b/pages/order/confirmation.vue @@ -10,16 +10,14 @@ ¥{{couponList.discountPrice}} - + {{couponList.discountPrice*100}} ¥{{couponList.salesPrice}} - + {{couponList.salesPrice*100}} x1 @@ -35,8 +33,7 @@ ¥{{couponList.discountPrice}} - + {{couponList.discountPrice*100}} @@ -98,13 +95,13 @@ - + - 工会卡支付可用余额: + 工会卡支付可用余额: {{tongCardPrice}}元 - + @@ -125,8 +122,7 @@ 实付:¥{{paytheprice}} - + {{paytheprice*100}} @@ -171,7 +167,9 @@ bindUserPhone, orderToPay, orderToGoldPay, - findUser + findUser, + hltUnionCardPay, + getHuiLianTongCardBalance } from '../../Utils/Api.js'; import wybPopup from '../../components/wyb-popup/wyb-popup.vue'; import ssPaymentPassword from '../../components/sanshui-payment-password' @@ -206,18 +204,29 @@ PaymentPassword: '', isture: true, orderId: '', - jumpType:'' + jumpType: '', + tongCardPrice: 0, + balanceCardNo : '' + }; }, onLoad(option) { this.couponId = option.id; this.getCouponById(); - this.getUserNormalDiscountList(); }, onShow() { - this.user = app.globalData.userInfo; - this.findUser(); + let that =this; + that.paytype = ''; + that.user = app.globalData.userInfo; + that.findUser(); + uni.getStorage({ + key: 'balanceCardNo', + success(e) { + that.balanceCardNo = e.data; + that.getHuiLianTongCardBalance(); + } + }) }, onHide() { @@ -254,7 +263,7 @@ if (res.return_code == '000000') { app.globalData.userInfo = res.return_data; this.user = res.return_data; - uni.setStorage({ + uni.setStorage({ key: "user", data: res.return_data }) @@ -329,6 +338,19 @@ } }) }, + //查询工会卡余额 + //查询详情 + getHuiLianTongCardBalance() { + let params = { + cardNo: this.balanceCardNo + } + getHuiLianTongCardBalance(params).then(res => { + if (res.return_code == '000000') { + this.tongCardPrice = res.return_data.balance; + } + + }); + }, // H5获取手机号 jumpH5Bding() { uni.navigateTo({ @@ -400,7 +422,24 @@ } }) }, - + //获取选择支付方式 + changeRiado() { + if (!this.user.isSetHltCard) { + uni.showToast({ + icon: 'none', + title: '当前账号还未绑定,前往绑定', + duration: 2000, + success() { + setTimeout(() => { + uni.navigateTo({ + url: '../user/bindingCard/bindingCard' + }) + }, 1000) + } + }); + return; + } + }, //获取订单数据 orderToPay(item) { let that = this; @@ -453,7 +492,7 @@ } }) } else if (that.paytype == 'jinbi') { - if(!that.user.isSetPayPwd){ + if (!that.user.isSetPayPwd) { uni.navigateTo({ url: '../login/updatePas/updatePas' }) @@ -461,6 +500,24 @@ } that.isture = false; that.$refs.paymentPassword.modalFun('show'); + } else if (that.paytype == 'gonghuika') { + if (!that.user.isSetHltCard) { + uni.showToast({ + icon: 'none', + title: '当前账号还未绑定,前往绑定', + duration: 2000, + success() { + setTimeout(() => { + uni.navigateTo({ + url: '../user/bindingCard/bindingCard' + }) + }, 1000) + } + }); + return; + } + that.isture = false; + that.$refs.paymentPassword.modalFun('show'); } else { uni.showToast({ title: '请选择支付方式', @@ -475,18 +532,49 @@ uni.showLoading({ title: '支付中...' }) + if (this.paytype == 'jinbi') { + let params = { + "orderId": this.orderId, + "password": this.PaymentPassword + } + orderToGoldPay(params).then(res => { + uni.hideLoading(); + if (res.return_code == '000000') { + uni.showToast({ + title: '支付成功' + }) + uni.reLaunch({ + url: '../pay/success/success?id=' + this.couponId + }); + return; + } + if (res.return_code == '102130') { + uni.navigateTo({ + url: '../../login/updatePas/updatePas' + }) + return; + } + uni.showToast({ + title: res.return_msg, + icon: 'none' + }) + }) + return; + } + let params = { "orderId": this.orderId, + "cardNo": this.balanceCardNo, "password": this.PaymentPassword } - orderToGoldPay(params).then(res => { + hltUnionCardPay(params).then(res => { uni.hideLoading(); if (res.return_code == '000000') { uni.showToast({ title: '支付成功' }) uni.reLaunch({ - url:'../pay/success/success?id=' + this.couponId + url: '../pay/success/success?id=' + this.couponId }); return; } @@ -500,8 +588,9 @@ title: res.return_msg, icon: 'none' }) - }) + + }, payRequest: function(self) { uni.showLoading({ diff --git a/pages/pay/payment/payment.vue b/pages/pay/payment/payment.vue index 7140894..ae1038f 100644 --- a/pages/pay/payment/payment.vue +++ b/pages/pay/payment/payment.vue @@ -6,8 +6,8 @@ 订单金额: {{amount}} 元 - {{amount*100}} 个积分 (当前积分:{{user.gold}}) - {{amount}}元(当前积分:{{user.gold}}) + {{amount*100}} 个积分 + {{amount}}元 @@ -25,12 +25,25 @@ - 积分支付 + 积分支付(积分:{{user.gold}}) + + + + + + + 工会卡支付(余额:{{tongCardPrice}}元) + + + + + @@ -61,7 +74,9 @@