|
@@ -29,17 +29,18 @@ import MapApi from '@/api/map/MapApi';
|
|
|
import AppCofig from '@/common/config/AppCofig';
|
|
import AppCofig from '@/common/config/AppCofig';
|
|
|
import type { MapMarker, MapPolygon, MapPolyline } from '@/types/Map';
|
|
import type { MapMarker, MapPolygon, MapPolyline } from '@/types/Map';
|
|
|
import SimpleDropDownPicker from '@/common/components/SimpleDropDownPicker.vue';
|
|
import SimpleDropDownPicker from '@/common/components/SimpleDropDownPicker.vue';
|
|
|
-import CommonContent from '@/api/CommonContent';
|
|
|
|
|
|
|
|
|
|
const instance = getCurrentInstance();
|
|
const instance = getCurrentInstance();
|
|
|
const mapCtx = uni.createMapContext('prevMap', instance);
|
|
const mapCtx = uni.createMapContext('prevMap', instance);
|
|
|
const selectedRegion = ref<number>();
|
|
const selectedRegion = ref<number>();
|
|
|
|
|
|
|
|
const regionLoader = useSimpleDataLoader(async () => {
|
|
const regionLoader = useSimpleDataLoader(async () => {
|
|
|
- return (await CommonContent.getCategoryChildList(1)).map(p => ({
|
|
|
|
|
- id: p.id,
|
|
|
|
|
- name: p.title,
|
|
|
|
|
- }));
|
|
|
|
|
|
|
+ return [
|
|
|
|
|
+ {
|
|
|
|
|
+ id: undefined as any,
|
|
|
|
|
+ name: '厦门市 · 湖里区',
|
|
|
|
|
+ },
|
|
|
|
|
+ ]
|
|
|
});
|
|
});
|
|
|
const mapLoader = useSimpleDataLoader<MapMarker[]>(async () => {
|
|
const mapLoader = useSimpleDataLoader<MapMarker[]>(async () => {
|
|
|
const res = (await LightVillageApi.getVillageList(undefined, selectedRegion.value, undefined, 1, 12)).map((p, i) => {
|
|
const res = (await LightVillageApi.getVillageList(undefined, selectedRegion.value, undefined, 1, 12)).map((p, i) => {
|
|
@@ -63,32 +64,27 @@ const mapLoader = useSimpleDataLoader<MapMarker[]>(async () => {
|
|
|
|
|
|
|
|
if (p.isLight) {
|
|
if (p.isLight) {
|
|
|
if (p.lightValue >= 1) {
|
|
if (p.lightValue >= 1) {
|
|
|
- maker.width = 50;
|
|
|
|
|
- maker.height = 50;
|
|
|
|
|
- maker.iconPath = `https://mncdn.wenlvti.net/app_static/xiangyuan/images/map/StarX.png`;
|
|
|
|
|
|
|
+ maker.iconPath = `https://mncdn.wenlvti.net/app_static/xiangyuan/images/map/LightSun.png`;
|
|
|
} else if (p.lightValue >= 0.5) {
|
|
} else if (p.lightValue >= 0.5) {
|
|
|
- maker.width = 40;
|
|
|
|
|
- maker.height = 40;
|
|
|
|
|
- maker.iconPath = `https://mncdn.wenlvti.net/app_static/xiangyuan/images/map/StarLarge.png`;
|
|
|
|
|
|
|
+ maker.iconPath = `https://mncdn.wenlvti.net/app_static/xiangyuan/images/map/LightMoon.png`;
|
|
|
} else if (p.lightValue >= 0.25) {
|
|
} else if (p.lightValue >= 0.25) {
|
|
|
- maker.width = 30;
|
|
|
|
|
- maker.height = 30;
|
|
|
|
|
- maker.iconPath = `https://mncdn.wenlvti.net/app_static/xiangyuan/images/map/StarMid.png`;
|
|
|
|
|
- } else{
|
|
|
|
|
- maker.width = 20;
|
|
|
|
|
- maker.height = 20;
|
|
|
|
|
- maker.iconPath = `https://mncdn.wenlvti.net/app_static/xiangyuan/images/map/StarSmall.png`;
|
|
|
|
|
|
|
+ maker.iconPath = `https://mncdn.wenlvti.net/app_static/xiangyuan/images/map/LightStar.png`;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ maker.iconPath = `https://mncdn.wenlvti.net/app_static/xiangyuan/images/map/LightStar.png`;
|
|
|
}
|
|
}
|
|
|
|
|
+ const size = (p.lightValue + 0.5) * 36;
|
|
|
|
|
+ maker.width = size;
|
|
|
|
|
+ maker.height = size;
|
|
|
} else {
|
|
} else {
|
|
|
maker.width = 15;
|
|
maker.width = 15;
|
|
|
maker.height = 15;
|
|
maker.height = 15;
|
|
|
- maker.iconPath = `https://mncdn.wenlvti.net/app_static/xiangyuan/images/map/StarNotLight1.png`;
|
|
|
|
|
|
|
+ maker.iconPath = `https://mncdn.wenlvti.net/app_static/xiangyuan/images/map/StarNotLight.png`;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return maker as MapMarker;
|
|
return maker as MapMarker;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- const countryGeoJsonData = await MapApi.loadCountryGeoJsonData();
|
|
|
|
|
|
|
+ /* const countryGeoJsonData = await MapApi.loadCountryGeoJsonData();
|
|
|
const { polygons, polylines: geoPolylines } = geoJsonToWechatMapShapes(countryGeoJsonData, {
|
|
const { polygons, polylines: geoPolylines } = geoJsonToWechatMapShapes(countryGeoJsonData, {
|
|
|
fillColor: '#344A41',
|
|
fillColor: '#344A41',
|
|
|
strokeColor: '#4AB58A',
|
|
strokeColor: '#4AB58A',
|
|
@@ -96,7 +92,7 @@ const mapLoader = useSimpleDataLoader<MapMarker[]>(async () => {
|
|
|
level: 'abovebuildings',
|
|
level: 'abovebuildings',
|
|
|
});
|
|
});
|
|
|
polygon.value.push(...polygons);
|
|
polygon.value.push(...polygons);
|
|
|
- polyline.value = geoPolylines;
|
|
|
|
|
|
|
+ polyline.value = geoPolylines; */
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
mapCtx.includePoints({
|
|
mapCtx.includePoints({
|
|
@@ -118,7 +114,7 @@ const mapLoader = useSimpleDataLoader<MapMarker[]>(async () => {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const polygon = ref<MapPolygon[]>([
|
|
const polygon = ref<MapPolygon[]>([
|
|
|
- {
|
|
|
|
|
|
|
+ /* {
|
|
|
fillColor: '#000',
|
|
fillColor: '#000',
|
|
|
level: 'abovebuildings',
|
|
level: 'abovebuildings',
|
|
|
points: [
|
|
points: [
|
|
@@ -127,7 +123,7 @@ const polygon = ref<MapPolygon[]>([
|
|
|
{ latitude: 89, longitude: 179.999 },
|
|
{ latitude: 89, longitude: 179.999 },
|
|
|
{ latitude: -89, longitude: 179.999 },
|
|
{ latitude: -89, longitude: 179.999 },
|
|
|
]
|
|
]
|
|
|
- }
|
|
|
|
|
|
|
+ } */
|
|
|
]);
|
|
]);
|
|
|
const polyline = ref<MapPolyline[]>([]);
|
|
const polyline = ref<MapPolyline[]>([]);
|
|
|
|
|
|