Commit 7dbf98a1 authored by wildfirecode's avatar wildfirecode

1

parent 03d04ea9
...@@ -6,6 +6,7 @@ import SceneCtrl from "../ctrls/sceneCtrl"; ...@@ -6,6 +6,7 @@ import SceneCtrl from "../ctrls/sceneCtrl";
import { ModuleTypes } from "../types/sceneTypes"; import { ModuleTypes } from "../types/sceneTypes";
import { createData } from "../../../src/startScene/StartScene"; import { createData } from "../../../src/startScene/StartScene";
import { DataManager } from "../../tw/manager/DataManager"; import { DataManager } from "../../tw/manager/DataManager";
import getShowOffPic from "../../../src/getShowOffPic";
export default class NoPrizePanel extends Panel { export default class NoPrizePanel extends Panel {
_level; _level;
start(data) { start(data) {
...@@ -14,7 +15,7 @@ export default class NoPrizePanel extends Panel { ...@@ -14,7 +15,7 @@ export default class NoPrizePanel extends Panel {
this._level = parseInt(data.level + ''); this._level = parseInt(data.level + '');
this['shareBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this['shareBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(16)); NetManager.ins.clickLog(getlogItem(16));
getShowOffPic(this.stage);
}, this); }, this);
this.showlog(); this.showlog();
NetManager.ins.hc_home(() => { }, window['collectRuleId']); NetManager.ins.hc_home(() => { }, window['collectRuleId']);
......
...@@ -5,6 +5,8 @@ import { NetManager } from "../../tw/manager/NetManager"; ...@@ -5,6 +5,8 @@ import { NetManager } from "../../tw/manager/NetManager";
import SceneCtrl from "../ctrls/sceneCtrl"; import SceneCtrl from "../ctrls/sceneCtrl";
import { ModuleTypes } from "../types/sceneTypes"; import { ModuleTypes } from "../types/sceneTypes";
import Panel from "./Panel"; import Panel from "./Panel";
import { callShareApi } from "../../../src/shareCtrl";
import getShowOffPic from "../../../src/getShowOffPic";
export default class PrizePanel extends Panel { export default class PrizePanel extends Panel {
_level; _level;
start(data) { start(data) {
...@@ -24,7 +26,7 @@ export default class PrizePanel extends Panel { ...@@ -24,7 +26,7 @@ export default class PrizePanel extends Panel {
this['shareBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this['shareBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(15)); NetManager.ins.clickLog(getlogItem(15));
getShowOffPic(this.stage);
}, this); }, this);
this['goBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this['goBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
this.hidePanel(); this.hidePanel();
......
...@@ -2,6 +2,8 @@ import ComponentBase from "../libs/new_wx/components/ComponentBase"; ...@@ -2,6 +2,8 @@ import ComponentBase from "../libs/new_wx/components/ComponentBase";
import getHomeData from "./getHomeData"; import getHomeData from "./getHomeData";
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 { iswx } from "./iswx";
import { callShareApi } from "./shareCtrl";
class ShowOff extends ComponentBase { class ShowOff extends ComponentBase {
start() { start() {
...@@ -18,18 +20,21 @@ export const getPrintScreenData = (scene, startX, startY, width, height) => { ...@@ -18,18 +20,21 @@ export const getPrintScreenData = (scene, startX, startY, width, height) => {
const imageData = renderTexture.toDataURL("image/jpg"); const imageData = renderTexture.toDataURL("image/jpg");
return imageData; return imageData;
} }
export default async (parent?: egret.DisplayObjectContainer) => { export default async (stage, parent?: egret.DisplayObjectContainer, ) => {
return new Promise(async (r) => { // return new Promise(async (r) => {
const pic: egret.Texture = await RES.getResAsync('showoff_jpg'); const pic: egret.Texture = await RES.getResAsync('showoff_jpg');
const showoff = new ShowOff(); const showoff = new ShowOff();
showoff.loadSkin(); showoff.loadSkin();
showoff.start(); showoff.start();
if (parent) parent.addChild(showoff); if (parent) parent.addChild(showoff);
const base64 = getPrintScreenData(showoff, 0, 0, pic.textureWidth, parent.stage.stageHeight); const base64 = getPrintScreenData(showoff, 0, 0, pic.textureWidth, stage.stageHeight);
NetManager.ins.imgUrl((success) => { NetManager.ins.imgUrl((success) => {
const data = DataManager.ins.getData('imgURL'); const data = DataManager.ins.getData('imgURL');
r(data.data) // r(data.data);
}, base64); if (!iswx()) {
}) callShareApi(data.data, 1);
}
}, base64);
// })
} }
...@@ -12,6 +12,7 @@ import { playBg, toggleBg, toggleSound } from "../soundCtrl"; ...@@ -12,6 +12,7 @@ import { playBg, toggleBg, toggleSound } from "../soundCtrl";
import MapBottomPart from "./MapBottomPart"; import MapBottomPart from "./MapBottomPart";
import MapRpeatPart from "./MapRpeatPart"; import MapRpeatPart from "./MapRpeatPart";
import MapTopPart from "./MapTopPart"; import MapTopPart from "./MapTopPart";
import getShowOffPic from "../getShowOffPic";
export default class MapScene extends Scene { export default class MapScene extends Scene {
scrollGroup: eui.Group; scrollGroup: eui.Group;
...@@ -24,6 +25,10 @@ export default class MapScene extends Scene { ...@@ -24,6 +25,10 @@ export default class MapScene extends Scene {
_data; _data;
async start(data?) { async start(data?) {
super.start(); super.start();
// setTimeout(() => {
// getShowOffPic(this.stage,this)
// }, 3000);
this._data = data; this._data = data;
//滚动的背景变黑 //滚动的背景变黑
this['rectbg'].height = this.stage.stageHeight; this['rectbg'].height = this.stage.stageHeight;
......
...@@ -5,6 +5,7 @@ import { getlogItem } from "../Main"; ...@@ -5,6 +5,7 @@ import { getlogItem } from "../Main";
import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl"; import SceneCtrl from "../../libs/new_wx/ctrls/sceneCtrl";
import { ModuleTypes } from "../../libs/new_wx/types/sceneTypes"; import { ModuleTypes } from "../../libs/new_wx/types/sceneTypes";
import setGray from "../setGray"; import setGray from "../setGray";
import getShowOffPic from "../getShowOffPic";
export default class Prize2Panel extends Panel { export default class Prize2Panel extends Panel {
_level; _level;
...@@ -19,7 +20,7 @@ export default class Prize2Panel extends Panel { ...@@ -19,7 +20,7 @@ export default class Prize2Panel extends Panel {
this['tips'].text = `本次获得元宝:${submitdata.prizeResponse.changeMoney}`; this['tips'].text = `本次获得元宝:${submitdata.prizeResponse.changeMoney}`;
this['shareBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this['shareBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(15)); NetManager.ins.clickLog(getlogItem(15));
getShowOffPic(this.stage);
}, this); }, this);
this['goBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this['goBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
......
...@@ -11,15 +11,15 @@ ...@@ -11,15 +11,15 @@
"remainProp": [ "remainProp": [
{ {
"type": 2, "type": 2,
"num": 1 "num": 0
}, },
{ {
"type": 3, "type": 3,
"num": 8 "num": 0
}, },
{ {
"type": 4, "type": 4,
"num": 10 "num": 0
} }
], ],
"remainEnargy": 9979, "remainEnargy": 9979,
......
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