Commit b6d3bd3d authored by wildfirecode13's avatar wildfirecode13

u

parent 7e64d160
...@@ -2,16 +2,16 @@ ...@@ -2,16 +2,16 @@
"code": null, "code": null,
"data": [ "data": [
{ {
"nickname": "123", "nickname": "138****5678",
"amount": "999" "amount": "9999"
}, },
{ {
"nickname": "789", "nickname": "138****5678",
"amount": "777" "amount": "7777"
}, },
{ {
"nickname": "456", "nickname": "138****5678",
"amount": "888" "amount": "8888"
} }
], ],
"message": "sed dolor nulla sint ut", "message": "sed dolor nulla sint ut",
......
{ {
"code": null, "code": null,
"data": 0, "data": 500000,
"message": "reprehenderit ullamco minim esse", "message": "reprehenderit ullamco minim esse",
"success": true "success": true
} }
\ No newline at end of file
...@@ -8,7 +8,10 @@ ...@@ -8,7 +8,10 @@
"keys": "startSceneBg.jpg,奖品按钮.png,底部按钮区背景.png,开始游戏.png,排行榜按钮.png,规则按钮.png,赚次数按钮.png,运动锦鲤按钮.png", "keys": "startSceneBg.jpg,奖品按钮.png,底部按钮区背景.png,开始游戏.png,排行榜按钮.png,规则按钮.png,赚次数按钮.png,运动锦鲤按钮.png",
"name": "StartScene" "name": "StartScene"
}, },
{
"keys": "assist_bg.png,assist_bg2.png,assist_btn.png,assist_close.png,assist_title.png",
"name": "assist"
},
{ {
"keys": "comCloseBtn.png,toastBg.png,waitingBg.png,waitingRot.png", "keys": "comCloseBtn.png,toastBg.png,waitingBg.png,waitingRot.png",
"name": "common" "name": "common"
......
This diff is collapsed.
...@@ -8,7 +8,10 @@ export const ResJson = { ...@@ -8,7 +8,10 @@ export const ResJson = {
"keys": "startSceneBg.jpg,奖品按钮.png,底部按钮区背景.png,开始游戏.png,排行榜按钮.png,规则按钮.png,赚次数按钮.png,运动锦鲤按钮.png", "keys": "startSceneBg.jpg,奖品按钮.png,底部按钮区背景.png,开始游戏.png,排行榜按钮.png,规则按钮.png,赚次数按钮.png,运动锦鲤按钮.png",
"name": "StartScene" "name": "StartScene"
}, },
{
"keys": "assist_bg.png,assist_bg2.png,assist_btn.png,assist_close.png,assist_title.png",
"name": "assist"
},
{ {
"keys": "comCloseBtn.png,toastBg.png,waitingBg.png,waitingRot.png", "keys": "comCloseBtn.png,toastBg.png,waitingBg.png,waitingRot.png",
"name": "common" "name": "common"
......
...@@ -258,7 +258,6 @@ export const SkinJson ={ ...@@ -258,7 +258,6 @@ export const SkinJson ={
} }
] ]
}, },
{ {
"name": "prize", "name": "prize",
"x": 78, "x": 78,
...@@ -1111,6 +1110,107 @@ export const SkinJson ={ ...@@ -1111,6 +1110,107 @@ export const SkinJson ={
} }
} }
] ]
},
{
"name": "assist",
"x": 78,
"y": 405,
"type": "container",
"children": [
{
"name": "assist_bg2",
"x": 28,
"y": 0,
"type": "sprite",
"props": {
"source": "assist_bg2.png"
}
},
{
"name": "assist_bg",
"x": 0,
"y": 134,
"type": "sprite",
"props": {
"source": "assist_bg.png"
}
},
{
"name": "assist_title",
"x": 78,
"y": 69,
"type": "sprite",
"props": {
"source": "assist_title.png"
}
},
{
"name": "assist_tips3",
"x": 208,
"y": 208,
"type": "text",
"props": {
"text": "成功助力好友",
"size": 30,
"fillColor": "#c75b2b",
"textAlpha": 1
}
},
{
"name": "assist_tips2",
"x": 145,
"y": 412,
"type": "text",
"props": {
"text": "活动最高可获得100万体验金\r收益多多快来参与吧",
"size": 24,
"fillColor": "#c75b2b",
"textAlpha": 1
}
},
{
"name": "assist_amout",
"x": 226,
"y": 294,
"type": "text",
"props": {
"text": "1000",
"size": 60,
"fillColor": "#ff2f50",
"textAlpha": 1
}
},
{
"name": "assist_tips",
"x": 363,
"y": 315,
"type": "text",
"props": {
"text": "元",
"size": 29,
"fillColor": "#ff2f50",
"textAlpha": 1
}
},
{
"name": "assist_btn",
"x": 127,
"y": 580,
"type": "sprite",
"props": {
"source": "assist_btn.png"
}
},
{
"name": "assist_close",
"x": 560,
"y": 7,
"type": "sprite",
"props": {
"source": "assist_close.png"
}
}
]
} }
] ]
} }
\ No newline at end of file
const w = 500; const w = 532;
const h = 50; const h = 40
const gap = 10; const gap = 10;
export default class Marquee extends FYGE.Sprite { export default class Marquee extends FYGE.Sprite {
...@@ -65,11 +65,11 @@ export default class Marquee extends FYGE.Sprite { ...@@ -65,11 +65,11 @@ export default class Marquee extends FYGE.Sprite {
initUI() { initUI() {
const bg = new FYGE.Shape(); // const bg = new FYGE.Shape();
bg.beginFill(0, 1); // bg.beginFill(0, 1);
bg.drawRoundedRect(0, 0, w, h, 5, 5, 5, 5); // bg.drawRoundedRect(0, 0, w, h, 5, 5, 5, 5);
bg.endFill(); // bg.endFill();
this.addChild(bg); // this.addChild(bg);
this.textwrapper = new FYGE.Sprite(); this.textwrapper = new FYGE.Sprite();
this.textwrapper.x = gap; this.textwrapper.x = gap;
...@@ -84,7 +84,7 @@ export default class Marquee extends FYGE.Sprite { ...@@ -84,7 +84,7 @@ export default class Marquee extends FYGE.Sprite {
const buttonTxt = new FYGE.TextField; const buttonTxt = new FYGE.TextField;
buttonTxt.textHeight = h; buttonTxt.textHeight = h;
buttonTxt.size = 20; buttonTxt.size = 25;
buttonTxt.verticalAlign = FYGE.VERTICAL_ALIGN.MIDDLE; buttonTxt.verticalAlign = FYGE.VERTICAL_ALIGN.MIDDLE;
buttonTxt.fillColor = '0xffffff'; buttonTxt.fillColor = '0xffffff';
this.textwrapper.addChild(buttonTxt); this.textwrapper.addChild(buttonTxt);
...@@ -93,7 +93,7 @@ export default class Marquee extends FYGE.Sprite { ...@@ -93,7 +93,7 @@ export default class Marquee extends FYGE.Sprite {
const buttonTxt2 = new FYGE.TextField; const buttonTxt2 = new FYGE.TextField;
buttonTxt2.textHeight = h; buttonTxt2.textHeight = h;
buttonTxt2.size = 20; buttonTxt2.size = 25;
buttonTxt2.verticalAlign = FYGE.VERTICAL_ALIGN.MIDDLE; buttonTxt2.verticalAlign = FYGE.VERTICAL_ALIGN.MIDDLE;
buttonTxt2.fillColor = '0xffffff'; buttonTxt2.fillColor = '0xffffff';
this.textwrapper.addChild(buttonTxt2); this.textwrapper.addChild(buttonTxt2);
......
...@@ -2,6 +2,7 @@ import { changeScene } from "../../module/ctrls"; ...@@ -2,6 +2,7 @@ import { changeScene } from "../../module/ctrls";
import { RES } from "../../module/RES"; import { RES } from "../../module/RES";
import { Panel } from "../../module/views/Panel"; import { Panel } from "../../module/views/Panel";
import Group from "../common/Group"; import Group from "../common/Group";
import { ProgressBarS } from "../common/ProgressBarS";
import { showShareMask } from "../common/ShareMask"; import { showShareMask } from "../common/ShareMask";
import TestButton from "../common/TestButton"; import TestButton from "../common/TestButton";
import TestLabel from "../common/TestLabel"; import TestLabel from "../common/TestLabel";
...@@ -13,11 +14,11 @@ import { getWebData, sendWebNet, WebNetName } from "../WebNet"; ...@@ -13,11 +14,11 @@ import { getWebData, sendWebNet, WebNetName } from "../WebNet";
let createItemResultComplete, myWalletResultComplete; let createItemResultComplete, myWalletResultComplete;
const checkUpdateShare = () => { const checkUpdateShare = () => {
if (createItemResultComplete && myWalletResultComplete) { if (createItemResultComplete && myWalletResultComplete) {
updateShare('inPrizePanel', updateShare('inPrizePanel',
createItemResultComplete.data, createItemResultComplete.data,
myWalletResultComplete.data.sumIncome, myWalletResultComplete.data.experienceAmount) myWalletResultComplete.data.sumIncome, myWalletResultComplete.data.experienceAmount)
} }
} }
export class PrizePanel extends Panel { export class PrizePanel extends Panel {
...@@ -28,29 +29,46 @@ export class PrizePanel extends Panel { ...@@ -28,29 +29,46 @@ export class PrizePanel extends Panel {
super.initUi(); super.initUi();
var skin = RES.getSkinDataByName(this.skinName); var skin = RES.getSkinDataByName(this.skinName);
this.position.set(skin.x, skin.y); this.position.set(skin.x, skin.y);
this.inviteBtn =getObject(this,'prize_invite'); this.inviteBtn = getObject(this, 'prize_invite');
} }
async start(data) { async start(data) {
super.start(); super.start();
const prize_tips1 = getObject(this, 'prize_tips1');
const prize_tips2 = getObject(this, 'prize_tips2');
const prize_tip3 = getObject(this, 'prize_tip3');
prize_tips2.text = data;
const w = prize_tips1.textWidth + prize_tips2.textWidth;
prize_tips2.x = (595 - w) / 2;
prize_tips1.x = prize_tips2.x + prize_tips2.textWidth;
prize_tip3.textWidth=595;
prize_tip3.x=0;
prize_tip3.textAlign='center';
prize_tip3.text=`${data}/1000000`;
let percent = 0.05;
if(data/1000000 > percent) {
percent = data/1000000;
}
const progressBar = new ProgressBarS(getObject(this,'prize_progress'));
progressBar.value=percent;
sendWebNet(WebNetName.createItem).then(createItemResult => { sendWebNet(WebNetName.createItem).then(createItemResult => {
createItemResultComplete = createItemResult; createItemResultComplete = createItemResult;
checkUpdateShare(); checkUpdateShare();
}); });
sendWebNet(WebNetName.myWallet).then(myWalletResult => { sendWebNet(WebNetName.myWallet).then(myWalletResult => {
myWalletResultComplete = myWalletResult; myWalletResultComplete = myWalletResult;
checkUpdateShare(); checkUpdateShare();
}); });
getObject(this,'prize_close').addEventListener(FYGE.MouseEvent.CLICK, ()=>{ getObject(this, 'prize_close').addEventListener(FYGE.MouseEvent.CLICK, () => {
console.log('123') console.log('123')
}, this); }, this);
} }
hidePanel() { hidePanel() {
...@@ -58,22 +76,22 @@ export class PrizePanel extends Panel { ...@@ -58,22 +76,22 @@ export class PrizePanel extends Panel {
changeScene(IndexScene); changeScene(IndexScene);
} }
onClick_inviteBtn(){ onClick_inviteBtn() {
showShareMask(); showShareMask();
} }
get closeBtns() { get closeBtns() {
return [getObject(this,'prize_close')]; return [getObject(this, 'prize_close')];
} }
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
this.inviteBtn.addEventListener(FYGE.MouseEvent.CLICK, this.onClick_inviteBtn, this); this.inviteBtn.addEventListener(FYGE.MouseEvent.CLICK, this.onClick_inviteBtn, this);
} }
removeEvents() { removeEvents() {
super.removeEvents(); super.removeEvents();
this.inviteBtn.removeEventListener(FYGE.MouseEvent.CLICK, this.onClick_inviteBtn, this); this.inviteBtn.removeEventListener(FYGE.MouseEvent.CLICK, this.onClick_inviteBtn, this);
} }
get groupNames() { return ["prize"] } get groupNames() { return ["prize"] }
get skinName() { return "prize" } get skinName() { return "prize" }
......
...@@ -61,20 +61,19 @@ export class IndexScene extends Scene { ...@@ -61,20 +61,19 @@ export class IndexScene extends Scene {
// showPanel(DrawPanel) // showPanel(DrawPanel)
// }, 1000); // }, 1000);
// sendWebNet(WebNetName.carouselInfo).then(res => { sendWebNet(WebNetName.carouselInfo).then(res => {
// console.log('carouselInfo ', res); console.log('carouselInfo ', res);
// const template = '{phone}邀请了{friend}位好友,获得了{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('{friend}', item.friend); str = str.replace('{amount}', item.amount);
// str = str.replace('{amount}', item.amount); return str
// return str });
// }); const q = getObject(this,'index_wrapper').addChild(new Marquee(datas));
// const q = this.page.view.addChild(new Marquee(datas)); q.x=135;q.y=191;
// q.y = 50; window['q'] = q;
// q.x = 50; });
// });
sendWebNet(WebNetName.createItem).then(createItemResult => { sendWebNet(WebNetName.createItem).then(createItemResult => {
......
...@@ -15,6 +15,7 @@ export class NewbieScene extends Scene { ...@@ -15,6 +15,7 @@ export class NewbieScene extends Scene {
prizeBtn: FYGE.Sprite; prizeBtn: FYGE.Sprite;
ruleBtn: FYGE.Sprite; ruleBtn: FYGE.Sprite;
onPageVisibilityChange = async (visible) => { onPageVisibilityChange = async (visible) => {
if(getQueryParams().disablewatch==1){console.log('disable watch');return; }
console.log('页面visible', visible); console.log('页面visible', visible);
if (!prize) { if (!prize) {
console.log('没有领体验金'); return; console.log('没有领体验金'); return;
......
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