htc há 1 mês atrás
pai
commit
e82dbc468f
2 ficheiros alterados com 7 adições e 2 exclusões
  1. 1 1
      pages/login/wxLogin.vue
  2. 6 1
      pagesClockin/index.vue

+ 1 - 1
pages/login/wxLogin.vue

@@ -62,7 +62,7 @@
 								if(roleCodes.length==0) url = '/pagesClockin/index';
 								else if(roleCodes.includes('Maintenance')) url = '/pages/operation/index';
 								else if(roleCodes.includes('inventory')||roleCodes.includes('Warehouse Manager')) url = '/pagesStorage/home';
-								if(!url) return this.$showToast('无菜单角色,请后台查看!')
+								if(!url) return that.$showToast('无菜单角色,请后台查看!')
 								setTimeout(()=>{
 									uni.reLaunch({ url })
 								},1500)

+ 6 - 1
pagesClockin/index.vue

@@ -62,7 +62,7 @@
 </template>
 
 <script>
-	var timer = null;
+	var timer = null,timer2 = null;
 	const QQMapWX = require('../static/lib/qqmap-wx-jssdk.min.js');
 	const qqmapsdk = new QQMapWX({
 	  key: 'V3NBZ-6NRKT-QOQXY-LU6RY-PNHJ5-QDBTQKEY'
@@ -103,10 +103,14 @@
 		},
 		onUnload() {
 			clearInterval(timer)
+			clearInterval(timer2)
 		},
 		mounted() {
 			this.getRules();
 			this.getCurrentLocation();
+			timer2 = setInterval(()=>{
+				this.getCurrentLocation();
+			},5000)
 			this.getUserInfo();
 		},
 		methods:{
@@ -187,6 +191,7 @@
 				success: (res) => {
 				  if(res.result && res.result.elements.length > 0) {
 					this.distance = res.result.elements[0].distance;
+					console.log(this.distance,'distance');
 				  }
 				},
 				fail: (err) => {