From 0f4ba510ad7f5377ecce7fe57c3a9656311c6da5 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Wed, 21 Apr 2021 08:58:07 +0800 Subject: [PATCH] 1. 白屏的bug优化 --- components/full_screen/full_screen.js | 32 +++++++++----------------------- components/full_screen/full_screen.wxml | 1 - components/full_screen/full_screen.wxss | 2 -- pages/index/index/index.js | 17 ++++++++++++++--- pages/index/index/index.wxml | 14 +++++++------- pages/index/index/index.wxss | 12 +++++++++++- 6 files changed, 41 insertions(+), 37 deletions(-) diff --git a/components/full_screen/full_screen.js b/components/full_screen/full_screen.js index a38f198..81f7d8f 100644 --- a/components/full_screen/full_screen.js +++ b/components/full_screen/full_screen.js @@ -21,28 +21,23 @@ Component({ clearInterval(this.data.full_screen); }, }, - - ready: function () { - var th=this; - setTimeout(function(){ - th.setData({hidden:1,}) - },2600) - }, - + + ready: function () {}, properties: {}, methods: { close_full_screen(){ - this.setData({is_full_screen_show:0,sec_show:0,is_full_screen_men:0}); + this.setData({is_full_screen_show:0,sec_show:0}); }, //-- 跳转到满屏广告的链接 -- go_full_ad(){ if(!this.data.full_ad) return false; if(!this.data.full_ad.ad_weapplink) return false; getApp().goto(this.data.full_ad.ad_weapplink); - this.setData({is_full_screen_show:0,is_full_screen_men:0}); }, get_the_full_screen(){ - if(this.data.full_ad) return false; + if(this.data.full_ad) { + return false; + } var th=this; //获取全屏的广告 getApp().request.promiseGet("/api/weshop/ad/page?pid=1001&store_id=" + o.stoid,{ @@ -53,8 +48,7 @@ Component({ th.setData({ is_full_screen_show:1, full_ad:res.data.data.pageData[0], - }) - + }) //--定时关闭-- th.data.full_screen=setInterval(function(){ if(!th.data.sec_show) { @@ -65,16 +59,8 @@ Component({ th.data.sec_show--; th.setData({sec_show:th.data.sec_show}); },1000) - - - setTimeout(function(){ - th.setData({is_full_screen_men:0}); - },1000) - }else{ - th.setData({ - is_full_screen_men:0 - }) - } + + } }) } }, diff --git a/components/full_screen/full_screen.wxml b/components/full_screen/full_screen.wxml index 4ba3a6f..ce01065 100644 --- a/components/full_screen/full_screen.wxml +++ b/components/full_screen/full_screen.wxml @@ -1,5 +1,4 @@ - 跳过 {{sec_show}} diff --git a/components/full_screen/full_screen.wxss b/components/full_screen/full_screen.wxss index f6dde99..f5220b9 100644 --- a/components/full_screen/full_screen.wxss +++ b/components/full_screen/full_screen.wxss @@ -8,8 +8,6 @@ background-size: 100% 100%; background-repeat: no-repeat; } - - .skip_box{ float: right; margin-top: 10rpx; margin-right: 10rpx; background-color: gainsboro; width: 120rpx; diff --git a/pages/index/index/index.js b/pages/index/index/index.js index d21cf3a..8c35f1e 100644 --- a/pages/index/index/index.js +++ b/pages/index/index/index.js @@ -253,8 +253,20 @@ Page({ //有加载过一次首页,就显示 if(show || userInfo || getApp().globalData.user_id){ - var full_screen = th.selectComponent("#full_screen"); //组件的id - full_screen.get_the_full_screen(); + setTimeout(function(){ + var full_screen = th.selectComponent("#full_screen"); //组件的id + full_screen.get_the_full_screen(); + },660) + //动画效果 + if(!th.data.f_hidden){ + wx.showLoading({ + title:'加载中..' + }); + setTimeout(function(){ + th.setData({f_hidden:1}) + wx.hideLoading(); + },800) + } }else{ getApp().globalData.isLoad_ad=1; } @@ -371,7 +383,6 @@ Page({ flash_data = e.data.data.pageData; if (flash_data == null || flash_data.length <= 0) return false; - //当前时间戳 var nt = ut.gettimestamp(); diff --git a/pages/index/index/index.wxml b/pages/index/index/index.wxml index 8ec31dd..c89ff3a 100644 --- a/pages/index/index/index.wxml +++ b/pages/index/index/index.wxml @@ -1,7 +1,10 @@ - - + + + + + @@ -390,6 +393,8 @@ + + @@ -417,8 +422,6 @@ - - @@ -426,9 +429,6 @@ - - - diff --git a/pages/index/index/index.wxss b/pages/index/index/index.wxss index 1d5ed89..b28ea57 100644 --- a/pages/index/index/index.wxss +++ b/pages/index/index/index.wxss @@ -966,4 +966,14 @@ page { /* transform: translateY(-50%); */ z-index: 10000; } -.dis_top{position: fixed; top: 0; left: 0; width: 100%; z-index: 100000;} \ No newline at end of file +.dis_top{position: fixed; top: 0; left: 0; width: 100%; z-index: 100000;} +.full_screen{ + position: fixed;left: 0;top: 0; + z-index: 1000000000000; + background-color: rgba(0,0,0,0.4); + width: 100%; + height: 100%; + background-position: center; + background-size: 100% 100%; + background-repeat: no-repeat; +} -- libgit2 0.21.4