diff --git a/Utils/Api.js b/Utils/Api.js index d0a5378..2e4bb98 100644 --- a/Utils/Api.js +++ b/Utils/Api.js @@ -220,7 +220,11 @@ export const setCacheParam = params => { //查询充值话费详情 export const getPhoneOrderById = params => { return POST('GET', `${base}/outRechargeOrder/getOrderById`, params).then(res => res.data); -} +} +// 取消话费订单 +export const cancelRechargeOrder = params => { + return POST('GET', `${base}/outRechargeOrder/cancelOrder`, params).then(res => res.data); +} //优惠券包列表 export const getDiscountPackageList = params => { return POST('GET', `${base}/discountPackage/getDiscountPackageList`, params).then(res => res.data); @@ -437,12 +441,12 @@ export const findById = params => { return POST('GET', `${base}/outRechargePrice/findById`, params).then(res => res.data); } //提交订单 -export const orderToUNionPay = params => { - return POST('POST', `${base}/outRechargeOrder/orderToPay`, params).then(res => res.data); +export const orderToPayByWx = params => { + return POST('POST', `${base}/czOrder/orderToPayByWx`, params).then(res => res.data); } //工会卡支付 -export const hltUnionCardPayUnion = params => { - return POST('POST', `${base}/outRechargeOrder/hltUnionCardPay`, params).then(res => res.data); +export const hltUnionCardPayghk = params => { + return POST('POST', `${base}/czOrder/hltUnionCardPay`, params).then(res => res.data); } //话费列表 export const getUserOrderListhuafei = params => { diff --git a/Utils/Request.js b/Utils/Request.js index eae7132..b74d33a 100644 --- a/Utils/Request.js +++ b/Utils/Request.js @@ -58,7 +58,7 @@ function request(method, url, data) { }, fail(err) { uni.showToast({ - title: '请求失败', + title: '网络异常', icon: 'none', duration: 1500, }) diff --git a/pages.json b/pages.json index 8185efe..268d0da 100644 --- a/pages.json +++ b/pages.json @@ -172,7 +172,6 @@ { "path": "pages/goods/goods", "style": { - "navigationBarTitleText": "", "navigationBarBackgroundColor": "#0083f5", "backgroundColorTop": "#0083f5", "navigationBarTitleText": "详情", @@ -472,8 +471,7 @@ "navigationBarTextStyle": "white" } } - - ], + ], "subpackages": [{ "root": "subPages", "pages": [{ @@ -664,15 +662,37 @@ }, { "path": "cardsDetails/cardsDetails", "style": { - "navigationBarTitleText": "卡详情", - "enablePullDownRefresh": false, - "backgroundTextStyle": "light", - "navigationBarBackgroundColor": "#0083f5", - "backgroundColorTop": "#0083f5", + "navigationBarTitleText": "卡详情", + "enablePullDownRefresh": false, + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", "navigationBarTextStyle": "white" } - } + }, { + "path": "rechargeDetails/rechargeDetails", + "style": { + "navigationBarTitleText": "详情", + "enablePullDownRefresh": false, + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", + "navigationBarTextStyle": "white" + } + } ,{ + "path" : "recharge-pay/recharge-pay", + "style" : + { + "navigationBarTitleText": "支付", + "enablePullDownRefresh": false, + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#0083f5", + "backgroundColorTop": "#0083f5", + "navigationBarTextStyle": "white" + } + + } ] }], "globalStyle": { diff --git a/pages/goods/refuel-details/refuel-details.vue b/pages/goods/refuel-details/refuel-details.vue index 6a8d024..479b520 100644 --- a/pages/goods/refuel-details/refuel-details.vue +++ b/pages/goods/refuel-details/refuel-details.vue @@ -66,7 +66,7 @@ + @input="Listeningfocus" /> 约{{oilLiters}}L @@ -215,7 +215,7 @@ this.counId = options.desId; if (app.globalData.accountId) { this.isTyAgent = true; - } + } // #ifdef H5 if (app.globalData.accountType && app.globalData.accountType == '000000#/') { this.recentGasStation(); @@ -230,7 +230,7 @@ this.getDictionaryByCodeTypeMoney(); }, onShow() { - this.user = app.globalData.userInfo; + this.user = app.globalData.userInfo; }, onUnload() { if (app.globalData.accountType && app.globalData.accountType == '000000#/') { @@ -256,7 +256,7 @@ this.$refs.popup.show(); }, //一键加油 - recentGasStation() { + recentGasStation() { uni.showLoading({ title: '加载中...' }) @@ -264,9 +264,9 @@ latitude: app.globalData.latitude, longitude: app.globalData.longitude, isTyAgent: this.isTyAgent - } - recentGasStation(params).then(res => { - uni.hideLoading(); + } + recentGasStation(params).then(res => { + uni.hideLoading(); if (res.return_code == '000000') { this.storeList = res.return_data; if (!this.oilNo) { @@ -276,7 +276,7 @@ this.priceOfficial = res.return_data.oilPriceList[0].priceOfficial; this.detailList = res.return_data.oilPriceList; this.oilType = res.return_data.oilPriceList[0].oilType; - this.gasGunList = res.return_data.gasGunList; + this.gasGunList = res.return_data.gasGunList; this.counId = res.return_data.goodsId; for (var i = 0; i < res.return_data.gasGunList.length; i++) { if (this.oilNo == res.return_data.gasGunList[i].oilNoName) { @@ -296,7 +296,7 @@ }) }, //查询详情 - getGasDetailByStoreKey() { + getGasDetailByStoreKey() { uni.showLoading({ title: '加载中...' }) @@ -305,9 +305,9 @@ latitude: app.globalData.latitude, longitude: app.globalData.longitude, isTyAgent: this.isTyAgent - } + } getGasDetailByStoreKey(params).then(res => { - uni.hideLoading(); + uni.hideLoading(); if (res.return_code == '000000') { this.storeList = res.return_data; if (!this.oilNo) { @@ -423,7 +423,7 @@ var a = /^[0-9]+(\.[0-9]{1})?$/; var b = /^[0-9]+(.[0-9]{1})?$/; var c = /^([1-9][0-9]*)+(\.[0-9]{1,2})?$/; - if (this.inputMoney == '' || this.inputMoney < 10 || !(c.test(this.inputMoney))) { + if (this.inputMoney == '') { uni.showToast({ title: '请输入正确加油金额', icon: "none", @@ -441,38 +441,25 @@ this.totalPreferences = '0'; return; } - - // let inputs = this.inputMoney.split('.'); - // if (inputs[1] != undefined && inputs[1].length > 1) { - // uni.showToast({ - // title: '加油金额精确到小数点1位', - // icon: "none", - // duration:2000 - // }); - // return; - // } if (parseInt(this.inputMoney) > parseInt(this.xzMoney)) { uni.showToast({ title: '加油金额不能超过' + this.xzMoney + '元', icon: "none", duration: 2000 - }); - this.inputMoney = this.xzMoney; - + }); + this.totalPrice = '0.00'; + this.discountPrice = '0.00'; + this.litre = ''; + this.inputMoney = ''; + this.oilLiters = '0'; + this.discount = '0'; + this.oilSubsidy = '0'; + this.litersPreferences = '0'; + this.pricePreferences = '0'; + this.totalPreferences = '0'; + return; } - - //原来计算方式 - // this.litre = parseFloat(this.inputMoney / this.priceGun).toFixed(2); - // var arr1 = parseFloat(this.inputMoney / this.priceOfficial * this.priceVip).toFixed(4); - // this.totalPrice = this.numFilter(arr1); this.oilPriceDiscountCompute(); - //目前计算方式 - // this.litre = parseFloat(this.inputMoney / this.priceGun).toFixed(2); - // this.totalPrice = parseFloat(this.inputMoney / this.priceGun * this.priceVip).toFixed(2); - // if (this.priceVip != this.priceGun) { - // let gbprice = parseFloat(this.litre * this.priceGun).toFixed(2); - // this.discountPrice = parseFloat(gbprice - this.totalPrice).toFixed(0); - // } }, //计算价格 oilPriceDiscountCompute() { @@ -525,7 +512,8 @@ */ postionIng() { let that = this; - if (that.inputMoney == '' || that.inputMoney < 10) { + var c = /^([1-9][0-9]*)+(\.[0-9]{1,2})?$/; + if (that.inputMoney == '' || that.inputMoney < 10 || !(c.test(this.inputMoney))) { uni.showToast({ title: '请输入正确金额', icon: "none", diff --git a/pages/tabBar/category/category.vue b/pages/tabBar/category/category.vue index 5e1d1a8..84a65b2 100644 --- a/pages/tabBar/category/category.vue +++ b/pages/tabBar/category/category.vue @@ -190,7 +190,11 @@ if (res.return_code == '000000' && res.return_data != '') { this.MerchantList = res.return_data; this.showCategoryIndex = res.return_data[0].merchantName; - this.showCategoryIndexId = res.return_data[0].id; + this.showCategoryIndexId = res.return_data[0].id; + this.pageNum = 1; + this.pageSize = 10; + this.isNoMoreData = false; + this.categoryList = []; this.getStoreListByMerchant(); } else { diff --git a/pages/tabBar/home/home.vue b/pages/tabBar/home/home.vue index 221c55a..3761332 100644 --- a/pages/tabBar/home/home.vue +++ b/pages/tabBar/home/home.vue @@ -265,7 +265,7 @@ methods: { jumpcdx() { location.href = - 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsg.dctpay.com%2FhsgH5%2Findex.html%23%2F&response_type=code&scope=snsapi_base&state=1#wechat_redirect'; + 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsgcs.dctpay.com%2FhsgH5%2Findex.html%23%2F&response_type=code&scope=snsapi_base&state=1#wechat_redirect'; }, //获取首页功能 getCmsContentcmsContent() { diff --git a/pages/tabBar/user/user.vue b/pages/tabBar/user/user.vue index d60da92..1328ac3 100644 --- a/pages/tabBar/user/user.vue +++ b/pages/tabBar/user/user.vue @@ -64,7 +64,9 @@ 话费充值 - + + @@ -157,7 +159,8 @@ headerPosition: "fixed", textnum: '', textSend: '', - therrNum: '', + therrNum: '', + rechargeOrderNum:'', //话费待支付 headerTop: null, statusTop: null, showHeader: true, @@ -361,7 +364,8 @@ this.user = res.return_data; this.textnum = res.return_data.unusedCouponNum; this.textSend = res.return_data.unusedDiscount; - this.therrNum = res.return_data.unpaid; + this.therrNum = res.return_data.unpaid; + this.rechargeOrderNum = res.return_data.rechargeOrderNum; uni.setStorage({ key: "user", data: res.return_data diff --git a/pages/user/order_list/order_list.vue b/pages/user/order_list/order_list.vue index e423025..ec9b48c 100644 --- a/pages/user/order_list/order_list.vue +++ b/pages/user/order_list/order_list.vue @@ -294,22 +294,7 @@ } }); }, - doCancelOrder(ordersn) { - let typeNum = this.orderList.length; - for (let i = 0; i < typeNum; i++) { - let list = this.orderList[i]; - let orderNum = list.length; - if (orderNum > 0 && list[0].type == 'unpaid') { - for (let j = 0; j < orderNum; j++) { - if (this.orderList[i][j].ordersn == ordersn) { - this.orderList[i][j].type = 'cancelled'; - break; - } - } - } - - } - }, + //去支付 toPayment(row) { let payTypes; if (row.payType == 1 || row.payType == null) { diff --git a/subPages/Phone-recharge-details/Phone-recharge-details.vue b/subPages/Phone-recharge-details/Phone-recharge-details.vue index 252fd7d..9e2fe99 100644 --- a/subPages/Phone-recharge-details/Phone-recharge-details.vue +++ b/subPages/Phone-recharge-details/Phone-recharge-details.vue @@ -20,7 +20,7 @@ 支付成功 - {{phoneorderdes.payPrice}}元 + {{phoneorderdes.payRealPrice}}元 {{phoneorderdes.payTime | timeFormat('yyyy-mm-dd')}} {{phoneorderdes.payTime | timeFormat('hh:mm')}} @@ -28,15 +28,19 @@ - 话费充值 : {{phoneorderdes.userPhone}}|{{phoneorderdes.remarks}} + 话费充值 : {{phoneorderdes.userPhone}}|{{phoneorderdes.operatorName}} 订单总额 {{phoneorderdes.orderPrice == null ? '0': phoneorderdes.orderPrice}}元 - 优惠 - {{phoneorderdes.deductionPrice == null ? '0': phoneorderdes.deductionPrice}}元 + 优惠券抵扣 + {{phoneorderdes.discountDeductionPrice == null ? '0': phoneorderdes.discountDeductionPrice}}元 + + + 积分抵扣 + {{phoneorderdes.integralDeductionPrice == null ? '0': phoneorderdes.integralDeductionPrice}}元 实际支付金额 diff --git a/subPages/recharge-centre/recharge-centre.vue b/subPages/recharge-centre/recharge-centre.vue index c91fd87..c933393 100644 --- a/subPages/recharge-centre/recharge-centre.vue +++ b/subPages/recharge-centre/recharge-centre.vue @@ -121,8 +121,7 @@ import QSTabs from '../../components/QS-tabs/QS-tabs.vue'; import { getListOutRechargePrice, - addOrderPay, - orderToUNionPay + addOrderPay } from '../../Utils/Api.js'; export default { components: { @@ -304,44 +303,6 @@ } }) - - - // uni.showLoading({ - // title: '加载中...' - // }) - // addOrderPay(params).then(res => { - // uni.hideLoading() - // if (res.return_code == '000000') { - // let params = { - // "orderId": res.return_data.id, - // "openId": app.globalData.openId - // } - // this.orderToUNionPay(params); - // } else { - // uni.showToast({ - // title: res.return_msg, - // icon: "none" - // }) - // } - // }) - - }, - //获取订单信息 - orderToUNionPay(item) { - orderToUNionPay(item).then(res => { - if (res.return_code == '000000') { - //判断是否是公众号 - // #ifdef H5 - //判断微信浏览器 - this.payRequest(res); - // #endif - } else { - uni.showToast({ - title: res.return_msg, - icon: 'none' - }) - } - }) }, //唤起支付 payRequest: function(self) { diff --git a/subPages/recharge-pay/recharge-pay.vue b/subPages/recharge-pay/recharge-pay.vue new file mode 100644 index 0000000..0be629f --- /dev/null +++ b/subPages/recharge-pay/recharge-pay.vue @@ -0,0 +1,562 @@ + + + + + diff --git a/subPages/rechargeDetails/rechargeDetails.vue b/subPages/rechargeDetails/rechargeDetails.vue new file mode 100644 index 0000000..f6d04b0 --- /dev/null +++ b/subPages/rechargeDetails/rechargeDetails.vue @@ -0,0 +1,505 @@ + + + + + diff --git a/subPages/unionComfirmation/unionComfirmation.vue b/subPages/unionComfirmation/unionComfirmation.vue index 75c7823..860400c 100644 --- a/subPages/unionComfirmation/unionComfirmation.vue +++ b/subPages/unionComfirmation/unionComfirmation.vue @@ -25,7 +25,15 @@ ¥{{orderPrice}} - + + + + 折扣金额 + + + ¥{{saveprice}} + + @@ -42,7 +50,6 @@ - @@ -54,8 +61,12 @@ 0 - + + {{availIntegal}} @@ -76,16 +87,6 @@ - @@ -157,11 +158,10 @@ diff --git a/subPages/unionPay-orderList/unionPay-orderList.vue b/subPages/unionPay-orderList/unionPay-orderList.vue index b856e16..0f90bcb 100644 --- a/subPages/unionPay-orderList/unionPay-orderList.vue +++ b/subPages/unionPay-orderList/unionPay-orderList.vue @@ -1,396 +1,489 @@ - - - -