吉县样式修改
This commit is contained in:
parent
0ba08dcd55
commit
7cc86bfc18
|
|
@ -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">
|
||||||
</view>
|
<image
|
||||||
<view class="info-item">
|
v-for="(pic, index) in enterprisePics"
|
||||||
<text class="label">负责人:</text>
|
:key="index"
|
||||||
<text class="value">{{ currentEnterprise.entCharge || '-' }}</text>
|
class="pic-item"
|
||||||
</view>
|
:src="pic"
|
||||||
<view class="info-item">
|
mode="widthFix"
|
||||||
<text class="label">统一信用代码:</text>
|
@click="previewImage(index)"
|
||||||
<text class="value">{{ currentEnterprise.entCredit || '-' }}</text>
|
></image>
|
||||||
</view>
|
</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>
|
||||||
Loading…
Reference in New Issue