|
|
@@ -109,7 +109,6 @@ |
|
|
|
this.timer = setInterval(this.getCurrentTime, 1000) |
|
|
|
|
|
|
|
//判断教师是否授课,显示弹层 |
|
|
|
alert('判断教师是否授课') |
|
|
|
let hasLesson = await this.judgeTeacherIsHasLesson() |
|
|
|
this.modal = hasLesson |
|
|
|
|
|
|
@@ -176,11 +175,8 @@ |
|
|
|
this.$set(this.info, 'AttendanceTypeString', '外勤打卡') |
|
|
|
this.$set(this.postData, 'AIsOut', 1) |
|
|
|
// 获取定位,不是外勤时候改变状态 |
|
|
|
alert('异步加载地图开始') |
|
|
|
if (!window.BMapGL) await this.loadJScript() |
|
|
|
alert('异步加载地图结束') |
|
|
|
this.map = new BMapGL.Map('container'); |
|
|
|
alert('初始化地图结束') |
|
|
|
|
|
|
|
await this.isFieldPersonnel() |
|
|
|
if(!this.postData.ClockPlace){ |
|
|
@@ -220,7 +216,6 @@ |
|
|
|
loadJScript() { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
window.initMap = function() { |
|
|
|
alert('地图加载回调') |
|
|
|
resolve(BMapGL) |
|
|
|
} |
|
|
|
var script = document.createElement('script'); |
|
|
@@ -236,7 +231,6 @@ |
|
|
|
// 签到状态(1正常打卡,2迟到打卡,3早退打卡,4外勤打卡,5不在考勤时间范围) |
|
|
|
async getDistance(myP1) { |
|
|
|
// new BMapGL.Point(116.404, 39.915) |
|
|
|
alert('获取当前位置') |
|
|
|
let myP2 = await this.local(); |
|
|
|
if (!myP2) { |
|
|
|
// this.TOAST('获取定位失败!') |
|
|
@@ -245,7 +239,6 @@ |
|
|
|
this.$set(this.postData, 'AIsOut', 1) |
|
|
|
return |
|
|
|
} |
|
|
|
alert('开始计算距离') |
|
|
|
let distance = this.map.getDistance(myP1, myP2).toFixed(2) |
|
|
|
// alert('距离'+ distance) |
|
|
|
// console.log('距离', distance, '打卡坐标:', myP1, '当前坐标:', myP2) |
|
|
|