Browse Source

修改文章Practice模式

gcj 3 years ago
parent
commit
49cd0cfa70

+ 2 - 2
src/components/Adult/preview/ArticleViewChs/Practicechs.vue

@@ -529,9 +529,9 @@ export default {
       let _this = this;
       if (_this.isRepeat) {
         let time = curTime * 1000;
-        if (time > _this.currSent.ed || time < _this.currSent.bg) {
+        if (time >= _this.currSent.ed || time <= _this.currSent.bg) {
           _this.curTime = _this.currSent.bg;
-          this.$refs.audioLine.onTimeupdateTime(_this.currSent.bg / 1000);
+          this.$refs.audioLine.onTimeupdateTime(_this.currSent.bg / 1000, true);
         } else {
           _this.curTime = curTime * 1000;
         }

+ 2 - 3
src/components/Adult/preview/DialogueArticleViewChs/Practicechs.vue

@@ -672,10 +672,9 @@ export default {
       let _this = this;
       if (_this.isRepeat) {
         let time = curTime * 1000;
-        console.log(time, _this.currSent.ed);
-        if (time > _this.currSent.ed || time < _this.currSent.bg) {
+        if (time >= _this.currSent.ed || time <= _this.currSent.bg) {
           _this.curTime = _this.currSent.bg;
-          this.$refs.audioLine.onTimeupdateTime(_this.currSent.bg / 1000);
+          this.$refs.audioLine.onTimeupdateTime(_this.currSent.bg / 1000, true);
         } else {
           _this.curTime = curTime * 1000;
         }

+ 111 - 65
src/views/TextbookDetail.vue

@@ -6,47 +6,55 @@
       <Header />
       <div class="shade"></div>
     </div>
-    <div class="main" v-loading="loading">
-      <div class="bookDetail" v-if="detailSHow">
-        <div class="rightUp">
-          <span>HOT</span>
-        </div>
-        <div class="img">
-          <img :src="TextbookData.picture_url" alt="" />
-        </div>
-        <div class="text">
-          <p class="p1">{{ TextbookData.name }}</p>
-          <p class="p2">{{ TextbookData.org_name }}</p>
-          <p class="p2">{{ TextbookData.author }}</p>
-          <p class="p3">
-            {{ TextbookData.description }}
-          </p>
-          <div class="operation">
-            <span class="price">
-              ¥<span
-                class="price_1"
-                v-html="changePrice(TextbookData.price)"
-              ></span>
-            </span>
-            <button @click="getPurchase" class="get">
-              <!-- Key390-去学习 Key72-购买 -->
-              {{ bookIsBuy == "true" ? this.$t("Key390") : this.$t("Key72") }}
-            </button>
-            <!-- <button   class="acquired">
+    <template v-if="TextbookData.is_deleted == 'false'">
+      <template v-if="bookIsBuy == 'true' || TextbookData.publish_status == 1">
+        <div class="main" v-loading="loading">
+          <div class="bookDetail" v-if="detailSHow">
+            <div class="rightUp">
+              <span>HOT</span>
+            </div>
+            <div class="img">
+              <img :src="TextbookData.picture_url" alt="" />
+            </div>
+            <div class="text">
+              <p class="p1">{{ TextbookData.name }}</p>
+              <p class="p2">{{ TextbookData.org_name }}</p>
+              <p class="p2">{{ TextbookData.author }}</p>
+              <p class="p3">
+                {{ TextbookData.description }}
+              </p>
+              <div class="operation">
+                <span class="price">
+                  ¥<span
+                    class="price_1"
+                    v-html="changePrice(TextbookData.price)"
+                  ></span>
+                </span>
+                <button @click="getPurchase" class="get">
+                  <!-- Key390-去学习 Key72-购买 -->
+                  {{
+                    bookIsBuy == "true" ? this.$t("Key390") : this.$t("Key72")
+                  }}
+                </button>
+                <!-- <button   class="acquired">
               ACQUIRED
             </button> -->
-            <span class="enshrine" @click="enshrineEvent">
-              <img
-                v-if="enshrine == 'false'"
-                src="../assets/textBookDetail/enshrine2.png"
-                alt=""
-              />
-              <img v-else src="../assets/textBookDetail/enshrine1.png" alt="" />
-            </span>
+                <span class="enshrine" @click="enshrineEvent">
+                  <img
+                    v-if="enshrine == 'false'"
+                    src="../assets/textBookDetail/enshrine2.png"
+                    alt=""
+                  />
+                  <img
+                    v-else
+                    src="../assets/textBookDetail/enshrine1.png"
+                    alt=""
+                  />
+                </span>
+              </div>
+            </div>
           </div>
-        </div>
-      </div>
-      <!-- <div class="more"  v-if="detailSHow">
+          <!-- <div class="more"  v-if="detailSHow">
         <div class="moreTitle">更多推荐</div>
         <div class="moreList">
           <div class="moreOne">
@@ -123,37 +131,55 @@
           </div>
         </div>
       </div> -->
-      <div class="cutDownOrimg" v-if="detailSHow">
-        <div class="sele">
-          <div
-            @click="SelectShowEvent('1')"
-            :class="SelectShow == '1' ? 'select' : ''"
-          >
-            <!-- 目录 -->{{ $t("Key612") }}
+          <div class="cutDownOrimg" v-if="detailSHow">
+            <div class="sele">
+              <div
+                @click="SelectShowEvent('1')"
+                :class="SelectShow == '1' ? 'select' : ''"
+              >
+                <!-- 目录 -->{{ $t("Key612") }}
+              </div>
+              <div
+                @click="SelectShowEvent('2')"
+                :class="SelectShow == '1' ? '' : 'select'"
+              >
+                <!-- 资源 -->{{ $t("Key613") }}
+              </div>
+            </div>
           </div>
-          <div
-            @click="SelectShowEvent('2')"
-            :class="SelectShow == '1' ? '' : 'select'"
-          >
-            <!-- 资源 -->{{ $t("Key613") }}
+          <div v-if="SelectShow == '1'" class="Catalogue">
+            <BookView
+              :bookId="TextBookId"
+              @bookdetailShow="bookdetailShow"
+              :bookIsBuy="bookIsBuy"
+            ></BookView>
+          </div>
+          <div v-else class="Resources">
+            <div>
+              <img src="../assets/textBookDetail/fileType1.png" alt="" />
+              <span> 文件名 </span>
+              <img src="../assets/textBookDetail/upload.png" alt="" />
+            </div>
           </div>
         </div>
+      </template>
+    </template>
+    <template v-if="TextbookData.is_deleted == 'true'">
+      <div class="noview-msg-box">
+        <div class="noview-msg">无法查看,教材已被删除</div>
       </div>
-      <div v-if="SelectShow == '1'" class="Catalogue">
-        <BookView
-          :bookId="TextBookId"
-          @bookdetailShow="bookdetailShow"
-          :bookIsBuy="bookIsBuy"
-        ></BookView>
-      </div>
-      <div v-else class="Resources">
-        <div>
-          <img src="../assets/textBookDetail/fileType1.png" alt="" />
-          <span> 文件名 </span>
-          <img src="../assets/textBookDetail/upload.png" alt="" />
-        </div>
+    </template>
+    <template
+      v-if="
+        TextbookData.is_deleted == 'false' &&
+        bookIsBuy == 'false' &&
+        TextbookData.publish_status == 0
+      "
+    >
+      <div class="noview-msg-box">
+        <div class="noview-msg">无法查看,教材已下架</div>
       </div>
-    </div>
+    </template>
     <!-- 商品详情 -->
     <el-dialog
       class="buyWindow"
@@ -318,7 +344,7 @@ export default {
         goods_id: this.TextBookId,
       };
       LearnWebSI(Mname, data).then((res) => {
-        this.bookIsBuy = res.is_buy;
+        this.bookIsBuy = res.is_buy; //是否已购买 true 是 false 否
       });
     },
     // 获取当前书籍是否已收藏
@@ -775,6 +801,26 @@ export default {
       }
     }
   }
+  .noview-msg-box {
+    width: 100%;
+    position: absolute;
+    top: 200px;
+    left: 0;
+    z-index: 9999;
+  }
+  .noview-msg {
+    width: fit-content;
+    margin: 0 auto;
+    padding: 8px;
+    background: #fcf5f5;
+    border: 1px solid #e65959;
+    box-sizing: border-box;
+    border-radius: 4px;
+    font-weight: 400;
+    font-size: 12px;
+    line-height: 14px;
+    color: #e55959;
+  }
 }
 </style>
 <style lang="scss">