|
@@ -42,10 +42,11 @@
|
|
? 'red-border'
|
|
? 'red-border'
|
|
: 'brown-border',
|
|
: 'brown-border',
|
|
]"
|
|
]"
|
|
|
|
+ v-if="data.new_word_str.length<=4"
|
|
>
|
|
>
|
|
<div
|
|
<div
|
|
class="strockplay"
|
|
class="strockplay"
|
|
- v-for="(conItem, conindex) in data.new_word"
|
|
|
|
|
|
+ v-for="(conItem, conindex) in data.new_word_str"
|
|
:key="'new_word_' + conindex"
|
|
:key="'new_word_' + conindex"
|
|
>
|
|
>
|
|
<Strockplayredline
|
|
<Strockplayredline
|
|
@@ -53,7 +54,7 @@
|
|
:Book_text="conItem"
|
|
:Book_text="conItem"
|
|
:playStorkes="true"
|
|
:playStorkes="true"
|
|
:targetDiv="'bwcHanziIntp' + conItem + detailIndex + conindex"
|
|
:targetDiv="'bwcHanziIntp' + conItem + detailIndex + conindex"
|
|
- :wordNum="data.new_word.length"
|
|
|
|
|
|
+ :wordNum="data.new_word_str.length"
|
|
:themeColor="themeColor"
|
|
:themeColor="themeColor"
|
|
/>
|
|
/>
|
|
<div
|
|
<div
|
|
@@ -65,10 +66,22 @@
|
|
? 'red-bg'
|
|
? 'red-bg'
|
|
: 'brown-bg',
|
|
: 'brown-bg',
|
|
]"
|
|
]"
|
|
- v-if="conindex < data.new_word.length - 1"
|
|
|
|
|
|
+ v-if="conindex < data.new_word_str.length - 1"
|
|
></div>
|
|
></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <p v-else :class="[
|
|
|
|
+ 'bwc-tolength',
|
|
|
|
+ themeColor == 'green'
|
|
|
|
+ ? 'green-border'
|
|
|
|
+ : themeColor == 'red'
|
|
|
|
+ ? 'red-border'
|
|
|
|
+ : 'brown-border',
|
|
|
|
+ ]">
|
|
|
|
+ <span v-for="(item, index) in data.new_word_str" :key="index">{{
|
|
|
|
+ item
|
|
|
|
+ }}</span>
|
|
|
|
+ </p>
|
|
<div class="wordInfor">
|
|
<div class="wordInfor">
|
|
<div class="yinpin">
|
|
<div class="yinpin">
|
|
<span class="pinyintext"> {{ data.pinyin.toLowerCase() }}</span>
|
|
<span class="pinyintext"> {{ data.pinyin.toLowerCase() }}</span>
|
|
@@ -403,6 +416,7 @@ export default {
|
|
CurrentList: [],
|
|
CurrentList: [],
|
|
sortIndex: 0,
|
|
sortIndex: 0,
|
|
chsFhList: [",", "。", "”", ":", "》", "?", "!", ";"],
|
|
chsFhList: [",", "。", "”", ":", "》", "?", "!", ";"],
|
|
|
|
+ punctuationList: ['(',')','……','(',')','…'], // 标点数组
|
|
};
|
|
};
|
|
},
|
|
},
|
|
//计算属性 类似于data概念
|
|
//计算属性 类似于data概念
|
|
@@ -940,31 +954,43 @@ export default {
|
|
// 处理数据
|
|
// 处理数据
|
|
handleChineseDetail() {
|
|
handleChineseDetail() {
|
|
let _this = this;
|
|
let _this = this;
|
|
- _this.dataDetail.forEach((item) => {
|
|
|
|
- if (item.request.queryType == "entity") {
|
|
|
|
- // 读音
|
|
|
|
- item.response.entity.forEach((items) => {
|
|
|
|
- items.attrs.forEach((itemss) => {
|
|
|
|
- if (itemss.key == "pronunciation") {
|
|
|
|
- // 音频
|
|
|
|
- let Mname = "tool-TextToVoiceFile";
|
|
|
|
- getContentFile(Mname, { text: this.word.detail.new_word }).then(
|
|
|
|
- (res) => {
|
|
|
|
- _this.mp3Url = res.file_url;
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
- // _this.data.mp3Url = itemss.objects[0]["@value"]
|
|
|
|
- // ? itemss.objects[0]["@value"]
|
|
|
|
- // : "";
|
|
|
|
- }
|
|
|
|
|
|
+ if(_this.dataDetail){
|
|
|
|
+ _this.dataDetail.forEach((item) => {
|
|
|
|
+ if (item.request.queryType == "entity") {
|
|
|
|
+ // 读音
|
|
|
|
+ item.response.entity.forEach((items) => {
|
|
|
|
+ items.attrs.forEach((itemss) => {
|
|
|
|
+ if (itemss.key == "pronunciation") {
|
|
|
|
+ // 音频
|
|
|
|
+ let Mname = "tool-TextToVoiceFile";
|
|
|
|
+ getContentFile(Mname, { text: this.word.detail.new_word }).then(
|
|
|
|
+ (res) => {
|
|
|
|
+ _this.mp3Url = res.file_url;
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ // _this.data.mp3Url = itemss.objects[0]["@value"]
|
|
|
|
+ // ? itemss.objects[0]["@value"]
|
|
|
|
+ // : "";
|
|
|
|
+ }
|
|
|
|
+ });
|
|
});
|
|
});
|
|
- });
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
},
|
|
},
|
|
},
|
|
},
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
- created() {},
|
|
|
|
|
|
+ created() {
|
|
|
|
+ // 去掉生词里的标点
|
|
|
|
+ let new_word_str = ""
|
|
|
|
+ for(let i = 0;i<this.data.new_word.length;i++){
|
|
|
|
+ if(this.punctuationList.indexOf(this.data.new_word[i])==-1){
|
|
|
|
+ new_word_str+=this.data.new_word[i]
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.data.new_word_str = new_word_str
|
|
|
|
+ },
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
mounted() {
|
|
mounted() {
|
|
let _this = this;
|
|
let _this = this;
|
|
@@ -1080,6 +1106,17 @@ export default {
|
|
background: #bd8865;
|
|
background: #bd8865;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ .bwc-tolength {
|
|
|
|
+ color: #404040;
|
|
|
|
+ font-size: 30px;
|
|
|
|
+ line-height: 1.5;
|
|
|
|
+ font-family: FZJCGFKTK;
|
|
|
|
+ text-align: center;
|
|
|
|
+ border: 2px solid #d47064;
|
|
|
|
+ border-radius: 8px;
|
|
|
|
+ padding: 40px 0;
|
|
|
|
+ margin: 0 37px 16px 0;
|
|
|
|
+ }
|
|
.red-border {
|
|
.red-border {
|
|
border: 2px solid #ff5757;
|
|
border: 2px solid #ff5757;
|
|
}
|
|
}
|