From deddb6d97c0046dbc013f87e1a67ae04b9b0a58b Mon Sep 17 00:00:00 2001 From: Wik-T <812952667@qq.com> Date: Wed, 1 Mar 2023 18:02:59 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E8=AF=9D=E8=B4=B9=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 44 +- Utils/Api.js | 21 +- pages/goods/refuel-confirm/refuel-confirm.vue | 12 +- pages/tabBar/home/home.vue | 5 +- subPages/recharge-centre/recharge-centre.vue | 436 ++++++++++++------ subPages/recharge/recharge.vue | 4 +- subPages/static/tongz.png | Bin 0 -> 1576 bytes uni.scss | 9 + 8 files changed, 356 insertions(+), 175 deletions(-) create mode 100644 subPages/static/tongz.png diff --git a/App.vue b/App.vue index 314e522..0ccd0fa 100644 --- a/App.vue +++ b/App.vue @@ -95,23 +95,23 @@ // #endif // #ifdef H5 let that = this; - // that.globalData.url = 'https://hsgcs.dctpay.com/crest'; - // that.globalData.v1url = 'https://hsgcs.dctpay.com/v1'; - // that.globalData.orderurl = 'https://hsgcs.dctpay.com/order'; - // that.globalData.userurl = 'https://hsgcs.dctpay.com/user'; - // that.globalData.brestUrl = 'https://hsgcs.dctpay.com/brest'; - // that.globalData.imgUrl = 'https://hsgcs.dctpay.com/filesystem/'; - // that.globalData.imageWxImg = 'https://hsgcs.dctpay.com/filesystem/wxApplets/'; - // that.globalData.imageqrImg = 'https://hsgcs.dctpay.com/filesystem/temporary/'; + that.globalData.url = 'https://hsgcs.dctpay.com/crest'; + that.globalData.v1url = 'https://hsgcs.dctpay.com/v1'; + that.globalData.orderurl = 'https://hsgcs.dctpay.com/order'; + that.globalData.userurl = 'https://hsgcs.dctpay.com/user'; + that.globalData.brestUrl = 'https://hsgcs.dctpay.com/brest'; + that.globalData.imgUrl = 'https://hsgcs.dctpay.com/filesystem/'; + that.globalData.imageWxImg = 'https://hsgcs.dctpay.com/filesystem/wxApplets/'; + that.globalData.imageqrImg = 'https://hsgcs.dctpay.com/filesystem/temporary/'; - that.globalData.url = 'https://hsg.dctpay.com/crest'; - that.globalData.v1url = 'https://hsg.dctpay.com/v1'; - that.globalData.orderurl = 'https://hsg.dctpay.com/order'; - that.globalData.userurl = 'https://hsg.dctpay.com/user'; - that.globalData.brestUrl = 'https://hsg.dctpay.com/brest'; - that.globalData.imgUrl = 'https://hsg.dctpay.com/filesystem/'; - that.globalData.imageWxImg = 'https://hsg.dctpay.com/filesystem/wxApplets/'; - that.globalData.imageqrImg = 'https://hsg.dctpay.com/filesystem/temporary/'; + // that.globalData.url = 'https://hsg.dctpay.com/crest'; + // that.globalData.v1url = 'https://hsg.dctpay.com/v1'; + // that.globalData.orderurl = 'https://hsg.dctpay.com/order'; + // that.globalData.userurl = 'https://hsg.dctpay.com/user'; + // that.globalData.brestUrl = 'https://hsg.dctpay.com/brest'; + // that.globalData.imgUrl = 'https://hsg.dctpay.com/filesystem/'; + // that.globalData.imageWxImg = 'https://hsg.dctpay.com/filesystem/wxApplets/'; + // that.globalData.imageqrImg = 'https://hsg.dctpay.com/filesystem/temporary/'; uni.getStorage({ key: 'openId', success(e) { @@ -233,5 +233,15 @@ diff --git a/Utils/Api.js b/Utils/Api.js index 4540afa..8e6b502 100644 --- a/Utils/Api.js +++ b/Utils/Api.js @@ -276,12 +276,12 @@ export const getDetailByCardNo = params => { // 获取用户卡号列表 export const getUserCardList = params => { return POST('GET', `${base}/highUserCard/getUserCardList`, params).then(res => res.data); -} - -//根据油卡查询车牌列表 +} + +//根据油卡查询车牌列表 export const getCardListByCardNo = params => { return POST('GET', `${base}/fleetOilCard/getCardListByCardNo`, params).then(res => res.data); -} +} // 根据手机号获取汇联通工会卡列表 export const getHuiLianTongCardByPhone = params => { @@ -306,8 +306,8 @@ export const getHuiLianTongCardConsume = params => { // 汇联通工会卡支付 export const hltUnionCardPay = params => { return POST('POST', `${base}/order/hltUnionCardPay`, params).then(res => res.data); -} - +} + //绑定卡包 export const bindHuiLianTongCard = params => { @@ -565,6 +565,10 @@ export const getRecordByCouponAgentId = params => { export const orderToGoldPayunion = params => { return POST('POST', `${base}/outRechargeOrder/orderToGoldPay`, params).then(res => res.data); } +// 话费充值数据字典 +export const findSecConfigByType = params => { + return POST('GET', `${base}/common/findSecConfigByType`, params).then(res => res.data); +} //提交订单 export const addOrderPay = params => { @@ -675,9 +679,8 @@ export const findUser = params => { // 获取用户余额 export const getUserAccount = params => { return POST('POST', `${userbase}/getUserAccount`, params).then(res => res.data); -} -//查询优惠券 +} +//查询优惠券 export const getUserDiscountList = params => { return POST('GET', `${userbase}/discount/getUserDiscountList`, params).then(res => res.data); } - diff --git a/pages/goods/refuel-confirm/refuel-confirm.vue b/pages/goods/refuel-confirm/refuel-confirm.vue index 294dd37..4f5097d 100644 --- a/pages/goods/refuel-confirm/refuel-confirm.vue +++ b/pages/goods/refuel-confirm/refuel-confirm.vue @@ -241,7 +241,7 @@ 优惠券选择 + @click="radioChanges(items)"> @@ -492,9 +492,9 @@ this.$refs.popup.show(); }, //选择优惠券 - radioChanges(item, items) { + radioChanges(item) { this.rechangeload(); - if (this.memDiscountId == items.id) { // 如果已经选中,则取消选中 + if (this.memDiscountId == item.id) { // 如果已经选中,则取消选中 this.memDiscountId = ''; this.deductionPrice = '0.00'; this.priceCaluc(this.orderList.payPrice); @@ -502,7 +502,7 @@ } else { // 否则进行选中赋值 if (item.discountType == 1) { if (this.orderPrice >= item.discountCondition) { - this.memDiscountId = items.id; + this.memDiscountId = item.id; //满减价格 this.deductionPrice = item.discountPrice; let oldprice = this.orderPrice - this.deductionPrice; @@ -516,14 +516,14 @@ } } if (item.discountType == 2) { - this.memDiscountId = items.id; + this.memDiscountId = item.id; //抵扣价格 this.deductionPrice = item.discountPrice; let oldprice = this.orderPrice - this.deductionPrice; this.priceCaluc(oldprice); } if (item.discountType == 3) { - this.memDiscountId = items.id; + this.memDiscountId = item.id; // 打折 this.deductionPrice = parseFloat(this.orderPrice - (this.orderPrice * item.discountPrice)).toFixed(2); let oldprice = parseFloat(this.orderPrice * item.discountPrice).toFixed(2); diff --git a/pages/tabBar/home/home.vue b/pages/tabBar/home/home.vue index 67f35d3..5c243f7 100644 --- a/pages/tabBar/home/home.vue +++ b/pages/tabBar/home/home.vue @@ -632,7 +632,7 @@ datas.push(this.homeCateList[i]) } } - let jumpid = datas[0].childDate[item].type; + let jumpid = datas[0].childDate[item].type; uni.navigateTo({ url: '../../user/news/news?id=' + jumpid }) @@ -962,8 +962,7 @@ .spcarea { width: 31%; - margin-right: auto; - margin-left: auto; + margin-left: 2%; padding-bottom: 10px; } diff --git a/subPages/recharge-centre/recharge-centre.vue b/subPages/recharge-centre/recharge-centre.vue index 844141a..9f3ebd1 100644 --- a/subPages/recharge-centre/recharge-centre.vue +++ b/subPages/recharge-centre/recharge-centre.vue @@ -1,44 +1,90 @@ @@ -48,17 +94,24 @@ // #endif let app = getApp(); import QSTabs from '../../components/QS-tabs/QS-tabs.vue'; + import swiperNavBar from '../../components/swiperNavBar.vue'; + import Postion from '@/components/postion/postion.vue'; + import wybPopup from '../../components/wyb-popup/wyb-popup.vue'; import { getListOutRechargePrice, - addOrderPay + addOrderPay, + findSecConfigByType, + getCmsContent } from '../../Utils/Api.js'; export default { components: { - QSTabs + QSTabs, + swiperNavBar, + Postion, + wybPopup }, data() { return { - typeId: '', inputAmountId: '', inputAmount: '', inputPhone: '', @@ -66,98 +119,118 @@ amountList: [], price: '', amoutstatus: '', - tabs: ["5个工作日", "6小时到账"], //切换操作 + tabs: [], //切换操作 current: 0, //默认 - swiperCurrent: 2, - imagewxUrl: app.globalData.imageWxImg, - image1:'telephone1.png', - image2:'telephone2.png' + swiperCurrent: 2, + imageUrl: app.globalData.imgUrl, + imagewxUrl: app.globalData.imageWxImg, + imgadres: 'noorder.png', + imgadres1: '', + image1: 'telephone1.png', + image2: 'telephone2.png', + notice: '', //警告 + textcont: '', // 富文本 + explainReceiptTime: '', //时间到账 + time: 0, + + //导航 + scrollIntoView: 0, //设置哪个方向可滚动,则在哪个方向滚动到该元素 + swiperTabList: [], //导航列表 + swiperTabIdx: 0, + swiperCurrentSize: '30rpx', //导航的字体大小 + swiperColor: '#333333', //导航栏字体未选中前颜色 + swiperCurrentColor: '#1D63FF', //选中当前导航栏字体颜色 + currentSwiperWidth: '33%', //当前导航的宽度 % upx rpx px (导航超出可左右滑动 ) + currentSwiperHeight: 100, //当前导航的高度度 rpx px + mainHeight: 240, //全屏或者局部滑动设置的高度 + currentSwiperLineShow: true, //是否显示导航栏的线条 (线条距离标题太近的话可自行修改.swiperLine的css) + currentSwiperLineActiveBg: '#1D63FF', //当前选中的导航栏线条颜色 + currentSwiperLineActiveWidth: '30rpx', //当前选中的导航栏线条的宽度 upx rpx px + currentSwiperLineActiveHeight: '6rpx', //当前选中的导航栏线条的高度度 upx rpx px + currentSwiperLineAnimatie: 300, //当前选中的导航栏线条过渡效果 + } }, onLoad(options) { - this.typeId = options.id; - if (!app.globalData.userInfo) { - if (this.typeId == 1) { - uni.setNavigationBarTitle({ - title: '中国移动' - }) - this.amoutType = 2; - this.getListOutRechargePrice(2); - return; - } - if (this.typeId == 2) { - uni.setNavigationBarTitle({ - title: '中国电信' - }) - this.amoutType = 1; - this.getListOutRechargePrice(1); - return; - } - if (this.typeId == 3) { - uni.setNavigationBarTitle({ - title: '中国联通' - }) - this.amoutType = 3; - this.getListOutRechargePrice(3); - return; - } - } + this.getCmsAactibity(); + this.getListOutRechargePrice(); }, onShow() { - this.amountList = []; - if (app.globalData.userInfo) { - if (this.typeId == 1) { - uni.setNavigationBarTitle({ - title: '中国移动' - }) - this.amoutType = 2; - this.getListOutRechargePrice(2); - return; - } - if (this.typeId == 2) { - uni.setNavigationBarTitle({ - title: '中国电信' - }) - this.amoutType = 1; - this.getListOutRechargePrice(1); - return; - } - if (this.typeId == 3) { - uni.setNavigationBarTitle({ - title: '中国联通' - }) - this.amoutType = 3; - this.getListOutRechargePrice(3); - return; + this.findSecConfigByType(); + this.findSecConfigByTypewap(); + }, + mounted() { + let scroll_width = 0; + const query = uni.createSelectorQuery().in(this); + query.select('.right-left-scroll').boundingClientRect(data => { + scroll_width = (data.width).toFixed(2); + }).exec(); + + query.select('.right-left-scroll .content').boundingClientRect(data => { + if (data.width - scroll_width > 0) { + this.time = (9 * data.width / scroll_width).toFixed(2); } - } + }).exec(); }, methods: { + //查询弹窗 + getCmsAactibity() { + let code; + // #ifdef H5 + code = '2' + // #endif + // #ifdef MP + code = '1' + // #endif + let params = { + companyId: app.globalData.companyId, + platform: code, + categoryCode: 'CMS_RECHARGE_POPOVER' + } + getCmsContent(params).then(res => { + if (res.return_code == '000000' && res.return_data.childCategory.length != 0) { + //弹窗首页广告 + this.imgadres1 = res.return_data.childCategory[0].imgData; + this.showPopup(); + } + }); + }, + //显示弹出 + showPopup() { + this.$refs.popup.show(); + }, + // 充值通知 + findSecConfigByType() { + let datas = { + codeType: 'EXPLAIN_NOTIFICATIONS' + } + findSecConfigByType(datas).then(res => { + if (res.return_code == '000000') { + this.notice = res.return_data.codeValue; + } + }); + }, + //充值警告 + findSecConfigByTypewap() { + let datas = { + codeType: 'EXPLAIN_WRAP ' + } + findSecConfigByType(datas).then(res => { + if (res.return_code == '000000') { + this.textcont = res.return_data.codeValue; + } + }); + }, select(amoutinfos) { this.inputAmount = amoutinfos.payPrice; this.price = amoutinfos.rechargePrice; this.inputAmountId = amoutinfos.id; this.amoutstatus = amoutinfos.status; }, - //筛选 - change(index) { - this.$refs.tabs.setFinishCurrent(index); - this.current = index; - this.inputAmount = ''; - this.inputAmountId = ''; - this.amoutstatus = ''; - if (index == 0) { - this.swiperCurrent = 2; - this.getListOutRechargePrice(this.amoutType); - } else { - this.swiperCurrent = 1; - this.getListOutRechargePrice(this.amoutType); - } - }, /** * 查询价格 */ - getListOutRechargePrice(item) { + getListOutRechargePrice() { uni.showLoading({ title: '加载中...' }) @@ -169,21 +242,38 @@ showType = 1; // #endif let params = { - operatorType: item, "companyId": app.globalData.companyId, - platformId: showType, - // rechargeType: this.swiperCurrent + platformId: showType } getListOutRechargePrice(params).then(res => { uni.hideLoading() if (res.return_code == '000000' && res.return_data) { - this.amountList = res.return_data; + this.tabs = res.return_data; + this.amountList = res.return_data[0].priceList; + this.explainReceiptTime = res.return_data[0].explain_receipt_time; + this.amoutType = res.return_data[0].id; } else { this.amountList = []; } }) }, + //tab点击事件 自行完善需要的代码 + CurrentTab: function(index) { + this.swiperTabIdx = index; + this.scrollIntoView = Math.max(0, index - 1); + this.explainReceiptTime = this.tabs[this.swiperTabIdx].explain_receipt_time; + this.amountList = this.tabs[this.swiperTabIdx].priceList; + this.amoutType = this.tabs[this.swiperTabIdx].id; + }, + //滑动事件 自行完善需要的代码 + SwiperChange: function(e) { + this.swiperTabIdx = e.detail.current; + this.scrollIntoView = Math.max(0, e.detail.current - 1); + this.explainReceiptTime = this.tabs[this.swiperTabIdx].explain_receipt_time; + this.amountList = this.tabs[this.swiperTabIdx].priceList; + this.amoutType = this.tabs[this.swiperTabIdx].id; + }, /** * 提交订单 */ @@ -241,9 +331,68 @@ diff --git a/subPages/recharge/recharge.vue b/subPages/recharge/recharge.vue index aaae763..402bcea 100644 --- a/subPages/recharge/recharge.vue +++ b/subPages/recharge/recharge.vue @@ -4,10 +4,10 @@ - - + --> diff --git a/subPages/static/tongz.png b/subPages/static/tongz.png new file mode 100644 index 0000000000000000000000000000000000000000..b712ee99f0d3f17b97a6eee2d4d3d2c38682937b GIT binary patch literal 1576 zcmV+@2G{wCP)Px);z>k7RCr$Pnq6!ZRTRh1xm&;n6Vw+ZK8gts1VbRwAl=yo0^Qy%Boc@ZegsX* zPGdBDq{gpMVthalF||7j55@6fHZ)%)&0W z)0w$5yW9O>cOQ4|$NB&6x%Zs=fzaSTY;gV11km(=1}D&*0uAl}%|)=PQ(z<+>kD@! z`b00x=<4gl=o9*rod|D>|25klS~UQsc*bzA!nJ8OWOS9Ti~bD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