You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.3 KiB
48 lines
1.3 KiB
import Common5 from "../../Platform/th/Common5";
|
|
import UserManager from "../Manager/UserManager";
|
|
|
|
|
|
const {ccclass, property} = cc._decorator;
|
|
|
|
@ccclass
|
|
export default class CaiShangEnd extends cc.Component {
|
|
|
|
@property(cc.Label)
|
|
duishouLab: cc.Label = null;
|
|
@property(cc.Label)
|
|
zijiyingliLab: cc.Label = null;
|
|
data_ = null
|
|
destroyNode = null
|
|
addMoney = 0
|
|
shouyiMoney = 0
|
|
start () {
|
|
|
|
}
|
|
|
|
setEndView(destroyNode, addMoney, shouyiMoney){
|
|
this.destroyNode = destroyNode
|
|
this.addMoney = addMoney
|
|
this.shouyiMoney = shouyiMoney
|
|
|
|
this.zijiyingliLab.string = '共计盈利:'+Common5.getNumberChangeHanzi(shouyiMoney)+''
|
|
|
|
let str = ''
|
|
if(shouyiMoney>0){
|
|
str = '对手投资损失:'
|
|
let money_ = Math.abs(shouyiMoney)
|
|
this.duishouLab.string = str + Common5.getNumberChangeHanzi(money_)+''
|
|
}else{
|
|
str = '对手投资盈利:'
|
|
let money_ = Math.abs(shouyiMoney)
|
|
this.duishouLab.string = str + Common5.getNumberChangeHanzi(money_)+''
|
|
}
|
|
}
|
|
|
|
sureClickEvent(){
|
|
UserManager.addMoney(this.addMoney)
|
|
this.destroyNode.removeFromParent()
|
|
this.destroyNode.destroy()
|
|
this.node.removeFromParent()
|
|
}
|
|
// update (dt) {}
|
|
}
|
|
|