Commit a6f8e6e0 authored by 范雪寒's avatar 范雪寒

feat:

parent 1e11767b
{
"ver": "2.0.1",
"uuid": "f0680ae0-c079-45ef-abd7-9e63d90b982b",
"downloadMode": 0,
"duration": 0.130612,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "c551970e-b095-45f3-9f1d-25cde8b8deb1",
"subMetas": {}
}
\ No newline at end of file
import { asyncCallNetworkApiGet, asyncDelay, onHomeworkFinish } from "../script/util";
import { asyncCallNetworkApiGet, asyncDelay, jumpToCourseWare, onHomeworkFinish } from "../script/util";
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent";
const { ccclass, property } = cc._decorator;
......@@ -7,22 +7,58 @@ const { ccclass, property } = cc._decorator;
export default class SceneComponent extends MyCocosSceneComponent {
addPreloadImage() {
// this._imageResList.push({ url: this.data.pic_url });
this._imageResList.push({ url: this.data.havePic });
this.data.pageArr.forEach(page => {
this._imageResList.push({ url: page.bgItem.url });
this._imageResList.push({ url: page.startBg });
});
}
async onLoadEnd() {
await this.initData();
this.initView();
this.updateView();
this.initListener();
await this.startStep1();
await this.startStep2();
}
async startStep1() {
await this.asyncPlayAudioByUrl(this.data.pageArr[this.currentPageIdx].startAudio);
await asyncDelay(0.3);
const circle = cc.find('Canvas/step1/pad/circle');
circle.active = true;
const progress = cc.find('Canvas/step1/pad/circle/progress');
await this.asyncCountDown(progress, 3);
await asyncDelay(0.3);
await this.checkPage();
}
async startStep2() {
await this.asyncPlayAudioByUrl(this.data.pageArr[this.currentPageIdx].hotZoneItemArr[this.currentPartIdx].audio_url);
await asyncDelay(0.3);
await this.checkPart();
// jumpToCourseWare
}
async checkPage() {
}
async checkPart() {
}
rows: Array<any>;
step = 0;
currentPageIdx = 0;
currentPartIdx = 0;
async initData() {
const middleLayer = cc.find('middleLayer');
if (!middleLayer) {
return;
let folderId = 20650;
if (middleLayer) {
const middleLayerComponent = middleLayer.getComponent('middleLayer');
folderId = middleLayerComponent.getData('NJ_game_select').folderId;
}
const middleLayerComponent = middleLayer.getComponent('middleLayer');
const folderId = middleLayerComponent.getData();
console.log('folderId = ' + folderId);
const resStr = await asyncCallNetworkApiGet('/api/syllabus/v1/list', {
......@@ -30,13 +66,80 @@ export default class SceneComponent extends MyCocosSceneComponent {
});
console.log('resStr = ' + resStr);
const res = JSON.parse(resStr);
this.rows = res.rows.filter(row => row.name != '指读索引');
}
asyncCountDown(node: cc.Node, time: number) {
return new Promise<void>((resolve, reject) => {
this.countDown(node, time, () => {
resolve();
});
});
}
countDown(node: cc.Node, time: number, callback = null) {
const progressComponent = node.getComponent(cc.ProgressBar);
cc.tween(progressComponent)
.to(time, { progress: 0 })
.call(() => {
callback && callback();
})
.start();
}
updateView() {
const page = cc.find('Canvas/step1/pad/mask/page');
const pageUrl = this.data.pageArr[this.currentPageIdx].bgItem.url;
this.setNodeSpirteFrameByUrl(pageUrl, page, () => {
page.scale = page.parent.height / page.height;
});
const step1 = cc.find('Canvas/step1');
const step2 = cc.find('Canvas/step2');
if (this.step == 0) {
step1.active = true;
step2.active = false;
} else {
step1.active = false;
step2.active = true;
}
const partImg = cc.find('Canvas/step2/pad/mask/page');
this.setNodeSpirteFrameByUrl(pageUrl, partImg, () => {
// partImg.scale = partImg.parent.height / partImg.height;
});
initView() {
const book_left = cc.find('Canvas/step1/book_left');
const book_right = cc.find('Canvas/step1/book_right');
if (this.currentPageIdx % 2 == 0) {
book_left.active = true;
book_right.active = false;
} else {
book_left.active = false;
book_right.active = true;
}
const bgNode = cc.find('Canvas/bg');
bgNode.color = cc.color(255, 255, 255);
const startBg = this.data.pageArr[this.currentPageIdx].startBg;
this.setNodeSpirteFrameByUrl(startBg, bgNode);
}
initListener() {
}
asyncPlayAudioByUrl(url: string): Promise<void> {
return new Promise((resolve, reject) => {
this.playAudioByUrl(url, () => {
resolve();
});
});
}
setNodeSpirteFrameByUrl(url: string, node: cc.Node, callBack = null) {
cc.assetManager.loadRemote(url, (err, tex) => {
node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(tex);
callBack && callBack();
});
}
}
export const defaultData = {
bookPages: [{
pageIdx: 1, // 第几页
startAudio: 'http://xxxx.mp3', // 页码引导音频
startBg: 'http://xxxx.jpg', // 页码背景图片
scanImg: 'http://xxxx.jpg', // 页码扫描图片
bookDataInfo: {
bgItem: {
guidAudio: 'http://xxxx.mp3', // 热区引导音频
guidBg: 'http://xxxx.jpg', // 热区背景图片
havePic: "http://staging-teach.cdn.ireadabc.com/7a23e43f8ec4964e3feb9709ec553fd4.png",
skeJsonData: {
url: "http://staging-teach.cdn.ireadabc.com/5069b9316d9b69705281752f03b47901.json",
name: "mao_ske.json"
},
texJsonData: {
url: "http://staging-teach.cdn.ireadabc.com/3bbb72fd8ad3c02aa1df8d3785f4b34f.json",
name: "mao_tex.json"
},
texPngData: {
url: "http://staging-teach.cdn.ireadabc.com/c130de476dac5e9bbd71f92b2711d3ba.png",
name: "mao_tex.png"
},
pageArr: [{
pageIdx: "4",
bgItem: {
url: "http://staging-teach.cdn.ireadabc.com/05a97df4c007e93d06a31e9573f73c70.png",
rect: {
x: 325.58,
y: 0,
width: 296.85,
height: 378
}
},
hotZoneItemArr: [{
id: "1653445055937",
index: 0,
audio_url: "http://staging-teach.cdn.ireadabc.com/9ed260b1f7117ef534f8a58315b5c1fa.mp3",
itemType: "rect",
fontScale: 0.740625,
imgScale: 1,
imgSizeW: 0,
imgSizeH: 0,
mapScale: 0.740625,
dragDot: {
x: 474,
y: 189
},
hotZoneArr: [{ // 数组顺序
rect: { x: 0, y: 0, width: 100, height: 100 },
}, { // 数组顺序
rect: { x: 0, y: 0, width: 100, height: 100 },
}]
}
gIdx: "0",
posX: 473,
posY: 100,
rect: {
x: 13.42,
y: 36,
width: 268,
height: 128
}
},
{
id: "1653445079373",
index: 1,
audio_url: "http://staging-teach.cdn.ireadabc.com/b435d0eaeb83a0c5890cf25c8498437d.mp3",
itemType: "rect",
fontScale: 0.740625,
imgScale: 1,
imgSizeW: 0,
imgSizeH: 0,
mapScale: 0.740625,
dragDot: {
x: 474,
y: 189
},
gIdx: "0",
posX: 476,
posY: 253,
rect: {
x: 9.42,
y: 164,
width: 282,
height: 178
}
}],
scanImg: "http://staging-teach.cdn.ireadabc.com/05a97df4c007e93d06a31e9573f73c70.png",
startAudio: "http://staging-teach.cdn.ireadabc.com/6adb999b715a7804c642c361c4ec0f69.mp3",
startBg: "http://staging-teach.cdn.ireadabc.com/61603343b305bdd0d7007707f8ee185c.jpg"
}]
}
\ No newline at end of file
}
{
"ver": "2.3.5",
"uuid": "4c628745-8ca1-43c0-a6a0-7f3a4fb92f0a",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 612,
"height": 375,
"platformSettings": {},
"subMetas": {
"booble": {
"ver": "1.0.4",
"uuid": "63327f5a-f1d4-4736-acb6-4659173c48af",
"rawTextureUuid": "4c628745-8ca1-43c0-a6a0-7f3a4fb92f0a",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 612,
"height": 375,
"rawWidth": 612,
"rawHeight": 375,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "ecabbd9e-6c32-4f26-a93a-d2a79113e708",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 41,
"height": 31,
"platformSettings": {},
"subMetas": {
"boobleSmall": {
"ver": "1.0.4",
"uuid": "65edd0e7-4d67-4015-b1f4-be36357e907c",
"rawTextureUuid": "ecabbd9e-6c32-4f26-a93a-d2a79113e708",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 41,
"height": 31,
"rawWidth": 41,
"rawHeight": 31,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "580dc2a3-fbf7-464e-9f86-69df75cb493c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 350,
"height": 94,
"platformSettings": {},
"subMetas": {
"book": {
"ver": "1.0.4",
"uuid": "6dba0977-1427-4c8d-b789-29f34baa1d93",
"rawTextureUuid": "580dc2a3-fbf7-464e-9f86-69df75cb493c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 350,
"height": 94,
"rawWidth": 350,
"rawHeight": 94,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "9980867d-3e4c-4ff9-b7a5-bb3dc54530ea",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 158,
"height": 60,
"platformSettings": {},
"subMetas": {
"btn": {
"ver": "1.0.4",
"uuid": "6e4f6287-de70-4652-bbc1-7b5bc578e75f",
"rawTextureUuid": "9980867d-3e4c-4ff9-b7a5-bb3dc54530ea",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 158,
"height": 60,
"rawWidth": 158,
"rawHeight": 60,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "65365be2-4e22-4107-8a7e-cab8da4a4fb7",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 109,
"height": 108,
"platformSettings": {},
"subMetas": {
"countDown_black": {
"ver": "1.0.4",
"uuid": "a1c77917-5ea2-4d19-9212-3c9edac102a7",
"rawTextureUuid": "65365be2-4e22-4107-8a7e-cab8da4a4fb7",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 109,
"height": 108,
"rawWidth": 109,
"rawHeight": 108,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "085d63e8-3a55-46d2-a6da-4a7500ae9476",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 109,
"height": 108,
"platformSettings": {},
"subMetas": {
"countDown_blue": {
"ver": "1.0.4",
"uuid": "289ed11c-e7bb-4661-b89c-1208443df506",
"rawTextureUuid": "085d63e8-3a55-46d2-a6da-4a7500ae9476",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 2,
"trimX": 5,
"trimY": 3,
"width": 99,
"height": 98,
"rawWidth": 109,
"rawHeight": 108,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "bc6dcd00-f643-4503-af67-70f7c9c5e631",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 684,
"height": 244,
"platformSettings": {},
"subMetas": {
"frame": {
"ver": "1.0.4",
"uuid": "0fd4caca-73af-48e5-938f-50637bd4b125",
"rawTextureUuid": "bc6dcd00-f643-4503-af67-70f7c9c5e631",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 684,
"height": 244,
"rawWidth": 684,
"rawHeight": 244,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "15c25361-4056-4a22-b5d6-7dd5de409d9a",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 576,
"height": 576,
"platformSettings": {},
"subMetas": {
"light": {
"ver": "1.0.4",
"uuid": "192dfed5-c12c-4d56-8168-a5dcdfceafe3",
"rawTextureUuid": "15c25361-4056-4a22-b5d6-7dd5de409d9a",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 576,
"height": 576,
"rawWidth": 576,
"rawHeight": 576,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "086e62a6-fdce-4e7e-9bb3-449d2fb56887",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 237,
"height": 179,
"platformSettings": {},
"subMetas": {
"pad": {
"ver": "1.0.4",
"uuid": "59eec3c9-facc-4f63-a2ee-62e287c0c5d3",
"rawTextureUuid": "086e62a6-fdce-4e7e-9bb3-449d2fb56887",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 237,
"height": 179,
"rawWidth": 237,
"rawHeight": 179,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "74ec4351-71ce-4d80-afa0-7ca0f6d8050c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 97,
"height": 126,
"platformSettings": {},
"subMetas": {
"page": {
"ver": "1.0.4",
"uuid": "1e3628d3-bb91-4dab-b90e-092aabca2434",
"rawTextureUuid": "74ec4351-71ce-4d80-afa0-7ca0f6d8050c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 97,
"height": 126,
"rawWidth": 97,
"rawHeight": 126,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "03031161-b8a8-4bfc-99fd-d040f6060d32",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 297,
"height": 199,
"platformSettings": {},
"subMetas": {
"part": {
"ver": "1.0.4",
"uuid": "5aaf7027-4f5d-43c1-80df-42f5aae44f05",
"rawTextureUuid": "03031161-b8a8-4bfc-99fd-d040f6060d32",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 297,
"height": 199,
"rawWidth": 297,
"rawHeight": 199,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "53ae939a-38cc-42a2-8396-509f6fb315b7",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.0.1",
"uuid": "26e78fda-d56d-4d7c-80d4-a14cf7d06fe1",
"subMetas": {}
}
\ No newline at end of file
{"width":2048,"SubTexture":[{"width":1280,"y":1,"height":720,"name":"从中间往四周炸星星停留1s后消失/背景","x":1},{"width":127,"y":879,"height":123,"name":"从中间往四周炸星星停留1s后消失/发光星星","x":1},{"width":72,"y":952,"height":69,"name":"从中间往四周炸星星停留1s后消失/发光星星_拷贝_13","x":817},{"width":46,"y":963,"height":44,"name":"从中间往四周炸星星停留1s后消失/发光星星_拷贝_17","x":571},{"width":46,"y":955,"height":44,"name":"从中间往四周炸星星停留1s后消失/发光星星_拷贝_18","x":738},{"width":46,"y":971,"height":44,"name":"从中间往四周炸星星停留1s后消失/发光星星_拷贝_19","x":381},{"width":46,"y":956,"height":44,"name":"从中间往四周炸星星停留1s后消失/发光星星_拷贝_20","x":658},{"width":77,"y":879,"height":74,"name":"从中间往四周炸星星停留1s后消失/发光星星_拷贝_14","x":738},{"width":159,"y":723,"height":154,"name":"从中间往四周炸星星停留1s后消失/发光星星_拷贝","x":1},{"width":159,"y":723,"height":154,"name":"从中间往四周炸星星停留1s后消失/发光星星_拷贝_2","x":806},{"width":124,"y":879,"height":120,"name":"从中间往四周炸星星停留1s后消失/发光星星_拷贝_3","x":130},{"width":85,"y":879,"height":82,"name":"从中间往四周炸星星停留1s后消失/发光星星_拷贝_15","x":571},{"width":73,"y":879,"height":71,"name":"从中间往四周炸星星停留1s后消失/发光星星_拷贝_16","x":817},{"width":93,"y":879,"height":90,"name":"从中间往四周炸星星停留1s后消失/发光星星_拷贝_5","x":476},{"width":93,"y":879,"height":90,"name":"从中间往四周炸星星停留1s后消失/发光星星_拷贝_6","x":381},{"width":78,"y":879,"height":75,"name":"从中间往四周炸星星停留1s后消失/发光星星_拷贝_7","x":658},{"width":159,"y":723,"height":154,"name":"从中间往四周炸星星停留1s后消失/发光星星_拷贝_12","x":162},{"width":159,"y":723,"height":154,"name":"从中间往四周炸星星停留1s后消失/发光星星_拷贝_9","x":484},{"width":123,"y":879,"height":119,"name":"从中间往四周炸星星停留1s后消失/发光星星_拷贝_10","x":256},{"width":159,"y":723,"height":154,"name":"从中间往四周炸星星停留1s后消失/发光星星_拷贝_11","x":645},{"width":159,"y":723,"height":154,"name":"从中间往四周炸星星停留1s后消失/发光星星_拷贝_8","x":323}],"height":1024,"name":"star","imagePath":"star_tex.png"}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "f5d85edc-331b-41b0-8843-f2a8d15aa755",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "eadb770b-a3fa-4e1c-8b5d-0a57360487ad",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 2048,
"height": 1024,
"platformSettings": {},
"subMetas": {
"star_tex": {
"ver": "1.0.4",
"uuid": "6c01af33-7c41-46ae-8254-b877c3ccf957",
"rawTextureUuid": "eadb770b-a3fa-4e1c-8b5d-0a57360487ad",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -383,
"offsetY": 1,
"trimX": 1,
"trimY": 1,
"width": 1280,
"height": 1020,
"rawWidth": 2048,
"rawHeight": 1024,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"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