From cfcb6da1b57dd6e0012c1bbf58b6579bb358cc9c Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Tue, 13 Aug 2024 08:54:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BagAuth/pages/login/oldLogin.vue | 2 +- .../pages/components/price-select-tab.vue | 14 +++-- BagStation/pages/makeOrder/makeOrder.vue | 4 +- components/three-sites.vue | 7 ++- pages/tabbar/home/home.vue | 58 ++++++++++++------- pages/tabbar/station/stationList.vue | 50 ++++++++++++++-- 6 files changed, 99 insertions(+), 36 deletions(-) diff --git a/BagAuth/pages/login/oldLogin.vue b/BagAuth/pages/login/oldLogin.vue index fab67b0..b5f1391 100644 --- a/BagAuth/pages/login/oldLogin.vue +++ b/BagAuth/pages/login/oldLogin.vue @@ -212,7 +212,7 @@ confirmColor: '#FE0505', success: (res) => { if (res.confirm) { - uni.setStorageSync('username', that.driver.username) + uni.setStorageSync('username', this.driver.username) uni.navigateTo({ url: '/BagAuth/pages/login/register' }) diff --git a/BagStation/pages/components/price-select-tab.vue b/BagStation/pages/components/price-select-tab.vue index add244e..341c6f3 100644 --- a/BagStation/pages/components/price-select-tab.vue +++ b/BagStation/pages/components/price-select-tab.vue @@ -363,7 +363,11 @@ activeCur: { type: Number, default: 0 - } + }, + siteId: { + type: String, + default: '' + }, }, data() { return { @@ -671,8 +675,8 @@ checkInfo() { // console.log(this.radio) this.tsetPlate(this.plateNumber ? this.plateNumber : this.plateNumberSel) - if (!this.testPlateResult && !['1689182438357262336', '1689183144276463616', '1689185023261741056'] - .includes(this.oilItem.siteId)) { + if (!this.testPlateResult && !['1689182438357262336', '1689183144276463616', '1689185023261741056','1762304610449412096'] + .includes(this.siteId || this.oilItem.siteId)) { // this.plateNumber='' uni.showToast({ title: '车牌号不可为空或格式错误,请重新输入', @@ -832,8 +836,8 @@ beforeMake() { // console.log(this.radio, 'beforeMake') this.tsetPlate(this.plateNumber ? this.plateNumber : this.plateNumberSel) - if (!this.testPlateResult && !['1689182438357262336', '1689183144276463616', '1689185023261741056'] - .includes(this.oilItem.siteId)) { + if (!this.testPlateResult && !['1689182438357262336', '1689183144276463616', '1689185023261741056','1762304610449412096'] + .includes(this.siteId || this.oilItem.siteId)) { // this.plateNumber='' uni.showToast({ title: '车牌号不可为空或格式错误,请重新输入', diff --git a/BagStation/pages/makeOrder/makeOrder.vue b/BagStation/pages/makeOrder/makeOrder.vue index 133db43..61b4017 100644 --- a/BagStation/pages/makeOrder/makeOrder.vue +++ b/BagStation/pages/makeOrder/makeOrder.vue @@ -63,7 +63,7 @@ + :channelJuli="siteInfo.juli" :siteId="siteId"> @@ -79,6 +79,7 @@ data() { return { isBackPrev: true, + siteId:'', radio: 'B', mainURL: this.global.mainURL, imgURL: this.global.imgURL, @@ -108,6 +109,7 @@ if (authorization && target.siteId) { // 扫码进入 返回按钮点击回到首页 this.isBackPrev = false + this.siteId = target.siteId this.getSiteInfo(target.siteId) } } catch (e) {} diff --git a/components/three-sites.vue b/components/three-sites.vue index b7c024b..8cb3935 100644 --- a/components/three-sites.vue +++ b/components/three-sites.vue @@ -60,7 +60,7 @@ export default { }; }, created() { - this.getSiteList(); + this.refreshLocation(); }, methods: { toSitePage() { @@ -72,13 +72,14 @@ export default { refreshLocation() { uni.getLocation({ type: "wgs84", - success: function (res) { + success: (res) => { uni.setStorageSync("location", res); + this.getSiteList() }, }); }, getSiteList() { - this.refreshLocation(); + // this.refreshLocation(); let data1 = { currentPage: 1, pageSize: 3, diff --git a/pages/tabbar/home/home.vue b/pages/tabbar/home/home.vue index 4d859f9..abfb852 100644 --- a/pages/tabbar/home/home.vue +++ b/pages/tabbar/home/home.vue @@ -179,7 +179,7 @@ - + @@ -349,12 +349,13 @@ const openid = uni.getStorageSync('openid') if (token && openid) { this.getAuthInfo() - } else { - uni.showToast({ - title: '您还没有登录哦', - icon: "none" - }) - } + } + // else { + // uni.showToast({ + // title: '您还没有登录哦', + // icon: "none" + // }) + // } this.refreshLocation() }, @@ -412,6 +413,7 @@ type: 'wgs84', success: (res) => { uni.setStorageSync('location', res) + this.getSiteList() }, fail: () => { uni.getSetting({ @@ -423,30 +425,42 @@ confirmText: '去设置', success: (resSec) => { if (resSec.confirm) { - uni.openSetting({}) + uni.openSetting({ + complete:() => { + // this.getSiteList() + // this.realPosition() + // this.refreshLocation() + } + }) } } }) + }else { + uni.showToast({ + title:'获取定位失败,请稍后再试!', + icon:'none' + }) } } }) }, - complete: () => { - this.getSiteList() - }, - }); - }, - realPosition() { - uni.getLocation({ - type: 'wgs84', - success: (res) => { - uni.setStorageSync('location', res) - }, - complete: () => { - this.getSiteList() - }, + // complete: () => { + // this.getSiteList() + // }, }); }, + // realPosition() { + // uni.getLocation({ + // type: 'wgs84', + // success: (res) => { + // uni.setStorageSync('location', res) + // this.getSiteList() + // }, + // // complete: () => { + // // this.getSiteList() + // // }, + // }); + // }, hideModel(name) { if (name == 'auth') { this.showAuthFrror = false diff --git a/pages/tabbar/station/stationList.vue b/pages/tabbar/station/stationList.vue index d47a2d5..a830936 100644 --- a/pages/tabbar/station/stationList.vue +++ b/pages/tabbar/station/stationList.vue @@ -262,7 +262,7 @@ } else { this.isFilterData=true } - this.getSiteList() + // this.getSiteList() }, onPullDownRefresh() { @@ -363,17 +363,59 @@ onSelected(e) { // console.log(e) }, + // refreshLocation() { + // uni.getLocation({ + // type: 'wgs84', + // success: function(res) { + // uni.setStorageSync('location', res) + // this.getSiteList() + // } + // }); + // }, refreshLocation() { uni.getLocation({ type: 'wgs84', - success: function(res) { + success: (res) => { uni.setStorageSync('location', res) - } + this.getSiteList() + }, + fail: () => { + uni.getSetting({ + success: (res) => { + if (!res.authSetting['scope.userLocation']) { + uni.showModal({ + title: '请您打开定位权限', + content: '用于获取您当前位置附近的油站', + confirmText: '去设置', + success: (resSec) => { + if (resSec.confirm) { + uni.openSetting({ + complete:() => { + // this.getSiteList() + // this.realPosition() + this.refreshLocation() + } + }) + } + } + }) + }else { + uni.showToast({ + title:'获取定位失败,请稍后再试!', + icon:'none' + }) + } + } + }) + }, + // complete: () => { + // this.getSiteList() + // }, }); }, getSiteList() { - this.refreshLocation() + // this.refreshLocation() let data1 = { currentPage: this.currentPage,