From aa79676ee20e97c35dc0939185f8e2d21cc05108 Mon Sep 17 00:00:00 2001 From: lishenfeng Date: Wed, 20 Nov 2024 16:33:41 +0800 Subject: [PATCH] =?UTF-8?q?feat():=20=E7=82=B9=E4=BD=8D=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/zhjs/index.vue | 53 +------------------- pages/zhjs/subnvue/index.nvue | 94 +++++++++++++++++++++++++++++------ 2 files changed, 80 insertions(+), 67 deletions(-) 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) + } + } + }