Commit 3abecebc authored by shunx 马's avatar shunx 马

1111

parent 501f13de
{ {
"code": null, "code": null,
"data": { "data": {
"surplusCount": 1, "surplusCount": 0,
"credits": 22222, "credits": 22222,
"needCredits": 3333, "needCredits": 3333,
"type": 2, "type": 2,
......
...@@ -21,5 +21,9 @@ ...@@ -21,5 +21,9 @@
/** /**
* 分享获得免费次数 * 分享获得免费次数
*/ */
getFreeCount = "/projectx/{projectId}/dazzle/getFreeCount.do" getFreeCount = "/projectx/{projectId}/dazzle/getFreeCount.do",
/**
* 获取积分票据
*/
getCreditCost = "/projectx/{projectId}/credits/creditsCost.do"
} }
\ No newline at end of file
...@@ -3,6 +3,10 @@ import { RES } from "../../module/RES"; ...@@ -3,6 +3,10 @@ import { RES } from "../../module/RES";
import { Panel } from "../../module/views/Panel"; import { Panel } from "../../module/views/Panel";
import centerTextField from "../common/centerTextField"; import centerTextField from "../common/centerTextField";
import getObject from "../common/getObject"; import getObject from "../common/getObject";
import { sendWebNetWithToken } from "../sendWebNetWithToken";
import { sendWebNet } from "../WebNet";
import { WebNetName } from "../WebNetName";
import { NoPrizePanel } from "./noprize";
import { PrizePanel } from "./prize"; import { PrizePanel } from "./prize";
let section; let section;
...@@ -15,8 +19,23 @@ export class CostPanel extends Panel { ...@@ -15,8 +19,23 @@ export class CostPanel extends Panel {
cost_open() { cost_open() {
this.dispatchEvent("stopIndexEnterFrame", { }); this.dispatchEvent("stopIndexEnterFrame", { });
this.hidePanel(); this.hidePanel();
this.getPrize();
}
showPanel(PrizePanel) getPrize = async () => {
const result = await sendWebNet(WebNetName.getCreditCost, { toPlaywayId: 'dazzle', toActionId: 'drawPrize' });
if (result && result.success) {
const prizeData = await sendWebNetWithToken(WebNetName.drawPrize, { ticket: result.data });
if (prizeData && prizeData.success) {
if (prizeData.data && prizeData.data.options) {
if (prizeData.data.options.optionId == "thanks") {
showPanel(NoPrizePanel)
} else {
showPanel(PrizePanel);
}
}
}
}
} }
get groupNames() { get groupNames() {
......
...@@ -6,19 +6,18 @@ import { showPanel } from "../../module/ctrls"; ...@@ -6,19 +6,18 @@ import { showPanel } from "../../module/ctrls";
import { getImage } from "../common/getImage"; import { getImage } from "../common/getImage";
import getObject from "../common/getObject"; import getObject from "../common/getObject";
import { CostPanel } from "./cost"; import { CostPanel } from "./cost";
import { getWebData } from "../WebNet";
import { WebNetName } from "../WebNetName";
let section; let section;
export class PrizePanel extends Panel { export class PrizePanel extends Panel {
start() { start() {
super.start(); super.start();
const prizename = '活动活动黑乎乎的后sdfsdffsdfsdff端df和'; const result = getWebData(WebNetName.drawPrize);
const prizeimg = 'https://yun.duiba.com.cn/db_games/sxbank.png';
const size = 164; const size = 164;
getImage(result.data.optionImg, this.prizeContainer, size, size, 3);
getImage(prizeimg, this.prizeContainer, size, size, 3); getObject(this, 'prize_name').text = result.data.optionName;
getObject(this, 'prize_name').text = prizename;
} }
click_prize_open() { click_prize_open() {
......
...@@ -17,10 +17,13 @@ import { ScrollItem } from "./ScrollItem"; ...@@ -17,10 +17,13 @@ import { ScrollItem } from "./ScrollItem";
import { getWebData, sendWebNet } from "../WebNet"; import { getWebData, sendWebNet } from "../WebNet";
import { WebNetName } from "../WebNetName"; import { WebNetName } from "../WebNetName";
import { layers } from "../../module/views/layers"; import { layers } from "../../module/views/layers";
import { showShareMask } from "../common/ShareMask";
let boxGroup: BoxGroup; let boxGroup: BoxGroup;
let boxArea; let boxArea;
let hand: FYGE.Sprite;
let shareButton;
export class IndexScene extends Scene { export class IndexScene extends Scene {
get groupNames() { return ["index"] } get groupNames() { return ["index"] }
...@@ -51,10 +54,16 @@ export class IndexScene extends Scene { ...@@ -51,10 +54,16 @@ export class IndexScene extends Scene {
list.updateData(array); list.updateData(array);
list.position.set(80, 1240 + 30); list.position.set(80, 1240 + 30);
this.addChild(list); this.addChild(list);
if (hand) {
const tw = FYGE.Tween.get(hand, { loop: true }).to({ scaleX: 1.5, scaleY: 1.5 }, 1000).to({ scaleX: 1, scaleY: 1 }, 1000);
}
this.getIndex(); this.getIndex();
this.stage.addEventListener("restartEnterFrame", this.onRestartFrame, this); this.stage.addEventListener("restartEnterFrame", this.onRestartFrame, this);
boxGroup.addEventListener("stopIndexEnterFrame", this.removeEvent, this); boxGroup.addEventListener("stopIndexEnterFrame", this.removeEvent, this);
shareButton = getObject(this, 'index_sharetips');
shareButton.addEventListener(FYGE.MouseEvent.CLICK, () => {
showShareMask();
},this)
} }
initContainer() { initContainer() {
...@@ -112,14 +121,16 @@ export class IndexScene extends Scene { ...@@ -112,14 +121,16 @@ export class IndexScene extends Scene {
this.removeEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this); this.removeEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this);
} }
handleShare = async() =>{
showShareMask();
await getWebData(WebNetName.getFreeCount);
this.getIndex();
}
getIndex = async () => { getIndex = async () => {
const result = getWebData(WebNetName.index); const result = await getWebData(WebNetName.index);
const shareButton = getObject(this, 'index_sharetips'); hand = getObject(this, 'index_sharehand');
shareButton.addEventListener(FYGE.MouseEvent.CLICK, () =>{
})
const hand = getObject(this, 'index_sharehand');
this.addChild(hand); this.addChild(hand);
const tw = FYGE.Tween.get(hand, { loop: true }).to({ scaleX: 1.5, scaleY: 1.5 }, 1000).to({ scaleX: 1, scaleY: 1 }, 1000);
hand.visible = false; hand.visible = false;
if (result && result.data) { if (result && result.data) {
const getBoxButton = getObject(this, 'index_opentips'); const getBoxButton = getObject(this, 'index_opentips');
......
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