Pārlūkot izejas kodu

优化加载速度

master
yangteng pirms 8 mēnešiem
vecāks
revīzija
565760a20f
1 mainītis faili ar 16 papildinājumiem un 12 dzēšanām
  1. 16
    12
      pages/index/index.vue

+ 16
- 12
pages/index/index.vue Parādīt failu

@@ -165,7 +165,7 @@
} from "vue";
import {
onPageScroll,
onLoad, onReachBottom
onLoad, onReachBottom,onReady
} from "@dcloudio/uni-app";
import flowPathList from "./components/flow-path-list.vue";
import filter from '@/components/filter/filter.vue';
@@ -278,10 +278,14 @@
onLoad((options) => {
console.log("wechatSignNo",options)
getInfo();
quanKeyAction().then((val : any) => {
setItem('key', val.dictTypeAndItem)
})
})
// 页面初次渲染完成时触发
onReady(()=>{
setTimeout(()=>{
quanKeyAction()
},5000)
})

onMounted(() => {
uni.getSystemInfo({
success: (e : any) => {
@@ -339,15 +343,15 @@
method: "POST",
showLoading: true,
};

return new Promise(async (resolve, reject) => {
const res = await request(queryKey, options);
const data = stringToJson(res.bizContent);
resolve(data);
}).catch((error) => {
reject(error);
request(queryKey, options).then((res) => {
console.log(stringToJson(res.bizContent));
const data = stringToJson(res.bizContent)
console.log("轮播图", data)
setItem('key', data.dictTypeAndItem)
})
.catch((err) => {
console.log(err);
});

}



Notiek ielāde…
Atcelt
Saglabāt