|
@@ -108,7 +108,7 @@ |
|
|
methods: { |
|
|
methods: { |
|
|
// 页面初始化 |
|
|
// 页面初始化 |
|
|
async init() { |
|
|
async init() { |
|
|
this.isInternalNetwork(false) |
|
|
|
|
|
|
|
|
await this.isInternalNetwork(false) |
|
|
this.LOADING('加载数据中...') |
|
|
this.LOADING('加载数据中...') |
|
|
|
|
|
|
|
|
this.now = this.getCurrentTime() |
|
|
this.now = this.getCurrentTime() |
|
@@ -178,33 +178,35 @@ |
|
|
AttendanceType:this.info.AttendanceType, |
|
|
AttendanceType:this.info.AttendanceType, |
|
|
AttendanceTypeString:this.info.AttendanceTypeString, |
|
|
AttendanceTypeString:this.info.AttendanceTypeString, |
|
|
} |
|
|
} |
|
|
if (![5].includes(this.info.AttendanceType)) { |
|
|
|
|
|
this.$set(this.info, 'AttendanceType', 4) |
|
|
|
|
|
this.$set(this.info, 'AttendanceTypeString', '外勤打卡') |
|
|
|
|
|
this.$set(this.postData, 'AIsOut', 1) |
|
|
|
|
|
// 获取定位,不是外勤时候改变状态 |
|
|
|
|
|
// if (!window.BMapGL) await this.loadJScript() |
|
|
|
|
|
if(!window.BMapGL || !BMapGL.Map){ |
|
|
|
|
|
this.TOAST('获取定位资源失败!') |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
this.map = new BMapGL.Map('container'); |
|
|
|
|
|
|
|
|
|
|
|
await this.isFieldPersonnel() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ([5].includes(this.info.AttendanceType)) return true |
|
|
|
|
|
|
|
|
|
|
|
this.$set(this.info, 'AttendanceType', 4) |
|
|
|
|
|
this.$set(this.info, 'AttendanceTypeString', '外勤打卡') |
|
|
|
|
|
this.$set(this.postData, 'AIsOut', 1) |
|
|
|
|
|
// 获取定位,不是外勤时候改变状态 |
|
|
|
|
|
// if (!window.BMapGL) await this.loadJScript() |
|
|
|
|
|
if(!window.BMapGL || !BMapGL.Map){ |
|
|
|
|
|
this.TOAST('获取定位资源失败!') |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
|
|
|
this.map = new BMapGL.Map('container'); |
|
|
|
|
|
|
|
|
|
|
|
await this.isFieldPersonnel() |
|
|
|
|
|
if(!this.postData.ClockPlace){ |
|
|
|
|
|
return true |
|
|
|
|
|
} |
|
|
|
|
|
this.timer1 = setInterval(async ()=>{ |
|
|
|
|
|
if(this.isGetingLocal)return |
|
|
if(!this.postData.ClockPlace){ |
|
|
if(!this.postData.ClockPlace){ |
|
|
return true |
|
|
|
|
|
|
|
|
clearInterval(this.timer1) |
|
|
} |
|
|
} |
|
|
this.timer1 = setInterval(async ()=>{ |
|
|
|
|
|
if(this.isGetingLocal)return |
|
|
|
|
|
if(!this.postData.ClockPlace){ |
|
|
|
|
|
clearInterval(this.timer1) |
|
|
|
|
|
} |
|
|
|
|
|
this.isGetingLocal = true |
|
|
|
|
|
await this.isFieldPersonnel() |
|
|
|
|
|
// console.log(this.postData) |
|
|
|
|
|
this.isGetingLocal = false |
|
|
|
|
|
},3000) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.isGetingLocal = true |
|
|
|
|
|
await this.isFieldPersonnel() |
|
|
|
|
|
// console.log(this.postData) |
|
|
|
|
|
this.isGetingLocal = false |
|
|
|
|
|
},3000) |
|
|
|
|
|
|
|
|
return true |
|
|
return true |
|
|
}, |
|
|
}, |
|
|
//返回 |
|
|
//返回 |
|
@@ -284,7 +286,7 @@ |
|
|
resolve(false) |
|
|
resolve(false) |
|
|
} |
|
|
} |
|
|
new BMapGL.Convertor().translate([res], 3, 5, data => { |
|
|
new BMapGL.Convertor().translate([res], 3, 5, data => { |
|
|
if (data.status == 0) { |
|
|
|
|
|
|
|
|
if (data&&data.status == 0) { |
|
|
// alert(data.points[0].lng + '' + data.points[0].lat) |
|
|
// alert(data.points[0].lng + '' + data.points[0].lat) |
|
|
this.$set(this.postData, 'ALon', data.points[0].lng) |
|
|
this.$set(this.postData, 'ALon', data.points[0].lng) |
|
|
this.$set(this.postData, 'ALat', data.points[0].lat) |
|
|
this.$set(this.postData, 'ALat', data.points[0].lat) |
|
@@ -304,7 +306,7 @@ |
|
|
this.$set(this.postData, 'ALon', '') |
|
|
this.$set(this.postData, 'ALon', '') |
|
|
this.$set(this.postData, 'ALat', '') |
|
|
this.$set(this.postData, 'ALat', '') |
|
|
this.$set(this.postData, 'ClockPlace', '') |
|
|
this.$set(this.postData, 'ClockPlace', '') |
|
|
this.TOAST('获取定位失败!') |
|
|
|
|
|
|
|
|
this.TOAST('定位获取失败!') |
|
|
resolve(false) |
|
|
resolve(false) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -322,8 +324,8 @@ |
|
|
}, |
|
|
}, |
|
|
// 判断是否学校网络 |
|
|
// 判断是否学校网络 |
|
|
isInternalNetwork(TOAST=true){ |
|
|
isInternalNetwork(TOAST=true){ |
|
|
this.LOADING() |
|
|
|
|
|
this.requestBase("https://mp.weixin.qq.com/intp/getuserclientip").then(res=>{ |
|
|
|
|
|
|
|
|
this.LOADING('加载数据中...') |
|
|
|
|
|
return this.requestBase("https://mp.weixin.qq.com/intp/getuserclientip").then(res=>{ |
|
|
this.HIDE_LOADING() |
|
|
this.HIDE_LOADING() |
|
|
let res_ = res[1] |
|
|
let res_ = res[1] |
|
|
let client_ip_start = '1.190.222.' |
|
|
let client_ip_start = '1.190.222.' |
|
|