|
|
@@ -21,7 +21,7 @@
|
|
|
data.unified_attrib && data.unified_attrib.topic_color ? data.unified_attrib.topic_color : '#de4444',
|
|
|
fontSize: data.unified_attrib && data.unified_attrib.font_size ? data.unified_attrib.font_size : '',
|
|
|
}"
|
|
|
- v-html="data.title_con"
|
|
|
+ v-html="convertText(sanitizeHTML(data.title_con))"
|
|
|
></span>
|
|
|
<span v-if="showLang" class="NPC-topTitle-text">
|
|
|
{{ titleTrans[getLang()] }}
|
|
|
@@ -173,7 +173,7 @@
|
|
|
</template>
|
|
|
|
|
|
<template v-else>
|
|
|
- <span style="flex-shrink: 0; width: 24px; height: 24px"></span>
|
|
|
+ <span v-if="hasVoice" style="flex-shrink: 0; width: 24px; height: 24px"></span>
|
|
|
</template>
|
|
|
<div class="tabNum-box">
|
|
|
<template v-if="sItem.mIndex == 0">
|
|
|
@@ -218,7 +218,7 @@
|
|
|
: '',
|
|
|
}"
|
|
|
class="NPC-word-tab-common NPC-word-tab-word"
|
|
|
- v-html="sItem.new_word"
|
|
|
+ v-html="convertText(sanitizeHTML(sItem.new_word))"
|
|
|
>
|
|
|
</span>
|
|
|
<span
|
|
|
@@ -249,7 +249,7 @@
|
|
|
<p
|
|
|
class="NPC-word-tab-common NPC-word-tab-cixing"
|
|
|
:class="[/[\u4E00-\u9FA5\uF900-\uFA2D]/.test(sItem.cixing) ? 'hasCn' : '']"
|
|
|
- v-html="sItem.cixing"
|
|
|
+ v-html="convertText(sanitizeHTML(sItem.cixing))"
|
|
|
></p>
|
|
|
<span
|
|
|
v-if="
|
|
|
@@ -290,7 +290,7 @@
|
|
|
? data.unified_attrib.font_size
|
|
|
: '',
|
|
|
}"
|
|
|
- v-html="sItem.new_word"
|
|
|
+ v-html="convertText(sanitizeHTML(sItem.new_word))"
|
|
|
></p>
|
|
|
<span
|
|
|
v-if="
|
|
|
@@ -324,7 +324,7 @@
|
|
|
<p
|
|
|
class="NPC-word-tab-common NPC-word-tab-cixing"
|
|
|
:class="[/[\u4E00-\u9FA5\uF900-\uFA2D]/.test(sItem.cixing) ? 'hasCn' : '']"
|
|
|
- v-html="sItem.cixing"
|
|
|
+ v-html="convertText(sanitizeHTML(sItem.cixing))"
|
|
|
></p>
|
|
|
|
|
|
<span
|
|
|
@@ -343,7 +343,10 @@
|
|
|
</div>
|
|
|
|
|
|
<span>
|
|
|
- <p class="NPC-word-tab-common NPC-word-tab-def" v-html="sItem.def_str"></p>
|
|
|
+ <p
|
|
|
+ class="NPC-word-tab-common NPC-word-tab-def"
|
|
|
+ v-html="convertText(sanitizeHTML(sItem.def_str))"
|
|
|
+ ></p>
|
|
|
<span
|
|
|
v-if="
|
|
|
showLang &&
|
|
|
@@ -357,7 +360,10 @@
|
|
|
</span>
|
|
|
</span>
|
|
|
<div v-if="sItem.collocation">
|
|
|
- <span class="collocation"><span>搭配:</span><b v-html="sItem.collocation"></b></span>
|
|
|
+ <span class="collocation"
|
|
|
+ ><span>{{ convertText('搭配:') }}</span
|
|
|
+ ><b v-html="convertText(sanitizeHTML(sItem.collocation))"></b
|
|
|
+ ></span>
|
|
|
<span v-if="showLang" class="">
|
|
|
{{
|
|
|
multilingualTextList[getLang()] &&
|
|
|
@@ -370,9 +376,9 @@
|
|
|
</div>
|
|
|
<div v-if="sItem.liju_list">
|
|
|
<span class="collocation"
|
|
|
- ><span>例句:</span>
|
|
|
+ ><span>{{ convertText('例句:') }}</span>
|
|
|
<div>
|
|
|
- <b v-html="sItem.liju_list"></b>
|
|
|
+ <b v-html="convertText(sanitizeHTML(sItem.liju_list))"></b>
|
|
|
</div>
|
|
|
</span>
|
|
|
<span v-if="showLang" class="">
|
|
|
@@ -470,7 +476,7 @@
|
|
|
</template>
|
|
|
|
|
|
<template v-else>
|
|
|
- <span style="flex-shrink: 0; width: 24px; height: 24px"></span>
|
|
|
+ <span v-if="hasVoice" style="flex-shrink: 0; width: 24px; height: 24px"></span>
|
|
|
</template>
|
|
|
<div class="tabNum-box">
|
|
|
<template v-if="sItem.mIndex == 0">
|
|
|
@@ -521,7 +527,7 @@
|
|
|
: '',
|
|
|
}"
|
|
|
class="NPC-word-tab-common NPC-word-tab-word"
|
|
|
- v-html="sItem.new_word"
|
|
|
+ v-html="convertText(sanitizeHTML(sItem.new_word))"
|
|
|
>
|
|
|
</span>
|
|
|
<span
|
|
|
@@ -554,7 +560,7 @@
|
|
|
<p
|
|
|
class="NPC-word-tab-common NPC-word-tab-cixing"
|
|
|
:class="[/[\u4E00-\u9FA5\uF900-\uFA2D]/.test(sItem.cixing) ? 'hasCn' : '']"
|
|
|
- v-html="sItem.cixing"
|
|
|
+ v-html="convertText(sanitizeHTML(sItem.cixing))"
|
|
|
></p>
|
|
|
<span
|
|
|
v-if="
|
|
|
@@ -569,7 +575,10 @@
|
|
|
</span>
|
|
|
</span>
|
|
|
<span :style="{ width: data.col_width[3].value + 'px' }">
|
|
|
- <p class="NPC-word-tab-common NPC-word-tab-def" v-html="sItem.def_str"></p>
|
|
|
+ <p
|
|
|
+ class="NPC-word-tab-common NPC-word-tab-def"
|
|
|
+ v-html="convertText(sanitizeHTML(sItem.def_str))"
|
|
|
+ ></p>
|
|
|
<span
|
|
|
v-if="
|
|
|
showLang &&
|
|
|
@@ -614,7 +623,7 @@
|
|
|
? data.unified_attrib.font_size
|
|
|
: '',
|
|
|
}"
|
|
|
- v-html="sItem.new_word"
|
|
|
+ v-html="convertText(sanitizeHTML(sItem.new_word))"
|
|
|
></p>
|
|
|
<span
|
|
|
v-if="
|
|
|
@@ -650,7 +659,7 @@
|
|
|
<p
|
|
|
class="NPC-word-tab-common NPC-word-tab-cixing"
|
|
|
:class="[/[\u4E00-\u9FA5\uF900-\uFA2D]/.test(sItem.cixing) ? 'hasCn' : '']"
|
|
|
- v-html="sItem.cixing"
|
|
|
+ v-html="convertText(sanitizeHTML(sItem.cixing))"
|
|
|
></p>
|
|
|
|
|
|
<span
|
|
|
@@ -666,7 +675,10 @@
|
|
|
</span>
|
|
|
</span>
|
|
|
<span :style="{ width: data.col_width[3].value + 'px' }">
|
|
|
- <p class="NPC-word-tab-common NPC-word-tab-def" v-html="sItem.def_str"></p>
|
|
|
+ <p
|
|
|
+ class="NPC-word-tab-common NPC-word-tab-def"
|
|
|
+ v-html="convertText(sanitizeHTML(sItem.def_str))"
|
|
|
+ ></p>
|
|
|
<span
|
|
|
v-if="
|
|
|
showLang &&
|
|
|
@@ -701,7 +713,10 @@
|
|
|
</div>
|
|
|
|
|
|
<div v-if="sItem.collocation" :style="{ width: data.col_width[4].value + 'px' }">
|
|
|
- <span class="collocation"><span>搭配:</span><b v-html="sItem.collocation"></b></span>
|
|
|
+ <span class="collocation"
|
|
|
+ ><span>{{ convertText('搭配:') }}</span
|
|
|
+ ><b v-html="convertText(sanitizeHTML(sItem.collocation))"></b
|
|
|
+ ></span>
|
|
|
<span v-if="showLang" class="">
|
|
|
{{
|
|
|
multilingualTextList[getLang()] &&
|
|
|
@@ -714,9 +729,9 @@
|
|
|
</div>
|
|
|
<div v-if="sItem.liju_list" :style="{ width: data.col_width[5].value + 'px' }">
|
|
|
<span class="collocation"
|
|
|
- ><span>例句:</span>
|
|
|
+ ><span>{{ convertText('例句:') }}</span>
|
|
|
<div>
|
|
|
- <b v-html="sItem.liju_list"></b>
|
|
|
+ <b v-html="convertText(sanitizeHTML(sItem.liju_list))"></b>
|
|
|
</div>
|
|
|
</span>
|
|
|
<span v-if="showLang" class="">
|
|
|
@@ -772,7 +787,7 @@
|
|
|
}"
|
|
|
>
|
|
|
<div class="header-info-preview">
|
|
|
- <h5 :style="{ textAlign: 'left' }">{{ item.header_con }}</h5>
|
|
|
+ <h5 :style="{ textAlign: 'left' }">{{ convertText(item.header_con) }}</h5>
|
|
|
<label
|
|
|
:style="{
|
|
|
background:
|
|
|
@@ -780,7 +795,7 @@
|
|
|
? data.unified_attrib.topic_color
|
|
|
: '',
|
|
|
}"
|
|
|
- >{{ item.label }}</label
|
|
|
+ >{{ convertText(item.label) }}</label
|
|
|
>
|
|
|
</div>
|
|
|
<div v-if="item.file_list[0]" class="item-image">
|
|
|
@@ -800,7 +815,7 @@
|
|
|
/>
|
|
|
</div>
|
|
|
<h2 v-if="item.new_word" :class="['con-preview', item.file_list[0] ? '' : 'con-preview-big']">
|
|
|
- {{ item.new_word }}
|
|
|
+ {{ convertText(item.new_word) }}
|
|
|
</h2>
|
|
|
|
|
|
<a class="overturn-btn" @click="changeShowLeft(item)"><i class="el-icon-refresh"></i></a>
|
|
|
@@ -815,7 +830,7 @@
|
|
|
}"
|
|
|
>
|
|
|
<div class="header-info-preview">
|
|
|
- <h5 :style="{ textAlign: 'left' }">{{ item.header_con }}</h5>
|
|
|
+ <h5 :style="{ textAlign: 'left' }">{{ convertText(item.header_con) }}</h5>
|
|
|
<label
|
|
|
:style="{
|
|
|
background:
|
|
|
@@ -823,7 +838,7 @@
|
|
|
? data.unified_attrib.topic_color
|
|
|
: '',
|
|
|
}"
|
|
|
- >{{ item.label }}</label
|
|
|
+ >{{ convertText(item.label) }}</label
|
|
|
>
|
|
|
</div>
|
|
|
<div
|
|
|
@@ -943,12 +958,12 @@
|
|
|
}"
|
|
|
>
|
|
|
<div v-if="item.cixing">
|
|
|
- <label class="card-label">词性:</label>
|
|
|
- <p v-html="item.cixing"></p>
|
|
|
+ <label class="card-label">{{ convertText('词性:') }}</label>
|
|
|
+ <p v-html="convertText(sanitizeHTML(item.cixing))"></p>
|
|
|
</div>
|
|
|
<div v-if="item.definition_list">
|
|
|
- <label class="card-label">释义:</label>
|
|
|
- <p v-html="item.definition_list"></p>
|
|
|
+ <label class="card-label">{{ convertText('释义:') }}</label>
|
|
|
+ <p v-html="convertText(sanitizeHTML(item.definition_list))"></p>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -967,21 +982,21 @@
|
|
|
>
|
|
|
<template v-if="!(item.collocation || item.liju_list) || item.new_word.length >= 4">
|
|
|
<div v-if="item.cixing">
|
|
|
- <label class="card-label">词性:</label>
|
|
|
- <p v-html="item.cixing"></p>
|
|
|
+ <label class="card-label">{{ convertText('词性:') }}</label>
|
|
|
+ <p v-html="convertText(sanitizeHTML(item.cixing))"></p>
|
|
|
</div>
|
|
|
<div v-if="item.definition_list">
|
|
|
- <label class="card-label">释义:</label>
|
|
|
- <p v-html="item.definition_list"></p>
|
|
|
+ <label class="card-label">{{ convertText('释义:') }}</label>
|
|
|
+ <p v-html="convertText(sanitizeHTML(item.definition_list))"></p>
|
|
|
</div>
|
|
|
</template>
|
|
|
<div v-if="item.collocation">
|
|
|
- <label class="card-label">搭配:</label>
|
|
|
- <p v-html="item.collocation"></p>
|
|
|
+ <label class="card-label">{{ convertText('搭配:') }}</label>
|
|
|
+ <p v-html="convertText(sanitizeHTML(item.collocation))"></p>
|
|
|
</div>
|
|
|
<div v-if="item.liju_list">
|
|
|
- <label class="card-label">例句:</label>
|
|
|
- <p v-html="item.liju_list"></p>
|
|
|
+ <label class="card-label">{{ convertText('例句:') }}</label>
|
|
|
+ <p v-html="convertText(sanitizeHTML(item.liju_list))"></p>
|
|
|
</div>
|
|
|
</div>
|
|
|
<a class="overturn-btn" @click="changeShowLeft(item)"><i class="el-icon-refresh"></i></a>
|
|
|
@@ -1133,6 +1148,7 @@ export default {
|
|
|
showCard: false, // 卡片放大
|
|
|
showIndex: 0, // 卡片放大索引
|
|
|
dataHeight: 0, // 组件列表中容器高度
|
|
|
+ hasVoice: false, // 整体是否有读音
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -1273,6 +1289,7 @@ export default {
|
|
|
this.$refs.newwordAudio.pause();
|
|
|
},
|
|
|
initData() {
|
|
|
+ this.hasVoice = false;
|
|
|
this.rowWidth = 0;
|
|
|
this.data.col_width.forEach((item) => {
|
|
|
this.rowWidth += Number(item.value);
|
|
|
@@ -1292,6 +1309,7 @@ export default {
|
|
|
// GetFileURLMap({ file_id_list: [this.data.audio_data.file_id] }).then(({ url_map }) => {
|
|
|
// this.data.audio_data.url = url_map[this.data.audio_data.file_id];
|
|
|
// });
|
|
|
+ this.hasVoice = true;
|
|
|
}
|
|
|
this.data.new_word_list.forEach((item) => {
|
|
|
if (item.number) {
|
|
|
@@ -1305,6 +1323,7 @@ export default {
|
|
|
GetFileURLMap({ file_id_list: [item.mp3_list] }).then(({ url_map }) => {
|
|
|
this.$set(item, 'mp3_list_url', url_map[item.mp3_list]);
|
|
|
});
|
|
|
+ this.hasVoice = true;
|
|
|
}
|
|
|
// if (item.file_list && item.file_list[0]) {
|
|
|
// GetFileURLMap({ file_id_list: item.file_list }).then(({ url_map }) => {
|