diff --git a/App.vue b/App.vue index f8a2e7f..750f205 100644 --- a/App.vue +++ b/App.vue @@ -27,7 +27,9 @@ latitude: '', balancePrice: '', balanceCardNo: '', - identificationCode: '', + identificationCode: '', + //公司id + companyId:'', // h5获取信息 h5code: '', //门店ID @@ -84,7 +86,75 @@ that.globalData.token = e.data; } } - }) + }) + + + + uni.getStorage({ + key: 'accountId', + success(e) { + if (e.data) { + that.globalData.accountId = e.data; + that.globalData.accountType = e.data; + } + } + }) + uni.getStorage({ + key: 'gasKey', + success(e) { + if (e.data) { + that.globalData.gasKey = e.data; + } + } + }) + uni.getStorage({ + key: 'staffCode', + success(e) { + if (e.data) { + if (that.globalData.accountId == '000001&key' || that.globalData.accountId == + '000000&gasKey' || that.globalData.accountId == '000009&key' || that.globalData.accountId == '0000010&key') { + that.globalData.staffCode = e.data; + } else { + that.globalData.mchId = e.data; + } + } + } + }) + + uni.getStorage({ + key: 'cityId', + success(e) { + if (e.data) { + that.globalData.cityId = e.data; + } + } + }) + + uni.getStorage({ + key: 'companyId', + success(e) { + if (e.data) { + that.globalData.companyId = e.data; + } + } + }) + + uni.getStorage({ + key: 'latitude', + success(e) { + if (e.data) { + that.globalData.latitude = e.data; + } + } + }) + uni.getStorage({ + key: 'longitude', + success(e) { + if (e.data) { + that.globalData.longitude = e.data; + } + } + }) }, onHide: function() {} } diff --git a/Utils/Api.js b/Utils/Api.js index 5e6e2b0..43094d4 100644 --- a/Utils/Api.js +++ b/Utils/Api.js @@ -594,3 +594,8 @@ export const czhltUnionCardPay = params => { export const getUserOrderListhuafei = params => { return POST('GET', `${base}/outRechargeOrder/getUserOrderList`, params).then(res => res.data); } + +//肯德基返利 +export const getRebateIntegral = params => { + return POST('POST', `${base}/common/getRebateIntegral`, params).then(res => res.data); +} diff --git a/manifest.json b/manifest.json index 348d218..5c09ace 100644 --- a/manifest.json +++ b/manifest.json @@ -86,7 +86,7 @@ }, "devServer" : { "port" : "", - "https" : true + "https" : false }, "domain" : "https://hsgcs.dctpay.com", "template" : "index.html" diff --git a/member-Recharge/rec-confirmation/rec-confirmation.vue b/member-Recharge/rec-confirmation/rec-confirmation.vue index 66e3c46..7ff891b 100644 --- a/member-Recharge/rec-confirmation/rec-confirmation.vue +++ b/member-Recharge/rec-confirmation/rec-confirmation.vue @@ -72,7 +72,27 @@ ¥{{priceValue[1] / 100}} - + + + + + + 下单返积分 + + + 返{{rebateIntegral}}积分 + + + {{rebateIntegral}} + + + + + 积分抵扣与优惠券抵扣不同享 + + 支付方式 @@ -116,17 +136,17 @@ 优惠券选择 - - - - - {{items.discountName}} + + + + {{items.discountName}} 有效期:{{items.useEndTime | timeFormat('yyyy-mm-dd hh:mm:ss')}} - - + + { + if (res.return_code == '000000') { + this.rebateIntegral = res.return_data; + this.Integrastu = 1; + }else{ + this.rebateIntegral = res.return_msg; + this.Integrastu = 2; + } + }) }, //查询工会卡详情 getHuiLianTongCardBalance() { @@ -298,7 +340,8 @@ this.paytype = ''; } else { this.isUse = true; - } + } + this.getRebateIntegral(); }, //获取选择支付方式 changeRiado() { @@ -462,7 +505,8 @@ this.payPrice = Math.abs(parseFloat(this.orderPrice - (parseFloat(this.priceValue[1] / 100).toFixed( 2)) - this .deductionPrice).toFixed(2)); - } + } + this.getRebateIntegral(); }, rechangeload() { this.isUse = false; @@ -802,10 +846,10 @@ border-radius: 8px; image { - float: left; - width: 170rpx; - max-height: 170rpx; - margin-left: 10px; + // float: left; + width: 160rpx; + max-height: 160rpx; + // margin-left: 10px; } } diff --git a/pages/goods/refuel-confirm/refuel-confirm.vue b/pages/goods/refuel-confirm/refuel-confirm.vue index a78e6b3..35b1b2c 100644 --- a/pages/goods/refuel-confirm/refuel-confirm.vue +++ b/pages/goods/refuel-confirm/refuel-confirm.vue @@ -120,6 +120,25 @@ ¥{{priceValue[1] / 100}} + + + + + 下单返积分 + + + 返{{rebateIntegral}}积分 + + + {{rebateIntegral}} + + + + + 积分抵扣与优惠券抵扣不同享 + @@ -176,18 +195,18 @@ 优惠券选择 - - - - - {{items.highDiscount.discountName}} + + + + {{items.highDiscount.discountName}} 有效期:{{items.highDiscount.salesEndTime | timeFormat('yyyy-mm-dd hh:mm:ss')}} - - + + @@ -219,7 +238,8 @@ canUseDiscount, addOrder, cancelOrder, - oilPriceDiscountCompute + oilPriceDiscountCompute, + getRebateIntegral } from '../../../Utils/Api.js'; import ssPaymentPassword from '../../../components/sanshui-payment-password/index.vue'; import wybPopup from '../../../components/wyb-popup/wyb-popup.vue'; @@ -256,7 +276,9 @@ memDiscountId: '', //优惠券id priceValue: [0, 0], // 积分可以指定默认值 availIntegal: 0, // 可用积分 - gasOrderList: '' //存的订单信息 + gasOrderList: '', //存的订单信息 + rebateIntegral: '', //返回积分 + Integrastu: 1 //返积分状态 } }, onLoad(e) { @@ -266,9 +288,9 @@ onShow() { let that = this; // that.paytype = ''; - that.findUser(); - this.priceValue[1] = 0; - this.reload(); + that.findUser(); + this.priceValue[1] = 0; + this.reload(); this.calculatepayPrice(); }, methods: { @@ -290,6 +312,24 @@ } }); }, + //支付返利积分 + getRebateIntegral() { + let datas = { + "companyId": app.globalData.companyId, + "price": this.payPrice, + "productId": 1, + "type": 3, + } + getRebateIntegral(datas).then(res => { + if (res.return_code == '000000') { + this.rebateIntegral = res.return_data; + this.Integrastu = 1; + } else { + this.rebateIntegral = res.return_msg; + this.Integrastu = 2; + } + }) + }, //查询优惠券 canUseDiscount() { let params = { @@ -323,6 +363,8 @@ } else { this.availIntegal = payprice; } + + this.getRebateIntegral(); } }) }, @@ -385,7 +427,7 @@ } else { this.availIntegal = payprice; this.priceValue[1] = 0; - } + } this.reload(); this.calculatepayPrice(); }, @@ -400,7 +442,8 @@ this.payPrice = Math.abs(parseFloat(this.orderPrice - (parseFloat(this.priceValue[1] / 100).toFixed( 2)) - this .deductionPrice).toFixed(2)); - } + } + this.getRebateIntegral(); }, rechangeload() { this.isUse = false; @@ -433,7 +476,8 @@ this.paytype = ''; } else { this.isUse = true; - } + } + this.getRebateIntegral(); }, //密码支付完成 @@ -1034,10 +1078,10 @@ border-radius: 8px; image { - float: left; - width: 170rpx; - max-height: 170rpx; - margin-left: 10px; + // float: left; + width: 160rpx; + max-height: 160rpx; + // margin-left: 10px; } } diff --git a/pages/goods/refuel-details/refuel-details.vue b/pages/goods/refuel-details/refuel-details.vue index b083c97..cbfee48 100644 --- a/pages/goods/refuel-details/refuel-details.vue +++ b/pages/goods/refuel-details/refuel-details.vue @@ -76,8 +76,11 @@ - {{amount.codeValue}}元 - 最高优惠¥{{amount.codeName}} + + {{amount.codeValue}}元 + + + 最高优惠¥{{amount.codeName}} @@ -156,7 +159,7 @@ - + 提示: {{showtoastdes}} 立即登录 @@ -175,7 +178,7 @@ oilPriceDiscountCompute, recentGasStation, sendSmsCodeByHw, - H5login, + H5login, getDictionaryByCodeType } from '../../../Utils/Api.js'; import wybPopup from '../../../components/wyb-popup/wyb-popup.vue'; @@ -194,7 +197,7 @@ detailList: [], gunnumber: [], user: '', - amountList: [ + amountList: [ // { // id: '1', // price: '200' @@ -244,39 +247,52 @@ code: '', getCodeText: '获取验证码', getCodeBtnColor: "#ffffff", - getCodeisWaiting: false, - showtoastdes:'' // 未登陆错误 + getCodeisWaiting: false, + showtoastdes: '' // 未登陆错误 } }, onLoad(options) { - this.store_key = options.id; - this.counId = options.desId; - this.oilNo = options.oilNo; + let that = this; + // #ifdef MP + that.store_key = options.id; + // #endif + // #ifdef H5 + uni.getStorage({ + key: 'store_key', + success(e) { + if (e.data) { + that.store_key = e.data; + } + } + }) + // #endif + that.counId = options.desId; + that.oilNo = options.oilNo; if (app.globalData.accountId) { - this.isTyAgent = true; + that.isTyAgent = true; } if (app.globalData.gasKey && app.globalData.accountType == '000000&gasKey') { - this.store_key = app.globalData.gasKey; + that.store_key = app.globalData.gasKey; } else { app.globalData.staffCode = ''; } - // #ifdef H5 - if (app.globalData.accountType && app.globalData.accountType == '000000#/') { - this.recentGasStation(); + // #ifdef H5 + if (app.globalData.accountType && app.globalData.accountType == '000000#/') { + that.recentGasStation(); } else { - this.getGasDetailByStoreKey(); + that.getGasDetailByStoreKey(); } // #endif // #ifdef MP - this.getGasDetailByStoreKey(); + that.getGasDetailByStoreKey(); // #endif - this.getDictionaryByCodeTypeOl(); - this.getDictionaryByCodeTypeMoney(); - this.getDictionaryByCodeType(); + that.getDictionaryByCodeTypeOl(); + that.getDictionaryByCodeTypeMoney(); + that.getDictionaryByCodeType(); }, onShow() { - this.user = app.globalData.userInfo; + this.user = app.globalData.userInfo; }, onUnload() { if (app.globalData.accountType && app.globalData.accountType == '000000#/') { @@ -286,18 +302,18 @@ app.globalData.accountType = ''; } }, - methods: { - //价格 - //查询油品 - getDictionaryByCodeType() { - let datas = { - codeType: 'REFUEL_PRICE' - } - getDictionaryByCodeType(datas).then(res => { - if (res.return_code == '000000') { - this.amountList = res.return_data; - } - }) + methods: { + //价格 + //查询油品 + getDictionaryByCodeType() { + let datas = { + codeType: 'REFUEL_PRICE' + } + getDictionaryByCodeType(datas).then(res => { + if (res.return_code == '000000') { + this.amountList = res.return_data; + } + }) }, //一键加油登陆 //跳转协议 @@ -409,12 +425,12 @@ }) this.$refs.popups.hide(); this.postionIng(); - } else { + } else { this.showtoastdes = res.return_msg; - uni.showToast({ + uni.showToast({ title: res.return_msg, - icon: "none", - duration:2000 + icon: "none", + duration: 2000 }); } }) @@ -424,6 +440,11 @@ //前往导航 seeloaction() { + // #ifdef H5 + window.open( + `//uri.amap.com/navigation?from=${app.globalData.longitude},${app.globalData.latitude},我的位置&to=${this.storeList.gasAddressLongitude},${this.storeList.gasAddressLatitude},${this.storeList.gasAddress}&mode=car&policy=1&src=mypage&coordinate=gaode&callnative=1` + ) + // #endif // #ifdef MP uni.openLocation({ latitude: Number(this.storeList.gasAddressLatitude), //目的地的定位 @@ -442,7 +463,7 @@ this.$refs.popups.show(); }, //一键加油 - recentGasStation() { + recentGasStation() { this.gunnumber = []; uni.showLoading({ title: '加载中...' @@ -454,24 +475,53 @@ } recentGasStation(params).then(res => { uni.hideLoading(); - if (res.return_code == '000000') { + if (res.return_code == '000000') { this.storeList = res.return_data; - if (!this.oilNo) { - this.oilNo = res.return_data.oilPriceList[0].oilNoName; - this.priceVip = res.return_data.oilPriceList[0].priceVip; - this.priceGun = res.return_data.oilPriceList[0].priceGun; - 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.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) { - this.gunnumber.push(res.return_data.gasGunList[i]) - // this.gunNo = res.return_data.gasGunList[i].gunNo; - this.gasOilNo = res.return_data.gasGunList[i].oilNo; - } - } + // if (!this.oilNo) { + // this.oilNo = res.return_data.oilPriceList[0].oilNoName; + // this.priceVip = res.return_data.oilPriceList[0].priceVip; + // this.priceGun = res.return_data.oilPriceList[0].priceGun; + // 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.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) { + // this.gunnumber.push(res.return_data.gasGunList[i]) + // // this.gunNo = res.return_data.gasGunList[i].gunNo; + // this.gasOilNo = res.return_data.gasGunList[i].oilNo; + // } + // } + // } + + if (!this.oilNo || this.oilNo == undefined) { + this.oilNo = res.return_data.oilPriceList[0].oilNoName; + this.priceVip = res.return_data.oilPriceList[0].priceVip; + this.priceGun = res.return_data.oilPriceList[0].priceGun; + this.priceOfficial = res.return_data.oilPriceList[0].priceOfficial; + this.oilType = res.return_data.oilPriceList[0].oilType; + } else { + let oillist = res.return_data.oilPriceList; + for (var i = 0; i < oillist.length; i++) { + if (this.oilNo == oillist[i].oilNoName) { + this.priceVip = oillist[i].priceVip; + this.priceGun = oillist[i].priceGun; + this.priceOfficial = oillist[i].priceOfficial; + this.oilType = oillist[i].oilType; + } + } + } + + this.detailList = res.return_data.oilPriceList; + this.counId = res.return_data.goodsId; + this.gasGunList = res.return_data.gasGunList; + for (var i = 0; i < res.return_data.gasGunList.length; i++) { + if (this.oilNo == res.return_data.gasGunList[i].oilNoName) { + this.gunnumber.push(res.return_data.gasGunList[i]) + // this.gunNo = res.return_data.gasGunList[i].gunNo; + this.gasOilNo = res.return_data.gasGunList[i].oilNo; + } } } else { uni.showToast({ @@ -483,7 +533,7 @@ }) }, //查询详情 - getGasDetailByStoreKey() { + getGasDetailByStoreKey() { this.gunnumber = []; uni.showLoading({ title: '加载中...' @@ -496,7 +546,7 @@ } getGasDetailByStoreKey(params).then(res => { uni.hideLoading(); - if (res.return_code == '000000') { + if (res.return_code == '000000') { this.storeList = res.return_data; if (!this.oilNo || this.oilNo == undefined) { this.oilNo = res.return_data.oilPriceList[0].oilNoName; @@ -1096,9 +1146,11 @@ font-size: 12px; } } - .colorfe80{ - color: #089bf5; + + .colorfe80 { + color: #089bf5; } + .footer { position: fixed; bottom: 0upx; diff --git a/pages/goods/refuel/refuel.vue b/pages/goods/refuel/refuel.vue index fb00bf3..bb66e3e 100644 --- a/pages/goods/refuel/refuel.vue +++ b/pages/goods/refuel/refuel.vue @@ -156,13 +156,21 @@ } }, onLoad() { + // let that = this; + // that.getDictionaryByCodeType(); + // if (app.globalData.accountId) { + // that.isTyAgent = true; + // } + // that.getGasStoreList(); + + }, + onShow() { let that = this; that.getDictionaryByCodeType(); if (app.globalData.accountId) { that.isTyAgent = true; } that.getGasStoreList(); - }, onReachBottom() { this.getGasStoreList(); @@ -192,8 +200,8 @@ seeloaction(item) { // #ifdef H5 - // window.location.href = - // `http://apis.map.qq.com/uri/v1/marker?marker=coord:(${item.latitude},${item.longitude})&addr:${item.address}`; + window.location.href = + `http://apis.map.qq.com/uri/v1/marker?marker=coord:(${item.latitude},${item.longitude})&addr:${item.address}`; // #endif // #ifdef MP uni.openLocation({ @@ -260,6 +268,7 @@ pageSize: this.pageSize, isTyAgent: this.isTyAgent } + getGasStoreList(params).then(res => { if (res.return_code == '000000') { uni.hideLoading(); @@ -281,6 +290,10 @@ url: '../refuel-details/refuel-details?id=' + items + '&desId=' + itemId + '&oilNo=' + this .onilName }) + uni.setStorage({ + key: "store_key", + data: items + }) }, result(val) { console.log('filter_result:' + JSON.stringify(val)); diff --git a/pages/goods/store-list/store-details.vue b/pages/goods/store-list/store-details.vue index 30720e3..9d5d595 100644 --- a/pages/goods/store-list/store-details.vue +++ b/pages/goods/store-list/store-details.vue @@ -3,16 +3,17 @@ - + + {{merchanList.storeName}} - + {{merchanList.address}} 营业时间: 00:00-23:59 - + {{distance}}km @@ -20,14 +21,16 @@ - + {{mers.highCouponModel.couponName}} 有效期至:{{mers.useEndTime | formatDate('-')}} - - 查看详情 + + 查看详情 + @@ -88,8 +91,25 @@ } }, onLoad(option) { - this.merchanId = option.id; - this.distance = option.juli; + let that = this; + that.merchanId = option.id; + that.distance = option.juli; + uni.getStorage({ + key: 'store_id', + success(e) { + if (e.data) { + that.merchanId = e.data; + } + } + }) + uni.getStorage({ + key: 'store_juli', + success(e) { + if (e.data) { + that.distance = e.data; + } + } + }) }, onShow() { this.user = app.globalData.userInfo; @@ -105,7 +125,7 @@ //获取登陆信息 getuserinfo() { uni.navigateTo({ - url:'../../userLogin/userLogin' + url: '../../userLogin/userLogin' }) }, //查询门店详情 @@ -133,12 +153,20 @@ }, //前往导航 seeloaction() { - uni.openLocation({ - latitude: Number(this.merchanList.latitude), //目的地的定位 - longitude: Number(this.merchanList.longitude), //目的地的定位 - name: this.merchanList.storeName, - address: this.merchanList.address - }) + // #ifdef H5 + window.open( + `//uri.amap.com/navigation?from=${app.globalData.longitude},${app.globalData.latitude},我的位置&to=${this.merchanList.longitude},${this.merchanList.latitude},${this.merchanList.address}&mode=car&policy=1&src=mypage&coordinate=gaode&callnative=1` + ) + // #endif + // #ifdef MP + uni.openLocation({ + latitude: Number(this.merchanList.latitude), //目的地的定位 + longitude: Number(this.merchanList.longitude), //目的地的定位 + name: this.merchanList.storeName, + address: this.merchanList.address + }) + + // #endif }, //查询门店对应的卡券 getCouponListByStoreId() { @@ -190,26 +218,29 @@ .headimg { width: 160rpx; max-height: 160rpx; - margin-top: -40px; - margin-left: 20px; + margin-top: -40px; + margin-left: 20px; } - .store_rig{ + + .store_rig { margin-left: 210rpx; } - .store_zp{ + + .store_zp { background: #e6f2fe; color: #0084f5; padding-left: 4px; padding-right: 4px; } } - .store_btn{ - border: 2px solid #0084f5; - color: #0084f5; - width: 150rpx; - padding: 6px; - text-align: center; - border-radius: 5px; + + .store_btn { + border: 2px solid #0084f5; + color: #0084f5; + width: 150rpx; + padding: 6px; + text-align: center; + border-radius: 5px; } diff --git a/pages/order/confirmation.vue b/pages/order/confirmation.vue index 4eef259..5903071 100644 --- a/pages/order/confirmation.vue +++ b/pages/order/confirmation.vue @@ -960,8 +960,8 @@ display: flex; image { - width: 170rpx; - max-height: 170rpx; + width: 160rpx; + max-height: 160rpx; } } diff --git a/pages/tabBar/category/category.vue b/pages/tabBar/category/category.vue index b91bd27..0870663 100644 --- a/pages/tabBar/category/category.vue +++ b/pages/tabBar/category/category.vue @@ -261,7 +261,15 @@ }) // uni.navigateTo({ // url: '../../goods/goods?id=' + e - // }); + // }); + uni.setStorage({ + key: "store_id", + data: e.id + }) + uni.setStorage({ + key: "store_juli", + data: e.distance + }) }, //搜索跳转 toSearch() { diff --git a/pages/tabBar/home/home.vue b/pages/tabBar/home/home.vue index 7dd8350..3ca70d3 100644 --- a/pages/tabBar/home/home.vue +++ b/pages/tabBar/home/home.vue @@ -223,7 +223,8 @@ success(e) { if (e.data) { if (app.globalData.accountId == '000001&key' || app.globalData.accountId == - '000000&gasKey' || app.globalData.accountId == '000009&key' || app.globalData.accountId == '0000010&key') { + '000000&gasKey' || app.globalData.accountId == '000009&key' || app.globalData + .accountId == '0000010&key') { app.globalData.staffCode = e.data; } else { app.globalData.mchId = e.data; @@ -234,7 +235,7 @@ // #endif }, onLoad(options) { - let that = this; + let that = this; // #ifdef MP // 1.wx获取登录用户code uni.login({ @@ -269,6 +270,16 @@ uni.hideLoading(); app.globalData.latitude = res.lat; app.globalData.longitude = res.lng; + + uni.setStorage({ + key: "latitude", + data: res.lat + }) + + uni.setStorage({ + key: "longitude", + data: res.lng + }) that.findByLatAndLng(res.lng, res.lat); }, err => { @@ -323,9 +334,16 @@ }, //获取首页功能 getCmsContentcmsContent() { + let code; + // #ifdef H5 + code = 'CMS_H5_IMG' + // #endif + // #ifdef MP + code = 'CMS_HOME_CONTENT' + // #endif let params = { regionId: app.globalData.cityId, - categoryCode: 'CMS_HOME_CONTENT' + categoryCode: code } getCmsContent(params).then(res => { if (res.return_code == '000000') { @@ -343,9 +361,16 @@ }, //获取首页菜单 getCmsContentcmshome() { + let code; + // #ifdef H5 + code = 'CMS_H5_FAST' + // #endif + // #ifdef MP + code = 'CMS_HOME_NAV' + // #endif let params = { regionId: app.globalData.cityId, - categoryCode: 'CMS_HOME_NAV' + categoryCode: code } getCmsContent(params).then(res => { if (res.return_code == '000000') { @@ -367,9 +392,16 @@ }); }, getCmsAactibity() { + let code; + // #ifdef H5 + code = 'CMS_H5_ALERT' + // #endif + // #ifdef MP + code = 'CMS_WX_APPLETS_HOME_ACTIVITY' + // #endif let params = { regionId: app.globalData.cityId, - categoryCode: 'CMS_WX_APPLETS_HOME_ACTIVITY' + categoryCode: code } getCmsContent(params).then(res => { if (res.return_code == '000000' && res.return_data != '') { @@ -466,6 +498,15 @@ app.globalData.cityName = res.return_data.provinceName; app.globalData.qianzhuCityName = res.return_data.cityName; app.globalData.cityId = res.return_data.regionId; + app.globalData.companyId = res.return_data.companyId; + uni.setStorage({ + key: "cityId", + data: res.return_data.regionId + }) + uni.setStorage({ + key: "companyId", + data: res.return_data.companyId + }) // app.globalData.cityId = '500103'; if (res.return_data.regionId) { that.getCouponListArea(); @@ -475,7 +516,7 @@ that.getCmsAactibity(); that.getCmsContentcmshome(); that.getCmsContentcmsContent(); - } + } uni.getStorage({ key: 'accountType', success(e) { @@ -492,7 +533,7 @@ // 006 话费充值 // 007 在线加油 // 008 工会卡卡券 - // 009 分销推广优选商品 + // 009 分销推广优选商品 // 0010 只跳首页 if (e.data == '000000#/' && app.globalData.h5code) { uni.navigateTo({ @@ -553,12 +594,12 @@ } } }) - }else{ - uni.showToast({ - title: res.return_msg, - icon: 'none', - duration: 2000 - }) + } else { + uni.showToast({ + title: res.return_msg, + icon: 'none', + duration: 2000 + }) } }); }, diff --git a/pages/user/bindingCard/bindingCard.vue b/pages/user/bindingCard/bindingCard.vue index bdcd3c3..d09bd26 100644 --- a/pages/user/bindingCard/bindingCard.vue +++ b/pages/user/bindingCard/bindingCard.vue @@ -10,15 +10,15 @@ - + - + @@ -32,11 +32,11 @@ 绑定卡号 获取预留手机号 - + @@ -70,7 +70,6 @@ }, onLoad(options) { this.user = app.globalData.userInfo; - // this.getHuiLianTongCardByPhone(); this.getDictionaryByCodeType(); }, @@ -84,13 +83,16 @@ if (res.return_code == '000000') { this.cardList = res.return_data; this.type = res.return_data[0].codeValue; + if (this.type == 1) { + this.getHuiLianTongCardByPhone(); + } this.typeName = res.return_data[0].codeName; } }) }, //查询我的卡号列表 getHuiLianTongCardByPhone() { - let params = { + let params = { phone: this.user.phone } uni.showLoading(); @@ -98,7 +100,11 @@ uni.hideLoading(); if (res.return_code == '000000' && res.return_data != '') { this.UserCard = res.return_data; - this.cardNoNumber = res.return_data[0].cardNo; + this.cardNoNumber = res.return_data[0].cardNo; + let params = { + cardNo: this.cardNoNumber + } + this.getHuiLianTongCardByCardNo(params); return; } this.UserCard = ''; @@ -106,15 +112,22 @@ }, //选择卡类型 changeUserCard(e) { - this.type = this.cardList[e.target.value].codeValue; - this.typeName = this.cardList[e.target.value].codeName; - this.cardNoNumber = ''; - this.phoneNumber = ''; + this.type = this.cardList[e.target.value].codeValue; + if(this.type == 1){ + this.getHuiLianTongCardByPhone(); + } + this.typeName = this.cardList[e.target.value].codeName; + this.cardNoNumber = ''; + this.phoneNumber = ''; this.disStute = false; }, //选择卡号 bindUserCard(e) { - this.cardNoNumber = this.UserCard[e.target.value].cardNo; + this.cardNoNumber = this.UserCard[e.target.value].cardNo; + let params = { + cardNo: this.cardNoNumber + } + this.getHuiLianTongCardByCardNo(params); }, getCode() { uni.hideKeyboard() @@ -132,8 +145,8 @@ title: '发送中...' }) let params = { - phone: this.phoneNumber, - HWMSG:1 + phone: this.phoneNumber, + HWMSG: 1 } sendSmsCodeByHw(params).then(res => { if (res.return_code == '000000') { @@ -284,8 +297,7 @@ duration: 2000, success() { setTimeout(() => { - uni.navigateBack({ - }) + uni.navigateBack({}) }, 1000) } }); diff --git a/pages/user/positioning/positioning.vue b/pages/user/positioning/positioning.vue index 93acd45..6cdede3 100644 --- a/pages/user/positioning/positioning.vue +++ b/pages/user/positioning/positioning.vue @@ -109,7 +109,8 @@ if (res.return_code == '000000') { app.globalData.cityName = res.return_data.provinceName; app.globalData.qianzhuCityName = res.return_data.cityName; - app.globalData.cityId = res.return_data.regionId; + app.globalData.cityId = res.return_data.regionId; + app.globalData.companyId = res.return_data.companyId; uni.navigateBack({}) } else { uni.showToast({ diff --git a/qianzhu-KFC/buffet-order/buffet-order.vue b/qianzhu-KFC/buffet-order/buffet-order.vue index 3bebbb3..10229e8 100644 --- a/qianzhu-KFC/buffet-order/buffet-order.vue +++ b/qianzhu-KFC/buffet-order/buffet-order.vue @@ -107,12 +107,14 @@ jumpmenulist(item) { if (this.typeid == 2) { uni.navigateTo({ - url: '../menu-list/menu-list?storeCode=' + item.code + url: '../menu-list/menu-list?storeCode=' + item.code + '&sttime=' + item.startTime + + '&entime=' + item.endTime }) } if (this.typeid == 1) { uni.navigateTo({ - url: '../kfc-menu-list/kfc-menu-list?storeCode=' + item.storeCode + url: '../kfc-menu-list/kfc-menu-list?storeCode=' + item.storeCode + '&sttime=' + item + .startTime + '&entime=' + item.endTime }) } }, @@ -126,8 +128,8 @@ lon: app.globalData.longitude } getStarbucksStore(datas).then(res => { - setTimeout(() => { - uni.hideLoading(); + setTimeout(() => { + uni.hideLoading(); }, 1000); if (res.return_code == '000000') { this.kcfShopList = res.return_data; @@ -146,8 +148,8 @@ lon: app.globalData.longitude } getKfcStoresList(datas).then(res => { - setTimeout(() => { - uni.hideLoading(); + setTimeout(() => { + uni.hideLoading(); }, 1000); if (res.return_code == '000000') { this.kcfShopList = res.return_data; diff --git a/qianzhu-KFC/confirmOrder/confirmOrder.vue b/qianzhu-KFC/confirmOrder/confirmOrder.vue index 4cb27b2..9511c41 100644 --- a/qianzhu-KFC/confirmOrder/confirmOrder.vue +++ b/qianzhu-KFC/confirmOrder/confirmOrder.vue @@ -114,6 +114,28 @@ ¥{{priceValue[1] / 100}} + + + + + + 下单返积分 + + + 返{{rebateIntegral}}积分 + + + {{rebateIntegral}} + + + + + 积分抵扣与优惠券抵扣不同享 + + + 支付方式 @@ -214,17 +236,17 @@ 优惠券选择 - - - - - {{items.discountName}} + + + + {{items.discountName}} 有效期:{{items.useEndTime | timeFormat('yyyy-mm-dd hh:mm:ss')}} - - + + @@ -265,7 +287,8 @@ qianzhuorderToPayByWx, czhltUnionCardPay, getUserOrderPreList, - thirdCancelOrder + thirdCancelOrder, + getRebateIntegral } from '../../Utils/Api.js'; // #ifdef H5 var jweixin = require('jweixin-module'); @@ -281,7 +304,7 @@ return { orderList: [], sttypeid: 1, - paytype: '', //支付方式 + paytype: '2', //支付方式 typeid: app.globalData.distinguishid, //类型区分 priceValue: [0, 0], // 积分可以指定默认值 availIntegal: 0, // 可用积分 @@ -308,6 +331,8 @@ imageUrl: app.globalData.imgUrl, //图片地址 orderPrice: 0, //订单价格 rechargeDes: '', // 支付详情 + rebateIntegral: '', //返回积分 + Integrastu: 1 //返积分状态 } }, onLoad() { @@ -358,6 +383,24 @@ } }); }, + //支付返利积分 + getRebateIntegral() { + let datas = { + "companyId": app.globalData.companyId, + "price": this.payPrice, + "productId": this.productType, + "type": 4, + } + getRebateIntegral(datas).then(res => { + if (res.return_code == '000000') { + this.rebateIntegral = res.return_data; + this.Integrastu = 1; + } else { + this.rebateIntegral = res.return_msg; + this.Integrastu = 2; + } + }) + }, //查询积分 findUser() { findUser().then(res => { @@ -367,6 +410,7 @@ this.getHuiLianTongCardBalance(); this.getThirdPartyByDetail(); this.getUserOrderPreList(); + this.getRebateIntegral(); uni.setStorage({ key: "user", data: res.return_data @@ -462,6 +506,7 @@ } else { this.isUse = true; } + this.getRebateIntegral(); }, //获取选择支付方式 changeRiado() { @@ -682,7 +727,8 @@ this.payPrice = Math.abs(parseFloat(this.orderPrice - (parseFloat(this.priceValue[1] / 100).toFixed( 2)) - this .deductionPrice).toFixed(2)); - } + } + this.getRebateIntegral(); }, rechangeload() { this.isUse = false; @@ -746,14 +792,14 @@ icon: 'none', title: '工会卡余额不足', duration: 2000, - }); + }); that.thirdCancelOrder(); return; } if (!that.user.isSetPayPwd) { uni.navigateTo({ url: '../../pages/login/updatePas/updatePas' - }) + }) that.thirdCancelOrder(); return; } @@ -769,7 +815,7 @@ }) }, 1000) } - }); + }); that.thirdCancelOrder(); return; } @@ -842,12 +888,12 @@ }) return; } - if (res.return_code == '102130') { + if (res.return_code == '102130') { uni.navigateTo({ url: '../../login/updatePas/updatePas' }) return; - } + } this.thirdCancelOrder(); uni.showToast({ title: res.return_msg, @@ -1037,10 +1083,10 @@ border-radius: 8px; image { - float: left; - width: 170rpx; - max-height: 170rpx; - margin-left: 10px; + // float: left; + width: 160rpx; + max-height: 160rpx; + // margin-left: 10px; } } diff --git a/qianzhu-KFC/kfc-menu-list/kfc-menu-list.vue b/qianzhu-KFC/kfc-menu-list/kfc-menu-list.vue index 59706d4..b9c79fc 100644 --- a/qianzhu-KFC/kfc-menu-list/kfc-menu-list.vue +++ b/qianzhu-KFC/kfc-menu-list/kfc-menu-list.vue @@ -1,19 +1,17 @@