|
|
@@ -24,6 +24,7 @@
|
|
|
activeWordIndex === indexC
|
|
|
? 'active'
|
|
|
: '',
|
|
|
+ indexC === 0 ? 'text-left' : '',
|
|
|
]"
|
|
|
:style="{
|
|
|
color:
|
|
|
@@ -38,7 +39,154 @@
|
|
|
}"
|
|
|
@click="palyWord(indexC)"
|
|
|
>
|
|
|
- {{ itemC.wordsName || itemC.onebest }}
|
|
|
+ <!-- {{ itemC.wordsName || itemC.onebest }} -->
|
|
|
+ <template v-if="itemC.isShow">
|
|
|
+ <template
|
|
|
+ v-if="
|
|
|
+ data[sentenceActive].wordsResultList[indexC + 1] &&
|
|
|
+ data[sentenceActive].wordsResultList[indexC + 1].wordsName &&
|
|
|
+ chsFhList.indexOf(data[sentenceActive].wordsResultList[indexC + 1].wordsName) > -1
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <span class="NNPE-words-box">
|
|
|
+ <span
|
|
|
+ v-if="property.pinyin_position == 'top' && property.view_pinyin === 'true'"
|
|
|
+ :class="['NNPE-pinyin', noFont.indexOf(itemC.pinyin) > -1 ? 'noFont' : '']"
|
|
|
+ :style="{ fontSize: fontSize - 6 + 'px' }"
|
|
|
+ >{{
|
|
|
+ property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true'
|
|
|
+ ? itemC.pinyin_up
|
|
|
+ : itemC.pinyin
|
|
|
+ }}</span
|
|
|
+ >
|
|
|
+ <span class="NNPE-chs">
|
|
|
+ <template>
|
|
|
+ <span>{{ itemC.wordsName }}</span>
|
|
|
+ </template>
|
|
|
+ </span>
|
|
|
+ <span
|
|
|
+ v-if="property.pinyin_position == 'bottom' && property.view_pinyin === 'true'"
|
|
|
+ :class="['NNPE-pinyin', noFont.indexOf(itemC.pinyin) > -1 ? 'noFont' : '']"
|
|
|
+ :style="{ fontSize: fontSize - 6 + 'px' }"
|
|
|
+ >{{
|
|
|
+ property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true'
|
|
|
+ ? itemC.pinyin_up
|
|
|
+ : itemC.pinyin
|
|
|
+ }}</span
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ <span class="NNPE-words-box">
|
|
|
+ <span
|
|
|
+ v-if="property.pinyin_position == 'top' && property.view_pinyin === 'true'"
|
|
|
+ :class="[
|
|
|
+ 'NNPE-pinyin',
|
|
|
+ noFont.indexOf(data[sentenceActive].wordsResultList[indexC + 1].pinyin) > -1 ? 'noFont' : '',
|
|
|
+ ]"
|
|
|
+ :style="{ fontSize: fontSize - 6 + 'px' }"
|
|
|
+ style="text-align: left"
|
|
|
+ >{{
|
|
|
+ property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true'
|
|
|
+ ? data[sentenceActive].wordsResultList[indexC + 1].pinyin_up
|
|
|
+ : data[sentenceActive].wordsResultList[indexC + 1].pinyin
|
|
|
+ }}</span
|
|
|
+ >
|
|
|
+ <span class="NNPE-chs" style="text-align: left">{{
|
|
|
+ data[sentenceActive].wordsResultList[indexC + 1].wordsName
|
|
|
+ }}</span>
|
|
|
+ <span
|
|
|
+ v-if="property.pinyin_position == 'bottom' && property.view_pinyin === 'true'"
|
|
|
+ :class="[
|
|
|
+ 'NNPE-pinyin',
|
|
|
+ noFont.indexOf(data[sentenceActive].wordsResultList[indexC + 1].pinyin) > -1 ? 'noFont' : '',
|
|
|
+ ]"
|
|
|
+ :style="{ fontSize: fontSize - 6 + 'px' }"
|
|
|
+ style="text-align: left"
|
|
|
+ >{{
|
|
|
+ property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true'
|
|
|
+ ? data[sentenceActive].wordsResultList[indexC + 1].pinyin_up
|
|
|
+ : data[sentenceActive].wordsResultList[indexC + 1].pinyin
|
|
|
+ }}</span
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ <span
|
|
|
+ v-if="
|
|
|
+ data[sentenceActive].wordsResultList[indexC + 2] &&
|
|
|
+ data[sentenceActive].wordsResultList[indexC + 2].wordsName &&
|
|
|
+ chsFhList.indexOf(data[sentenceActive].wordsResultList[indexC + 2].wordsName) > -1
|
|
|
+ "
|
|
|
+ class="NNPE-words-box"
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ v-if="property.pinyin_position == 'top' && property.view_pinyin === 'true'"
|
|
|
+ :class="[
|
|
|
+ 'NNPE-pinyin',
|
|
|
+ noFont.indexOf(data[sentenceActive].wordsResultList[indexC + 2].pinyin) > -1 ? 'noFont' : '',
|
|
|
+ ]"
|
|
|
+ :style="{ fontSize: fontSize - 6 + 'px' }"
|
|
|
+ style="text-align: left"
|
|
|
+ >{{
|
|
|
+ property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true'
|
|
|
+ ? data[sentenceActive].wordsResultList[indexC + 2].pinyin_up
|
|
|
+ : data[sentenceActive].wordsResultList[indexC + 2].pinyin
|
|
|
+ }}</span
|
|
|
+ >
|
|
|
+ <span class="NNPE-chs" style="text-align: left">{{
|
|
|
+ data[sentenceActive].wordsResultList[indexC + 2].wordsName
|
|
|
+ }}</span>
|
|
|
+ <span
|
|
|
+ v-if="property.pinyin_position == 'bottom' && property.view_pinyin === 'true'"
|
|
|
+ :class="[
|
|
|
+ 'NNPE-pinyin',
|
|
|
+ noFont.indexOf(data[sentenceActive].wordsResultList[indexC + 2].pinyin) > -1 ? 'noFont' : '',
|
|
|
+ ]"
|
|
|
+ style="text-align: left"
|
|
|
+ :style="{ fontSize: fontSize - 6 + 'px' }"
|
|
|
+ >{{
|
|
|
+ property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true'
|
|
|
+ ? data[sentenceActive].wordsResultList[indexC + 2].pinyin_up
|
|
|
+ : data[sentenceActive].wordsResultList[indexC + 2].pinyin
|
|
|
+ }}</span
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <span class="NNPE-words-box">
|
|
|
+ <span
|
|
|
+ v-if="property.pinyin_position == 'top' && property.view_pinyin === 'true'"
|
|
|
+ class="NNPE-pinyin"
|
|
|
+ :class="[
|
|
|
+ itemC.wordsName != '“' && itemC.padding ? 'padding' : '',
|
|
|
+ noFont.indexOf(itemC.pinyin) > -1 ? 'noFont' : '',
|
|
|
+ ]"
|
|
|
+ :style="{ fontSize: fontSize - 6 + 'px' }"
|
|
|
+ >{{
|
|
|
+ property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true'
|
|
|
+ ? itemC.pinyin_up
|
|
|
+ : itemC.pinyin
|
|
|
+ }}</span
|
|
|
+ >
|
|
|
+ <span class="NNPE-chs">
|
|
|
+ <template>
|
|
|
+ <span>{{ itemC.wordsName }}</span>
|
|
|
+ </template>
|
|
|
+ </span>
|
|
|
+ <span
|
|
|
+ v-if="property.pinyin_position == 'bottom' && property.view_pinyin === 'true'"
|
|
|
+ class="NNPE-pinyin"
|
|
|
+ :class="[
|
|
|
+ itemC.wordsName != '“' && itemC.padding ? 'padding' : '',
|
|
|
+ noFont.indexOf(itemC.pinyin) > -1 ? 'noFont' : '',
|
|
|
+ ]"
|
|
|
+ :style="{ fontSize: fontSize - 6 + 'px' }"
|
|
|
+ >{{
|
|
|
+ property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true'
|
|
|
+ ? itemC.pinyin_up
|
|
|
+ : itemC.pinyin
|
|
|
+ }}</span
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</template>
|
|
|
<div class="NPC-notes-note" v-if="multilingualTextList[sentenceActive]">
|
|
|
@@ -113,7 +261,7 @@
|
|
|
export default {
|
|
|
//import引入的组件需要注入到对象中才能使用
|
|
|
components: {},
|
|
|
- props: ['fontSize', 'sentenceTheme', 'data', 'activeIndex', 'mp3Url', 'multilingualTextList'],
|
|
|
+ props: ['fontSize', 'sentenceTheme', 'data', 'activeIndex', 'mp3Url', 'multilingualTextList', 'property'],
|
|
|
data() {
|
|
|
//这里存放数据
|
|
|
return {
|
|
|
@@ -193,6 +341,8 @@ export default {
|
|
|
audio: new Audio(),
|
|
|
ed: null,
|
|
|
activeWordIndex: null,
|
|
|
+ chsFhList: [',', '。', '”', ':', '》', '?', '!', ';', '#', '、'],
|
|
|
+ noFont: ['~', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '/'],
|
|
|
};
|
|
|
},
|
|
|
//计算属性 类似于data概念
|
|
|
@@ -266,9 +416,27 @@ export default {
|
|
|
this.$emit('changeTheme', index);
|
|
|
}
|
|
|
},
|
|
|
+ handleData() {
|
|
|
+ this.data.forEach((item) => {
|
|
|
+ item.wordsResultList.forEach((wItem, wIndex) => {
|
|
|
+ wItem.wordsName = wItem.wordsName ? wItem.wordsName : wItem.onebest;
|
|
|
+ this.mergeWordSymbol(wItem);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 词和标点合一起
|
|
|
+ mergeWordSymbol(wItem) {
|
|
|
+ if (this.chsFhList.indexOf(wItem.wordsName) > -1) {
|
|
|
+ wItem.isShow = false;
|
|
|
+ } else {
|
|
|
+ wItem.isShow = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
- created() {},
|
|
|
+ created() {
|
|
|
+ this.handleData();
|
|
|
+ },
|
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {
|
|
|
let _this = this;
|
|
|
@@ -358,15 +526,65 @@ export default {
|
|
|
border-radius: 8px;
|
|
|
|
|
|
.content-item {
|
|
|
- // margin: 0 6px 0 0;
|
|
|
- font-family: '楷体';
|
|
|
- font-size: 20px;
|
|
|
- line-height: 40px;
|
|
|
- cursor: pointer;
|
|
|
+ display: flex;
|
|
|
+ padding-bottom: 6px;
|
|
|
+
|
|
|
+ .NNPE-words-box {
|
|
|
+ padding: 0 1px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .NNPE-pinyin {
|
|
|
+ display: block;
|
|
|
+ min-height: 22px;
|
|
|
+ font-family: 'League';
|
|
|
+ font-weight: normal;
|
|
|
+ line-height: 1.4;
|
|
|
+ text-align: center;
|
|
|
+
|
|
|
+ &.noFont {
|
|
|
+ font-family: initial;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.textLeft {
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.textRight {
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .NNPE-chs {
|
|
|
+ display: flex;
|
|
|
+ display: block;
|
|
|
+ flex-flow: wrap;
|
|
|
+ font-family: '楷体';
|
|
|
+ line-height: 1.4;
|
|
|
+ text-align: center;
|
|
|
+
|
|
|
+ &.overActive {
|
|
|
+ background: rgba(0, 0, 0, 6%);
|
|
|
+ }
|
|
|
+
|
|
|
+ &.active {
|
|
|
+ background: rgba(222, 68, 68, 15%);
|
|
|
+ }
|
|
|
+
|
|
|
+ &.wordActive {
|
|
|
+ color: rgba(222, 68, 68, 100%);
|
|
|
+ }
|
|
|
+
|
|
|
+ .wordActive {
|
|
|
+ color: rgba(222, 68, 68, 100%);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- // &.active {
|
|
|
- // font-weight: 700;
|
|
|
- // }
|
|
|
+ &.text-left {
|
|
|
+ .NNPE-chs,
|
|
|
+ .NNPE-pinyin {
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|