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 0000000..b712ee9 Binary files /dev/null and b/subPages/static/tongz.png differ diff --git a/uni.scss b/uni.scss index f36e81f..3e9061d 100644 --- a/uni.scss +++ b/uni.scss @@ -309,6 +309,10 @@ $uni-font-size-paragraph:30upx; .backcorltop{ background: linear-gradient(to bottom, #3da7e7, #6fbdee); } + +.backcorlf5{ + background: linear-gradient(to bottom, #3267f6, #f5f5f5); +} .backcorf06{ background-color: #0083f5; @@ -590,6 +594,11 @@ $uni-font-size-paragraph:30upx; .height25 { height: 25px; } + +.height25l { + height: 25px; + line-height: 25px; +} .height50 {