吉县样式修改

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">
<map id="map" ref="map" style="width: 100%; height: calc(100vh + 50rpx);" :scale="mapScale"
: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">
</map>
<view class="zdxq">
@ -35,34 +35,23 @@
<text class="popup-close" @click="closePopup">×</text>
</view>
<view class="popup-body">
<view class="info-item">
<text class="label">企业简称</text>
<text class="value">{{ currentEnterprise.entShortName || '-' }}</text>
</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 class="info-item" v-if="enterprisePics.length > 0">
<text class="label">企业照片</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.entIntro || '暂无简介' }}</text>
</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>
@ -78,8 +67,8 @@
return {
baseUrl: configService.staticDomainURL,
center: {
latitude: 36.5,
longitude: 111.7
latitude: 35.604,
longitude: 110.983
},
mapScale: 13,
markers: [],
@ -98,7 +87,8 @@
currentMarkerId: null,
maxMarkerId: 0,
// ''
activeType: ''
activeType: '',
hasLoaded: false
};
},
computed: {
@ -108,6 +98,15 @@
return this.markers;
}
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() {},
@ -116,8 +115,10 @@
},
onShow() {
api.checkLogin(() => {
if (this.hasLoaded) return //
this.$nextTick(() => {
this.getList()
this.hasLoaded = true
})
}, () => {
uni.reLaunch({
@ -161,9 +162,9 @@
this.maxMarkerId = this.allStationList.length + 1;
//
this.enterpriseRender();
this.stationRender();
this.monitorRender()
this.monitorRender();
this.enterpriseRender();
// 使
this.ensureAllMarkersVisible();
@ -197,7 +198,16 @@
console.error('加载企业数据失败:', err);
})
},
previewImage(index) {
const urls = this.enterprisePics;
const current = urls[index];
uni.previewImage({
urls: urls,
current: current,
indicator: 'default',
loop: true
});
},
//
renderEnterpriseMarkers() {
if (!this.enterpriseList || this.enterpriseList.length === 0) {
@ -233,8 +243,8 @@
iconPath: iconPath,
latitude: lat,
longitude: lng,
width: 40,
height: 50,
width: 20,
height: 25,
stationType: 'enterprise',
stationName: item.entName,
entShortName: item.entShortName,
@ -246,15 +256,15 @@
createTime: item.createTime,
entId: item.id,
joinCluster: false,
zIndex: this.markersZIndex++,
zIndex: 1,
enterpriseData: item,
callout: {
content: item.entName || '企业',
color: '#FFFFFF',
fontSize: 14,
fontSize: 12,
borderRadius: 10,
bgColor: '#007AFF',
padding: 8,
padding: 4,
display: 'ALWAYS'
}
};
@ -392,8 +402,8 @@
iconPath: '/static/qiyeIcon.png',
latitude: lat,
longitude: lng,
width: 35,
height: 52,
width: 17,
height: 26,
customCallout: {
anchorY: 0,
anchorX: 0,
@ -403,7 +413,7 @@
stationName: item.stationName,
stationCode: item.stationCode,
joinCluster: false,
zIndex: this.markersZIndex,
zIndex: 1,
};
this.markers.push(markerItem);
}
@ -437,7 +447,7 @@
stationName: item.stationName,
stationCode: item.stationCode,
joinCluster: false,
zIndex: this.markersZIndex,
zIndex: 100,
};
this.markers.push(markerItem);
}
@ -490,7 +500,7 @@
stationCode: item.ids,
deviceType: item.type,
joinCluster: false,
zIndex: this.markersZIndex,
zIndex: 20,
};
this.markers.push(markerItem);
});
@ -769,4 +779,9 @@
flex: 1;
word-break: break-all;
}
.pic-item {
width: 380rpx;
height: auto;
border-radius: 8rpx;
}
</style>