Commit d75e5d79 authored by wildfirecode's avatar wildfirecode

1

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