吉县样式修改

This commit is contained in:
978184212@qq.com 2026-09-11 15:47:38 +08:00
parent 0ba08dcd55
commit 7cc86bfc18
1 changed files with 55 additions and 40 deletions

View File

@ -2,7 +2,7 @@
<view class="container"> <view class="container">
<map id="map" ref="map" style="width: 100%; height: calc(100vh + 50rpx);" :scale="mapScale" <map id="map" ref="map" style="width: 100%; height: calc(100vh + 50rpx);" :scale="mapScale"
:markers="filteredMarkers" :markers="filteredMarkers"
longitude="112.83100231396601" latitude="36.872032399813556" show-location show-compass show-scale :longitude="center.longitude" :latitude="center.latitude" show-location show-compass show-scale
@markertap="markertap"> @markertap="markertap">
</map> </map>
<view class="zdxq"> <view class="zdxq">
@ -35,34 +35,23 @@
<text class="popup-close" @click="closePopup">×</text> <text class="popup-close" @click="closePopup">×</text>
</view> </view>
<view class="popup-body"> <view class="popup-body">
<view class="info-item"> <view class="info-item" v-if="enterprisePics.length > 0">
<text class="label">企业简称</text> <text class="label">企业照片</text>
<text class="value">{{ currentEnterprise.entShortName || '-' }}</text> <view class="pic-list">
<image
v-for="(pic, index) in enterprisePics"
:key="index"
class="pic-item"
:src="pic"
mode="widthFix"
@click="previewImage(index)"
></image>
</view> </view>
<view class="info-item">
<text class="label">负责人</text>
<text class="value">{{ currentEnterprise.entCharge || '-' }}</text>
</view>
<view class="info-item">
<text class="label">统一信用代码</text>
<text class="value">{{ currentEnterprise.entCredit || '-' }}</text>
</view>
<view class="info-item">
<text class="label">企业编号</text>
<text class="value">{{ currentEnterprise.entCode || '-' }}</text>
</view> </view>
<view class="info-item"> <view class="info-item">
<text class="label">企业简介</text> <text class="label">企业简介</text>
<text class="value">{{ currentEnterprise.entIntro || '暂无简介' }}</text> <text class="value">{{ currentEnterprise.entIntro || '暂无简介' }}</text>
</view> </view>
<view class="info-item">
<text class="label">联系电话</text>
<text class="value">{{ currentEnterprise.entPhone || '暂无' }}</text>
</view>
<view class="info-item">
<text class="label">创建时间</text>
<text class="value">{{ currentEnterprise.createTime || '-' }}</text>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -78,8 +67,8 @@
return { return {
baseUrl: configService.staticDomainURL, baseUrl: configService.staticDomainURL,
center: { center: {
latitude: 36.5, latitude: 35.604,
longitude: 111.7 longitude: 110.983
}, },
mapScale: 13, mapScale: 13,
markers: [], markers: [],
@ -98,7 +87,8 @@
currentMarkerId: null, currentMarkerId: null,
maxMarkerId: 0, maxMarkerId: 0,
// '' // ''
activeType: '' activeType: '',
hasLoaded: false
}; };
}, },
computed: { computed: {
@ -108,6 +98,15 @@
return this.markers; return this.markers;
} }
return this.markers.filter(item => item.stationType === this.activeType); return this.markers.filter(item => item.stationType === this.activeType);
},
//
enterprisePics() {
const raw = this.currentEnterprise.entPics || '';
if (!raw) return [];
return raw.split(',').map(p => p.trim()).filter(p => p).map(p => {
if (/^https?:\/\//.test(p)) return p;
return this.baseUrl.replace(/\/$/, '') + '/' + p.replace(/^\//, '');
});
} }
}, },
onLoad() {}, onLoad() {},
@ -116,8 +115,10 @@
}, },
onShow() { onShow() {
api.checkLogin(() => { api.checkLogin(() => {
if (this.hasLoaded) return //
this.$nextTick(() => { this.$nextTick(() => {
this.getList() this.getList()
this.hasLoaded = true
}) })
}, () => { }, () => {
uni.reLaunch({ uni.reLaunch({
@ -161,9 +162,9 @@
this.maxMarkerId = this.allStationList.length + 1; this.maxMarkerId = this.allStationList.length + 1;
// //
this.enterpriseRender();
this.stationRender(); this.stationRender();
this.monitorRender() this.monitorRender();
this.enterpriseRender();
// 使 // 使
this.ensureAllMarkersVisible(); this.ensureAllMarkersVisible();
@ -197,7 +198,16 @@
console.error('加载企业数据失败:', err); console.error('加载企业数据失败:', err);
}) })
}, },
previewImage(index) {
const urls = this.enterprisePics;
const current = urls[index];
uni.previewImage({
urls: urls,
current: current,
indicator: 'default',
loop: true
});
},
// //
renderEnterpriseMarkers() { renderEnterpriseMarkers() {
if (!this.enterpriseList || this.enterpriseList.length === 0) { if (!this.enterpriseList || this.enterpriseList.length === 0) {
@ -233,8 +243,8 @@
iconPath: iconPath, iconPath: iconPath,
latitude: lat, latitude: lat,
longitude: lng, longitude: lng,
width: 40, width: 20,
height: 50, height: 25,
stationType: 'enterprise', stationType: 'enterprise',
stationName: item.entName, stationName: item.entName,
entShortName: item.entShortName, entShortName: item.entShortName,
@ -246,15 +256,15 @@
createTime: item.createTime, createTime: item.createTime,
entId: item.id, entId: item.id,
joinCluster: false, joinCluster: false,
zIndex: this.markersZIndex++, zIndex: 1,
enterpriseData: item, enterpriseData: item,
callout: { callout: {
content: item.entName || '企业', content: item.entName || '企业',
color: '#FFFFFF', color: '#FFFFFF',
fontSize: 14, fontSize: 12,
borderRadius: 10, borderRadius: 10,
bgColor: '#007AFF', bgColor: '#007AFF',
padding: 8, padding: 4,
display: 'ALWAYS' display: 'ALWAYS'
} }
}; };
@ -392,8 +402,8 @@
iconPath: '/static/qiyeIcon.png', iconPath: '/static/qiyeIcon.png',
latitude: lat, latitude: lat,
longitude: lng, longitude: lng,
width: 35, width: 17,
height: 52, height: 26,
customCallout: { customCallout: {
anchorY: 0, anchorY: 0,
anchorX: 0, anchorX: 0,
@ -403,7 +413,7 @@
stationName: item.stationName, stationName: item.stationName,
stationCode: item.stationCode, stationCode: item.stationCode,
joinCluster: false, joinCluster: false,
zIndex: this.markersZIndex, zIndex: 1,
}; };
this.markers.push(markerItem); this.markers.push(markerItem);
} }
@ -437,7 +447,7 @@
stationName: item.stationName, stationName: item.stationName,
stationCode: item.stationCode, stationCode: item.stationCode,
joinCluster: false, joinCluster: false,
zIndex: this.markersZIndex, zIndex: 100,
}; };
this.markers.push(markerItem); this.markers.push(markerItem);
} }
@ -490,7 +500,7 @@
stationCode: item.ids, stationCode: item.ids,
deviceType: item.type, deviceType: item.type,
joinCluster: false, joinCluster: false,
zIndex: this.markersZIndex, zIndex: 20,
}; };
this.markers.push(markerItem); this.markers.push(markerItem);
}); });
@ -769,4 +779,9 @@
flex: 1; flex: 1;
word-break: break-all; word-break: break-all;
} }
.pic-item {
width: 380rpx;
height: auto;
border-radius: 8rpx;
}
</style> </style>