Browse Source

优化小程序

bayi 2 năm trước cách đây
mục cha
commit
801f103acb

+ 13 - 3
components/navigationBar/index.js

@@ -45,6 +45,7 @@ Component({
         timer = setInterval(() => {
           if (this.data.userInfo.uid && !this.data.userInfo.grade) {
             this.showGrade()
+            clearInterval(timer)
           } else if (this.data.userInfo.uid && this.data.userInfo.grade) {
             clearInterval(timer)
           }
@@ -63,6 +64,11 @@ Component({
       this.setData({
         isGradeShow: false,
       })
+      if (typeof this.getTabBar === 'function') {
+        this.getTabBar().setData({
+          mask: false
+        })
+      }
     },
     // 选择年级
     selectGrade({
@@ -77,6 +83,11 @@ Component({
       })
     },
     showGrade() {
+      if (typeof this.getTabBar === 'function') {
+        this.getTabBar().setData({
+          mask: true
+        })
+      }
       if (this.data.isGradeShow) {
         return
       }
@@ -95,13 +106,12 @@ Component({
           duration: 2000
         })
       }
-      this.setData({
-        isGradeShow: false,
-      })
       let res = await setUserInfo({
         grade
       }, 'put')
+      console.log(res);
       this.setUser(res)
+      this.closeGrade()
       setTimeout(() => {
         this.triggerEvent('reload')
       }, 300)

+ 1 - 0
custom-tab-bar/index.js

@@ -26,6 +26,7 @@ Component({
     selected: 0,
     color: "#999999",
     selectedColor: "#32CA69",
+    mask:false,
     listTab: [{
       "pagePath": "/pages/index/index",
       "text": "推荐",

+ 10 - 2
custom-tab-bar/index.less

@@ -5,10 +5,9 @@
   right: 0;
   background: white;
   display: flex;
-  border-top: 1rpx solid rgba(0, 0, 0, 0.1);
   box-sizing: border-box;
   padding: 14rpx 0rpx;
-  padding-bottom: env(safe-area-inset-bottom);
+  padding-bottom: calc(env(safe-area-inset-bottom) + 14rpx);
   box-shadow: rgba(0, 0, 0, 0.35) 0px 30rpx 20rpx 20rpx;
 
   .tab-bar-item {
@@ -44,4 +43,13 @@
       margin-top: 10rpx;
     }
   }
+
+  .mask {
+    position: absolute;
+    top: 0rpx;
+    width: 100%;
+    height: 100%;
+    z-index: 9;
+    background: rgba(0, 0, 0, 0.7);
+  }
 }

+ 1 - 0
custom-tab-bar/index.wxml

@@ -1,4 +1,5 @@
 <view class="tab-bar">
+  <view class="mask" wx:if="{{mask}}"></view>
   <view wx:for="{{listTab}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}"
     bindtap="switchTab">
     <view class="noticeTips" wx:if="{{item.pagePath=='/pages/my/index'&&userInfo.myCount>0}}">

+ 9 - 2
custom-tab-bar/index.wxss

@@ -5,10 +5,9 @@
   right: 0;
   background: white;
   display: flex;
-  border-top: 1rpx solid rgba(0, 0, 0, 0.1);
   box-sizing: border-box;
   padding: 14rpx 0rpx;
-  padding-bottom: env(safe-area-inset-bottom);
+  padding-bottom: calc(env(safe-area-inset-bottom) + 14rpx);
   box-shadow: rgba(0, 0, 0, 0.35) 0px 30rpx 20rpx 20rpx;
 }
 .tab-bar .tab-bar-item {
@@ -41,3 +40,11 @@
   font-size: 28rpx;
   margin-top: 10rpx;
 }
+.tab-bar .mask {
+  position: absolute;
+  top: 0rpx;
+  width: 100%;
+  height: 100%;
+  z-index: 9;
+  background: rgba(0, 0, 0, 0.7);
+}

+ 1 - 1
pages/comment/index.wxml

@@ -9,7 +9,7 @@
       <view class="reply" data-id="{{item.posts.id}}" catchtap="setReply">回复评论</view>
     </view>
     <image src="{{item.userRead.coverImg}}" class="cover" wx:if="{{item.userRead.resourcesType==0}}" />
-    <view class="audioCover" style="background-image: url({{item.backgroundVirtualImg}});" wx:else>
+    <view class="audioCover" style="background-image: url({{item.userRead.backgroundVirtualImg}});" wx:else>
       <image src="/static/audioBg.png" class="audioPlayBg" />
       <image src="/static/zhen.png" class="audioPlayZhen" />
       <image src="{{item.userRead.coverImg}}" class="cover" />

+ 5 - 5
pages/index/index.js

@@ -54,11 +54,11 @@ Page({
     }
   },
   onShow() {
-    if (typeof this.getTabBar === 'function') {
-      this.getTabBar().setData({
-        selected: 0
-      })
-    }
+    /*  if (typeof this.getTabBar === 'function') {
+       this.getTabBar().setData({
+         selected: 0
+       })
+     } */
   },
   onUnload() {
     this.storeBindings.destroyStoreBindings()

+ 1 - 1
pages/like/index.wxml

@@ -8,7 +8,7 @@
       </view>
     </view>
     <image src="{{item.userRead.coverImg}}" class="cover" wx:if="{{item.userRead.resourcesType==0}}" />
-    <view class="audioCover" style="background-image: url({{item.backgroundVirtualImg}});" wx:else>
+    <view class="audioCover" style="background-image: url({{item.userRead.backgroundVirtualImg}});" wx:else>
       <image src="/static/audioBg.png" class="audioPlayBg" />
       <image src="/static/zhen.png" class="audioPlayZhen" />
       <image src="{{item.userRead.coverImg}}" class="cover" />

BIN
static/activity.png


BIN
static/activity2.png


BIN
static/message.png


BIN
static/message2.png


BIN
static/my.png


BIN
static/my2.png


BIN
static/tj.png


BIN
static/tj2.png


BIN
static/zp.png


BIN
static/zp2.png