Sfoglia il codice sorgente

联调朗读页面

bayi 2 anni fa
parent
commit
6202e0189d
2 ha cambiato i file con 6 aggiunte e 7 eliminazioni
  1. 2 4
      pages/reading/index.js
  2. 4 3
      pages/reading/index.wxml

+ 2 - 4
pages/reading/index.js

@@ -92,7 +92,6 @@ Page({
   // 获取阅读内容
   async getreadInfo(videoId, reset = false) {
     let videoInfo = await getreadInfo(videoId)
-    console.log(videoInfo);
     wx.setNavigationBarTitle({
       title: videoInfo.userRead.title
     })
@@ -102,7 +101,6 @@ Page({
       item.readTime = data[index + 1] ? data[index + 1].time - item.time : ''
       return item
     })
-    console.log(data);
     this.setData({
       article: data,
       videoInfo
@@ -383,7 +381,7 @@ Page({
   },
   // 控制视频或音频的播放状态
   playMediaState() {
-    if (!this.data.videoInfo.userReadExtend) {
+    if (!this.data.videoInfo.userReadExtend || this.data.videoInfo.userReadExtend.resourcesType == 0) {
       this.videoContext.play()
     } else {
       this.innerAudioContext.play();
@@ -391,7 +389,7 @@ Page({
   },
   // 控制视频或音频的暂停状态
   stopMediaState() {
-    if (!this.data.videoInfo.userReadExtend) {
+    if (!this.data.videoInfo.userReadExtend || this.data.videoInfo.userReadExtend.resourcesType == 0) {
       this.videoContext.stop()
       this.videoContext.seek(0)
     } else {

+ 4 - 3
pages/reading/index.wxml

@@ -1,5 +1,5 @@
 <view class="readingBox">
-  <block wx:if="{{!videoInfo.userReadExtend}}">
+  <block wx:if="{{!videoInfo.userReadExtend||videoInfo.userReadExtend.resourcesType==0}}">
     <image src="{{videoInfo.userRead.coverImg}}" class='poster' wx:if="{{!state&&!readingReset}}" />
     <video id="myVideo" src="{{videoInfo.userRead.originVideo}}" bindended='videoEnd' controls="{{false}}"
       show-center-play-btn="{{readingReset}}" bindplay='videoPlay'></video>
@@ -10,7 +10,7 @@
     <view class="audioPlay" style="background-image: url({{videoInfo.userReadExtend.backgroundVirtualImg}});">
       <image src="/static/audioBg.png" class="audioPlayBg {{state?'circle':''}}" />
       <image src="/static/zhen.png" class="audioPlayZhen" />
-      <image src="{{videoInfo.userRead.iconImg}}" bindtap='videoPlay' class="cover {{state?'circle':''}}" mode="" />
+      <image src="{{videoInfo.userRead.coverImg}}" bindtap='videoPlay' class="cover {{state?'circle':''}}" mode="" />
     </view>
   </view>
   <view class="contentBox" wx:if="{{!readingReset}}">
@@ -84,7 +84,8 @@
   </view>
   <view class="controller">
     <image src="{{state?'/static/readingNow.gif':'/static/work.png'}}" class="playImg" bindtap="setCountDown" />
-    <view class="text">{{state?'完成录制':readingReset?'点击重录':readingType=='public'||readingType=='readMatch'?'开始朗读':'开始挑战'}}</view>
+    <view class="text">
+      {{state?'完成录制':readingReset?'点击重录':readingType=='public'||readingType=='readMatch'?'开始朗读':'开始挑战'}}</view>
     <uploadFile wx:if="{{readingReset}}" class="btnPosition" />
   </view>
   <view class="playImgBg"></view>