|
@@ -8,10 +8,11 @@ import { userDataManager } from '../manager/userDataManager';
|
|
|
import { ClientEvent } from '../lib/clientEvent';
|
|
|
import { SdkUtil } from '../sdkUtil';
|
|
|
import { results_unlock_car } from './results_unlock_car';
|
|
|
+import { base_ui } from '../fw/base_ui';
|
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
|
@ccclass('results')
|
|
|
-export class results extends Component {
|
|
|
+export class results extends base_ui {
|
|
|
@property(Node) btn_restart:Node = null
|
|
|
@property(Node) lab_scores:Node = null
|
|
|
@property(Node) btn_back_home:Node = null
|
|
@@ -22,18 +23,18 @@ export class results extends Component {
|
|
|
private call_back = null
|
|
|
private back_home_cb = null
|
|
|
start() {
|
|
|
- uiManager.Instance().onButtonListen(this.btn_restart,()=>{
|
|
|
+ this.onButtonListen(this.btn_restart,()=>{
|
|
|
if(this.call_back!=null){
|
|
|
this.call_back()
|
|
|
this.close()
|
|
|
}
|
|
|
})
|
|
|
- uiManager.Instance().onButtonListen(this.btn_back_home,()=>{
|
|
|
- if(this.back_home_cb){
|
|
|
+ this.onButtonListen(this.btn_back_home,()=>{
|
|
|
+ if(this.back_home_cb){
|
|
|
this.back_home_cb()
|
|
|
- }
|
|
|
+ }
|
|
|
})
|
|
|
- uiManager.Instance().onButtonListen(this.btn_video_reLife,()=>{
|
|
|
+ this.onButtonListen(this.btn_video_reLife,()=>{
|
|
|
let ad_id = SdkUtil.getAdId(config.ADS_TYPE.GAME_RELIFE_VIDEO)
|
|
|
SdkUtil.showVideoAd(ad_id,()=>{
|
|
|
if(this.call_back){
|
|
@@ -43,7 +44,7 @@ export class results extends Component {
|
|
|
})
|
|
|
})
|
|
|
|
|
|
- uiManager.Instance().onButtonListen(this.btn_share,()=>{
|
|
|
+ this.onButtonListen(this.btn_share,()=>{
|
|
|
SdkUtil.shareGame(config.ADS_CONFIG.GAME_RELIFE_SHARE_TITLE,()=>{
|
|
|
// if(this.call_back){
|
|
|
// this.call_back(true)
|
|
@@ -53,14 +54,14 @@ export class results extends Component {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- private close(){
|
|
|
+ protected close(){
|
|
|
this.node.active = false;
|
|
|
}
|
|
|
|
|
|
|
|
|
- public show(scores:number,call,back_home_cb,isFristOverGame:boolean){
|
|
|
+ public show(scores:number,call,back_home_cb,isReLife:boolean){
|
|
|
this.back_home_cb = back_home_cb
|
|
|
- this.btn_video_reLife.active = isFristOverGame
|
|
|
+ this.btn_video_reLife.active = isReLife
|
|
|
http.post(config.API.sync_integral,{"integral":scores},(err,data)=>{
|
|
|
if(!err){
|
|
|
let d = JSON.parse(data)
|