浏览代码

Merge branch 'NPC-lhd'

natasha 3 年之前
父节点
当前提交
82cd4ac109

+ 70 - 18
src/components/Adult/preview/WordPhrase.vue

@@ -78,23 +78,46 @@
                 v-else
                 style="width: 16px; height: 16px; margin-left: 8px"
               ></div>
-              <span class="NPC-word-tab-common NPC-word-tab-pinyin" v-if="!sItem.pinyin_site||sItem.pinyin_site=='first'">
-                {{ sItem.pinyin }}
-              </span>
-              <span class="NPC-word-tab-common NPC-word-tab-word">
-                {{ sItem.new_word }}
-              </span>
-              <span class="NPC-word-tab-common NPC-word-tab-pinyin" v-if="sItem.pinyin_site=='last'">
-                {{ sItem.pinyin }}
-              </span>
-              <span
-                class="NPC-word-tab-common NPC-word-tab-cixing"
-                v-html="sItem.cixing"
-              ></span>
-              <span
-                class="NPC-word-tab-common NPC-word-tab-def"
-                v-html="sItem.def_str"
-              ></span>
+              <template v-if="sItem.pinyin_site&&(sItem.pinyin_site=='top'||sItem.pinyin_site=='bottom')">
+                  <div class="NPC-word-tab-box">
+                        <span class="NPC-word-tab-common NPC-word-tab-pinyin" :class="[sItem.motif_color?'NPC-word-tab-pinyin-'+themeColor:'']" v-if="sItem.pinyin_site=='top'">
+                            {{ sItem.pinyin }}
+                        </span>
+                        <span class="NPC-word-tab-common NPC-word-tab-word" :class="[sItem.motif_color?'NPC-word-tab-word-'+themeColor:'']">
+                            {{ sItem.new_word }}
+                        </span>
+                        <span class="NPC-word-tab-common NPC-word-tab-pinyin" :class="[sItem.motif_color?'NPC-word-tab-pinyin-'+themeColor:'']" v-if="sItem.pinyin_site=='bottom'">
+                            {{ sItem.pinyin }}
+                        </span>
+                  </div>
+                    <span
+                        class="NPC-word-tab-common NPC-word-tab-cixing"
+                        v-html="sItem.cixing"
+                    ></span>
+                    <span
+                        class="NPC-word-tab-common NPC-word-tab-def"
+                        v-html="sItem.def_str"
+                    ></span>
+              </template>
+              <template v-else>
+                    <span class="NPC-word-tab-common NPC-word-tab-pinyin" :class="[sItem.motif_color?'NPC-word-tab-pinyin-'+themeColor:'']" v-if="!sItem.pinyin_site||sItem.pinyin_site=='first'">
+                        {{ sItem.pinyin }}
+                    </span>
+                    <span class="NPC-word-tab-common NPC-word-tab-word" :class="[sItem.motif_color?'NPC-word-tab-word-'+themeColor:'']">
+                        {{ sItem.new_word }}
+                    </span>
+                    <span class="NPC-word-tab-common NPC-word-tab-pinyin" :class="[sItem.motif_color?'NPC-word-tab-pinyin-'+themeColor:'']" v-if="sItem.pinyin_site=='last'">
+                        {{ sItem.pinyin }}
+                    </span>
+                    <span
+                        class="NPC-word-tab-common NPC-word-tab-cixing"
+                        v-html="sItem.cixing"
+                    ></span>
+                    <span
+                        class="NPC-word-tab-common NPC-word-tab-def"
+                        v-html="sItem.def_str"
+                    ></span>
+              </template>
               <span v-if="curQue.isInfor">
                 <img
                   src="../../../assets/NPC/detail-icon.png"
@@ -397,6 +420,15 @@ export default {
         margin-top: 4px;
         margin-left: 8px;
       }
+      .NPC-word-tab-box{
+          width: 240px;
+          span{
+              display: block;
+              width: 100%;
+              color: #000000;
+              margin: 2px 0;
+          }
+      }
       .NPC-word-tab-common {
         padding-left: 8px;
         width: 120px;
@@ -405,10 +437,30 @@ export default {
       .NPC-word-tab-pinyin {
         font-family: "GB-PINYINOK-B";
         white-space: nowrap;
+        font-size: 12px;
+        &.NPC-word-tab-pinyin-red{
+            color: #e35454;
+        }
+        &.NPC-word-tab-pinyin-green{
+            color: #24b99e;
+        }
+        &.NPC-word-tab-pinyin-brown{
+            color: #bd8865;
+        }
       }
       .NPC-word-tab-word {
-        font-family: "sourceR";
+        font-family: "FZJCGFKTK";
         white-space: nowrap;
+        font-size: 16px;
+        &.NPC-word-tab-word-red{
+            color: #e35454;
+        }
+        &.NPC-word-tab-word-green{
+            color: #24b99e;
+        }
+        &.NPC-word-tab-word-brown{
+            color: #bd8865;
+        }
       }
       .NPC-word-tab-cixing {
         font-family: "robot";

+ 44 - 22
src/components/Adult/preview/components/Intp.vue

@@ -17,30 +17,39 @@
         <!-- 基本释义 -->
         <h1>基本释义</h1>
         <span v-if="word.pinyin" class="pinyin">{{ word.pinyin }}</span>
-        <div
-          v-for="(itemss, indexss) in paraphrase"
-          :key="indexss"
-          class="paraphrase"
-        >
-          <template v-if="itemss['@Value2']">
+        <template v-if="isHasValue2">
             <div
-              v-for="(vItems, key, vIndexs) in itemss['@Value2']"
-              :key="vIndexs"
-              class="para"
-            >
-              <span class="para-key">{{
-                key.replace("[", "").replace("]", "")
-              }}</span>
-              <ul
-                v-for="(pItems, pIndexs) in vItems"
-                :key="pIndexs"
-                class="para-value"
-              >
-                <li>{{ pItems }}</li>
-              </ul>
+                v-for="(itemss, indexss) in paraphrase"
+                :key="indexss"
+                class="paraphrase"
+                >
+                <div
+                    v-for="(vItems, key, vIndexs) in itemss['@Value2']"
+                    :key="vIndexs"
+                    class="para"
+                    >
+                    <span class="para-key">{{
+                        key.replace("[", "").replace("]", "")
+                    }}</span>
+                    <ul
+                        v-for="(pItems, pIndexs) in vItems"
+                        :key="pIndexs"
+                        class="para-value"
+                    >
+                        <li>{{ pItems }}</li>
+                    </ul>
+                </div>
             </div>
-          </template>
-        </div>
+        </template>
+        <template v-else>
+            <ul
+                v-for="(itemss, indexss) in paraphrase"
+                :key="indexss"
+                class="paraphrase"
+                >
+                <li>{{ itemss['@value'] }}</li>
+            </ul>
+        </template>
         <hr />
       </div>
     </template>
@@ -107,6 +116,7 @@ export default {
       antonymList: [], // 反义词
       termsList: [], // 组词
       dataDetail: [],
+      isHasValue2: false, // 释义里是否含有value2
     };
   },
   computed: {
@@ -182,6 +192,12 @@ export default {
               } else if (itemss.key == "definition") {
                 // 释义
                 _this.paraphrase = itemss.objects;
+                for(let i = 0; i< _this.paraphrase.length; i++){
+                    if(_this.paraphrase[i]['@Value2']){
+                        _this.isHasValue2 = true
+                        return false
+                    }
+                }
               } else if (itemss.key == "synonym") {
                 // 近义词
                 _this.synonymList = itemss.objects;
@@ -211,6 +227,12 @@ export default {
         _this.paraphrase = _this.word.paraphrase
           ? JSON.parse(JSON.stringify(_this.word.paraphrase))
           : [];
+        for(let i = 0; i< _this.paraphrase.length; i++){
+            if(_this.paraphrase[i]['@Value2']){
+                _this.isHasValue2 = true
+                return false
+            }
+        }
         _this.synonymList = _this.word.synonymList
           ? JSON.parse(JSON.stringify(_this.word.synonymList))
           : [];

+ 3 - 3
src/components/Adult/preview/components/WordPhraseDetail.vue

@@ -92,7 +92,7 @@
         <div class="zhedie-white">
           <div v-if="list1 && list1.length > 0" v-loading="loading1">
             <div class="topTitle">
-              <span>本课例句</span>
+              <span>本课例句({{list1.length}})</span>
               <span @click="handleChangeTab('wordShow')"
                 >{{ wordShow ? "收起" : "展开" }}
                 <img
@@ -119,7 +119,7 @@
           </div>
           <div v-if="list2 && list2.length > 0" v-loading="loading2">
             <div class="topTitle">
-              <span>本书例句</span>
+              <span>本书例句({{list2.length}})</span>
               <span @click="handleChangeTab('wordShow2')"
                 >{{ wordShow2 ? "收起" : "展开" }}
                 <img
@@ -146,7 +146,7 @@
           </div>
           <div v-if="list3 && list3.length > 0" v-loading="loading3">
             <div class="topTitle">
-              <span>本套教材例句</span>
+              <span>本套教材例句({{list3.length}})</span>
               <span @click="handleChangeTab('wordShow3')"
                 >{{ wordShow3 ? "收起" : "展开" }}
                 <img