优化提升页面加载速度

This commit is contained in:
weipengfei 2023-08-30 16:50:35 +08:00
parent b1f7a48310
commit 27dca505a1
3 changed files with 24 additions and 14 deletions

View File

@ -114,7 +114,7 @@
"nativePlugins" : { "nativePlugins" : {
"JG-JCore" : { "JG-JCore" : {
"JPUSH_APPKEY_ANDROID" : "5ced5ec5fa7bb86302944f0f", "JPUSH_APPKEY_ANDROID" : "5ced5ec5fa7bb86302944f0f",
"JPUSH_APPKEY_IOS" : "", "JPUSH_APPKEY_IOS" : "5ced5ec5fa7bb86302944f0f",
"JPUSH_CHANNEL_ANDROID" : "", "JPUSH_CHANNEL_ANDROID" : "",
"JPUSH_CHANNEL_IOS" : "", "JPUSH_CHANNEL_IOS" : "",
"__plugin_info__" : { "__plugin_info__" : {

View File

@ -193,14 +193,14 @@
methods: { methods: {
navTo(url) { navTo(url) {
if (url) { if (url) {
uni.showLoading({ uni.showLoading({
title: '加载中', title: '加载中',
mask: true mask: true
}) })
uni.navigateTo({ uni.navigateTo({
url: url, url: url,
success() { success() {
uni.hideLoading() uni.hideLoading();
} }
}) })
} else Toast('暂未开放'); } else Toast('暂未开放');

View File

@ -370,14 +370,15 @@
data_type: '1', data_type: '1',
datas: [] datas: []
}, },
datasList: [], //
listloging: true,
} }
}, },
onLoad(options) { onLoad(options) {
this.initInformationDetails({ this.initInformationDetails({
id: options.id id: options.id
}); });
this.initMap(); // this.initMap();
}, },
onShow() {}, onShow() {},
computed: { computed: {
@ -400,18 +401,27 @@
}, },
async initInformationDetails(id) { async initInformationDetails(id) {
let res = await informationDetails(id); let res = await informationDetails(id);
this.$u.sleep(100).then(() => { Object.keys(res.data).forEach(key => {
this.skeleton = false; if(key!='datas')this.formData[key] = res.data[key];
Object.keys(res.data).forEach(key => { })
this.formData[key] = res.data[key]; this.skeleton = false;
}) this.datasList = res.data['datas'];
})
}, },
toastShow() { toastShow() {
Toast('不可修改') Toast('不可修改')
}, },
changeCurrent(e) { changeCurrent(e) {
this.current = e.index; this.current = e.index;
if(e.index==1&&this.listloging){
uni.showLoading({
title: '加载中'
})
this.formData.datas = [...this.datasList];
this.$nextTick(()=>{
uni.hideLoading();
this.listloging = false;
})
}
}, },
updateTo(time) { updateTo(time) {
return getTimeAgo(time) return getTimeAgo(time)