Commit a8f5dee5 authored by wildfirecode13's avatar wildfirecode13

u

parent bc5ca4e3
...@@ -66,8 +66,8 @@ ...@@ -66,8 +66,8 @@
</script> </script>
<!-- 构建的js --> <!-- 构建的js -->
<!-- <script src="output.js" crossorigin="anonymous"></script> --> <script src="output.js" crossorigin="anonymous"></script>
<script src="https://yun.duiba.com.cn/db_games/activity/template/1628480312/output.js" crossorigin="anonymous"></script> <!-- <script src="https://yun.duiba.com.cn/db_games/activity/template/1628480312/output.js" crossorigin="anonymous"></script> -->
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"data": { "data": {
"alreadyOpenAccount": false, "alreadyOpenAccount": false,
"assistFriendNum": 0, "assistFriendNum": 0,
"canWithdraw": false, "canWithdraw": true,
"experienceAmount": 1234, "experienceAmount": 1234,
"maxExperienceAmount": 2500, "maxExperienceAmount": 2500,
"millionShares": null, "millionShares": null,
......
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
"code": "200010", "code": "200010",
"data": 2000, "data": 2000,
"message": "收益未满7天不能提现", "message": "收益未满7天不能提现",
"success": true "success": false
} }
\ No newline at end of file
...@@ -41,6 +41,7 @@ export class IndexScene extends Scene { ...@@ -41,6 +41,7 @@ export class IndexScene extends Scene {
if(canWithdraw){ if(canWithdraw){
getPxTokenSave().then(token => { getPxTokenSave().then(token => {
sendWebNet(WebNetName.withDraw, { token: token }).then(res => { sendWebNet(WebNetName.withDraw, { token: token }).then(res => {
if(res.success)
showPanel(DrawPanel,res.data); showPanel(DrawPanel,res.data);
}); });
}) })
......
...@@ -8,66 +8,77 @@ import { RulePanel } from "../panels/rule"; ...@@ -8,66 +8,77 @@ import { RulePanel } from "../panels/rule";
import { getPxTokenSave, sendWebNet, WebNetName } from "../WebNet"; import { getPxTokenSave, sendWebNet, WebNetName } from "../WebNet";
export class ShareScene extends Scene { export class ShareScene extends Scene {
onClick_share_assist(){ onClick_share_assist() {
const query = getQueryParams(); const query = getQueryParams();
getPxTokenSave().then(token=>{ getPxTokenSave().then(token => {
sendWebNet(WebNetName.assist,{code:query.code}).then(res=>{ sendWebNet(WebNetName.assist, { code: query.code }).then(res => {
showPanel(AssistPanel,res.data) showPanel(AssistPanel, res.data)
}) })
}) })
} }
onClick_share_rule(){ onClick_share_rule() {
showPanel(RulePanel); showPanel(RulePanel);
} }
async start(data) { async start(data) {
super.start(); super.start();
console.log('ShareScene query>>',JSON.stringify(data.query)); console.log('ShareScene query>>', JSON.stringify(getQueryParams()));
getPxTokenSave().then(token=>{ const query = getQueryParams();
sendWebNet(WebNetName.shareInfo,{code:getQueryParams().code,token:token}).then(res => {
const {experienceAmount,preIncom,remainAssist}=res.data;
getObject(this,'share_tips1').text=`${experienceAmount}元体验金,预期收益${preIncom}元`
getObject(this,'share_tips2').text=`今日剩余助力次数:${remainAssist}次`
});
})
sendWebNet(WebNetName.carouselInfo).then(res => { sendWebNet(WebNetName.carouselInfo).then(res => {
console.log('carouselInfo ', res); console.log('carouselInfo ', res);
const template = '{phone}邀请1位好友,获得了{amount}体验金'; const template = '{phone}邀请1位好友,获得了{amount}体验金';
const datas = res.data.map(item=>{ const datas = res.data.map(item => {
let str = template.replace('{phone}',item.nickname); let str = template.replace('{phone}', item.nickname);
str = str.replace('{amount}',item.amount); str = str.replace('{amount}', item.amount);
return str return str
}); });
const q = this.addChild(new Marquee(datas)); const q = this.addChild(new Marquee(datas));
q.x = 135; q.y=448; q.x = 135; q.y = 448;
window['q']=q; window['q'] = q;
}); });
if (query.code) {
getPxTokenSave().then(token => {
sendWebNet(WebNetName.shareInfo, { code: getQueryParams().code, token: token }).then(res => {
const { experienceAmount, preIncom, remainAssist } = res.data;
getObject(this, 'share_tips1').text = `${experienceAmount}元体验金,预期收益${preIncom}元`
getObject(this, 'share_tips2').text = `今日剩余助力次数:${remainAssist}次`
});
})
} else {
getObject(this, 'share_assist').visible = false;
getObject(this, 'share_tips3').text = '';
const go = getObject(this, 'share_go');
go.x = 750 / 2 - 234 * 1.5 / 2;
go.y = 1110;
go.scaleX = 1.5;
go.scaleY = 1.5;
}
} }
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
getObject(this,'share_rule').addEventListener(FYGE.MouseEvent.CLICK, this.onClick_share_rule, this); getObject(this, 'share_rule').addEventListener(FYGE.MouseEvent.CLICK, this.onClick_share_rule, this);
getObject(this,'share_assist').addEventListener(FYGE.MouseEvent.CLICK, this.onClick_share_assist, this); getObject(this, 'share_assist').addEventListener(FYGE.MouseEvent.CLICK, this.onClick_share_assist, this);
} }
removeEvents() { removeEvents() {
super.removeEvents(); super.removeEvents();
getObject(this,'share_rule').removeEventListener(FYGE.MouseEvent.CLICK, this.onClick_share_rule, this); getObject(this, 'share_rule').removeEventListener(FYGE.MouseEvent.CLICK, this.onClick_share_rule, this);
getObject(this,'share_assist').removeEventListener(FYGE.MouseEvent.CLICK, this.onClick_share_assist, this); getObject(this, 'share_assist').removeEventListener(FYGE.MouseEvent.CLICK, this.onClick_share_assist, this);
} }
get groupNames() { return ["share"] } get groupNames() { return ["share"] }
get skinName() { return "share" } get skinName() { return "share" }
initUi() { initUi() {
super.initUi(); super.initUi();
} }
} }
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