Commit 10734c46 authored by shunx 马's avatar shunx 马

111

parent 27290ee0
{
"code": null,
"data": {
"surplusCount": 0,
"surplusCount": 1,
"credits": 22222,
"needCredits": 3333,
"type": 2,
"type": 1,
"isMember":1
},
"message": null,
......
......@@ -7,6 +7,7 @@ import { sendWebNetWithToken } from "../sendWebNetWithToken";
import { sendWebNet } from "../WebNet";
import { WebNetName } from "../WebNetName";
import { NoPrizePanel } from "./noprize";
import { notEnoughMoneyPanel } from "./notEnoughMoney";
import { PrizePanel } from "./prize";
let section;
......@@ -35,7 +36,7 @@ export class CostPanel extends Panel {
}
}
}
}
}
}
get groupNames() {
......
import { showPanel } from "../../module/ctrls";
import { RES } from "../../module/RES";
import { Panel } from "../../module/views/Panel";
import centerTextField from "../common/centerTextField";
import getObject from "../common/getObject";
import { hideShareMask, showShareMask } from "../common/ShareMask";
import { SharePanel } from "./share";
let section;
export class getTimesPanel extends Panel {
click_getTimes_go(){
console.log('click_getTimes_go');
click_getTimes_go() {
this.hidePanel();
showShareMask();
setTimeout(() => {
hideShareMask();
showPanel(SharePanel);
},2000)
}
get groupNames() { return ["getTimes"] }
......
......@@ -22,8 +22,9 @@ import { showShareMask } from "../common/ShareMask";
let boxGroup: BoxGroup;
let boxArea;
let hand: FYGE.Sprite;
let hand;
let shareButton;
let indexData;
export class IndexScene extends Scene {
get groupNames() { return ["index"] }
......@@ -35,8 +36,6 @@ export class IndexScene extends Scene {
start() {
super.start();
// this.initNonmemberMask();
// getObject(this,'index_sharetips').visible=false;
this.initContainer();
this.initmask();
const limit = getObject(this, 'index_timestips2');
......@@ -49,20 +48,21 @@ export class IndexScene extends Scene {
index_moneytips.position.set(480, 1131);
const index_timestips = getObject(this, 'index_timestips');
index_timestips.position.set(127, 1131);
const list = new FYGE.ScrollList(ScrollItem, 131+20, 131, 620, 154, false);
const array = ['//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png','//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png','//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png','//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png','//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png'];
list.updateData(array);
const list = new FYGE.ScrollList(ScrollItem, 131 + 20, 131, 620, 154, false);
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);
}
hand = getObject(this, 'index_sharehand');
this.addChild(hand);
this.getIndex();
const result = getWebData(WebNetName.index)
const array = ['//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png','//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png','//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png','//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png','//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png'];
list.updateData(array);
hand && FYGE.Tween.get(hand, { loop: true }).to({ scaleX: 1.5, scaleY: 1.5 }, 1000).to({ scaleX: 1, scaleY: 1 }, 1000);
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.handleShare();
},this)
}
......@@ -121,16 +121,19 @@ export class IndexScene extends Scene {
this.removeEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this);
}
handleShare = async() =>{
showShareMask();
await getWebData(WebNetName.getFreeCount);
this.getIndex();
handleShare = async () => {
if (indexData.data.type == 2 && indexData.data.surplusCount <= 0) {
showPanel(timesNotEnoughPanel);
} else {
showPanel(getTimesPanel);
await getWebData(WebNetName.getFreeCount);
this.getIndex();
}
}
getIndex = async () => {
const result = await getWebData(WebNetName.index);
hand = getObject(this, 'index_sharehand');
this.addChild(hand);
indexData = result;
hand.visible = false;
if (result && result.data) {
const getBoxButton = getObject(this, 'index_opentips');
......@@ -155,13 +158,22 @@ export class IndexScene extends Scene {
shareButton.visible = false;
}
} else {
needCredits.text = '免费拆盒1次';
reDegree.text = `${result.data.surplusCount}`;
getBoxButton.visible = true;
shareButton.visible = false;
if (result.data.surplusCount > 0) {
needCredits.text = '免费拆盒1次';
reDegree.text = `${result.data.surplusCount}`;
getBoxButton.visible = false;
shareButton.visible = true;
hand.visible = true;
} else {
reDegree.text = '0';
needCredits.text = `${result.data.needCredits}` + "积分/次";
getBoxButton.visible = true;
shareButton.visible = false;
}
}
}
}
}
......
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