Commit cc995f21 authored by Tt's avatar Tt

001增加按鈕響應

parent 6495f1c6
import { asyncDelay, onHomeworkFinish } from "../script/util"; import { asyncDelay, onHomeworkFinish, callMiddleLayerFunction } from "../script/util";
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent"; import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent";
const { ccclass, property } = cc._decorator; const { ccclass, property } = cc._decorator;
...@@ -45,8 +45,10 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -45,8 +45,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.node.on('page1_btn_click', (event) => { this.node.on('page1_btn_click', (event) => {
event.stopPropagation(); event.stopPropagation();
let data = event.getUserData(); let data = event.getUserData();
console.log(data); console.log(JSON.stringify(data));
alert("点击了" + JSON.stringify(data)); callMiddleLayerFunction('NS_select_stage', { stageId: data.id }, (result) => {
console.log(JSON.stringify(result));
});
}); });
} }
toPage1(testData = null) { toPage1(testData = null) {
......
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