Commit d649e8db authored by limingzhe's avatar limingzhe

fix: 识别参数

parent e62b0390
No preview for this file type
import { getSprNode, onHomeworkFinish, playAudio, playAudioByUrl } from "../script/util"; import { getSprNode, getSprNodeByUrl, onHomeworkFinish, playAudio, playAudioByUrl } from "../script/util";
import { defaultData } from "../script/defaultData"; import { defaultData } from "../script/defaultData";
cc.Class({ cc.Class({
...@@ -105,14 +105,16 @@ cc.Class({ ...@@ -105,14 +105,16 @@ cc.Class({
addPreloadImage() { addPreloadImage() {
if (this.data.exercises) { this._imageResList.push({ url: this.data.dot_big_1_url || '' });
// this._imageResList.push({ url: this.data.picUrl }); this._imageResList.push({ url: this.data.dot_big_2_url || '' });
} this._imageResList.push({ url: this.data.dot_small_1_url || '' });
this._imageResList.push({ url: this.data.dot_small_2_url || '' });
}, },
addPreloadAudio() { addPreloadAudio() {
if (this.data) { if (this.data) {
this._audioResList.push({ url: this.data.write_big_0_audio_url || '' }); this._audioResList.push({ url: this.data.write_big_0_audio_url || '' });
this._audioResList.push({ url: this.data.write_big_1_audio_url || '' }); this._audioResList.push({ url: this.data.write_big_1_audio_url || '' });
...@@ -123,14 +125,16 @@ cc.Class({ ...@@ -123,14 +125,16 @@ cc.Class({
this._audioResList.push({ url: this.data.finish_audio_url || '' }); this._audioResList.push({ url: this.data.finish_audio_url || '' });
this._audioResList.push({ url: this.data.tip_audio_url || '' }); this._audioResList.push({ url: this.data.tip_audio_url || '' });
} }
}, },
addPreloadAnima() { addPreloadAnima() {
const animArr = this.data.animArr;
for (let i=0; i<animArr.length; i++) {
this._animaResList.push({ url: animArr[i]?.skeJsonData?.url || '' });
this._animaResList.push({ url: animArr[i]?.texJsonData?.url || '' });
this._animaResList.push({ url: animArr[i]?.texPngData?.url || '' });
}
}, },
preload() { preload() {
...@@ -265,11 +269,18 @@ cc.Class({ ...@@ -265,11 +269,18 @@ cc.Class({
} }
const para = { const para = {
"library_id": "iplayabc",
'page_id': 5, 'page_id': 5,
'book_id': 'opw_1', 'book_id': 'opw1',
'part_name': 'c', 'part_name': 'c',
'is_hand_writing': true, 'is_hand_writing': true,
'is_line_link': false, 'is_line_link': false,
'ques_region' : [
0, 0.077,
1, 0.077,
1, 0.331,
0, 0.331,
]
} }
cw.openOsmoHandwriting(para); cw.openOsmoHandwriting(para);
...@@ -454,19 +465,9 @@ cc.Class({ ...@@ -454,19 +465,9 @@ cc.Class({
}, },
addLetterItemBig() { addLetterItemBig() {
const letterS = this.data.letter.toLowerCase();
const itemLetterBig = getSprNode('letter/' + letterS + '_1_1');
// itemLetterBig.x = -this.canvas.width / 2 + 70 * this._mapScaleMin;
// itemLetterBig.y = 200 * this._mapScaleMin;
itemLetterBig.scale = this._mapScaleMin;
itemLetterBig.anchorY = 0.28
this.canvas.addChild(itemLetterBig);
const itemBgBig = getSprNode('item_bg'); const itemBgBig = getSprNode('item_bg');
itemBgBig.scale = this._mapScaleMin; itemBgBig.scale = this._mapScaleMin;
// itemBgBig.x = itemLetterBig.x + 70 * this._mapScaleMin;
// itemBgBig.y = itemLetterBig.y;
itemBgBig.anchorX = 0; itemBgBig.anchorX = 0;
this.canvas.addChild(itemBgBig); this.canvas.addChild(itemBgBig);
this.itemBgBig = itemBgBig; this.itemBgBig = itemBgBig;
...@@ -475,83 +476,323 @@ cc.Class({ ...@@ -475,83 +476,323 @@ cc.Class({
const letterW = 50 * this._mapScaleMin; const letterW = 50 * this._mapScaleMin;
itemBgBig.x = -itemBgBig.width / 2 * itemBgBig.scaleX + letterW; itemBgBig.x = -itemBgBig.width / 2 * itemBgBig.scaleX + letterW;
itemBgBig.y = 200 * this._mapScaleMin; itemBgBig.y = 200 * this._mapScaleMin;
itemLetterBig.x = itemBgBig.x - letterW; // itemLetterBig.x = itemBgBig.x - letterW;
itemLetterBig.y = itemBgBig.y; // itemLetterBig.y = itemBgBig.y;
// getSprNodeByUrl(this.data.letter_big_pic_url, (spr) => {
// const itemLetterBig = spr.node;
// this.canvas.addChild(itemLetterBig);
// itemLetterBig.scale = itemBgBig.height / itemLetterBig.height;
// itemLetterBig.x = itemBgBig.x - letterW;
// itemLetterBig.y = itemBgBig.y;
// })
let animColor;
let animBlack;
const checkShowOneLineAnim = () => {
if (animColor && animBlack) {
this.setOneLineAllAnimBig(animColor, animBlack, itemBgBig)
this.showLetterAnim(1000, this.letterAnimBig);
this.addColorLetterListener( this.letterAnimBig );
}
}
const bigColorData = this.getAnimData('letter_big_0');
const bigBlackData = this.getAnimData('letter_big_1');
this.getOneAnim(bigColorData, (animNode) => {
animColor = animNode;
animColor.x = 100;
this.letterAnimBig = animColor;
itemBgBig.addChild(animColor);
checkShowOneLineAnim();
})
this.getOneAnim(bigBlackData, (animNode) => {
animBlack = animNode;
checkShowOneLineAnim();
const itemLetterBig = cc.instantiate(animNode);
this.canvas.addChild(itemLetterBig);
itemLetterBig.animationNames = animNode.animationNames;
this.showLetterAnim(1000, itemLetterBig);
itemLetterBig.x = itemBgBig.x - letterW;
itemLetterBig.y = itemBgBig.y;
itemLetterBig.scale = 0.614;
itemLetterBig.y += itemBgBig.height / 6;
})
// const letterAnim0 = this.getLetterAnimBig0(letterS.toUpperCase());
// letterAnim0.x = 100;
// this.letterAnimBig = letterAnim0;
// itemBgBig.addChild(letterAnim0);
// const baseX = letterAnim0.x + 150;
// const baseY = letterAnim0.y + 32;
// const disW = 132;
// for (let i=0; i<7; i++) {
// const letterAnim1 = this.getLetterAnimBig1(letterS);
// letterAnim1.x = baseX + i * disW;
// letterAnim1.y = baseY;
// itemBgBig.addChild(letterAnim1);
// if (i < 2) {
// letterAnim1.opacity = 255 * 0.5;
// } else {
// letterAnim1.active = false;
// }
// }
},
setLetterDot(animNode, key) {
const url = this.data[key + '_url'];
if (url) {
getSprNodeByUrl(url, (spr) => {
spr.node.parent = animNode.parent;
spr.node.x = animNode.x;
spr.node.y = animNode.y;
spr.node.scale = animNode.scale;
})
}
},
addColorLetterListener(letter) {
letter.on('touchstart', ()=> {
if (!this.canTouch) {
return;
}
this.canTouch = false;
this.showLetterAnim(1, letter, () => {
this.checkShowDataPool();
});
})
},
getAnimData(key) {
const animArr = this.data.animArr;
for (let i=0; i<animArr.length; i++) {
if (animArr[i].key == key) {
return animArr[i];
}
}
},
const letterAnim0 = this.getLetterAnimBig0(letterS.toUpperCase()); setOneLineAllAnimBig(animColor, animBlack, animBg) {
letterAnim0.x = 100;
this.letterAnimBig = letterAnim0;
// letterAnim0.y = 30;
itemBgBig.addChild(letterAnim0);
const baseX = letterAnim0.x + 150; this.lineLetterBigArr = [];
const baseY = letterAnim0.y + 32; const baseX = animColor.x + 150;
// const baseY = animColor.y + 32;
const disW = 132; const disW = 132;
for (let i=0; i<7; i++) { for (let i=0; i<7; i++) {
const letterAnim1 = this.getLetterAnimBig1(letterS); const anim = cc.instantiate(animBlack);
letterAnim1.x = baseX + i * disW; anim.animationNames = animBlack.animationNames;
letterAnim1.y = baseY; anim.x = baseX + i * disW;
itemBgBig.addChild(letterAnim1);
// anim.scale = animBg.height / anim.height;
if (anim.height) {
anim.scale = 0.614;
if(animBg != this.itemBgSmall) {
anim.y += animBg.height / 6;
}
} else {
anim.scale = 0.614;
if(animBg != this.itemBgSmall) {
anim.y += animBg.height / 6;
}
}
// console.log(' anim.scale ~ ', anim.scale);
animBg.addChild(anim, 1);
this.showLetterAnim(1000, anim);
// const dragonDisplay = anim.getComponent(dragonBones.ArmatureDisplay);
// dragonDisplay.timeScale = 1000;
// dragonDisplay.playAnimation(anim.animationNames[0], 1);
if (i < 2) { if (i < 2) {
letterAnim1.opacity = 255 * 0.5; anim.opacity = 255 * 0.3;
if (i == 0) {
this.setLetterDot(anim, 'dot_big_1');
}
} else { } else {
letterAnim1.active = false; anim.active = false;
this.setLetterDot(anim, 'dot_big_2');
} }
this.lineLetterBigArr.push(anim);
}
},
setOneLineAllAnimSmall(animColor, animBlack, animBg) {
this.lineLetterSmallArr = [];
const baseX = animColor.x + 150;
const disW = 132;
for (let i=0; i<7; i++) {
const anim = cc.instantiate(animBlack);
anim.animationNames = animBlack.animationNames;
anim.x = baseX + i * disW;
anim.scale = 0.614;
// console.log(' anim.scale ~ ', anim.scale);
animBg.addChild(anim, 1);
this.showLetterAnim(1000, anim);
// const dragonDisplay = anim.getComponent(dragonBones.ArmatureDisplay);
// dragonDisplay.timeScale = 1000;
// dragonDisplay.playAnimation(anim.animationNames[0], 1);
if (i < 2) {
anim.opacity = 255 * 0.3;
if (i == 0) {
this.setLetterDot(anim, 'dot_small_1');
}
} else {
anim.active = false;
this.setLetterDot(anim, 'dot_small_2');
}
this.lineLetterSmallArr.push(anim);
} }
}, },
addLetterItemSmall() { addLetterItemSmall() {
const letterS = this.data.letter.toLowerCase();
const itemLetterSmall = getSprNode('letter/' + letterS + '_0_1');
// itemLetterSmall.x = -this.canvas.width / 2 + 70 * this._mapScaleMin;
// itemLetterSmall.y = -30 * this._mapScaleMin;
itemLetterSmall.scale = this._mapScaleMin;
this.canvas.addChild(itemLetterSmall);
const itemBgSmall = getSprNode('item_bg'); const itemBgSmall = getSprNode('item_bg');
itemBgSmall.scale = this._mapScaleMin; itemBgSmall.scale = this._mapScaleMin;
// itemBgSmall.x = itemLetterSmall.x + 70 * this._mapScaleMin;
// itemBgSmall.y = itemLetterSmall.y;
itemBgSmall.anchorX = 0; itemBgSmall.anchorX = 0;
this.canvas.addChild(itemBgSmall); this.canvas.addChild(itemBgSmall);
this.itemBgSmall = itemBgSmall; this.itemBgSmall = itemBgSmall;
const letterW = 50 * this._mapScaleMin; const letterW = 50 * this._mapScaleMin;
itemBgSmall.x = -itemBgSmall.width / 2 * itemBgSmall.scaleX + letterW; itemBgSmall.x = -itemBgSmall.width / 2 * itemBgSmall.scaleX + letterW;
itemBgSmall.y = -30 * this._mapScaleMin; itemBgSmall.y = -30 * this._mapScaleMin;
itemLetterSmall.x = itemBgSmall.x - letterW;
itemLetterSmall.y = itemBgSmall.y;
let animColor;
let animBlack;
const checkShowOneLineAnim = () => {
if (animColor && animBlack) {
this.setOneLineAllAnimSmall(animColor, animBlack, itemBgSmall)
this.showLetterAnim(1000, this.letterAnimSmall);
this.addColorLetterListener( this.letterAnimSmall );
}
}
const letterAnim0 = this.getLetterAnimSmall0(letterS.toLowerCase()); const smallColorData = this.getAnimData('letter_small_0');
letterAnim0.x = 100; const smallBlackData = this.getAnimData('letter_small_1');
letterAnim0.y = 7;
letterAnim0.opacity = 160;
this.letterAnimSmall = letterAnim0;
itemBgSmall.addChild(letterAnim0); this.getOneAnim(smallColorData, (animNode) => {
const baseX = letterAnim0.x + 150; animColor = animNode;
const baseY = 4; animColor.x = 100;
const disW = 132; this.letterAnimSmall = animColor;
for (let i=0; i<7; i++) { itemBgSmall.addChild(animColor);
const letterAnim1 = this.getLetterAnimSmall1(letterS); checkShowOneLineAnim();
letterAnim1.x = baseX + i * disW;
letterAnim1.y = baseY;
if (i < 2) { })
letterAnim1.opacity = 255 * 0.5;
} else {
letterAnim1.active = false;
}
itemBgSmall.addChild(letterAnim1); this.getOneAnim(smallBlackData, (animNode) => {
} animBlack = animNode;
checkShowOneLineAnim();
const itemLetterSmall = cc.instantiate(animNode);
this.canvas.addChild(itemLetterSmall);
itemLetterSmall.animationNames = animNode.animationNames;
this.showLetterAnim(1000, itemLetterSmall);
itemLetterSmall.x = itemBgSmall.x - letterW;
itemLetterSmall.y = itemBgSmall.y;
itemLetterSmall.scale = 0.614;
// itemLetterSmall.y += itemBgSmall.height / 6;
})
// const letterS = this.data.letter.toLowerCase();
// const itemLetterSmall = getSprNode('letter/' + letterS + '_0_1');
// // itemLetterSmall.x = -this.canvas.width / 2 + 70 * this._mapScaleMin;
// // itemLetterSmall.y = -30 * this._mapScaleMin;
// itemLetterSmall.scale = this._mapScaleMin;
// this.canvas.addChild(itemLetterSmall);
// const itemBgSmall = getSprNode('item_bg');
// itemBgSmall.scale = this._mapScaleMin;
// // itemBgSmall.x = itemLetterSmall.x + 70 * this._mapScaleMin;
// // itemBgSmall.y = itemLetterSmall.y;
// itemBgSmall.anchorX = 0;
// this.canvas.addChild(itemBgSmall);
// this.itemBgSmall = itemBgSmall;
// const letterW = 50 * this._mapScaleMin;
// itemBgSmall.x = -itemBgSmall.width / 2 * itemBgSmall.scaleX + letterW;
// itemBgSmall.y = -30 * this._mapScaleMin;
// itemLetterSmall.x = itemBgSmall.x - letterW;
// itemLetterSmall.y = itemBgSmall.y;
// const letterAnim0 = this.getLetterAnimSmall0(letterS.toLowerCase());
// letterAnim0.x = 100;
// letterAnim0.y = 7;
// letterAnim0.opacity = 160;
// this.letterAnimSmall = letterAnim0;
// itemBgSmall.addChild(letterAnim0);
// const baseX = letterAnim0.x + 150;
// const baseY = 4;
// const disW = 132;
// for (let i=0; i<7; i++) {
// const letterAnim1 = this.getLetterAnimSmall1(letterS);
// letterAnim1.x = baseX + i * disW;
// letterAnim1.y = baseY;
// if (i < 2) {
// letterAnim1.opacity = 255 * 0.5;
// } else {
// letterAnim1.active = false;
// }
// itemBgSmall.addChild(letterAnim1);
// }
}, },
getLetterAnimBig0(resName) { getLetterAnimBig0(resName) {
...@@ -582,8 +823,6 @@ cc.Class({ ...@@ -582,8 +823,6 @@ cc.Class({
return letter; return letter;
// const sprNode = getSprNode('letter/' + letter + '_1_0');
// return sprNode;
}, },
getLetterAnimBig1(letter) { getLetterAnimBig1(letter) {
...@@ -638,7 +877,7 @@ cc.Class({ ...@@ -638,7 +877,7 @@ cc.Class({
const layer = new cc.Node(); const layer = new cc.Node();
layer.x = -this.canvas.width / 2 + 10; layer.x = -this.canvas.width / 2 + 10;
layer.y = this.canvas.height / 2 - 10; layer.y = this.canvas.height / 2 - 10;
layer.active = false; // layer.active = false;
const sample = getSprNode('sample'); const sample = getSprNode('sample');
sample.anchorX = 0; sample.anchorX = 0;
...@@ -729,7 +968,7 @@ cc.Class({ ...@@ -729,7 +968,7 @@ cc.Class({
this.canvas.addChild(layer) this.canvas.addChild(layer, 10)
this.debugLayer = layer; this.debugLayer = layer;
}, },
...@@ -768,7 +1007,9 @@ cc.Class({ ...@@ -768,7 +1007,9 @@ cc.Class({
this.playAni('normal', 0); this.playAni('normal', 0);
// this.startTesting(); // this.startTesting();
this.showBigLetterAnim(); this.showLetterAnim(1, this.letterAnimBig, () => {
this.showBigLetter1Audio();
});
} }
...@@ -788,18 +1029,32 @@ cc.Class({ ...@@ -788,18 +1029,32 @@ cc.Class({
}) })
}, },
showBigLetterAnim() { showLetterAnim(timeScale = 1, animNode, cb=null) {
console.log(' in showBigLetterAnim') console.log(' in showLetterAnim')
const anim = this.letterAnimBig.getComponent(cc.Animation);
const dragonDisplay = animNode.getComponent(dragonBones.ArmatureDisplay);
dragonDisplay.timeScale = timeScale;
dragonDisplay.playAnimation(animNode.animationNames[0], 1);
dragonDisplay.once( dragonBones.EventObject.LOOP_COMPLETE , () => {
cb && cb();
})
// const anim = this.letterAnimBig.getComponent(cc.Animation);
// anim.play('anim_A_0');
// const cb = () => {
// console.log('in finished');
// this.showBigLetter1Audio();
// anim.off('finished', cb)
// }
// anim.on('finished', cb);
anim.play('anim_A_0');
const cb = () => {
console.log('in finished');
this.showBigLetter1Audio();
anim.off('finished', cb)
}
anim.on('finished', cb);
}, },
showBigLetter1Audio() { showBigLetter1Audio() {
...@@ -810,7 +1065,7 @@ cc.Class({ ...@@ -810,7 +1065,7 @@ cc.Class({
this.canTouch = true; this.canTouch = true;
this.startTesting(); this.startTesting();
// this.showBigLetterAnim(); // this.showLetterAnim();
} }
...@@ -885,6 +1140,31 @@ cc.Class({ ...@@ -885,6 +1140,31 @@ cc.Class({
} }
writeRect.isShowEnd = true; writeRect.isShowEnd = true;
playAudio(this.audioRight.clip);
if (!isSmall) {
const animNode = this.lineLetterBigArr[index];
animNode.active = true;
animNode.opacity = 255;
this.showLetterAnim(1, animNode, () => {
});
} else {
const animNode = this.lineLetterSmallArr[index];
animNode.active = true;
animNode.opacity = 255;
this.showLetterAnim(1, animNode, () => {
});
}
return;
console.log('show Letter small 2 :' , index) console.log('show Letter small 2 :' , index)
const letterAnim = this.getLetterAnim(isSmall); const letterAnim = this.getLetterAnim(isSmall);
...@@ -1962,66 +2242,6 @@ cc.Class({ ...@@ -1962,66 +2242,6 @@ cc.Class({
return wordArr; return wordArr;
// const wordArr = [];
// const maxLen = 10;
// text = text.trim();
// const topY = -topLabelData.word[0].location.top;
// const bottomY = -bottomLabelData.word[0].location.top;
// for(let j=0; j<block.length; j++) {
// const line = block[j].line;
// if (!line) {
// continue;
// }
// for (let i=0; i<line.length; i++) {
// const location = line[i].word[0].location;
// const curTop = -location.top;
// if (curTop >= topY || curTop <= bottomY) {
// continue;
// }
// let word = line[i].word;
// let sentence = ''
// if (word.length > maxLen) {
// console.log('continue ', word.length);
// continue;
// }
// line[i].word = word = this.checkCutWordData(word);
// // console.log('word1~ ', word);
// word.forEach(item => {
// sentence += item.content + ' ';
// });
// sentence.trim();
// line[i].sentence = sentence;
// console.log('sentence: ', sentence);
// console.log('text: ', text);
// console.log('index: ', sentence.indexOf(text));
// if (sentence.indexOf(text) != -1 ) {
// wordArr.push( line[i] );
// }
// }
// }
// return wordArr;
}, },
checkCutWordData(wordArr) { checkCutWordData(wordArr) {
...@@ -2065,6 +2285,70 @@ cc.Class({ ...@@ -2065,6 +2285,70 @@ cc.Class({
}, },
getOneAnim(data ,cb) {
if (!data.texPngData) {
cb && cb();
return
}
const animaNode = new cc.Node();
const dragonDisplay = animaNode.addComponent(dragonBones.ArmatureDisplay);
const image = data.texPngData.url//"http://staging-teach.cdn.ireadabc.com/5a0c5af3e952acd0ac83a6e5c6f03ff1.png";
const ske = data.skeJsonData.url//"http://staging-teach.cdn.ireadabc.com/bd825dcceea298d1146be8067ae3d17f.json";
const atlas = data.texJsonData.url//"http://staging-teach.cdn.ireadabc.com/246f8991b729fa3e5a7f4802de828efa.json";
cc.loader.load(image, (error, texture) => {
cc.loader.load({url: atlas, type: 'txt'}, (error, atlasJson) => {
cc.loader.load({url: ske, type: 'txt'}, (error, dragonBonesJson) => {
const atlas = new dragonBones.DragonBonesAtlasAsset();
atlas.atlasJson = atlasJson;
atlas.texture = texture;
const asset = new dragonBones.DragonBonesAsset();
asset.dragonBonesJson = dragonBonesJson;
dragonDisplay.dragonAtlasAsset = atlas;
dragonDisplay.dragonAsset = asset;
let json = JSON.parse(asset.dragonBonesJson);
let armatures = json["armature"];
let armatureNames = [];
for (let i = 0; i < armatures.length; i++) {
armatureNames.push(armatures[i].name);
}
if (armatureNames.length > 0) {
let defaultArmatureName = armatureNames[0];
dragonDisplay.armatureName = defaultArmatureName;
let defaultArmature = armatures[0];
let animations = defaultArmature.animation;
let animationNames = [];
for (let i = 0; i < animations.length; i++) {
animationNames.push(animations[i].name);
}
animaNode.animationNames = animationNames;
}
cb(animaNode);
});
});
});
},
topLabelData: null, topLabelData: null,
bottomLabelData: null, bottomLabelData: null,
topLeftLetter: null, topLeftLetter: null,
......
export const defaultData = {"write_big_0_audio_url":"http://staging-teach.cdn.ireadabc.com/443413d501c007c9a05c8f93416b60e1.mp3","write_big_1_audio_url":"http://staging-teach.cdn.ireadabc.com/7cd79c2e777bc1b7c916fdb5e5e326a8.mp3","write_big_2_audio_url":"http://staging-teach.cdn.ireadabc.com/0fd3a090c37a2c11bb8503908a1326f2.mp3","write_small_0_audio_url":"http://staging-teach.cdn.ireadabc.com/0b2bac3cae824af3ace9c183115fcd15.mp3","write_small_1_audio_url":"http://staging-teach.cdn.ireadabc.com/9b28f76d7966d2ade83a746b7ac1664c.mp3","write_small_2_audio_url":"http://staging-teach.cdn.ireadabc.com/908269df525600b866042ab473a0b879.mp3","finish_audio_url":"http://staging-teach.cdn.ireadabc.com/7be3761deb1c904e68a0cd3b47cd28d1.mp3","tip_audio_url":"http://staging-teach.cdn.ireadabc.com/52824b6c66664de8ee7b3bef3af5593f.mp3","letter":"A"} export const defaultData = {"write_big_0_audio_url":"http://staging-teach.cdn.ireadabc.com/443413d501c007c9a05c8f93416b60e1.mp3","write_big_1_audio_url":"http://staging-teach.cdn.ireadabc.com/7cd79c2e777bc1b7c916fdb5e5e326a8.mp3","write_big_2_audio_url":"http://staging-teach.cdn.ireadabc.com/0fd3a090c37a2c11bb8503908a1326f2.mp3","write_small_0_audio_url":"http://staging-teach.cdn.ireadabc.com/0b2bac3cae824af3ace9c183115fcd15.mp3","write_small_1_audio_url":"http://staging-teach.cdn.ireadabc.com/9b28f76d7966d2ade83a746b7ac1664c.mp3","write_small_2_audio_url":"http://staging-teach.cdn.ireadabc.com/908269df525600b866042ab473a0b879.mp3","finish_audio_url":"http://staging-teach.cdn.ireadabc.com/7be3761deb1c904e68a0cd3b47cd28d1.mp3","tip_audio_url":"http://staging-teach.cdn.ireadabc.com/52824b6c66664de8ee7b3bef3af5593f.mp3","letter":"A","animArr":[{"key":"letter_big_0","title":"大写彩色动画","skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/25c3e44a24d2558fdd9d21bd020a12f7.json","name":"A_big_color_ske.json"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/b9f338ed66c1d683e606f6e17db1208f.json","name":"A_big_color_tex.json"},"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/6f00f2443f7b598d82479e85d1507b82.png","name":"A_big_color_tex.png"}},{"key":"letter_big_1","title":"大写黑色动画","skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/b8f88524300ff0c56f8c29307dccd202.json","name":"A_big_ske.json"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/f7e98e5a8d50ed84e285e2c664747cc2.json","name":"A_big_tex.json"},"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/ad5527e45a30b44f8238743055d0ae2b.png","name":"A_big_tex.png"}},{"key":"letter_small_0","title":"小写彩色动画","skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/d59a88955bbfac24b682aea5ffdb159c.json","name":"a_small_color_ske.json"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/8f865752a7c35f5e2a421851b072ae72.json","name":"a_small_color_tex.json"},"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/1092894cb5a02d2c2d96803166fd4e79.png","name":"a_small_color_tex.png"}},{"key":"letter_small_1","title":"小写黑色动画","skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/485d26f6e36426e2431a2c9a5ae33e14.json","name":"a_small_ske.json"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/10aa01d5bcb4c35ad3a4ff3a41204a2d.json","name":"a_small_tex.json"},"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/fca78056f7c139918484443a9bf7cca8.png","name":"a_small_tex.png"}}],"letter_small_pic_url":"http://staging-teach.cdn.ireadabc.com/f7f72381d37bb389c2b277bc79a197c3.png","letter_big_pic_url":"http://staging-teach.cdn.ireadabc.com/3decbe2e9d3537c8db340af67fc69f54.png","dot_big_1_url":"http://staging-teach.cdn.ireadabc.com/88695b362c7fd57c51ec4cfd71ae2e73.png","dot_big_2_url":"http://staging-teach.cdn.ireadabc.com/b46a06ca66b373cdf7e129b026a6248d.png","dot_small_1_url":"http://staging-teach.cdn.ireadabc.com/f4733b392faae330311cf8e95ca3e21f.png","dot_small_2_url":"http://staging-teach.cdn.ireadabc.com/d62ead9ca6ce1ed29f08a5d28e8dd2ea.png"}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "6cfc27c3-5eb1-40be-b7e2-e85c1fd66642",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 94,
"height": 96,
"platformSettings": {},
"subMetas": {
"icon_1": {
"ver": "1.0.4",
"uuid": "1ad30604-b532-4332-81a5-2d07bffbc702",
"rawTextureUuid": "6cfc27c3-5eb1-40be-b7e2-e85c1fd66642",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 94,
"height": 96,
"rawWidth": 94,
"rawHeight": 96,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "fe41dd10-7ea6-426c-9742-0b65a2f6e9d6",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 94,
"height": 96,
"platformSettings": {},
"subMetas": {
"icon_2": {
"ver": "1.0.4",
"uuid": "e385c97d-e4e6-4287-b908-bfd378a095ca",
"rawTextureUuid": "fe41dd10-7ea6-426c-9742-0b65a2f6e9d6",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 94,
"height": 96,
"rawWidth": 94,
"rawHeight": 96,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "8c74bdca-9bc4-47c6-a6bd-4416ec612b86",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 94,
"height": 96,
"platformSettings": {},
"subMetas": {
"icon_3": {
"ver": "1.0.4",
"uuid": "61908aeb-79c3-4d79-be26-e0ddecb23f9c",
"rawTextureUuid": "8c74bdca-9bc4-47c6-a6bd-4416ec612b86",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 94,
"height": 96,
"rawWidth": 94,
"rawHeight": 96,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "f2e5ba6b-cd8d-4052-82f1-38183cf635b2",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 94,
"height": 96,
"platformSettings": {},
"subMetas": {
"icon_4": {
"ver": "1.0.4",
"uuid": "071b1a39-408a-4c42-bac7-0ac0d2f0f2f6",
"rawTextureUuid": "f2e5ba6b-cd8d-4052-82f1-38183cf635b2",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 94,
"height": 96,
"rawWidth": 94,
"rawHeight": 96,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "6ca2770a-224f-457d-8c97-ad96a323ebe5",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 94,
"height": 96,
"platformSettings": {},
"subMetas": {
"icon_5": {
"ver": "1.0.4",
"uuid": "d7837a05-9648-4134-8e45-6a431bcb5efb",
"rawTextureUuid": "6ca2770a-224f-457d-8c97-ad96a323ebe5",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 94,
"height": 96,
"rawWidth": 94,
"rawHeight": 96,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "b75d9c0a-5baf-4982-b889-f44270cdb020",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 94,
"height": 96,
"platformSettings": {},
"subMetas": {
"icon_6": {
"ver": "1.0.4",
"uuid": "194462d0-cbaa-4d72-ba2d-70975222d9e3",
"rawTextureUuid": "b75d9c0a-5baf-4982-b889-f44270cdb020",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 94,
"height": 96,
"rawWidth": 94,
"rawHeight": 96,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
...@@ -67,10 +67,56 @@ ...@@ -67,10 +67,56 @@
></app-audio-recorder> ></app-audio-recorder>
</div> </div>
<div style="width: 200px; margin-top: 15px;"> <div style="width: 200px; margin-top: 15px; display: flex; align-items: center;">
<span>字母: </span> <span style="width: 50px;">字母: </span>
<input type="text" nz-input [(ngModel)]="item.letter" (blur)="save()"> <input type="text" nz-input [(ngModel)]="item.letter" (blur)="save()">
</div> </div>
<div *ngFor="let anim of item.animArr" style="width: 500px; margin-top: 15px; display: flex; align-items: center;">
<span style="margin-right: 10px;">{{anim.title}}: </span>
<app-upload-dragon-bone
[skeJsonData]="anim.skeJsonData || {}"
[texJsonData]="anim.texJsonData || {}"
[texPngData]="anim.texPngData || {} "
(save)="saveAnimArr($event, anim)"
>
</app-upload-dragon-bone>
</div>
<div style="width: 300px; margin-top: 20px;" align='center'>
<span>大写字母点1: </span>
<app-upload-image-with-preview
[picUrl]="item.dot_big_1_url"
(imageUploaded)="onImageUploadSuccess($event, 'dot_big_1_url')">
</app-upload-image-with-preview>
</div>
<div style="width: 300px; margin-top: 20px;" align='center'>
<span>大写字母点2: </span>
<app-upload-image-with-preview
[picUrl]="item.dot_big_2_url"
(imageUploaded)="onImageUploadSuccess($event, 'dot_big_2_url')">
</app-upload-image-with-preview>
</div>
<div style="width: 300px; margin-top: 20px;" align='center'>
<span>小写字母点1: </span>
<app-upload-image-with-preview
[picUrl]="item.dot_small_1_url"
(imageUploaded)="onImageUploadSuccess($event, 'dot_small_1_url')">
</app-upload-image-with-preview>
</div>
<div style="width: 300px; margin-top: 20px;" align='center'>
<span>小写字母点2: </span>
<app-upload-image-with-preview
[picUrl]="item.dot_small_2_url"
(imageUploaded)="onImageUploadSuccess($event, 'dot_small_2_url')">
</app-upload-image-with-preview>
</div>
<!-- <div style="width: 300px;" align='center'> <!-- <div style="width: 300px;" align='center'>
......
...@@ -14,6 +14,13 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -14,6 +14,13 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
// 储存对象 // 储存对象
item; item;
animArr = [
{key: 'letter_big_0', title: '大写彩色动画'},
{key: 'letter_big_1', title: '大写黑色动画'},
{key: 'letter_small_0', title: '小写彩色动画'},
{key: 'letter_small_1', title: '小写黑色动画'},
]
constructor(private appRef: ApplicationRef, private changeDetectorRef: ChangeDetectorRef) { constructor(private appRef: ApplicationRef, private changeDetectorRef: ChangeDetectorRef) {
} }
...@@ -60,6 +67,20 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -60,6 +67,20 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
init() { init() {
if (!this.item.animArr) {
this.item.animArr = this.animArr;
}
}
saveAnimArr(data, anim) {
console.log('data: ', data);
console.log('anim: ', anim);
anim["skeJsonData"] = data.skeJsonData;
anim["texJsonData"] = data.texJsonData;
anim["texPngData"] = data.texPngData;
this.save();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment