更新
This commit is contained in:
		
							parent
							
								
									f514616b96
								
							
						
					
					
						commit
						53901aec4f
					
				| 
						 | 
				
			
			@ -96,9 +96,10 @@
 | 
			
		|||
	/deep/ .u-title{
 | 
			
		||||
		padding-bottom: 41rpx;
 | 
			
		||||
	}
 | 
			
		||||
	/deep/ .u-icon__icon{
 | 
			
		||||
	/deep/ .uicon-nav-back{
 | 
			
		||||
		padding-bottom: 41rpx;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	page {
 | 
			
		||||
		background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			@ -158,7 +159,7 @@
 | 
			
		|||
				}
 | 
			
		||||
				textarea{
 | 
			
		||||
					font-size: 30rpx;
 | 
			
		||||
					color: #9F9F9F;
 | 
			
		||||
					color: #333;
 | 
			
		||||
					padding-right: 20rpx;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
| 
						 | 
				
			
			@ -179,7 +180,7 @@
 | 
			
		|||
				}
 | 
			
		||||
				input{
 | 
			
		||||
					font-size: 30rpx;
 | 
			
		||||
					color: #9F9F9F;
 | 
			
		||||
					color: #333;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			.name{
 | 
			
		||||
| 
						 | 
				
			
			@ -199,7 +200,7 @@
 | 
			
		|||
				}
 | 
			
		||||
				input{
 | 
			
		||||
					font-size: 30rpx;
 | 
			
		||||
					color: #9F9F9F;
 | 
			
		||||
					color: #333;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -49,7 +49,7 @@
 | 
			
		|||
				</view>
 | 
			
		||||
        	</view>
 | 
			
		||||
			
 | 
			
		||||
			<view class="pic">
 | 
			
		||||
			<view class="pic" @click="btnad">
 | 
			
		||||
				<image :src="imgad" mode="" class="pic"></image>
 | 
			
		||||
			</view>
 | 
			
		||||
        </view>
 | 
			
		||||
| 
						 | 
				
			
			@ -77,6 +77,21 @@
 | 
			
		|||
            			this.detailobj = res.data
 | 
			
		||||
            		}
 | 
			
		||||
            	})
 | 
			
		||||
            },
 | 
			
		||||
			btnad(){
 | 
			
		||||
				this.$u.get("/app/ad").then((res) => {
 | 
			
		||||
					if (res.code == 200) {
 | 
			
		||||
						if(res.data.urlType == 1){
 | 
			
		||||
							uni.navigateTo({
 | 
			
		||||
								url:'/page_fenbao/webview?url=' + res.data.url
 | 
			
		||||
							})
 | 
			
		||||
						}else{
 | 
			
		||||
							uni.navigateTo({
 | 
			
		||||
								url: res.data.url
 | 
			
		||||
							})
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				})
 | 
			
		||||
			},
 | 
			
		||||
			getad(){
 | 
			
		||||
				this.$u.get("/app/ad").then((res) => {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -195,7 +195,7 @@
 | 
			
		|||
 | 
			
		||||
								image {
 | 
			
		||||
									width: 180rpx;
 | 
			
		||||
									height: 230rpx;
 | 
			
		||||
									height: 200rpx;
 | 
			
		||||
									border-radius: 20rpx;
 | 
			
		||||
								}
 | 
			
		||||
							}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
<template>
 | 
			
		||||
	<view class="page">
 | 
			
		||||
		<u-navbar title="店铺详情" :border-bottom="false" :background="bgc" title-color='#fff' back-icon-color="#fff" title-size='36'
 | 
			
		||||
			height='58'></u-navbar>
 | 
			
		||||
		<u-navbar title="店铺详情" :border-bottom="false" :background="bgc" title-color='#fff' back-icon-color="#fff"
 | 
			
		||||
			title-size='36' height='58'></u-navbar>
 | 
			
		||||
		<view class="box">
 | 
			
		||||
			<view class="shopname">
 | 
			
		||||
				{{listobj.name}}
 | 
			
		||||
| 
						 | 
				
			
			@ -14,7 +14,8 @@
 | 
			
		|||
					<text class="qian">绑定设备:</text> <text class="shen">{{listobj.deviceCount}}</text>
 | 
			
		||||
				</view>
 | 
			
		||||
				<view class="jiben">
 | 
			
		||||
					<text class="qian">营业时间:</text> <text class="shen">{{listobj.businessTimeStart}}~{{listobj.businessTimeEnd}}</text>
 | 
			
		||||
					<text class="qian">营业时间:</text> <text
 | 
			
		||||
						class="shen">{{listobj.businessTimeStart}}~{{listobj.businessTimeEnd}}</text>
 | 
			
		||||
				</view>
 | 
			
		||||
				<view class="jiben">
 | 
			
		||||
					<text class="qian">详细地址:</text> <text class="shen">{{listobj.address}}</text>
 | 
			
		||||
| 
						 | 
				
			
			@ -24,10 +25,14 @@
 | 
			
		|||
				</view>
 | 
			
		||||
			</view>
 | 
			
		||||
			<view class="icons">
 | 
			
		||||
				<image src="https://api.ccttiot.com/smartmeter/img/static/uDNcSwmkeciv4fHv4JdJ" mode="" @click="show = true"></image>
 | 
			
		||||
				<image src="https://api.ccttiot.com/smartmeter/img/static/uCaV3mfjN1LUrW1gPPzQ" mode="" @click="btnpag(1)"></image>
 | 
			
		||||
				<image src="https://api.ccttiot.com/smartmeter/img/static/uoyO7psgUNmNuhPDoOmH" mode="" @click="btnpag(2)"></image>
 | 
			
		||||
				<image src="https://api.ccttiot.com/smartmeter/img/static/uu7AtppWYWNucDPLkcFu" mode="" @click="btnpag(3)"></image>
 | 
			
		||||
				<image src="https://api.ccttiot.com/smartmeter/img/static/uDNcSwmkeciv4fHv4JdJ" mode=""
 | 
			
		||||
					@click="show = true"></image>
 | 
			
		||||
				<image src="https://api.ccttiot.com/smartmeter/img/static/uCaV3mfjN1LUrW1gPPzQ" mode=""
 | 
			
		||||
					@click="btnpag(1)"></image>
 | 
			
		||||
				<image src="https://api.ccttiot.com/smartmeter/img/static/uoyO7psgUNmNuhPDoOmH" mode=""
 | 
			
		||||
					@click="btnpag(2)"></image>
 | 
			
		||||
				<image src="https://api.ccttiot.com/smartmeter/img/static/uu7AtppWYWNucDPLkcFu" mode=""
 | 
			
		||||
					@click="btnpag(3)"></image>
 | 
			
		||||
			</view>
 | 
			
		||||
		</view>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -51,11 +56,11 @@
 | 
			
		|||
					}
 | 
			
		||||
				],
 | 
			
		||||
				show: false,
 | 
			
		||||
				storeId:'',
 | 
			
		||||
				listobj:{},
 | 
			
		||||
				deviceId:'',
 | 
			
		||||
				name:'',
 | 
			
		||||
				mac:''
 | 
			
		||||
				storeId: '',
 | 
			
		||||
				listobj: {},
 | 
			
		||||
				deviceId: '',
 | 
			
		||||
				name: '',
 | 
			
		||||
				mac: ''
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		onLoad(option) {
 | 
			
		||||
| 
						 | 
				
			
			@ -88,7 +93,7 @@
 | 
			
		|||
				'isStart': false
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		onHide(){
 | 
			
		||||
		onHide() {
 | 
			
		||||
			xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
 | 
			
		||||
			xBlufi.notifyStartDiscoverBle({
 | 
			
		||||
				'isStart': false
 | 
			
		||||
| 
						 | 
				
			
			@ -101,7 +106,7 @@
 | 
			
		|||
			});
 | 
			
		||||
		},
 | 
			
		||||
		methods: {
 | 
			
		||||
			getdetail(){
 | 
			
		||||
			getdetail() {
 | 
			
		||||
				this.$u.get("/app/store/mch/" + this.storeId).then(res => {
 | 
			
		||||
					if (res.code == 200) {
 | 
			
		||||
						this.listobj = res.data
 | 
			
		||||
| 
						 | 
				
			
			@ -110,21 +115,21 @@
 | 
			
		|||
			},
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
			btnpag(num){
 | 
			
		||||
				if(num == 1){
 | 
			
		||||
			btnpag(num) {
 | 
			
		||||
				if (num == 1) {
 | 
			
		||||
					uni.navigateTo({
 | 
			
		||||
						url:'/page_fenbao/statulist/myshop/shebeilist/index?storeId=' + this.storeId
 | 
			
		||||
						url: '/page_fenbao/statulist/myshop/shebeilist/index?storeId=' + this.storeId
 | 
			
		||||
					})
 | 
			
		||||
				}else if(num == 2){
 | 
			
		||||
				} else if (num == 2) {
 | 
			
		||||
					uni.navigateTo({
 | 
			
		||||
						url:'/page_fenbao/statulist/myshop/editshop/index?obj=' + JSON.stringify(this.listobj)
 | 
			
		||||
						url: '/page_fenbao/statulist/myshop/editshop/index?obj=' + JSON.stringify(this.listobj)
 | 
			
		||||
					})
 | 
			
		||||
				}else if(num == 3){
 | 
			
		||||
				} else if (num == 3) {
 | 
			
		||||
					let vm = this
 | 
			
		||||
					uni.showModal({
 | 
			
		||||
						title: '提示',
 | 
			
		||||
						content: '你确定要注销这个店铺吗?',
 | 
			
		||||
					    success: function (res) {  
 | 
			
		||||
						success: function(res) {
 | 
			
		||||
							if (res.confirm) {
 | 
			
		||||
								vm.$u.delete("/app/store/" + vm.storeId).then(res => {
 | 
			
		||||
									if (res.code == 200) {
 | 
			
		||||
| 
						 | 
				
			
			@ -133,10 +138,10 @@
 | 
			
		|||
											icon: 'success',
 | 
			
		||||
											duration: 1000
 | 
			
		||||
										})
 | 
			
		||||
										setTimeout(()=>{
 | 
			
		||||
										setTimeout(() => {
 | 
			
		||||
											uni.navigateBack()
 | 
			
		||||
										},1500)
 | 
			
		||||
									}else if(res.code == 500){
 | 
			
		||||
										}, 1500)
 | 
			
		||||
									} else if (res.code == 500) {
 | 
			
		||||
										uni.showToast({
 | 
			
		||||
											title: res.msg,
 | 
			
		||||
											icon: 'success',
 | 
			
		||||
| 
						 | 
				
			
			@ -176,8 +181,8 @@
 | 
			
		|||
						let sceneValue = res.result
 | 
			
		||||
						let decodedValue = decodeURIComponent(sceneValue);
 | 
			
		||||
						let id = getQueryParam(decodedValue, 'deviceNo')
 | 
			
		||||
						this.$u.get(`/app/device/${id}/bySn`).then((res) =>{
 | 
			
		||||
							if(res.code == 200){
 | 
			
		||||
						this.$u.get(`/app/device/${id}/bySn`).then((res) => {
 | 
			
		||||
							if (res.code == 200) {
 | 
			
		||||
								this.qrResult = 'CTKG-' + res.data.mac
 | 
			
		||||
								// console.log(this.qrResult);
 | 
			
		||||
								// uni.navigateTo({
 | 
			
		||||
| 
						 | 
				
			
			@ -201,7 +206,9 @@
 | 
			
		|||
										name: this.name
 | 
			
		||||
									});
 | 
			
		||||
								}, 2000)
 | 
			
		||||
							  uni.showLoading({ title: '连接中...' });
 | 
			
		||||
								uni.showLoading({
 | 
			
		||||
									title: '连接中...'
 | 
			
		||||
								});
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							}
 | 
			
		||||
| 
						 | 
				
			
			@ -222,7 +229,7 @@
 | 
			
		|||
					case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS:
 | 
			
		||||
						if (options.result) {
 | 
			
		||||
							let devicesarr = options.data
 | 
			
		||||
			 				console.log(devicesarr,'devicesarrdevicesarr');
 | 
			
		||||
							console.log(devicesarr, 'devicesarrdevicesarr');
 | 
			
		||||
							devicesarr.forEach(device => {
 | 
			
		||||
								const mac = device.name.substring(5);
 | 
			
		||||
								if (device.name == this.qrResult) {
 | 
			
		||||
| 
						 | 
				
			
			@ -233,6 +240,11 @@
 | 
			
		|||
								}
 | 
			
		||||
 | 
			
		||||
							});
 | 
			
		||||
						} else {
 | 
			
		||||
							uni.showToast({
 | 
			
		||||
								title: '没有发现设备',
 | 
			
		||||
								icon: 'none'
 | 
			
		||||
							});
 | 
			
		||||
						}
 | 
			
		||||
						break;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -253,8 +265,8 @@
 | 
			
		|||
									name = this.name.slice(index + 1);
 | 
			
		||||
								}
 | 
			
		||||
								let data = {
 | 
			
		||||
			 						storeId:this.storeId,
 | 
			
		||||
			 						mac:this.mac
 | 
			
		||||
									storeId: this.storeId,
 | 
			
		||||
									mac: this.mac
 | 
			
		||||
								}
 | 
			
		||||
								this.$u.put('/app/device/bind', data).then((res) => {
 | 
			
		||||
									if (res.code == 200) {
 | 
			
		||||
| 
						 | 
				
			
			@ -269,20 +281,24 @@
 | 
			
		|||
										uni.showModal({
 | 
			
		||||
											title: '提示',
 | 
			
		||||
											content: '你已绑定成功,需前去配网吗?',
 | 
			
		||||
			 							    success: function (res) {  
 | 
			
		||||
											success: function(res) {
 | 
			
		||||
												if (res.confirm) {
 | 
			
		||||
													let systemInfo = uni.getSystemInfoSync();
 | 
			
		||||
													if (systemInfo.platform === 'android') {
 | 
			
		||||
														// 当前设备是 Android  
 | 
			
		||||
														uni.navigateTo({
 | 
			
		||||
			 												url: '/page_components/wifilist/index?deviceId=' + options
 | 
			
		||||
			 													.data.deviceId + '&name=' + options.data.name
 | 
			
		||||
															url: '/page_components/wifilist/index?deviceId=' +
 | 
			
		||||
																options
 | 
			
		||||
																.data.deviceId + '&name=' +
 | 
			
		||||
																options.data.name
 | 
			
		||||
														})
 | 
			
		||||
													} else if (systemInfo.platform === 'ios') {
 | 
			
		||||
														// 当前设备是 iOS  
 | 
			
		||||
														uni.navigateTo({
 | 
			
		||||
			 												url: '/page_fenbao/device/wifivideo?deviceId=' + options
 | 
			
		||||
			 													.data.deviceId + '&name=' + options.data.name
 | 
			
		||||
															url: '/page_fenbao/device/wifivideo?deviceId=' +
 | 
			
		||||
																options
 | 
			
		||||
																.data.deviceId + '&name=' +
 | 
			
		||||
																options.data.name
 | 
			
		||||
														})
 | 
			
		||||
													}
 | 
			
		||||
												} else if (res.cancel) {
 | 
			
		||||
| 
						 | 
				
			
			@ -291,7 +307,7 @@
 | 
			
		|||
											}
 | 
			
		||||
										})
 | 
			
		||||
 | 
			
		||||
			 						}else if(res.code == 500){
 | 
			
		||||
									} else if (res.code == 500) {
 | 
			
		||||
										uni.showToast({
 | 
			
		||||
											title: '该设备已被绑定',
 | 
			
		||||
											icon: 'none',
 | 
			
		||||
| 
						 | 
				
			
			@ -373,15 +389,18 @@
 | 
			
		|||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss">
 | 
			
		||||
	/deep/ .u-title{
 | 
			
		||||
	/deep/ .u-title {
 | 
			
		||||
		padding-bottom: 41rpx;
 | 
			
		||||
	}
 | 
			
		||||
	/deep/ .u-icon__icon{
 | 
			
		||||
 | 
			
		||||
	/deep/ .u-icon__icon {
 | 
			
		||||
		padding-bottom: 41rpx;
 | 
			
		||||
	}
 | 
			
		||||
	/deep/ .u-icon__icon{
 | 
			
		||||
 | 
			
		||||
	/deep/ .u-icon__icon {
 | 
			
		||||
		padding-bottom: 40rpx;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	page {
 | 
			
		||||
		background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			@ -391,14 +410,16 @@
 | 
			
		|||
		position: fixed;
 | 
			
		||||
		top: 0;
 | 
			
		||||
		left: 0;
 | 
			
		||||
		.box{
 | 
			
		||||
 | 
			
		||||
		.box {
 | 
			
		||||
			width: 750rpx;
 | 
			
		||||
			height: 1440rpx;
 | 
			
		||||
			background: #F4F5F7;
 | 
			
		||||
			border-radius: 0rpx 0rpx 0rpx 0rpx;
 | 
			
		||||
			padding: 22rpx 36rpx;
 | 
			
		||||
			box-sizing: border-box;
 | 
			
		||||
			.shopname{
 | 
			
		||||
 | 
			
		||||
			.shopname {
 | 
			
		||||
				width: 680rpx;
 | 
			
		||||
				height: 102rpx;
 | 
			
		||||
				background: #FFFFFF;
 | 
			
		||||
| 
						 | 
				
			
			@ -410,7 +431,8 @@
 | 
			
		|||
				font-size: 32rpx;
 | 
			
		||||
				color: #3D3D3D;
 | 
			
		||||
			}
 | 
			
		||||
			.shoplist{
 | 
			
		||||
 | 
			
		||||
			.shoplist {
 | 
			
		||||
				padding: 30rpx;
 | 
			
		||||
				box-sizing: border-box;
 | 
			
		||||
				width: 680rpx;
 | 
			
		||||
| 
						 | 
				
			
			@ -418,28 +440,33 @@
 | 
			
		|||
				background: #FFFFFF;
 | 
			
		||||
				border-radius: 24rpx 24rpx 24rpx 24rpx;
 | 
			
		||||
				margin-top: 24rpx;
 | 
			
		||||
				.tit{
 | 
			
		||||
 | 
			
		||||
				.tit {
 | 
			
		||||
					font-weight: 600;
 | 
			
		||||
					font-size: 28rpx;
 | 
			
		||||
					color: #3D3D3D;
 | 
			
		||||
				}
 | 
			
		||||
				.jiben{
 | 
			
		||||
 | 
			
		||||
				.jiben {
 | 
			
		||||
					margin-top: 16rpx;
 | 
			
		||||
					display: flex;
 | 
			
		||||
					justify-content: space-between;
 | 
			
		||||
					.qian{
 | 
			
		||||
 | 
			
		||||
					.qian {
 | 
			
		||||
						font-size: 24rpx;
 | 
			
		||||
						color: #808080;
 | 
			
		||||
						width: 40%;
 | 
			
		||||
						// margin-right: 20rpx;
 | 
			
		||||
					}
 | 
			
		||||
					.shen{
 | 
			
		||||
 | 
			
		||||
					.shen {
 | 
			
		||||
						font-size: 24rpx;
 | 
			
		||||
						color: #3D3D3D;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			.icons{
 | 
			
		||||
 | 
			
		||||
			.icons {
 | 
			
		||||
				padding-top: 30rpx;
 | 
			
		||||
				padding-left: 50rpx;
 | 
			
		||||
				padding-right: 50rpx;
 | 
			
		||||
| 
						 | 
				
			
			@ -452,7 +479,8 @@
 | 
			
		|||
				display: flex;
 | 
			
		||||
				justify-content: space-between;
 | 
			
		||||
				margin-top: 26rpx;
 | 
			
		||||
				image{
 | 
			
		||||
 | 
			
		||||
				image {
 | 
			
		||||
					width: 96rpx;
 | 
			
		||||
					height: 96rpx;
 | 
			
		||||
				}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,7 +2,9 @@
 | 
			
		|||
	<view class="page">
 | 
			
		||||
		<u-navbar title="附近共享" :border-bottom="false" :background="bgc" title-color='#fff' back-icon-color="#fff" title-size='44' height='58'></u-navbar>
 | 
			
		||||
			<view class="dtxs">
 | 
			
		||||
				<map class='map' :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick" :markers="covers" :show-location="true" />
 | 
			
		||||
				<!-- <map class='map' :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick" :markers="covers" :show-location="true" :scale="mapScale"/> -->
 | 
			
		||||
				<map class='map' id="map" :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick"
 | 
			
		||||
					:show-location="true" :markers="covers" :scale="mapScale" />
 | 
			
		||||
			</view>
 | 
			
		||||
		<view class="listbox">
 | 
			
		||||
			<view class="moshi">
 | 
			
		||||
| 
						 | 
				
			
			@ -47,6 +49,10 @@
 | 
			
		|||
				bgc: {
 | 
			
		||||
					backgroundColor: " #8883F0",
 | 
			
		||||
				},
 | 
			
		||||
				mapScale: 15,
 | 
			
		||||
				mapContext: null,
 | 
			
		||||
				mapScaleInterval: null,
 | 
			
		||||
				listmap: [],
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		onLoad() {
 | 
			
		||||
| 
						 | 
				
			
			@ -55,7 +61,84 @@
 | 
			
		|||
		onShow() {
 | 
			
		||||
			this.getshanghu()
 | 
			
		||||
		},
 | 
			
		||||
		onReady() {
 | 
			
		||||
			this.mapContext = uni.createMapContext('map', this);
 | 
			
		||||
			this.mapScaleInterval = setInterval(this.updateMarkers, 1000);
 | 
			
		||||
		},
 | 
			
		||||
		beforeDestroy() {
 | 
			
		||||
			// 在组件卸载前清除定时器  
 | 
			
		||||
			if (this.mapScaleInterval) {
 | 
			
		||||
				clearInterval(this.mapScaleInterval);
 | 
			
		||||
				this.mapScaleInterval = null;
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		methods: {
 | 
			
		||||
			updateMarkers() {
 | 
			
		||||
				this.mapContext.getScale({
 | 
			
		||||
					success: (res) => {
 | 
			
		||||
						this.covers = []; // 清空之前的覆盖物  
 | 
			
		||||
						if (res.scale <= 14) {
 | 
			
		||||
							this.addMarkersWithoutLabels();
 | 
			
		||||
						} else {
 | 
			
		||||
							this.addMarkersWithLabels();
 | 
			
		||||
						}
 | 
			
		||||
					},
 | 
			
		||||
					fail: (error) => {
 | 
			
		||||
						console.error('获取地图缩放级别失败:', error);
 | 
			
		||||
						// 额外的错误处理逻辑...  
 | 
			
		||||
					},
 | 
			
		||||
				});
 | 
			
		||||
			},
 | 
			
		||||
			addMarkersWithoutLabels() {
 | 
			
		||||
				this.listmap.forEach((item) => {
 | 
			
		||||
					const shopCover = {
 | 
			
		||||
						id: parseFloat(item.storeId),
 | 
			
		||||
						latitude: item.lat,
 | 
			
		||||
						longitude: item.lng,
 | 
			
		||||
						width: 25,
 | 
			
		||||
						height: 30,
 | 
			
		||||
						iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4', 
 | 
			
		||||
					};
 | 
			
		||||
					this.covers.push(shopCover);
 | 
			
		||||
				});
 | 
			
		||||
			},
 | 
			
		||||
			addMarkersWithLabels() {
 | 
			
		||||
				this.listmap.forEach((item) => {
 | 
			
		||||
					const shopCover = {
 | 
			
		||||
						id: parseFloat(item.storeId),
 | 
			
		||||
						latitude: item.lat,
 | 
			
		||||
						longitude: item.lng,
 | 
			
		||||
						width: 25,
 | 
			
		||||
						height: 30,
 | 
			
		||||
						iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4',
 | 
			
		||||
						label: {
 | 
			
		||||
							content: item.name,
 | 
			
		||||
							anchorX:this.calculateAnchorX(item.name),
 | 
			
		||||
							fontWeight: 700,
 | 
			
		||||
							color: '#8883F0',
 | 
			
		||||
							textShadow: '2px 2px 0px white, -2px -2px 0px white, 2px -2px 0px white, -2px 2px 0px white',
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
					this.covers.push(shopCover);
 | 
			
		||||
				});
 | 
			
		||||
			},
 | 
			
		||||
			calculateAnchorX(name) {  
 | 
			
		||||
			    let chineseLength = 0; 
 | 
			
		||||
			    let englishLength = 0;   
 | 
			
		||||
			    for (let i = 0; i < name.length; i++) {  
 | 
			
		||||
			        const charCode = name.charCodeAt(i);  
 | 
			
		||||
			        // 判断是否为中文字符(这里简化了判断,只考虑了基本的中文字符范围)  
 | 
			
		||||
			        if (charCode >= 0x4e00 && charCode <= 0x9fa5) {  
 | 
			
		||||
			            chineseLength++;  
 | 
			
		||||
			        } else if (/[a-zA-Z]/.test(name[i])) { // 判断是否为英文字符  
 | 
			
		||||
			           englishLength = englishLength+0.3; // 英文长度加1,但视为两个中文字符长度  
 | 
			
		||||
						// console.log(englishLength);
 | 
			
		||||
			        }  
 | 
			
		||||
			    }  
 | 
			
		||||
			    const totalLength = chineseLength + englishLength * 2; // 总长度(以中文字符为单位)  
 | 
			
		||||
			    return -totalLength * 6.5; // 假设每个中文字符对应的 anchorX 偏移是 -7 
 | 
			
		||||
			},
 | 
			
		||||
			
 | 
			
		||||
			// 跳转导航
 | 
			
		||||
			mapFun(item) {
 | 
			
		||||
				uni.openLocation({
 | 
			
		||||
| 
						 | 
				
			
			@ -82,6 +165,7 @@
 | 
			
		|||
			            // 请求附近的店铺    
 | 
			
		||||
			            this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then(response => {    
 | 
			
		||||
			                if (response.code == 200) {   
 | 
			
		||||
								this.listmap = response.data
 | 
			
		||||
			                    this.gxlist = response.data;  
 | 
			
		||||
			                    this.gxlist.forEach(item => {    
 | 
			
		||||
			                        // 计算距离  
 | 
			
		||||
| 
						 | 
				
			
			@ -99,8 +183,29 @@
 | 
			
		|||
			                            distance: distance ,// 可以在这里也添加距离到覆盖物对象中,但通常只需要在店铺对象中  
 | 
			
		||||
										label: {
 | 
			
		||||
											content: item.name,
 | 
			
		||||
											// anchorX:-20,
 | 
			
		||||
											textAlign: 'center'
 | 
			
		||||
											anchorX: (() => {
 | 
			
		||||
												if (item.name.length <= 2) {
 | 
			
		||||
													return -12
 | 
			
		||||
												} else if (item.name.length <= 3) {
 | 
			
		||||
													return -20
 | 
			
		||||
												} else if (item.name.length <= 4) {
 | 
			
		||||
													return -25
 | 
			
		||||
												} else if (item.name.length <= 5) {
 | 
			
		||||
													return -30
 | 
			
		||||
												} else if (item.name.length <= 6) {
 | 
			
		||||
													return -35
 | 
			
		||||
												} else if (item.name.length <= 8) {
 | 
			
		||||
													return -40
 | 
			
		||||
												} else if (item.name.length <=
 | 
			
		||||
													10) {
 | 
			
		||||
													return -45
 | 
			
		||||
												} else {
 | 
			
		||||
													return -item.name.length * 5
 | 
			
		||||
												}
 | 
			
		||||
											})(),
 | 
			
		||||
											fontWeight: 700,
 | 
			
		||||
											color: '#8883F0',
 | 
			
		||||
											textShadow: '2px 2px 0px white, -2px -2px 0px white, 2px -2px 0px white, -2px 2px 0px white',
 | 
			
		||||
										}
 | 
			
		||||
			                        };    
 | 
			
		||||
			                        // console.log(this.gxlist);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
<template>
 | 
			
		||||
	<view class="page">
 | 
			
		||||
		<u-navbar title="常见问题" :border-bottom="false" :background="bgc" title-color='#fff' back-icon-color="#fff" title-size='36'
 | 
			
		||||
		<u-navbar title="疑问解答" :border-bottom="false" :background="bgc" title-color='#fff' back-icon-color="#fff" title-size='36'
 | 
			
		||||
			height='58'></u-navbar>
 | 
			
		||||
        <view class="box">
 | 
			
		||||
        	<view class="title">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,7 +2,9 @@
 | 
			
		|||
	<view class="page">
 | 
			
		||||
		<u-navbar title="地图模式" :border-bottom="false" :background="bgc" title-color='#fff' back-icon-color="#fff" title-size='44' height='58'></u-navbar>
 | 
			
		||||
			<view class="dtxs">
 | 
			
		||||
					<map class='map' :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick" :markers="covers" :show-location="true"/>
 | 
			
		||||
					<!-- <map class='map' :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick" :markers="covers" :show-location="true" :scale="mapScale" /> -->
 | 
			
		||||
					<map class='map' id="map" :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick"
 | 
			
		||||
						:show-location="true" :markers="covers" :scale="mapScale" />
 | 
			
		||||
			</view>
 | 
			
		||||
		<view class="listbox" v-if="falga">
 | 
			
		||||
			<view class="moshi">
 | 
			
		||||
| 
						 | 
				
			
			@ -72,6 +74,10 @@
 | 
			
		|||
				bgc: {
 | 
			
		||||
					backgroundColor: " #8883F0",
 | 
			
		||||
				},
 | 
			
		||||
				mapScale: 15,
 | 
			
		||||
				mapContext: null,
 | 
			
		||||
				mapScaleInterval: null,
 | 
			
		||||
				listmap: [],
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		onLoad(option) {
 | 
			
		||||
| 
						 | 
				
			
			@ -82,7 +88,84 @@
 | 
			
		|||
			}
 | 
			
		||||
			this.getxq()
 | 
			
		||||
		},
 | 
			
		||||
		onReady() {
 | 
			
		||||
			this.mapContext = uni.createMapContext('map', this);
 | 
			
		||||
			this.mapScaleInterval = setInterval(this.updateMarkers, 1000);
 | 
			
		||||
		},
 | 
			
		||||
		beforeDestroy() {
 | 
			
		||||
			// 在组件卸载前清除定时器  
 | 
			
		||||
			if (this.mapScaleInterval) {
 | 
			
		||||
				clearInterval(this.mapScaleInterval);
 | 
			
		||||
				this.mapScaleInterval = null;
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		methods: {
 | 
			
		||||
			updateMarkers() {
 | 
			
		||||
				this.mapContext.getScale({
 | 
			
		||||
					success: (res) => {
 | 
			
		||||
						this.covers = []; // 清空之前的覆盖物  
 | 
			
		||||
						if (res.scale <= 14) {
 | 
			
		||||
							this.addMarkersWithoutLabels();
 | 
			
		||||
						} else {
 | 
			
		||||
							this.addMarkersWithLabels();
 | 
			
		||||
						}
 | 
			
		||||
					},
 | 
			
		||||
					fail: (error) => {
 | 
			
		||||
						console.error('获取地图缩放级别失败:', error);
 | 
			
		||||
						// 额外的错误处理逻辑...  
 | 
			
		||||
					},
 | 
			
		||||
				});
 | 
			
		||||
			},
 | 
			
		||||
			addMarkersWithoutLabels() {
 | 
			
		||||
				this.listmap.forEach((item) => {
 | 
			
		||||
					const shopCover = {
 | 
			
		||||
						id: parseFloat(item.storeId),
 | 
			
		||||
						latitude: item.lat,
 | 
			
		||||
						longitude: item.lng,
 | 
			
		||||
						width: 25,
 | 
			
		||||
						height: 30,
 | 
			
		||||
						iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4', 
 | 
			
		||||
					};
 | 
			
		||||
					this.covers.push(shopCover);
 | 
			
		||||
				});
 | 
			
		||||
			},
 | 
			
		||||
			addMarkersWithLabels() {
 | 
			
		||||
				this.listmap.forEach((item) => {
 | 
			
		||||
					const shopCover = {
 | 
			
		||||
						id: parseFloat(item.storeId),
 | 
			
		||||
						latitude: item.lat,
 | 
			
		||||
						longitude: item.lng,
 | 
			
		||||
						width: 25,
 | 
			
		||||
						height: 30,
 | 
			
		||||
						iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4',
 | 
			
		||||
						label: {
 | 
			
		||||
							content: item.name,
 | 
			
		||||
							anchorX:this.calculateAnchorX(item.name),
 | 
			
		||||
							fontWeight: 700,
 | 
			
		||||
							color: '#8883F0',
 | 
			
		||||
							textShadow: '2px 2px 0px white, -2px -2px 0px white, 2px -2px 0px white, -2px 2px 0px white',
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
					this.covers.push(shopCover);
 | 
			
		||||
				});
 | 
			
		||||
			},
 | 
			
		||||
			calculateAnchorX(name) {  
 | 
			
		||||
			    let chineseLength = 0; 
 | 
			
		||||
			    let englishLength = 0;   
 | 
			
		||||
			    for (let i = 0; i < name.length; i++) {  
 | 
			
		||||
			        const charCode = name.charCodeAt(i);  
 | 
			
		||||
			        // 判断是否为中文字符(这里简化了判断,只考虑了基本的中文字符范围)  
 | 
			
		||||
			        if (charCode >= 0x4e00 && charCode <= 0x9fa5) {  
 | 
			
		||||
			            chineseLength++;  
 | 
			
		||||
			        } else if (/[a-zA-Z]/.test(name[i])) { // 判断是否为英文字符  
 | 
			
		||||
			           englishLength = englishLength+0.3; // 英文长度加1,但视为两个中文字符长度  
 | 
			
		||||
						// console.log(englishLength);
 | 
			
		||||
			        }  
 | 
			
		||||
			    }  
 | 
			
		||||
			    const totalLength = chineseLength + englishLength * 2; // 总长度(以中文字符为单位)  
 | 
			
		||||
			    return -totalLength * 6.5; // 假设每个中文字符对应的 anchorX 偏移是 -7 
 | 
			
		||||
			},
 | 
			
		||||
			
 | 
			
		||||
			scanQRCode() {
 | 
			
		||||
				uni.scanCode({
 | 
			
		||||
					onlyFromCamera: true,
 | 
			
		||||
| 
						 | 
				
			
			@ -118,7 +201,7 @@
 | 
			
		|||
			
 | 
			
		||||
			btnchak(id){
 | 
			
		||||
				uni.navigateTo({
 | 
			
		||||
					url:'/page_fenbao/statulist/myshop/shebeilist/index?storeId=' + id
 | 
			
		||||
					url:'/page_fenbao/sbshouye?storeId=' + id
 | 
			
		||||
				})
 | 
			
		||||
			},
 | 
			
		||||
			
 | 
			
		||||
| 
						 | 
				
			
			@ -159,6 +242,7 @@
 | 
			
		|||
			            // 请求附近的店铺  
 | 
			
		||||
			            this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then(res => {  
 | 
			
		||||
			                if (res.code == 200) {  
 | 
			
		||||
								this.listmap = res.data
 | 
			
		||||
			                    // 假设返回的店铺数据在res.rows中,并且每个店铺有latitude和longitude字段  
 | 
			
		||||
			                    res.data.forEach(item => {  
 | 
			
		||||
			                        const shopCover = {  
 | 
			
		||||
| 
						 | 
				
			
			@ -167,24 +251,36 @@
 | 
			
		|||
			                            longitude: item.lng,  
 | 
			
		||||
			                            width: 25,  
 | 
			
		||||
			                            height: 30,  
 | 
			
		||||
			                            iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4' ,// 你可以为每个店铺指定不同的图标 
 | 
			
		||||
			                            iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4' ,
 | 
			
		||||
										label: {
 | 
			
		||||
											content: item.name,
 | 
			
		||||
											// anchorX:-20,
 | 
			
		||||
											textAlign: 'center'
 | 
			
		||||
											anchorX: (() => {
 | 
			
		||||
												if (item.name.length <= 2) {
 | 
			
		||||
													return -12
 | 
			
		||||
												} else if (item.name.length <= 3) {
 | 
			
		||||
													return -20
 | 
			
		||||
												} else if (item.name.length <= 4) {
 | 
			
		||||
													return -25
 | 
			
		||||
												} else if (item.name.length <= 5) {
 | 
			
		||||
													return -30
 | 
			
		||||
												} else if (item.name.length <= 6) {
 | 
			
		||||
													return -35
 | 
			
		||||
												} else if (item.name.length <= 8) {
 | 
			
		||||
													return -40
 | 
			
		||||
												} else if (item.name.length <=
 | 
			
		||||
													10) {
 | 
			
		||||
													return -45
 | 
			
		||||
												} else {
 | 
			
		||||
													return -item.name.length * 5
 | 
			
		||||
												}
 | 
			
		||||
											})(),
 | 
			
		||||
											fontWeight: 700,
 | 
			
		||||
											color: '#8883F0',
 | 
			
		||||
											textShadow: '2px 2px 0px white, -2px -2px 0px white, 2px -2px 0px white, -2px 2px 0px white',
 | 
			
		||||
										}
 | 
			
		||||
			                        };  
 | 
			
		||||
			                        this.covers.push(shopCover); // 将店铺覆盖物添加到数组中  
 | 
			
		||||
			                        this.covers.push(shopCover); 
 | 
			
		||||
			                    });  
 | 
			
		||||
			                    // 添加当前位置的覆盖物(如果需要的话)  
 | 
			
		||||
			                    // const myLocationCover = {  
 | 
			
		||||
			                    //     latitude: this.latitude,  
 | 
			
		||||
			                    //     longitude: this.longitude,  
 | 
			
		||||
			                    //     width: 20,  
 | 
			
		||||
			                    //     height: 40,  
 | 
			
		||||
			                    //     iconPath: '../../../static/image/icon1.png'  
 | 
			
		||||
			                    // };  
 | 
			
		||||
			                    // this.covers.push(myLocationCover);  
 | 
			
		||||
			                }  
 | 
			
		||||
			            });  
 | 
			
		||||
			        },  
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										18
									
								
								pages.json
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								pages.json
									
									
									
									
									
								
							| 
						 | 
				
			
			@ -215,6 +215,24 @@
 | 
			
		|||
						"navigationBarTextStyle": "#FFFFFF",
 | 
			
		||||
						"navigationStyle": "custom"
 | 
			
		||||
					}
 | 
			
		||||
				},{
 | 
			
		||||
					"path": "webview",
 | 
			
		||||
					"style": {
 | 
			
		||||
						"navigationBarTitleText": "",
 | 
			
		||||
						"enablePullDownRefresh": false,
 | 
			
		||||
						"navigationBarBackgroundColor": "#8883F0",
 | 
			
		||||
						"navigationBarTextStyle": "#FFFFFF",
 | 
			
		||||
						"navigationStyle": "custom"
 | 
			
		||||
					}
 | 
			
		||||
				},{
 | 
			
		||||
					"path": "sbshouye",
 | 
			
		||||
					"style": {
 | 
			
		||||
						"navigationBarTitleText": "添加设备",
 | 
			
		||||
						"enablePullDownRefresh": false,
 | 
			
		||||
						"navigationBarBackgroundColor": "#3996FD",
 | 
			
		||||
						"navigationBarTextStyle": "#FFFFFF",
 | 
			
		||||
						"navigationStyle": "custom"
 | 
			
		||||
					}
 | 
			
		||||
				},{
 | 
			
		||||
					"path": "device/lianjie",
 | 
			
		||||
					"style": {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -71,8 +71,9 @@
 | 
			
		|||
 | 
			
		||||
			<swiper class="swiper" style="height: 100%;margin-top: 20rpx;" :current='curtitidx' @change="swiperchange" @scrolltolower="onReachBottom">
 | 
			
		||||
				<swiper-item v-for="(item,index) in groupLists" :key="index">
 | 
			
		||||
					<view class="" v-if="shujuflag">
 | 
			
		||||
						暂无设备...
 | 
			
		||||
					<view style="width: 100%;padding-top: 300rpx;text-align: center;font-size: 32rpx;font-weight: 600;color: #ccc;" class="" v-if="shujuflag">
 | 
			
		||||
						<image style="width: 432rpx;height: 432rpx;display: block;padding-left: 100rpx;margin-bottom: 30rpx;" src="https://api.ccttiot.com/smartmeter/img/static/unju6N2PoHUv2pyLegfV" mode=""></image>
 | 
			
		||||
						该店铺暂无设备...
 | 
			
		||||
					</view>
 | 
			
		||||
					<view class="swiper-item " >
 | 
			
		||||
						<view class="card_box" @click="todetail(item.deviceId)" 
 | 
			
		||||
| 
						 | 
				
			
			@ -347,6 +348,7 @@
 | 
			
		|||
				});
 | 
			
		||||
			},
 | 
			
		||||
			getlist() {
 | 
			
		||||
				this.shujuflag = false
 | 
			
		||||
				if (this.storeId == null) {
 | 
			
		||||
					this.$u.get(`/app/device/list?pageNum=${this.pagenum}&pageSize=${this.pagesize}`).then((res) => {
 | 
			
		||||
						if (res.code == 200) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,17 +6,17 @@
 | 
			
		|||
				title-size='44' height='58'></u-navbar>
 | 
			
		||||
			<view class="ditu">
 | 
			
		||||
				<view class="dtxs">
 | 
			
		||||
					<map class='map' :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick"
 | 
			
		||||
						@scale="onMapScaleChange" :show-location="true" :markers="covers" :scale="mapScale" />
 | 
			
		||||
					<map class='map' id="map" :latitude="latitude" :longitude="longitude" @markertap="handleMarkerClick"
 | 
			
		||||
						:show-location="true" :markers="covers" :scale="mapScale" />
 | 
			
		||||
				</view>
 | 
			
		||||
				<view class="fujin">
 | 
			
		||||
					<image src="https://api.ccttiot.com/smartmeter/img/static/u7HPhEwbIJqbLRpImBON" mode=""
 | 
			
		||||
						@click="btnindex(5)"></image>
 | 
			
		||||
					<image src="https://api.ccttiot.com/smartmeter/img/static/uGVN2tOaCq2hiWKy1cYl" mode=""
 | 
			
		||||
						@click="btnindex(6)" v-if="isMch"></image>
 | 
			
		||||
					<image src="https://api.ccttiot.com/smartmeter/img/static/uzSmYNgLYJRMEmo4TWyA" mode=""
 | 
			
		||||
				<!-- 	<image src="https://api.ccttiot.com/smartmeter/img/static/uzSmYNgLYJRMEmo4TWyA" mode=""
 | 
			
		||||
						@click="btnindex(7)"
 | 
			
		||||
						style="width: 58rpx;height: 58rpx;position: fixed;top: 940rpx;right: 60rpx;"></image>
 | 
			
		||||
						style="width: 58rpx;height: 58rpx;position: fixed;top: 940rpx;right: 60rpx;"></image> -->
 | 
			
		||||
				</view>
 | 
			
		||||
				<view class="tubiao">
 | 
			
		||||
					<view class="gr" @click="btnindex(1)">
 | 
			
		||||
| 
						 | 
				
			
			@ -40,7 +40,7 @@
 | 
			
		|||
						<!-- 联系客服 -->
 | 
			
		||||
					</view>
 | 
			
		||||
				</view>
 | 
			
		||||
				<view class="guangg">
 | 
			
		||||
				<view class="guangg" @click="btnad">
 | 
			
		||||
					<image :src="imgad" mode=""></image>
 | 
			
		||||
				</view>
 | 
			
		||||
				<view class="saoma" @click="scanQRCode">
 | 
			
		||||
| 
						 | 
				
			
			@ -93,37 +93,118 @@
 | 
			
		|||
				userType: '',
 | 
			
		||||
				isMch: false,
 | 
			
		||||
				imgad: '',
 | 
			
		||||
 | 
			
		||||
				listmap: [],
 | 
			
		||||
				mapScale: 15,
 | 
			
		||||
				czflag:false,
 | 
			
		||||
				datetime:0,
 | 
			
		||||
				dingobj:''
 | 
			
		||||
				czflag: false,
 | 
			
		||||
				datetime: 0,
 | 
			
		||||
				dingobj: '',
 | 
			
		||||
				mapContext: null,
 | 
			
		||||
				mapScaleInterval: null,
 | 
			
		||||
			};
 | 
			
		||||
		},
 | 
			
		||||
		onLoad() {
 | 
			
		||||
			// this.initOtherCovers(); // 初始化其他覆盖物
 | 
			
		||||
           
 | 
			
		||||
			
 | 
			
		||||
 | 
			
		||||
		},
 | 
			
		||||
		onShow() {
 | 
			
		||||
			this.logins();
 | 
			
		||||
			this.getad()
 | 
			
		||||
			this.gethuidaio()
 | 
			
		||||
		},
 | 
			
		||||
		onReady() {
 | 
			
		||||
			this.mapContext = uni.createMapContext('map', this);
 | 
			
		||||
			this.mapScaleInterval = setInterval(this.updateMarkers, 1000);
 | 
			
		||||
		},
 | 
			
		||||
		beforeDestroy() {
 | 
			
		||||
			// 在组件卸载前清除定时器  
 | 
			
		||||
			if (this.mapScaleInterval) {
 | 
			
		||||
				clearInterval(this.mapScaleInterval);
 | 
			
		||||
				this.mapScaleInterval = null;
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		methods: {
 | 
			
		||||
			btnad(){
 | 
			
		||||
				this.$u.get("/app/ad").then((res) => {
 | 
			
		||||
					if (res.code == 200) {
 | 
			
		||||
						if(res.data.urlType == 1){
 | 
			
		||||
							uni.navigateTo({
 | 
			
		||||
								url:'/page_fenbao/webview?url=' + res.data.url
 | 
			
		||||
							})
 | 
			
		||||
						}else{
 | 
			
		||||
							uni.navigateTo({ 
 | 
			
		||||
								url: res.data.url
 | 
			
		||||
							})
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				})
 | 
			
		||||
			},
 | 
			
		||||
			
 | 
			
		||||
			onMapScaleChange(e) {
 | 
			
		||||
				// console.log(this.covers,'eeeeeeeee');
 | 
			
		||||
				this.mapScale = e.detail.scale; // 更新当前缩放级别  
 | 
			
		||||
				this.getMyLocation()
 | 
			
		||||
			     // this.covers.forEach(marker => {  
 | 
			
		||||
			     //        marker.label.content = this.mapScale > 13 ? marker.label.content : ''; 
 | 
			
		||||
			     // });  
 | 
			
		||||
			updateMarkers() {
 | 
			
		||||
				this.mapContext.getScale({
 | 
			
		||||
					success: (res) => {
 | 
			
		||||
						this.covers = []; // 清空之前的覆盖物  
 | 
			
		||||
						if (res.scale <= 14) {
 | 
			
		||||
							this.addMarkersWithoutLabels();
 | 
			
		||||
						} else {
 | 
			
		||||
							this.addMarkersWithLabels();
 | 
			
		||||
						}
 | 
			
		||||
					},
 | 
			
		||||
					fail: (error) => {
 | 
			
		||||
						console.error('获取地图缩放级别失败:', error);
 | 
			
		||||
						// 额外的错误处理逻辑...  
 | 
			
		||||
					},
 | 
			
		||||
				});
 | 
			
		||||
			},
 | 
			
		||||
			addMarkersWithoutLabels() {
 | 
			
		||||
				this.listmap.forEach((item) => {
 | 
			
		||||
					const shopCover = {
 | 
			
		||||
						id: parseFloat(item.storeId),
 | 
			
		||||
						latitude: item.lat,
 | 
			
		||||
						longitude: item.lng,
 | 
			
		||||
						width: 25,
 | 
			
		||||
						height: 30,
 | 
			
		||||
						iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4', 
 | 
			
		||||
					};
 | 
			
		||||
					this.covers.push(shopCover);
 | 
			
		||||
				});
 | 
			
		||||
			},
 | 
			
		||||
			addMarkersWithLabels() {
 | 
			
		||||
				this.listmap.forEach((item) => {
 | 
			
		||||
					const shopCover = {
 | 
			
		||||
						id: parseFloat(item.storeId),
 | 
			
		||||
						latitude: item.lat,
 | 
			
		||||
						longitude: item.lng,
 | 
			
		||||
						width: 25,
 | 
			
		||||
						height: 30,
 | 
			
		||||
						iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4',
 | 
			
		||||
						label: {
 | 
			
		||||
							content: item.name,
 | 
			
		||||
							anchorX:this.calculateAnchorX(item.name),
 | 
			
		||||
							fontWeight: 700,
 | 
			
		||||
							color: '#8883F0',
 | 
			
		||||
							textShadow: '2px 2px 0px #000, -2px -2px 0px #000, 2px -2px 0px #000, -2px 2px 0px #000',
 | 
			
		||||
							rotate:20
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
					this.covers.push(shopCover);
 | 
			
		||||
				});
 | 
			
		||||
			},
 | 
			
		||||
			calculateAnchorX(name) {  
 | 
			
		||||
			    let chineseLength = 0; 
 | 
			
		||||
			    let englishLength = 0;   
 | 
			
		||||
			    for (let i = 0; i < name.length; i++) {  
 | 
			
		||||
			        const charCode = name.charCodeAt(i);   
 | 
			
		||||
			        if (charCode >= 0x4e00 && charCode <= 0x9fa5) {  
 | 
			
		||||
			            chineseLength++;  
 | 
			
		||||
			        } else if (/[a-zA-Z]/.test(name[i])) { 
 | 
			
		||||
			           englishLength = englishLength+0.3; // 英文长度加1,但视为两个中文字符长度  
 | 
			
		||||
						// console.log(englishLength);
 | 
			
		||||
			        }  
 | 
			
		||||
			    }  
 | 
			
		||||
			    const totalLength = chineseLength + englishLength * 2;  
 | 
			
		||||
			    return -totalLength * 6.5; // 假设每个中文字符对应的 anchorX 偏移是 -7 
 | 
			
		||||
			},
 | 
			
		||||
 | 
			
		||||
			scanQRCode() {
 | 
			
		||||
 | 
			
		||||
				uni.scanCode({
 | 
			
		||||
					onlyFromCamera: true,
 | 
			
		||||
					scanType: ['qrCode'],
 | 
			
		||||
| 
						 | 
				
			
			@ -213,6 +294,7 @@
 | 
			
		|||
								if (res.code == 200) {
 | 
			
		||||
									// console.log(res);
 | 
			
		||||
									// 假设返回的店铺数据在res.rows中,并且每个店铺有latitude和longitude字段  
 | 
			
		||||
									this.listmap = res.data
 | 
			
		||||
									res.data.forEach(item => {
 | 
			
		||||
										const shopCover = {
 | 
			
		||||
											id: parseFloat(item.storeId),
 | 
			
		||||
| 
						 | 
				
			
			@ -223,8 +305,32 @@
 | 
			
		|||
											iconPath: 'https://api.ccttiot.com/smartmeter/img/static/uZXgsJE6hXbRSwbKILB4', // 你可以为每个店铺指定不同的图标  
 | 
			
		||||
											label: {
 | 
			
		||||
												content: item.name,
 | 
			
		||||
												// anchorX:-20,
 | 
			
		||||
												textAlign: 'center'
 | 
			
		||||
												anchorX: (() => {
 | 
			
		||||
													if (item.name.length <= 2) {
 | 
			
		||||
														return -12
 | 
			
		||||
													} else if (item.name.length <= 3) {
 | 
			
		||||
														return -20
 | 
			
		||||
													} else if (item.name.length <= 4) {
 | 
			
		||||
														return -25
 | 
			
		||||
													} else if (item.name.length <= 5) {
 | 
			
		||||
														return -30
 | 
			
		||||
													} else if (item.name.length <= 6) {
 | 
			
		||||
														return -35
 | 
			
		||||
													} else if (item.name.length <= 8) {
 | 
			
		||||
														return -40
 | 
			
		||||
													} else if (item.name.length <=
 | 
			
		||||
														10) {
 | 
			
		||||
														return -45
 | 
			
		||||
													} else {
 | 
			
		||||
														return -item.name.length * 5
 | 
			
		||||
													}
 | 
			
		||||
												})(),
 | 
			
		||||
												fontWeight: 700,
 | 
			
		||||
												color: '#8883F0',
 | 
			
		||||
												textShadow: '2px 2px 0px white, -2px -2px 0px white, 2px -2px 0px white, -2px 2px 0px white',
 | 
			
		||||
												style: {
 | 
			
		||||
 | 
			
		||||
												},
 | 
			
		||||
											}
 | 
			
		||||
										};
 | 
			
		||||
										this.covers.push(shopCover); // 将店铺覆盖物添加到数组中  
 | 
			
		||||
| 
						 | 
				
			
			@ -302,23 +408,23 @@
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
			gethuidaio(){
 | 
			
		||||
			gethuidaio() {
 | 
			
		||||
				this.$u.get('/app/bill/recharge/device/fail/list').then(res => {
 | 
			
		||||
					if(res.code == 200){
 | 
			
		||||
						if(res.data.length > 0){
 | 
			
		||||
					if (res.code == 200) {
 | 
			
		||||
						if (res.data.length > 0) {
 | 
			
		||||
							this.czflag = true
 | 
			
		||||
							this.dingobj = res.data
 | 
			
		||||
						}else{
 | 
			
		||||
						} else {
 | 
			
		||||
							uni.removeStorageSync('time')
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				})
 | 
			
		||||
			},
 | 
			
		||||
 | 
			
		||||
			tocz(){
 | 
			
		||||
			tocz() {
 | 
			
		||||
				this.czflag = false
 | 
			
		||||
				uni.navigateTo({
 | 
			
		||||
					url:'/page_fenbao/chongzhi?dingobj=' + JSON.stringify(this.dingobj)
 | 
			
		||||
					url: '/page_fenbao/chongzhi?dingobj=' + JSON.stringify(this.dingobj)
 | 
			
		||||
				})
 | 
			
		||||
			},
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -331,10 +437,11 @@
 | 
			
		|||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss">
 | 
			
		||||
	/deep/ .u-title{
 | 
			
		||||
	/deep/ .u-title {
 | 
			
		||||
		padding-bottom: 41rpx;
 | 
			
		||||
	}
 | 
			
		||||
	/deep/ .u-icon__icon{
 | 
			
		||||
 | 
			
		||||
	/deep/ .u-icon__icon {
 | 
			
		||||
		padding-bottom: 41rpx;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -359,8 +466,9 @@
 | 
			
		|||
		padding-right: 34rpx;
 | 
			
		||||
		box-sizing: border-box;
 | 
			
		||||
		height: 100%;
 | 
			
		||||
 | 
			
		||||
		// 代理样式
 | 
			
		||||
		.tip_box{
 | 
			
		||||
		.tip_box {
 | 
			
		||||
			position: fixed;
 | 
			
		||||
			left: 72rpx;
 | 
			
		||||
			top: 700rpx;
 | 
			
		||||
| 
						 | 
				
			
			@ -368,9 +476,11 @@
 | 
			
		|||
			background: #F7FAFE;
 | 
			
		||||
			border-radius: 30rpx 30rpx 30rpx 30rpx;
 | 
			
		||||
			z-index: 10000000;
 | 
			
		||||
			.top{
 | 
			
		||||
 | 
			
		||||
			.top {
 | 
			
		||||
				padding: 52rpx 38rpx 42rpx 36rpx;
 | 
			
		||||
				.txt{
 | 
			
		||||
 | 
			
		||||
				.txt {
 | 
			
		||||
					width: 100%;
 | 
			
		||||
					text-align: center;
 | 
			
		||||
					font-weight: 500;
 | 
			
		||||
| 
						 | 
				
			
			@ -378,12 +488,14 @@
 | 
			
		|||
					color: #3D3D3D;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			.bot{
 | 
			
		||||
				border-top: 2rpx solid #D8D8D8 ;
 | 
			
		||||
 | 
			
		||||
			.bot {
 | 
			
		||||
				border-top: 2rpx solid #D8D8D8;
 | 
			
		||||
				display: flex;
 | 
			
		||||
				flex-wrap: nowrap;
 | 
			
		||||
				height: 100%;
 | 
			
		||||
				.bot_left{
 | 
			
		||||
 | 
			
		||||
				.bot_left {
 | 
			
		||||
					width: 50%;
 | 
			
		||||
					height: 98rpx;
 | 
			
		||||
					display: flex;
 | 
			
		||||
| 
						 | 
				
			
			@ -393,14 +505,15 @@
 | 
			
		|||
					font-size: 36rpx;
 | 
			
		||||
					color: #3D3D3D;
 | 
			
		||||
				}
 | 
			
		||||
				.bot_right{
 | 
			
		||||
 | 
			
		||||
				.bot_right {
 | 
			
		||||
					width: 50%;
 | 
			
		||||
					height: 98rpx;
 | 
			
		||||
					display: flex;
 | 
			
		||||
					align-items: center;
 | 
			
		||||
					justify-content: center;
 | 
			
		||||
 | 
			
		||||
					border-left: 2rpx solid #D8D8D8 ;
 | 
			
		||||
					border-left: 2rpx solid #D8D8D8;
 | 
			
		||||
					font-weight: 500;
 | 
			
		||||
					font-size: 36rpx;
 | 
			
		||||
					color: #8883F0;
 | 
			
		||||
| 
						 | 
				
			
			@ -409,6 +522,7 @@
 | 
			
		|||
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		.userdaili {
 | 
			
		||||
			.gongneng {
 | 
			
		||||
				width: 680rpx;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										10
									
								
								pages/tj.vue
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								pages/tj.vue
									
									
									
									
									
								
							| 
						 | 
				
			
			@ -134,10 +134,11 @@
 | 
			
		|||
 | 
			
		||||
		},
 | 
			
		||||
		onShow() {
 | 
			
		||||
			this.timelist = []
 | 
			
		||||
			setTimeout(() => {
 | 
			
		||||
				// console.log(this.$refs)
 | 
			
		||||
				this.$refs.canvas.init(this.initChart)
 | 
			
		||||
			}, 1000)
 | 
			
		||||
			}, 500)
 | 
			
		||||
			this.recharge = 0
 | 
			
		||||
			this.deviceId = uni.getStorageSync('deviceId')
 | 
			
		||||
			this.userType = uni.getStorageSync('userType')
 | 
			
		||||
| 
						 | 
				
			
			@ -146,11 +147,6 @@
 | 
			
		|||
			this.yeartime.year = now.getFullYear()
 | 
			
		||||
			this.yeartime.month = now.getMonth() + 1
 | 
			
		||||
			this.gettime()
 | 
			
		||||
			// if (this.userType == '00') {
 | 
			
		||||
			// 	this.gettimes()
 | 
			
		||||
			// } else if (this.userType == '01') {
 | 
			
		||||
			// 	this.gettime()
 | 
			
		||||
			// }
 | 
			
		||||
		},
 | 
			
		||||
		methods: {
 | 
			
		||||
			
 | 
			
		||||
| 
						 | 
				
			
			@ -163,7 +159,7 @@
 | 
			
		|||
				setTimeout(() => {
 | 
			
		||||
					// console.log(this.$refs)
 | 
			
		||||
					this.$refs.canvas.init(this.initChart)
 | 
			
		||||
				}, 1000)
 | 
			
		||||
				}, 500)
 | 
			
		||||
			},
 | 
			
		||||
			// 进行获取用电量请求
 | 
			
		||||
			gettime() {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user