Commit 22c927a4 authored by wildfirecode13's avatar wildfirecode13

u

parent 76ad7180
{ {"code":"200303","data":null,"message":"助力者助力次数已用完","success":false}
"code": null, \ No newline at end of file
"data": "1234567890123",
"message": 123,
"success": 1
}
\ No newline at end of file
import { RES } from "../../module/RES";
import { layers } from "../../module/views/layers"; import { layers } from "../../module/views/layers";
import centerTextField from "./centerTextField";
import TestLabel from "./TestLabel"; import TestLabel from "./TestLabel";
let mask; let mask;
export default class ShareMask extends FYGE.Sprite { export default class ShareMask extends FYGE.Sprite {
...@@ -12,10 +14,10 @@ export default class ShareMask extends FYGE.Sprite { ...@@ -12,10 +14,10 @@ export default class ShareMask extends FYGE.Sprite {
bg.endFill(); bg.endFill();
this.addChild(bg); this.addChild(bg);
this.addChild(new TestLabel({ // this.addChild(new TestLabel({
text:'这是个分享引导蒙层', // text:'这是个分享引导蒙层',
color:'0xffffff',w:750,h:1624 // color:'0xffffff',w:750,h:1624
})); // }));
if (container) if (container)
container.addChild(this); container.addChild(this);
...@@ -27,6 +29,19 @@ export default class ShareMask extends FYGE.Sprite { ...@@ -27,6 +29,19 @@ export default class ShareMask extends FYGE.Sprite {
mask=null; mask=null;
}; };
const sharepicWrapper = new FYGE.Sprite();
sharepicWrapper.addChild(new FYGE.Sprite(RES.getRes('share.png')));
const tf = new FYGE.TextField;
tf.size=30;
tf.fillColor='0xffffff';
tf.text = '点击分享~';
tf.position.set(0,240);
centerTextField(tf,470,-50);
sharepicWrapper.addChild(tf);
sharepicWrapper.x = 750-470-30;
sharepicWrapper.y = 30;
this.addChild(sharepicWrapper);
this.addEventListener(FYGE.MouseEvent.CLICK, callback, this); this.addEventListener(FYGE.MouseEvent.CLICK, callback, this);
} }
} }
......
...@@ -10,5 +10,5 @@ export const getShareUrl = (queryParams) => { ...@@ -10,5 +10,5 @@ export const getShareUrl = (queryParams) => {
} }
export const getAutoPrizeUrl = () => { export const getAutoPrizeUrl = () => {
return getShareUrl({autoPrize:1}) return getShareUrl({autoprize:1})
} }
\ No newline at end of file
import { hideWaiting, showPanel, showWaiting } from "../../module/ctrls"; import { hideWaiting, showPanel, showToast, showWaiting } from "../../module/ctrls";
import { Scene } from "../../module/views/Scene"; import { Scene } from "../../module/views/Scene";
import centerTextField from "../common/centerTextField"; import centerTextField from "../common/centerTextField";
import getObject from "../common/getObject"; import getObject from "../common/getObject";
...@@ -14,10 +14,21 @@ export class ShareScene extends Scene { ...@@ -14,10 +14,21 @@ export class ShareScene extends Scene {
const query = getQueryParams(); const query = getQueryParams();
showWaiting(); showWaiting();
getPxTokenSave().then(token => { getPxTokenSave().then(token => {
sendWebNet(WebNetName.assist, { code: query.code }).then(res => { sendWebNet(WebNetName.assist, { code: query.code,token:token },null,true).then(res => {
this.updateUI();
hideWaiting(); hideWaiting();
if (res.success) if (res.success)
showPanel(AssistPanel, res.data) showPanel(AssistPanel, res.data)
else{
switch (res.code) {
case '200303':
showToast('助力机会已用完,明天再来吧~');
break;
default:
showToast('助力机会已用完,明天再来吧~');
break;
}
}
}) })
}) })
...@@ -50,13 +61,7 @@ export class ShareScene extends Scene { ...@@ -50,13 +61,7 @@ export class ShareScene extends Scene {
}); });
if (query.code) { if (query.code) {
getPxTokenSave().then(token => { this.updateUI();
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 { } else {
getObject(this, 'share_assist').visible = false; getObject(this, 'share_assist').visible = false;
getObject(this, 'share_tips3').text = ''; getObject(this, 'share_tips3').text = '';
...@@ -68,6 +73,16 @@ export class ShareScene extends Scene { ...@@ -68,6 +73,16 @@ export class ShareScene extends Scene {
} }
} }
private updateUI() {
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}次`;
});
});
}
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
......
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