diff --git a/mapFind/img/pcMarker.png b/mapFind/img/pcMarker.png new file mode 100644 index 0000000..701af5a Binary files /dev/null and b/mapFind/img/pcMarker.png differ diff --git a/mapFind/pages/placeMap/index.js b/mapFind/pages/placeMap/index.js index e8f715d..a927378 100644 --- a/mapFind/pages/placeMap/index.js +++ b/mapFind/pages/placeMap/index.js @@ -98,7 +98,9 @@ Page({ //设置地图房源列表滚动条高度 mapSelectScrollTop: 0, //是否初次加载地区 - mapFirstLoading: true + mapFirstLoading: true, + platform:'',//平台 + mapMarkerTime:'',//计时器 }, get_config() { var that = this; @@ -206,6 +208,7 @@ Page({ }, callouttap(e) { //点击地图marker let id = e.detail.markerId; + console.log(id) let object = null; if (this.data.headerObjTab === 'apartment') { //公寓 this.data.areaMarkerList.find((obj) => { @@ -484,15 +487,27 @@ Page({ let repeatArr={} if (data.length) { let dataObj = { - iconPath: "/img/lucency.png", - width: 10, - height: 10, + iconPath:this.data.platform==='windows'?"/mapFind/img/pcMarker.png":'/img/lucency.png', + width: this.data.platform==='windows'?20:0, + height: this.data.platform==='windows'?20:0, joinCluster: this.data.headerObjTab !== 'apartment' && this.data.showPlace ? false : false, customCallout: { anchorY: 0, anchorX: 0, display: 'ALWAYS', }, + // callout: { + // content:'1', + // anchorY: 0, + // anchorX: 0, + // display: 'ALWAYS', + // }, + // label:{ + // content:'1', + // anchorY: 0, + // anchorX: 0, + // display: 'ALWAYS', + // } } data.map((res, index) => { //latitude longitude if (this.data.showPlace || this.data.headerObjTab === 'apartment' ? true : res.count > 0) { @@ -528,13 +543,41 @@ Page({ obj=this.data.placePriceList } if (this.data.headerObjTab !== 'apartment' && this.data.showPlace) List = this.handleDetailData(List, setLangs) - List=this.repeatSetList(List,repeatArr) + if(this.data.headerObjTab !== 'apartment' && this.data.showPlace)List=this.repeatSetList(List,repeatArr) + + console.log(List) return { List, arr, obj } }, + // windowsMarkerSet(data,type){ + // this.data.mapMarkerTime=setInterval(()=>{ + // let datas=JSON.parse(JSON.stringify(data)) + // while(datas.length){ + // let num=Math.floor(Math.random()*datas.length) + // let markerNum=null + // let key=null + // data.map((res,index)=>{ + // if(res.id===datas[num].id){ + // markerNum=index + // } + // }) + // key=`${type}[${markerNum}]` + // this.setData({ + // [key]:{ + // ...datas[num], + // alpha:datas[num].alpha?0:1 + // } + // }) + // datas.splice(num,1) + // } + // // this.setData({ + // // markersList:data + // // }) + // },500) + // }, //坐标重叠处理 repeatSetList(data,idList){ let List=JSON.parse(JSON.stringify(data)) @@ -659,6 +702,7 @@ Page({ longitude:'114.13295', }) } + // this.windowsMarkerSet(this.data.markersList,'markersList') } }) }, @@ -807,6 +851,16 @@ Page({ this.mapCtx.on('markerClusterClick', res => { console.log('markerClusterClick', res) }) + wx.getSystemInfo({ + success: (res) => { + // windows | mac为pc端 + // android | ios为手机端 + this.setData({ + platform:res.platform + }) + console.log(res.platform) + } + }); var that = this; // this.getMapContxt() // this.get_config() diff --git a/mapFind/pages/placeMap/index.wxml b/mapFind/pages/placeMap/index.wxml index 84c84da..186b4f1 100644 --- a/mapFind/pages/placeMap/index.wxml +++ b/mapFind/pages/placeMap/index.wxml @@ -73,7 +73,7 @@ - + diff --git a/mapFind/pages/placeMap/index.wxss b/mapFind/pages/placeMap/index.wxss index c7fe26f..5900b0e 100644 --- a/mapFind/pages/placeMap/index.wxss +++ b/mapFind/pages/placeMap/index.wxss @@ -601,4 +601,4 @@ page { color: #aaaaaa; margin: 0 auto; font-size: 21rpx; -} \ No newline at end of file +}