Browse Source

地图插件

master
chenkainan 11 months ago
parent
commit
62be9a6414
  1. 8
      manifest.json
  2. 7
      pages.json
  3. 5
      pages/index/index.vue
  4. 32
      pages/map/map.vue
  5. 1
      pages/user/user.vue

8
manifest.json

@ -62,7 +62,13 @@
"scope.userLocation" : {
"desc" : "获取用户距离商家距离"
}
}
},
"plugins": {
"myPlugin": {
"version": "1.0.0",
"provider": "wxcb555ab174f22ec9"
}
}
},
"mp-alipay" : {
"usingComponents" : true

7
pages.json

@ -10,7 +10,12 @@
{
"path": "pages/map/map",
"style": {
"navigationBarTitleText": "地图"
"navigationBarTitleText": "地图",
"mp-weixin": {
"usingComponents": {
"hello-component": "plugin://myPlugin/hello-component"
}
}
}
},
{

5
pages/index/index.vue

@ -38,7 +38,7 @@
<view class="subtitle">便民快捷购票入口</view>
<image src="https://static.ticket.sz-trip.com/tongli/images/index/rightIcons1.png" mode=""></image>
</view>
<view :style="{backgroundImage: 'url('+showImg(homeUi['dtdl'])+')'}">
<view :style="{backgroundImage: 'url('+showImg(homeUi['dtdl'])+')'}" @click="gotoPath('plugin://myPlugin/index')">
<view class="title">地图导览</view>
<view class="subtitle">随时随地发现新旅程</view>
<image src="https://static.ticket.sz-trip.com/tongli/images/index/rightIcons.png" mode=""></image>
@ -188,6 +188,9 @@
notice: '',
}
},
onShow() {
uni.setStorageSync('isFlag', true)
},
onReady() {
//
if(!uni.getStorageSync('location')) {

32
pages/map/map.vue

@ -1,7 +1,6 @@
<template>
<view class="content">
<!-- <web-view :src="src"></web-view> -->
暂未开放
</view>
</template>
@ -9,22 +8,29 @@
export default {
data() {
return {
src: ''
src: '',
isFlag: true
}
},
onHide() {
uni.setStorageSync('isFlag', false)
},
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'
// })
// }
this.gotoPath()
},
methods: {
gotoPath() {
this.isFlag = uni.getStorageSync('isFlag')
if(this.isFlag) {
uni.navigateTo({
url: "plugin://myPlugin/index"
})
}else {
uni.switchTab({
url: '/pages/index/index'
})
}
}
}
}
</script>

1
pages/user/user.vue

@ -159,6 +159,7 @@
onShow() {
this.userInfo = (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo'))) || this.$store.state.user.userInfo || {}
console.log(this.userInfo)
uni.setStorageSync('isFlag', true)
// this.dfkList = []
// this.nowDateTime = parseInt(new Date().getTime() / 1000)
// this.Post({}, "/api/user/userInfo").then((res) => {

Loading…
Cancel
Save