Browse Source

优化展示效果

bayi 2 years ago
parent
commit
0a17abd8c5

+ 17 - 15
components/empty/index.less

@@ -1,19 +1,21 @@
 .empty {
-    display: flex;
-    flex-direction: column;
-    justify-content: center;
-    align-items: center;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
 
-    .nullImg {
-        // margin-top: 250rpx;
-        width: 364rpx;
-        height: 280rpx;
-    }
+  .nullImg {
+    width: 364rpx;
+    height: 280rpx;
+  }
 
-    .message {
-        margin-top: 30rpx;
-        font-size: 32rpx;
-        font-weight: bold;
-        color: #FFB513;
-    }
+  .message {
+    width: 500rpx;
+    text-align: center;
+    margin-top: 30rpx;
+    font-size: 32rpx;
+    line-height: 60rpx;
+    font-weight: bold;
+    color: #FFB513;
+  }
 }

+ 3 - 0
components/empty/index.wxss

@@ -9,8 +9,11 @@
   height: 280rpx;
 }
 .empty .message {
+  width: 500rpx;
+  text-align: center;
   margin-top: 30rpx;
   font-size: 32rpx;
+  line-height: 60rpx;
   font-weight: bold;
   color: #FFB513;
 }

+ 2 - 1
pages/otherWork/index.json

@@ -1,6 +1,7 @@
 {
   "usingComponents": {
-    "worksList": "/components/worksList/index"
+    "worksList": "/components/worksList/index",
+    "emptyBg": "/components/empty/index"
   },
   "navigationBarTitleText": ""
 }

+ 1 - 0
pages/otherWork/index.wxml

@@ -1,4 +1,5 @@
 <view>
   <worksList id="worksList" videoType="follow" worksList="{{list}}" autoPlay='{{false}}' />
   <canvas id='share' type="2d"> </canvas>
+  <emptyBg wx:if="{{text!=''&&nullList}}" message="快来成为第一个朗读的人,让文字在你的声音中跃然生动!"></emptyBg>
 </view>

+ 8 - 6
pages/reading/index.js

@@ -74,12 +74,14 @@ Page({
       title: options.navBarTitle
     })
     this.getreadInfo(videoId, options.reset).then(res => {
-      if (options.voluntarily) {
-        this.setCountDown()
-      }
-      if (options.autoPlay) {
-        this.videoPlay()
-      }
+      wx.nextTick(() => {
+        if (options.voluntarily) {
+          this.setCountDown()
+        }
+        if (options.autoPlay) {
+          this.videoPlay()
+        }
+      })
     })
     this.setData({
       readingReset: options.reset || false,