Commit 632be74c authored by xinzhedeai's avatar xinzhedeai

页面加载 空白显示优化处理

parent ec64a0a8
...@@ -2,9 +2,14 @@ ...@@ -2,9 +2,14 @@
* 请求拦截、相应拦截、错误统一处理 * 请求拦截、相应拦截、错误统一处理
*/ */
const BASE_URL = 'https://gqyjpt.weihai.cn' const BASE_URL = 'https://gqyjpt.weihai.cn'
var errors = []
if(localStorage.getItem('wenti')){
errors = JSON.parse(localStorage.getItem('wenti'))
}
localStorage.setItem('wenti', JSON.stringify(errors))
var http2 = { var http2 = {
post: function(params, fn) { post: function(params, fn) {
console.log('中台错误信息', JSON.stringify(localStorage.getItem('wenti')))
/** /**
* 网关验签接口 * 网关验签接口
* @param {1} = appid应用唯一标识 * @param {1} = appid应用唯一标识
...@@ -46,6 +51,9 @@ var http2 = { ...@@ -46,6 +51,9 @@ var http2 = {
success: true success: true
*/ */
if(!value){ if(!value){
var errors = JSON.parse(localStorage.getItem('wenti'))
errors.push('中台发生了错误-中台value为undefined')
localStorage.setItem('wenti', JSON.stringify(errors))
// vant.Dialog.alert({ // vant.Dialog.alert({
// title: '信息提示', // title: '信息提示',
// message: '网络异常, 请重试', // message: '网络异常, 请重试',
...@@ -61,6 +69,9 @@ var http2 = { ...@@ -61,6 +69,9 @@ var http2 = {
console.log('vaildInterfacefn响应解密', sm2_decrypt_result) console.log('vaildInterfacefn响应解密', sm2_decrypt_result)
if(!sm2_decrypt_result){ // 解密为空字符串 if(!sm2_decrypt_result){ // 解密为空字符串
var errors = JSON.parse(localStorage.getItem('wenti'))
errors.push('中台发生了错误-解密为空')
localStorage.setItem('wenti', JSON.stringify(errors))
fn && fn(null, 'decrypt') fn && fn(null, 'decrypt')
return return
} }
......
...@@ -220,7 +220,9 @@ window.addEventListener("load", function() { ...@@ -220,7 +220,9 @@ window.addEventListener("load", function() {
if (res) { if (res) {
console.log('接口回调数据', JSON.parse(res)) console.log('接口回调数据', JSON.parse(res))
setTimeout(() => { setTimeout(() => {
this.$nextTick(()=>{
vant.Toast.clear() vant.Toast.clear()
})
}, 0); }, 0);
var result = JSON.parse(res) var result = JSON.parse(res)
// this.noticeContent = result.noticeContent // this.noticeContent = result.noticeContent
......
...@@ -72,7 +72,9 @@ window.addEventListener("load", function() { ...@@ -72,7 +72,9 @@ window.addEventListener("load", function() {
} }
this.loading = false this.loading = false
setTimeout(() => { setTimeout(() => {
this.$nextTick(()=>{
vant.Toast.clear() vant.Toast.clear()
})
}, 0); }, 0);
this.$nextTick(()=>{ this.$nextTick(()=>{
// 滚动条跳转位置 // 滚动条跳转位置
......
...@@ -256,7 +256,9 @@ window.addEventListener("load", function() { ...@@ -256,7 +256,9 @@ window.addEventListener("load", function() {
} }
this.filePathList = this.form.drillPhotoList || []; this.filePathList = this.form.drillPhotoList || [];
setTimeout(() => { setTimeout(() => {
this.$nextTick(()=>{
vant.Toast.clear() vant.Toast.clear()
})
}, 0); }, 0);
} }
}) })
......
...@@ -82,7 +82,9 @@ window.addEventListener("load", function() { ...@@ -82,7 +82,9 @@ window.addEventListener("load", function() {
} }
this.loading = false this.loading = false
setTimeout(() => { setTimeout(() => {
this.$nextTick(()=>{
vant.Toast.clear() vant.Toast.clear()
})
}, 0); }, 0);
this.$nextTick(()=>{ this.$nextTick(()=>{
// 滚动条跳转位置 // 滚动条跳转位置
......
...@@ -45,7 +45,9 @@ window.addEventListener("load", function() { ...@@ -45,7 +45,9 @@ window.addEventListener("load", function() {
this.lawChapter = result.lawChapter this.lawChapter = result.lawChapter
} }
setTimeout(() => { setTimeout(() => {
this.$nextTick(()=>{
vant.Toast.clear() vant.Toast.clear()
})
}, 0); }, 0);
}) })
}, },
......
...@@ -63,7 +63,9 @@ window.addEventListener("load", function() { ...@@ -63,7 +63,9 @@ window.addEventListener("load", function() {
} }
this.loading = false this.loading = false
setTimeout(() => { setTimeout(() => {
this.$nextTick(()=>{
vant.Toast.clear() vant.Toast.clear()
})
}, 0); }, 0);
this.$nextTick(()=>{ this.$nextTick(()=>{
// 滚动条跳转位置 // 滚动条跳转位置
......
...@@ -64,7 +64,9 @@ window.addEventListener("load", function() { ...@@ -64,7 +64,9 @@ window.addEventListener("load", function() {
} }
this.loading = false this.loading = false
setTimeout(() => { setTimeout(() => {
this.$nextTick(()=>{
vant.Toast.clear() vant.Toast.clear()
})
}, 0); }, 0);
this.$nextTick(()=>{ this.$nextTick(()=>{
// 滚动条跳转位置 // 滚动条跳转位置
......
...@@ -67,7 +67,9 @@ window.addEventListener("load", function() { ...@@ -67,7 +67,9 @@ window.addEventListener("load", function() {
} }
this.loading = false this.loading = false
setTimeout(() => { setTimeout(() => {
this.$nextTick(()=>{
vant.Toast.clear() vant.Toast.clear()
})
}, 0); }, 0);
this.$nextTick(()=>{ this.$nextTick(()=>{
// 滚动条跳转位置 // 滚动条跳转位置
......
...@@ -44,7 +44,9 @@ window.addEventListener("load", function() { ...@@ -44,7 +44,9 @@ window.addEventListener("load", function() {
this.noticeContent = result.noticeContent this.noticeContent = result.noticeContent
} }
setTimeout(() => { setTimeout(() => {
this.$nextTick(()=>{
vant.Toast.clear() vant.Toast.clear()
})
}, 0); }, 0);
}) })
}, },
......
...@@ -65,7 +65,9 @@ window.addEventListener("load", function() { ...@@ -65,7 +65,9 @@ window.addEventListener("load", function() {
} }
this.loading = false this.loading = false
setTimeout(() => { setTimeout(() => {
this.$nextTick(()=>{
vant.Toast.clear() vant.Toast.clear()
})
}, 0); }, 0);
this.$nextTick(()=>{ this.$nextTick(()=>{
// 滚动条跳转位置 // 滚动条跳转位置
......
...@@ -116,7 +116,9 @@ window.addEventListener("load", function() { ...@@ -116,7 +116,9 @@ window.addEventListener("load", function() {
// 隐患状态 成功和待验证 则不允许编辑 // 隐患状态 成功和待验证 则不允许编辑
this.disabled = this.form.hdStatus === 1 || this.form.hdStatus === 3 this.disabled = this.form.hdStatus === 1 || this.form.hdStatus === 3
setTimeout(() => { setTimeout(() => {
this.$nextTick(()=>{
vant.Toast.clear() vant.Toast.clear()
})
}, 0); }, 0);
} }
......
...@@ -63,7 +63,9 @@ window.addEventListener("load", function() { ...@@ -63,7 +63,9 @@ window.addEventListener("load", function() {
} }
this.loadFlag = false this.loadFlag = false
setTimeout(() => { setTimeout(() => {
this.$nextTick(()=>{
vant.Toast.clear() vant.Toast.clear()
})
}, 0); }, 0);
// console.log('响应结束',this.total, this.list.length) // console.log('响应结束',this.total, this.list.length)
this.$nextTick(()=>{ this.$nextTick(()=>{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment