Commit e0e714f2 by 李伟康

增加加载动画

1 parent 5e74ee83
...@@ -229,7 +229,6 @@ Component({ ...@@ -229,7 +229,6 @@ Component({
/**页面初始化 */ /**页面初始化 */
async init() { async init() {
thisPage = wx.$router.getPageInstance() thisPage = wx.$router.getPageInstance()
wx.$api.showLoading()
try { try {
const { const {
data, data,
......
...@@ -25,7 +25,6 @@ Page({ ...@@ -25,7 +25,6 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
wx.$api.showLoading()
wx.hideHomeButton({ wx.hideHomeButton({
success: res => { success: res => {
wx.hideLoading() wx.hideLoading()
......
...@@ -33,14 +33,12 @@ Page({ ...@@ -33,14 +33,12 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
wx.$api.showLoading()
const sessionId = getSessionId(), const sessionId = getSessionId(),
{ {
url, url,
targetPath = url ? decodeURIComponent(url) : '' targetPath = url ? decodeURIComponent(url) : ''
} = this.options } = this.options
wx.nextTick(() => { wx.nextTick(() => {
wx.hideLoading()
let path = 'pages.index', let path = 'pages.index',
obj = {} obj = {}
if (targetPath) obj.targetPath = targetPath if (targetPath) obj.targetPath = targetPath
......
{ {
"usingComponents": {} "usingComponents": {},
"navigationStyle": "custom"
} }
\ No newline at end of file \ No newline at end of file
.layout{ .layout {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
display: grid; display: grid;
place-items: center; place-items: center;
.icon{
width: 480rpx; .loading {
height: 480rpx; height: 48rpx;
view {
width: 16rpx;
height: 100%;
display: inline-block;
background-color: #0052d9;
animation: stretchdelay 1.2s infinite ease-in-out;
margin: 0 4rpx;
&:nth-child(2) {
animation-delay: -1.1s;
}
&:nth-child(3) {
animation-delay: -1s;
}
&:nth-child(4) {
animation-delay: -.9s;
}
}
} }
} }
@keyframes stretchdelay {
0%,
100%,
40% {
transform: scaley(.33);
}
20% {
transform: scaley(1);
}
}
\ No newline at end of file \ No newline at end of file
<view class="layout"> <view class="layout">
<!-- <image class="icon" src="https://img02.glsx.com.cn/weapp/resource/scrm-mobile/crowdfunding/COVER_LIVE.gif"></image> --> <view class="loading">
<block wx:for="{{4}}" wx:key="index">
<view></view>
</block>
</view>
</view> </view>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!