Commit b6d3bd3d authored by wildfirecode13's avatar wildfirecode13

u

parent 7e64d160
......@@ -2,16 +2,16 @@
"code": null,
"data": [
{
"nickname": "123",
"amount": "999"
"nickname": "138****5678",
"amount": "9999"
},
{
"nickname": "789",
"amount": "777"
"nickname": "138****5678",
"amount": "7777"
},
{
"nickname": "456",
"amount": "888"
"nickname": "138****5678",
"amount": "8888"
}
],
"message": "sed dolor nulla sint ut",
......
{
"code": null,
"data": 0,
"data": 500000,
"message": "reprehenderit ullamco minim esse",
"success": true
}
\ No newline at end of file
......@@ -8,7 +8,10 @@
"keys": "startSceneBg.jpg,奖品按钮.png,底部按钮区背景.png,开始游戏.png,排行榜按钮.png,规则按钮.png,赚次数按钮.png,运动锦鲤按钮.png",
"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",
"name": "common"
......
This diff is collapsed.
......@@ -8,7 +8,10 @@ export const ResJson = {
"keys": "startSceneBg.jpg,奖品按钮.png,底部按钮区背景.png,开始游戏.png,排行榜按钮.png,规则按钮.png,赚次数按钮.png,运动锦鲤按钮.png",
"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",
"name": "common"
......
......@@ -258,7 +258,6 @@ export const SkinJson ={
}
]
},
{
"name": "prize",
"x": 78,
......@@ -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 h = 50;
const w = 532;
const h = 40
const gap = 10;
export default class Marquee extends FYGE.Sprite {
......@@ -65,11 +65,11 @@ export default class Marquee extends FYGE.Sprite {
initUI() {
const bg = new FYGE.Shape();
bg.beginFill(0, 1);
bg.drawRoundedRect(0, 0, w, h, 5, 5, 5, 5);
bg.endFill();
this.addChild(bg);
// const bg = new FYGE.Shape();
// bg.beginFill(0, 1);
// bg.drawRoundedRect(0, 0, w, h, 5, 5, 5, 5);
// bg.endFill();
// this.addChild(bg);
this.textwrapper = new FYGE.Sprite();
this.textwrapper.x = gap;
......@@ -84,7 +84,7 @@ export default class Marquee extends FYGE.Sprite {
const buttonTxt = new FYGE.TextField;
buttonTxt.textHeight = h;
buttonTxt.size = 20;
buttonTxt.size = 25;
buttonTxt.verticalAlign = FYGE.VERTICAL_ALIGN.MIDDLE;
buttonTxt.fillColor = '0xffffff';
this.textwrapper.addChild(buttonTxt);
......@@ -93,7 +93,7 @@ export default class Marquee extends FYGE.Sprite {
const buttonTxt2 = new FYGE.TextField;
buttonTxt2.textHeight = h;
buttonTxt2.size = 20;
buttonTxt2.size = 25;
buttonTxt2.verticalAlign = FYGE.VERTICAL_ALIGN.MIDDLE;
buttonTxt2.fillColor = '0xffffff';
this.textwrapper.addChild(buttonTxt2);
......
......@@ -2,6 +2,7 @@ import { changeScene } from "../../module/ctrls";
import { RES } from "../../module/RES";
import { Panel } from "../../module/views/Panel";
import Group from "../common/Group";
import { ProgressBarS } from "../common/ProgressBarS";
import { showShareMask } from "../common/ShareMask";
import TestButton from "../common/TestButton";
import TestLabel from "../common/TestLabel";
......@@ -13,11 +14,11 @@ import { getWebData, sendWebNet, WebNetName } from "../WebNet";
let createItemResultComplete, myWalletResultComplete;
const checkUpdateShare = () => {
if (createItemResultComplete && myWalletResultComplete) {
updateShare('inPrizePanel',
createItemResultComplete.data,
myWalletResultComplete.data.sumIncome, myWalletResultComplete.data.experienceAmount)
}
if (createItemResultComplete && myWalletResultComplete) {
updateShare('inPrizePanel',
createItemResultComplete.data,
myWalletResultComplete.data.sumIncome, myWalletResultComplete.data.experienceAmount)
}
}
export class PrizePanel extends Panel {
......@@ -28,29 +29,46 @@ export class PrizePanel extends Panel {
super.initUi();
var skin = RES.getSkinDataByName(this.skinName);
this.position.set(skin.x, skin.y);
this.inviteBtn =getObject(this,'prize_invite');
this.inviteBtn = getObject(this, 'prize_invite');
}
async start(data) {
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 => {
createItemResultComplete = createItemResult;
checkUpdateShare();
});
createItemResultComplete = createItemResult;
checkUpdateShare();
});
sendWebNet(WebNetName.myWallet).then(myWalletResult => {
myWalletResultComplete = myWalletResult;
checkUpdateShare();
});
sendWebNet(WebNetName.myWallet).then(myWalletResult => {
myWalletResultComplete = myWalletResult;
checkUpdateShare();
});
getObject(this,'prize_close').addEventListener(FYGE.MouseEvent.CLICK, ()=>{
getObject(this, 'prize_close').addEventListener(FYGE.MouseEvent.CLICK, () => {
console.log('123')
}, this);
}
hidePanel() {
......@@ -58,22 +76,22 @@ export class PrizePanel extends Panel {
changeScene(IndexScene);
}
onClick_inviteBtn(){
onClick_inviteBtn() {
showShareMask();
}
get closeBtns() {
return [getObject(this,'prize_close')];
return [getObject(this, 'prize_close')];
}
initEvents() {
super.initEvents();
this.inviteBtn.addEventListener(FYGE.MouseEvent.CLICK, this.onClick_inviteBtn, this);
}
removeEvents() {
super.removeEvents();
this.inviteBtn.removeEventListener(FYGE.MouseEvent.CLICK, this.onClick_inviteBtn, this);
}
super.initEvents();
this.inviteBtn.addEventListener(FYGE.MouseEvent.CLICK, this.onClick_inviteBtn, this);
}
removeEvents() {
super.removeEvents();
this.inviteBtn.removeEventListener(FYGE.MouseEvent.CLICK, this.onClick_inviteBtn, this);
}
get groupNames() { return ["prize"] }
get skinName() { return "prize" }
......
......@@ -61,20 +61,19 @@ export class IndexScene extends Scene {
// showPanel(DrawPanel)
// }, 1000);
// sendWebNet(WebNetName.carouselInfo).then(res => {
// console.log('carouselInfo ', res);
// const template = '{phone}邀请了{friend}位好友,获得了{amount}体验金';
// const datas = res.data.map(item => {
// let str = template.replace('{phone}', item.nickname);
// str = str.replace('{friend}', item.friend);
// str = str.replace('{amount}', item.amount);
// return str
// });
// const q = this.page.view.addChild(new Marquee(datas));
// q.y = 50;
// q.x = 50;
// });
sendWebNet(WebNetName.carouselInfo).then(res => {
console.log('carouselInfo ', res);
const template = '{phone}邀请1位好友,获得了{amount}体验金';
const datas = res.data.map(item => {
let str = template.replace('{phone}', item.nickname);
str = str.replace('{amount}', item.amount);
return str
});
const q = getObject(this,'index_wrapper').addChild(new Marquee(datas));
q.x=135;q.y=191;
window['q'] = q;
});
sendWebNet(WebNetName.createItem).then(createItemResult => {
......
......@@ -15,6 +15,7 @@ export class NewbieScene extends Scene {
prizeBtn: FYGE.Sprite;
ruleBtn: FYGE.Sprite;
onPageVisibilityChange = async (visible) => {
if(getQueryParams().disablewatch==1){console.log('disable watch');return; }
console.log('页面visible', visible);
if (!prize) {
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