Commit d75e5d79 authored by wildfirecode's avatar wildfirecode

1

parent 6141a8b0
......@@ -413,6 +413,13 @@
}
</script> -->
<script src="output.js"></script>
<!-- <script src="https://yun.duiba.com.cn/db_games/debug/vconsole.min.js"></script>
<script>
// init vConsole 11111
var vConsole = new VConsole();
console.log('Hello world');
</script> -->
</body>
</html>
\ No newline at end of file
import Scene from "../views/Scene";
import PanelCtrl from "../ctrls/panelCtrl";
import { ModuleTypes } from "../types/sceneTypes";
import SceneCtrl from "../ctrls/sceneCtrl";
export default class CertificateScene extends Scene{
protected get skinKey(){return 'Certificate'}
......@@ -11,13 +12,23 @@ export default class CertificateScene extends Scene{
this.initUI(data);
}
_from
initUI(data){
this['from'].text = '11111111';
this['to'].text = '22222222';
this.once(egret.Event.ADDED_TO_STAGE, () => {
this.height = this.stage.stageHeight;
}, this);
this._from=data.from;
this['from'].text = data.inviterPhone;
this['to'].text = data.inviteePhone;
}
onTap_btn(){
console.log('onTap_btn')
if(this._from == 'ShareStarterScene') {
SceneCtrl.instance.change(ModuleTypes.ShareStarterScene);
}else {
location.href = window['indexUrl'];
}
}
initEvents(){
......
......@@ -7,6 +7,7 @@ import { NetManager } from "../../libs/tw/manager/NetManager";
import { loadSvga } from "../loadSvga";
import { getResPath } from "../utils";
import { wait } from "../GameConst";
import SceneCtrl from "../ctrls/sceneCtrl";
export default class ShareStarterScene extends Scene {
_bg: SVGA.EgretMovieClip;
......@@ -70,12 +71,21 @@ export default class ShareStarterScene extends Scene {
this._trans.once(egret.Event.COMPLETE, () => {
console.log('COMPLETE')
this.changeToStandBy();
this['tipsWrapper'].visible = true;
this['transbtn'].visible = true;
// const data = DataManager.ins.getData('accept').data;
// data.from = 'ShareStarterScene';
// SceneCtrl.instance.change(ModuleTypes.CertificateScene, data);
const data:any = {}
data.from = 'ShareStarterScene';
SceneCtrl.instance.change(ModuleTypes.CertificateScene, data);
}, this);
}
onTap_sharebtn() {
this['tipsWrapper'].visible=false;
this['transbtn'].visible=false;
this['tipsWrapper'].visible = false;
this['transbtn'].visible = false;
//这里要调用分享方法
yzwNet.genInvite(() => {
let sharecode = DataManager.ins.getData('genInvite').data;
......
......@@ -5,6 +5,8 @@ import GameConst, { wait } from "../GameConst";
import { NetManager } from "../../libs/tw/manager/NetManager";
import { DataManager } from "../../libs/tw/manager/DataManager";
import { yzwNet } from "../NetConst";
import SceneCtrl from "../ctrls/sceneCtrl";
import { ModuleTypes } from "../types/sceneTypes";
export default class TransScene extends Scene {
_bg: SVGA.EgretMovieClip;
......@@ -49,12 +51,16 @@ export default class TransScene extends Scene {
.to({ alpha: 1 }, 500).wait(500);
}
_shakeTag;
addShareEvent() {
console.log('addShareEvent window.DeviceMotionEvent', window.DeviceMotionEvent);
if (window.DeviceMotionEvent) {
var speed = 25;
var x = 0, y = 0, z = 0, lastX = 0, lastY = 0, lastZ = 0;
window.addEventListener('devicemotion', (event) => {
var acceleration = event.accelerationIncludingGravity;
window.addEventListener('devicemotion', (eventData) => {
console.log('devicemotion', eventData)
var acceleration = eventData.accelerationIncludingGravity;
x = acceleration.x;
y = acceleration.y;
if (Math.abs(x - lastX) > speed || Math.abs(y - lastY) > speed) {
......@@ -67,6 +73,8 @@ export default class TransScene extends Scene {
}
onshake() {
if (this._shakeTag) return;
this._shakeTag = true;
this['shareTips'].visible = false;
let sharecode = GameConst.getQueryString("shareCode");
NetManager.ins.yyh_updateAnimationState(sharecode, 3, (success) => {
......@@ -105,10 +113,15 @@ export default class TransScene extends Scene {
this._trans.once(egret.Event.COMPLETE, () => {
console.log('COMPLETE')
this.changeToStandBy();
if (!this._isInviterSide) {
this._standby.x = 40;
this._standby.y = 10;
}
const data = DataManager.ins.getData('accept').data;
data.from = 'TransScene';
SceneCtrl.instance.change(ModuleTypes.CertificateScene, data);
}, this);
}
......@@ -127,7 +140,7 @@ export default class TransScene extends Scene {
setTimeout(() => {
this.onshake();
}, 10000);
}, 3000);
}
initEvents() {
......
{
"code": null,
"data": {
"inviterPhone": 123,
"inviteePhone": 456
},
"message": null,
"success": true
}
\ No newline at end of file
{"code":null,"data":{"inviterPhone":null,"inviteePhone":null},"message":null,"success":true}
\ 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