Commit 28e00509 authored by liujiangnan's avatar liujiangnan

feat:播放帧动画

parent 1c352eae
...@@ -136,6 +136,31 @@ export default class NewClass extends cc.Component { ...@@ -136,6 +136,31 @@ export default class NewClass extends cc.Component {
await this.drawPageItems(parseInt(index)); await this.drawPageItems(parseInt(index));
} }
clearnDetailItem() {
const node = cc.find("Canvas/reportdetail");
const contentNode = cc.find("view/content/userdetail_scollpage/learnresult/itembg", node);
// 清理原来的数据
// 字母
const letterRow = cc.find("letter_row", contentNode);
const letterItem = cc.find("item", letterRow);
letterItem.parent = node;
letterRow.removeAllChildren();
letterItem.parent = letterRow;
// 单词
const wordRow = cc.find("word_row", contentNode);
const wordItem = cc.find("item", wordRow);
wordItem.parent = node;
wordRow.removeAllChildren();
wordItem.parent = wordRow;
// 句子
const sentenceRow = cc.find("sentence_row", contentNode);
const sentenceItem = cc.find("item", sentenceRow);
sentenceItem.parent = node;
sentenceRow.removeAllChildren();
sentenceItem.parent = sentenceRow;
}
async onShowLearnDetail(evt: cc.Event) { async onShowLearnDetail(evt: cc.Event) {
const node = evt.currentTarget; const node = evt.currentTarget;
if (node.locked) { if (node.locked) {
...@@ -143,8 +168,11 @@ export default class NewClass extends cc.Component { ...@@ -143,8 +168,11 @@ export default class NewClass extends cc.Component {
return; return;
} }
cc.find("Canvas/learnreport").active = false; // 清除之前渲染的列表
this.clearnDetailItem();
cc.find("Canvas/reportdetail").active = true; cc.find("Canvas/reportdetail").active = true;
cc.find("Canvas/learnreport").active = false;
const token = cc.sys.localStorage.getItem("token"); const token = cc.sys.localStorage.getItem("token");
const res: any = await asyncCallNetworkApiGet("/api/oxford/v1/kid/learn/forder/report", { kidid: node.kidid, folderid: node.folder_id, token }); const res: any = await asyncCallNetworkApiGet("/api/oxford/v1/kid/learn/forder/report", { kidid: node.kidid, folderid: node.folder_id, token });
...@@ -232,9 +260,24 @@ export default class NewClass extends cc.Component { ...@@ -232,9 +260,24 @@ export default class NewClass extends cc.Component {
cc.find("split_line", resultNode).active = false; cc.find("split_line", resultNode).active = false;
} }
}
// 播放录音
async onPlayRecordAudio(evt: cc.Event) {
const node = evt.currentTarget;
if (!node.audio_url) {
// TODO 弹出提示框“没有录音”
return;
} }
const playNode = cc.find("play", node.parent);
playNode.active = true;
const animationState = playNode.getComponent(cc.Animation).getAnimationState("play1");
animationState.wrapMode = cc.WrapMode.Loop;
animationState.play();
}
// 返回用户中心 // 返回用户中心
async onClickBackToUserCenter() { async onClickBackToUserCenter() {
...@@ -244,4 +287,10 @@ export default class NewClass extends cc.Component { ...@@ -244,4 +287,10 @@ export default class NewClass extends cc.Component {
cc.find("Canvas/learnreport").active = false; cc.find("Canvas/learnreport").active = false;
} }
// 返回报告列表
async onClickBackToReportPage() {
cc.find("Canvas/learnreport").active = true;
cc.find("Canvas/reportdetail").active = false;
}
} }
{
"ver": "2.3.5",
"uuid": "7b3832de-78fe-4ef4-a0ab-6e9774b8271c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 102,
"height": 39,
"platformSettings": {},
"subMetas": {
"play1": {
"ver": "1.0.4",
"uuid": "701fdca4-143c-4e5a-8b4e-eafcf2c8e9bd",
"rawTextureUuid": "7b3832de-78fe-4ef4-a0ab-6e9774b8271c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 102,
"height": 39,
"rawWidth": 102,
"rawHeight": 39,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "5ce590e3-075c-4531-b09c-4bd13102fce6",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 102,
"height": 39,
"platformSettings": {},
"subMetas": {
"play2": {
"ver": "1.0.4",
"uuid": "4a7f44f8-6994-4585-8d93-bdb4a4d96e33",
"rawTextureUuid": "5ce590e3-075c-4531-b09c-4bd13102fce6",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 102,
"height": 39,
"rawWidth": 102,
"rawHeight": 39,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "46cc6f47-2e78-48be-9d11-7486f5a73842",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 102,
"height": 39,
"platformSettings": {},
"subMetas": {
"play3": {
"ver": "1.0.4",
"uuid": "f1be6db4-5bb1-406b-b8ee-998c36b91a6c",
"rawTextureUuid": "46cc6f47-2e78-48be-9d11-7486f5a73842",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 102,
"height": 39,
"rawWidth": 102,
"rawHeight": 39,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "5691dc58-0fde-42a1-99fd-cae6dba4c020",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 102,
"height": 39,
"platformSettings": {},
"subMetas": {
"play_icon": {
"ver": "1.0.4",
"uuid": "3cca2fb0-1a57-4bb5-b9ae-425478934001",
"rawTextureUuid": "5691dc58-0fde-42a1-99fd-cae6dba4c020",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 102,
"height": 39,
"rawWidth": 102,
"rawHeight": 39,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"__type__": "cc.AnimationClip",
"_name": "play1",
"_objFlags": 0,
"_native": "",
"_duration": 1.0166666666666666,
"sample": 60,
"speed": 1,
"wrapMode": 1,
"curveData": {
"comps": {
"cc.Sprite": {
"spriteFrame": [
{
"frame": 0,
"value": {
"__uuid__": "701fdca4-143c-4e5a-8b4e-eafcf2c8e9bd"
}
},
{
"frame": 0.3333333333333333,
"value": {
"__uuid__": "4a7f44f8-6994-4585-8d93-bdb4a4d96e33"
}
},
{
"frame": 0.6666666666666666,
"value": {
"__uuid__": "f1be6db4-5bb1-406b-b8ee-998c36b91a6c"
}
},
{
"frame": 1,
"value": {
"__uuid__": "701fdca4-143c-4e5a-8b4e-eafcf2c8e9bd"
}
}
]
}
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.0",
"uuid": "0ff81042-2658-4de6-8d60-9ce292197bad",
"subMetas": {}
}
\ No newline at end of file
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