提交 1c04d2f2 作者: 龚洪江

数据切换

上级 ce2f67de
// 测试服务器 // 测试服务器
// const baseURL = 'https://testapi.sharefly.mmcuav.cn/' const baseURL = 'https://testapi.sharefly.mmcuav.cn/'
// const routeURL='https://csfpg.sharefly.mmcuav.cn/'
// 正式服 // 正式服
const baseURL = "https://csfapi.mmcuav.cn/" // const baseURL = "https://csfapi.mmcuav.cn/"
const routeURL='https://sharefly.mmcuav.cn/'
const api = { const api = {
getWebSitList:'systemservlet/website/getWebsiteList' getWebSitList:'systemservlet/website/getWebsiteList',
flyerDotList:'flyerservlet/flyeraccount/bitmap' ,
deviceDotList:'deviceservlet/device/bitmap'
} }
export { export {
api, api,
baseURL, baseURL,
routeURL
} }
\ No newline at end of file
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
<view class="provice-title">{{ location.province }}</view> <view class="provice-title">{{ location.province }}</view>
<img src="@/assets/image/bot-arrow.png" alt="" /> <img src="@/assets/image/bot-arrow.png" alt="" />
</view> --> </view> -->
<view class="websit-node-head-wrap"> <view class="websit-node-head-wrap">
<image src="../../static/images/map-tip.png" mode="widthFix" class="img-1"></image> <image src="../../static/images/map-tip.png" mode="widthFix" class="img-1"></image>
<!-- <view class=" animate__animated animate__tada animate__infinite animate__delay-1s btn-img" style="background:red"></view> --> <!-- <view class=" animate__animated animate__tada animate__infinite animate__delay-1s btn-img" style="background:red"></view> -->
<image src="../../static/images/go.png" mode="widthFix" class=" animate__heartBeat btn-img"></image> <image src="../../static/images/go.png" mode="widthFix" class=" animate__heartBeat btn-img"></image>
</view> </view>
<view class="websit-node-list-wrap"> <view class="websit-node-list-wrap">
<view class="ios-wrap"> <view class="ios-wrap">
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
<view class="left-info"> <view class="left-info">
<view class="head">{{ item.dizhi }}网点</view> <view class="head">{{ item.dizhi }}网点</view>
<view class="meta"> <view class="meta">
<view class="grade">4.{{ RandomNum(5, 9) }}</view> <view class="grade">{{item.grade}}</view>
<view class="tip"> <view class="tip">
近天{{ RandomNum(1, 10)}}服务次数超{{ 近天{{item.day}}服务次数超{{
RandomNum(4, 5) * 10 item.count
}} }}
</view> </view>
</view> </view>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<view class="current-status"> <view class="current-status">
<view class="swiper-no-swiping"> <view class="swiper-no-swiping">
<swiper :options="swiperOptions"> <swiper :options="swiperOptions">
<swiper-slide v-for="(item, index) in cityList" :key="index"> <swiper-slide v-for="(item, index ) in cityList" :key="index">
<view class="swiper-slide"> <view class="swiper-slide">
{{ item }}网点{{ labelList[RandomNum(0, 2)] }} {{ item }}网点{{ labelList[RandomNum(0, 2)] }}
</view> </view>
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
return { return {
title: 'Hello', title: 'Hello',
location: {}, location: {},
locationData:{ locationData: {
adcode: "440305", adcode: "440305",
city: "深圳市", city: "深圳市",
city_code: "156440300", city_code: "156440300",
...@@ -86,10 +86,10 @@ ...@@ -86,10 +86,10 @@
} }
}, },
onLoad(option) { onLoad(option) {
if(option.location){ if (option.location) {
} }
let str = this.getQueryString("location") || JSON.stringify(this.locationData) ; let str = this.getQueryString("location") || JSON.stringify(this.locationData);
// uni.showToast({ // uni.showToast({
// title: str, // title: str,
// icon:'none' // icon:'none'
...@@ -102,22 +102,14 @@ ...@@ -102,22 +102,14 @@
url: "/page-home/cooperation/cooperation" url: "/page-home/cooperation/cooperation"
}); });
}, },
RandomNum(minNum, maxNum) {
return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
},
// 数据切换
changeTabEvent(index) {
this.currentTipIndex = index;
document.title = this.tipList[index].label;
},
getQueryString(name) { getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg); var r = window.location.search.substr(1).match(reg);
if (r != null) { if (r != null) {
return decodeURIComponent(r[2]); return decodeURIComponent(r[2]);
} }
return null; return null;
} }
} }
} }
</script> </script>
...@@ -129,7 +121,6 @@ ...@@ -129,7 +121,6 @@
map: null, map: null,
markers: [], markers: [],
websitList: [], websitList: [],
// swiperOptions: { // swiperOptions: {
// autoplay: { // autoplay: {
// delay: 2000, // delay: 2000,
...@@ -166,6 +157,7 @@ ...@@ -166,6 +157,7 @@
}, },
], //数据切换 ], //数据切换
currentTipIndex: 0, currentTipIndex: 0,
massMarks: undefined, //海量点对象
}; };
}, },
mounted() { mounted() {
...@@ -207,19 +199,30 @@ ...@@ -207,19 +199,30 @@
}); });
}, },
setMassMarks() { setMassMarks() {
let styleObject = { let styleList = [{
url: "https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/image/servicepot.png", // 图标地址 url: 'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/image/servicepot.png', // 图标地址
size: new AMap.Size(40, 40), // 图标大小 size: new AMap.Size(40, 40), // 图标大小
anchor: new AMap.Pixel(5, 5), // 图标显示位置偏移量,基准点为图标左上角 anchor: new AMap.Pixel(5, 5), // 图标显示位置偏移量,基准点为图标左上角
}; },
let massMarks = new AMap.MassMarks(this.markers, { {
url: 'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/image/mmc1_flyer.png', // 图标地址
size: new AMap.Size(40, 40), // 图标大小
anchor: new AMap.Pixel(5, 5), // 图标显示位置偏移量,基准点为图标左上角
},
{
url: 'https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/image/mmc1.png', // 图标地址
size: new AMap.Size(40, 40), // 图标大小
anchor: new AMap.Pixel(5, 5), // 图标显示位置偏移量,基准点为图标左上角
}
];
this.massMarks = new AMap.MassMarks(this.markers, {
zIndex: 5, // 海量点图层叠加的顺序 zIndex: 5, // 海量点图层叠加的顺序
zooms: [3, 19], // 在指定地图缩放级别范围内展示海量点图层 zooms: [3, 19], // 在指定地图缩放级别范围内展示海量点图层
style: styleObject, // 设置样式对象 style: styleList, // 设置样式对象
}); });
console.log("massMarks-->", massMarks); console.log("massMarks-->", this.massMarks);
// 将海量点添加至地图实例 // 将海量点添加至地图实例
massMarks.setMap(this.map); this.massMarks.setMap(this.map);
}, },
async getMarkPoint() { async getMarkPoint() {
let res = await this.$httpRequest({ let res = await this.$httpRequest({
...@@ -232,7 +235,12 @@ ...@@ -232,7 +235,12 @@
}) })
if (res.result) { if (res.result) {
let nodeList = res.result.reduce((pre, cur) => { let nodeList = res.result.reduce((pre, cur) => {
let list = cur.locationList.filter((item) => item.range >= 100); let list = cur.locationList.filter((item) => {
item.grade = '4.' + this.RandomNum(5, 9)
item.day = this.RandomNum(1, 10)
item.count = this.RandomNum(4, 5) * 10
return item.range >= 100
});
pre.push(...list); pre.push(...list);
// } // }
return pre; return pre;
...@@ -248,10 +256,71 @@ ...@@ -248,10 +256,71 @@
return { return {
id: index, id: index,
lnglat: [item.jd, item.wd], lnglat: [item.jd, item.wd],
style: 0
}; };
}); });
} }
}, },
// 数据切换
async changeTabEvent(index) {
this.currentTipIndex = index;
switch (index) {
case 0:
await this.getMarkPoint()
this.massMarks.setData(this.markers)
break;
case 1:
await this.getFlyerDotList()
this.massMarks.setData(this.markers)
break;
case 2:
await this.getDeviceDotList()
this.massMarks.setData(this.markers)
break;
}
document.title = this.tipList[index].label;
},
async getFlyerDotList(data) {
let res = await this.$httpRequest({
url: this.$api.flyerDotList,
method: 'get',
data: {
lat: this.location.location.lat,
lon: this.location.location.lng,
}
})
if (res.result && res.result.length != 0) {
this.markers = res.result.slice(0, 1999).map((item, index) => {
return {
id: index,
lnglat: [item.lon, item.lat],
style: 1
};
});
}
},
async getDeviceDotList() {
let res = await this.$httpRequest({
url: this.$api.deviceDotList,
method: 'get',
data: {
lat: this.location.location.lat,
lon: this.location.location.lng,
}
})
if (res.result && res.result.length != 0) {
this.markers = res.result.map((item, index) => {
return {
id: index,
lnglat: [item.lon, item.lat],
style: 2
};
});
}
},
RandomNum(minNum, maxNum) {
return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
},
}, },
}; };
</script> </script>
...@@ -264,7 +333,7 @@ ...@@ -264,7 +333,7 @@
.websit-node-list-wrap { .websit-node-list-wrap {
position: absolute; position: absolute;
left: 0; left: 0;
top: 60%; top: 78%;
width: 100%; width: 100%;
background: #f9f9f9; background: #f9f9f9;
border-radius: 36rpx 36rpx 0px 0px; border-radius: 36rpx 36rpx 0px 0px;
...@@ -396,9 +465,11 @@ ...@@ -396,9 +465,11 @@
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
width: 90%; width: 90%;
.img-1 { .img-1 {
width: 100%; width: 100%;
} }
.btn-img { .btn-img {
width: 84rpx; width: 84rpx;
position: absolute; position: absolute;
......
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>全国网点</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)')) <!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>全国网点</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/h5/static/index.a5c69d49.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/h5/static/js/chunk-vendors.ed1c0629.js></script><script src=/h5/static/js/index.2fcd7cef.js></script></body></html> document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/h5/static/index.a5c69d49.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/h5/static/js/chunk-vendors.ed1c0629.js></script><script src=/h5/static/js/index.fd493a86.js></script></body></html>
\ No newline at end of file \ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论