Browse Source

app 考勤打卡解决加载问题

黑艺新账号
yxq 8 months ago
parent
commit
004906aba8
2 changed files with 23 additions and 14 deletions
  1. +9
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/App.vue
  2. +14
    -14
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/AttendanceCard/list.vue

+ 9
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/App.vue View File

@@ -5,6 +5,15 @@
// 考虑到用户刷新网页时会丢失全局数据、页面栈、页面数据等,因此直接跳回首页即可

async onLaunch(param) {
// 加载百度地图资源
let ak = this.GET_AK()
var script = document.createElement('script');
script.type = 'text/javascript';
script.src =
'https://api.map.baidu.com/api?v=1.0&type=webgl&ak=' + ak +
'&callback=' + 'initMap';
document.head.appendChild(script);
// 在App.vue文件中获取到页面到URL (初始化WXsdj)
window.localStorage.setItem('scanUrl',location.href.split('#')[0])
//应用的生命周期 应用启动后触发


+ 14
- 14
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/AttendanceCard/list.vue View File

@@ -177,7 +177,7 @@
this.$set(this.info, 'AttendanceTypeString', '外勤打卡')
this.$set(this.postData, 'AIsOut', 1)
// 获取定位,不是外勤时候改变状态
if (!window.BMapGL) await this.loadJScript()
// if (!window.BMapGL) await this.loadJScript()
if(!window.BMapGL || !BMapGL.Map){
this.TOAST('获取定位资源失败!')
return false
@@ -316,19 +316,19 @@
},
},
destroyed() {
let scirpt = document.getElementById('baiduScript')
if(scirpt){
scirpt.remove()
}
let scirpt1 = document.querySelectorAll('body script')
if(scirpt1){
scirpt1.forEach(e=>{
if(e.src.includes('https://api.map.baidu.com')){
e.remove()
}
})
}
window.BMapGL = null
// let scirpt = document.getElementById('baiduScript')
// if(scirpt){
// scirpt.remove()
// }
// let scirpt1 = document.querySelectorAll('body script')
// if(scirpt1){
// scirpt1.forEach(e=>{
// if(e.src.includes('https://api.map.baidu.com')){
// e.remove()
// }
// })
// }
// window.BMapGL = null
clearInterval(this.timer)
clearInterval(this.timer1)
}


Loading…
Cancel
Save