chenrui 4 лет назад
Родитель
Сommit
ed1af9dbaf

+ 8 - 2
api/task.js

@@ -91,5 +91,11 @@ export const validTaskPosition = params => {
     data: params
   })
 }
-
-
+//  地址反解析    根据经纬度获取具体位置
+export const tencentAddressInfo = params => {
+  return axios.request({
+    url: `tencent/addressInfo`,
+    method: 'post',
+    data: params
+  })
+}

+ 1 - 1
pages/shopTourOver/shopTourOver.vue

@@ -132,7 +132,7 @@
 	}
 </script>
 
-<style lang="scss" scoped>
+<style lang="scss">
 	page{
 		background-color: #f8f8f8;
 		height: calc(100vh - 44px);

+ 6 - 6
pages/shopTourRecord/screenModule.vue

@@ -35,7 +35,7 @@
 						<view class="screen-module">
 							<text class="screen-tit">巡店人:</text>
 							<view class="screen-inp-val">
-								<u-input class="screen-inp" v-model="moreScreen.shopInspector" :height="52" placeholder="请输入" type="text" :border="true" />
+								<u-input class="screen-inp" v-model="moreScreen.userName" :height="52" placeholder="请输入" type="text" :border="true" />
 							</view>
 						</view>
 					</scroll-view>
@@ -84,7 +84,7 @@
 				sourceTypeList: [], // 检查方式数据列表
 				moreScreen: {  //  数据暂存
 					storeName: '',  //  门店
-					shopInspector: ''  //  巡店人
+					userName: ''  //  巡店人
 				}
 			}
 		},
@@ -109,9 +109,9 @@
 				this.searchForm.creatTime = this.defaultParams.creatTime ? this.defaultParams.creatTime : []
 				this.range = this.searchForm.creatTime
 				this.searchForm.storeName = this.defaultParams.storeName ? this.defaultParams.storeName : ''
-				this.searchForm.shopInspector = this.defaultParams.shopInspector ? this.defaultParams.shopInspector : ''
+				this.searchForm.userName = this.defaultParams.userName ? this.defaultParams.userName : ''
 				this.moreScreen.storeName = this.searchForm.storeName
-				this.moreScreen.shopInspector = this.searchForm.shopInspector
+				this.moreScreen.userName = this.searchForm.userName
 				this.defaultSourceType()
 			},
 			//  巡店人、状态  筛选条件  change
@@ -128,7 +128,7 @@
 			closeDropdown(){
 				this.searchForm.creatTime = this.range
 				this.searchForm.storeName = this.moreScreen.storeName
-				this.searchForm.shopInspector = this.moreScreen.shopInspector
+				this.searchForm.userName = this.moreScreen.userName
 				this.$emit('refresh', this.searchForm)
 				this.$refs.uDropdown.close()
 			},
@@ -152,7 +152,7 @@
 					this.defaultSourceType()
 				}else if(ind == 3){  //  多条件筛选
 					this.moreScreen.storeName = this.searchForm.storeName
-					this.moreScreen.shopInspector = this.searchForm.shopInspector
+					this.moreScreen.userName = this.searchForm.userName
 					this.range = this.searchForm.creatTime
 				}
 			},

+ 2 - 2
pages/shopTourRecord/shopTourRecord.vue

@@ -65,7 +65,7 @@
 					status: '',  //  状态(全部、待处理、进行中、已完成、已过期)
 					creatTime: [],  //  时间区间(天)
 					storeName: '',  //  门店
-					shopInspector: ''  //  巡店人
+					userName: ''  //  巡店人
 				},
 				pageNo: 1,  //  当前页码
 				pageSize: 15,  //  一页多少条
@@ -113,7 +113,7 @@
 					typeList: this.searchForm.typeList ? this.searchForm.typeList : [],
 					status: this.searchForm.status ? this.searchForm.status : '', // 任务状态
 					inspectorId: this.searchForm.inspectorId ? this.searchForm.inspectorId : '',
-					shopInspector: this.searchForm.shopInspector ? this.searchForm.shopInspector : '',
+					userName: this.searchForm.userName ? this.searchForm.userName : '',
 				}
 				getTasksList(params).then(res => {
 					if (res.status == 200) {

+ 12 - 7
pages/siteInspection/siteInspection.vue

@@ -35,7 +35,7 @@
 <script>
 	import { clzConfirm,getGpsLocation } from '@/libs/tools.js'
 	import { findStoreList } from '@/api/store.js'
-	import { queryCurrentTaskUsing } from '@/api/task.js'
+	import { queryCurrentTaskUsing, tencentAddressInfo } from '@/api/task.js'
 	export default{
 		data(){
 			return{
@@ -50,23 +50,28 @@
 			}
 		},
 		onReady() {
-			this.init()
+			this.getLocation()
 		},
 		methods: {
-			// 初始化
-			init(){
-				this.getLocation()
-			},
 			// 获取当前位置
 			getLocation(){
 				const _this = this
 				getGpsLocation(function(gps){
 					console.log(gps)
-					// _this.location
+					_this.getAddressInfo({lng:gps[0],lat:gps[1]})
 					// 按照经纬度查询
 					_this.searchHandle({lng:gps[0],lat:gps[1]})
 				})
 			},
+			// 根据经纬度获取具体位置
+			getAddressInfo(params){
+				tencentAddressInfo(params).then(res => {
+					console.log(res)
+					if(res.status == 200){
+						this.location = res.data.province + res.data.city + res.data.district + res.data.address
+					}
+				})
+			},
 			// 按名称查询
 			queryHandle(){
 				this.searchHandle({

+ 1 - 1
pages/spotCheck/spotCheck.vue

@@ -6,7 +6,7 @@
 
 <script>
 	import { clzConfirm,saveBase64ToAliOss } from '@/libs/tools'
-	import {getTaskDetail,savePointTask,getVideoUrl} from '@/api/task'
+	import {getTaskDetail,savePointTask} from '@/api/task'
 	import {getTaskTargetById} from '@/api/taskTarget'
 	import { photoPaiZhao, getVideoUrl } from '@/api/store';
 	export default {