更新
This commit is contained in:
@@ -159,10 +159,12 @@
|
||||
</view>
|
||||
<msg-models :showAuthFrror="showAuthFrror" @hideOneModal="hideModel"></msg-models>
|
||||
<three-sites @hideOneModal="showThreeSites=false" :showThreeSites="showThreeSites"></three-sites>
|
||||
<transBlcok ref="transBlcok" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import transBlcok from '@/components/transBlock/index.vue'
|
||||
import SwitchEnterprises from '@/components/SwitchEnterprises.vue'
|
||||
import msgModels from '../../components/showModels.vue'
|
||||
import accountApi from '@/api/account.js'
|
||||
@@ -176,7 +178,8 @@
|
||||
siteItem,
|
||||
threeSites,
|
||||
msgModels,
|
||||
SwitchEnterprises
|
||||
SwitchEnterprises,
|
||||
transBlcok
|
||||
// slFilter
|
||||
},
|
||||
data() {
|
||||
@@ -331,10 +334,7 @@
|
||||
onReady() {
|
||||
let _that = this
|
||||
let IsOtherUser = _that.isOther
|
||||
console.log(IsOtherUser, '这里是判断是否为卡力')
|
||||
console.log('这里是onShow', IsOtherUser, '++++++')
|
||||
if (IsOtherUser) {
|
||||
console.log('首页 卡力 进入')
|
||||
uni.showToast({
|
||||
title: '卡力用户只支持跳转登录',
|
||||
icon: 'none'
|
||||
@@ -350,10 +350,7 @@
|
||||
this.refreshLocation()
|
||||
let _that = this
|
||||
let IsOtherUser = _that.isOther
|
||||
console.log(IsOtherUser, '这里是判断是否为卡力')
|
||||
console.log('这里是onShow', IsOtherUser, '++++++')
|
||||
if (IsOtherUser) {
|
||||
console.log('首页 卡力 进入')
|
||||
uni.showToast({
|
||||
title: '卡力用户只支持跳转登录',
|
||||
icon: 'none'
|
||||
@@ -363,15 +360,13 @@
|
||||
})
|
||||
return
|
||||
}
|
||||
console.log('首页 非卡力 进入')
|
||||
},
|
||||
onLoad(e) {
|
||||
let _that = this
|
||||
let IsOtherUser = _that.isOther
|
||||
// console.log(IsOtherUser, '这里是判断是否为卡力')
|
||||
// console.log('这里是onLoad', IsOtherUser, '++++++')
|
||||
|
||||
if (IsOtherUser) {
|
||||
console.log('首页 卡力 进入')
|
||||
// 卡力
|
||||
uni.showToast({
|
||||
title: '卡力用户只支持跳转登录',
|
||||
icon: 'none'
|
||||
@@ -381,7 +376,7 @@
|
||||
})
|
||||
return
|
||||
}
|
||||
// console.log('首页 非卡力 进入测试++')
|
||||
//非卡力
|
||||
this.reverseGeocoder(this.location);
|
||||
setTimeout(() => {
|
||||
let startParamsData = uni.getStorageSync('isJump') || null;
|
||||
@@ -417,20 +412,12 @@
|
||||
icon: "none"
|
||||
})
|
||||
}
|
||||
// uni.navigateTo({
|
||||
// url: `/BagStation/pages/stationDetail/stieQr?siteId=1372099296709754880&activeChannelCode=XOIL`
|
||||
// })
|
||||
// uni.redirectTo({
|
||||
// url:'/BagStation/pages/makeOrder/makeOrder'
|
||||
// // url:'/BagStation/pages/makeOrder/payResult?status=success'
|
||||
// })
|
||||
// url:'/BagStation/pages/makeOrder/payResult?status=success'
|
||||
this.getSiteList();
|
||||
},
|
||||
mounted() {},
|
||||
beforeCreate() {},
|
||||
onReady() {
|
||||
// this.getSiteList()
|
||||
|
||||
},
|
||||
methods: {
|
||||
swiperClick(item, index) {
|
||||
@@ -475,33 +462,7 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
// refreshLocation() {
|
||||
// wx.showLoading({
|
||||
// title: '定位中...',
|
||||
// mask: true,
|
||||
// })
|
||||
// return new Promise((resolve, reject) => {
|
||||
// let _locationChangeFn = (res) => {
|
||||
// console.log('location change', res)
|
||||
// uni.setStorageSync('location', res)
|
||||
// this.getSiteList();
|
||||
// wx.hideLoading()
|
||||
// wx.offLocationChange(_locationChangeFn)
|
||||
// }
|
||||
// wx.startLocationUpdate({
|
||||
// success: (res) => {
|
||||
// console.log(res);
|
||||
// wx.onLocationChange(_locationChangeFn)
|
||||
// resolve()
|
||||
// },
|
||||
// fail: (err) => {
|
||||
// console.log('获取当前位置失败', err)
|
||||
// wx.hideLoading()
|
||||
// reject()
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
// },
|
||||
|
||||
refreshLocation() {
|
||||
uni.getLocation({
|
||||
type: 'wgs84',
|
||||
@@ -509,7 +470,6 @@
|
||||
uni.setStorageSync('location', res)
|
||||
},
|
||||
complete: (res) => {
|
||||
// console.log('定位',res)
|
||||
this.getSiteList()
|
||||
var msgTip = ''
|
||||
if (res.errMsg == 'getLocation:fail auth deny') {
|
||||
@@ -534,7 +494,6 @@
|
||||
if (this.showAuthFrzen <= new Date().getTime()) {
|
||||
// 一小时后再提示
|
||||
uni.setStorageSync('showAuthFrzen', new Date().getTime() + 10 * 1000)
|
||||
// uni.setStorageSync('showAuthFrzen', new Date().getTime() + 1 * 60 * 60 * 1000)
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -543,8 +502,6 @@
|
||||
if (res.code === 20000) {
|
||||
let _that = this
|
||||
let IsOtherUser = _that.isOther
|
||||
// console.log(IsOtherUser, '这里是判断是否为卡力')
|
||||
// console.log('这里是getUserAuthInfo', IsOtherUser, '++++++')
|
||||
if (IsOtherUser) {
|
||||
uni.showToast({
|
||||
title: '卡力用户只支持跳转登录',
|
||||
@@ -584,27 +541,13 @@
|
||||
})
|
||||
},
|
||||
shadoumeiyou(index) {
|
||||
// if(!uni.getStorageSync('user')){
|
||||
// uni.showToast({
|
||||
// title:'请先登登录',
|
||||
// icon:'none'
|
||||
// })
|
||||
// }
|
||||
|
||||
if (index == 0) {
|
||||
uni.switchTab({
|
||||
url: '/pages/tabbar/station/stationList'
|
||||
})
|
||||
} else if (index == 1) {
|
||||
// const referer = '星油云'; //调用插件的app的名称
|
||||
// const endPoint = JSON.stringify({
|
||||
// name: '输入目的地',
|
||||
// latitude: 39.89631551,
|
||||
// longitude: 116.323459711
|
||||
// });
|
||||
// wx.navigateTo({
|
||||
// url: 'plugin://routePlan/index?key=' + this.qqMapKey + '&referer=' + referer +
|
||||
// '&endPoint=' + endPoint
|
||||
// })
|
||||
|
||||
if (!uni.getStorageSync('user')) {
|
||||
uni.showModal({
|
||||
title: '请您登录',
|
||||
@@ -623,19 +566,13 @@
|
||||
uni.removeStorageSync("origins")
|
||||
uni.removeStorageSync("destination")
|
||||
wx.navigateTo({
|
||||
// url:'../../../BagStation/pages/routePlain/routePlain',
|
||||
|
||||
url: '../../../BagStation/pages/newRoutePlanning/newRoutePlanning'
|
||||
// url:'../../../BagStation/pages/overviewMap/overviewMap',
|
||||
|
||||
})
|
||||
} else if (index == 9) {
|
||||
this.goToPage('/BagAuth/pages/agreeMent/OperationGuide')
|
||||
}
|
||||
// else if(index==8){
|
||||
// uni.navigateTo({
|
||||
// url: '/BagStation/myCars/myCars'
|
||||
// })
|
||||
// }
|
||||
else if (index == 2) {
|
||||
} else if (index == 2) {
|
||||
if (!uni.getStorageSync('user')) {
|
||||
uni.showModal({
|
||||
title: '请您登录',
|
||||
@@ -652,8 +589,7 @@
|
||||
return
|
||||
}
|
||||
wx.navigateTo({
|
||||
// url:'../../../BagStation/pages/routePlain/routePlain',
|
||||
// url:'../../../BagStation/pages/newRoutePlanning/newRoutePlanning'
|
||||
|
||||
url: '../../../BagStation/pages/overviewMap/overviewMap',
|
||||
})
|
||||
} else if (index == 6) {
|
||||
@@ -809,23 +745,13 @@
|
||||
uni.setStorageSync('OtherSiteInfo', item)
|
||||
uni.navigateTo({
|
||||
url: `/BagStation/pages/stationDetail/stationDetail?channerCode=${item.channelCode}`,
|
||||
fail: (err) => {
|
||||
// console.log(err)
|
||||
},
|
||||
success: () => {
|
||||
// console.log('err')
|
||||
}
|
||||
|
||||
})
|
||||
return
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: `/BagStation/pages/stationDetail/stationDetail?item=${itemS}`,
|
||||
fail: (err) => {
|
||||
// console.log(err)
|
||||
},
|
||||
success: () => {
|
||||
// console.log('err')
|
||||
}
|
||||
|
||||
})
|
||||
} else {
|
||||
uni.showModal({
|
||||
@@ -948,8 +874,26 @@
|
||||
uni.scanCode({
|
||||
scanType: 'qrCode',
|
||||
onlyFromCamera: true,
|
||||
success: (res) => {
|
||||
console.log(res.result)
|
||||
success: async (res) => {
|
||||
if (typeof res.result === 'string') {
|
||||
let result = JSON.parse(res.result)
|
||||
if (result.qrcodeText) {
|
||||
let accountResult = await accountApi.getUserAccount()
|
||||
if (accountResult.data.length) {
|
||||
accountApi.checkQrStr(result.giveCustomerId, result.qrcodeText).then(
|
||||
res => {
|
||||
let currentCard = accountResult.data[0] || []
|
||||
this.$refs.transBlcok._open({
|
||||
...currentCard,
|
||||
...result
|
||||
})
|
||||
})
|
||||
}
|
||||
return
|
||||
}
|
||||
this.getScanRes(res.result)
|
||||
return
|
||||
}
|
||||
this.getScanRes(res.result)
|
||||
},
|
||||
fail: (err) => {
|
||||
@@ -982,6 +926,10 @@
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/deep/.vue-ref {
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.showBtn {
|
||||
padding-right: 3%;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user