|
@@ -23,22 +23,34 @@
|
|
|
:themeColor="themeColor"
|
|
|
ref="freewrite"
|
|
|
/> -->
|
|
|
- <template v-if="imgOrCans">
|
|
|
- <img :src="currenHzData.strokes_image_url" alt="" />
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <FreeWriteQP
|
|
|
- :bgColor.sync="bgColor"
|
|
|
- :height="height"
|
|
|
- :isCrop="isCrop"
|
|
|
- :lineColor="hanzicolor"
|
|
|
- :lineWidth="hanziweight"
|
|
|
- :width="width"
|
|
|
- class="vueEsign"
|
|
|
- ref="esign"
|
|
|
- id="esign"
|
|
|
- />
|
|
|
+ <div
|
|
|
+ @click.stop="play"
|
|
|
+ :class="[
|
|
|
+ 'strock-play-box',
|
|
|
+ themeColor == 'green'
|
|
|
+ ? 'green-border'
|
|
|
+ : themeColor == 'red'
|
|
|
+ ? 'red-border'
|
|
|
+ : themeColor == 'brown'
|
|
|
+ ? 'brown-border'
|
|
|
+ : 'red-border',
|
|
|
+ ]"
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <template v-if="!hasPlay && currenHzData.strokes_image_url">
|
|
|
+ <img class="img" :src="currenHzData.strokes_image_url" alt="" />
|
|
|
</template>
|
|
|
+ <FreeWriteQP
|
|
|
+ :bgColor.sync="bgColor"
|
|
|
+ :height="height"
|
|
|
+ :isCrop="isCrop"
|
|
|
+ :lineColor="hanzicolor"
|
|
|
+ :lineWidth="hanziweight"
|
|
|
+ :width="width"
|
|
|
+ class="vueEsign"
|
|
|
+ ref="esign"
|
|
|
+ id="esign"
|
|
|
+ />
|
|
|
</div>
|
|
|
<ul class="nav-list">
|
|
|
<li @click="resetHuahua()">重写</li>
|
|
@@ -96,12 +108,39 @@ export default {
|
|
|
collectFlag: false, // 是否收藏
|
|
|
imgarr: [],
|
|
|
imgOrCans: false,
|
|
|
+ hasPlay: false,
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
|
watch: {},
|
|
|
//方法集合
|
|
|
methods: {
|
|
|
+ play(index) {
|
|
|
+ if (this.hasPlay) {
|
|
|
+ this.$message.warning("请等待播放完成");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$refs.esign.reset();
|
|
|
+ this.hasPlay = true;
|
|
|
+ let c = document.getElementById("esign");
|
|
|
+ let cxt = document.getElementById("esign").getContext("2d");
|
|
|
+ cxt.clearRect(0, 0, c.width, c.height);
|
|
|
+ let history = this.currenHzData.history;
|
|
|
+ const len = history.length;
|
|
|
+ let i = 0;
|
|
|
+ const runner = () => {
|
|
|
+ i++;
|
|
|
+ if (i < len) {
|
|
|
+ this.$refs.esign.draw(null, history[i][0], history[i][1]);
|
|
|
+ requestAnimationFrame(runner);
|
|
|
+ } else {
|
|
|
+ console.log("播放完成");
|
|
|
+ this.hasPlay = false;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ requestAnimationFrame(runner);
|
|
|
+ },
|
|
|
+
|
|
|
changeNav(index) {
|
|
|
this.navIndex = index;
|
|
|
},
|
|
@@ -120,8 +159,13 @@ export default {
|
|
|
this.learn_mode = mode;
|
|
|
},
|
|
|
resetHuahua() {
|
|
|
+ if (this.hasPlay) {
|
|
|
+ this.$message.warning("请等待播放完成");
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.imgOrCans = false;
|
|
|
this.$refs.esign.reset();
|
|
|
+ this.currenHzData.strokes_image_url = "";
|
|
|
},
|
|
|
handleWriteImg() {
|
|
|
this.$refs.esign
|
|
@@ -145,7 +189,7 @@ export default {
|
|
|
strokes_image_url: write_img,
|
|
|
};
|
|
|
// this.imgarr.push(obj);
|
|
|
- this.closeifFreeShow(obj,this.rowIndex,this.colIndex);
|
|
|
+ this.closeifFreeShow(obj, this.rowIndex, this.colIndex);
|
|
|
});
|
|
|
//console.log(Book_img);
|
|
|
// this.textOcr(res.replace("data:image/png;base64,", ""));
|
|
@@ -181,7 +225,6 @@ export default {
|
|
|
.practice {
|
|
|
width: 320px;
|
|
|
max-height: 400px;
|
|
|
- overflow: auto;
|
|
|
margin: 0 auto;
|
|
|
background: #f3f3f3;
|
|
|
box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.15);
|
|
@@ -202,6 +245,7 @@ export default {
|
|
|
background-size: cover;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.close-icon {
|
|
|
position: absolute;
|
|
|
top: 8px;
|
|
@@ -277,6 +321,22 @@ export default {
|
|
|
background: #fff url("../../../../assets/NPC/chinaTianRed.png") center
|
|
|
no-repeat;
|
|
|
background-size: 100% 100%;
|
|
|
+ position: relative;
|
|
|
+ .img {
|
|
|
+ position: absolute;
|
|
|
+ }
|
|
|
+ .strock-play-box {
|
|
|
+ position: absolute;
|
|
|
+ width: 32px;
|
|
|
+ height: 32px;
|
|
|
+ background: #fff url("../../../../assets/NPC/strock-play-red-click-big.png") center
|
|
|
+ no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ cursor: pointer;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ z-index: 2;
|
|
|
+ }
|
|
|
}
|
|
|
.footer {
|
|
|
position: absolute;
|