Browse Source

地图插件

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

6
manifest.json

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

7
pages.json

@ -10,7 +10,12 @@
{ {
"path": "pages/map/map", "path": "pages/map/map",
"style": { "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> <view class="subtitle">便民快捷购票入口</view>
<image src="https://static.ticket.sz-trip.com/tongli/images/index/rightIcons1.png" mode=""></image> <image src="https://static.ticket.sz-trip.com/tongli/images/index/rightIcons1.png" mode=""></image>
</view> </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="title">地图导览</view>
<view class="subtitle">随时随地发现新旅程</view> <view class="subtitle">随时随地发现新旅程</view>
<image src="https://static.ticket.sz-trip.com/tongli/images/index/rightIcons.png" mode=""></image> <image src="https://static.ticket.sz-trip.com/tongli/images/index/rightIcons.png" mode=""></image>
@ -188,6 +188,9 @@
notice: '', notice: '',
} }
}, },
onShow() {
uni.setStorageSync('isFlag', true)
},
onReady() { onReady() {
// //
if(!uni.getStorageSync('location')) { if(!uni.getStorageSync('location')) {

32
pages/map/map.vue

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

1
pages/user/user.vue

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

Loading…
Cancel
Save