更新
This commit is contained in:
@@ -158,7 +158,8 @@
|
||||
</view>
|
||||
</view>
|
||||
<msg-models :showAuthFrror="showAuthFrror" @hideOneModal="hideModel"></msg-models>
|
||||
<three-sites v-if="showThreeSites" @hideOneModal="showThreeSites=false" :showThreeSites="showThreeSites"></three-sites>
|
||||
<three-sites v-if="showThreeSites" @hideOneModal="showThreeSites=false"
|
||||
:showThreeSites="showThreeSites"></three-sites>
|
||||
<transBlcok ref="transBlcok" />
|
||||
<!-- <tabbar :current-page="0"/> -->
|
||||
</view>
|
||||
@@ -241,7 +242,7 @@
|
||||
}]
|
||||
}
|
||||
],
|
||||
getCount: 0,
|
||||
// getCount: 0,
|
||||
siteList: [],
|
||||
height: 0,
|
||||
starUrl: this.global.starUrl,
|
||||
@@ -329,7 +330,7 @@
|
||||
},
|
||||
watch: {
|
||||
showAuthFrror(n, o) {
|
||||
console.log(n, o, '=================')
|
||||
// console.log(n, o, '=================')
|
||||
}
|
||||
},
|
||||
|
||||
@@ -403,18 +404,11 @@
|
||||
},
|
||||
onShow() {
|
||||
const token = uni.getStorageSync('Authorization')
|
||||
const openid = uni.getStorageSync('openid')
|
||||
if (token && openid) {
|
||||
if (token) {
|
||||
this.getAuthInfo()
|
||||
|
||||
this.refreshLocation()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '您还没有登录哦',
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
this.getSiteList();
|
||||
this.refreshLocation()
|
||||
// this.getSiteList();
|
||||
},
|
||||
mounted() {},
|
||||
beforeCreate() {},
|
||||
@@ -427,7 +421,7 @@
|
||||
if (res.code == '20000') {
|
||||
uni.showToast({
|
||||
title: '该油卡已被禁用',
|
||||
icon:'none'
|
||||
icon: 'none'
|
||||
})
|
||||
uni.clearStorageSync()
|
||||
uni.setStorageSync('loginOut', true)
|
||||
@@ -449,7 +443,7 @@
|
||||
customerId: cardInfo.customerId
|
||||
}).then(res => {
|
||||
if (res.code === 20000) {
|
||||
if(res.data.accountState == 0) {
|
||||
if (res.data.accountState == 0) {
|
||||
this.logOut()
|
||||
}
|
||||
}
|
||||
@@ -507,22 +501,28 @@
|
||||
success: function(res) {
|
||||
uni.setStorageSync('location', res)
|
||||
},
|
||||
fail: err => {
|
||||
if (err.errMsg === "getLocation:fail auth deny") {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "您已拒绝获取位置信息,请重新授权",
|
||||
confirmText: "开启定位",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.openSetting({
|
||||
success: (res) => {
|
||||
if (res.authSetting["scope.userLocation"]) {
|
||||
this.refreshLocation()
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
complete: (res) => {
|
||||
this.getSiteList()
|
||||
var msgTip = ''
|
||||
if (res.errMsg == 'getLocation:fail auth deny') {
|
||||
msgTip = '请允许小程序获取您的位置'
|
||||
} else if (res.errMsg == 'getLocation:fail:ERROR_NOCELL&WIFI_LOCATIONSWITCHOFF') {
|
||||
msgTip = '请您打开手机定位'
|
||||
}
|
||||
if (msgTip) {
|
||||
setTimeout(() => {
|
||||
uni.showToast({
|
||||
title: msgTip,
|
||||
icon: 'none'
|
||||
})
|
||||
}, 300)
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -585,22 +585,20 @@
|
||||
url: '/pages/tabbar/station/stationList'
|
||||
})
|
||||
} else if (index == 1) {
|
||||
|
||||
if (!uni.getStorageSync('user')) {
|
||||
uni.showModal({
|
||||
title: '请您登录',
|
||||
content: "登录星油加油才可以加油 |˛˙꒳˙)♡",
|
||||
confirmText: '去登陆',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.reLaunch({
|
||||
url: '../../../BagAuth/pages/login/login'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
// if (!uni.getStorageSync('user')) {
|
||||
// uni.showModal({
|
||||
// content: "登录后才能查看哦",
|
||||
// confirmText: '去登陆',
|
||||
// success: (res) => {
|
||||
// if (res.confirm) {
|
||||
// uni.reLaunch({
|
||||
// url: '../../../BagAuth/pages/login/login'
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
uni.removeStorageSync("origins")
|
||||
uni.removeStorageSync("destination")
|
||||
wx.navigateTo({
|
||||
@@ -611,26 +609,29 @@
|
||||
} else if (index == 9) {
|
||||
this.goToPage('/BagAuth/pages/agreeMent/OperationGuide')
|
||||
} else if (index == 2) {
|
||||
if (!uni.getStorageSync('user')) {
|
||||
uni.showModal({
|
||||
title: '请您登录',
|
||||
content: "登录星油加油才可以加油 |˛˙꒳˙)♡",
|
||||
confirmText: '去登陆',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.reLaunch({
|
||||
url: '../../../BagAuth/pages/login/login'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
// if (!uni.getStorageSync('user')) {
|
||||
// uni.showModal({
|
||||
// content: "登录后才能查看哦",
|
||||
// confirmText: '去登陆',
|
||||
// success: (res) => {
|
||||
// if (res.confirm) {
|
||||
// uni.reLaunch({
|
||||
// url: '../../../BagAuth/pages/login/login'
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
wx.navigateTo({
|
||||
|
||||
url: '../../../BagStation/pages/overviewMap/overviewMap',
|
||||
})
|
||||
} else if (index == 6) {
|
||||
uni.showToast({
|
||||
title: '功能即将开放,敬请期待',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
const user = uni.getStorageSync('user');
|
||||
if (user) {
|
||||
Financial.findHomePageReport({
|
||||
@@ -657,7 +658,7 @@
|
||||
this.swiperClick(this.swiperArray[0], 1)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '功能暂无',
|
||||
title: '功能即将开放,敬请期待',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
@@ -670,8 +671,7 @@
|
||||
// })
|
||||
if (!uni.getStorageSync('user')) {
|
||||
uni.showModal({
|
||||
title: '请您登录',
|
||||
content: "登录星油加油才可以加油 |˛˙꒳˙)♡",
|
||||
content: "登录后才能查看哦",
|
||||
confirmText: '去登陆',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
@@ -731,38 +731,20 @@
|
||||
})
|
||||
return
|
||||
}
|
||||
this.getCount++
|
||||
// this.getCount++
|
||||
if (res.code == 20000) {
|
||||
// console.log(res.data.list)
|
||||
this.siteList = res.data.list
|
||||
} else {
|
||||
if (this.getCount == 1) {
|
||||
setTimeout(() => {
|
||||
this.getSiteList()
|
||||
}, 1000)
|
||||
}
|
||||
// else {
|
||||
// if (this.getCount == 1) {
|
||||
// setTimeout(() => {
|
||||
// this.getSiteList()
|
||||
// }, 1000)
|
||||
|
||||
|
||||
} else {
|
||||
uni.getSetting({
|
||||
success: (resSet) => {
|
||||
if (resSet.authSetting['scope.address'] == false) {
|
||||
uni.showMode({
|
||||
title: '请您打开定位权限',
|
||||
content: '用于获取您当前位置附近的油站',
|
||||
confirmText: '去设置',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.openSetting({
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
// }
|
||||
// }
|
||||
})
|
||||
} else {
|
||||
oilSiteApi.getSiteList(data1).then(res => {
|
||||
@@ -775,33 +757,31 @@
|
||||
},
|
||||
toDetail(item) {
|
||||
let itemS = JSON.stringify(item)
|
||||
if (uni.getStorageSync('user')) {
|
||||
if (item.channelCode === 'TY') {
|
||||
uni.setStorageSync('OtherSiteInfo', item)
|
||||
uni.navigateTo({
|
||||
url: `/BagStation/pages/stationDetail/stationDetail?channerCode=${item.channelCode}`,
|
||||
|
||||
})
|
||||
return
|
||||
}
|
||||
if (item.channelCode === 'TY') {
|
||||
uni.setStorageSync('OtherSiteInfo', item)
|
||||
uni.navigateTo({
|
||||
url: `/BagStation/pages/stationDetail/stationDetail?item=${itemS}`,
|
||||
|
||||
})
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '请您登录',
|
||||
content: "登录星油加油才可以加油 |˛˙꒳˙)♡",
|
||||
confirmText: '去登陆',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.reLaunch({
|
||||
url: '../../../BagAuth/pages/login/login'
|
||||
})
|
||||
}
|
||||
}
|
||||
url: `/BagStation/pages/stationDetail/stationDetail?channerCode=${item.channelCode}`,
|
||||
})
|
||||
return
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: `/BagStation/pages/stationDetail/stationDetail?item=${itemS}`,
|
||||
|
||||
})
|
||||
// if (uni.getStorageSync('user')) {
|
||||
// } else {
|
||||
// uni.showModal({
|
||||
// content: "登录后才能查看哦",
|
||||
// confirmText: '去登陆',
|
||||
// success: (res) => {
|
||||
// if (res.confirm) {
|
||||
// uni.reLaunch({
|
||||
// url: '../../../BagAuth/pages/login/login'
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
},
|
||||
getFilterData() {
|
||||
oilSiteApi.getCheckInfo().then(res => {
|
||||
@@ -901,16 +881,12 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
scan1() {
|
||||
// 测试用
|
||||
this.getScanRes('fixed_1371293944539422720')
|
||||
},
|
||||
openScan() {
|
||||
let user = uni.getStorageSync('user')
|
||||
if (!user) {
|
||||
uni.showModal({
|
||||
title: '请您登录',
|
||||
content: "登录星油加油才可以加油 |˛˙꒳˙)♡",
|
||||
|
||||
content: "登录后才能查看哦",
|
||||
confirmText: '去登陆',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
|
||||
Reference in New Issue
Block a user