浏览代码

视频课-讲义下载

xuqiaoying 3 年之前
父节点
当前提交
c7e0889043
共有 4 个文件被更改,包括 57 次插入21 次删除
  1. 17 5
      pages3/live/detail.vue
  2. 40 16
      pages3/polyv/detail.vue
  3. 二进制
      pages3/static/imgs/downLoad.png
  4. 二进制
      pages3/static/imgs/downLoading.png

+ 17 - 5
pages3/live/detail.vue

@@ -247,7 +247,7 @@
           </view>
         </view>
         <!--答疑 -->
-        <view v-show="current == 2">
+        <view v-show="current == 2" class="Answering">
           <view class="inputBottom">
             <view class="flex_auto">
               <u-input
@@ -266,7 +266,8 @@
           <view
             v-for="(item, index) in answerList"
             :key="index"
-            style="background-color: #ffffff; margin-bottom: 20rpx"
+            style="background-color: #ffffff;"
+            class="answer_item"
           >
             <view class="chat_box" @click.stop="clearCtx">
               <view style="display: flex; flex: 1">
@@ -2030,7 +2031,7 @@ export default {
   .box {
     flex: 1;
     overflow: hidden;
-    margin: 20rpx;
+    margin: 16rpx 16rpx 100rpx 16rpx;
 
     .box_in {
       height: 100%;
@@ -2217,6 +2218,16 @@ page {
   // padding-top: constant(safe-area-inset-top);
   // padding-top: env(safe-area-inset-top);
 }
+.Answering {
+  .answer_item {
+    &:nth-child(2) {
+      border-radius: 16rpx 16rpx 0rpx 0rpx;
+    }
+    &:nth-last-child(1) {
+      border-radius: 0rpx 0rpx 16rpx 16rpx;
+    }
+  }
+}
 .inputBottom {
   position: fixed;
   left: 0;
@@ -2247,8 +2258,9 @@ page {
 .noteBox {
   width: 100%;
   background: #ffffff;
-  padding: 10rpx;
+  padding: 0rpx 10rpx 20rpx;
   border-radius: 16rpx;
+  overflow: hidden;
   .left_ti {
     padding-top: 14rpx;
   }
@@ -2262,7 +2274,7 @@ page {
   color: #666666;
   text-align: center;
   line-height: 48rpx;
-  margin: 20rpx 0;
+  margin: 16rpx 0rpx 8rpx;
 }
 .t_content1 {
   color: #007aff;

+ 40 - 16
pages3/polyv/detail.vue

@@ -230,11 +230,13 @@
               <!-- 这是后台配置的讲义标题过长省略这是后台配置的讲义标题过长省略 -->
             </view>
             <view class="btn" @click="openDocument">
-              <u-icon name="download" color="#007AFF" size="40"></u-icon>
+              <!-- <u-icon name="download" color="#007AFF" size="40"></u-icon> -->
+              <image v-if="!downLoading" src="/pages3/static/imgs/downLoad.png" style="width: 40rpx;height: 40rpx;"></image>
+              <image v-else src="/pages3/static/imgs/downLoading.png" style="width: 40rpx;height: 40rpx;"></image>
             </view>
           </view>
 
-          <view style="text-align: center" v-else>暂无讲义</view>
+          <!-- <view style="text-align: center" v-else>暂无讲义</view> -->
           <!-- <view class="lecture-content">
 						<rich-text :nodes="'讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容'"></rich-text>
 					</view> -->
@@ -294,7 +296,7 @@
                 @click="jumpNote(item1)"
               >
                 <view style="display: flex">
-                  <view>
+                  <view class="left_ti">
                     <view>
                       <image
                         src="/static/icon/note2.png"
@@ -325,7 +327,7 @@
           </view>
         </view>
         <!--答疑 -->
-        <view v-show="current == 3">
+        <view v-show="current == 3" class="Answering">
           <view class="inputBottom">
             <view class="flex_auto">
               <u-input
@@ -344,7 +346,8 @@
           <view
             v-for="(item, index) in answerList"
             :key="index"
-            style="background-color: #ffffff; margin-bottom: 20rpx"
+            style="background-color: #ffffff;"
+            class="answer_item"
           >
             <view class="chat_box" @click.stop="clearCtx">
               <view style="display: flex; flex: 1">
@@ -687,7 +690,8 @@ export default {
 			clearTimer:null,
 			livingItem:'',
 			option:null,
-			isOther:''
+			isOther:'',
+      downLoading: false, //下载讲义加载
     };
   },
   computed: {
@@ -769,7 +773,7 @@ export default {
 				this.studyRecordQueryLiveLast();
 			}
 		});
-    
+    this.current = uni.getStorageSync('current') || 0
     console.log(this.gradeId, 7512);
     
   },
@@ -804,6 +808,7 @@ export default {
         })
         .then((res) => {});
     }
+    uni.removeStorageSync('current')
     // websocket.sendMsg("delAction");
   },
   mounted() {
@@ -2469,21 +2474,24 @@ export default {
       this.current = index;
     },
     openDocument() {
-      let self = this;
+      this.downLoading = true
       let url = this.$method.splitImgHost(this.courseHandoutsData.handoutsUrl);
       console.log(url);
       uni.downloadFile({
         url: url,
-        success: function (res) {
+        success: (res) => {
           console.log(999);
           var filePath = res.tempFilePath;
           uni.openDocument({
             filePath: filePath,
-            showMenu: self.courseHandoutsData.canDownload == 1 ? true : false,
-            success: function (res) {
+            showMenu: this.courseHandoutsData.canDownload == 1 ? true : false,
+            success: (res) => {
+              this.downLoading = false
+              uni.setStorageSync('current', this.current)
               console.log(res, "打开文档成功");
             },
-            fail: function (err) {
+            fail: (err) => {
+              this.downLoading = false
               console.log(err);
               uni.showToast({
                 icon: "none",
@@ -2493,6 +2501,7 @@ export default {
           });
         },
         fail: (err) => {
+          this.downLoading = false
           uni.showModal({
             title: "提示",
             content: "文档错误," + err.errMsg,
@@ -2563,7 +2572,7 @@ export default {
   .box {
     flex: 1;
     overflow: hidden;
-    margin: 20rpx;
+    margin: 16rpx 16rpx 100rpx 16rpx;
 
     .box_in {
       height: 100%;
@@ -2722,7 +2731,7 @@ export default {
   margin-left: 8rpx;
 }
 .t2Content {
-  font-size: 28rpx;
+  font-size: 24rpx;
   font-family: PingFang SC;
   font-weight: bold;
   color: #999999;
@@ -2733,6 +2742,7 @@ export default {
   padding-top: 10rpx;
   color: #333333;
   font-size: 30rpx;
+  font-weight: 400;
 }
 .tBox {
   display: flex;
@@ -2749,6 +2759,16 @@ page {
   // padding-top: constant(safe-area-inset-top);
   // padding-top: env(safe-area-inset-top);
 }
+.Answering {
+  .answer_item {
+    &:nth-child(2) {
+      border-radius: 16rpx 16rpx 0rpx 0rpx;
+    }
+    &:nth-last-child(1) {
+      border-radius: 0rpx 0rpx 16rpx 16rpx;
+    }
+  }
+}
 .inputBottom {
   position: fixed;
   left: 0;
@@ -2779,8 +2799,12 @@ page {
 .noteBox {
   width: 100%;
   background: #ffffff;
-  padding: 10rpx;
+  padding: 0rpx 10rpx 20rpx;
   border-radius: 16rpx;
+  overflow: hidden;
+  .left_ti {
+    padding-top: 14rpx;
+  }
 }
 .dateBox {
   width: 216rpx;
@@ -2791,7 +2815,7 @@ page {
   color: #666666;
   text-align: center;
   line-height: 48rpx;
-  margin: 20rpx 0;
+  margin: 16rpx 0rpx 8rpx;
 }
 .t_content1 {
   color: #007aff;

二进制
pages3/static/imgs/downLoad.png


二进制
pages3/static/imgs/downLoading.png