|
@@ -68,9 +68,29 @@
|
|
<b class="content-en" v-if="curQue.en">{{ curQue.en }}</b>
|
|
<b class="content-en" v-if="curQue.en">{{ curQue.en }}</b>
|
|
</div>
|
|
</div>
|
|
<div class="item-intro-box">
|
|
<div class="item-intro-box">
|
|
- <div class="item-intro" v-if="curQue.con">
|
|
|
|
|
|
+ <div class="item-intro" :style="{textIndent:curQue.textindent?'2em':''}" v-if="curQue.con">
|
|
{{ curQue.con }}
|
|
{{ curQue.con }}
|
|
</div>
|
|
</div>
|
|
|
|
+ <template v-if="curQue.conDetail&&curQue.conDetail.sentence">
|
|
|
|
+ <div class="item-intro">
|
|
|
|
+ <OneSentenceTemp
|
|
|
|
+ :detail="curQue.conDetail"
|
|
|
|
+ :TaskModel="TaskModel"
|
|
|
|
+ :Bookanswer="[]"
|
|
|
|
+ :correctAnswer="[]"
|
|
|
|
+ :isInput="
|
|
|
|
+ false
|
|
|
|
+ "
|
|
|
|
+ :pyPosition="'top'"
|
|
|
|
+ :pyColors="'rgba(255, 255, 255, 0.85)'"
|
|
|
|
+ :fn_check_list="[]"
|
|
|
|
+ :pyNumber="pyNumber"
|
|
|
|
+ :record_check="[]"
|
|
|
|
+ :maxFontsize="maxFontsize"
|
|
|
|
+ :textIndent="curQue.textindent"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
</div>
|
|
</div>
|
|
<a class="start-btn" @click="handleNNPEnext">开始学习</a>
|
|
<a class="start-btn" @click="handleNNPEnext">开始学习</a>
|
|
</div>
|
|
</div>
|
|
@@ -79,15 +99,18 @@
|
|
<script>
|
|
<script>
|
|
//这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
|
|
//这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
|
|
//例如:import 《组件名称》from ‘《组件路径》';
|
|
//例如:import 《组件名称》from ‘《组件路径》';
|
|
|
|
+import OneSentenceTemp from "./components/OneSentenceTemp.vue";
|
|
export default {
|
|
export default {
|
|
//import引入的组件需要注入到对象中才能使用
|
|
//import引入的组件需要注入到对象中才能使用
|
|
- components: {},
|
|
|
|
- props: ["curQue", "handleNNPEnext"],
|
|
|
|
|
|
+ components: {OneSentenceTemp},
|
|
|
|
+ props: ["curQue", "handleNNPEnext","TaskModel"],
|
|
data() {
|
|
data() {
|
|
//这里存放数据
|
|
//这里存放数据
|
|
return {
|
|
return {
|
|
chsFhList: [",", "。", "“", ":", "》", "?", "!", ";"],
|
|
chsFhList: [",", "。", "“", ":", "》", "?", "!", ";"],
|
|
noFont: ["~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")"], // 对应不要拼音字体
|
|
noFont: ["~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")"], // 对应不要拼音字体
|
|
|
|
+ pyNumber: 0,
|
|
|
|
+ maxFontsize: 16
|
|
};
|
|
};
|
|
},
|
|
},
|
|
//计算属性 类似于data概念
|
|
//计算属性 类似于data概念
|
|
@@ -98,18 +121,45 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
// 处理数据
|
|
// 处理数据
|
|
handleData() {
|
|
handleData() {
|
|
- let _this = this;
|
|
|
|
- let curQue = JSON.parse(JSON.stringify(this.curQue));
|
|
|
|
- let paraArr = [];
|
|
|
|
- curQue.detail.wordsList.forEach((sItem, sIndex) => {
|
|
|
|
- let obj = {
|
|
|
|
- pinyin: sItem.pinyin,
|
|
|
|
- chs: sItem.chs,
|
|
|
|
- isShow: true,
|
|
|
|
- };
|
|
|
|
- paraArr.push(obj);
|
|
|
|
- });
|
|
|
|
- this.$set(_this.curQue.detail, "resArr", paraArr);
|
|
|
|
|
|
+ let _this = this;
|
|
|
|
+ let curQue = JSON.parse(JSON.stringify(this.curQue));
|
|
|
|
+ let paraArr = [];
|
|
|
|
+ curQue.detail.wordsList.forEach((sItem, sIndex) => {
|
|
|
|
+ let obj = {
|
|
|
|
+ pinyin: sItem.pinyin,
|
|
|
|
+ chs: sItem.chs,
|
|
|
|
+ isShow: true,
|
|
|
|
+ };
|
|
|
|
+ paraArr.push(obj);
|
|
|
|
+ });
|
|
|
|
+ this.$set(_this.curQue.detail, "resArr", paraArr);
|
|
|
|
+
|
|
|
|
+ if(this.curQue.hasOwnProperty("conDetail")){
|
|
|
|
+ let isHasPY = 0;
|
|
|
|
+ let maxFontsize = 16;
|
|
|
|
+ if (this.curQue.conDetail.wordsList.length > 0) {
|
|
|
|
+ this.curQue.conDetail.wordsList.forEach((sItem, sIndex) => {
|
|
|
|
+ this.mergeWordSymbol(sItem);
|
|
|
|
+ if (sItem.pinyin) {
|
|
|
|
+ isHasPY++;
|
|
|
|
+ }
|
|
|
|
+ sItem.fontColor='rgba(255, 255, 255, 0.85)'
|
|
|
|
+ let fontSize = JSON.parse(JSON.stringify(sItem.fontSize));
|
|
|
|
+ fontSize = Number(fontSize.replace("px", ""));
|
|
|
|
+ maxFontsize = fontSize > maxFontsize ? fontSize : maxFontsize;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ this.maxFontsize = maxFontsize;
|
|
|
|
+ this.pyNumber = isHasPY;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //词和标点合一起
|
|
|
|
+ mergeWordSymbol(sItem) {
|
|
|
|
+ if (this.chsFhList.indexOf(sItem.chs) > -1) {
|
|
|
|
+ sItem.isShow = false;
|
|
|
|
+ } else {
|
|
|
|
+ sItem.isShow = true;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
},
|
|
},
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|