natasha 1 tahun lalu
induk
melakukan
2a61868c67

+ 2 - 1
src/components/common/BookPeruseCard.vue

@@ -133,8 +133,9 @@ export default {
       return { newarr, timeArr, rateArr }
     },
     handleLink(){
+
         let url  = this.LoginNavIndex +'&&&1&&&2&&&3&&&' + this.previousPage
-        if(!this.$route.query.from){
+        if(!this.$route.query.from&&this.LoginNavIndex!==1){
             this.$router.push({
                 path: "/bookPeruseItem",
                 query: {

+ 1 - 1
src/views/bookShelf/bookItem.vue

@@ -38,7 +38,7 @@
             <div class="book-info-right">
                 <h1 class="title">{{info.name||info.iss_name}}</h1>
                 <!-- <b class="org">{{data.org}}</b><span class="date">2023.07.01-2023.07.21</span> -->
-                <div class="sales-box">
+                <div class="sales-box" v-if="isBuy==='false'">
                     <div class="sales-left">
                         <span>优惠价</span>
                         <span class="OPPOSans">¥{{info.hasOwnProperty('price_discount')||info.hasOwnProperty('iss_price_sell')?info.price_discount||info.iss_price_sell:info.price||info.iss_price_org|cutMoneyFiter}}</span>

+ 1 - 1
src/views/bookShelf/bookPeruseItem.vue

@@ -38,7 +38,7 @@
             <div class="book-info-right">
                 <h1 class="title">{{info.cn_title}}</h1>
                 <!-- <b class="org">{{data.org}}</b><span class="date">2023.07.01-2023.07.21</span> -->
-                <div class="sales-box">
+                <div class="sales-box" v-if="isBuy==='false'">
                     <div class="sales-left">
                         <span>优惠价</span>
                         <span class="OPPOSans">¥{{info.price|cutMoneyFiter}}</span>

+ 7 - 4
src/views/personalCenter/components/OrderList.vue

@@ -50,8 +50,8 @@
             label="价格"
             width="154">
             <template slot-scope="scope">
-                <span class="currectPrice">¥{{scope.row.goods_price_discount?scope.row.goods_price_discount:scope.row.goods_price | cutMoneyFiter}}</span>
-                <span class="oldPrice" v-if="scope.row.goods_price_discount&&scope.row.goods_price_discount!==scope.row.goods_price">(¥{{scope.row.goods_price | cutMoneyFiter}})</span>
+                <span class="currectPrice">¥{{scope.row.hasOwnProperty('goods_price_discount')?scope.row.goods_price_discount:scope.row.goods_price | cutMoneyFiter}}</span>
+                <span class="oldPrice" v-if="scope.row.hasOwnProperty('goods_price_discount')&&scope.row.goods_price_discount!==scope.row.goods_price">(¥{{scope.row.goods_price | cutMoneyFiter}})</span>
             </template>
         </el-table-column>
         <el-table-column
@@ -62,8 +62,11 @@
                     未使用
                 </template>
                 <template v-else>
-                    <span class="code" :id="'copy-'+scope.row.discount_code">{{scope.row.discount_code}}</span>
-                    <svg-icon icon-class="copy" class="copy" @click="CopyToClipboard('copy-'+scope.row.discount_code)"></svg-icon>
+                    <template v-if="scope.row.discount_code">
+                        <span class="code" :id="'copy-'+scope.row.discount_code">{{scope.row.discount_code}}</span>
+                        <svg-icon icon-class="copy" class="copy" @click="CopyToClipboard('copy-'+scope.row.discount_code)"></svg-icon>
+                    </template>
+                    <template v-else>-</template>
                 </template>
             </template>
         </el-table-column>

+ 190 - 27
src/views/personalCenter/components/WordCard.vue

@@ -91,7 +91,7 @@
         <div class="list">
               <template v-if="!kwicFlag">
                 <div
-                  v-for="(item, i) in ShowList"
+                  v-for="(item, i) in sentKwicData.sentence_list"
                   :key="i + 'sentence'"
                   class="one"
                 >
@@ -109,32 +109,35 @@
                 </div>
               </template>
               <template v-else>
-                <div
-                  v-for="(item, index) in ShowList"
-                  :key="'kwic' + index"
-                  class="kwic_one"
-                >
-                  <div class="number">{{ item.number }}</div>
-                  <el-tooltip effect="dark" placement="bottom">
-                    <div class="content">
-                      {{ item.source_courseware_name_path }}
-                    </div>
-                    <div class="laiyuan">
-                      {{ item.source_courseware_name_path }}
+                <template v-if="kwicAlign==='left'">
+                    <div
+                        v-for="(item, index) in sentKwicData.sentence_list_sort_left"
+                        :key="'kwic' + index"
+                        class="kwic_one"
+                        >
+                        <div class="number">{{ item.number }}</div>
+                        <el-tooltip effect="dark" placement="bottom">
+                            <div class="content" slot="content">
+                            {{ item.source_courseware_name_path }}
+                            </div>
+                            <div class="laiyuan">
+                            {{ item.source_courseware_name_path }}
+                            </div>
+                        </el-tooltip>
+                        <div
+                            class="word_sentence"
+                        >
+                            <div v-for="(txt, indexs) in item.resArr" :key="indexs">
+                            <span
+                                v-for="(txts, indexs) in txt"
+                                v-html="txts"
+                                :key="indexs"
+                            ></span>
+                            </div>
+                        </div>
                     </div>
-                  </el-tooltip>
-                  <div
-                    class="word_sentence"
-                  >
-                    <div v-for="(txt, indexs) in item.resArr" :key="indexs">
-                      <span
-                        v-for="(txts, indexs) in txt"
-                        v-html="txts"
-                        :key="indexs"
-                      ></span>
-                    </div>
-                  </div>
-                </div>
+                </template>
+                
               </template>
             </div>
     </div>
@@ -347,12 +350,172 @@ export default {
                 this.sentKwicData.max_page_no = res.data.max_page_no
                 this.sentKwicData.my_bought_total = res.my_bought_total
                 this.sentKwicData.total = res.total
+                if(res.data&&res.data.results){
+                    res.data.results.forEach((item,indexs) => {
+                        let tokenIndexArr = [item.token_idx]
+                        let str = ''
+                        item.number = indexs+1
+                        tokenIndexArr.forEach(index=>{
+                            item.tokens[index][0] = '<span style=\"color:#ED5F00;font-weight:600;\">'+ item.tokens[index][0] + '</span>'
+                        })
+                        item.tokens.forEach(items=>{
+                            str += items[0] + ' '
+                        })
+                        item.res = str
+                        item.source_courseware_name_path = item.study_phase_name + '版 / ' + item.iss_no + ' / '
+                    });
+                    this.sentKwicData.sentence_list = res.data.results
+                }
+                
             }
         })
         .catch(() => {
             this.loading = false
         });
-    }
+        getLogin('/PaperServer/Client/Article/QuerySentKwicData', {
+            word: this.data.word,
+            page_size: 30,
+            page_no: this.pageNo,
+            only_my_bought: true,
+            kwic_type: 1
+        })
+        .then((res) => {
+            this.loading = false
+            if(res.status===1){
+                if(res.data&&res.data.results){
+                    res.data.results.forEach((item,indexs) => {
+                        let tokenIndexArr = [item.token_idx]
+                        let str = ''
+                        item.number = indexs+1
+                        tokenIndexArr.forEach(index=>{
+                            item.tokens[index][0] = '<span style=\"color:#ED5F00;font-weight:600;\">'+ item.tokens[index][0] + '</span>'
+                        })
+                        item.tokens.forEach(items=>{
+                            str += items[0] + ' '
+                        })
+                        item.res = str
+                        item.source_courseware_name_path = item.study_phase_name + '版 / ' + item.iss_no + ' / '
+                    });
+                    this.sentKwicData.sentence_list = res.data.results
+                }
+                
+            }
+        })
+        .catch(() => {
+            this.loading = false
+        });
+    },
+    handleExample(list, type) {
+      if (list.length > 0) {
+        list = list.map((item, index) => {
+          let str = item.source_courseware_name_path;
+          item.show_source_courseware_name_path = str.slice(0, 8) + "...";
+          if (type == "left") {
+            let sentence = JSON.parse(JSON.stringify(item.sentence));
+            let arr = JSON.parse(JSON.stringify(item.sentence_fc_list));
+            arr.forEach((items, indexs) => {
+              if (indexs == item.sentence_fc_list_word_index) {
+                arr[
+                  indexs
+                ] = `<span style=color:#DE4444;font-weight:700;>${arr[indexs]}</span>`;
+              }
+            });
+            let data = this.changefiveword(
+              arr,
+              item.sentence_fc_list_word_index,
+              type
+            );
+            item.resArr = data;
+          } else if (type == "right") {
+            let sentence = JSON.parse(JSON.stringify(item.sentence));
+            let arr = JSON.parse(JSON.stringify(item.sentence_fc_list));
+            arr.forEach((items, indexs) => {
+              if (indexs == item.sentence_fc_list_word_index) {
+                arr[
+                  indexs
+                ] = `<span style=color:#DE4444;font-weight:700;>${arr[indexs]}</span>`;
+              }
+            });
+            let data = this.changefiveword(
+              arr,
+              item.sentence_fc_list_word_index,
+              type
+            );
+            item.resArr = data;
+          } else if (type == "mid") {
+            let sentence = JSON.parse(JSON.stringify(item.sentence));
+            let arr = JSON.parse(JSON.stringify(item.sentence_fc_list));
+            arr.forEach((items, indexs) => {
+              if (indexs == item.sentence_fc_list_word_index) {
+                arr[
+                  indexs
+                ] = `<span style=color:#DE4444;font-weight:700;>${arr[indexs]}</span>`;
+              }
+            });
+            let data = this.changefiveword(
+              arr,
+              item.sentence_fc_list_word_index,
+              type
+            );
+            item.resArr = data;
+          } else {
+            let newsentence = JSON.parse(JSON.stringify(item.sentence));
+            let res = "";
+            for (let i = 0; i < item.position_list.length; i++) {
+              let part1 = "";
+              let part2 = "";
+              let part3 = "";
+              if (item.position_list.length > 1) {
+                if (i == 0) {
+                  part1 = newsentence.substring(0, item.position_list[i].begin);
+                  part2 = newsentence.substring(
+                    item.position_list[i].begin,
+                    item.position_list[i].end
+                  );
+                  part3 = newsentence.substring(
+                    item.position_list[i].end,
+                    item.position_list[i + 1].begin
+                  );
+                } else if (i == item.position_list.length - 1) {
+                  part2 = newsentence.substring(
+                    item.position_list[i].begin,
+                    item.position_list[i].end
+                  );
+                  part3 = newsentence.substring(item.position_list[i].end);
+                } else {
+                  part2 = newsentence.substring(
+                    item.position_list[i].begin,
+                    item.position_list[i].end
+                  );
+                  part3 = newsentence.substring(
+                    item.position_list[i].end,
+                    item.position_list[i + 1].begin
+                  );
+                }
+              } else {
+                part1 = newsentence.substring(0, item.position_list[i].begin);
+                part2 = newsentence.substring(
+                  item.position_list[i].begin,
+                  item.position_list[i].end
+                );
+                part3 = newsentence.substring(item.position_list[i].end);
+              }
+              res +=
+                part1 +
+                '<span style="color:#DE4444;">' +
+                part2 +
+                "</span>" +
+                part3;
+            }
+            item.res = res;
+          }
+          return item;
+        });
+        return list;
+      } else {
+        return [];
+      }
+    },
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {