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

1111

parent 501f13de
{
"code": null,
"data": {
"surplusCount": 1,
"surplusCount": 0,
"credits": 22222,
"needCredits": 3333,
"type": 2,
......
......@@ -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";
import { Panel } from "../../module/views/Panel";
import centerTextField from "../common/centerTextField";
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";
let section;
......@@ -15,8 +19,23 @@ export class CostPanel extends Panel {
cost_open() {
this.dispatchEvent("stopIndexEnterFrame", { });
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() {
......
......@@ -6,19 +6,18 @@ import { showPanel } from "../../module/ctrls";
import { getImage } from "../common/getImage";
import getObject from "../common/getObject";
import { CostPanel } from "./cost";
import { getWebData } from "../WebNet";
import { WebNetName } from "../WebNetName";
let section;
export class PrizePanel extends Panel {
start() {
super.start();
const prizename = '活动活动黑乎乎的后sdfsdffsdfsdff端df和';
const prizeimg = 'https://yun.duiba.com.cn/db_games/sxbank.png';
const result = getWebData(WebNetName.drawPrize);
const size = 164;
getImage(prizeimg, this.prizeContainer, size, size, 3);
getObject(this, 'prize_name').text = prizename;
getImage(result.data.optionImg, this.prizeContainer, size, size, 3);
getObject(this, 'prize_name').text = result.data.optionName;
}
click_prize_open() {
......
......@@ -17,10 +17,13 @@ import { ScrollItem } from "./ScrollItem";
import { getWebData, sendWebNet } from "../WebNet";
import { WebNetName } from "../WebNetName";
import { layers } from "../../module/views/layers";
import { showShareMask } from "../common/ShareMask";
let boxGroup: BoxGroup;
let boxArea;
let hand: FYGE.Sprite;
let shareButton;
export class IndexScene extends Scene {
get groupNames() { return ["index"] }
......@@ -51,10 +54,16 @@ export class IndexScene extends Scene {
list.updateData(array);
list.position.set(80, 1240 + 30);
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.stage.addEventListener("restartEnterFrame", this.onRestartFrame, this);
boxGroup.addEventListener("stopIndexEnterFrame", this.removeEvent, this);
shareButton = getObject(this, 'index_sharetips');
shareButton.addEventListener(FYGE.MouseEvent.CLICK, () => {
showShareMask();
},this)
}
initContainer() {
......@@ -112,14 +121,16 @@ export class IndexScene extends Scene {
this.removeEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this);
}
handleShare = async() =>{
showShareMask();
await getWebData(WebNetName.getFreeCount);
this.getIndex();
}
getIndex = async () => {
const result = getWebData(WebNetName.index);
const shareButton = getObject(this, 'index_sharetips');
shareButton.addEventListener(FYGE.MouseEvent.CLICK, () =>{
})
const hand = getObject(this, 'index_sharehand');
const result = await getWebData(WebNetName.index);
hand = getObject(this, 'index_sharehand');
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;
if (result && result.data) {
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