|
@@ -1,12 +1,24 @@
|
|
|
<template>
|
|
|
- <div class="section-loading" v-show="progress != 100">
|
|
|
+ <div class="section-loading">
|
|
|
+ <div class="section1-wwbox">
|
|
|
+ <img src="/img/section1/section1-ww.webp" alt="" class="fadeIn">
|
|
|
+ <div class="title2 fadeIn"></div>
|
|
|
+ <div>
|
|
|
+ <div class="icon">
|
|
|
+ <img src="./img/webp/wsicon.webp" alt="">
|
|
|
+ </div>
|
|
|
+ <p id="progress-bar"><span>{{ progress }}</span>%</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- <div class="loading">
|
|
|
<div class="section1-wwbox">
|
|
|
- <!-- <div class="icon">
|
|
|
+ <div class="icon">
|
|
|
<img src="/img/webp/wsicon-sec.webp" alt="" />
|
|
|
- </div> -->
|
|
|
- <p id="progress-bar"><span>{{ progress }}</span>%</p>
|
|
|
+ </div>
|
|
|
+ <p class="text" id="progress-bar"><span>{{ progress }}</span>%</p>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
@@ -24,20 +36,19 @@ const framePro = ref(0)
|
|
|
const imgPro = ref(0)
|
|
|
emitter.on("updatePress", (val) => {
|
|
|
framePro.value = val * 0.7
|
|
|
- progress.value = framePro.value + imgPro.value
|
|
|
+ progress.value = Math.round(framePro.value + imgPro.value)
|
|
|
});
|
|
|
// 总任务
|
|
|
function loadImages(list){
|
|
|
- const pageSize = 5
|
|
|
+ const pageSize = 1
|
|
|
let pageNum = 0 ,totalNum = list.length;
|
|
|
return new Promise((reslove,reject)=>{
|
|
|
function run(){
|
|
|
Promise.all(genetateTasks(list,pageSize,pageNum)).then(()=>{
|
|
|
- console.log('pageNum', pageNum, list.length);
|
|
|
pageNum++
|
|
|
const hasLength = pageSize * pageNum
|
|
|
imgPro.value = Math.round((hasLength/(list.length + 1))*30)
|
|
|
- progress.value = framePro.value + imgPro.value
|
|
|
+ progress.value = Math.round(framePro.value + imgPro.value)
|
|
|
if(totalNum > hasLength){
|
|
|
run()
|
|
|
}else {
|
|
@@ -51,7 +62,6 @@ function genetateTasks(list,pageSize,pageNum){
|
|
|
const promiseArr = []
|
|
|
const start = pageNum * pageSize
|
|
|
const end = (pageNum + 1) * pageSize - 1
|
|
|
- console.log('genetateTasks', pageSize,pageNum);
|
|
|
// progress.value =
|
|
|
for(let i = start;i<end;i++){
|
|
|
const p = new Promise((reslove,reject)=>{
|
|
@@ -67,6 +77,17 @@ function genetateTasks(list,pageSize,pageNum){
|
|
|
// emitter.emit("preBaseLoadingdone");
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
+@import "/src/assets/style/index.css";
|
|
|
+.icon {
|
|
|
+ width: 25px;
|
|
|
+ height: 25px;
|
|
|
+ img {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+}
|
|
|
+.text{
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
.scroll-icon {
|
|
|
opacity: 1;
|
|
|
z-index: 10;
|