|
@@ -1,4 +1,4 @@
|
|
-import { _decorator, Component, Label, Node } from 'cc';
|
|
|
|
|
|
+import { _decorator, Component, Label, Node, Sprite, SpriteFrame } from 'cc';
|
|
import { http } from '../http';
|
|
import { http } from '../http';
|
|
import { config } from '../config';
|
|
import { config } from '../config';
|
|
import { audioManager } from '../manager/audioManager';
|
|
import { audioManager } from '../manager/audioManager';
|
|
@@ -11,6 +11,7 @@ import { results_unlock_car } from './results_unlock_car';
|
|
import { base_ui } from '../fw/base_ui';
|
|
import { base_ui } from '../fw/base_ui';
|
|
import { GameManager } from '../GameManager';
|
|
import { GameManager } from '../GameManager';
|
|
import { restart_view } from '../ui/restart_view';
|
|
import { restart_view } from '../ui/restart_view';
|
|
|
|
+import { ResourceUtil } from '../manager/ResourceUtil';
|
|
const { ccclass, property } = _decorator;
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
|
@ccclass('results')
|
|
@ccclass('results')
|
|
@@ -22,8 +23,10 @@ export class results extends base_ui {
|
|
@property(Node) unlock_car:Node = null
|
|
@property(Node) unlock_car:Node = null
|
|
@property(Node) btn_share:Node = null
|
|
@property(Node) btn_share:Node = null
|
|
@property(Node) lab_des:Node = null
|
|
@property(Node) lab_des:Node = null
|
|
|
|
+ @property(Node) spr_title:Node = null
|
|
private call_back = null
|
|
private call_back = null
|
|
private back_home_cb = null
|
|
private back_home_cb = null
|
|
|
|
+ @property(SpriteFrame) TITLE_SF_LIST:SpriteFrame[] = []
|
|
start() {
|
|
start() {
|
|
this.onButtonListen(this.btn_restart,()=>{
|
|
this.onButtonListen(this.btn_restart,()=>{
|
|
if(this.call_back!=null){
|
|
if(this.call_back!=null){
|
|
@@ -58,9 +61,19 @@ export class results extends base_ui {
|
|
this.node.active = false;
|
|
this.node.active = false;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ setTitleSpr(scores:number){
|
|
|
|
+ let index = GameManager.getGameEndPrompt(scores)
|
|
|
|
+ if(index!=-1){
|
|
|
|
+ this.spr_title.getComponent(Sprite).spriteFrame = this.TITLE_SF_LIST[index]
|
|
|
|
+ }else{
|
|
|
|
+ this.spr_title.getComponent(Sprite).spriteFrame = null
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
public show(scores:number,jiesuan_finish_cb,call,back_home_cb,isReLife:boolean){
|
|
public show(scores:number,jiesuan_finish_cb,call,back_home_cb,isReLife:boolean){
|
|
this.back_home_cb = back_home_cb
|
|
this.back_home_cb = back_home_cb
|
|
this.btn_video_reLife.active = isReLife
|
|
this.btn_video_reLife.active = isReLife
|
|
|
|
+ this.setTitleSpr(scores)
|
|
http.post(config.API.sync_integral,{"integral":scores},(err,data)=>{
|
|
http.post(config.API.sync_integral,{"integral":scores},(err,data)=>{
|
|
if(!err){
|
|
if(!err){
|
|
let d = JSON.parse(data)
|
|
let d = JSON.parse(data)
|