diff --git a/pages/zhjs/index.vue b/pages/zhjs/index.vue index bfe7f0b..0fd65f6 100644 --- a/pages/zhjs/index.vue +++ b/pages/zhjs/index.vue @@ -1,59 +1,10 @@ \ No newline at end of file diff --git a/pages/zhjs/subnvue/index.nvue b/pages/zhjs/subnvue/index.nvue index a3bb1f4..c7e303c 100644 --- a/pages/zhjs/subnvue/index.nvue +++ b/pages/zhjs/subnvue/index.nvue @@ -4,8 +4,12 @@ fontSize:'18px' }" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'> - + + @@ -15,26 +19,84 @@ export default { data() { return { - latitude: 31.52, - longitude: 114.76, - enableSatellite:true, - markers: [{ - latitude: 31.52, - longitude: 114.76, - iconPath: '../../static/tabs/add.png', + latitude: 31.495, + longitude: 114.767, + enableSatellite:false, + markers: [ + { + latitude: 31.4954, + longitude: 114.7693, + iconPath: '/static/tabs/add.png', width: "25", - height: "25" - }], - dingwei: '../../static/tabs/dingwei.png' + height: "25", + id:1, + }, + { + latitude: 31.4951, + longitude: 114.767, + iconPath: '/static/tabs/add.png', + width: "25", + height: "25", + id:2, + } + ], + dingwei: '../../static/tabs/dingwei.png', + map:null, + windowHeight:0, + windowHeight:0 } }, + created() { + let that = this; + uni.getSystemInfo({ + success(res) { + that.windowHeight = res.windowHeight; + that.windowHeight = res.windowHeight + res.statusBarHeight; + that.statusBarHeight = res.statusBarHeight; + that.navTop = res.statusBarHeight + 10; + } + }) + }, + onReady() { + this.map = uni.createMapContext("map") + }, methods: { onControlTap(){ - const map = uni.createMapContext("map"); - map.moveToLocation() + this.$refs.map.moveToLocation({ + latitude: 31.495, + longitude: 114.767 + }) + }, + markertap(e){ + const newMarker = this.markers + newMarker.forEach(((item,i) => { + if(item.id === e.detail.markerId){ + item.height=55; + item.width=55; + item.label={ + content:"测试", + color:"#57a7f0", + bgColor:"transparent" + } + }else{ + item.height=25; + item.width=25; + item.label={ + content:" ", + bgColor:"transparent" + } + } + })); + console.log("newMarker",newMarker); + this.markers = [...newMarker]; } }, - } + computed:{ + marker(){ + return this.markers.slice(0) + } + } + }