Rorschach 4 years ago
parent
commit
055f7f7ea6

BIN
.DS_Store


+ 3 - 1
app.js

@@ -8,13 +8,15 @@ App({
   onLaunch: function (options) {
   onLaunch: function (options) {
     // 判断设备是否为 iPhone X
     // 判断设备是否为 iPhone X
     this.checkIsIPhoneX()
     this.checkIsIPhoneX()
+    options.referrerInfo.extraData && (this.globalData.upgradeHide = options.referrerInfo.extraData.upgrade)
   },
   },
   globalData: {
   globalData: {
     isIPX: false, // 当前设备是否为 iPhone X
     isIPX: false, // 当前设备是否为 iPhone X
     isIOS: false, // 判断设备是否为苹果
     isIOS: false, // 判断设备是否为苹果
     userInfo: null,
     userInfo: null,
     statusBarHeight: wx.getSystemInfoSync()['statusBarHeight'],
     statusBarHeight: wx.getSystemInfoSync()['statusBarHeight'],
-    userGrade: '二年级'
+    userGrade: '二年级',
+    upgradeHide: true
   },
   },
   checkIsIPhoneX: function () {
   checkIsIPhoneX: function () {
     const self = this
     const self = this

+ 42 - 0
component/video-swiper/index.js

@@ -367,6 +367,48 @@ Component({
                 });
                 });
             }
             }
         },
         },
+        // 下载视频
+        download: function (e) {
+            // console.log(e.currentTarget.dataset)
+            wx.showLoading({
+                title: '保存到本地',
+                mask: true
+            })
+            const { url } = e.currentTarget.dataset;
+            wx.downloadFile({
+                url,
+                success (res) {
+                    // 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容
+                    if (res.statusCode === 200) {
+                        console.log(res.tempFilePath)
+                        wx.saveVideoToPhotosAlbum({
+                            filePath: res.tempFilePath,
+                            success (res) {
+                              wx.hideLoading()
+                              wx.showToast({
+                                title: '保存成功',
+                                icon: 'success',
+                                duration: 2000,
+                                mask: true
+                              })                              
+                            },
+                            fail (error) {
+                                console.log(error)
+                            }
+                        })
+                    }
+                },
+                fail () {
+                    wx.hideLoading()
+                    wx.showToast({
+                      title: '网络不给力',
+                      icon: 'error',
+                      duration: 2000,
+                      mask: true
+                    })                              
+                }
+            })
+        },
         delete: function (e) {
         delete: function (e) {
             console.log('删除', e)
             console.log('删除', e)
             wx.showModal({
             wx.showModal({

+ 17 - 1
component/video-swiper/index.wxml

@@ -81,10 +81,17 @@
           <image class="efun_tag" src="../../static/index/efun_tag.png" wx:if="{{item.isEfun}}"></image>
           <image class="efun_tag" src="../../static/index/efun_tag.png" wx:if="{{item.isEfun}}"></image>
         </view>
         </view>
       </view>
       </view>
+      <!-- <view wx:if="{{!item.showMyBtn}}" class="time">
+        <text>发布时间:{{item.time}}</text>
+      </view> -->
       <view wx:if="{{!item.showMyBtn}}" class="time">
       <view wx:if="{{!item.showMyBtn}}" class="time">
         <text>发布时间:{{item.time}}</text>
         <text>发布时间:{{item.time}}</text>
       </view>
       </view>
       <view wx:if="{{item.showMyBtn && !item.ifCheck}}" class="my_btn">
       <view wx:if="{{item.showMyBtn && !item.ifCheck}}" class="my_btn">
+        <view class="delete" catchtap="download" data-url="{{item.markPath ? item.markPath : '' }}" data-id="{{item.id}}">
+          <image class="download_image" src="../../static/index/down.png" />
+          <text class="delete_text">下载</text>
+        </view>
         <view class="delete" catchtap="delete" data-id="{{item.id}}">
         <view class="delete" catchtap="delete" data-id="{{item.id}}">
           <image class="delete_image" src="../../static/index/delete.png" />
           <image class="delete_image" src="../../static/index/delete.png" />
           <text class="delete_text">删除</text>
           <text class="delete_text">删除</text>
@@ -95,6 +102,16 @@
           <text class="hide_text">{{item.status==='NORMAL'? '公开': '仅自己可见'}}</text>
           <text class="hide_text">{{item.status==='NORMAL'? '公开': '仅自己可见'}}</text>
         </view>
         </view>
       </view>
       </view>
+      <!-- <view wx:if="{{item.showMyBtn && !item.ifCheck}}" class="my_btn">
+        <view class="delete" catchtap="delete" data-id="{{item.id}}">
+          <image class="delete_image" src="../../static/index/delete.png" />
+          <text class="delete_text">删除</text>
+        </view>
+        <view class="hide" catchtap="hide" data-status="{{item.status}}" data-id="{{item.id}}">
+          <image class="hide_image" src="{{item.status==='NORMAL'? '../../static/index/unlock.png': '../../static/index/lock.png'}}" />
+          <text class="hide_text">{{item.status==='NORMAL'? '公开': '仅自己可见'}}</text>
+        </view>
+      </view> -->
     </view>
     </view>
     <view class="video_place" wx:if="{{!item.videoShow}}" catchtap="{{item.ifCheck ? null : 'showVideo'}}" data-index="{{index}}">
     <view class="video_place" wx:if="{{!item.videoShow}}" catchtap="{{item.ifCheck ? null : 'showVideo'}}" data-index="{{index}}">
       <image class="place_img" src="{{item.coverImg}}" />
       <image class="place_img" src="{{item.coverImg}}" />
@@ -154,7 +171,6 @@
         <image src="../../static/index/microphone.png" />
         <image src="../../static/index/microphone.png" />
         <text>我要配音</text>
         <text>我要配音</text>
       </view>
       </view>
-
     </view>
     </view>
   </view>
   </view>
   <view class="no_work" wx:if="{{!isSwiper && noMoreWork}}">
   <view class="no_work" wx:if="{{!isSwiper && noMoreWork}}">

+ 7 - 1
component/video-swiper/index.wxss

@@ -50,11 +50,12 @@
   top: 0;
   top: 0;
 }
 }
 .swiper_container .swiper_item .head_box .user_box {
 .swiper_container .swiper_item .head_box .user_box {
-  width: 378rpx;
+  width: 360rpx;
   height: 100%;
   height: 100%;
   display: flex;
   display: flex;
   align-items: center;
   align-items: center;
   position: relative;
   position: relative;
+  overflow: hidden;
 }
 }
 .swiper_container .swiper_item .head_box .user_box .avatar {
 .swiper_container .swiper_item .head_box .user_box .avatar {
   width: 80rpx;
   width: 80rpx;
@@ -94,6 +95,11 @@
   display: flex;
   display: flex;
   align-items: center;
   align-items: center;
 }
 }
+.swiper_container .swiper_item .head_box .my_btn .delete .download_image {
+  width: 29rpx;
+  height: 33rpx;
+  margin-bottom: 2rpx;
+}
 .swiper_container .swiper_item .head_box .my_btn .delete {
 .swiper_container .swiper_item .head_box .my_btn .delete {
   display: flex;
   display: flex;
   flex-direction: column;
   flex-direction: column;

+ 9 - 1
pages/index/index.js

@@ -82,7 +82,7 @@ Page({
     },
     },
     grade: wx.getStorageSync('grade'),
     grade: wx.getStorageSync('grade'),
     noMoreWork: false, // 没有更多作品 已经到底了
     noMoreWork: false, // 没有更多作品 已经到底了
-
+    upgradeHide: false
   },
   },
   jurisdiction: function () {
   jurisdiction: function () {
     //隐藏弹框
     //隐藏弹框
@@ -92,6 +92,12 @@ Page({
     //登录页信息
     //登录页信息
     this.updateData(0)
     this.updateData(0)
   },
   },
+  // 隐藏升级弹窗
+  hideUpgrade() {
+    this.setData({
+      upgradeHide: true
+    })
+  },
   //tab点击
   //tab点击
   switcher: function ({
   switcher: function ({
     currentTarget
     currentTarget
@@ -413,6 +419,7 @@ Page({
       temp.avatar = item.user.avatar;
       temp.avatar = item.user.avatar;
       temp.profession = item.user.profession;
       temp.profession = item.user.profession;
       temp.uid = item.user.uid;
       temp.uid = item.user.uid;
+      temp.markPath = item.userRead.markPath ? item.userRead.markPath : item.userRead.videoPath;
       temp.url = item.userRead.videoPath ? item.userRead.videoPath : item.userRead.originVideo;
       temp.url = item.userRead.videoPath ? item.userRead.videoPath : item.userRead.originVideo;
       temp.id = item.userRead.id;
       temp.id = item.userRead.id;
       temp.type = item.userRead.type;
       temp.type = item.userRead.type;
@@ -658,6 +665,7 @@ Page({
         temp.avatar = item.user.avatar;
         temp.avatar = item.user.avatar;
         temp.profession = item.user.profession;
         temp.profession = item.user.profession;
         temp.uid = item.user.uid;
         temp.uid = item.user.uid;
+        temp.markPath = item.userRead.markPath ? item.userRead.markPath : item.userRead.videoPath;
         temp.url = item.userRead.videoPath ? item.userRead.videoPath : item.userRead.originVideo;
         temp.url = item.userRead.videoPath ? item.userRead.videoPath : item.userRead.originVideo;
         temp.id = item.userRead.id;
         temp.id = item.userRead.id;
         temp.type = item.userRead.type;
         temp.type = item.userRead.type;

+ 6 - 0
pages/index/index.wxml

@@ -69,6 +69,12 @@
 <view hidden="{{hide}}">
 <view hidden="{{hide}}">
   <Dialog bindmyevent="jurisdiction" />
   <Dialog bindmyevent="jurisdiction" />
 </view>
 </view>
+<view class="upgrade" hidden="{{upgradeHide}}">
+  <view class="upgrade-main">
+    <image class="upgrade-icon" src="https://reader-wx.ai160.com/images/reader/upgrade_success.png"></image>
+    <image class="close" bindtap="hideUpgrade" src="../../static/image/close.png"></image>
+  </view> 
+</view>
 <shareDialog id="share-dialog" shareType='works' bindShareDialogClose="shareDialogClose" shareId="{{id}}" />
 <shareDialog id="share-dialog" shareType='works' bindShareDialogClose="shareDialogClose" shareId="{{id}}" />
 <canvas canvas-id="myCanvas" style="width:300px; height: 525px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
 <canvas canvas-id="myCanvas" style="width:300px; height: 525px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
 <!-- <view class="index-dialog" wx:if="{{indexSignDialog}}">
 <!-- <view class="index-dialog" wx:if="{{indexSignDialog}}">

+ 26 - 0
pages/index/index.wxss

@@ -399,4 +399,30 @@
 
 
 .change_grade .change_brage_wrapper .change_item_blank{
 .change_grade .change_brage_wrapper .change_item_blank{
   background: #ffffff !important;
   background: #ffffff !important;
+}
+.upgrade {
+  position: fixed;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 100%;
+  background: rgba(0, 0, 0, .6);
+  z-index:9999;
+}
+.upgrade-main {
+  position: absolute;
+  right: 20rpx;
+  top: -10rpx;  
+}
+.upgrade-icon {
+  width: 443rpx;
+  height: 236rpx;
+}
+.close {
+  position: absolute;
+  left: 50%;
+  transform: translateX(-50%);
+  top: 260rpx;
+  width: 65rpx;
+  height: 65rpx;  
 }
 }

+ 3 - 0
pages/reading/reading.js

@@ -459,6 +459,7 @@ Page({
         }
         }
         this.innerAudioContext = wx.createInnerAudioContext();
         this.innerAudioContext = wx.createInnerAudioContext();
         this.innerAudioContext.src = this.data.recordSource; // 这里可以是录音的临时路径
         this.innerAudioContext.src = this.data.recordSource; // 这里可以是录音的临时路径
+        console.log('音频路径', this.data.recordSource)
         this.setData({
         this.setData({
             videoUrl: this.data.videoUrl,
             videoUrl: this.data.videoUrl,
             muted: true
             muted: true
@@ -516,6 +517,8 @@ Page({
 
 
         }, () => {
         }, () => {
             console.log('播放视频播放视频播放视频')
             console.log('播放视频播放视频播放视频')
+            // this.videoCtx.seek(1);
+            this.videoCtx.stop();
             this.videoCtx.play();
             this.videoCtx.play();
             this.recordStart();
             this.recordStart();
         })
         })

BIN
static/.DS_Store


BIN
static/image/.DS_Store


BIN
static/image/close.png


BIN
static/index/down.png


+ 1 - 1
templates/courses/courses.wxml

@@ -9,7 +9,7 @@
             <view class="course_btn_wrapper">
             <view class="course_btn_wrapper">
                     <view class="collect course_btn" data-index="{{index}}" data-id="{{item.userRead.id}}" data-type="{{item.userRead.type}}">
                     <view class="collect course_btn" data-index="{{index}}" data-id="{{item.userRead.id}}" data-type="{{item.userRead.type}}">
                         <image class="comment_icon btn_icon" src="../../static/index/res_comment.png" />
                         <image class="comment_icon btn_icon" src="../../static/index/res_comment.png" />
-                        <text class="collect_text btn_text">{{item.userRead.commentAmount}}</text>
+                        <text class="collect_text btn_text">{{item.readAmount}}</text>
                     </view>
                     </view>
                     <view class="collect course_btn" data-index="{{index}}" data-id="{{item.userRead.id}}" data-type="{{item.userRead.type}}">
                     <view class="collect course_btn" data-index="{{index}}" data-id="{{item.userRead.id}}" data-type="{{item.userRead.type}}">
                         <image class="play_icon btn_icon" src="../../static/index/res_eye.png" />
                         <image class="play_icon btn_icon" src="../../static/index/res_eye.png" />