Sfoglia il codice sorgente

Signed-off-by: 1004749546@qq.com <1004749546@qq.com>
首页修改

1004749546@qq.com 4 anni fa
parent
commit
99ed1f238b
1 ha cambiato i file con 20 aggiunte e 12 eliminazioni
  1. 20 12
      pages/index/index.vue

+ 20 - 12
pages/index/index.vue

@@ -14,7 +14,7 @@
 							<cover-image class="img" src="/static/img/index-list.png"></cover-image>
 							<cover-view>网点列表</cover-view>
 						</cover-view>
-						<cover-view @click="$refs.popup.open()" class="flex-item">
+						<cover-view @click="openPop" class="flex-item">
 							<cover-image class="img" src="/static/img/index-call.png"></cover-image>
 							<cover-view>联系客服</cover-view>
 						</cover-view>
@@ -40,7 +40,7 @@
 						电话客服
 					</view>
 				</view>
-				<view @click="$refs.popup.close()" class="pop-cancle">
+				<view @click="closePop" class="pop-cancle">
 					取消
 				</view>
 			</view>
@@ -60,6 +60,7 @@
 				markers: [], // 标注点
 				centerX: '',
 				centerY: '',
+				showPop: false, // 是否显示客服弹框
 				markData: [{
 						id: '1',
 						name: '洗车机',
@@ -98,16 +99,20 @@
 		},
 		onLoad() {
 			this.getUserLocation()
+			// H5及APP平台适配代码
+			// #ifdef H5 || APP-PLUS
+			this.getLocation()
+			// #endif
 		},
 		methods: {
 			// 用户位置信息授权
 			getUserLocation() {
 				let _this = this
-				// 可以通过 wx.getSetting 先查询一下用户是否授权了 "scope.userLocation" 这个 scope
-				wx.getSetting({
+				// 可以通过 wx.getSetting 先查询一下用户是否授权了 "scope.userLocation" 这个 scope  H5及APP平台不适用
+				uni.getSetting({
 					success(res) {
 						if (!res.authSetting['scope.userLocation']) {
-							wx.authorize({
+							uni.authorize({
 								scope: 'scope.userLocation',
 								success() {
 									// 用户已经同意小程序使用位置信息,后续调用 wx.getLocation 接口不会弹窗询问
@@ -167,8 +172,14 @@
 				})
 			},
 			// 联系客服
-			concatServicer() {
+			openPop() {
 				 this.$refs.popup.open()
+				 this.showPop = true
+			},
+			// 关闭客服弹窗
+			closePop() {
+				this.$refs.popup.close()
+				this.showPop = false
 			},
 			// 电话客服
 			callPhone () {
@@ -232,7 +243,6 @@
 			flex: 1;
 
 			.cover-view {
-				z-index: 9;
 				position: absolute;
 				top: calc(60% - 120rpx);
 				left: calc(50% - 360rpx);
@@ -248,7 +258,7 @@
 					width: 120rpx;
 					height: 120rpx;
 					font-size: 24rpx;
-					color: #fff;
+					color: #F8F8F8;
 					display: flex;
 					flex-direction: column;
 					justify-content: center;
@@ -259,10 +269,10 @@
 						margin-bottom: 10rpx;
 					}
 				}
+				
 			}
 
 			.cover-bottom {
-				z-index: 9;
 				position: absolute;
 				bottom: calc(60rpx);
 				width: 80%;
@@ -270,9 +280,7 @@
 			}
 
 		}
-		uni-popup{
-			z-index: 999;
-		}
+		
 		.popup-box{
 			width: 100%;
 			height: 320rpx;