Commit 60a1eb9c authored by liujiangnan's avatar liujiangnan

feat: 全部功能

parent d48c8e88
...@@ -98,8 +98,8 @@ ...@@ -98,8 +98,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 1280, "width": 1920,
"height": 720 "height": 1080
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -110,8 +110,8 @@ ...@@ -110,8 +110,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
640, 960,
360, 540,
0, 0,
0, 0,
0, 0,
...@@ -243,8 +243,8 @@ ...@@ -243,8 +243,8 @@
"_enabled": true, "_enabled": true,
"_designResolution": { "_designResolution": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 1280, "width": 1920,
"height": 720 "height": 1080
}, },
"_fitWidth": false, "_fitWidth": false,
"_fitHeight": true, "_fitHeight": true,
...@@ -337,8 +337,8 @@ ...@@ -337,8 +337,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 1280, "width": 1920,
"height": 720 "height": 1080
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -349,8 +349,8 @@ ...@@ -349,8 +349,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
640, 960,
360, 540,
0, 0,
0, 0,
0, 0,
...@@ -382,7 +382,7 @@ ...@@ -382,7 +382,7 @@
"__id__": 8 "__id__": 8
}, },
"_children": [], "_children": [],
"_active": false, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 10 "__id__": 10
...@@ -405,8 +405,8 @@ ...@@ -405,8 +405,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 171, "width": 131,
"height": 146 "height": 131
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -417,15 +417,15 @@ ...@@ -417,15 +417,15 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-577.25, -863.522,
303.5, 453.12800000000004,
0, 0,
0, 0,
0, 0,
0, 0,
1, 1,
0.5, 1,
0.5, 1,
1 1
] ]
}, },
...@@ -521,9 +521,9 @@ ...@@ -521,9 +521,9 @@
"alignMode": 2, "alignMode": 2,
"_target": null, "_target": null,
"_alignFlags": 9, "_alignFlags": 9,
"_left": 20, "_left": 30.977999999999952,
"_right": 0, "_right": 0,
"_top": 20, "_top": 21.371999999999957,
"_bottom": 0, "_bottom": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,
...@@ -553,7 +553,7 @@ ...@@ -553,7 +553,7 @@
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "dae06413-7c06-4a99-8a27-fc098af38812" "__uuid__": "57bdc862-1a68-4657-9b66-b5115d097b7e"
}, },
"_type": 0, "_type": 0,
"_sizeMode": 1, "_sizeMode": 1,
...@@ -612,8 +612,8 @@ ...@@ -612,8 +612,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
437.75, 757.75,
303.5, 483.5,
0, 0,
0, 0,
0, 0,
...@@ -807,8 +807,8 @@ ...@@ -807,8 +807,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
567.75, 887.75,
303.5, 483.5,
0, 0,
0, 0,
0, 0,
......
...@@ -42,6 +42,8 @@ export default class NewClass extends middleLayerBase { ...@@ -42,6 +42,8 @@ export default class NewClass extends middleLayerBase {
return; return;
} }
this.loadOnlineCourseWare(this.course_id, false, this.courseware_id); this.loadOnlineCourseWare(this.course_id, false, this.courseware_id);
this.initListener();
} }
onHomeworkFinish(callBack, data = null) { onHomeworkFinish(callBack, data = null) {
...@@ -63,8 +65,23 @@ export default class NewClass extends middleLayerBase { ...@@ -63,8 +65,23 @@ export default class NewClass extends middleLayerBase {
}); });
} }
exitFlag;
initListener() { initListener() {
const ExitBtn = cc.find('middleLayer/ExitBtn');
ExitBtn.on("click", () => {
if (this.exitFlag) {
return;
}
this.exitFlag = true;
cc.tween(ExitBtn)
.to(0.1, { scaleX: 0.9, scaleY: 1.1 })
.to(0.1, { scaleX: 1.1, scaleY: 0.9 })
.to(0.1, { scaleX: 1, scaleY: 1 })
.call(() => {
this.callNativeFunction({ name: "exit", value: "" });
})
.start();
});
} }
reWriteAir() { reWriteAir() {
...@@ -166,12 +183,18 @@ export default class NewClass extends middleLayerBase { ...@@ -166,12 +183,18 @@ export default class NewClass extends middleLayerBase {
paramStr paramStr
); );
} else { } else {
console.error("非源生环境,需要从URL中获取必要的参数"); if (param.name == "loadSceneList") {
const token = this.getQueryString("token"); // Mock数据
const course_id = this.getQueryString("course_id"); console.error("非源生环境,需要从URL中获取必要的参数");
const courseware_id = this.getQueryString("courseware_id"); const token = this.getQueryString("token");
const resobj = { bundleInfo: {token,course_id,courseware_id}}; const course_id = this.getQueryString("course_id");
return JSON.stringify(resobj); const courseware_id = this.getQueryString("courseware_id");
const resobj = { bundleInfo: {token,course_id,courseware_id}};
return JSON.stringify(resobj);
}
if (param.name == "exit") {
console.log("==调用退出方法成功==参数:", paramStr);
}
} }
} }
} }
...@@ -340,40 +340,3 @@ export function showTrebleFirework(baseNode, rabbonList) { ...@@ -340,40 +340,3 @@ export function showTrebleFirework(baseNode, rabbonList) {
showFireworks(left); showFireworks(left);
showFireworks(right); showFireworks(right);
} }
export function onHomeworkFinish() {
const middleLayer = cc.find('middleLayer');
if (middleLayer) {
const middleLayerComponent = middleLayer.getComponent('middleLayer');
if (middleLayerComponent.role == 'student') {
middleLayerComponent.onHomeworkFinish(() => { });
}
} else {
console.log('onHomeworkFinish');
}
}
export function callMiddleLayerFunction(apiName, data, callback) {
const middleLayer = cc.find('middleLayer');
if (middleLayer) {
const middleLayerComponent = middleLayer.getComponent('middleLayer');
middleLayerComponent.callMiddleLayerFunction(apiName, data, callback);
} else {
console.log('callMiddleLayerFunction: ' + apiName);
}
}
export function login() {
const middleLayer = cc.find('middleLayer');
if (middleLayer) {
const middleLayerComponent = middleLayer.getComponent('middleLayer');
middleLayerComponent.callMiddleLayerFunction('NS_login', {
userName: 'username123',
password: '1234567'
}, (result) => {
console.log(result);
});
} else {
console.log('NS_login');
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "b8f292f2-73ea-41e1-9d85-993bc4197375",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 131,
"height": 131,
"platformSettings": {},
"subMetas": {
"btn_return": {
"ver": "1.0.4",
"uuid": "57bdc862-1a68-4657-9b66-b5115d097b7e",
"rawTextureUuid": "b8f292f2-73ea-41e1-9d85-993bc4197375",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 131,
"height": 131,
"rawWidth": 131,
"rawHeight": 131,
"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