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

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

onMounted(() => { onMounted(() => {
uni.getSystemInfo({ uni.getSystemInfo({
success: (e : any) => { success: (e : any) => {
method: "POST", method: "POST",
showLoading: true, 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