first commit
This commit is contained in:
1
衣莎项目/源码/YiShaXiYi/component/loading-prog/.pydio
Normal file
1
衣莎项目/源码/YiShaXiYi/component/loading-prog/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
8560d1d5-f21b-4e20-bcee-6284751a16e3
|
||||
52
衣莎项目/源码/YiShaXiYi/component/loading-prog/loading-prog.js
Normal file
52
衣莎项目/源码/YiShaXiYi/component/loading-prog/loading-prog.js
Normal file
@@ -0,0 +1,52 @@
|
||||
// component/loading-prog/loading-prog.js
|
||||
const app = getApp();
|
||||
Component({
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
isLoading: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
loadProgress: 0,
|
||||
system: app.globalData.system, //设备相关信息
|
||||
},
|
||||
/**
|
||||
* 在组件实例刚刚被创建时执行
|
||||
*/
|
||||
created() {
|
||||
this.loadProgress()
|
||||
},
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
// 加载动画
|
||||
loadProgress() {
|
||||
this.setData({
|
||||
loadProgress: this.data.loadProgress + 3
|
||||
})
|
||||
if (this.data.loadProgress < 100) {
|
||||
setTimeout(() => {
|
||||
this.loadProgress();
|
||||
}, 70)
|
||||
} else {
|
||||
this.setData({
|
||||
loadProgress: 0
|
||||
})
|
||||
}
|
||||
if (!this.properties.isLoading) {
|
||||
this.setData({
|
||||
loadProgress: 100
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<!-- component/loading-prog/loading-prog.wxml -->
|
||||
<!-- 加载动画 -->
|
||||
<view class='load-progress load-all {{isLoading?"show":"hide"}}' style="top:{{system.statusHeight+system.titleHeight}}px;">
|
||||
<view class='load-progress-bar bg-green' style="transform: translate3d(-{{100-loadProgress}}%, 0px, 0px);"></view>
|
||||
<view class="load-bac"></view>
|
||||
</view>
|
||||
@@ -0,0 +1,3 @@
|
||||
/* component/loading-prog/loading-prog.wxss */
|
||||
@import "../../extend/ColorUI/css/main.wxss";
|
||||
@import "../../css/_main.wxss";
|
||||
Reference in New Issue
Block a user