diff --git a/pages.json b/pages.json index 5ff863b..29887a8 100644 --- a/pages.json +++ b/pages.json @@ -293,6 +293,12 @@ "style": { "navigationBarTitleText": "选择日期" } + }, + { + "path": "h5Web/h5Web", + "style": { + "navigationBarTitleText": "" + } } ] }], diff --git a/pages/map/map.vue b/pages/map/map.vue index b3eb304..466f15e 100644 --- a/pages/map/map.vue +++ b/pages/map/map.vue @@ -1,6 +1,6 @@ @@ -8,57 +8,22 @@ export default { data() { return { - latitude: 33.338538, - longitude: 120.153567, + src: '' } }, - onReady() { - this._mapContext = uni.createMapContext("map", this); - - // 仅调用初始化,才会触发 on.("markerClusterCreate", (e) => {}) - this._mapContext.initMarkerCluster({ - enableDefaultStyle: false, - zoomOnClick: true, - gridSize: 60, - complete(res) { - console.log('initMarkerCluster', res) - } - }); - - this._mapContext.on("markerClusterCreate", (e) => { - console.log("markerClusterCreate", e); - }); - - this.addMarkers(); - }, - methods: { - addMarkers() { - console.log(111,this._mapContext) - this._mapContext.addGroundOverlay({ - id: 1, - src: 'https://static.ticket.sz-trip.com/yandu/images/maps/6/53/25.png', - bounds: { - southwest: {//左下角GPS - longitude: 119.700158, - latitude: 33.112837 - }, - northeast: {//右上角GPS - longitude: 120.25057, - latitude: 33.458095 - } - }, - zIndex: 1, // 图层绘制顺序 - success: () => { - console.log("显示成功", southwest, northeast) - }, - fail: (e) => { - console.log("显示失败", e) - }, - complete: res => { - console.log(res) - } + 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: { + } } @@ -68,9 +33,4 @@ width: 100vw; height: 100vh; } - - .map { - width: 100vw; - height: 100vh; - } \ No newline at end of file diff --git a/pages/user/user.vue b/pages/user/user.vue index 6c0ff40..9637cc5 100644 --- a/pages/user/user.vue +++ b/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) diff --git a/subPackages/h5Web/h5Web.vue b/subPackages/h5Web/h5Web.vue new file mode 100644 index 0000000..c4854ab --- /dev/null +++ b/subPackages/h5Web/h5Web.vue @@ -0,0 +1,54 @@ + + + + + \ No newline at end of file