|
@@ -6,27 +6,39 @@
|
|
<span v-html="sanitizeHTML(data.stem)"></span>
|
|
<span v-html="sanitizeHTML(data.stem)"></span>
|
|
</div>
|
|
</div>
|
|
<div v-if="isEnable(data.property.is_enable_description)" class="description">{{ data.description }}</div>
|
|
<div v-if="isEnable(data.property.is_enable_description)" class="description">{{ data.description }}</div>
|
|
- <template v-if="data.property.learn_type === 'paint'">
|
|
|
|
- <!-- 描红 -->
|
|
|
|
- </template>
|
|
|
|
- <template v-else-if="data.property.learn_type === 'write'">
|
|
|
|
- <!-- 书写 -->
|
|
|
|
- </template>
|
|
|
|
- <template v-else>
|
|
|
|
- <!-- 笔画学习 -->
|
|
|
|
- </template>
|
|
|
|
|
|
+
|
|
|
|
+ <!-- 笔画学习 -->
|
|
<div class="words-box">
|
|
<div class="words-box">
|
|
<div v-for="(item, index) in data.option_list" :key="index" class="words-item">
|
|
<div v-for="(item, index) in data.option_list" :key="index" class="words-item">
|
|
- <div class="words-info">
|
|
|
|
- <AudioPlay :file-id="item.audio_file_id" theme-color="gray" />
|
|
|
|
- <span class="pinyin">{{ item.pinyin }}</span>
|
|
|
|
- </div>
|
|
|
|
- <Strockplayredline
|
|
|
|
- :play-storkes="true"
|
|
|
|
- :book-text="item.content"
|
|
|
|
- :target-div="'pra' + item.content + index"
|
|
|
|
- class="strock-chinese"
|
|
|
|
- />
|
|
|
|
|
|
+ <template v-if="item.content.trim()">
|
|
|
|
+ <template v-if="data.property.learn_type === 'paint'">
|
|
|
|
+ <!-- 描红 -->
|
|
|
|
+ <Strockred
|
|
|
|
+ :book-text="item.content"
|
|
|
|
+ :hanzi-color="hanzi_color"
|
|
|
|
+ :reset="true"
|
|
|
|
+ :target-div="'write-praT' + item.content"
|
|
|
|
+ :book-strokes="item.strokes"
|
|
|
|
+ class="strock-chinese"
|
|
|
|
+ />
|
|
|
|
+ </template>
|
|
|
|
+ <template v-else-if="data.property.learn_type === 'write'">
|
|
|
|
+ <!-- 书写 -->
|
|
|
|
+ </template>
|
|
|
|
+ <template v-else>
|
|
|
|
+ <div class="words-info">
|
|
|
|
+ <AudioPlay :file-id="item.audio_file_id" theme-color="gray" />
|
|
|
|
+ <span class="pinyin">{{ item.pinyin }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <Strockplayredline
|
|
|
|
+ :play-storkes="true"
|
|
|
|
+ :book-text="item.content"
|
|
|
|
+ :target-div="'pra' + item.content + index"
|
|
|
|
+ :book-strokes="item.strokes"
|
|
|
|
+ class="strock-chinese"
|
|
|
|
+ />
|
|
|
|
+ </template>
|
|
|
|
+ </template>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -35,20 +47,44 @@
|
|
<script>
|
|
<script>
|
|
import PreviewMixin from './components/PreviewMixin';
|
|
import PreviewMixin from './components/PreviewMixin';
|
|
import Strockplayredline from './components/common/Strockplayredline.vue';
|
|
import Strockplayredline from './components/common/Strockplayredline.vue';
|
|
|
|
+import Strockred from './components/common/Strockred.vue';
|
|
|
|
+import { GetStaticResources } from '@/api/exercise';
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'ChinesePreview',
|
|
name: 'ChinesePreview',
|
|
components: {
|
|
components: {
|
|
Strockplayredline,
|
|
Strockplayredline,
|
|
|
|
+ Strockred,
|
|
},
|
|
},
|
|
mixins: [PreviewMixin],
|
|
mixins: [PreviewMixin],
|
|
data() {
|
|
data() {
|
|
- return {};
|
|
|
|
|
|
+ return {
|
|
|
|
+ hanzi_color: '#404040', // 描红汉字底色
|
|
|
|
+ writer_number: 19, // 书写个数
|
|
|
|
+ };
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
console.log(this.data);
|
|
console.log(this.data);
|
|
|
|
+ this.handleData();
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ // 初始化数据
|
|
|
|
+ handleData() {
|
|
|
|
+ // console.log(document.getElementsByClassName('preview-content')[0].clientWidth);
|
|
|
|
+
|
|
|
|
+ this.data.option_list.forEach((item) => {
|
|
|
|
+ if (item.content.trim()) {
|
|
|
|
+ let MethodName = 'hz_resource_manager-GetHZStrokesContent';
|
|
|
|
+ let data = {
|
|
|
|
+ hz: item.content.trim(),
|
|
|
|
+ };
|
|
|
|
+ GetStaticResources(MethodName, data).then((res) => {
|
|
|
|
+ this.$set(item, 'strokes', res);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
},
|
|
},
|
|
- methods: {},
|
|
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|