Browse Source

1.调整自动播放的位置2.调整用户主页样式3.快速滚动音频不播放问题

bayi 2 years ago
parent
commit
3450f84a9e

+ 1 - 1
components/videoPreview/index.js

@@ -47,7 +47,7 @@ Component({
       value: 'public'
     },
     currentId: {
-      type: Number,
+      type: Number
     }
   },
   data: {

+ 0 - 1
components/videoPreview/index.wxml

@@ -40,7 +40,6 @@
   </view>
   <!-- 视频 -->
   <view class="workContent" wx:if="{{!videoInfoCopy.userReadExtend||videoInfoCopy.userReadExtend.resourcesType==0}}">
-
     <!-- 审核中遮罩 -->
     <view class="videoBox" wx:if="{{videoInfoCopy.userRead.status=='CHECK'&&videoInfoCopy.userRead.id!=currentId}}">
       <view class="maskBg"></view>

+ 3 - 1
components/worksList/index.js

@@ -3,6 +3,7 @@ import {
   submitPlayLog
 } from '~/api/video'
 let _observer
+let preId = ''
 Component({
   behaviors: [behavior],
   properties: {
@@ -21,7 +22,8 @@ Component({
           this._observer.relativeTo('.playLine')
             .observe('.videoPreview', (res) => {
               let intersectionRatio = res.intersectionRatio
-              if (intersectionRatio > 0) {
+              if (intersectionRatio > 0 && preId != res.dataset.id) {
+                preId = res.dataset.id
                 submitPlayLog({
                   userReadId: res.dataset.id,
                   playStopTime: 1000

+ 1 - 0
components/worksList/index.less

@@ -3,6 +3,7 @@
 
   .playLine {
     position: fixed;
+    top: 60%;
     z-index: 999;
     width: 100%;
     height: 1rpx;

+ 1 - 0
components/worksList/index.wxss

@@ -3,6 +3,7 @@
 }
 .worksList .playLine {
   position: fixed;
+  top: 60%;
   z-index: 999;
   width: 100%;
   height: 1rpx;

+ 0 - 2
mixins/video.js

@@ -13,7 +13,6 @@ module.exports = Behavior({
     playVideo({
       currentTarget
     }) {
-      console.log('zzz');
       this.setData({
         currentId: currentTarget.dataset.id
       })
@@ -56,7 +55,6 @@ module.exports = Behavior({
     },
     // 分享
     creatShare(video) {
-      console.log(video);
       return new Promise((resolve, reject) => {
         let context = wx.createSelectorQuery();
         context

+ 4 - 3
pages/personal/index.js

@@ -14,7 +14,8 @@ Page({
     uid: '',
     userInfo: {},
     // type为pk,顶部显示为pk时样式,user为默认样式
-    type: 'user'
+    type: 'user',
+    uid: wx.getStorageSync('uid')
   },
   /**
    * 生命周期函数--监听页面加载
@@ -45,7 +46,7 @@ Page({
   },
   // 关注
   async setFans() {
-    if (this.data.userInfo.user.uid == wx.getStorageSync('uid')) {
+    if (this.data.userInfo.user.uid == this.data.uid) {
       return wx.showToast({
         title: '不可以关注自己哦~',
         icon: 'none'
@@ -67,7 +68,7 @@ Page({
   toPkPage({
     currentTarget
   }) {
-    if (this.data.userInfo.user.profession == '官方') {
+    if (this.data.userInfo.user.profession == '官方' || this.data.userInfo.user.uid == this.data.uid) {
       wx.navigateTo({
         url: `/pages/reading/index?videoId=${currentTarget.dataset.id}`
       })

+ 2 - 2
pages/personal/index.wxml

@@ -8,7 +8,7 @@
     <view class="userRight">
       <view class="uRtop">
         <view class="uRtopleft">
-          <view class="nickName textOver">{{userInfo.user.nickName||'请输入昵称' }}</view>
+          <view class="nickName textOver">{{userInfo.user.nickName||userInfo.user.eid }}</view>
           <view class="gradeText textOver">学号:{{userInfo.user.eid}}</view>
         </view>
         <view class="follow {{userInfo.like?'isFans':''}}" bindtap="setFans">
@@ -78,7 +78,7 @@
           </view>
         </view>
         <view class="goRead" data-id="{{item.userRead.id}}" bindtap="toPkPage">
-          {{userInfo.user.profession=='官方'?'去朗读':'挑战PK'}}
+          {{userInfo.user.profession=='官方'||userInfo.user.uid==uid?'去朗读':'挑战PK'}}
         </view>
       </view>
     </scroll-view>