Commit 22c927a4 authored by wildfirecode13's avatar wildfirecode13

u

parent 76ad7180
{
"code": null,
"data": "1234567890123",
"message": 123,
"success": 1
}
\ No newline at end of file
{"code":"200303","data":null,"message":"助力者助力次数已用完","success":false}
\ No newline at end of file
import { RES } from "../../module/RES";
import { layers } from "../../module/views/layers";
import centerTextField from "./centerTextField";
import TestLabel from "./TestLabel";
let mask;
export default class ShareMask extends FYGE.Sprite {
......@@ -12,10 +14,10 @@ export default class ShareMask extends FYGE.Sprite {
bg.endFill();
this.addChild(bg);
this.addChild(new TestLabel({
text:'这是个分享引导蒙层',
color:'0xffffff',w:750,h:1624
}));
// this.addChild(new TestLabel({
// text:'这是个分享引导蒙层',
// color:'0xffffff',w:750,h:1624
// }));
if (container)
container.addChild(this);
......@@ -27,6 +29,19 @@ export default class ShareMask extends FYGE.Sprite {
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);
}
}
......
......@@ -10,5 +10,5 @@ export const getShareUrl = (queryParams) => {
}
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 centerTextField from "../common/centerTextField";
import getObject from "../common/getObject";
......@@ -14,10 +14,21 @@ export class ShareScene extends Scene {
const query = getQueryParams();
showWaiting();
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();
if (res.success)
showPanel(AssistPanel, res.data)
else{
switch (res.code) {
case '200303':
showToast('助力机会已用完,明天再来吧~');
break;
default:
showToast('助力机会已用完,明天再来吧~');
break;
}
}
})
})
......@@ -50,13 +61,7 @@ export class ShareScene extends Scene {
});
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}次`
});
})
this.updateUI();
} else {
getObject(this, 'share_assist').visible = false;
getObject(this, 'share_tips3').text = '';
......@@ -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() {
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