limengbo před 4 roky
rodič
revize
990fa6d796

+ 3 - 3
component/my/my.js

@@ -74,9 +74,9 @@ export const myInit = (that) => {
       });
     },
     that.toWalletDetail = function(e) {
-      // wx.navigateTo({
-      //   url: `../../pages/user/walletDetails/walletDetails?title=资金明细`
-      // });
+      wx.navigateTo({
+        url: `../../pages/user/walletDetails/walletDetails?title=资金明细`
+      });
     },
     that.getFollowWorks(1, 3);
 }

+ 4 - 4
component/my/my.wxml

@@ -30,13 +30,13 @@
           <image class="" src='../../static/image/flower_small.png' />
           <view>小红花:{{myData.user.integralAmount || 0 }}</view>
         </view>
-        <!-- <view class="flower-tips" wx:if="{{myData.user.unfinishedAmount > 0}}">
+        <view class="flower-tips" wx:if="{{myData.user.unfinishedAmount > 0}}">
           <text class="flower-last">{{myData.user.unfinishedAmount }}</text>
           个任务福利还没有完成
         </view>
         <view class="flower-tips" wx:if="{{myData.user.unfinishedAmount <= 0}}">
           今天任务全部完成,真棒
-        </view> -->
+        </view>
       </view>
       <!-- android 显示两个 -->
       <view class="wallet-section" wx:if="{{!myData.isIOS}}">
@@ -50,10 +50,10 @@
           <image class="flower-icon" src='../../static/image/flower_small.png' />
           <view class="flower-text">
             <view>小红花:{{myData.user.integralAmount || 0 }}</view>
-            <!-- <view class="flower-tips-text">
+            <view class="flower-tips-text">
               <text class="flower-last">{{myData.user.unfinishedAmount }}</text>
               个任务福利还没有完成
-            </view> -->
+            </view>
           </view>
         </view>
       </view>

+ 1 - 1
component/share/share.wxml

@@ -2,7 +2,7 @@
    <view class="btn" animation="{{animationData}}"  id="btnArea" catchtap="nothing">
        <!-- <image class="bg" src="../../static/groupImg/share.png"></image> -->
        <view class="corss-line"></view>
-       <view class="invite-text">邀请助力</view>
+       <view class="invite-text">分享作品</view>
        <view class="share-btn">
             <button class="share-friend" open-type="share" catchtap="shareFriend">
                <image  src="../../static/groupImg/weixin.png"></image>

+ 5 - 5
pages/index/index.js

@@ -333,11 +333,11 @@ Page({
       url: `../../pages/user/mycourse/mycourse?title=我的课程`
     });
   },
-  // goToFlower: function() {
-  //   wx.navigateTo({
-  //     url: `../../pages/social/littleFlower/littleFlower`
-  //   });
-  // },
+  goToFlower: function() {
+    wx.navigateTo({
+      url: `../../pages/social/littleFlower/littleFlower`
+    });
+  },
   signInBtn: function(e) {
     this.setData({
       indexSignDialog: false

+ 4 - 4
pages/main/class/class.js

@@ -133,24 +133,24 @@ Page({
     getOpenidSessionKey((res) => {
       httpRequestApi.areYouSuper(this.data.productId).success(res => {
         if (res.data.success) {
+          const that = this;
           wx.authorize({
             scope: 'scope.record',
             success () {
                 // 用户已经同意小程序使用录音功能,后续调用 wx.startRecord 接口不会弹窗询问
                 console.log('成功')
                 wx.navigateTo({
-                  url: `../../main/reading/reading?id=${this.data.id}`
+                  url: `../../main/reading/reading?id=${that.data.id}`
                 })
             },
             fail () {
                 wx.showModal({
-                    title: '无法开启您的录音权限',
-                    content: '点击右上角浮点按钮->设置,进行授权',
+                    title: '录音前请打开麦克风权限',
+                    content: '点击右上角浮点...,选择:设置-麦克风,点击/打开。',
                     confirmText: '我知道了',
                     showCancel: false,
                     success(res) {
                         console.log('用户点击确定')
-                        dialogFlag = false;
                     }
                 })
             }

+ 16 - 16
pages/main/reading/reading.js

@@ -46,7 +46,7 @@ Page({
         
             })
         })
-
+        
         this.recorderManager = wx.getRecorderManager();
 
 
@@ -87,13 +87,13 @@ Page({
                 success(res) {
                     if (!res.authSetting['scope.record'] && dialogFlag) {
                         wx.showModal({
-                            title: '无法开启您的录音权限',
-                            content: '点击右上角浮点按钮->设置,进行授权',
+                            title: '录音前请打开麦克风权限',
+                            content: '点击右上角浮点...,选择:设置-麦克风,点击/打开。',
                             confirmText: '我知道了',
                             showCancel: false,
                             success(res) {
                                 console.log('用户点击确定')
-                                dialogFlag = false;
+                                // dialogFlag = false;
                             }
                         })
                         dialogFlag = false;
@@ -131,13 +131,13 @@ Page({
     },
     onHide: function () {
         console.log('onhide')
-        // if (this.data.btnImgFlag) {
-        //     this.recorderManager.stop();
-        // }
+        if (this.data.btnImgFlag) {
+            this.recorderManager.stop();
+        }
 
-        // if (this.innerAudioContext) {
-        //     this.innerAudioContext.stop();
-        // }
+        if (this.innerAudioContext) {
+            this.innerAudioContext.stop();
+        }
         this.setData({
             recordFlag: 0
         })
@@ -145,12 +145,12 @@ Page({
     },
     onUnload: function () {
         console.log('onUnload')
-        // if (this.recorderManager) {
-        //     this.recorderManager.stop();
-        // }
-        // if (this.innerAudioContext) {
-        //     this.innerAudioContext.stop();
-        // }
+        if (this.recorderManager) {
+            this.recorderManager.stop();
+        }
+        if (this.innerAudioContext) {
+            this.innerAudioContext.stop();
+        }
     },
     // onShow:function(){
 

+ 5 - 2
pages/social/replyDetail/replyDetail.js

@@ -78,12 +78,15 @@ Page({
                 temp.likes = 0;
                 temp.id = item.postId;
                 temp.avatar = item.user.avatar;
-                replyTemp.push(temp);
+                if (item.isRisky === 'NORMAL') {
+                    replyTemp.push(temp);
+                }
                 console.log(replyTemp);
             });
+            const count = replyTemp.length - 1;
             this.setData({
                 comment: replyTemp,
-                count: replied.replyCount
+                count
             })
         });
     },

+ 75 - 26
pages/social/works/works.js

@@ -51,7 +51,8 @@ Page({
         modalCloseShow: true,
         hide: true,
         addComeOut: '',
-        flowerNum: '6'
+        flowerNum: '6',
+        readIsRisky: ''
         // shareFlag: false
     },
     showAlert: function () {
@@ -113,15 +114,16 @@ Page({
     },
     onHide: function () {
         // this.data.stackSize >= 2
-        console.log('hide')
+        console.log('=================================hide')
         if (this.innerAudioContext) {
             console.log('音频应该被暂停')
             this.innerAudioContext.pause();
+            this.innerAudioContext.volume = 0;
         }
         // this.videoCtx = null
     },
     onUnload: function () {
-        console.log(this.data.productId)
+        console.log('-------------------页面雨鞋')
         if (this.videoPlayTime) {
             const data = {
                 "title": this.data.title,
@@ -134,6 +136,11 @@ Page({
             httpRequestApi.playLogReport(data).success(res => {
                 console.log(res)
             })
+            if (this.innerAudioContext) {
+                console.log('音频应该被暂停')
+                this.innerAudioContext.pause();
+                this.innerAudioContext.volume = 0;
+            }
         }
 
         if (this.innerAudioContext) {
@@ -167,12 +174,12 @@ Page({
                 authorAvatar: author.avatar,
                 authorProfession: author.profession,
                 authorUid: author.uid,
-                videoSrc: works.originVideo,
                 audioSrc: works.audioPath,
                 iconImg: works.iconImg,
                 classId: works.lessonId,
                 isLike: res.data.data.isLike,
                 isFans: res.data.data.isFans,
+                videoSrc: works.originVideo,
                 title: works.title,
                 userReadId: works.id
             })
@@ -182,6 +189,17 @@ Page({
                     productId: productId
                 })
             });
+            if(this.data.fromReading){
+                setTimeout(()=>{
+                    this.openShare()
+                })
+            }
+            if (works.isRisky === 'DEL') {
+                this.setData({
+                    readIsRisky: 'DEL'
+                });
+                return false;
+            }
             // 设置音频路径
             this.innerAudioContext = wx.createInnerAudioContext();
             this.innerAudioContext.onPause((res) => {
@@ -189,32 +207,39 @@ Page({
                 console.log('音频暂停')
             })
             this.innerAudioContext.src = this.data.audioSrc; // 这里可以是录音的临时路径
-            if(this.data.fromReading){
-                setTimeout(()=>{
-                    this.openShare()
-                })
-            }
 
 
         });
     },
     onShow() {
+        console.log('------------------------------------------------')
         if(this.data.myUid){
             this.setData({
                 replyList: [],
                 pageNo: 1,
-                pageSize: 2
+                pageSize: 8
             }, () => {
                 this.getReply();
             })
         }
     },
     videoPlayHandler: function () {
+        if (this.data.readIsRisky === 'DEL') {
+            wx.showModal({
+                title: '提示',
+                content: '作品还在审核中,请稍后收听(一分钟内)。',
+                confirmText: '我知道了',
+                showCancel: false,
+                success(res) {
+                    console.log('用户点击确定')
+                }
+            })
+            return false;
+        }
         this.setData({
             videoLoad: true
         }, () => {
             this.videoCtx = wx.createVideoContext('worksVideo', this);
-            debugger
             this.videoCtx.play();
         })
     },
@@ -285,7 +310,27 @@ Page({
             noScroll: ''
         })
     },
-    videoPlay: function () {
+    videoPlay: function (event) {
+        console.log(11111, this.videoPlayTime)
+        if (this.data.readIsRisky === 'DEL') {
+            wx.showModal({
+                title: '提示',
+                content: '作品还在审核中,请稍后收听(一分钟内)。',
+                confirmText: '我知道了',
+                showCancel: false,
+                success(res) {
+                    console.log('用户点击确定')
+                }
+            })
+            return false;
+        }
+        if (this.innerAudioContext) {
+            this.innerAudioContext.volume = 1;
+            if (this.videoPlayTime) {
+                this.innerAudioContext.seek(this.videoPlayTime);
+            }
+        }
+        console.log('============', this.data.goBackHome)
         // 视频开始 先结束 再开始
         // this.innerAudioContext.play();
         // this.innerAudioContext.pause();
@@ -307,9 +352,11 @@ Page({
 
         this.innerAudioContext.stop();
     },
-    videoPause: function () {
+    videoPause: function (event) {
         console.log('视频暂停')
+        console.log('暂停', event)
         this.innerAudioContext.pause();
+        this.innerAudioContext.volume = 0;
     },
     videoWaiting: function () {
         console.log('视频缓冲')
@@ -324,12 +371,18 @@ Page({
     },
     videoTimeupdate: function (e) {
         this.videoPlayTime = e.detail.currentTime
-        if (e.detail.currentTime - this.innerAudioContext.currentTime >= 1) {
-            this.innerAudioContext.seek(e.detail.currentTime - 0.1);
-        }
+        // if (e.detail.currentTime - this.innerAudioContext.currentTime >= 1) {
+        //     this.innerAudioContext.seek(e.detail.currentTime - 0.1);
+        // } 
     },
     goToReading: function () {
         const classId = this.data.classId;
+        if (this.innerAudioContext && this.videoCtx) {
+            this.videoCtx.pause();
+            this.innerAudioContext.pause();
+            this.innerAudioContext.volume = 0;
+            console.log('关闭音频')
+        }
         getOpenidSessionKey((res) => {
             httpRequestApi.areYouSuper(this.data.productId).success(res => {
                 if (res.data.success) {
@@ -344,13 +397,12 @@ Page({
                         },
                         fail () {
                             wx.showModal({
-                                title: '无法开启您的录音权限',
-                                content: '点击右上角浮点按钮->设置,进行授权',
+                                title: '录音前请打开麦克风权限',
+                                content: '点击右上角浮点...,选择:设置-麦克风,点击/打开。',
                                 confirmText: '我知道了',
                                 showCancel: false,
                                 success(res) {
                                     console.log('用户点击确定')
-                                    dialogFlag = false;
                                 }
                             })
                         }
@@ -395,11 +447,6 @@ Page({
             this.setData({
                 hide: !this.data.hide
             })
-            if (this.innerAudioContext && this.videoCtx) {
-                this.videoCtx.stop();
-                this.innerAudioContext.pause();
-                console.log('关闭音频')
-            }
             return;
         });
     },
@@ -507,11 +554,13 @@ Page({
                 temp.time = formatDate(item.gmtCreated, 3);
                 temp.likes = item.postsAttributeInfo.favors || 0;
                 temp.isLike = item.isLike;
-                this.data.replyList.push(temp);
+                if (item.isRisky === 'NORMAL') {
+                    this.data.replyList.push(temp);
+                }
             });
             this.setData({
                 replyList: this.data.replyList,
-                total: res.data.data.totalSize,
+                total: this.data.replyList.length,
                 totalPage: res.data.data.totalNo
             })
         });

+ 7 - 7
pages/social/works/works.wxml

@@ -1,11 +1,11 @@
 <view class="works-page {{noScroll}}">
-    <view class="videoSection" wx:if="{{!isIOS}}">
+    <view class="videoSection">
         <image wx:if="{{!videoLoad}}" class="video-playBtn" bindtap="videoPlayHandler" src="../../../static/image/play-btn.png"/>
         <image wx:if="{{!videoLoad}}" class="videoIcon" src="{{iconImg}}" />
         <video wx:if="{{videoLoad}}" id="worksVideo" class="videoSection" src="{{videoSrc}}" bindplay="videoPlay" bindtimeupdate="videoTimeupdate" bindprogress="videoProgress" bindwaiting="videoWaiting" bindended="videoEnd" bindpause="videoPause" controls="false" enable-progress-gesture="{{gesture}}" show-fullscreen-btn="{{fullScreenBtn}}" show-play-btn="{{playBtn}}"></video>
     </view>
     <!-- <video wx:if="{{isIOS}}" id="worksVideo" class="videoSection" src="{{videoUrl}}" autoPlay="{{autoPlay}}" controls="{{controls}}" show-center-play-btn="{{centerBtn}}" show-fullscreen-btn="{{fullScreenBtn}}" show-play-btn="{{playBtn}}"></video> -->
-    <video wx:if="{{isIOS}}" id="worksVideo" class="videoSection" src="{{videoSrc}}" bindplay="videoPlay" bindwaiting="videoWaiting" bindended="videoEnd" bindpause="videoPause" controls="false" enable-progress-gesture="{{gesture}}" show-fullscreen-btn="{{fullScreenBtn}}" show-play-btn="{{playBtn}}"></video>
+    <!-- <video wx:if="{{isIOS}}" id="worksVideo" class="videoSection" src="{{videoSrc}}" bindplay="videoPlay" bindwaiting="videoWaiting" bindended="videoEnd" bindpause="videoPause" controls="false" enable-progress-gesture="{{gesture}}" show-fullscreen-btn="{{fullScreenBtn}}" show-play-btn="{{playBtn}}"></video> -->
     <view class="readAuthorSection">
         <image class="avatar" src="{{authorAvatar}}" bindtap="goToUsers" data-uid="{{authorUid}}" />
         <view class="profession" wx:if="{{authorProfession}}">{{authorProfession}}</view>
@@ -35,7 +35,7 @@
             <text class="animation-flower {{addComeOut}}">+1</text>
             <image src="../../../static/image/add_flower.png" />
         </view>
-        <!-- <input class="commentInput" bindconfirm="sendHandler" value="{{inputValue}}" confirm-type="send" placeholder="听了这么多,说点什么吧" bindinput="inputValue"></input> -->
+        <input class="commentInput" bindconfirm="sendHandler" value="{{inputValue}}" confirm-type="send" placeholder="听了这么多,说点什么吧" bindinput="inputValue"></input>
     </view>
     <view class="commentArea">
         <view class="commentItem" wx:for="{{replyList}}" wx:key="{{index}}">
@@ -50,9 +50,9 @@
                     <text class="gutInGut">{{item.text}}</text>
                     <text wx:if="{{item.text.length >=22}}" class="whole" bindtap="goToDetail" data-id="{{item.id}}">全文</text>
                 </view>
-                <!-- <view class="commentAll" bindtap="goToDetail" data-id="{{item.id}}" wx:if="{{item.replyCount}}">
+                <view class="commentAll" bindtap="goToDetail" data-id="{{item.id}}" wx:if="{{item.replyCount}}">
                     <text>共有{{item.replyCount}}条评论</text>
-                </view> -->
+                </view>
             </view>
             <view class="btnWrapper">
                 <!-- <image class="commentBtn" src="../../../static/image/comment.png" bindtap="goToDetail" data-count="{{item.replyCount}}" data-id="{{item.id}}" data-index="{{index}}" />
@@ -61,10 +61,10 @@
                     <image class="likeBtn" src="{{item.isLike? '../../../static/image/point.png' : '../../../static/image/like.png'}}" />
                     <text class="likeText">{{item.likes}}</text>
                 </view>
-                <!-- <view class="hotAreaBigBigBig" bindtap="goToDetail" data-id="{{item.id}}" data-index="{{index}}">
+                <view class="hotAreaBigBigBig" bindtap="goToDetail" data-id="{{item.id}}" data-index="{{index}}">
                     <image class="commentBtn" src="../../../static/image/comment.png" />
                     <text class="commentText">回复</text>
-                </view> -->
+                </view>
             </view>
         </view>
     </view>

+ 1 - 1
pages/social/works/works.wxss

@@ -232,7 +232,7 @@
 
 .commentSection {
     width: 100%;
-    height: 88rpx;
+    height: 158rpx;
 }
 
 .commentSection .title {