Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/dev1.4' into dev1.4

xuyunhui 2 anni fa
parent
commit
d3deed5343

+ 2 - 2
common/js/env.js

@@ -1,9 +1,9 @@
 "use strict";
 
 // let baseUrl = `https://jje.admin.xinyuekj.com.cn`
-// let baseUrl = `https://jje.xinyuekj.com.cn/prod-api`
+let baseUrl = `https://jje.xinyuekj.com.cn/prod-api`
 /** 测试环境 */
-let baseUrl = `https://jje.admin.xinyuekj.com.cn/test-api`
+// let baseUrl = `https://jje.admin.xinyuekj.com.cn/test-api`
 /** 开发环境*/
 // let baseUrl = `http://65i1sxopd9qp.ngrok.xiaomiqiu123.top`
 // let baseUrl = `http://47.108.114.127:10888`

+ 10 - 4
orderPages/bookService/index.vue

@@ -37,8 +37,8 @@
             </view>
           </view>
           <view class="h-row">
-            <text class="address">地址:{{ storeInfo.address }}</text>
-            <!-- <text class="address">距你1.8km</text> -->
+              <text class="address">地址:{{ storeInfo.address }}</text>
+			  <text class="address1">{{storeInfo.distanceDesc}}</text>
           </view>
         </view>
       </view>
@@ -863,9 +863,15 @@
 
           .address {
             color: #999999;
-            font-size: 12px;
-            padding-right: 12px;
+			  width: 450rpx;
+            font-size: 24rpx;
           }
+
+			.address1 {
+				color: #999999;
+				font-size: 24rpx;
+				padding-right: 40rpx;
+			}
         }
       }
 

+ 8 - 3
orderPages/storeService/index.vue

@@ -22,7 +22,7 @@
           </view>
           <view class="h-row">
             <text class="address">地址:{{ storeInfo.address }}</text>
-            <!-- <text class="address">距你1.8km</text> -->
+			  <text class="address1">{{storeInfo.distanceDesc}}</text>
           </view>
         </view>
       </view>
@@ -524,9 +524,14 @@ background-color: white;
 
           .address {
             color: #999999;
-            font-size: 12px;
-            padding-right: 12px;
+			  width: 450rpx;
+            font-size:  24rpx;
           }
+			.address1 {
+				color: #999999;
+				font-size: 24rpx;
+				padding-right: 40rpx;
+			}
         }
       }
 

+ 18 - 4
pages/index/index.vue

@@ -241,6 +241,7 @@
 		},
 		data() {
 			return {
+				isGetAddress:true, //是否获取到了经纬度
 				noticeList: [],
 				notice: '',
 				userInfo: {},
@@ -249,8 +250,8 @@
 					auth: true,
 					appid: 46,
 					telphone: '',
-					longitude: 0,
-					latitude: 0
+					latitude: 26.5737,
+					longitude: 106.7135,
 				},
 				storeList: [],
 				storeInfo: {},
@@ -266,6 +267,14 @@
 			// 查询门店信息
 			const data = uni.getStorageSync('storeInfo');
 			if (!data) {
+				setTimeout(e=>{
+					console.log('定时器要执行了 isGetAddress =>',this.isGetAddress)
+					if (this.isGetAddress){
+						console.log('定时器执行了isGetAddress =>',this.isGetAddress)
+						this.isGetAddress = !this.isGetAddress
+						this.getStoreListData(this.reqParm)
+					}
+				},3000)
 				// 获取位置信息查询门店列表数据
 				this.getLocation();
 			} else {
@@ -301,7 +310,7 @@
 				console.log("用户扫技师端或者拓客端二维码传递过来的参数",param)
 			}
 
-			this.getLocation();
+
 
 			//公告信息
 			this.getNoticeListData();
@@ -490,7 +499,12 @@
 					},
 					complete: function(complete) {
 						console.log('获取用户地址失败or成功==》', complete)
-						that.getStoreListData(that.reqParm)
+						if (that.isGetAddress){
+							console.log("根据位置获取门店执行了 isGetAddress =>",that.isGetAddress)
+							that.isGetAddress = !that.isGetAddress
+							that.getStoreListData(that.reqParm)
+						}
+
 					}
 				});
 			},

+ 18 - 1
storePages/store/store-choose.vue

@@ -81,6 +81,7 @@
     export default {
         data() {
             return {
+                isGetAddress:true, //是否获取到了经纬度
                 markers:[],
                 areaName: '贵阳市',
                 latitude: 26.5737,
@@ -106,6 +107,14 @@
 
 
             this.getLocation()
+            setTimeout(e=>{
+                console.log('定时器要执行了 isGetAddress =>',this.isGetAddress)
+                if (this.isGetAddress){
+                    console.log('定时器执行了isGetAddress =>',this.isGetAddress)
+                    this.isGetAddress = !this.isGetAddress
+                    this.getStoreListData()
+                }
+            },3000)
             // 判断Openid是否为空
             if (option.type) {
                 this.type = option.type;
@@ -141,6 +150,9 @@
                 })
             },
             getLocation() {
+                uni.showLoading({
+                    title: '加载中...'
+                });
                 let that = this
                 uni.getLocation({
                     type: 'gcj02',
@@ -157,7 +169,11 @@
                     complete: function (complete) {
                         console.log('获取用户地址失败or成功==》', complete)
                         // 获取商店数据
-                        that.getStoreListData();
+                        if (that.isGetAddress){
+                            console.log("根据位置获取门店执行了 isGetAddress =>",that.isGetAddress)
+                            that.isGetAddress = !that.isGetAddress
+                            that.getStoreListData()
+                        }
                     }
                 })
             },
@@ -194,6 +210,7 @@
                     latitude: this.latitude,
                     longitude: this.longitude,
                 }).then((res) => {
+                    uni.hideLoading();
                     console.log(res)
                     that.storeList = res.data.data
                     that.latitude = res.data.data[0].latitude