Kaynağa Gözat

手表发送定位命令

wgl 4 yıl önce
ebeveyn
işleme
fd9f342bf6

+ 9 - 0
src/projects/pension/apis/Master/health.js

@@ -54,3 +54,12 @@ export function geStepList() {
 		method: 'post',
 	})
 }
+
+//获取实时定位
+export function fixPosition() {
+	return request({
+		url: '/mobile/watchApi/fixPosition',
+		data: {},
+		method: 'get',
+	})
+}

+ 18 - 5
src/projects/pension/views/Master/Health/ChartMap.vue

@@ -15,11 +15,11 @@
 			</div>
 		</div>
 		<div class="fyy-footer vongi-yjbtn">
-				<button type="button" class="mui-btn mui-btn-pink">
-					<span class="iconfont icon-dingwei1"></span>
-					获取当前位置
-				</button>	
-			</div>
+			<button @click="fixPosition" type="button" class="mui-btn mui-btn-pink">
+				<span class="iconfont icon-dingwei1"></span>
+				获取当前位置
+			</button>
+		</div>
 		<loading :visible="isLoading"></loading>
 	</div>
 </template>
@@ -132,6 +132,19 @@
 					picker.dispose();
 				});
 			},
+			//获取实时定位
+			fixPosition() {
+				this.isLoading = true;
+				API_Health.fixPosition().then(response => {
+					this.isLoading = false;
+
+					mui.toast('发送定位命令成功,请稍后刷新页面查看最新定位!');
+				}).catch(error => {
+					this.isLoading = false;
+					mui.toast(error);
+				})
+			},
+
 			asynCallBack() {},
 		},
 		mounted() {