소스 검색

Merge branch 'test' of git.echepei.com:sailun/sailun-tbr-web into test

qukaidi 4 년 전
부모
커밋
91a773725f
2개의 변경된 파일41개의 추가작업 그리고 2개의 파일을 삭제
  1. 30 1
      pages/home/Scan-code-in/index.vue
  2. 11 1
      pages/home/Scan-code-out/index.vue

+ 30 - 1
pages/home/Scan-code-in/index.vue

@@ -71,6 +71,11 @@
 </template>
 
 <script>
+	const app = getApp()
+	var QQMapWX = require('../../../components/mi-map/qqmap-wx-jssdk.min.js')
+	var qqmapsdk = new QQMapWX({
+		key: 'LXCBZ-NNIKD-UZ64F-H6AFI-UNJLH-OCFGE'
+	})
 	import {
 		request
 	} from '../../../common/request/request'
@@ -146,6 +151,20 @@
 				})
 			},
 			location(){
+				
+				uni.getNetworkType({
+				    success: function (res) {
+						let none = res.networkType
+				        console.log(res.networkType);
+						if(none == 'none'){
+							uni.showToast({
+								icon: 'none',
+								title: '无网络,请连接网络后再试~',
+								position: "bottom"
+							})
+						}
+				    }
+				});
 				let this_s = this
 				uni.getLocation({
 					type: 'wgs84', // 返回国测局坐标
@@ -154,7 +173,16 @@
 						console.log(res);
 						this_s.longitude = res.longitude
 						this_s.latitude = res.latitude
-						this_s.address = res.address.city + res.address.district + res.address.poiName
+						this_s.address = res.address.country + res.address.province + res.address.city + res.address.district + res.address.street
+						if(res.address.length == 0){
+							uni.showToast({
+								icon: 'none',
+								title: '获取地址失败, 请检查是否开启定位权限~~',
+								position: "bottom"
+							})
+							console.log("定位失败出去啦")
+							return
+						}
 						this_s.Submit()
 					},
 					fail: function(e) {
@@ -162,6 +190,7 @@
 							icon: 'none',
 							title: '获取地址失败, 请检查是否开启定位权限~~'
 						})
+						this.location()
 					}
 				})
 			},

+ 11 - 1
pages/home/Scan-code-out/index.vue

@@ -97,7 +97,16 @@
 						console.log(res);
 						this_s.longitude = res.longitude
 						this_s.latitude = res.latitude
-						this_s.address = res.address.city + res.address.district + res.address.poiName
+						this_s.address = res.address.country + res.address.province + res.address.city + res.address.district + res.address.street
+						if(res.address.length == 0){
+							uni.showToast({
+								icon: 'none',
+								title: '获取地址失败, 请检查是否开启定位权限~~',
+								position: "bottom"
+							})
+							console.log("定位失败出去啦")
+							return
+						}
 						this_s.Submit()
 					},
 					fail: function(e) {
@@ -105,6 +114,7 @@
 							icon: 'none',
 							title: '获取地址失败, 请检查是否开启定位权限~~'
 						})
+						this.location()
 					}
 				})
 			},