Commit eb2d8a6a authored by wildfirecode's avatar wildfirecode

1

parent 11f42d42
......@@ -54,6 +54,7 @@
// window['pageID'] = 'TeamShareScene';
// window['pageID'] = 'JoinShareScene';
// window['pageID'] = 'Share2Scene';
window['pageID'] = 'TransScene';
window['projectId'] = "1";
window['playwayId'] = "join_1";
window["appId"] = "";
......
......@@ -170,35 +170,35 @@ class Main extends MainBase {
// Waiting.instance.hide();
// return;
// if (window['pageID']) {
// if (GameConst.getQueryString("InviteSource")) {
// yzwNet.homeBaseInfo((s) => {
// if (!s) {
// ToastCtrl.instance.show(DataManager.ins.getData("homeBaseInfo").message)
// // ToastCtrl.instance.show("网络异常请重试~");
// return;
// }
// }, window['projectId'], GameConst.getQueryString("InviteSource"))
// }
// Waiting.instance.hide();
if (window['pageID']) {
if (GameConst.getQueryString("InviteSource")) {
yzwNet.homeBaseInfo((s) => {
if (!s) {
ToastCtrl.instance.show(DataManager.ins.getData("homeBaseInfo").message)
// ToastCtrl.instance.show("网络异常请重试~");
return;
}
}, window['projectId'], GameConst.getQueryString("InviteSource"))
}
Waiting.instance.hide();
// if (window['pageID'] == 'JoinShareScene') {
// SceneCtrl.instance.change(ModuleTypes.JoinShareScene);
// }
// if (window['pageID'] == 'TeamShareScene') {
// SceneCtrl.instance.change(ModuleTypes.TeamShareScene);
// }
// if (window['pageID'] == 'Share2Scene') {
// SceneCtrl.instance.change(ModuleTypes.Share2Scene);
// }
// if (window['pageID'] == 'TeamShareScene') {
// SceneCtrl.instance.change(ModuleTypes.TeamShareScene);
// }
// if (window['pageID'] == 'TransScene') {
// SceneCtrl.instance.change(ModuleTypes.TransScene);
// }
// return;
// }
if (window['pageID'] == 'JoinShareScene') {
SceneCtrl.instance.change(ModuleTypes.JoinShareScene);
}
if (window['pageID'] == 'TeamShareScene') {
SceneCtrl.instance.change(ModuleTypes.TeamShareScene);
}
if (window['pageID'] == 'Share2Scene') {
SceneCtrl.instance.change(ModuleTypes.Share2Scene);
}
if (window['pageID'] == 'TeamShareScene') {
SceneCtrl.instance.change(ModuleTypes.TeamShareScene);
}
if (window['pageID'] == 'TransScene') {
SceneCtrl.instance.change(ModuleTypes.TransScene);
}
return;
}
loadSvgaRes(getResPath() + 'resource/assets/svgas/standby.svga');
......
......@@ -25,7 +25,6 @@ export default class ShareStarterScene extends Scene {
this.height = this.stage.stageHeight;
}, this);
this._bg = await loadSvga(getResPath() + 'resource/assets/svgas/bg.svga', this['group']) as SVGA.EgretMovieClip;
this._bg.visible = false;
this._standby = await loadSvga(getResPath() + 'resource/assets/svgas/standby.svga', this['group']) as SVGA.EgretMovieClip;
......
......@@ -4,13 +4,13 @@ import { loadSvgaRes, loadSvga } from "../loadSvga";
import { wait } from "../GameConst";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { DataManager } from "../../libs/tw/manager/DataManager";
import { yzwNet } from "../NetConst";
export default class TransScene extends Scene {
_bg: SVGA.EgretMovieClip;
_standby: SVGA.EgretMovieClip;
_trans: SVGA.EgretMovieClip;
_isInviterSide = false;
_shareCode;
protected get skinKey() { return 'Trans' }
constructor(data) {
......@@ -19,12 +19,9 @@ export default class TransScene extends Scene {
}
async initUI(data) {
// await Promise.all([
// loadSvgaRes(getResPath() + 'resource/assets/svgas/progress.svga'),
// loadSvgaRes(getResPath() + 'resource/assets/svgas/progress2.svga'),
// ]);
//要区分是分享者,还是被分享者
this.once(egret.Event.ADDED_TO_STAGE, () => {
this.height = this.stage.stageHeight;
}, this);
this._bg = await loadSvga(getResPath() + 'resource/assets/svgas/bg.svga', this['group']) as SVGA.EgretMovieClip;
this._bg.visible = false;
this._standby = await loadSvga(getResPath() + 'resource/assets/svgas/standby.svga', this['group']) as SVGA.EgretMovieClip;
......@@ -42,41 +39,8 @@ export default class TransScene extends Scene {
this.addAni(this['matchingTips']);
this.addAni(this['shareTips']);
// this['matchingTips'];
// this['shareTips'];
const sharecode = 0;
if (this._isInviterSide) {//邀请者
this['matchingTips'].visible = true;
NetManager.ins.yyh_pollingAnimationState((success) => {
const data = DataManager.ins.getData('yyh_pollingAnimationState').data;
if (data == 3) {//摇一摇
this.changeToTrans();
this['waitTips'].visible = false;
this['matchingTips'].visible = false;
this['shareTips'].visible = false;
}
}, sharecode, () => {
const data = DataManager.ins.getData('yyh_pollingAnimationState').data;
if (data == 1) {//被邀请者确认邀请
this['waitTips'].visible = true;
this['matchingTips'].visible = false;
}
if (data == 2) {//用户取消
//暂时无法取消
}
return data === null || data === 0 || data == 1|| data == 2;
})
} else {
this.setRightPhone();//邀请者
this['shareTips'].visible = true;
//进入页面后发送确认消息
NetManager.ins.yyh_updateAnimationState(sharecode, 1, (success) => {
if (success) {
this.addShareEvent();
}
});
}
this.setRightPhone();//邀请者
}
addAni(d) {
......@@ -94,12 +58,7 @@ export default class TransScene extends Scene {
x = acceleration.x;
y = acceleration.y;
if (Math.abs(x - lastX) > speed || Math.abs(y - lastY) > speed) {
this['shareTips'].visible = false;
NetManager.ins.yyh_updateAnimationState(this._shareCode, 3, (success) => {
if (success) {
}
});
this.onshake();
}
lastX = x;
lastY = y;
......@@ -107,6 +66,16 @@ export default class TransScene extends Scene {
}
}
onshake(){
this['shareTips'].visible = false;
let sharecode = DataManager.ins.getData('genInvite').data;
NetManager.ins.yyh_updateAnimationState(sharecode, 3, (success) => {
if (success) {
this.changeToTrans();
}
});
}
setRightPhone() {
this._standby.x = -750;
this._trans.x = -750;
......@@ -142,10 +111,26 @@ export default class TransScene extends Scene {
}
onTap_btn() {
this['btn'].visible=false;
console.log('onTap_btn');
this['shareTips'].visible = true;
//进入页面后发送确认消息
yzwNet.genInvite(() => {
let sharecode = DataManager.ins.getData('genInvite').data;
NetManager.ins.yyh_updateAnimationState(sharecode, 1, (success) => {
if (success) {
this.addShareEvent();
}
});
}, window['projectId']);
setTimeout(() => {
this.onshake();
}, 3000);
}
initEvents() {
// this.onTap(this['btn'], this.onTap_btn);
this.onTap(this['btn'], this.onTap_btn);
}
}
\ 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