积分版本修改。
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!;
|
||||
|
||||
/** 转盘是否正在转 */
|
||||
private _is_turing = false;
|
||||
@@ -55,6 +58,7 @@ export class PageMain extends BaseView {
|
||||
onShow(params: any) {
|
||||
this.titleAnimation();
|
||||
this.lab_remain.string = "REMAINING CHANCE : " + USERDATA.point.toString();
|
||||
this.lab_point.string = USERDATA.prize_amount.toString();
|
||||
|
||||
this.setRw();
|
||||
|
||||
@@ -176,6 +180,17 @@ export class PageMain extends BaseView {
|
||||
app.manager.ui.show<PageRewardhistory>({name: 'PageRewardhistory'})
|
||||
}
|
||||
|
||||
/** 点击领取奖励 */
|
||||
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"))
|
||||
})
|
||||
}
|
||||
|
||||
/** 点击转盘 */
|
||||
btnClickTurn(){
|
||||
if (this._is_turing) return;
|
||||
@@ -205,9 +220,11 @@ export class PageMain extends BaseView {
|
||||
}
|
||||
|
||||
USERDATA.point--
|
||||
USERDATA.prize_amount = res.total_amount
|
||||
this.lab_remain.string = "REMAINING CHANCE : " + USERDATA.point.toString()
|
||||
|
||||
this.rotateTurntable(n, ()=>{
|
||||
this.lab_point.string = USERDATA.prize_amount.toString();
|
||||
this._is_turing = false
|
||||
this.lab_rw.string = Tools.StringLFormat(res.message)
|
||||
Tools.remoteLoadSprite(USERDATA.prize_list[n].pic, this.icon_rw)
|
||||
|
||||
Reference in New Issue
Block a user