ソースを参照

1.修改个人作品样式2.区别个人页面官方作品

bayi 2 年 前
コミット
eb6116ffef

+ 0 - 1
pages/childClassify/index.less

@@ -156,7 +156,6 @@
 
       .goRead {
         padding: 6rpx 28rpx 8rpx;
-        // width: 300rpx;
         color: white;
         font-size: 32rpx;
         background-image: linear-gradient(270deg, #33C3FF 0%, #81C7FF 100%, #14C962 100%);

+ 15 - 4
pages/personal/index.js

@@ -45,10 +45,15 @@ Page({
   },
   // 关注
   async setFans() {
+    if (this.data.userInfo.user.uid == wx.getStorageSync('uid')) {
+      return wx.showToast({
+        title: '不可以关注自己哦~',
+        icon: 'none'
+      })
+    }
     let newLike = !this.data.userInfo.like
     let res = await setFans({
       uid: this.data.userInfo.user.uid,
-      // fanId:
     }, 'put')
     console.log(res);
     this.setData({
@@ -62,8 +67,14 @@ Page({
   toPkPage({
     currentTarget
   }) {
-    wx.navigateTo({
-      url: `/pages/pkPage/index?videoId=${currentTarget.dataset.id}`
-    })
+    if (this.data.userInfo.user.profession == '官方') {
+      wx.navigateTo({
+        url: `/pages/reading/index?videoId=${currentTarget.dataset.id}`
+      })
+    } else {
+      wx.navigateTo({
+        url: `/pages/pkPage/index?videoId=${currentTarget.dataset.id}`
+      })
+    }
   },
 })

+ 20 - 18
pages/personal/index.less

@@ -136,27 +136,28 @@
       display: flex;
       align-items: center;
       justify-content: space-between;
-      padding: 26rpx 20rpx;
+      padding: 8rpx 12rpx;
       box-sizing: border-box;
       background-color: white;
       border-radius: 20rpx;
       margin-bottom: 20rpx;
 
+
       .left {
         display: flex;
         align-items: center;
         justify-content: space-between;
 
         .cover {
-          width: 144rpx;
-          height: 80rpx;
+          width: 230rpx;
+          height: 128rpx;
           border-radius: 8rpx;
         }
 
         .audioCover {
           position: relative;
-          width: 144rpx;
-          height: 80rpx;
+          width: 230rpx;
+          height: 128rpx;
           display: flex;
           align-items: center;
           justify-content: center;
@@ -166,34 +167,35 @@
           background-position: center;
 
           .audioPlayBg {
-            width: 70rpx;
-            height: 70rpx;
+            width: 100rpx;
+            height: 100rpx;
           }
 
           .audioPlayZhen {
             position: absolute;
-            right: 32rpx;
-            top: 12rpx;
-            width: 16rpx;
-            height: 22rpx;
+            right: 52rpx;
+            top: 20rpx;
+            width: 24rpx;
+            height: 30rpx;
           }
 
           .cover {
             position: absolute;
-            width: 60rpx;
-            height: 60rpx;
+            width: 84rpx;
+            height: 84rpx;
             border-radius: 50%;
           }
         }
 
         .work {
-          margin-left: 26rpx;
+          margin-left: 16rpx;
+
 
           .title {
-            max-width: 310rpx;
-            font-size: 28rpx;
+            width: 270rpx;
+            font-size: 34rpx;
             font-weight: bold;
-            margin-bottom: 10rpx;
+            margin-bottom: 12rpx;
           }
 
           .statistics {
@@ -222,7 +224,7 @@
       }
 
       .goRead {
-        padding: 6rpx 32rpx 8rpx;
+        padding: 6rpx 28rpx 8rpx;
         color: white;
         font-size: 32rpx;
         background-image: linear-gradient(270deg, #33C3FF 0%, #81C7FF 100%, #14C962 100%);

+ 3 - 1
pages/personal/index.wxml

@@ -77,7 +77,9 @@
             </view>
           </view>
         </view>
-        <view class="goRead" data-id="{{item.userRead.id}}" bindtap="toPkPage">挑战PK</view>
+        <view class="goRead" data-id="{{item.userRead.id}}" bindtap="toPkPage">
+          {{userInfo.user.profession=='官方'?'去朗读':'挑战PK'}}
+        </view>
       </view>
     </scroll-view>
   </view>

+ 18 - 18
pages/personal/index.wxss

@@ -116,7 +116,7 @@
   display: flex;
   align-items: center;
   justify-content: space-between;
-  padding: 26rpx 20rpx;
+  padding: 8rpx 12rpx;
   box-sizing: border-box;
   background-color: white;
   border-radius: 20rpx;
@@ -128,14 +128,14 @@
   justify-content: space-between;
 }
 .personalBox .worksList .worksBox .left .cover {
-  width: 144rpx;
-  height: 80rpx;
+  width: 230rpx;
+  height: 128rpx;
   border-radius: 8rpx;
 }
 .personalBox .worksList .worksBox .left .audioCover {
   position: relative;
-  width: 144rpx;
-  height: 80rpx;
+  width: 230rpx;
+  height: 128rpx;
   display: flex;
   align-items: center;
   justify-content: center;
@@ -145,30 +145,30 @@
   background-position: center;
 }
 .personalBox .worksList .worksBox .left .audioCover .audioPlayBg {
-  width: 70rpx;
-  height: 70rpx;
+  width: 100rpx;
+  height: 100rpx;
 }
 .personalBox .worksList .worksBox .left .audioCover .audioPlayZhen {
   position: absolute;
-  right: 32rpx;
-  top: 12rpx;
-  width: 16rpx;
-  height: 22rpx;
+  right: 52rpx;
+  top: 20rpx;
+  width: 24rpx;
+  height: 30rpx;
 }
 .personalBox .worksList .worksBox .left .audioCover .cover {
   position: absolute;
-  width: 60rpx;
-  height: 60rpx;
+  width: 84rpx;
+  height: 84rpx;
   border-radius: 50%;
 }
 .personalBox .worksList .worksBox .left .work {
-  margin-left: 26rpx;
+  margin-left: 16rpx;
 }
 .personalBox .worksList .worksBox .left .work .title {
-  max-width: 310rpx;
-  font-size: 28rpx;
+  width: 270rpx;
+  font-size: 34rpx;
   font-weight: bold;
-  margin-bottom: 10rpx;
+  margin-bottom: 12rpx;
 }
 .personalBox .worksList .worksBox .left .work .statistics {
   display: flex;
@@ -190,7 +190,7 @@
   color: #666666;
 }
 .personalBox .worksList .worksBox .goRead {
-  padding: 6rpx 32rpx 8rpx;
+  padding: 6rpx 28rpx 8rpx;
   color: white;
   font-size: 32rpx;
   background-image: linear-gradient(270deg, #33C3FF 0%, #81C7FF 100%, #14C962 100%);