瀏覽代碼

1.回退到两行文字2.其他

bayi 2 年之前
父節點
當前提交
0c97ee1995

+ 2 - 1
components/activityList/index.js

@@ -7,7 +7,7 @@ Component({
    * 组件的初始数据
    */
   data: {
-      //1:图片,2:邀新榜,3:热播榜,4:挑战pk榜,5,朗读赛,6,领取勋章
+    //1:图片,2:邀新榜,3:热播榜,4:挑战pk榜,5,朗读赛,6,领取勋章
     type: '4',
     activityList: [],
     dsqList: []
@@ -86,6 +86,7 @@ Component({
     activityEvent({
       currentTarget
     }) {
+      console.log(currentTarget.dataset.info);
       //1:图片,2:邀新榜,3:热播榜,4:挑战pk榜,5,朗读赛,6,领取勋章
       let {
         type,

+ 5 - 5
components/activityList/index.wxml

@@ -41,19 +41,19 @@
             <view class="secondUser">
               <image src="{{item.userList[1].avatar||'/static/nullAvatar.png'}}" class="avatar" />
             </view>
-            <view class="nickName textOver">{{item.userList[1].nickName||item.userList[1].eid}}</view>
+            <view class="nickName textOver">{{item.userList[1].nickName||item.userList[1].eid||'等你来占位'}}</view>
           </view>
           <view class="userBox" bindtap="jumpUserInfo" data-uid='{{item.userList[0].uid}}'>
             <view class="firstUser">
               <image src="{{item.userList[0].avatar||'/static/nullAvatar.png'}}" class="avatar" />
             </view>
-            <view class="nickName textOver">{{item.userList[0].nickName||item.userList[0].eid}}</view>
+            <view class="nickName textOver">{{item.userList[0].nickName||item.userList[0].eid||'等你来占位'}}</view>
           </view>
           <view class="userBox" bindtap="jumpUserInfo" data-uid='{{item.userList[2].uid}}'>
             <view class="thirdUser">
               <image src="{{item.userList[2].avatar||'/static/nullAvatar.png'}}" class="avatar" />
             </view>
-            <view class="nickName textOver">{{item.userList[2].nickName||item.userList[2].eid}}</view>
+            <view class="nickName textOver">{{item.userList[2].nickName||item.userList[2].eid||'等你来占位'}}</view>
           </view>
         </view>
         <view class="btm">
@@ -61,7 +61,7 @@
             <image src="{{item.userList[index+3].avatar||'/static/nullAvatar.png'}}" class="avatar"
               bindtap="jumpUserInfo" data-uid='{{item.userList[index+3].uid}}' />
             <view class="nickName textOver">
-              {{item.userList[index+3].nickName||item.userList[index+3].eid||'请你来挑战'}}
+              {{item.userList[index+3].nickName||item.userList[index+3].eid||'等你来占位'}}
             </view>
           </view>
         </view>
@@ -84,7 +84,7 @@
           <view class="left">
             <image src="/static/{{index+1}}-1.png" class="stand" />
             <image src="{{item.userList[index].avatar||'/static/nullAvatar.png'}}" class="avatar" />
-            <view class="nickName textOver">{{item.userList[index].nickName||item.userList[index].eid}}
+            <view class="nickName textOver">{{item.userList[index].nickName||item.userList[index].eid||'等你来占位'}}
             </view>
           </view>
           <view class="right">

+ 1 - 2
components/banner/index.js

@@ -31,12 +31,11 @@ Component({
       //1:图片,2:邀新榜,3:热播榜,4:挑战pk榜,5,朗读赛,6,领取勋章
       let {
         type,
-        id,
         content
       } = currentTarget.dataset
       if ([2, 3, 4].includes(type)) {
         wx.navigateTo({
-          url: `/pages/ranking/index?id=${id}&type=${type}`,
+          url: `/pages/ranking/index?id=${content}&type=${type}`,
         })
       } else if (type == 5) {
         wx.navigateTo({

+ 1 - 1
components/banner/index.wxml

@@ -3,7 +3,7 @@
   <swiper class="swiper" autoplay circular indicator-dots="{{bannerList.length>1}}" indicator-active-color="#fff"
     indicator-color='#ecececa1' current="{{current}}">
     <block wx:for="{{bannerList}}" wx:key="id">
-      <swiper-item bindtap='bannelEvent' data-type='{{item.type}}' data-id="{{item.id}}" data-content="{{item.content}}">
+      <swiper-item bindtap='bannelEvent' data-type='{{item.type}}' data-content="{{item.content}}">
         <image src="{{item.icon}}" class="swiper-item" mode="" />
       </swiper-item>
     </block>

+ 30 - 22
components/videoPreview/index.js

@@ -34,6 +34,14 @@ Component({
     videoInfo: {
       type: Object,
       value: {},
+      observer(newVal) {
+        if (newVal.userReadExtend && newVal.userReadExtend.resourcesType == 1) {
+          newVal.userRead.title = newVal.userRead.title.split('\n')
+        }
+        this.setData({
+          videoInfoCopy: newVal
+        })
+      }
     },
     videoType: {
       type: String,
@@ -54,14 +62,14 @@ Component({
   },
   data: {
     selfUid: wx.getStorageSync('uid'),
-    videoInfo: {},
+    videoInfoCopy: {},
   },
   lifetimes: {
     attached() {
       let {
         userReadExtend,
         userRead
-      } = this.data.videoInfo
+      } = this.data.videoInfoCopy
       if (userReadExtend.resourcesType == 1) {
         this.setData({
           endTime: setDuration(userRead.duration)
@@ -72,17 +80,17 @@ Component({
   methods: {
     // 播放视频
     playVideo() {
-      this.triggerEvent('playVideo', this.properties.videoInfo.userRead.id)
-      this.submitPlayLog(this.properties.videoInfo.userRead.id)
+      this.triggerEvent('playVideo', this.data.videoInfoCopy.userRead.id)
+      this.submitPlayLog(this.data.videoInfoCopy.userRead.id)
     },
     slider({
       detail
     }) {
-      this.triggerEvent('setSeek', detail.value / 100 * this.properties.videoInfo.userRead.duration)
+      this.triggerEvent('setSeek', detail.value / 100 * this.data.videoInfoCopy.userRead.duration)
     },
     // 设置视频公开还是隐私
     async setVideoPublic() {
-      let info = this.properties.videoInfo.userRead
+      let info = this.data.videoInfoCopy.userRead
       let data = {
         id: info.id,
         status: info.status === 'NORMAL' ? 'DISABLE' : 'NORMAL'
@@ -96,21 +104,21 @@ Component({
         })
       }
       this.setData({
-        ['videoInfo.userRead.status']: info.status === 'NORMAL' ? 'DISABLE' : 'NORMAL'
+        ['videoInfoCopy.userRead.status']: info.status === 'NORMAL' ? 'DISABLE' : 'NORMAL'
       })
     },
     // 点赞
     async likeVideo() {
       let {
         id
-      } = this.properties.videoInfo.userRead
-      if (this.properties.videoInfo.isLike) {
+      } = this.data.videoInfoCopy.userRead
+      if (this.data.videoInfoCopy.isLike) {
         return
       }
       await likeVideo(id)
       this.setData({
-        ['videoInfo.isLike']: true,
-        ['videoInfo.userRead.likeAmount']: this.data.videoInfo.userRead.likeAmount + 1
+        ['videoInfoCopy.isLike']: true,
+        ['videoInfoCopy.userRead.likeAmount']: this.data.videoInfoCopy.userRead.likeAmount + 1
       })
     },
     // 下载视频
@@ -119,7 +127,7 @@ Component({
         title: '保存到本地',
         mask: true
       })
-      const url = this.properties.videoInfo.userRead.markPath || ''
+      const url = this.data.videoInfoCopy.userRead.markPath || ''
       wx.downloadFile({
         url,
         success(res) {
@@ -166,7 +174,7 @@ Component({
     delete() {
       let {
         id
-      } = this.properties.videoInfo.userRead
+      } = this.data.videoInfoCopy.userRead
       wx.showModal({
         title: '确认删除吗?',
         content: '作品将被永久删除,无法找回。',
@@ -183,7 +191,7 @@ Component({
               title: '删除成功!',
               icon: "none"
             })
-            this.triggerEvent('deleteVideo', this.properties.videoInfo.userRead.id)
+            this.triggerEvent('deleteVideo', this.data.videoInfoCopy.userRead.id)
           }
         }
       })
@@ -194,7 +202,7 @@ Component({
         id,
         type,
         uid
-      } = this.properties.videoInfo.userRead
+      } = this.data.videoInfoCopy.userRead
       if (wx.getStorageSync('uid') == uid) {
         return wx.showToast({
           title: '不能收藏自己作品哦!',
@@ -206,21 +214,21 @@ Component({
         favoritesType: type
       })
       this.setData({
-        ['videoInfo.isFavorites']: !this.data.videoInfo.isFavorites
+        ['videoInfoCopy.isFavorites']: !this.data.videoInfoCopy.isFavorites
       })
     },
     // 关注
     async setFans() {
-      if (this.properties.videoInfo.isFans) {
+      if (this.data.videoInfoCopy.isFans) {
         return
       }
       await setFans({
-        uid: this.properties.videoInfo.user.uid
+        uid: this.data.videoInfoCopy.user.uid
       })
-      this.triggerEvent('setListFans', this.properties.videoInfo.user.uid)
+      this.triggerEvent('setListFans', this.data.videoInfoCopy.user.uid)
     },
     toPkPage() {
-      let videoInfo = this.data.videoInfo
+      let videoInfo = this.data.videoInfoCopy
       if (this.properties.videoType == 'pk') {
         if (videoInfo.user.uid == wx.getStorageSync('uid')) {
           return wx.showToast({
@@ -246,13 +254,13 @@ Component({
     },
     jumpUserInfo() {
       wx.navigateTo({
-        url: `/pages/personal/index?uid=${this.data.videoInfo.user.uid}&type=user`,
+        url: `/pages/personal/index?uid=${this.data.videoInfoCopy.user.uid}&type=user`,
       })
     },
     // 控制音频播放
     audioPlay() {
       this.triggerEvent('playAudio')
-      this.submitPlayLog(this.properties.videoInfo.userRead.id)
+      this.submitPlayLog(this.data.videoInfoCopy.userRead.id)
     },
     // 统计作品播放次数
     async submitPlayLog(userReadId) {

+ 42 - 37
components/videoPreview/index.wxml

@@ -2,13 +2,13 @@
 <view class="work">
   <view class="workHead">
     <view class="wH-left">
-      <image src="{{videoInfo.user.avatar}}" class="avatar" bindtap="jumpUserInfo" />
+      <image src="{{videoInfoCopy.user.avatar}}" class="avatar" bindtap="jumpUserInfo" />
       <view class="wH-left-user">
-        <view class="nickname textOver">{{videoInfo.user.nickName||videoInfo.user.eid}}</view>
-        <view class="time">{{videoInfo.userRead.day}}</view>
+        <view class="nickname textOver">{{videoInfoCopy.user.nickName||videoInfoCopy.user.eid}}</view>
+        <view class="time">{{videoInfoCopy.userRead.day}}</view>
       </view>
     </view>
-    <view class="wH-right" wx:if="{{videoType=='my'&&videoInfo.userRead.status!='CHECK'}}">
+    <view class="wH-right" wx:if="{{videoType=='my'&&videoInfoCopy.userRead.status!='CHECK'}}">
       <view class="wH-right-btn" bindtap="download">
         <image class="img" src="/static/down.png" mode="" />
         <view class="text">下载</view>
@@ -19,94 +19,99 @@
       </view>
       <view class="wH-right-btn" bindtap="setVideoPublic">
         <image class="img" style="width:30rpx"
-          src="{{videoInfo.userRead.status==='NORMAL'? '/static/unlock.png': '/static/lock.png'}}" />
+          src="{{videoInfoCopy.userRead.status==='NORMAL'? '/static/unlock.png': '/static/lock.png'}}" />
         <view class="text">
-          {{videoInfo.userRead.status==='NORMAL'? '公开': '私密'}}
+          {{videoInfoCopy.userRead.status==='NORMAL'? '公开': '私密'}}
         </view>
       </view>
     </view>
     <view class="wH-right"
-      wx:elif="{{videoType=='public'&&selfUid!=videoInfo.user.uid||videoType=='excellent'&&selfUid!=videoInfo.user.uid}}">
-      <view class="follow {{videoInfo.isFans?'isFans':''}}" bindtap="setFans">
-        <image src="{{videoInfo.isFans?'/static/follow_2.png':'/static/follow_1.png'}}" class="character" mode="" />
-        <text class="text">{{videoInfo.isFans?'已关注':'关注'}}</text>
+      wx:elif="{{videoType=='public'&&selfUid!=videoInfoCopy.user.uid||videoType=='excellent'&&selfUid!=videoInfoCopy.user.uid}}">
+      <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>
       </view>
     </view>
     <view class="wH-right" wx:elif="{{videoType=='pk'}}">
       <view class="pkNum">
-        {{videoInfo.userRead.score>=0?videoInfo.userRead.score+'分':''}}
+        {{videoInfoCopy.userRead.score>=0?videoInfoCopy.userRead.score+'分':''}}
       </view>
     </view>
   </view>
   <!-- 视频 -->
-  <view class="workContent" wx:if="{{!videoInfo.userReadExtend||videoInfo.userReadExtend.resourcesType==0}}">
+  <view class="workContent" wx:if="{{!videoInfoCopy.userReadExtend||videoInfoCopy.userReadExtend.resourcesType==0}}">
     <!-- 审核中遮罩 -->
-    <view class="videoBox" wx:if="{{videoInfo.userRead.status=='CHECK'&&videoInfo.userRead.id!=currentId}}">
+    <view class="videoBox" wx:if="{{videoInfoCopy.userRead.status=='CHECK'&&videoInfoCopy.userRead.id!=currentId}}">
       <view class="maskBg"></view>
       <image class="maskImg" src="/static/checking.png" />
-      <image class="cover" src="{{videoInfo.userRead.coverImg}}" />
+      <image class="cover" src="{{videoInfoCopy.userRead.coverImg}}" />
     </view>
     <!--未播放-->
-    <view class="videoBox" wx:if="{{videoInfo.userRead.status!='CHECK'&&videoInfo.userRead.id!=currentId}}"
+    <view class="videoBox" wx:if="{{videoInfoCopy.userRead.status!='CHECK'&&videoInfoCopy.userRead.id!=currentId}}"
       bindtap="playVideo">
       <image class="play" src="/static/play-btn.png" />
-      <image class="cover" src="{{videoInfo.userRead.coverImg}}" />
+      <image class="cover" src="{{videoInfoCopy.userRead.coverImg}}" />
     </view>
     <!-- 视频水印 -->
-    <image src="{{videoInfo.readMaskTemplate.imgPath}}" class="watermark"
-      style="pointer-events:{{videoInfo.userRead.status!='CHECK'&&videoInfo.userRead.id!=currentId?'auto':'none'}}"
-      bindtap="playVideo" wx:if="{{videoInfo.userRead.status!='CHECK'}}" />
+    <image src="{{videoInfoCopy.readMaskTemplate.imgPath}}" class="watermark"
+      style="pointer-events:{{videoInfoCopy.userRead.status!='CHECK'&&videoInfoCopy.userRead.id!=currentId?'auto':'none'}}"
+      bindtap="playVideo" wx:if="{{videoInfoCopy.userRead.status!='CHECK'}}" />
     <!-- 播放时渲染的video -->
-    <video class="video" id="myVideo" wx:if="{{videoInfo.userRead.id==currentId}}"
-      src="{{videoInfo.userRead.videoPath}}" autoplay="true" object-fit="contain">
+    <video class="video" id="myVideo" wx:if="{{videoInfoCopy.userRead.id==currentId}}"
+      src="{{videoInfoCopy.userRead.videoPath}}" autoplay="true" object-fit="contain">
     </video>
   </view>
   <!-- 音频 -->
   <view class="workContent" wx:else>
     <view class="audioBox" bindtap="audioPlay">
-      <image src=" {{videoInfo.userReadExtend.backgroundVirtualImg}}" class="audioBg" mode="aspectFill" />
+      <image src=" {{videoInfoCopy.userReadExtend.backgroundVirtualImg}}" class="audioBg" mode="aspectFill" />
       <view class="titleBox">
-        {{videoInfo.userRead.title}}
+        <view class="textOver" wx:for="{{videoInfoCopy.userRead.title}}" wx:key="index">
+          {{item}}
+        </view>
       </view>
       <view class="audioPlay">
-        <image src="/static/audioBg.png" class="audioPlayBg {{videoInfo.userRead.id==currentId?'circle':''}}" />
+        <image src="/static/audioBg.png" class="audioPlayBg {{videoInfoCopy.userRead.id==currentId?'circle':''}}" />
         <image src="/static/zhen.png" class="audioPlayZhen" />
-        <image src="{{videoInfo.userRead.coverImg}}" class="cover {{videoInfo.userRead.id==currentId?'circle':''}}" />
+        <image src="{{videoInfoCopy.userRead.coverImg}}"
+          class="cover {{videoInfoCopy.userRead.id==currentId?'circle':''}}" />
       </view>
       <view class="progressBar">
-        <image src="{{videoInfo.userRead.id==currentId?'/static/aStop.png':'/static/aPlay.png'}}" class="audioSwitch" />
-        <view class="time">{{currentId == videoInfo.userRead.id?currentTime:'00:00'}}</view>
-        <slider class="slider" value="{{currentId == videoInfo.userRead.id?sliderValue:0}}" catchtap="false"
-          disabled="{{currentId != videoInfo.userRead.id}}" catchchange="slider" block-size='12'
+        <image src="{{videoInfoCopy.userRead.id==currentId?'/static/aStop.png':'/static/aPlay.png'}}"
+          class="audioSwitch" />
+        <view class="time">{{currentId == videoInfoCopy.userRead.id?currentTime:'00:00'}}</view>
+        <slider class="slider" value="{{currentId == videoInfoCopy.userRead.id?sliderValue:0}}" catchtap="false"
+          disabled="{{currentId != videoInfoCopy.userRead.id}}" catchchange="slider" block-size='12'
           backgroundColor='#ffffff50' selected-color="#ffffff" />
         <view class="time">{{endTime}}</view>
       </view>
     </view>
   </view>
-  <view class="workFooter" wx:if="{{videoInfo.userRead.status!='CHECK'}}">
+  <view class="workFooter" wx:if="{{videoInfoCopy.userRead.status!='CHECK'}}">
     <button class="resetBtn mangeL-box" open-type="share" data-info='{{videoInfo}}'>
       <image src="/static/share.png" mode="" class="icon" />
       <view class="icon-name">分享</view>
     </button>
     <view class="mangeL-box" bindtap="collect">
-      <image src="{{videoInfo.isFavorites ? '/static/star_colored.png' : '/static/star.png'}}" mode="" class="icon" />
-      <view class="icon-name">{{videoInfo.isFavorites?'已收藏':'收藏'}}</view>
+      <image src="{{videoInfoCopy.isFavorites ? '/static/star_colored.png' : '/static/star.png'}}" mode=""
+        class="icon" />
+      <view class="icon-name">{{videoInfoCopy.isFavorites?'已收藏':'收藏'}}</view>
     </view>
     <view class="mangeL-box" bindtap="openComment">
       <image src="/static/comment.png" mode="" class="icon" />
-      <view class="icon-name">{{filters.numFilter(videoInfo.userRead.commentAmount)}}</view>
+      <view class="icon-name">{{filters.numFilter(videoInfoCopy.userRead.commentAmount)}}</view>
     </view>
     <view class="mangeL-box" bindtap="likeVideo">
-      <image src="{{videoInfo.isLike ? '/static/heart_colored.png' : '/static/heart.png'}}" mode="" class="icon" />
-      <view class="icon-name">{{filters.numFilter(videoInfo.userRead.likeAmount)}}</view>
+      <image src="{{videoInfoCopy.isLike ? '/static/heart_colored.png' : '/static/heart.png'}}" mode="" class="icon" />
+      <view class="icon-name">{{filters.numFilter(videoInfoCopy.userRead.likeAmount)}}</view>
     </view>
   </view>
   <block wx:if="{{videoType!='my'}}">
-    <view class="toReading" bindtap="toPkPage" wx:if="{{videoInfo.userRead.type=='READ'}}">
+    <view class="toReading" bindtap="toPkPage" wx:if="{{videoInfoCopy.userRead.type=='READ'}}">
       <image src="/static/reading.png" class="reading" mode="" />
       <view class="reading-text">挑战PK</view>
     </view>
-    <view class="toReading" bindtap="toPkPage" wx:if="{{videoInfo.userRead.type=='EXAMPLE'}}">
+    <view class="toReading" bindtap="toPkPage" wx:if="{{videoInfoCopy.userRead.type=='EXAMPLE'}}">
       <image src="/static/reading.png" class="reading" mode="" />
       <view class="reading-text">去朗读</view>
     </view>

+ 4 - 4
pages/personal/index.wxml

@@ -29,16 +29,16 @@
       </view>
       <view class="uRBtm" wx:if="{{type=='pk'}}">
         <view class="count countFirst">
-          总场<text class="countNum textOver">{{filters.numFilter(userInfo.readAmount)|| 0}}</text>
+          总场<text class="countNum textOver">{{filters.numFilter(userInfo.totalCount)|| 0}}</text>
         </view>
         <view class="count countFirst">
-          胜<text class="countNum textOver">{{filters.numFilter(userInfo.readAmount)|| 0}}</text>
+          胜<text class="countNum textOver">{{filters.numFilter(userInfo.winCount)|| 0}}</text>
         </view>
         <view class="count">
-          平<text class="countNum textOver">{{filters.numFilter(userInfo.fansAmount)|| '0'}}</text>
+          平<text class="countNum textOver">{{filters.numFilter(userInfo.flatCount)|| '0'}}</text>
         </view>
         <view class="count countEnd">
-          负<text class="countNum textOver">{{filters.numFilter(userInfo.playAmount) || 0}}</text>
+          负<text class="countNum textOver">{{filters.numFilter(userInfo.failCount) || 0}}</text>
         </view>
       </view>
 

+ 9 - 1
pages/reading/index.js

@@ -107,6 +107,12 @@ Page({
       console.log("===收到错误结果=============", res)
     });
     this.innerAudioContext = wx.createInnerAudioContext();
+    this.innerAudioContext.onTimeUpdate(res => {
+      this.setData({
+        ["silderData.sliderValue"]: Math.round(this.innerAudioContext.currentTime / this.innerAudioContext.duration * 100),
+        ["silderData.currentTime"]: setDuration(this.innerAudioContext.currentTime)
+      })
+    })
     this.resultAudioContext = wx.createInnerAudioContext();
     this.resultAudioContext.onTimeUpdate(res => {
       this.setData({
@@ -502,7 +508,9 @@ Page({
       exampleState: false,
       state: false,
       currentRow: null,
-      scrollTop: 0
+      scrollTop: 0,
+      ["silderData.sliderValue"]: 0,
+      ["silderData.currentTime"]: '00:00'
     })
   },
   // 获取设备高度与行高度