import { _decorator, Component, Label, Node } from 'cc'; import { http } from '../http'; import { config } from '../config'; const { ccclass, property } = _decorator; @ccclass('results') export class results extends Component { @property(Node) btn_restart:Node = null @property(Node) lab_scores:Node = null private call_back = null start() { this.btn_restart.on(Node.EventType.TOUCH_END,()=>{ if(this.call_back!=null){ this.call_back() this.close() } }) } private close(){ this.node.active = false; } public show(scores:number,call){ http.post(config.API.sync_integral,{"integral":scores},(err,data)=>{ if(!err){ console.log("data",data) // http.get(config.STATIC_API.regions,(e,d)=>{ // console.log("regions",d) // }) http.get(config.STATIC_API.rankings(0),(err,data)=>{ console.log("rankings",data) }) } }) this.node.active = true this.lab_scores.getComponent(Label).string = "积分:"+ scores+"" this.call_back = call } }