Browse Source

地图显示数量修改

dev
396316021 1 year ago
parent
commit
28a26352bb
  1. 13
      api/shop.js
  2. 50
      pages/Index/components/ShopPage/index.vue
  3. 2
      pages/Service/index.vue

13
api/shop.js

@ -13,6 +13,19 @@ export function roomList(data) {
data
});
}
/**
* 公寓列表全部
* @param {Object} data
*/
export function roomMapList(data) {
return request({
url: `${host}/market/house-coordinates`,
method: "get",
data
});
}
/**
* 公寓列表
* @param {Object} data

50
pages/Index/components/ShopPage/index.vue

@ -331,6 +331,7 @@ import MzCard from "@/components/MzCard/index.vue";
import {imghost} from "@/config/host";
import shop from "@/pages/Shop/index.vue";
import MzMap from "@/components/MzMap/index.vue";
import {roomMapList} from "../../../../api/shop";
const img = 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/logo.png';
export default {
@ -593,6 +594,7 @@ export default {
mapData:{},
userInfo:{},
showMap:false,
mapList:[],
}
},
onReady() {
@ -626,10 +628,29 @@ export default {
this.tabCheck = e.id
if(this.tabCheck === 'room'){
this.getRoomList(true);
this.getRoomMapList();
}else{
this.getItemList(true);
}
},
getRoomMapList(){
roomMapList({}).then((res) => {
this.mapList = res.data;
let data = [];
res.data.map(item => {
const coordinate = item.coordinate.split(',');
data.push({
id:item.id,
latitude:parseFloat(coordinate[1]),
longitude:parseFloat(coordinate[0]),
width:'88rpx',
height:'88rpx'
});
return item;
});
this.roomCoordinate = this.roomCoordinate.concat(this.roomCoordinate,data);
});
},
getRoomList(clear = false) {
if (clear) {
this.status = 'loadmore'
@ -647,18 +668,18 @@ export default {
roomList(this.pages).then(res => {
console.log('roomCoordinate',this.roomCoordinate)
let data = [];
res.data.map(item => {
const coordinate = item.coordinate.split(',');
data.push({
id:item.id,
latitude:parseFloat(coordinate[1]),
longitude:parseFloat(coordinate[0]),
width:'88rpx',
height:'88rpx'
});
return item;
});
this.roomCoordinate = this.roomCoordinate.concat(this.roomCoordinate,data);
// res.data.map(item => {
// const coordinate = item.coordinate.split(',');
// data.push({
// id:item.id,
// latitude:parseFloat(coordinate[1]),
// longitude:parseFloat(coordinate[0]),
// width:'88rpx',
// height:'88rpx'
// });
// return item;
// });
// this.roomCoordinate = this.roomCoordinate.concat(this.roomCoordinate,data);
this.listWater.push.apply(this.listWater, res.data);
if (res.data.length === 0) {
this.status = 'nomore'
@ -747,10 +768,10 @@ export default {
let that = this
let id = e.markerId;
console.log(e)
this.mapData = that.listWater.find(line => id === line.id);
this.mapData = that.mapList.find(line => id === line.id);
this.popMapShow = true;
console.log(that.listWater)
console.log(that.mapList)
},
mapTap() {
this.popMapShow = false;
@ -812,6 +833,7 @@ export default {
this.getItemList(true);
this.getGoodsType();
this.getRoomList(true);
this.getRoomMapList();
this.getStreet();
uni.hideLoading();

2
pages/Service/index.vue

@ -234,7 +234,7 @@ export default {
},
pages: {
page: 1,
limit: 10,
limit: 100,
category : '',
jurisdiction : '',
type : '',

Loading…
Cancel
Save