|
|
@@ -0,0 +1,432 @@
|
|
|
+<!-- -->
|
|
|
+<template>
|
|
|
+ <div class="practice practiceSingle">
|
|
|
+ <div
|
|
|
+ :key="item.con + index"
|
|
|
+ class="Book_content"
|
|
|
+ v-for="(item, index) in cur.stem"
|
|
|
+ >
|
|
|
+ <!-- <img
|
|
|
+ @click="changePraShow()"
|
|
|
+ class="close-icon"
|
|
|
+ src="../../assets/common/close-icon.png"
|
|
|
+ /> -->
|
|
|
+ <div class="left-content">
|
|
|
+ <Audio :mp3="item.mp3_url" :pinyin="item.pinyin" />
|
|
|
+
|
|
|
+ <div class="strockplay">
|
|
|
+ <Strockplay
|
|
|
+ :Book_text="item.con"
|
|
|
+ :playStorkes="cur.playStorkes"
|
|
|
+ :targetDiv="'pra' + item.con + index"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="footer">
|
|
|
+ <!-- <div @click="collectFlag = !collectFlag" class="bg-box">
|
|
|
+ <img
|
|
|
+ :src="
|
|
|
+ collectFlag
|
|
|
+ ? require('../../assets/common/coll-icon-1.png')
|
|
|
+ : require('../../assets/common/coll-icon.png')
|
|
|
+ "
|
|
|
+ class="practice-icon"
|
|
|
+ />
|
|
|
+ </div> -->
|
|
|
+ <div @click="changeLearnMode(1)" class="bg-box">
|
|
|
+ <!-- <img
|
|
|
+ class="practice-icon"
|
|
|
+ src="../../assets/common/dict-icon.png"
|
|
|
+ /> -->
|
|
|
+ </div>
|
|
|
+ <div @click="changeLearnMode(2)" class="bg-box">
|
|
|
+ <!-- <img
|
|
|
+ class="practice-icon"
|
|
|
+ src="../../assets/common/write-icon-1.png"
|
|
|
+ /> -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <template v-if="learn_mode == 2">
|
|
|
+ <div class="right-content">
|
|
|
+ <ul class="nav-list">
|
|
|
+ <li :class="navIndex == 0 ? 'active' : ''" @click="changeNav(0)">
|
|
|
+ 描红模式
|
|
|
+ </li>
|
|
|
+ <li :class="navIndex == 1 ? 'active' : ''" @click="changeNav(1)">
|
|
|
+ 自由书写
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+
|
|
|
+ <div class="right-strockred">
|
|
|
+ <template v-if="navIndex == 0">
|
|
|
+ <Strockred
|
|
|
+ :Book_text="cur.stem[0].con"
|
|
|
+ :hanzicolor="hanzicolor"
|
|
|
+ :playStorkes="playStorkes"
|
|
|
+ :targetDiv="'write-pra' + cur.stem[0].con"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <Freewrite
|
|
|
+ :cur="cur"
|
|
|
+ :lineColor="hanzicolor"
|
|
|
+ :lineWidth="hanziweight"
|
|
|
+ ref="freewrite"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="footer">
|
|
|
+ <div class="pen-colors">
|
|
|
+ <!-- <img
|
|
|
+ class="write-icon-3"
|
|
|
+ src="../../assets/common/write-icon-3.png"
|
|
|
+ /> -->
|
|
|
+ <ul class="colors-list">
|
|
|
+ <li
|
|
|
+ :class="
|
|
|
+ colorIndex == index ? 'color-item-active' + index : ''
|
|
|
+ "
|
|
|
+ :key="'color' + index"
|
|
|
+ @click="changeColor(index)"
|
|
|
+ v-for="(item, index) in 5"
|
|
|
+ >
|
|
|
+ <span :class="'color-item' + index"></span>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ <!-- <img
|
|
|
+ @click="resetHuahua(index)"
|
|
|
+ class="clean-btn"
|
|
|
+ src="../../assets/common/icon-clean.png"
|
|
|
+ /> -->
|
|
|
+ </div>
|
|
|
+ <div class="pen" v-if="navIndex == 1">
|
|
|
+ <img
|
|
|
+ :src="penIndex == 0 ? thinpenActive : thinpen"
|
|
|
+ @click="changePen(0)"
|
|
|
+ class="pen-img"
|
|
|
+ />
|
|
|
+ <img
|
|
|
+ :src="penIndex == 1 ? thickpenActive : thickpen"
|
|
|
+ @click="changePen(1)"
|
|
|
+ class="pen-img"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <ChinaDict :cur="cur" />
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+// import Strockplay from "../common/Strockplay";
|
|
|
+// import Strockred from "../common/Strockred";
|
|
|
+// import Freewrite from "../common/Freewrite";
|
|
|
+// import ChinaDict from "../common/ChinaDict";
|
|
|
+// import Audio from "../common/Audio";
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ // Strockplay,
|
|
|
+ // Strockred,
|
|
|
+ // Freewrite,
|
|
|
+ // ChinaDict,
|
|
|
+ // Audio,
|
|
|
+ },
|
|
|
+ props: ["cur", "changePraShow"],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // learn_mode: "",
|
|
|
+ // playStorkes: false,
|
|
|
+ // navIndex: 0,
|
|
|
+ // colorsList: ["#404040", "#f65d4d", "#19b068", "#52a1ea", "#ff8c49"],
|
|
|
+ // weightList: [6, 10],
|
|
|
+ // colorIndex: 0,
|
|
|
+ // penIndex: 0,
|
|
|
+ // hanzicolor: "",
|
|
|
+ // hanziweight: "",
|
|
|
+ // thinpen: require("../../assets/common/thin-pen.png"), //细笔
|
|
|
+ // thinpenActive: require("../../assets/common/thin-pen-active.png"),
|
|
|
+ // thickpen: require("../../assets/common/thick-pen.png"),
|
|
|
+ // thickpenActive: require("../../assets/common/thick-pen-active.png"),
|
|
|
+ // collectFlag: false, // 是否收藏
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {},
|
|
|
+ watch: {},
|
|
|
+ //方法集合
|
|
|
+ methods: {
|
|
|
+ changeNav(index) {
|
|
|
+ this.navIndex = index;
|
|
|
+ },
|
|
|
+ changeColor(index) {
|
|
|
+ let _this = this;
|
|
|
+ _this.colorIndex = index;
|
|
|
+ let color = _this.colorsList[index];
|
|
|
+ _this.hanzicolor = color;
|
|
|
+ },
|
|
|
+ changePen(index) {
|
|
|
+ let _this = this;
|
|
|
+ _this.penIndex = index;
|
|
|
+ _this.hanziweight = _this.weightList[_this.penIndex];
|
|
|
+ },
|
|
|
+ changeLearnMode(mode) {
|
|
|
+ this.learn_mode = mode;
|
|
|
+ },
|
|
|
+ resetHuahua(index) {
|
|
|
+ console.log(this.$refs.freewrite);
|
|
|
+ this.$refs.freewrite[index].handelReset();
|
|
|
+ },
|
|
|
+ },
|
|
|
+ //生命周期 - 创建完成(可以访问当前this实例)
|
|
|
+ created() {
|
|
|
+ // console.log(this.cur);
|
|
|
+ // let _this = this;
|
|
|
+ // let color = _this.colorsList[_this.colorIndex];
|
|
|
+ // _this.hanzicolor = color;
|
|
|
+ // _this.hanziweight = 6;
|
|
|
+ // if (_this.cur) {
|
|
|
+ // _this.learn_mode = _this.cur.learn_mode ? _this.cur.learn_mode : 2;
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ //生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
+ mounted() {},
|
|
|
+ beforeCreate() {}, //生命周期 - 创建之前
|
|
|
+ beforeMount() {}, //生命周期 - 挂载之前
|
|
|
+ beforeUpdate() {}, //生命周期 - 更新之前
|
|
|
+ updated() {}, //生命周期 - 更新之后
|
|
|
+ beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
+ destroyed() {}, //生命周期 - 销毁完成
|
|
|
+ activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang='scss' scoped>
|
|
|
+//@import url(); 引入公共css类
|
|
|
+// .practice {
|
|
|
+// width: 1368px;
|
|
|
+// max-height: 840px;
|
|
|
+// overflow: auto;
|
|
|
+// margin: 0 auto;
|
|
|
+// background: #21ba71;
|
|
|
+// box-shadow: inset 0px 4px 0px rgba(255, 255, 255, 0.25);
|
|
|
+// border-radius: 40px;
|
|
|
+// .clean-btn {
|
|
|
+// width: 34px;
|
|
|
+// margin: 0 16px;
|
|
|
+// cursor: pointer;
|
|
|
+// }
|
|
|
+// .close-icon {
|
|
|
+// position: absolute;
|
|
|
+// top: 18px;
|
|
|
+// right: 18px;
|
|
|
+// width: 84px;
|
|
|
+// height: 84px;
|
|
|
+// cursor: pointer;
|
|
|
+// }
|
|
|
+// .Book_content {
|
|
|
+// width: 100%;
|
|
|
+// height: 100%;
|
|
|
+// display: flex;
|
|
|
+// box-sizing: border-box;
|
|
|
+// padding: 72px 48px 48px;
|
|
|
+// position: relative;
|
|
|
+// align-items: flex-start;
|
|
|
+// }
|
|
|
+// .left-content {
|
|
|
+// display: flex;
|
|
|
+// flex-direction: column;
|
|
|
+// justify-content: center;
|
|
|
+// }
|
|
|
+// .right-content {
|
|
|
+// position: relative;
|
|
|
+// width: 720px;
|
|
|
+// height: 720px;
|
|
|
+// background: #ffffff;
|
|
|
+// box-shadow: 0px 6px 0px rgba(0, 149, 78, 0.4);
|
|
|
+// border-radius: 24px;
|
|
|
+// box-sizing: border-box;
|
|
|
+// padding: 42px 40px 24px 40px;
|
|
|
+// display: flex;
|
|
|
+// flex-direction: column;
|
|
|
+// justify-content: flex-start;
|
|
|
+// align-items: center;
|
|
|
+// margin-left: 64px;
|
|
|
+// .nav-list {
|
|
|
+// width: 312px;
|
|
|
+// height: 44px;
|
|
|
+// background: rgba(49, 212, 134, 0.2);
|
|
|
+// border-radius: 240px;
|
|
|
+// display: flex;
|
|
|
+// justify-content: flex-start;
|
|
|
+// align-items: center;
|
|
|
+// padding: 0;
|
|
|
+// margin-bottom: 44px;
|
|
|
+// list-style: none;
|
|
|
+// > li {
|
|
|
+// height: 52px;
|
|
|
+// width: 156px;
|
|
|
+// text-align: center;
|
|
|
+// font-style: normal;
|
|
|
+// font-weight: bold;
|
|
|
+// font-size: 28px;
|
|
|
+// line-height: 52px;
|
|
|
+// color: #19b068;
|
|
|
+// cursor: pointer;
|
|
|
+// &.active {
|
|
|
+// background: #19b068;
|
|
|
+// border-radius: 240px;
|
|
|
+// color: #ffffff;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// .right-strockred {
|
|
|
+// width: 448px;
|
|
|
+// height: 448px;
|
|
|
+// }
|
|
|
+// .footer {
|
|
|
+// position: absolute;
|
|
|
+// bottom: 24px;
|
|
|
+// width: 640px;
|
|
|
+// display: flex;
|
|
|
+// justify-content: space-between;
|
|
|
+// align-items: center;
|
|
|
+// .pen-colors {
|
|
|
+// display: flex;
|
|
|
+// justify-content: flex-start;
|
|
|
+// align-items: center;
|
|
|
+// .write-icon-3 {
|
|
|
+// width: 25px;
|
|
|
+// height: 37px;
|
|
|
+// margin-right: 26px;
|
|
|
+// }
|
|
|
+// .colors-list {
|
|
|
+// display: flex;
|
|
|
+// justify-content: flex-start;
|
|
|
+// align-items: center;
|
|
|
+// margin: 0;
|
|
|
+// padding: 0;
|
|
|
+// > li {
|
|
|
+// width: 34px;
|
|
|
+// height: 34px;
|
|
|
+// border: 2px solid #fff;
|
|
|
+// box-sizing: border-box;
|
|
|
+// background: #fff;
|
|
|
+// margin: 0 8px;
|
|
|
+// display: flex;
|
|
|
+// justify-content: center;
|
|
|
+// align-items: center;
|
|
|
+// border-radius: 100%;
|
|
|
+// cursor: pointer;
|
|
|
+// > span {
|
|
|
+// width: 26px;
|
|
|
+// height: 26px;
|
|
|
+// border-radius: 100%;
|
|
|
+// &.color-item0 {
|
|
|
+// background: #404040;
|
|
|
+// }
|
|
|
+// &.color-item1 {
|
|
|
+// background: #f65d4d;
|
|
|
+// }
|
|
|
+// &.color-item2 {
|
|
|
+// background: #19b068;
|
|
|
+// }
|
|
|
+// &.color-item3 {
|
|
|
+// background: #52a1ea;
|
|
|
+// }
|
|
|
+// &.color-item4 {
|
|
|
+// background: #ff8c49;
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+// &.color-item-active0 {
|
|
|
+// border: 2px solid #404040;
|
|
|
+// }
|
|
|
+// &.color-item-active1 {
|
|
|
+// border: 2px solid #f65d4d;
|
|
|
+// }
|
|
|
+// &.color-item-active2 {
|
|
|
+// border: 2px solid #19b068;
|
|
|
+// }
|
|
|
+// &.color-item-active3 {
|
|
|
+// border: 2px solid #52a1ea;
|
|
|
+// }
|
|
|
+// &.color-item-active4 {
|
|
|
+// border: 2px solid #ff8c49;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// .pen {
|
|
|
+// display: flex;
|
|
|
+// justify-content: flex-start;
|
|
|
+// align-items: center;
|
|
|
+// > img {
|
|
|
+// width: 42px;
|
|
|
+// height: 38px;
|
|
|
+// margin-left: 9px;
|
|
|
+// cursor: pointer;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// .strockplay {
|
|
|
+// margin-bottom: 41px;
|
|
|
+// width: 444px;
|
|
|
+// height: 444px;
|
|
|
+// border-radius: 24px;
|
|
|
+// box-shadow: 0px 6px 0px rgba(0, 149, 78, 0.4);
|
|
|
+// }
|
|
|
+// .footer {
|
|
|
+// width: 100%;
|
|
|
+// display: flex;
|
|
|
+// justify-content: center;
|
|
|
+// align-items: center;
|
|
|
+// cursor: pointer;
|
|
|
+// .bg-box {
|
|
|
+// width: 124px;
|
|
|
+// height: 72px;
|
|
|
+// background: url("../../assets/common/bg-green.png") center no-repeat;
|
|
|
+// background-size: 100% 100%;
|
|
|
+// text-align: center;
|
|
|
+// &:nth-child(2) {
|
|
|
+// margin: 0 24px;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// .bg-box:active {
|
|
|
+// background: url("../../assets/common/bg-green-click.png") center no-repeat;
|
|
|
+// background-size: 100% 100%;
|
|
|
+// .practice-icon {
|
|
|
+// margin-top: 15px;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// .practice-icon {
|
|
|
+// height: 36px;
|
|
|
+// margin-top: 12px;
|
|
|
+// }
|
|
|
+// > span {
|
|
|
+// margin-bottom: 9px;
|
|
|
+// font-weight: 600;
|
|
|
+// font-family: "FZJCGFKTK";
|
|
|
+// font-size: 24px;
|
|
|
+// line-height: 34px;
|
|
|
+// /* identical to box height */
|
|
|
+
|
|
|
+// text-align: center;
|
|
|
+
|
|
|
+// color: #ba7d21;
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+</style>
|
|
|
+<style lang="scss">
|
|
|
+.practiceSingle {
|
|
|
+ .strock-play-box {
|
|
|
+ width: 84px !important;
|
|
|
+ height: 84px !important;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|