Browse Source

地图

master
chenkainan 1 year ago
parent
commit
951ea816ab
  1. 16
      pages/map/map.vue
  2. 2
      pages/user/user.vue
  3. 2
      subPackages/h5Web/h5Web.vue

16
pages/map/map.vue

@ -1,6 +1,6 @@
<template>
<view class="content">
<web-view src="https://yandumap.sz-trip.com/"></web-view>
<web-view :src="src"></web-view>
</view>
</template>
@ -8,11 +8,19 @@
export default {
data() {
return {
src: ''
}
},
onReady() {
onShow() {
//
let userInfo = (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo'))) || this.$store.state.user.userInfo || {}
if(userInfo.token) {
this.src = 'https://yandumap.sz-trip.com?token=' + userInfo.token
}else {
uni.navigateTo({
url: '/pages/login/login'
})
}
},
methods: {

2
pages/user/user.vue

@ -137,7 +137,7 @@
}
},
onShow() {
this.userInfo = JSON.parse(uni.getStorageSync('userInfo')) || this.$store.state.user.userInfo || {}
this.userInfo = (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo'))) || this.$store.state.user.userInfo || {}
console.log(this.userInfo)
// this.dfkList = []
// this.nowDateTime = parseInt(new Date().getTime() / 1000)

2
subPackages/h5Web/h5Web.vue

@ -14,7 +14,7 @@
const oTherMiniprogramIsBack = uni.getStorageSync('oTherMiniprogramIsBack')
if(oTherMiniprogramIsBack) {
uni.showModal({
title: '是否返回...',
title: '是否返回盐都小程序',
success: () => {
uni.removeStorageSync('oTherMiniprogramIsBack')
uni.navigateBack();

Loading…
Cancel
Save