Commit de3ab299 authored by wildfirecode13's avatar wildfirecode13

update

parent bed44ef6
......@@ -13,7 +13,13 @@ export class IndexScene extends Scene {
}
async start(data) {
super.start();
super.start(data);
data = data || {};
const { action, from } = data;
console.log('IndexScene', 'from=', from, 'action', action);
if (action == 'doShareCallback') {
}
// console.log(this);
......@@ -23,7 +29,7 @@ export class IndexScene extends Scene {
}
onPageVisibilityChange = async (visible) => {
console.log('页面' + visible ? '可见' : '不可见');
console.log('页面visible', visible);
const current = PanelCtrl.instance.current;
if (visible && !current) {
var res = await sendWebNet(WebNetName.canshare)
......
import { showPanel } from "../../module/ctrls";
import { unwatchPageVisibility, watchPageVisibility } from "@spark/utils";
import { changeScene, closeCurrentPanel, showPanel } from "../../module/ctrls";
import PanelCtrl from "../../module/ctrls/panelCtrl";
import { Scene } from "../../module/views/Scene";
import { PrizePanel } from "../panels/prize";
import { ShareFailPanel } from "../panels/share_fail";
import { ShareSuccessPanel } from "../panels/share_success";
import { sendWebNet, WebNetName } from "../WebNet";
import { IndexScene } from "./IndexScene";
let prize;
export class NewbieScene extends Scene {
onPageVisibilityChange = async (visible) => {
console.log('页面visible',visible);
if (!prize) {
console.log('没有领体验金'); return;
};
if (visible) {
closeCurrentPanel();
changeScene(IndexScene,{from:'NewbieScene',action:'doShareCallback'});
}
}
get groupNames() { return ["newbie"] }
get skinName() { return "newbie" }
......@@ -13,15 +32,21 @@ export class NewbieScene extends Scene {
super.start();
this.addEventListener(FYGE.MouseEvent.CLICK, () => {
prize = 1;
showPanel(PrizePanel, data);
}, this);
}
initEvents() {
super.initEvents();
watchPageVisibility(this.onPageVisibilityChange)
}
removeEvents() {
super.removeEvents();
unwatchPageVisibility(this.onPageVisibilityChange)
}
......
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