修改地图等通用问题

This commit is contained in:
978184212@qq.com 2026-08-14 16:44:42 +08:00
parent 370172dd56
commit e152ec17df
6 changed files with 17 additions and 40 deletions

View File

@ -1,5 +1,5 @@
{ {
"name" : "稷山县面源污染监测平台", "name" : "稷山县面源污染监测平台",
"appid" : "__UNI__A58A5D7", "appid" : "__UNI__A58A5D7",
"description" : "", "description" : "",
"versionName" : "2.2.22", "versionName" : "2.2.22",

View File

@ -35,7 +35,7 @@
</view> </view>
</view> </view>
</view> </view>
<text class="botmTetx">Copyright <text style="font-size: 30rpx;padding:0rpx 7rpx;"> © </text> 稷山县县现代农业发展中心</text> <text class="botmTetx">Copyright <text style="font-size: 30rpx;padding:0rpx 7rpx;"> © </text> 稷山县农业农村局</text>
<!-- <view class="loginpage"> <!-- <view class="loginpage">
<image class="bigimg" src="../../static/dls.jpg" mode=""></image> <image class="bigimg" src="../../static/dls.jpg" mode=""></image>
<view class="padding text-center margin-top"> <view class="padding text-center margin-top">

View File

@ -23,7 +23,7 @@
</view> </view>
</view> --> </view> -->
</view> </view>
<text class="botmTetx">Copyright <text style="font-size: 30rpx;padding:0rpx 7rpx;"> © </text> 稷山县县现代农业发展中心</text> <text class="botmTetx">Copyright <text style="font-size: 30rpx;padding:0rpx 7rpx;"> © </text> 稷山县农业农村局</text>
</view> </view>
</view> </view>
</template> </template>

View File

@ -4,7 +4,7 @@
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "稷山县小流域面源污染监测", "navigationBarTitleText": "稷山县小流域面源污染监测",
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },

View File

@ -335,18 +335,12 @@
}, },
// banner // banner
banlick(index){ banlick(index){
if (index==0) {
uni.navigateTo({
url: '/packDetail/pages/vidio/soilindex'
})
} else {
uni.navigateTo({ uni.navigateTo({
url: '/packDetail/pages/Site/index' url: '/packDetail/pages/Site/index'
}) })
} }
} }
} }
}
</script> </script>
<style lang="scss"> <style lang="scss">

View File

@ -11,16 +11,10 @@
畜禽污染监测站 畜禽污染监测站
</view> </view>
</view> </view>
<view class="zdxqitem" @click="switch2Change('orient')">
<image src="../../static/zhandian_nongtian_dingwei.png" mode=""></image>
<view class="textss">
农田污染监测站
</view>
</view>
<view class="zdxqitem" @click="switch2Change('enterprise')"> <view class="zdxqitem" @click="switch2Change('enterprise')">
<image src="../../static/qiyebzIcon.png" mode="" style="width: 40rpx; height: 40rpx;"></image> <image src="../../static/qiyebzIcon.png" mode="" style="width: 40rpx; height: 40rpx;"></image>
<view class="textss"> <view class="textss">
企业监测 企业点位
</view> </view>
</view> </view>
</view> </view>
@ -62,9 +56,6 @@
<text class="value">{{ currentEnterprise.createTime || '-' }}</text> <text class="value">{{ currentEnterprise.createTime || '-' }}</text>
</view> </view>
</view> </view>
<!-- <view class="popup-footer">
<button class="btn-detail" @click="goEnterpriseDetail">查看详情</button>
</view> -->
</view> </view>
</view> </view>
</view> </view>
@ -97,7 +88,6 @@
currentEnterprise: {}, currentEnterprise: {},
currentMarkerId: null, currentMarkerId: null,
maxMarkerId: 0, maxMarkerId: 0,
//
debugMode: true debugMode: true
}; };
}, },
@ -139,14 +129,13 @@
this.allStationList.push(...this.cusLocationList); this.allStationList.push(...this.cusLocationList);
this.allStationList.push(...this.soilStationList); this.allStationList.push(...this.soilStationList);
this.allStationList.forEach((item, index) => { this.allStationList.forEach((item, index) => {
item.id = index + 1; // 1 item.id = index + 1;
}); });
this.issscd = false this.issscd = false
this.isssscd = false this.isssscd = false
this.isSoilShow = false this.isSoilShow = false
// ID
this.maxMarkerId = this.allStationList.length + 1; this.maxMarkerId = this.allStationList.length + 1;
this.enterpriseRender(); this.enterpriseRender();
@ -168,7 +157,10 @@
if (res.data.data && res.data.data.result) { if (res.data.data && res.data.data.result) {
this.enterpriseList = res.data.data.result; this.enterpriseList = res.data.data.result;
this.renderEnterpriseMarkers(); this.renderEnterpriseMarkers();
//
this.$nextTick(() => {
this.ensureAllMarkersVisible(); this.ensureAllMarkersVisible();
});
} }
uni.hideLoading(); uni.hideLoading();
}).catch(err => { }).catch(err => {
@ -187,7 +179,6 @@
return; return;
} }
this.enterpriseList.forEach((item, index) => { this.enterpriseList.forEach((item, index) => {
const lat = Number(item.entLat); const lat = Number(item.entLat);
const lng = Number(item.entLong); const lng = Number(item.entLong);
@ -224,7 +215,6 @@
joinCluster: false, joinCluster: false,
zIndex: this.markersZIndex++, zIndex: this.markersZIndex++,
enterpriseData: item, enterpriseData: item,
// callout
callout: { callout: {
content: item.entName || '企业', content: item.entName || '企业',
color: '#FFFFFF', color: '#FFFFFF',
@ -238,21 +228,17 @@
this.markers.push(markerItem); this.markers.push(markerItem);
}); });
}, },
markertap(e) { markertap(e) {
const index = e.detail.markerId; const index = e.detail.markerId;
// marker
const marker = this.markers.find(m => Number(m.id) === Number(index)); const marker = this.markers.find(m => Number(m.id) === Number(index));
if (!marker) { if (!marker) {
console.warn('未找到对应的marker, ID:', index); console.warn('未找到对应的marker, ID:', index);
return; return;
} }
if (marker.stationType === 'enterprise') { if (marker.stationType === 'enterprise') {
this.currentEnterprise = marker.enterpriseData || { this.currentEnterprise = marker.enterpriseData || {
entName: marker.stationName || '企业名称', entName: marker.stationName || '企业名称',
@ -270,8 +256,8 @@
return; return;
} }
// //
if (['orient', 'livestock'].includes(marker.stationType)) { if (marker.stationType === 'livestock') {
uni.navigateTo({ uni.navigateTo({
url: `/packDetail/pages/Site/detail?item=${encodeURIComponent(JSON.stringify(marker))}` url: `/packDetail/pages/Site/detail?item=${encodeURIComponent(JSON.stringify(marker))}`
}) })
@ -282,7 +268,6 @@
} }
}, },
//
closePopup() { closePopup() {
this.showEnterprisePopup = false; this.showEnterprisePopup = false;
this.currentEnterprise = {}; this.currentEnterprise = {};
@ -424,7 +409,7 @@
try { try {
this.mapCtx.includePoints({ this.mapCtx.includePoints({
points: validPoints, points: validPoints,
padding: [80, 80, 80, 80] padding: [120, 120, 120, 120]
}); });
} catch (e) { } catch (e) {
console.error('调整地图视野异常:', e); console.error('调整地图视野异常:', e);
@ -499,7 +484,7 @@
if (regionName === 'enterprise') { if (regionName === 'enterprise') {
markers = this.markers.filter(item => item.stationType === 'enterprise'); markers = this.markers.filter(item => item.stationType === 'enterprise');
} else if (regionName === 'orient' || regionName === 'livestock' || regionName === 'watershed') { } else if (regionName === 'livestock') {
markers = this.markers.filter(item => item.stationType === regionName); markers = this.markers.filter(item => item.stationType === regionName);
} else if (regionName === 'soil') { } else if (regionName === 'soil') {
markers = this.markers.filter(item => item.type === 'soil' || item.deviceType === 'soil'); markers = this.markers.filter(item => item.type === 'soil' || item.deviceType === 'soil');
@ -527,7 +512,6 @@
</script> </script>
<style lang="scss"> <style lang="scss">
/* 样式保持不变 */
.bgimg { .bgimg {
position: fixed; position: fixed;
top: 0; top: 0;
@ -631,7 +615,6 @@
align-items: center; align-items: center;
} }
/* 企业信息弹窗样式 */
.enterprise-popup { .enterprise-popup {
position: fixed; position: fixed;
top: 0; top: 0;