diff --git a/Utils/Api.js b/Utils/Api.js index 3973b66..5906773 100644 --- a/Utils/Api.js +++ b/Utils/Api.js @@ -400,7 +400,26 @@ export const getMemberProducts = params => { return POST('GET', `${base}/highThirdParty/getMemberProducts`, params).then(res => res.data); } - +//分销统计数据 +export const userDistributionStatistics = params => { + return POST('GET', `${base}/highUser/userDistributionStatistics`, params).then(res => res.data); +} +//邀请列表 +export const distributionInviteList = params => { + return POST('GET', `${base}/highUser/distributionInviteList`, params).then(res => res.data); +} +//分销用户积分列表 +export const distributionOrderList = params => { + return POST('GET', `${base}/highUser/distributionOrderList`, params).then(res => res.data); +} +//分销用户积分列表 +export const promoteOrderList = params => { + return POST('GET', `${base}/highUser/promoteOrderList`, params).then(res => res.data); +} +//生成海报 +export const promotionalPosters = params => { + return POST('GET', `${base}/highUser/promotionalPosters`, params).then(res => res.data); +} export const qzOrderToPay = params => { return POST('POST', `${base}/order/qzOrderToPay`, params).then(res => res.data); @@ -416,7 +435,13 @@ export const cancelOrderByOrderNo = params => { /** * H5 获取用户信息 - */ + */ + +//h5静默登陆 +export const loginBySilence = params => { + return POST('GET', `${base}/wechat/loginBySilence`, params).then(res => res.data); +} + export const getH5UserInfo = params => { return POST('GET', `${base}/wechat/getH5UserInfo`, params).then(res => res.data); } diff --git a/Utils/Request.js b/Utils/Request.js index fa09372..f61d2d1 100644 --- a/Utils/Request.js +++ b/Utils/Request.js @@ -13,7 +13,7 @@ function request(method, url, data) { 'mchId': app.globalData.mchId, 'regionId': app.globalData.cityId, }, //有的时候这里不一定是 token 还可能是 Authorization - success(res) { + success(res) { resolve(res) if (res.statusCode === 401 || res.data.return_code == 102014 || res.data.return_code == 104001) { diff --git a/pages.json b/pages.json index 8d878b1..0eb5fc6 100644 --- a/pages.json +++ b/pages.json @@ -1,14 +1,13 @@ { "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages - { - "path" : "pages/welcome/welcome", - "style" : - { - "navigationBarTitleText": "", - "enablePullDownRefresh": false - } - - },{ + { + "path": "pages/welcome/welcome", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + + }, { "path": "pages/tabBar/home/home", "style": { "navigationBarTextStyle": "white", @@ -306,7 +305,7 @@ }, { "path": "pages/goods/recording/recording", "style": { - "navigationBarTitleText": "积分记录", + "navigationBarTitleText": "积分记录", "enablePullDownRefresh": false } @@ -469,18 +468,36 @@ "backgroundColorTop": "#0083f5", "navigationBarTextStyle": "white" } + }, { + "path": "pages/userLogin/agreement/agreement", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + } - ,{ - "path" : "pages/userLogin/agreement/agreement", - "style" : - { - "navigationBarTitleText": "", - "enablePullDownRefresh": false - } - - } - - ], + + , { + "path": "pages/user/myPromotion/myPromotion", + "style": { + "enablePullDownRefresh": false, + "navigationBarTitleText": "我的推广", + "backgroundTextStyle": "light" + // "navigationBarBackgroundColor": "#44AE3F", + // "backgroundColorTop": "#44AE3F", + // "navigationBarTextStyle": "white" + } + + }, { + "path": "pages/user/generatePoster/generatePoster", + "style": { + "navigationBarTitleText": "查看海报", + "enablePullDownRefresh": false + } + + } + + ], "subpackages": [{ "root": "subPages", "pages": [{ @@ -775,6 +792,16 @@ "onReachBottomDistance": 50 } + }, { + "path": "selectEntry/selectEntry", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false, + "app-plus": { + "titleNView": false //禁用原生导航栏 + } + } + } ] }, { diff --git a/pages/goods/refuel-confirm/refuel-confirm.vue b/pages/goods/refuel-confirm/refuel-confirm.vue index 4f0969d..ad7d419 100644 --- a/pages/goods/refuel-confirm/refuel-confirm.vue +++ b/pages/goods/refuel-confirm/refuel-confirm.vue @@ -265,7 +265,7 @@ }, onShow() { let that = this; - that.paytype = ''; + // that.paytype = ''; that.findUser(); }, methods: { diff --git a/pages/goods/refuel-details/refuel-details.vue b/pages/goods/refuel-details/refuel-details.vue index 39b1529..c16bace 100644 --- a/pages/goods/refuel-details/refuel-details.vue +++ b/pages/goods/refuel-details/refuel-details.vue @@ -72,6 +72,14 @@ 约{{oilLiters}}L + + + + @@ -254,12 +257,14 @@ methods: { //前往导航 seeloaction() { + // #ifdef MP uni.openLocation({ latitude: Number(this.storeList.gasAddressLatitude), //目的地的定位 longitude: Number(this.storeList.gasAddressLongitude), //目的地的定位 name: this.storeList.gasName, address: this.storeList.gasAddress }) + // #endif }, //显示弹出 showPopup(item) { @@ -323,13 +328,24 @@ this.storeList = res.return_data; 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.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.counId = res.return_data.goodsId; - this.oilType = res.return_data.oilPriceList[0].oilType; 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) { @@ -417,15 +433,10 @@ // this.totalPreferences = '0'; this.$refs.popup.hide(); }, - // select(amount) { - // this.inputMoney = amount.price; - // this.litre = parseFloat(amount.price / this.priceGun).toFixed(2); - // this.totalPrice = parseFloat(amount.price / this.priceGun * this.priceVip).toFixed(2); - // if (this.priceVip != this.priceGun) { - // let gbprice = parseFloat(this.litre * this.priceOfficial).toFixed(2); - // this.discountPrice = parseFloat(gbprice - this.inputMoney).toFixed(2); - // } - // }, + select(amount) { + this.inputMoney = amount.price; + this.oilPriceDiscountCompute(); + }, // H5获取手机号 jumpH5Bding() { uni.navigateTo({ diff --git a/pages/goods/refuel/refuel.vue b/pages/goods/refuel/refuel.vue index 29c3919..fb00bf3 100644 --- a/pages/goods/refuel/refuel.vue +++ b/pages/goods/refuel/refuel.vue @@ -191,12 +191,18 @@ }, seeloaction(item) { + // #ifdef H5 + // 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({ latitude: Number(item.latitude), //目的地的定位 longitude: Number(item.longitude), //目的地的定位 name: item.store_name, address: item.address }) + // #endif }, changeValue1(item) { this.distanceName = item.name; diff --git a/pages/login/register.vue b/pages/login/register.vue index 627e82e..7a55325 100644 --- a/pages/login/register.vue +++ b/pages/login/register.vue @@ -71,7 +71,7 @@ Timer() {}, getCode() { uni.hideKeyboard() - + if (this.getCodeisWaiting) { return; } @@ -119,14 +119,14 @@ }, 1000) }, doReg() { - uni.hideKeyboard(); - if (this.disabled == false) { - uni.showToast({ - title: '请勾选用户协议', - icon: "none", - duration: 2000 - }) - return; + uni.hideKeyboard(); + if (this.disabled == false) { + uni.showToast({ + title: '请勾选用户协议', + icon: "none", + duration: 2000 + }) + return; } //模板示例部分验证规则 if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.phoneNumber))) { @@ -146,9 +146,15 @@ uni.showLoading({ title: '提交中...' }) + let userid = ''; + if (app.globalData.accountId == '000009&key' || app.globalData.accountId == '0000010&key') { + userid = app.globalData.staffCode; + } let params = { phone: this.phoneNumber, - code: this.code + code: this.code, + popularizeUserId: userid, + regionId: app.globalData.cityId } H5login(params).then(res => { uni.hideLoading(); diff --git a/pages/order/confirmation.vue b/pages/order/confirmation.vue index cfcc5a5..4eef259 100644 --- a/pages/order/confirmation.vue +++ b/pages/order/confirmation.vue @@ -87,7 +87,14 @@ - + + + + 邀请码 + + + + @@ -131,6 +138,8 @@ + + - + diff --git a/pages/tabBar/home/home.vue b/pages/tabBar/home/home.vue index a95e030..d2728ab 100644 --- a/pages/tabBar/home/home.vue +++ b/pages/tabBar/home/home.vue @@ -223,7 +223,7 @@ success(e) { if (e.data) { if (app.globalData.accountId == '000001&key' || app.globalData.accountId == - '000000&gasKey') { + '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 +234,7 @@ // #endif }, onLoad(options) { - let that = this; + let that = this; // #ifdef MP // 1.wx获取登录用户code uni.login({ @@ -256,9 +256,9 @@ that.postionIng(); // #endif // #ifdef H5 - if (app.globalData.h5code) { - that.getH5AccessToken(); - } + // if (app.globalData.h5code) { + // that.getH5AccessToken(); + // } uni.showLoading({ title: '加载中' }) @@ -460,7 +460,7 @@ lng: item, lat: item1 } - findByLatAndLng(datas).then(res => { + findByLatAndLng(datas).then(res => { if (res.return_code == '000000') { that.city = res.return_data.result.addressComponent.province; app.globalData.cityName = res.return_data.result.addressComponent @@ -476,7 +476,7 @@ that.getCmsAactibity(); that.getCmsContentcmshome(); that.getCmsContentcmsContent(); - } + } uni.getStorage({ key: 'accountType', success(e) { @@ -491,6 +491,10 @@ // 004 肯德基 // 005 会员充值 // 006 话费充值 + // 007 在线加油 + // 008 工会卡卡券 + // 009 分销推广优选商品 + // 0010 只跳首页 if (e.data == '000000#/' && app.globalData.h5code) { uni.navigateTo({ url: '../../goods/refuel-details/refuel-details' @@ -532,6 +536,21 @@ url: '../../../subPages/recharge/recharge' }) } + if (e.data == '000007&key' && app.globalData.h5code) { + uni.navigateTo({ + url: '../../goods/refuel/refuel' + }) + } + if (e.data == '000008&key' && app.globalData.h5code) { + uni.navigateTo({ + url: '../../goods/goods-list/goods-list?id=5' + }) + } + if (e.data == '000009&key' && app.globalData.h5code) { + uni.navigateTo({ + url: '/subPages/selectEntry/selectEntry' + }) + } } } }) diff --git a/pages/tabBar/user/user.vue b/pages/tabBar/user/user.vue index 1157486..a470d2c 100644 --- a/pages/tabBar/user/user.vue +++ b/pages/tabBar/user/user.vue @@ -52,11 +52,13 @@ - + + - + + @@ -166,9 +168,9 @@ textnum: '', textSend: '', therrNum: '', - rechargeOrderNum: '', //话费待支付 - whetherCheckNum: '', //未查看数量 - orderPayNum:'', //支付订单数量 + rechargeOrderNum: '', //话费待支付 + whetherCheckNum: '', //未查看数量 + orderPayNum: '', //支付订单数量 headerTop: null, statusTop: null, showHeader: true, @@ -250,12 +252,17 @@ url: '../../login/login?id=2', text: '代理商登录', img: 'user/renw.png' + }, + { + url: '/pages/user/myPromotion/myPromotion', + text: '我的推广', + img: 'user/extension.png' } // , // { - // url: '/pages/user/Charge/Charge', - // text: '充话费', - // img: 'user/bank.png' + // url: '/pages/user/generatePoster/generatePoster', + // text: '生成海报', + // img: 'user/poster.png' // } ], //操作列表 @@ -371,8 +378,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.whetherCheckNum = res.return_data.whetherCheckNum; + this.therrNum = res.return_data.unpaid; + this.whetherCheckNum = res.return_data.whetherCheckNum; this.orderPayNum = res.return_data.orderPayNum; this.rechargeOrderNum = res.return_data.rechargeOrderNum; uni.setStorage({ @@ -521,7 +528,10 @@ key: "token", data: '' }) - location.reload(); + // location.reload(); + uni.navigateTo({ + url: '/pages/login/register' + }) } }); } @@ -884,7 +894,7 @@ .box { width: 25%; - margin-bottom: 30upx; + margin-bottom: 40upx; .img { width: 23vw; diff --git a/pages/user/generatePoster/generatePoster.vue b/pages/user/generatePoster/generatePoster.vue new file mode 100644 index 0000000..8e889ba --- /dev/null +++ b/pages/user/generatePoster/generatePoster.vue @@ -0,0 +1,34 @@ + + + + + diff --git a/pages/user/myPromotion/myPromotion.vue b/pages/user/myPromotion/myPromotion.vue new file mode 100644 index 0000000..a9b30b6 --- /dev/null +++ b/pages/user/myPromotion/myPromotion.vue @@ -0,0 +1,291 @@ + + + + + diff --git a/pages/user/order_list/order_list.vue b/pages/user/order_list/order_list.vue index 2fea62d..ef94372 100644 --- a/pages/user/order_list/order_list.vue +++ b/pages/user/order_list/order_list.vue @@ -14,61 +14,61 @@ - 卡券订单 - 积分充值 - 优惠券包 - - 团油订单 + 加油订单 - 电影票 - KFC - 星巴克 - 会员充值 - 工会卡充值 - + {{row.createTime | formatDate('-')}} diff --git a/pages/welcome/welcome.vue b/pages/welcome/welcome.vue index 8791e9b..c79ca7c 100644 --- a/pages/welcome/welcome.vue +++ b/pages/welcome/welcome.vue @@ -5,6 +5,10 @@ + + diff --git a/uni.scss b/uni.scss index 9325945..aa78efa 100644 --- a/uni.scss +++ b/uni.scss @@ -556,6 +556,9 @@ $uni-font-size-paragraph:30upx; .margle10{ margin-left: 10px; +} +.mart230 { + margin-top: 230px; } .mart90 { margin-top: 90px; @@ -827,4 +830,8 @@ $uni-font-size-paragraph:30upx; .icon12 { width: 12px; +} + +.icon40 { + width: 40px; } \ No newline at end of file