111 lines
1.8 KiB
Vue
111 lines
1.8 KiB
Vue
<template>
|
|
<view class="mask" v-if="isShow">
|
|
<view class="download-popup-box">
|
|
<view class="hint-text">{{hintText}}</view>
|
|
<view class="loading" style="margin-top: 10px;"></view>
|
|
<view class="progress">{{progress}}%</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: "download-progress",
|
|
props: {
|
|
progress: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
isShow: {
|
|
type: Boolean,
|
|
default: false
|
|
},
|
|
hintText: {
|
|
type: String,
|
|
default: '下载中...'
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
|
|
};
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
.mask {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100vw;
|
|
height: 100vh;
|
|
background-color: rgba(0, 0, 0, 0.2);
|
|
z-index: 9999;
|
|
}
|
|
|
|
.download-popup-box {
|
|
position: fixed;
|
|
top: 50%;
|
|
left: 50%;
|
|
transform: translate(-50%, -50%);
|
|
background-color: white;
|
|
width: 150px;
|
|
height: 150px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
align-items: center;
|
|
border-radius: 10px;
|
|
}
|
|
|
|
.progress {
|
|
margin-top: 10px;
|
|
color: #FE9944;
|
|
}
|
|
|
|
.hint-text {
|
|
font-size: 14px;
|
|
color: black;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.loading {
|
|
position: relative;
|
|
width: 48px;
|
|
height: 48px;
|
|
animation: satellite 3s infinite linear;
|
|
border: 1px solid #FE9944;
|
|
border-radius: 100%;
|
|
}
|
|
|
|
.loading:before,
|
|
.loading:after {
|
|
position: absolute;
|
|
left: 1px;
|
|
top: 1px;
|
|
width: 12px;
|
|
height: 12px;
|
|
content: "";
|
|
border-radius: 100%;
|
|
background-color: #FE9944;
|
|
box-shadow: 0 0 10px #FE9944;
|
|
}
|
|
|
|
.loading:after {
|
|
right: 0;
|
|
width: 20px;
|
|
height: 20px;
|
|
margin: 13px;
|
|
}
|
|
|
|
@keyframes satellite {
|
|
from {
|
|
transform: rotate(0) translateZ(0);
|
|
}
|
|
|
|
to {
|
|
transform: rotate(360deg) translateZ(0);
|
|
}
|
|
}
|
|
</style> |