Просмотр исходного кода

汉字播放笔顺优先使用保存笔顺

natasha 2 недель назад
Родитель
Сommit
1268b61686

+ 25 - 14
src/views/book/courseware/preview/components/newWord_template/components/Strockplayredline.vue

@@ -120,20 +120,31 @@ export default {
           },
         });
       } else {
-        _this.writer = HanziWriter.default.create(_this.targetDiv, _this.Book_text, {
-          charDataLoader(char, onComplete) {
-            let MethodName = 'hz_resource_manager-GetHZStrokesContent';
-            let data = {
-              hz: char,
-            };
-            GetStaticResources(MethodName, data).then((res) => {
-              onComplete(res);
-            });
-          },
-          padding: 5,
-          showOutline: true,
-          strokeColor: _this.strokeColor ? _this.strokeColor : '#333',
-        });
+        if (_this.hz_json) {
+          _this.writer = HanziWriter.default.create(_this.targetDiv, _this.Book_text, {
+            charDataLoader(char, onComplete) {
+              onComplete(_this.hz_json);
+            },
+            padding: 5,
+            showOutline: true,
+            strokeColor: _this.strokeColor ? _this.strokeColor : '#333',
+          });
+        } else {
+          _this.writer = HanziWriter.default.create(_this.targetDiv, _this.Book_text, {
+            charDataLoader(char, onComplete) {
+              let MethodName = 'hz_resource_manager-GetHZStrokesContent';
+              let data = {
+                hz: char,
+              };
+              GetStaticResources(MethodName, data).then((res) => {
+                onComplete(res);
+              });
+            },
+            padding: 5,
+            showOutline: true,
+            strokeColor: _this.strokeColor ? _this.strokeColor : '#333',
+          });
+        }
       }
     },
     handleData(stroke_num) {