Bladeren bron

店铺设置,提示弹窗

baijunde 9 maanden geleden
bovenliggende
commit
810b31aca7

+ 3 - 3
pages/index/shop.vue

@@ -45,9 +45,9 @@
 			<view class="business" @click="isPopup = true">
 				<image src="/static/index/business.png" mode=""></image>营业管理
 			</view>
-			<view class="edit" @click="edit">
+			<!-- <view class="edit" @click="edit">
 				<image src="/static/index/edit.png" mode=""></image>编辑门店
-			</view>
+			</view> -->
 		</view>
 		<view class="popup" v-if="isPopup">
 			<view class="model">
@@ -430,7 +430,7 @@
 			}
 
 			.business {
-				width: 324rpx;
+				width: 80%;
 				height: 76rpx;
 				background: linear-gradient(90deg, #77B6FF 0%, #449AFF 100%);
 				border-radius: 12rpx;

+ 84 - 70
pages/login/settled.vue

@@ -20,7 +20,7 @@
 			</view>
 		</view>
 		<status v-else :status="form.status" :updateTime="form.updateTime" :remark="form.remark"></status>
-		<view v-if="tab == 1" :class="title == '申请入驻'?'tab-top':''" >
+		<view v-if="tab == 1" :class="title == '申请入驻'?'tab-top':''">
 			<form>
 
 				<view class="borderRadiu">
@@ -116,7 +116,7 @@
 		</view>
 		<view v-if="tab == 2" :class="title=='申请入驻'?'tab-top':''" :style="title == '店铺信息' ? 'margin-top: 120upx' : ''">
 			<form>
-				<view class="borderRadiu" style="margin-bottom: 114upx;">
+				<view class="borderRadiu">
 					<view class="flex cu-form-group margin-top1 ">
 						<view class="content ">
 							<text class="text-bold">法人信息</text>
@@ -154,10 +154,26 @@
 					</view>
 				</view>
 			</form>
+			<view class="borderRadiu">
+				<view class="flex cu-form-group margin-top1">
+					<view class="content ">
+						<text class="text-bold">提交门店负责人信息</text>
+						<i class="text-bg "></i>
+					</view>
+				</view>
+				<view class="cu-form-group">
+					<view class="title">姓名</view>
+					<input placeholder="门店负责人姓名" v-model="form.leaderName" name="input"></input>
+				</view>
+				<view class="cu-form-group">
+					<view class="title">手机号</view>
+					<input placeholder="门店负责人手机号" v-model="form.leaderPhone" name="input"></input>
+				</view>
+			</view>
 		</view>
 		<view v-if="tab == 3" :class="title == '申请入驻'?'tab-top':''" :style="title == '店铺信息' ? 'margin-top: 120upx' : ''">
 			<form>
-				<view class="borderRadiu">
+				<!-- <view class="borderRadiu">
 					<view class="flex cu-form-group margin-top1">
 						<view class="content ">
 							<text class="text-bold">提交门店信息</text>
@@ -171,7 +187,6 @@
 					<view class="cu-form-group">
 						<view class="title">所在地区</view>
 						<view style="display: flex;width: 74%;justify-content: space-between;" @click="$refs.picker.show()">
-							<!-- <u-input readonly placeholder="去设置" v-model="form.locality" @click="$refs.picker.show()"    /> -->
 							<view style="font-size: 30rpx;">
 								<text v-if="form.locality"> {{ form.locality }}</text>
 								<text v-else style="color: grey">请选择所在地区</text>
@@ -183,52 +198,8 @@
 						<view class="title">门店地址</view>
 						<input placeholder="请输入门店地址详细地址" v-model="form.address" name="input"></input>
 					</view>
-					<!-- <view class="customize">
-						<view class="title">地理位置</view>
-						<view class=" booder-top" style="padding-bottom: 16upx" :style="{ 'display': mapIsHidden }">
-							<map style="width: 100%; height: 218upx;" :latitude="latitude" scale="14" zIndex="100"
-								:longitude="longitude" :markers="marker" @tap="handleMarkerTap"></map>
-						</view>
+				</view> -->
 
-						<view class="business-prompt">
-							若位置有误直接影响客户到店,请在地图中仔细核对,可拖拽地图确保位置正确
-						</view>
-					</view> -->
-					<!-- <view class="customize">
-						<view class="title">门头照片</view>
-						<view class="grid col-3 grid-square flex-sub booder-top">
-							<view class="bg-img" v-for="(item, index) in headPhotoImg" :key="index" @tap="ViewImage"
-								:data-url="headPhotoImg[index]">
-								<image :src="headPhotoImg[index]" mode="aspectFill"></image>
-								<view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index">
-									<text class='cuIcon-close'></text>
-								</view>
-							</view>
-							<view class="solids" @tap="ChooseImage" v-if="headPhotoImg.length <= 4">
-								<text class='cuIcon-cameraadd'></text>
-							</view>
-						</view>
-						<view class="business-prompt">
-							门店照片需包含完整的门店入口和招牌名称,建议现场拍摄门头照;最多可上传5张,支持格式bmp、png、jpeg、jpg,单个图片不超过5MB,建议尺寸在2000*1500px以上
-						</view>
-					</view> -->
-				</view>
-				<view class="borderRadiu" style="margin-bottom: 114upx;">
-					<view class="flex cu-form-group margin-top1">
-						<view class="content ">
-							<text class="text-bold">提交门店负责人信息</text>
-							<i class="text-bg "></i>
-						</view>
-					</view>
-					<view class="cu-form-group">
-						<view class="title">姓名</view>
-						<input placeholder="门店负责人姓名" v-model="form.leaderName" name="input"></input>
-					</view>
-					<view class="cu-form-group">
-						<view class="title">手机号</view>
-						<input placeholder="门店负责人手机号" v-model="form.leaderPhone" name="input"></input>
-					</view>
-				</view>
 			</form>
 		</view>
 		<view v-if="tab == 1" class="padding flex flex-direction sub-bottom">
@@ -238,13 +209,13 @@
 			<button class="cu-btn round line-blue  shadow" @click="tab = 1">上一步</button>
 			<button style="margin-left: 12upx;width:77%" class="cu-btn bg-blue round " @click="tab = 3">保存并下一步</button>
 		</view>
-		<view v-if="tab == 2 && title == '店铺信息'" class="padding flex sub-bottom">
-			<button class="cu-btn round line-gray  shadow" @click="$Router.push({ name: 'settings' })">取消</button>
-			<button style="margin-left: 12upx;width:77%" class="cu-btn line-blue  round shadow" @click="tab = 3">下一页</button>
+		<view v-if="tab == 2 && title == '店铺信息'" class="padding flex sub-bottom" style="justify-content: space-around;">
+			<button class="cu-btn  line-gray  shadow" style="width: 40%;" @click="$Router.push({ name: 'settings' })">取消</button>
+			<button style="margin-left: 12upx;width:40%" class="cu-btn bg-blue  " @click="sumbit">提交审核</button>
+			<!-- <button style="margin-left: 12upx;width:77%" class="cu-btn line-blue  round shadow" @click="tab = 3">下一页</button> -->
 		</view>
 		<view v-if="tab == 3" class="padding flex sub-bottom">
-			<button class="cu-btn round line-blue  shadow" @click="tab = 2">{{ title == '申请入驻' ? '上一步' : '上一页'
-                }}</button>
+			<button class="cu-btn round line-blue  shadow" @click="tab = 2">{{ title == '申请入驻' ? '上一步' : '上一页' }}</button>
 			<button style="margin-left: 12upx;width:77%" class="cu-btn bg-blue round " @click="sumbit">提交审核</button>
 		</view>
 		<view class="cu-load load-modal" v-if="lodingshow">
@@ -253,7 +224,8 @@
 		</view>
 		<w-picker class="picker-style" :visible.sync="visible" ref="picker" mode="region" :value="form.locality"
 			@confirm="onConfirm($event, 'region')"></w-picker>
-		<selectType v-if="showSelectLocality" @transmitType="confirmLocality" @cutPopup="showSelectLocality = false"></selectType>
+		<selectType v-if="showSelectLocality" @transmitType="confirmLocality" @cutPopup="showSelectLocality = false">
+		</selectType>
 	</view>
 
 </template>
@@ -347,7 +319,7 @@
 				loginType: '',
 				showSelectLocality: false, //选择主体类型弹窗显隐
 				mode: 1,
-				typeLabel:''
+				typeLabel: ''
 			}
 		},
 		watch: {
@@ -381,6 +353,7 @@
 			} else {
 				if (data.params) {
 					let obj = JSON.parse(decodeURIComponent(data.params));
+					console.log(obj)
 					this.title = '店铺信息'
 					this.tab = 2
 					obj.lifespanType = obj.lifespanType ? obj.lifespanType : '1'
@@ -390,8 +363,8 @@
 						iconPath: '../../static/boiaoji.png'
 					}] : []
 					this.businessLicenseImg = configService.apiUrl + '/' + obj.businessLicense
-					this.identityOneImg = configService.apiUrl + '/' + obj.identityOne
-					this.identityTwoImg = configService.apiUrl + '/' + obj.identityTwo
+					this.identityOneImg = obj.identityOne
+					this.identityTwoImg = obj.identityTwo
 					console.log(this.identityOneImg)
 					this.headPhotoImg = obj.headPhoto ? obj.headPhoto.split(',').filter(id => id !== '') : []
 					obj.headPhoto = obj.headPhoto ? obj.headPhoto.split(',').filter(id => id !== '') : []
@@ -405,7 +378,7 @@
 			confirmLocality(data) {
 				this.form.type = data.value
 				this.typeLabel = data.label
-				this.showSelectLocality =false
+				this.showSelectLocality = false
 			},
 			//选择证件有效时间
 			onEndTimeChange(val) {
@@ -708,15 +681,27 @@
 									if (this.form['lifespanType'] == 2 && (this.form['lifespanBegin'] == null || this.form[
 												'lifespanEnd'] ==
 											null)) {
-										this.$tip.alert('请选择日期!')
+										// this.$tip.alert('请选择日期!')
+										uni.showToast({
+											icon: 'none',
+											title: '请选择日期!'
+										})
 										return
 									}
 									if (this.form['businessLicense'] == null) {
-										this.$tip.alert('请上传营业执照!')
+										// this.$tip.alert('请上传营业执照!')
+										uni.showToast({
+											icon: 'none',
+											title: '请上传营业执照!'
+										})
 										return
 									}
 									if (this.formName[j]) {
-										this.$tip.alert(`请填写${this.formName[j]}!`)
+										// this.$tip.alert(`请填写${this.formName[j]}!`)
+										uni.showToast({
+											icon: 'none',
+											title: `请填写${this.formName[j]}!`
+										})
 										return
 									}
 
@@ -749,34 +734,63 @@
 									})
 									// #endif
 									// #ifndef APP-PLUS
-									this.$tip.success('登录成功!')
+									// this.$tip.success('登录成功!')
+									uni.showToast({
+										icon: 'none',
+										title: '登录成功'
+									})
 									this.$Router.replaceAll({
 										name: 'index'
 									})
 									// #endif
 								} else {
-									this.$tip.error(res.data.message);
+									// this.$tip.error(res.data.message);
+									uni.showToast({
+										icon: 'none',
+										title: res.data.message
+									})
 								}
 							})
 						}
 					}
 				} else {
-					console.log("编辑")
+					// this.form.identityOne = configService.apiUrl+'/'+this.form.identityOne
+					// this.form.identityTwo = configService.apiUrl+'/'+this.form.identityTwo
+					const isHttpOrHttpsone = /^https?:\/\//.test(this.form.identityOne)
+						const isHttpOrHttpstwo = /^https?:\/\//.test(this.form.identityOne)
+						if(!isHttpOrHttpsone){
+							this.form.identityOne = configService.apiUrl+'/'+this.form.identityOne
+						}
+						if(!isHttpOrHttpstwo){
+							tthis.form.identityTwo = configService.apiUrl+'/'+this.form.identityTwo
+						}
 					let data = {
 						...this.form,
 						source: 2,
 						headPhoto: Array.isArray(this.form.headPhoto) ? this.form.headPhoto.join(',') : this.form.headPhoto,
-						longitude: this.markers.length > 0 ? this.markers[0].longitude : '',
-						latitude: this.markers.length > 0 ? this.markers[0].latitude : ''
+						
+						// longitude: this.markers.length > 0 ? this.markers[0].longitude : '',
+						// latitude: this.markers.length > 0 ? this.markers[0].latitude : ''
 					}
-					this.$http.post('/merchant/localMerchantInfo/edit', data).then(res => {
+					console.log(data)
+					// this.$http.post('/merchant/localMerchantInfo/edit', data).then(res => {
+							this.$http.post('/merchant/localMerchantInfo/editMerchantInfo', data).then(res => {
+						
 						if (res.data.success) {
-							this.$tip.success(res.data.result || '成功')
+							// this.$tip.success(res.data.result || '成功')
+							uni.showToast({
+								icon: 'none',
+								title: res.data.result || '成功'
+							})
 							uni.navigateBack({
 								delta: 1 // 返回的页面数,默认为1
 							})
 						} else {
-							this.$tip.error(res.data.message);
+							// this.$tip.error(res.data.message);
+							uni.showToast({
+								icon: 'none',
+								title: res.data.message
+							})
 						}
 					})
 				}

+ 1 - 0
pages/order/arriveUpload.vue

@@ -52,6 +52,7 @@ export default {
 		}
 	},
 	onLoad(options) {
+		console.log(options)
 		this.taskId = options.taskId;
 		this.checkType = options.checkType;
 		this.uptype = options.uptype;

+ 2 - 4
pages/order/serviceOrder/orderDetail.vue

@@ -699,7 +699,7 @@
 					.map(key => `${key}=${encodeURIComponent(params[key])}`)
 					.join('&');
 				uni.navigateTo({
-					url: '/pages/order/arriveUpload?${queryString}'
+					url: `/pages/order/arriveUpload?${queryString}`
 				})
 			},
 			help() {
@@ -712,15 +712,13 @@
 				this.getDeatil()
 			},
 		},
-		mounted() {
+		onshow() {
 			this.getDeatil()
 		},
 		onLoad(options) {
 			this.taskId = options.taskId
 			this.checkType = options.checkType
 			this.rightsId = options.rightsId
-      console.log(this.rightsId)
-      console.log(this.rightsId?"0":"1")
 		}
 	}
 </script>

+ 34 - 8
pages/store/advertising.vue

@@ -114,7 +114,10 @@
 			if (res.data.success) {
 				this.businessData = res.data.result
 			} else {
-				this.$tip.error(res.data.message);
+				uni.showToast({
+					icon:'none',
+					title:res.data.message
+				})
 			}
 		},
 		methods: {
@@ -229,12 +232,19 @@
 				if (this.form.videoStatus == null) {
 					this.$http.post('/merchant/LocalMerchantOperate/add', data).then(res => {
 						if (res.data.success) {
-							this.$tip.success(res.data.result || '成功')
+							uni.showToast({
+								icon:'none',
+								title:res.data.result || '成功'
+							})
+							
 							uni.navigateBack({
 								delta: 1 // 返回的页面数,默认为1
 							})
 						} else {
-							this.$tip.error(res.data.message);
+							uni.showToast({
+								icon:'none',
+								title:res.data.message
+							})
 						}
 					})
 				} else {
@@ -243,12 +253,18 @@
 						id: this.form.videoId
 					}).then(res => {
 						if (res.data.success) {
-							this.$tip.success(res.data.result || '成功')
+							uni.showToast({
+								icon:'none',
+								title:res.data.result || '成功'
+							})
 							uni.navigateBack({
 								delta: 1 // 返回的页面数,默认为1
 							})
 						} else {
-							this.$tip.error(res.data.message);
+							uni.showToast({
+								icon:'none',
+								title:res.data.message
+							})
 						}
 					})
 				}
@@ -257,18 +273,28 @@
 			delClick(val) {
 				this.$http.delete('/merchant/localMerchantTime/delete?id=' + val.id).then(res => {
 					if (res.data.success) {
-						this.$tip.success(res.data.result || '成功')
+						uni.showToast({
+							icon:'none',
+							title:res.data.result || '成功'
+						})
+						
 						this.$http.get('/merchant/localMerchantTime/list?merchantId=' + uni.getStorageSync(USER_INFO).merchantId)
 							.then(res => {
 								if (res.data.success) {
 									this.businessData = res.data.result
 								} else {
-									this.$tip.error(res.data.message);
+									uni.showToast({
+										icon:'none',
+										title:res.data.message
+									})
 								}
 							})
 
 					} else {
-						this.$tip.error(res.data.message);
+						uni.showToast({
+							icon:'none',
+							title:res.data.message
+						})
 					}
 				})
 			}

+ 16 - 4
pages/store/brandMessage.vue

@@ -100,26 +100,38 @@ export default {
                 // this.$http.post('/merchant/localMerchantBrand/add',data).then(res => {
 									this.$http.post('/merchant/localMerchantBrand/addNew',data).then(res => {
                     if (res.data.success) {
-                        this.$tip.success(res.data.result || '成功')
+												uni.showToast({
+													icon:'none',
+													title:'成功'
+												})
                         uni.navigateBack({
                             delta: 1 // 返回的页面数,默认为1
                         })
                     }
                     else {
-                        this.$tip.error(res.data.message);
+												uni.showToast({
+													icon:'none',
+													title:res.data.message
+												})
                     }
                 })
             }
             else{
                 this.$http.post('/merchant/localMerchantBrand/edit',{...data,id:this.form.logoId}).then(res => {
                     if (res.data.success) {
-                        this.$tip.success(res.data.result || '成功')
+												uni.showToast({
+													icon:'none',
+													title:res.data.result || '成功'
+												})
                         uni.navigateBack({
                             delta: 1 // 返回的页面数,默认为1
                         })
                     }
                     else {
-                        this.$tip.error(res.data.message);
+											uni.showToast({
+												icon:'none',
+												title:res.data.message
+											})
                     }
                 })
             }

+ 107 - 316
pages/store/businessInfor.vue

@@ -1,8 +1,5 @@
 <template>
 	<view>
-		<!-- <cu-custom bgColor="bg-fff" :isBack="true">
-			<block slot="content"> 经营信息</block>
-		</cu-custom> -->
 		<view class="top"></view>
 		<view class="head">
 			<view class="handle">
@@ -10,12 +7,11 @@
 					<span class="cuIcon-back" @click="back"></span>
 				</view>
 				<span class="center">经营信息</span>
-				<view class="head_right">
-				</view>
+				<view class="head_right"></view>
 			</view>
 		</view>
 		<status v-if="form && form.videoStatus !== null" :status="form.videoStatus" :updateTime="form.videoUpdateTime"
-			:remark="form.videoRemark"></status>
+			:remark="form.videoRemark" style="z-index: 0;"></status>
 		<view class="tab-top" :style="form && form.videoStatus == null ? 'margin-top: 14upx;' : 'margin-top: 144upx;'">
 			<view class="borderRadiu">
 				<view class=" cu-form-group margin-top1 justify-between">
@@ -66,11 +62,15 @@
 				</view>
 				<view class="customize">
 					<view class="title">地理位置</view>
-					<view class=" booder-top" style="padding-bottom: 16upx" :style="{ 'display': mapIsHidden }"
+					<!-- 修复:mapIsHidden 应为字符串 'block'/'none',避免样式解析错误 -->
+					<view class=" booder-top" style="padding-bottom: 16upx" :style="{ display: mapIsHidden }"
 						@click="selectAddress">
-						<!-- <map :key="mapKey" style="width: 100%; height: 218upx;z-index:99" :latitude="latitude" scale="14"
-							zIndex="100" :longitude="longitude" :markers="marker" @tap="handleMarkerTap"></map> -->
-						<tdmap style="" :initialPosition="savedLocation" :allowSelection="false" :showCoordinates="false" :key="mapKey"></tdmap>
+						<tdmap 
+							:initialPosition="savedLocation" 
+							:allowSelection="false" 
+							:showCoordinates="false" 
+							:key="mapKey"
+						></tdmap>
 					</view>
 					<view class="business-prompt">
 						若位置有误直接影响客户到店,请在地图中仔细核对,可拖拽地图确保位置正确
@@ -82,24 +82,18 @@
 			<button class="cu-btn round line-gray  shadow" @click="$Router.push({ name: 'settings' })">取消</button>
 			<button style="margin-left: 12upx;width:77%" class="cu-btn bg-blue round " @click.native="sumbit">提交审核</button>
 		</view>
-
 		<u-picker v-model="show" mode="time" @confirm="selectTime" style="z-index: 999 !important;"></u-picker>
 	</view>
-
 </template>
+
 <script>
 	import configService from "../../common/service/config.service";
-	import {
-		USER_INFO
-	} from "@/common/util/constants";
+	import { USER_INFO } from "@/common/util/constants";
 	import status from "./components/status.vue";
 	import tdmap from "./tdtuMap.vue"
 
 	export default {
-		components: {
-			status,
-			tdmap
-		},
+		components: { status, tdmap },
 		data() {
 			return {
 				video: "",
@@ -119,161 +113,96 @@
 					height: 30,
 					label: {
 						content: "",
-						color: "#000000", // 文字颜色
-						fontSize: 14, // 文字大小
+						color: "#000000",
+						fontSize: 14,
 						bgColor: "#FFFFFF",
 						borderColor: "#CCCCCC",
 					},
-				}, ], // 初始为空数组
-				mapIsHidden: true,
+				}],
+				mapIsHidden: 'block', // 修复:初始为block,确保地图容器显示
 				mapKey: 1,
-				savedLocation: {}
+				// 修复:初始化savedLocation为合法对象,避免undefined
+				savedLocation: { lng: 112.55, lat: 37.87 } 
 			};
 		},
-		 onLoad(data) {
+		onLoad(data) {
 			if (data.params) {
 				let obj = JSON.parse(decodeURIComponent(data.params));
-				this.video = obj.video ? obj.video : ''
-				obj.photo = obj.photo ? obj.photo.split(',').filter(id => id !== '') : []
-				this.form = obj
-				this.date = this.form.openingTime
-				// this.savedLocation.lnglat = {
-				// 	lng: obj.longitude || 0,
-				// 	lat: obj.latitude || 0,
-				// };
-				// this.savedLocation.address = obj.address || '位置';
-				// this.latitude = obj.lat;
-				// this.longitude = obj.lng;
+				this.video = obj.video ? obj.video : '';
+				obj.photo = obj.photo ? obj.photo.split(',').filter(id => id !== '') : [];
+				this.form = obj;
+				this.date = this.form.openingTime;
+				
+				// 修复:从obj中赋值坐标,确保数字类型
+				if (obj.longitude && obj.latitude) {
+					this.savedLocation = {
+						lng: Number(obj.longitude) || 112.55,
+						lat: Number(obj.latitude) || 37.87,
+						address: obj.address || '位置'
+					};
+					this.latitude = obj.latitude;
+					this.longitude = obj.longitude;
+				}
 			}
 		},
 		onShow() {
 			this.$http
-				.get(
-					"/merchant/localMerchantTime/list?merchantId=" +
-					uni.getStorageSync(USER_INFO).merchantId
-				)
+				.get("/merchant/localMerchantTime/list?merchantId=" + uni.getStorageSync(USER_INFO).merchantId)
 				.then((res) => {
 					if (res.data.success) {
 						this.businessData = res.data.result;
 					} else {
-						this.$tip.error(res.data.message);
+						uni.showToast({ icon:'none', title:res.data.message });
 					}
 				});
-			let da = uni.getStorageSync("address");
-			console.log(da)
-			// let addname = uni.getStorageSync("currentAddress");
-			// const lat = parseFloat(da.lng) || 37.860372;
-			// const lng = parseFloat(da.lat) || 112.588154;
-			// const labelContent = da?.address || "未设置地址";
 			
+			// 修复:安全获取存储的地址,避免da为undefined
+			let da = uni.getStorageSync("address") || {};
+			console.log('存储的地址信息:', da);
+			
+			// 核心:确保lng/lat是合法数字,兜底默认值
+			const lng = Number(da.lng) || 112.55;
+			const lat = Number(da.lat) || 37.87;
 			
-			this.savedLocation.lng = da.lng
-			this.savedLocation.lat = da.lat
-			this.savedLocation.address = da.address || '位置';
-			this.latitude = da.lat;
-			this.longitude = da.lng;
-			this.mapKey += 1;
-			// this.marker[0].longitude = da.longitude
-			// this.marker[0].latitude = da.latitude
-			// this.marker[0].label.content = addname.name
-			// this.marker = [{
-			// 	latitude: lat, // 默认值避免 undefined
-			// 	longitude: lng, // 默认值避免 undefined
-			// 	iconPath: "/static/boiaoji.png",
-			// 	width: 30,
-			// 	height: 30,
-			// 	label: {
-			// 		content: labelContent, // 避免 addname 为 undefined
-			// 		color: "#000000",
-			// 		fontSize: 14,
-			// 		bgColor: "#FFFFFF",
-			// 		borderColor: "#CCCCCC",
-			// 	},
-			// }, ];
-		
-			// this.getCurrentLocation();
+			// 更新savedLocation(触发子组件props更新)
+			this.savedLocation = {
+				lng: lng,
+				lat: lat,
+				address: da.address || '位置'
+			};
+			this.latitude = lat;
+			this.longitude = lng;
+			
+			// 优化:仅当坐标变化时更新mapKey,避免频繁刷新
+			if (lng !== 112.55 || lat !== 37.87) {
+				this.mapKey += 1;
+			}
 		},
 		methods: {
 			back() {
-				uni.navigateTo({
-					url: '/pages/store/settings'
-				})
+				uni.navigateTo({ url: '/pages/store/settings' });
 			},
 			selectAddress() {
-				uni.navigateTo({
-					url: '/pages/store/selectTdMap?url=' + '/pages/store/businessInfor'
-				})
+				uni.navigateTo({ url: '/pages/store/selectTdMap?url=' + '/pages/store/businessInfor' });
 			},
-			// getCurrentLocation() {
-			// 	uni.getStorage({
-			// 		key: "currentAddress",
-			// 		success: (res) => {
-			// 			if (res.data && res.data.location) {
-			// 				let temp = res.data.location.split(",");
-			// 				this.latitude = temp[1];
-			// 				this.longitude = temp[0];
-
-
-			// 				// this.marker = [{
-			// 				// 	id: 0,
-			// 				// 	latitude: temp[1],
-			// 				// 	longitude: temp[0],
-			// 				// 	title: res.data.name || '当前位置',
-			// 				// 	iconPath: '../../static/boiaoji.png',
-			// 				// 	width: 30,
-			// 				// 	height: 30,
-			// 				// 	callout: { // 添加标注说明
-			// 				// 		content: res.data.name || '当前位置',
-			// 				// 		color: '#000',
-			// 				// 		fontSize: 12,
-			// 				// 		borderRadius: 10,
-			// 				// 		bgColor: '#fff',
-			// 				// 		padding: 5,
-			// 				// 		display: 'ALWAYS'
-			// 				// 	}
-			// 				// }];
-			// 				this.$forceUpdate();
-			// 			}
-			// 		},
-			// 		fail: () => {
-			// 			// 如果没有存储的位置,可以设置默认位置
-			// 			// this.setDefaultLocation();
-			// 		},
-			// 	});
-			// },
-
 			handleMarkerTap() {
 				const queryString = uni.getStorageSync("address") ?
-					encodeURIComponent(JSON.stringify(uni.getStorageSync("address"))) :
-					"";
-				uni.navigateTo({
-					url: `/pages/login/map?position=${queryString}`,
-					// url:'/pages/login/map'
-				});
+					encodeURIComponent(JSON.stringify(uni.getStorageSync("address"))) : "";
+				uni.navigateTo({ url: `/pages/login/map?position=${queryString}` });
 			},
 			selectTime(e) {
-				console.log(e);
 				this.date = e.year + "-" + e.month + "-" + e.day;
 			},
 			hoursChange(index) {
-				const queryString = encodeURIComponent(
-					JSON.stringify({
-						index,
-						arr: this.businessData,
-					})
-				);
-				uni.navigateTo({
-					url: `/pages/store/addHours?params=${queryString}`,
-				});
+				const queryString = encodeURIComponent(JSON.stringify({ index, arr: this.businessData }));
+				uni.navigateTo({ url: `/pages/store/addHours?params=${queryString}` });
 			},
 			delectVideo() {
 				uni.showModal({
 					title: "提示",
 					content: "是否要删除此视频",
 					success: (res) => {
-						if (res.confirm) {
-							this.video = "";
-						}
+						if (res.confirm) this.video = "";
 					},
 				});
 			},
@@ -284,73 +213,45 @@
 					cancelText: "取消",
 					confirmText: "确定",
 					success: (res) => {
-						if (res.confirm) {
-							// this.photoList.splice(e.currentTarget.dataset.index, 1)
-							this.form.photo.splice(e.currentTarget.dataset.index, 1);
-						}
+						if (res.confirm) this.form.photo.splice(e.currentTarget.dataset.index, 1);
 					},
 				});
 			},
 			ChooseImage() {
 				uni.chooseImage({
-					// count: 4, //默认9
-					sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
-					sourceType: ["album"], //从相册选择
+					sizeType: ["original", "compressed"],
+					sourceType: ["album"],
 					success: (res) => {
-						if (res) {
-							// this[type + 'Img'] = chooseImageRes.tempFilePaths[0];
-							uni.uploadFile({
-								url: configService.apiUrl + "/sys/common/upload",
-								filePath: res.tempFilePaths[0],
-								name: "file",
-								formData: {
-									biz: "temp",
-								},
-								success: (files) => {
-									let data = JSON.parse(files.data);
-									if (data.success) {
-										if (this.form.photo.length != 0) {
-											// this.photoList = this.photoList.concat(res.tempFilePaths)
-											this.form.photo.push(
-												configService.apiUrl + "/" + data.message
-											);
-										} else {
-											// this.photoList =res.tempFilePaths
-											this.form.photo = [
-												configService.apiUrl + "/" + data.message,
-											];
-										}
-									}
-								},
-							});
-						}
+						uni.uploadFile({
+							url: configService.apiUrl + "/sys/common/upload",
+							filePath: res.tempFilePaths[0],
+							name: "file",
+							formData: { biz: "temp" },
+							success: (files) => {
+								let data = JSON.parse(files.data);
+								if (data.success) {
+									const imgUrl = configService.apiUrl + "/" + data.message;
+									this.form.photo = this.form.photo.length ? [...this.form.photo, imgUrl] : [imgUrl];
+								}
+							},
+						});
 					},
 				});
 			},
 			ViewImage(e) {
-				uni.previewImage({
-					urls: this.form.photo,
-					current: e.currentTarget.dataset.url,
-				});
+				uni.previewImage({ urls: this.form.photo, current: e.currentTarget.dataset.url });
 			},
 			chooseVideo() {
-				// 上传视频
-				console.log("上传视频");
 				uni.chooseVideo({
 					sourceType: ["camera", "album"],
-					success: (res) => {
-						this.video = res.tempFilePath;
-					},
+					success: (res) => { this.video = res.tempFilePath; },
 				});
 			},
 			sumbit() {
 				if (!this.savedLocation.lng || !this.savedLocation.lat) {
-				    uni.showToast({
-				      title: "请先获取位置信息",
-				      icon: "none"
-				    });
+				    uni.showToast({ title: "请先获取位置信息", icon: "none" });
 				    return;
-				  }
+				}
 				let data = {
 					id: uni.getStorageSync(USER_INFO).merchantId,
 					storeExtent: this.form.storeExtent,
@@ -358,77 +259,48 @@
 					latitude: this.savedLocation.lat,
 					openingTime: this.date,
 				};
-				console.log(this.savedLocation.lng)
-				// if (this.form.videoStatus == null) {
-				// 	this.$http.post('/merchant/LocalMerchantOperate/add', data).then(res => {
-				// 		if (res.data.success) {
-				// 			this.$tip.success(res.data.result || '成功')
-				// 			uni.navigateBack({
-				// 				delta: 1 // 返回的页面数,默认为1
-				// 			})
-				// 		} else {
-				// 			this.$tip.error(res.data.message);
-				// 		}
-				// 	})
-				// }else {
-
 				this.$http
-					.post("/merchant/localMerchantInfo/shopEdit", {
-						...data,
-					})
+					.post("/merchant/localMerchantInfo/shopEdit", { ...data })
 					.then((res) => {
 						if (res.data.success) {
-							this.$tip.success(res.data.result || "成功");
-							uni.navigateTo({
-								url: '/pages/store/settings'
-							})
+							uni.showToast({ title: '提交成功', icon: 'none' });
+							uni.navigateTo({ url: '/pages/store/settings' });
 						} else {
-							this.$tip.error(res.data.message);
+							uni.showToast({ title: res.data.message, icon: 'none' });
 						}
 					});
-				// }
 			},
 			delClick(val) {
 				this.$http
 					.delete("/merchant/localMerchantTime/delete?id=" + val.id)
 					.then((res) => {
 						if (res.data.success) {
-							this.$tip.success(res.data.result || "成功");
+							uni.showToast({ title: '提交成功', icon: 'none' });
 							this.$http
-								.get(
-									"/merchant/localMerchantTime/list?merchantId=" +
-									uni.getStorageSync(USER_INFO).merchantId
-								)
+								.get("/merchant/localMerchantTime/list?merchantId=" + uni.getStorageSync(USER_INFO).merchantId)
 								.then((res) => {
-									if (res.data.success) {
-										this.businessData = res.data.result;
-									} else {
-										this.$tip.error(res.data.message);
-									}
+									if (res.data.success) this.businessData = res.data.result;
+									else uni.showToast({ icon:'none', title:res.data.message });
 								});
 						} else {
-							this.$tip.error(res.data.message);
+							uni.showToast({ icon:'none', title:res.data.message });
 						}
 					});
 			},
 		},
 	};
 </script>
-<style scoped lang="scss">
-	page {
-		background: #f8f8fa;
-	}
 
+<style scoped lang="scss">
+	page { background: #f8f8fa; }
 	.top {
 		width: 100%;
 		height: var(--status-bar-height);
 		background: linear-gradient(87deg, #FFFFFF 0%, #A3CDFF 100%), linear-gradient(360deg, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%);
 	}
-
 	.head {
 		width: 100%;
 		background: #ffffff;
-
 		.handle {
 			height: 112rpx;
 			display: flex;
@@ -436,11 +308,7 @@
 			align-items: center;
 			padding: 0px 24rpx;
 			position: relative;
-
-			.head_left {
-				font-size: 40rpx;
-			}
-
+			.head_left { font-size: 40rpx; }
 			.center {
 				position: absolute;
 				left: 50%;
@@ -449,12 +317,10 @@
 				font-size: 30rpx;
 				font-weight: 600;
 			}
-
 			.head_right {
 				display: flex;
 				justify-content: space-between;
 				align-items: center;
-
 				span {
 					width: 40rpx;
 					height: 40rpx;
@@ -465,101 +331,47 @@
 				}
 			}
 		}
-
 	}
-
-	.tab-top {
-		padding: 0 26upx;
-		padding-bottom: 130upx;
-	}
-
+	.tab-top { padding: 0 26upx; padding-bottom: 130upx; }
 	.progress-status {
 		position: fixed;
 		width: 100%;
 		z-index: 9999;
 		background: #ffffff;
-
 		.status {
 			font-size: 38upx;
 			color: #f6863e;
 			font-weight: 500;
 			margin-bottom: 10upx;
-
-			text {
-				margin-left: 5upx;
-			}
-
-			image {
-				vertical-align: text-top;
-				width: 42upx;
-				height: 42upx;
-			}
+			text { margin-left: 5upx; }
+			image { vertical-align: text-top; width: 42upx; height: 42upx; }
 		}
 	}
-
 	.borderRadiu {
 		border-radius: 8px;
 		background-color: #ffffff;
-
 		.customize {
 			padding: 0 18upx 18upx;
-
-			.title {
-				padding: 18upx 0;
-				font-size: 28upx;
-				// padding: 10px;
-			}
+			.title { padding: 18upx 0; font-size: 28upx; }
 		}
-
 		.business-img {
 			height: 210upx;
 			width: 310upx;
 			background-size: cover;
-
-			image {
-				width: 100%;
-				height: 100%;
-			}
+			image { width: 100%; height: 100%; }
 		}
-
 		.business-prompt {
 			padding-top: 16upx;
 			font-size: 20upx;
 			color: #999999;
 		}
 	}
-
 	.booder-top {
 		border-bottom: 1px solid rgb(238, 238, 238);
 		padding-bottom: 7px;
-
-		.uploader_video {
-			width: 310upx;
-			height: 210upx;
-		}
-
-		.video-container {
-			max-width: 100%;
-			/* 最大宽度为父容器宽度 */
-			max-height: 100%;
-
-			::v-deep.uni-video-bar {
-				height: 62upx;
-				padding: 0;
-			}
-		}
-
-		// ::v-deep video{
-		//     position: relative;
-		//     z-index: 1;
-		//     width: 310upx ;
-		//     height: 210upx;
-		//     .uni-video-bar .uni-video-bar-full{
-
-		//     }
-		// }
+		.uploader_video { width: 310upx; height: 210upx; }
+		.video-container { max-width: 100%; max-height: 100%; }
 	}
-
 	.sub-bottom {
 		position: fixed;
 		width: 100%;
@@ -567,31 +379,22 @@
 		background: #ffffff;
 		border-top: 1px solid #eeeeee;
 	}
-
-	.uni-uploader__img {
-		width: 200upx;
-		height: 200upx;
-	}
-
-	.uni-uploader__file,
-	.uploader_video {
+	.uni-uploader__img { width: 200upx; height: 200upx; }
+	.uni-uploader__file, .uploader_video {
 		position: relative;
 		z-index: 1;
 		width: 200upx;
 		height: 200upx;
 	}
-
 	.icon-cuo {
 		position: absolute;
 		right: 0;
 		top: 5upx;
-
 		color: #ffffff;
 		z-index: 999;
 		border-top-right-radius: 20upx;
 		border-bottom-left-radius: 20upx;
 	}
-
 	.business-hours {
 		padding: 27upx 22upx;
 		background: #f7f8fc;
@@ -599,9 +402,7 @@
 		border-radius: 8px 8px 8px 8px;
 		margin-bottom: 18upx;
 	}
-
 	.del-style {
-		// padding: 0 30upx;
 		width: 116upx;
 		background: #ffffff;
 		border-radius: 4px 4px 4px 4px;
@@ -610,15 +411,8 @@
 		font-size: 26upx;
 		line-height: 50upx;
 		text-align: center;
-		// -radius: 4px 4px 4px 4px;
 	}
-
-	.business-date {
-		text {
-			margin-right: 22upx;
-		}
-	}
-
+	.business-date { text { margin-right: 22upx; } }
 	.data-item {
 		display: flex;
 		align-items: center;
@@ -626,9 +420,6 @@
 		padding-left: 16rpx;
 		height: 80rpx;
 		align-items: center;
-
-		.custom-input {
-			width: 160rpx;
-		}
+		.custom-input { width: 160rpx; }
 	}
 </style>

+ 17 - 4
pages/store/businessQua.vue

@@ -249,12 +249,19 @@
 					if (this.form.specialStatus == null) {
 						this.$http.post('/merchant/localMerchantSpecial/add', data).then(res => {
 							if (res.data.success) {
-								this.$tip.success(res.data.result || '成功')
+								uni.showToast({
+									icon:'none',
+									title:res.data.result || '成功'
+								})
 								uni.navigateBack({
 									delta: 1 // 返回的页面数,默认为1
 								})
 							} else {
-								this.$tip.error(res.data.message);
+								uni.showToast({
+									icon:'none',
+									title:res.data.message
+								})
+								
 							}
 						})
 					} else {
@@ -263,12 +270,18 @@
 							id: this.form.specialId
 						}).then(res => {
 							if (res.data.success) {
-								this.$tip.success(res.data.result || '成功')
+								uni.showToast({
+									icon:'none',
+									title:res.data.result || '成功'
+								})
 								uni.navigateBack({
 									delta: 1 // 返回的页面数,默认为1
 								})
 							} else {
-								this.$tip.error(res.data.message);
+								uni.showToast({
+									icon:'none',
+									title:res.data.message
+								})
 							}
 						})
 					}

+ 4 - 4
pages/store/components/status.vue

@@ -1,5 +1,5 @@
 <template>
-    <view class="progress-status" 
+    <view class="progress-statu" 
         :style="status == null ? '' : 'padding: 20upx 42upx;'">
         <view v-if="status == 0">
             <view class="flex justify-between">
@@ -52,10 +52,10 @@ export default {
 }
 </script>
 <style scoped lang="scss">
-.progress-status {
-    position: fixed;
+.progress-statu {
+    // position: none;
     width: 100%;
-    z-index: 9999;
+    // z-index: 9999;
     background: #FFFFFF;
     border-top: 1px solid #EEEEEE;
     .status {

+ 29 - 9
pages/store/headPhoto.vue

@@ -14,7 +14,7 @@
 							<i class="text-bg "></i>
 						</view>
 					</view>
-					<view class="grid col-4 grid-square flex-sub booder-top" v-if="form.headPhoto">
+					<view class="grid col-4 grid-square flex-sub booder-top">
 						<view class="bg-img" v-for="(item, index) in form.photo" :key="index" @tap="ViewImage"
 							:data-url="form.headPhoto[index]">
 							<image :src="item" mode="aspectFill"></image>
@@ -90,7 +90,10 @@
 			if (res.data.success) {
 				this.businessData = res.data.result
 			} else {
-				this.$tip.error(res.data.message);
+				uni.showToast({
+					icon:'none',
+					title:res.data.message
+				})
 			}
 		},
 		methods: {
@@ -175,23 +178,31 @@
 				if (this.form.headPhotoStatus == null) {
 					this.$http.post('merchant/localMerchantHeadPhoto/add', data).then(res => {
 						if (res.data.success) {
-							this.$tip.success(res.data.result || '成功')
+							uni.showToast({
+								icon:'none',
+								title:'提交成功'
+							})
 							uni.navigateBack({
 								delta: 1 // 返回的页面数,默认为1
 							})
 						} else {
-							this.$tip.error(res.data.message);
+							uni.showToast({
+								icon:'none',
+								title:res.data.message
+							})
 						}
 					})
 				} else {
 					this.$http.post('merchant/localMerchantHeadPhoto/edit',data).then(res => {
 						if (res.data.success) {
-							this.$tip.success(res.data.result || '成功')
+							uni.showToast({
+								icon:'none',
+								title:'提交成功'
+							})
 							uni.navigateBack({
 								delta: 1 // 返回的页面数,默认为1
 							})
 						} else {
-							// this.$tip.error(res.data.message);
 							uni.showToast({
 								icon:'none',
 								title:res.data.message
@@ -204,18 +215,27 @@
 			delClick(val) {
 				this.$http.delete('/merchant/localMerchantTime/delete?id=' + val.id).then(res => {
 					if (res.data.success) {
-						this.$tip.success(res.data.result || '成功')
+						uni.showToast({
+							icon:'none',
+							title:res.data.result || '成功'
+						})
 						this.$http.get('/merchant/localMerchantTime/list?merchantId=' + uni.getStorageSync(USER_INFO).merchantId)
 							.then(res => {
 								if (res.data.success) {
 									this.businessData = res.data.result
 								} else {
-									this.$tip.error(res.data.message);
+									uni.showToast({
+										icon:'none',
+										title:res.data.message
+									})
 								}
 							})
 
 					} else {
-						this.$tip.error(res.data.message);
+						uni.showToast({
+							icon:'none',
+							title:res.data.message
+						})
 					}
 				})
 			}

+ 57 - 112
pages/store/selectTdMap.vue

@@ -6,9 +6,8 @@
 				<view class="head_left">
 					<span class="cuIcon-back" @click="back"></span>
 				</view>
-				<span class="center">商品管理</span>
+				<span class="center">选择地址</span>
 				<view class="head_right">
-					<!-- <span class="cuIcon-search" @click="goSearch"></span> -->
 					<view class="manage" @click="confirm">
 						确定
 					</view>
@@ -16,7 +15,7 @@
 			</view>
 		</view>
 
-		<!-- 地图容器 - 必须设置明确高度 -->
+		<!-- 地图容器 -->
 		<view id="mapContainer" class="map-container"></view>
 
 		<!-- 搜索功能区域 -->
@@ -26,7 +25,6 @@
 				<button class="search-btn" @click="handleSearch">搜索</button>
 			</view>
 
-			<!-- 搜索结果列表 -->
 			<view class="search-results" v-if="searchResults.length > 0">
 				<view class="result-header">
 					<text>搜索结果 ({{ searchResults.length }} 个)</text>
@@ -36,7 +34,7 @@
 					<view v-for="(result, index) in searchResults" :key="index" class="result-item"
 						@click="selectSearchResult(result)">
 						<view class="result-name">{{ result.name }}</view>
-						<view class="result-address">{{ result.address }}</view>
+						<view class="result-address">{{ result.name }}</view>
 						<view class="result-coord">经度:{{ result.lng.toFixed(6) }} 纬度:{{ result.lat.toFixed(6) }}</view>
 					</view>
 				</scroll-view>
@@ -111,23 +109,11 @@
 			}
 		},
 		mounted() {
-			// 确保在H5环境下运行
-			// #ifdef H5
 			this.$nextTick(() => {
 				setTimeout(() => {
 					this.initMap();
-				}, 300);
+				}, 500);
 			});
-			// #endif
-
-			// 非H5环境提示
-			// #ifndef H5
-			console.warn("天地图组件仅支持H5环境");
-			uni.showToast({
-				title: '地图功能仅在H5环境可用',
-				icon: 'none'
-			});
-			// #endif
 		},
 		beforeUnmount() {
 			this.cleanupMap();
@@ -156,19 +142,8 @@
 
 				uni.setStorageSync('address', params);
 				uni.navigateBack({
-					delta: 1 // 返回的页面数,默认为1
+					delta: 1
 				})
-				// 使用encodeURIComponent编码参数
-				// const queryString = Object.keys(params)
-				// 	.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`)
-				// 	.join('&');
-
-				// // 拼接完整URL
-				// const url = `${this.backurl}?${queryString}`;
-				// uni.navigateTo({
-				// 	url: url
-				// })
-
 			},
 			back() {
 				uni.navigateBack()
@@ -196,9 +171,12 @@
 			},
 
 			initMap() {
+				// APP环境使用动态脚本加载
 				if (typeof T === 'undefined') {
 					this.loadTiandituAPI().then(() => {
-						this.createMap();
+						setTimeout(() => {
+							this.createMap();
+						}, 1000);
 					}).catch(err => {
 						console.error("天地图加载失败:", err);
 						uni.showToast({
@@ -207,7 +185,9 @@
 						});
 					});
 				} else {
-					this.createMap();
+					setTimeout(() => {
+						this.createMap();
+					}, 300);
 				}
 			},
 
@@ -215,25 +195,44 @@
 				return new Promise((resolve, reject) => {
 					if (window.T) return resolve();
 
+					// APP环境特殊处理
 					const script = document.createElement('script');
 					script.src = `https://api.tianditu.gov.cn/api?v=4.0&tk=${this.tk}`;
-					script.onload = resolve;
-					script.onerror = () => reject(new Error('天地图脚本加载失败'));
+					script.onload = () => {
+						console.log('天地图API加载成功');
+						resolve();
+					};
+					script.onerror = () => {
+						console.error('天地图脚本加载失败');
+						reject(new Error('天地图脚本加载失败'));
+					};
+					
+					// 添加到DOM
 					document.head.appendChild(script);
 				});
 			},
 
 			createMap() {
 				try {
-					this.map = new T.Map('mapContainer');
+					const mapContainer = document.getElementById('mapContainer');
+					if (!mapContainer) {
+						console.error('地图容器未找到');
+						setTimeout(() => {
+							this.createMap();
+						}, 500);
+						return;
+					}
+
+					this.map = new T.Map('mapContainer', {
+						projection: 'EPSG:4326'
+					});
 
 					let centerLng = 112.55;
 					let centerLat = 37.87;
 
 					if (this.initialPosition && this.isValidPosition(this.initialPosition)) {
 						const lng = this.initialPosition.lng ||
-							(this.initialPosition.lnglat && (this.initialPosition.lnglat.lng || this.initialPosition.lnglat
-								.longitude));
+							(this.initialPosition.lnglat && (this.initialPosition.lnglat.lng || this.initialPosition.lnglat.longitude));
 						const lat = this.initialPosition.lat ||
 							(this.initialPosition.lnglat && (this.initialPosition.lnglat.lat || this.initialPosition.lnglat.latitude));
 
@@ -255,6 +254,7 @@
 					};
 					this.localSearch = new T.LocalSearch(this.map, searchConfig);
 
+					// 添加图层
 					const vecLayer = new T.TileLayer(
 						`https://t{s}.tianditu.gov.cn/vec_c/wmts?tk=${this.tk}`, {
 							subdomains: ['0', '1', '2', '3', '4', '5', '6', '7']
@@ -274,8 +274,7 @@
 
 					if (this.initialPosition && this.isValidPosition(this.initialPosition)) {
 						const lng = this.initialPosition.lng ||
-							(this.initialPosition.lnglat && (this.initialPosition.lnglat.lng || this.initialPosition.lnglat
-								.longitude));
+							(this.initialPosition.lnglat && (this.initialPosition.lnglat.lng || this.initialPosition.lnglat.longitude));
 						const lat = this.initialPosition.lat ||
 							(this.initialPosition.lnglat && (this.initialPosition.lnglat.lat || this.initialPosition.lnglat.latitude));
 
@@ -284,12 +283,17 @@
 					}
 
 					this.mapInitialized = true;
+					console.log('地图初始化完成');
+
 				} catch (e) {
 					console.error('地图初始化错误:', e);
+					uni.showToast({
+						title: '地图初始化失败,请重试',
+						icon: 'none'
+					});
 				}
 			},
 
-			// 搜索相关方法
 			handleSearch() {
 				if (!this.searchKeyword.trim()) {
 					uni.showToast({
@@ -316,14 +320,12 @@
 							lat: parseFloat(poi.lonlat.split(',')[1])
 						}));
 
-						// 在地图上显示搜索结果标记
 						pois.forEach(poi => {
 							const lng = parseFloat(poi.lonlat.split(',')[0]);
 							const lat = parseFloat(poi.lonlat.split(',')[1]);
 							this.addSearchMarker(lng, lat, poi.name, poi.address);
 						});
 
-						// 调整地图视图以显示所有结果
 						const points = pois.map(poi => {
 							const lnglat = poi.lonlat.split(',');
 							return new T.LngLat(parseFloat(lnglat[0]), parseFloat(lnglat[1]));
@@ -349,7 +351,6 @@
 				this.updateLabelContent();
 				this.notifyParent();
 
-				// 关闭其他信息窗口,打开当前结果的信息窗口
 				this.closeAllInfoWindows();
 				this.openInfoWindow(result.lng, result.lat, result.name, result.address);
 			},
@@ -360,7 +361,6 @@
 				this.clearSearchMarkers();
 			},
 
-			// 地图交互方法
 			enableMapSelection() {
 				this.map.on('click', this.handleMapClick);
 			},
@@ -403,7 +403,6 @@
 				this.setMapCenter(e.lnglat.lng, e.lnglat.lat);
 				this.reverseGeocode(e.lnglat.lng, e.lnglat.lat);
 
-				// 点击地图时也显示信息窗口
 				this.openInfoWindow(e.lnglat.lng, e.lnglat.lat, '选中位置', this.address);
 			},
 
@@ -415,22 +414,12 @@
 				});
 			},
 
-			// 标记和信息窗口管理
 			addMarker(lng, lat) {
 				try {
 					const point = new T.LngLat(lng, lat);
 
-					const markerIcon = new T.Icon({
-						iconUrl: 'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" fill="%231296db" stroke="%23ffffff" stroke-width="2"/></svg>',
-						iconSize: new T.Point(24, 24),
-						iconAnchor: new T.Point(12, 24)
-					});
-
-					const marker = new T.Marker(point, {
-						icon: markerIcon
-					});
-
-					// 为标记添加点击事件,显示信息窗口
+					const marker = new T.Marker(point);
+					
 					marker.addEventListener('click', () => {
 						this.openInfoWindow(lng, lat, '选中位置', this.address);
 					});
@@ -448,18 +437,8 @@
 			addSearchMarker(lng, lat, name, address) {
 				try {
 					const point = new T.LngLat(lng, lat);
+					const marker = new T.Marker(point);
 
-					const markerIcon = new T.Icon({
-						iconUrl: 'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><circle cx="12" cy="12" r="8" fill="%23ff6b6b" stroke="%23ffffff" stroke-width="2"/></svg>',
-						iconSize: new T.Point(20, 20),
-						iconAnchor: new T.Point(10, 20)
-					});
-
-					const marker = new T.Marker(point, {
-						icon: markerIcon
-					});
-
-					// 为搜索结果的标记添加点击事件
 					marker.addEventListener('click', () => {
 						this.openInfoWindow(lng, lat, name, address);
 					});
@@ -477,15 +456,15 @@
 
 				const point = new T.LngLat(lng, lat);
 				const infoContent = `
-        <div style="min-width: 250px; padding: 10px;">
-          <div style="font-weight: bold; margin-bottom: 8px; color: #1890ff;">${title}</div>
-          <div style="margin-bottom: 5px; color: #666;">${content}</div>
-          <div style="font-size: 12px; color: #999;">
-            经度: ${lng.toFixed(6)}<br/>
-            纬度: ${lat.toFixed(6)}
-          </div>
-        </div>
-      `;
+					<div style="min-width: 250px; padding: 10px;">
+						<div style="font-weight: bold; margin-bottom: 8px; color: #1890ff;">${title}</div>
+						<div style="margin-bottom: 5px; color: #666;">${content}</div>
+						<div style="font-size: 12px; color: #999;">
+							经度: ${lng.toFixed(6)}<br/>
+							纬度: ${lat.toFixed(6)}
+						</div>
+					</div>
+				`;
 
 				const infoWindow = new T.InfoWindow(infoContent, {
 					autoPan: true,
@@ -514,22 +493,6 @@
 						offset: new T.Point(0, -35)
 					});
 
-					label.setStyle({
-						color: '#333',
-						backgroundColor: 'rgba(255, 255, 255, 0.95)',
-						border: '1px solid #ddd',
-						borderRadius: '4px',
-						padding: '6px 12px',
-						fontSize: '12px',
-						fontWeight: 'normal',
-						boxShadow: '0 2px 6px rgba(0,0,0,0.15)',
-						maxWidth: '200px',
-						textAlign: 'center',
-						whiteSpace: 'nowrap',
-						overflow: 'hidden',
-						textOverflow: 'ellipsis'
-					});
-
 					this.map.addOverLay(label);
 					this.labels.push(label);
 				} catch (error) {
@@ -567,10 +530,7 @@
 			},
 
 			clearSearchMarkers() {
-				// 清除搜索相关的标记,保留主标记
 				const mainMarkers = this.markers.filter(marker => {
-					// 这里可以根据标记的特定属性来区分主标记和搜索标记
-					// 简化处理:保留最后一个标记(通常是用户选择的主标记)
 					return this.markers.indexOf(marker) === this.markers.length - 1;
 				});
 
@@ -635,7 +595,6 @@
 				}
 			}
 		}
-
 	}
 
 	.container {
@@ -654,7 +613,6 @@
 		background-color: #f8f8f8;
 	}
 
-	/* 搜索面板样式 */
 	.search-panel {
 		margin-top: 20rpx;
 		padding: 20rpx;
@@ -745,17 +703,4 @@
 		font-size: 11px;
 		color: #999;
 	}
-
-	::v-deep .tdt-bottom {
-		z-index: 0;
-	}
-
-	::v-deep .tdt-top {
-		z-index: 0;
-	}
-
-	::v-deep .tdt-bottom,
-	.tdt-control {
-		z-index: 0;
-	}
-</style>
+</style>

+ 231 - 402
pages/store/tdtuMap.vue

@@ -1,429 +1,258 @@
 <template>
-  <view class="container">
-    <!-- 地图容器 - 必须设置明确高度 -->
-    <view id="mapContainer" class="map-container"></view>
-
-    <!-- 坐标显示区域 -->
-    <view class="coordinates" v-if="showCoordinates">
-      <view class="coordinate-item">
-        <text class="coordinate-label">经度:</text>
-        <text class="coordinate-value">{{ longitude }}</text>
-      </view>
-      <view class="coordinate-item">
-        <text class="coordinate-label">纬度:</text>
-        <text class="coordinate-value">{{ latitude }}</text>
-      </view>
-      <view class="coordinate-item"> 
-        <text class="coordinate-label">地址:</text>
-        <text class="coordinate-value">{{ address }}</text>
-      </view>
+    <view class="map_container">
+        <!-- #ifdef APP-PLUS || H5 -->
+        <view 
+            id="MapContainer"
+            :props="randerProps"
+            :change:props="handlePropsChange"
+            style="width: 100%;height: 300px;position: relative;"
+        ></view>
+        <!-- #endif -->
     </view>
-  </view>
 </template>
 
 <script>
 export default {
-  props: {
-    initialPosition: {
-      type: Object,
-      default: () => ({
-        lnglat: null,
-        address: ''
-      })
+    name: "TdMap",
+    props: {
+        initialPosition: {
+            type: Object,
+            default: () => ({ lng: 112.55, lat: 37.87 }),
+            validator: (val) => {
+                if (!val) return true;
+                return typeof val.lng === 'number' && typeof val.lat === 'number' && !isNaN(val.lng) && !isNaN(val.lat);
+            }
+        },
+        allowSelection: { type: Boolean, default: false },
+        showCoordinates: { type: Boolean, default: false },
+        mapKey: { type: [String, Number], default: 0 }
     },
-    allowSelection: {
-      type: Boolean,
-      default: true
+    computed: {
+        randerProps() {
+            console.log('【子组件】接收的经纬度', this.initialPosition)
+            return {
+                initialPosition: { ...this.initialPosition },
+                allowSelection: this.allowSelection,
+                showCoordinates: this.showCoordinates
+            };
+        }
     },
-    showCoordinates: {
-      type: Boolean,
-      default: true
-    }
-  },
-  data() {
-    return {
-      map: null,
-      geocoder: null,
-      tk: '92c4ddd919f4e41a30e765680e3a29b7', // 替换为实际密钥
-      longitude: '未选择',
-      latitude: '未选择',
-      address: '未获取',
-      markers: [],
-      labels: [], // 存储文本标签
-      mapInitialized: false
-    };
-  },
-  watch: {
-    initialPosition: {
-      immediate: true,
-      handler(newVal) {
-        if (this.mapInitialized && newVal && this.isValidPosition(newVal)) {
-          this.processPosition(newVal);
+    methods: {
+        handlePropsChange(newProps) {
+            return { ...newProps };
         }
-      }
     },
-    allowSelection(newVal) {
-      if (this.map) {
-        if (newVal) {
-          this.enableMapSelection();
-        } else {
-          this.disableMapSelection();
+    watch: {
+        initialPosition: {
+            deep: true,
+            handler() {
+                this.handlePropsChange(this.randerProps);
+            }
         }
-      }
     }
-  },
-  mounted() {
-		this.$nextTick(() => {
-		  setTimeout(() => {
-		    this.initMap();
-		  }, 500);
-		});
-    // 确保在H5环境下运行
-    // #ifdef H5
-   
-    // #endif
-
-    // 非H5环境提示
-    // #ifndef H5
-    console.warn("天地图组件仅支持H5环境");
-    uni.showToast({
-      title: '地图功能仅在H5环境可用',
-      icon: 'none'
-    });
-    // #endif
-  },
-  methods: {
-    // 验证坐标是否有效
-    isValidPosition(position) {
-      const lng = position.lng ||
-        (position.lnglat && (position.lnglat.lng || position.lnglat.longitude));
-      const lat = position.lat ||
-        (position.lnglat && (position.lnglat.lat || position.lnglat.latitude));
-
-      return lng && lat && !isNaN(parseFloat(lng)) && !isNaN(parseFloat(lat));
-    },
-
-    // 处理坐标数据
-    processPosition(position) {
-      const lng = position.lng ||
-        (position.lnglat && (position.lnglat.lng || position.lnglat.longitude));
-      const lat = position.lat ||
-        (position.lnglat && (position.lnglat.lat || position.lnglat.latitude));
-
-      if (lng && lat) {
-        this.setMapCenter(parseFloat(lng), parseFloat(lat));
-        this.reverseGeocode(parseFloat(lng), parseFloat(lat));
-      }
-    },
-
-    initMap() {
-      if (typeof T === 'undefined') {
-        this.loadTiandituAPI().then(() => {
-          this.createMap();
-        }).catch(err => {
-          console.error("天地图加载失败:", err);
-          uni.showToast({
-            title: '地图加载失败',
-            icon: 'none'
-          });
-        });
-      } else {
-        this.createMap();
-      }
-    },
-
-    loadTiandituAPI() {
-      return new Promise((resolve, reject) => {
-        if (window.T) return resolve();
+};
+</script>
 
-        const script = document.createElement('script');
-        script.src = `https://api.tianditu.gov.cn/api?v=4.0&tk=${this.tk}`;
-        script.onload = resolve;
-        script.onerror = () => reject(new Error('天地图脚本加载失败'));
-        document.head.appendChild(script);
-      });
+<script module="randerJSMap" lang="renderjs">
+export default {
+    props: ['props'],
+    data() {
+        return {
+            mapRef: null,
+            markerRef: null,
+            mapLoaded: false
+        };
     },
-
-    createMap() {
-      try {
-        // 创建地图实例
-        this.map = new T.Map('mapContainer');
-
-        // 设置默认中心点(太原)
-        let centerLng = 112.55;
-        let centerLat = 37.87;
-				let name = ''
-
-        // 使用初始坐标(如果存在)
-        if (this.initialPosition && this.isValidPosition(this.initialPosition)) {
-          const lng = this.initialPosition.lng ||
-            (this.initialPosition.lnglat && (this.initialPosition.lnglat.lng || this.initialPosition.lnglat
-              .longitude));
-          const lat = this.initialPosition.lat ||
-            (this.initialPosition.lnglat && (this.initialPosition.lnglat.lat || this.initialPosition.lnglat.latitude));
-
-          centerLng = parseFloat(lng);
-          centerLat = parseFloat(lat);
-					name = this.initialPosition.address
-          // 更新坐标显示
-          this.longitude = centerLng.toFixed(6);
-          this.latitude = centerLat.toFixed(6);
-          this.address = name;
+    methods: {
+        /**
+         * 修复APP端容器获取失败问题
+         */
+        getMapContainer() {
+            return new Promise((resolve) => {
+                // 方案1:常规document获取
+                let container = document.getElementById('MapContainer');
+                if (container) {
+                    console.log('【容器获取】成功', container);
+                    return resolve(container);
+                }
+                // 方案2:APP端兜底(RenderJS专用)
+                uni.createSelectorQuery().in(this.$ownerInstance)
+                    .select('#MapContainer')
+                    .boundingClientRect((rect) => {
+                        if (rect) {
+                            container = document.querySelector('#MapContainer');
+                            resolve(container);
+                        } else {
+                            resolve(null);
+                        }
+                    }).exec();
+            });
+        },
+
+        /**
+         * 初始化地图(适配4.0:移除VectorLayer,简化逻辑)
+         */
+        async initMap() {
+            try {
+                const T = window.T;
+                if (!T) throw new Error('天地图API未加载');
+
+                // 1. 安全获取容器(解决APP端容器为空)
+                const container = await this.getMapContainer();
+                if (!container) throw new Error('地图容器为空');
+
+                // 2. 创建地图实例(4.0简化版)
+                this.mapRef = new T.Map(container);
+                if (!this.mapRef) throw new Error('地图实例创建失败');
+
+                // 3. 解析坐标(确认有值)
+                const { lng = 112.55, lat = 37.87 } = this.props?.initialPosition || {};
+                const targetLngLat = new T.LngLat(Number(lng), Number(lat));
+                console.log('【初始化】最终坐标', targetLngLat.getLng(), targetLngLat.getLat());
+
+                // 4. 初始化地图视图(放大缩放级别,确保点在视野中心)
+                this.mapRef.centerAndZoom(targetLngLat, 16); // 放大到16级,点更显眼
+                this.mapRef.setMapType(T.TMAP_NORMAL_MAP);
+                this.mapRef.enableScrollWheelZoom(true); // 开启滚轮缩放,方便查看
+
+                // 5. 强制渲染地图
+                this.mapRef.render();
+                this.mapLoaded = true;
+
+                // 6. 延长延迟创建点(给4.0地图加载留足时间,APP端需500ms+)
+                setTimeout(() => {
+                    this.createMarker(targetLngLat);
+                }, 800);
+
+            } catch (error) {
+                console.error('【初始化失败】', error);
+                this.mapLoaded = false;
+            }
+        },
+
+        /**
+         * 创建点覆盖物(4.0适配:直接添加到地图,放大尺寸确保可见)
+         */
+        createMarker(lngLat) {
+            try {
+                const T = window.T;
+                if (!this.mapLoaded || !lngLat) {
+                    console.error('【标点失败】前置条件不足', {
+                        mapLoaded: this.mapLoaded,
+                        lngLat: !!lngLat
+                    });
+                    return;
+                }
+
+                // 移除旧点(4.0直接从地图移除)
+                if (this.markerRef) {
+                    this.mapRef.removeOverlay(this.markerRef);
+                    this.markerRef = null;
+                }
+
+                // 创建点覆盖物(超大尺寸+高亮颜色,确保100%可见)
+                this.markerRef = new T.PointOverlay(lngLat, {
+                    radius: 15, // 放大到15px,肉眼绝对可见
+                    color: '#ff0000', // 红色(最显眼)
+                    borderColor: '#ffffff',
+                    borderWidth: 4,
+                    zIndex: 99999 // 顶级层级,绝对不被覆盖
+                });
+
+                // 4.0适配:直接添加到地图实例(无需矢量图层)
+                this.mapRef.addOverlay(this.markerRef);
+                console.log('【标点】点覆盖物添加到地图成功', this.markerRef);
+
+                // 强制刷新地图
+                this.mapRef.render();
+
+                // 确保点在视野中心(双重保障)
+                this.mapRef.panTo(lngLat);
+
+                // 点击事件(验证点存在)
+                this.markerRef.addEventListener('click', () => {
+                    const coord = {
+                        lng: lngLat.getLng().toFixed(6),
+                        lat: lngLat.getLat().toFixed(6)
+                    };
+                    uni.showToast({
+                        title: `坐标:${coord.lng},${coord.lat}`,
+                        icon: 'none',
+                        duration: 3000
+                    });
+                });
+
+            } catch (error) {
+                console.error('【标点异常】', error);
+            }
+        },
+
+        /**
+         * props更新时同步点位置
+         */
+        handlePropsUpdate(newProps) {
+            console.log('【props更新】', newProps);
+            if (!this.mapLoaded || !newProps) return;
+
+            const { lng, lat } = newProps.initialPosition || {};
+            if (typeof lng !== 'number' || typeof lat !== 'number' || isNaN(lng) || isNaN(lat)) {
+                console.warn('无效坐标,使用默认值');
+                return this.createMarker(new window.T.LngLat(112.55, 37.87));
+            }
+
+            setTimeout(() => {
+                this.createMarker(new window.T.LngLat(lng, lat));
+            }, 500);
         }
-
-        // 设置地图中心和缩放级别
-        this.map.centerAndZoom(new T.LngLat(centerLng, centerLat), 12);
-
-        // 创建逆地理编码对象
-        this.geocoder = new T.Geocoder();
-
-        // 添加正确的地图图层(使用经纬度投影)
-        const vecLayer = new T.TileLayer(
-          `https://t{s}.tianditu.gov.cn/vec_c/wmts?tk=${this.tk}`, {
-            subdomains: ['0', '1', '2', '3', '4', '5', '6', '7']
-          }
-        );
-        const cvaLayer = new T.TileLayer(
-          `https://t{s}.tianditu.gov.cn/cva_c/wmts?tk=${this.tk}`, {
-            subdomains: ['0', '1', '2', '3', '4', '5', '6', '7']
-          }
-        );
-
-        this.map.addLayer(vecLayer);
-        this.map.addLayer(cvaLayer);
-
-        // 添加缩放控件
-        this.map.addControl(new T.Control.Zoom());
-
-        // 启用选点功能
-        if (this.allowSelection) this.enableMapSelection();
-
-        // 添加初始标记
-        if (this.initialPosition && this.isValidPosition(this.initialPosition)) {
-          const lng = this.initialPosition.lng ||
-            (this.initialPosition.lnglat && (this.initialPosition.lnglat.lng || this.initialPosition.lnglat
-              .longitude));
-          const lat = this.initialPosition.lat ||
-            (this.initialPosition.lnglat && (this.initialPosition.lnglat.lat || this.initialPosition.lnglat.latitude));
-
-          this.addMarker(parseFloat(lng), parseFloat(lat));
-          this.reverseGeocode(parseFloat(lng), parseFloat(lat));
-        }
-
-        this.mapInitialized = true;
-      } catch (e) {
-        console.error('地图初始化错误:', e);
-      }
-    },
-
-    // 启用地图选点
-    enableMapSelection() {
-      this.map.on('click', this.handleMapClick);
-    },
-
-    // 禁用地图选点
-    disableMapSelection() {
-      this.map.off('click', this.handleMapClick);
     },
-
-    // 设置地图中心点并更新坐标显示
-    setMapCenter(lng, lat) {
-      this.longitude = parseFloat(lng).toFixed(6);
-      this.latitude = parseFloat(lat).toFixed(6);
-
-      // 清除现有标记
-      this.clearMarkers();
-
-      // 添加新标记
-      this.addMarker(lng, lat);
-
-      // 移动地图视图
-      this.map.panTo(new T.LngLat(lng, lat));
-      
-      // 通知父组件
-      this.notifyParent();
-    },
-
-    // 逆地理编码
-    reverseGeocode(lng, lat) {
-      if (!this.geocoder) return;
-
-      this.address = '正在查询...';
-      const point = new T.LngLat(lng, lat);
-
-      this.geocoder.getLocation(point, (result) => {
-        if (result.getStatus() === 0) {
-          this.address = result.getAddress();
+    mounted() {
+        console.log('【RenderJS】开始加载API');
+        if (window.T) {
+            // 延迟初始化(确保容器+props就绪)
+            setTimeout(() => this.initMap(), 500);
         } else {
-          this.address = '查询失败';
+            // 加载天地图4.0 API(替换为自己的TK)
+            const script = document.createElement('script');
+            script.src = 'https://api.tianditu.gov.cn/api?v=4.0&tk=92c4ddd919f4e41a30e765680e3a29b7';
+            script.async = false; // 同步加载,避免时序问题
+            script.onload = () => {
+                console.log('【API加载】完成');
+                setTimeout(() => this.initMap(), 800); // 延长延迟
+            };
+            script.onerror = () => console.error('API加载失败,请检查TK密钥是否有效');
+            document.body.appendChild(script);
         }
-        
-        // 更新标签内容
-        this.updateLabelContent();
-        this.notifyParent();
-      });
-    },
-
-    // 地图点击事件
-    handleMapClick(e) {
-      if (!this.allowSelection) return;
-      this.setMapCenter(e.lnglat.lng, e.lnglat.lat);
-      this.reverseGeocode(e.lnglat.lng, e.lnglat.lat);
-    },
-
-    // 通知父组件位置信息
-    notifyParent() {
-      this.$emit('update-location', {
-        longitude: this.longitude,
-        latitude: this.latitude,
-        address: this.address
-      });
-    },
-
-    // 添加标记
-    addMarker(lng, lat) {
-      try {
-        const point = new T.LngLat(lng, lat);
-        
-        // 添加标记
-        const marker = new T.Marker(point);
-        this.map.addOverLay(marker);
-        this.markers.push(marker);
-        
-        // 添加文本标签
-        this.addLabel(lng, lat, this.address);
-        
-        console.log('标记添加成功:', lng, lat); 
-      } catch (error) {
-        console.error('添加标记失败:', error);
-      } 
-    },
-
-    // 添加文本标签
-    addLabel(lng, lat, content) {
-      try {
-        const point = new T.LngLat(lng, lat);
-        
-        // 创建文本标签
-        const label = new T.Label({
-          text: content || '未知地址',
-          position: point,
-          offset: new T.Point(-50, -40) // 调整标签位置使其在标记点上方
-        });
-        
-        // 设置标签样式
-        // label.setStyle({
-        //   color: '#333',
-        //   backgroundColor: 'rgba(255, 255, 255, 0.9)',
-        //   border: '1px solid #ddd',
-        //   borderRadius: '4px',
-        //   padding: '5px 10px',
-        //   fontSize: '12px',
-        //   fontWeight: 'bold',
-        //   boxShadow: '0 2px 4px rgba(0,0,0,0.2)',
-        //   maxWidth: '150px',
-        //   textAlign: 'center'
-        // });
-        
-        this.map.addOverLay(label);
-        // this.labels.push(label);
-      } catch (error) {
-        console.error('添加标签失败:', error);
-      }
-    },
-    
-    // 更新标签内容
-    updateLabelContent() {
-      if (this.labels.length > 0) {
-        const lastLabel = this.labels[this.labels.length - 1];
-        lastLabel.setText(this.address);
-      }
     },
-
-    // 清除标记和标签
-    clearMarkers() {
-      // 清除标记
-      this.markers.forEach(marker => {
-        try {
-          this.map.removeOverLay(marker);
-        } catch (error) {
-          console.error('移除标记失败:', error);
-        }
-      });
-      this.markers = [];
-      
-      // 清除标签
-      this.labels.forEach(label => {
-        try {
-          this.map.removeOverLay(label);
-        } catch (error) {
-          console.error('移除标签失败:', error);
+    watch: {
+        props: {
+            deep: true,
+            handler(newProps) {
+                this.handlePropsUpdate(newProps);
+            }
         }
-      });
-      this.labels = [];
     }
-  }
 };
 </script>
 
-<style scoped>
-/* 容器样式 */
-.container {
-  width: 100%;
-  display: flex;
-  flex-direction: column;
-  position: relative; /* 为绝对定位的信息窗口提供参考 */
-  z-index: 0;
-}
-
-/* 地图容器 - 关键:必须设置高度 */
-.map-container {
-  width: 100%;
-  height: 300rpx;
-  /* 使用rpx单位适应不同屏幕 */
-  border: 1px solid #eee;
-  background-color: #f8f8f8;
-}
-
-/* 坐标显示区域 */
-.coordinates {
-  margin-top: 20rpx;
-  padding: 20rpx;
-  background-color: #f8f9fa;
-  border-radius: 8rpx;
-}
-
-.coordinate-item {
-  display: flex;
-  margin: 15rpx 0;
-  padding: 15rpx 0;
-  border-bottom: 1rpx dashed #dee2e6;
-}
-
-.coordinate-item:last-child {
-  border-bottom: none;
-}
-
-.coordinate-label {
-  font-weight: bold;
-  color: #495057;
-  min-width: 120rpx;
-}
-
-.coordinate-value {
-  color: #333333;
-  font-weight: 500;
-  flex: 1;
-}
-
-/* 天地图控件层级调整 */
-::v-deep .tdt-bottom {
-  z-index: 0;
-}
-::v-deep .tdt-top {
-  z-index: 0;
+<style scoped lang="scss">
+.map_container {
+    position: relative;
+    width: 100%;
+    height: 300px;
+    z-index: 1;
+    overflow: visible;
+    /* 浅灰色背景,对比红色点更显眼 */
+    background: #f0f0f0;
 }
-::v-deep .tdt-bottom, .tdt-control {
-  z-index: 0;
+#MapContainer {
+    position: relative;
+    z-index: 9999 !important; // 顶级层级,避免任何遮挡
+    display: block;
+    width: 100%;
+    height: 100%;
+    /* 移除可能的内边距/边框遮挡 */
+    padding: 0 !important;
+    margin: 0 !important;
+    border: none !important;
 }
 </style>