| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- cc.Class({
- extends: cc.Component,
- properties: {
- snbAmount: {
- default: null,
- type: cc.Label,
- serializable: true,
- },
- applyItem: {
- default: null,
- serializable: false,
- visible: false
- },
- applyButton: {
- default: null,
- type: cc.Node,
- serializable: true,
- },
- parentScript:{
- default:null,
- visible:false
- }
- },
- setInfo(context) {
- let { item , parentScript} = context;
- this.applyItem = item;
- this.snbAmount.string = item.snb;
- if(1 === item.isState){
- this.applyButton.active = true;
- }
- this.parentScript = parentScript;
- },
- /**
- * 提现cnt
- */
- onApplyTranCnt() {
- //限制相关人员交易
- if (1 === GlobalD.UserInfo.limitTran) {
- GlobalD.GameData.showToast(
- cc.find('Canvas/UICamera'),
- '转换CNT通道关闭,请联系相关管理人员!',
- 1
- )
- return
- }
- if (0 === Number(this.applyItem.snb) || 0 != Number(this.applyItem.snb) % 5) {
- GlobalD.GameData.showToast(
- cc.find('Canvas/UICamera'),
- '请输入5的倍数兑换!',
- 1
- )
- return
- }
- console.log('发起兑换:' + Number(this.applyItem.snb))
- GlobalD.GameData.onSnbToCnt(Number(this.applyItem.snb), (data) => {
- //更新数据
- // console.log('res=', data)
- //更新审核列表
- this.parentScript.onchildrenUpdate();
- })
- }
- });
|