|
@@ -214,7 +214,7 @@
|
|
|
<div class="choseButton" @click="newchoice">重新选择</div>
|
|
|
<div class="content">
|
|
|
<div class="zwsj" v-if="!this.contentList.length">暂无数据</div>
|
|
|
- <div class="list" v-for="(item,index) in contentList">
|
|
|
+ <div class="list" v-for="(item,index) in contentList" @click="goDeteil(item.id)">
|
|
|
<div class="left">
|
|
|
<img :src="item.imgUrl" alt="">
|
|
|
<div class="number" style="" v-if="index < 10">0{{index+1}}</div>
|
|
@@ -267,7 +267,7 @@
|
|
|
window.history.go(-1);
|
|
|
sessionStorage.setItem('znxztabs', JSON.stringify({}));
|
|
|
sessionStorage.setItem('znxz', '');
|
|
|
- },
|
|
|
+ },
|
|
|
compare(property) {
|
|
|
return function (a, b) {
|
|
|
if (a[property] < b[property]) {
|
|
@@ -279,6 +279,11 @@
|
|
|
return 0;
|
|
|
}
|
|
|
},
|
|
|
+ goDeteil(id) {
|
|
|
+ if (id) {
|
|
|
+ window.location.href = "ztcrdetail.html?ztid=" + id;
|
|
|
+ }
|
|
|
+ },
|
|
|
getListData(json) {
|
|
|
let that = this;
|
|
|
$.ajax({
|
|
@@ -289,14 +294,15 @@
|
|
|
dataType: "json",
|
|
|
success: function (data) {
|
|
|
let dataList = data.list;
|
|
|
- that.contentList= dataList.sort((a, b) => { return b.recommend - a.recommend });
|
|
|
+ that.contentList = dataList.sort((a, b) => { return b.recommend - a.recommend });
|
|
|
|
|
|
dataList.forEach(function (d) {
|
|
|
+ console.log(d.point)
|
|
|
// 添加选择地址
|
|
|
if (!d.point) return;
|
|
|
let pList = d.point.split('@');
|
|
|
pList.forEach(function (point) {
|
|
|
- that.pointList.push(point);
|
|
|
+ that.pointList.push(d);
|
|
|
});
|
|
|
});
|
|
|
that.loadMap(dataList[0].point);
|
|
@@ -317,11 +323,42 @@
|
|
|
//中心坐标
|
|
|
that.parkMap.centerAndZoom(new BMap.Point(currPoint[0], currPoint[1]), 14);
|
|
|
that.parkMap.setMapType(BMAP_SATELLITE_MAP);
|
|
|
- that.pointList.forEach(function (point) {
|
|
|
- let arr = point.split(',');
|
|
|
- let p = new BMap.Point(arr[0], arr[1]);
|
|
|
- let marker = new BMap.Marker(p);
|
|
|
- that.parkMap.addOverlay(marker);
|
|
|
+ that.pointList.forEach(function (d) {
|
|
|
+ let pList = d.point.split('@');
|
|
|
+ pList.forEach(function (point) {
|
|
|
+ let arr = point.split(',');
|
|
|
+ let p = new BMap.Point(arr[0], arr[1]);
|
|
|
+ let marker = new BMap.Marker(p);
|
|
|
+
|
|
|
+ // // 创建文本标注对象
|
|
|
+ // var label = new BMap.Label(" " + data.data[i][4] + " ", { offset: new BMap.Size(10, -25) });
|
|
|
+ // label.setStyle({
|
|
|
+ // color: "#fff",
|
|
|
+ // border: "0",
|
|
|
+ // padding: "0",
|
|
|
+ // display: "none",
|
|
|
+ // background: "rgba(66,117,202,0.9)",
|
|
|
+ // fontSize: "12px",
|
|
|
+ // height: "20px",
|
|
|
+ // lineHeight: "20px",
|
|
|
+ // fontFamily: "微软雅黑"
|
|
|
+ // });
|
|
|
+ // marker.setLabel(label);
|
|
|
+
|
|
|
+ // marker.addEventListener("mouseover", function (e) {
|
|
|
+ // var label = this.getLabel()
|
|
|
+ // label.setStyle({ display: "block" });
|
|
|
+ // });
|
|
|
+ // marker.addEventListener("mouseout", function (e) {
|
|
|
+ // var label = this.getLabel()
|
|
|
+ // label.setStyle({ display: "none" });
|
|
|
+ // });
|
|
|
+ that.parkMap.addOverlay(marker);
|
|
|
+ marker.addEventListener('click', function () {
|
|
|
+ var id = d.id;
|
|
|
+ window.location.href = 'ztcrdetail.html?ztid=' + id;
|
|
|
+ });
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
},
|