修改积分版本
This commit is contained in:
@@ -44,6 +44,9 @@ export class PageMain extends BaseView {
|
||||
/** 奖励icon */
|
||||
@property(Sprite)
|
||||
game_logo_bg: Sprite = null!;
|
||||
/** 当前分数 */
|
||||
@property(Label)
|
||||
lab_point: Label = null!;
|
||||
|
||||
|
||||
/** 默认鸡蛋数量 */
|
||||
@@ -65,6 +68,7 @@ export class PageMain extends BaseView {
|
||||
this.creatEggs();
|
||||
|
||||
this.lab_remain.string = "Cracks Used : " + USERDATA.point.toString();
|
||||
this.lab_point.string = USERDATA.prize_amount.toString();
|
||||
|
||||
// 加载配置的logo
|
||||
if (USERDATA.logo && this.game_logo) {
|
||||
@@ -243,6 +247,8 @@ export class PageMain extends BaseView {
|
||||
USERDATA.point--
|
||||
this.lab_remain.string = "Cracks Used : " + USERDATA.point.toString();
|
||||
|
||||
USERDATA.prize_amount = res.total_amount
|
||||
|
||||
let n = null
|
||||
for (let i = 0; i < USERDATA.prize_list.length; i++) {
|
||||
const element = USERDATA.prize_list[i];
|
||||
@@ -265,6 +271,7 @@ export class PageMain extends BaseView {
|
||||
app.manager.sound.playEffect({name: 'effect/win'});
|
||||
this.reward_bg.active = res.prize_type != 3
|
||||
this.noreward_bg.active = res.prize_type == 3
|
||||
this.lab_point.string = USERDATA.prize_amount.toString();
|
||||
}, 2.5);
|
||||
})
|
||||
}
|
||||
@@ -281,6 +288,17 @@ export class PageMain extends BaseView {
|
||||
app.manager.ui.show<PageTips>({name: 'PageTips'})
|
||||
}
|
||||
|
||||
/** 点击领取奖励 */
|
||||
onClaimPrize(){
|
||||
Tools.httpReq("claim-prize", {}, (res:any) => {
|
||||
app.manager.ui.showToast(Tools.GetLocalized("get success"))
|
||||
USERDATA.prize_amount = 0
|
||||
this.lab_point.string = USERDATA.prize_amount.toString();
|
||||
}, (err:any) => {
|
||||
app.manager.ui.showToast(Tools.GetLocalized("get fail"))
|
||||
})
|
||||
}
|
||||
|
||||
/** 点击音乐 */
|
||||
oncClickMusic(){
|
||||
let music = app.manager.sound.isMusicPlaying
|
||||
|
||||
Reference in New Issue
Block a user