Forráskód Böngészése

完善作品其他朗读作品页面

bayi 2 éve
szülő
commit
c2f04849fb

+ 5 - 2
components/videoPreview/index.js

@@ -41,6 +41,7 @@ Component({
         this.setData({
           videoInfoCopy: newVal,
           videoPath: newVal.userRead.videoPath,
+          selfWork: this.data.selfUid == newVal.user.uid,
           isOfficial: newVal.userRead.type != 'APP_EXAMPLE'
         })
       }
@@ -69,7 +70,9 @@ Component({
     //userRead.videoPath 和 example.videoPath,
     workType: 'videoPath',
     // 是否官方作品
-    isOfficial: false
+    isOfficial: false,
+    // 是否作者本人
+    selfWork: false
   },
   lifetimes: {
     attached() {
@@ -267,7 +270,7 @@ Component({
       let readId = videoInfo.userRead.id
       let videoType = this.properties.videoType
       let url = ''
-      if (!this.data.isOfficial || this.data.selfUid == videoInfo.user.uid) {
+      if (!this.data.isOfficial || this.data.selfWork) {
         // autoPlay自动播放
         url = `/pages/reading/index?videoId=${videoInfo.userRead.exampleId}&autoPlay=true`
       } else if (videoType == 'public' || videoType == 'follow') {

+ 3 - 3
components/videoPreview/index.wxml

@@ -28,7 +28,7 @@
         </view>
       </view>
     </view>
-    <view class="wH-right" wx:elif="{{videoType=='public'&&selfUid!=videoInfoCopy.user.uid}}">
+    <view class="wH-right" wx:elif="{{videoType=='public'&&!selfWork}}">
       <view class="follow {{videoInfoCopy.isFans?'isFans':''}}" bindtap="setFans">
         <image src="{{videoInfoCopy.isFans?'/static/follow_2.png':'/static/follow_1.png'}}" class="character" mode="" />
         <text class="text">{{videoInfoCopy.isFans?'已关注':'关注'}}</text>
@@ -61,7 +61,7 @@
     <!-- 播放时渲染的video -->
     <video class="video" id="myVideo" wx:if="{{videoInfoCopy.userRead.id==currentId}}"
       src="{{workType=='videoPath'? videoInfoCopy.userRead.videoPath:videoInfoCopy.example.videoPath}}" autoplay="true"
-      object-fit="contain" >
+      object-fit="contain">
     </video>
   </view>
   <!-- 音频 -->
@@ -110,7 +110,7 @@
     </view>
   </view>
   <view class="pkPageBtns" style="justify-content:{{videoType!='pk'?'center':'space-between'}}"
-    wx:if="{{videoType!='my'}}">
+    wx:if="{{videoType!='my'&&!selfWork}}">
     <view class="toReading" style="background-color: #00C657;" bindtap="changeRead"
       wx:if="{{videoInfoCopy.userRead.type=='READ'&&videoType=='pk'}}">
       <image src="/static/aPlay.png" class="reading" />

+ 1 - 0
pages/otherWork/index.js

@@ -1,3 +1,4 @@
+import share from '~/mixins/share'
 import {
   getUserReadByExampleId
 } from '~/api/works'