|
@@ -4,7 +4,7 @@
|
|
|
:class="[
|
|
|
'sentence-temp',
|
|
|
sentenceTempOption,
|
|
|
- sentType == 'option' ? 'sentence-temp-option' : '',
|
|
|
+ sentType == 'option' ? 'sentence-temp-option' : ''
|
|
|
]"
|
|
|
v-if="detail"
|
|
|
>
|
|
@@ -15,7 +15,7 @@
|
|
|
sentType == 'option' ? 'RLC-sentence-option' : '',
|
|
|
detail.pyNumber && detail.pyNumber[index] > 0
|
|
|
? 'RLC-sentence-hasPY'
|
|
|
- : '',
|
|
|
+ : ''
|
|
|
]"
|
|
|
v-for="(item, index) in detail.wordsList"
|
|
|
:key="'wordsList' + index"
|
|
@@ -28,7 +28,7 @@
|
|
|
pItem.chs == '“' ? 'textRight' : 'textCenter',
|
|
|
detail.pyNumber && detail.pyNumber[index] > 0
|
|
|
? 'RLC-words-hasPY'
|
|
|
- : '',
|
|
|
+ : ''
|
|
|
]"
|
|
|
:style="{
|
|
|
paddingLeft:
|
|
@@ -40,23 +40,23 @@
|
|
|
pItem.wordPadding.indexOf('right') > -1 ||
|
|
|
(detail.pyNumber && detail.pyNumber[index] > 0)
|
|
|
? '2px'
|
|
|
- : '0px',
|
|
|
+ : '0px'
|
|
|
}"
|
|
|
>
|
|
|
<template v-if="pItem.isShow">
|
|
|
<template
|
|
|
v-if="
|
|
|
item[pIndex + 1] &&
|
|
|
- item[pIndex + 1].chs &&
|
|
|
- chsFhList.indexOf(item[pIndex + 1].chs) > -1
|
|
|
+ item[pIndex + 1].chs &&
|
|
|
+ chsFhList.indexOf(item[pIndex + 1].chs) > -1
|
|
|
"
|
|
|
>
|
|
|
<span class="RLC-words-box">
|
|
|
<span
|
|
|
v-if="
|
|
|
detail.pyNumber &&
|
|
|
- detail.pyNumber[index] > 0 &&
|
|
|
- pyPosition == 'top'
|
|
|
+ detail.pyNumber[index] > 0 &&
|
|
|
+ pyPosition == 'top'
|
|
|
"
|
|
|
class="RLC-pinyin"
|
|
|
:class="[
|
|
@@ -65,8 +65,9 @@
|
|
|
pyColor == 'sub' ? 'RLC-pinyin-sub' : '',
|
|
|
pItem.pinyin && noFont.indexOf(pItem.pinyin) > -1
|
|
|
? 'noFont'
|
|
|
- : '',
|
|
|
+ : ''
|
|
|
]"
|
|
|
+ :style="{ fontSize: baseSizePhone - 2 + 'px' }"
|
|
|
>{{ pItem.pinyin | handlePY }}</span
|
|
|
>
|
|
|
<template v-if="!pItem.isHeng">
|
|
@@ -74,16 +75,15 @@
|
|
|
:class="[
|
|
|
'RLC-chs',
|
|
|
|
|
|
- sentType == 'option' ? 'RLC-chs-option' : '',
|
|
|
+ sentType == 'option' ? 'RLC-chs-option' : ''
|
|
|
]"
|
|
|
:style="{
|
|
|
- fontSize: sentType != 'option' ? pItem.fontSize : '',
|
|
|
+ fontSize: baseSizePhone + 6 + 'px',
|
|
|
color: pItem.fontColor,
|
|
|
- fontFamily: pItem.fontFamily,
|
|
|
+ fontFamily: pItem.fontFamily
|
|
|
}"
|
|
|
v-html="pItem.chs"
|
|
|
- ></span
|
|
|
- >
|
|
|
+ ></span>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
<template v-if="isInput">
|
|
@@ -91,9 +91,11 @@
|
|
|
<EditDiv
|
|
|
:id="
|
|
|
'sentenceTemp_' +
|
|
|
- Math.random().toString(36).substr(2) +
|
|
|
- '_' +
|
|
|
- index
|
|
|
+ Math.random()
|
|
|
+ .toString(36)
|
|
|
+ .substr(2) +
|
|
|
+ '_' +
|
|
|
+ index
|
|
|
"
|
|
|
class="answer-input"
|
|
|
:class="[Isexample ? 'answer-input-example' : '']"
|
|
@@ -106,6 +108,7 @@
|
|
|
? detail.hengList[index] * 60 + 'px'
|
|
|
: '120px',
|
|
|
textAlign: detail.hengList[index] ? 'center' : 'left',
|
|
|
+ fontSize: baseSizePhone + 6 + 'px'
|
|
|
}"
|
|
|
/>
|
|
|
</template>
|
|
@@ -114,33 +117,33 @@
|
|
|
v-if="pItem.chs != '#'"
|
|
|
class="RLC-chs"
|
|
|
:style="{
|
|
|
- fontSize: sentType != 'option' ? pItem.fontSize : '',
|
|
|
+ fontSize: baseSizePhone + 6 + 'px',
|
|
|
color: pItem.fontColor,
|
|
|
- fontFamily: pItem.fontFamily,
|
|
|
+ fontFamily: pItem.fontFamily
|
|
|
}"
|
|
|
:class="[
|
|
|
pItem.chs != '“' && pItem.padding ? 'padding' : '',
|
|
|
|
|
|
- sentType == 'option' ? 'RLC-chs-option' : '',
|
|
|
+ sentType == 'option' ? 'RLC-chs-option' : ''
|
|
|
]"
|
|
|
v-html="pItem.chs"
|
|
|
- ></span
|
|
|
- >
|
|
|
+ ></span>
|
|
|
</template>
|
|
|
</template>
|
|
|
<span
|
|
|
v-if="
|
|
|
detail.pyNumber &&
|
|
|
- detail.pyNumber[index] > 0 &&
|
|
|
- pyPosition == 'bottom'
|
|
|
+ detail.pyNumber[index] > 0 &&
|
|
|
+ pyPosition == 'bottom'
|
|
|
"
|
|
|
class="RLC-pinyin"
|
|
|
:class="[
|
|
|
pyColor == 'black' ? 'RLC-pinyin-black' : '',
|
|
|
pyColor == 'grey' ? 'RLC-pinyin-grey' : '',
|
|
|
pyColor == 'sub' ? 'RLC-pinyin-sub' : '',
|
|
|
- noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
|
|
|
+ noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : ''
|
|
|
]"
|
|
|
+ :style="{ fontSize: baseSizePhone - 2 + 'px' }"
|
|
|
>{{ pItem.pinyin | handlePY }}</span
|
|
|
>
|
|
|
</span>
|
|
@@ -148,19 +151,18 @@
|
|
|
<span
|
|
|
v-if="
|
|
|
detail.pyNumber &&
|
|
|
- detail.pyNumber[index] > 0 &&
|
|
|
- pyPosition == 'top'
|
|
|
+ detail.pyNumber[index] > 0 &&
|
|
|
+ pyPosition == 'top'
|
|
|
"
|
|
|
class="RLC-pinyin"
|
|
|
:class="[
|
|
|
pyColor == 'black' ? 'RLC-pinyin-black' : '',
|
|
|
pyColor == 'grey' ? 'RLC-pinyin-grey' : '',
|
|
|
pyColor == 'sub' ? 'RLC-pinyin-sub' : '',
|
|
|
- noFont.indexOf(item[pIndex + 1].pinyin) > -1
|
|
|
- ? 'noFont'
|
|
|
- : '',
|
|
|
+ noFont.indexOf(item[pIndex + 1].pinyin) > -1 ? 'noFont' : ''
|
|
|
]"
|
|
|
style="text-align: left"
|
|
|
+ :style="{ fontSize: baseSizePhone - 2 + 'px' }"
|
|
|
>{{ item[pIndex + 1].pinyin | handlePY }}</span
|
|
|
>
|
|
|
|
|
@@ -168,34 +170,31 @@
|
|
|
:class="[
|
|
|
'RLC-chs',
|
|
|
|
|
|
- sentType == 'option' ? 'RLC-chs-option' : '',
|
|
|
+ sentType == 'option' ? 'RLC-chs-option' : ''
|
|
|
]"
|
|
|
:style="{
|
|
|
- fontSize:
|
|
|
- sentType != 'option' ? item[pIndex + 1].fontSize : '',
|
|
|
+ fontSize: baseSizePhone + 6 + 'px',
|
|
|
color: item[pIndex + 1].fontColor,
|
|
|
- fontFamily: item[pIndex + 1].fontFamily,
|
|
|
+ fontFamily: item[pIndex + 1].fontFamily
|
|
|
}"
|
|
|
v-html="item[pIndex + 1].chs"
|
|
|
- ></span
|
|
|
- >
|
|
|
+ ></span>
|
|
|
|
|
|
<span
|
|
|
v-if="
|
|
|
detail.pyNumber &&
|
|
|
- detail.pyNumber[index] > 0 &&
|
|
|
- pyPosition == 'bottom'
|
|
|
+ detail.pyNumber[index] > 0 &&
|
|
|
+ pyPosition == 'bottom'
|
|
|
"
|
|
|
class="RLC-pinyin"
|
|
|
:class="[
|
|
|
pyColor == 'black' ? 'RLC-pinyin-black' : '',
|
|
|
pyColor == 'grey' ? 'RLC-pinyin-grey' : '',
|
|
|
pyColor == 'sub' ? 'RLC-pinyin-sub' : '',
|
|
|
- noFont.indexOf(item[pIndex + 1].pinyin) > -1
|
|
|
- ? 'noFont'
|
|
|
- : '',
|
|
|
+ noFont.indexOf(item[pIndex + 1].pinyin) > -1 ? 'noFont' : ''
|
|
|
]"
|
|
|
style="text-align: left"
|
|
|
+ :style="{ fontSize: baseSizePhone - 2 + 'px' }"
|
|
|
>{{ item[pIndex + 1].pinyin | handlePY }}</span
|
|
|
>
|
|
|
</span>
|
|
@@ -203,58 +202,54 @@
|
|
|
class="RLC-words-box"
|
|
|
v-if="
|
|
|
item[pIndex + 2] &&
|
|
|
- item[pIndex + 2].chs &&
|
|
|
- chsFhList.indexOf(item[pIndex + 2].chs) > -1
|
|
|
+ item[pIndex + 2].chs &&
|
|
|
+ chsFhList.indexOf(item[pIndex + 2].chs) > -1
|
|
|
"
|
|
|
>
|
|
|
<span
|
|
|
v-if="
|
|
|
detail.pyNumber &&
|
|
|
- detail.pyNumber[index] > 0 &&
|
|
|
- pyPosition == 'top'
|
|
|
+ detail.pyNumber[index] > 0 &&
|
|
|
+ pyPosition == 'top'
|
|
|
"
|
|
|
:class="[
|
|
|
'RLC-pinyin',
|
|
|
pyColor == 'black' ? 'RLC-pinyin-black' : '',
|
|
|
pyColor == 'grey' ? 'RLC-pinyin-grey' : '',
|
|
|
pyColor == 'sub' ? 'RLC-pinyin-sub' : '',
|
|
|
- noFont.indexOf(item[pIndex + 2].pinyin) > -1
|
|
|
- ? 'noFont'
|
|
|
- : '',
|
|
|
+ noFont.indexOf(item[pIndex + 2].pinyin) > -1 ? 'noFont' : ''
|
|
|
]"
|
|
|
style="text-align: left"
|
|
|
+ :style="{ fontSize: baseSizePhone - 2 + 'px' }"
|
|
|
>{{ item[pIndex + 2].pinyin }}</span
|
|
|
>
|
|
|
<span
|
|
|
:class="[
|
|
|
'RLC-chs',
|
|
|
- sentType == 'option' ? 'RLC-chs-option' : '',
|
|
|
+ sentType == 'option' ? 'RLC-chs-option' : ''
|
|
|
]"
|
|
|
:style="{
|
|
|
- fontSize:
|
|
|
- sentType != 'option' ? item[pIndex + 2].fontSize : '',
|
|
|
+ fontSize: baseSizePhone + 6 + 'px',
|
|
|
color: item[pIndex + 2].fontColor,
|
|
|
- fontFamily: item[pIndex + 2].fontFamily,
|
|
|
+ fontFamily: item[pIndex + 2].fontFamily
|
|
|
}"
|
|
|
v-html="item[pIndex + 2].chs"
|
|
|
- ></span
|
|
|
- >
|
|
|
+ ></span>
|
|
|
<span
|
|
|
v-if="
|
|
|
detail.pyNumber &&
|
|
|
- detail.pyNumber[index] > 0 &&
|
|
|
- pyPosition == 'bottom'
|
|
|
+ detail.pyNumber[index] > 0 &&
|
|
|
+ pyPosition == 'bottom'
|
|
|
"
|
|
|
:class="[
|
|
|
'RLC-pinyin',
|
|
|
pyColor == 'black' ? 'RLC-pinyin-black' : '',
|
|
|
pyColor == 'grey' ? 'RLC-pinyin-grey' : '',
|
|
|
pyColor == 'sub' ? 'RLC-pinyin-sub' : '',
|
|
|
- noFont.indexOf(item[pIndex + 2].pinyin) > -1
|
|
|
- ? 'noFont'
|
|
|
- : '',
|
|
|
+ noFont.indexOf(item[pIndex + 2].pinyin) > -1 ? 'noFont' : ''
|
|
|
]"
|
|
|
style="text-align: left"
|
|
|
+ :style="{ fontSize: baseSizePhone - 2 + 'px' }"
|
|
|
>{{ item[pIndex + 2].pinyin }}</span
|
|
|
>
|
|
|
</span>
|
|
@@ -265,8 +260,8 @@
|
|
|
<span
|
|
|
v-if="
|
|
|
detail.pyNumber &&
|
|
|
- detail.pyNumber[index] > 0 &&
|
|
|
- pyPosition == 'top'
|
|
|
+ detail.pyNumber[index] > 0 &&
|
|
|
+ pyPosition == 'top'
|
|
|
"
|
|
|
class="RLC-pinyin"
|
|
|
:class="[
|
|
@@ -274,8 +269,9 @@
|
|
|
pyColor == 'black' ? 'RLC-pinyin-black' : '',
|
|
|
pyColor == 'grey' ? 'RLC-pinyin-grey' : '',
|
|
|
pyColor == 'sub' ? 'RLC-pinyin-sub' : '',
|
|
|
- noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
|
|
|
+ noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : ''
|
|
|
]"
|
|
|
+ :style="{ fontSize: baseSizePhone - 2 + 'px' }"
|
|
|
>{{ pItem.pinyin | handlePY }}</span
|
|
|
>
|
|
|
<template v-if="!pItem.isHeng">
|
|
@@ -283,17 +279,16 @@
|
|
|
v-if="pItem.chs != '#'"
|
|
|
class="RLC-chs"
|
|
|
:style="{
|
|
|
- fontSize: sentType != 'option' ? pItem.fontSize : '',
|
|
|
+ fontSize: baseSizePhone + 6 + 'px',
|
|
|
color: pItem.fontColor,
|
|
|
- fontFamily: pItem.fontFamily,
|
|
|
+ fontFamily: pItem.fontFamily
|
|
|
}"
|
|
|
:class="[
|
|
|
pItem.chs != '“' && pItem.padding ? 'padding' : '',
|
|
|
- sentType == 'option' ? 'RLC-chs-option' : '',
|
|
|
+ sentType == 'option' ? 'RLC-chs-option' : ''
|
|
|
]"
|
|
|
v-html="pItem.chs"
|
|
|
- ></span
|
|
|
- >
|
|
|
+ ></span>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
<template v-if="isInput">
|
|
@@ -301,9 +296,11 @@
|
|
|
<EditDiv
|
|
|
:id="
|
|
|
'sentenceTemp_' +
|
|
|
- Math.random().toString(36).substr(2) +
|
|
|
- '_' +
|
|
|
- index
|
|
|
+ Math.random()
|
|
|
+ .toString(36)
|
|
|
+ .substr(2) +
|
|
|
+ '_' +
|
|
|
+ index
|
|
|
"
|
|
|
class="answer-input"
|
|
|
:class="[Isexample ? 'answer-input-example' : '']"
|
|
@@ -317,6 +314,7 @@
|
|
|
? detail.hengList[index] * 60 + 'px'
|
|
|
: '120px',
|
|
|
textAlign: detail.hengList[index] ? 'center' : 'left',
|
|
|
+ fontSize: baseSizePhone + 6 + 'px'
|
|
|
}"
|
|
|
/>
|
|
|
</template>
|
|
@@ -325,26 +323,25 @@
|
|
|
v-if="pItem.chs != '#'"
|
|
|
class="RLC-chs"
|
|
|
:style="{
|
|
|
- fontSize: sentType != 'option' ? pItem.fontSize : '',
|
|
|
+ fontSize: baseSizePhone + 6 + 'px',
|
|
|
color: pItem.fontColor,
|
|
|
textAlign: 'left',
|
|
|
- fontFamily: pItem.fontFamily,
|
|
|
+ fontFamily: pItem.fontFamily
|
|
|
}"
|
|
|
:class="[
|
|
|
pItem.chs != '“' && pItem.padding ? 'padding' : '',
|
|
|
|
|
|
- sentType == 'option' ? 'RLC-chs-option' : '',
|
|
|
+ sentType == 'option' ? 'RLC-chs-option' : ''
|
|
|
]"
|
|
|
v-html="pItem.chs"
|
|
|
- ></span
|
|
|
- >
|
|
|
+ ></span>
|
|
|
</template>
|
|
|
</template>
|
|
|
<span
|
|
|
v-if="
|
|
|
detail.pyNumber &&
|
|
|
- detail.pyNumber[index] > 0 &&
|
|
|
- pyPosition == 'bottom'
|
|
|
+ detail.pyNumber[index] > 0 &&
|
|
|
+ pyPosition == 'bottom'
|
|
|
"
|
|
|
class="RLC-pinyin"
|
|
|
:class="[
|
|
@@ -352,8 +349,9 @@
|
|
|
pyColor == 'black' ? 'RLC-pinyin-black' : '',
|
|
|
pyColor == 'grey' ? 'RLC-pinyin-grey' : '',
|
|
|
pyColor == 'sub' ? 'RLC-pinyin-sub' : '',
|
|
|
- noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
|
|
|
+ noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : ''
|
|
|
]"
|
|
|
+ :style="{ fontSize: baseSizePhone - 2 + 'px' }"
|
|
|
>{{ pItem.pinyin | handlePY }}</span
|
|
|
>
|
|
|
</template>
|
|
@@ -367,14 +365,15 @@
|
|
|
v-for="(item, index) in detail.sentenceArr"
|
|
|
:key="'sentenceArr' + index"
|
|
|
v-html="item"
|
|
|
- >
|
|
|
- </div>
|
|
|
+ :style="{ fontSize: baseSizePhone + 6 + 'px' }"
|
|
|
+ ></div>
|
|
|
</template>
|
|
|
<template v-else-if="detail.sentence">
|
|
|
<div
|
|
|
class="sentence"
|
|
|
v-html="detail.sentence"
|
|
|
style="white-space: pre-wrap"
|
|
|
+ :style="{ fontSize: baseSizePhone + 6 + 'px' }"
|
|
|
></div>
|
|
|
</template>
|
|
|
</div>
|
|
@@ -393,6 +392,7 @@ export default {
|
|
|
"isInput",
|
|
|
"Isexample",
|
|
|
"sentType",
|
|
|
+ "baseSizePhone"
|
|
|
],
|
|
|
filters: {
|
|
|
handlePY(pinyin) {
|
|
@@ -404,13 +404,13 @@ export default {
|
|
|
py = pinyin;
|
|
|
}
|
|
|
return py;
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
noFont: ["~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "/"],
|
|
|
chsFhList: [",", "。", "”", ":", "》", "?", "!", ";"],
|
|
|
- enFhList: [",", ".", ";", "?", "!", ":", ">", "<"],
|
|
|
+ enFhList: [",", ".", ";", "?", "!", ":", ">", "<"]
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -420,7 +420,7 @@ export default {
|
|
|
classname = "sentence-temp-24";
|
|
|
}
|
|
|
return classname;
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
watch: {},
|
|
|
//方法集合
|
|
@@ -438,10 +438,10 @@ export default {
|
|
|
updated() {}, //生命周期 - 更新之后
|
|
|
beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
destroyed() {}, //生命周期 - 销毁完成
|
|
|
- activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+ activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
};
|
|
|
</script>
|
|
|
-<style lang='scss' scoped>
|
|
|
+<style lang="scss" scoped>
|
|
|
//@import url(); 引入公共css类
|
|
|
.sentence-temp {
|
|
|
// padding: 9px 0;
|
|
@@ -570,4 +570,4 @@ export default {
|
|
|
line-height: 1.4;
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|