44 lines
1.2 KiB
JavaScript
44 lines
1.2 KiB
JavaScript
"use strict";
|
|
cc._RF.push(module, '1abe1v1FFJFJbuyXQKjrfxE', 'exchange_model');
|
|
// Scripts/mod/exchange/exchange_model.js
|
|
|
|
"use strict";
|
|
|
|
// --------------------------------------------------------------------
|
|
// @author: xxx@syg.com(必填, 创建模块的人员)
|
|
// @description:
|
|
// 这里填写详细说明,主要填写该模块的功能简要
|
|
// <br/>Create: 2018-12-25 16:37:10
|
|
// --------------------------------------------------------------------
|
|
var BridgeClass = require("bridge.class");
|
|
var ExchangeModel = cc.Class({
|
|
"extends": BridgeClass,
|
|
ctor: function ctor() {},
|
|
properties: {},
|
|
initConfig: function initConfig() {
|
|
this.exchangeList = [];
|
|
},
|
|
setExchangeData: function setExchangeData(data) {
|
|
this.exchangeList = data;
|
|
},
|
|
getRedStatus: function getRedStatus() {
|
|
var status = false;
|
|
for (var i = 0; i < this.exchangeList.length; ++i) {
|
|
var v = this.exchangeList[i];
|
|
if (v.id == 1) {
|
|
if (v.max - v.num > 0) {
|
|
status = true;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
return status;
|
|
},
|
|
getExchangeData: function getExchangeData() {
|
|
this.exchangeList.list.sort(Utils.tableLowerSorter(["id"]));
|
|
return this.exchangeList;
|
|
}
|
|
});
|
|
module.exports = ExchangeModel;
|
|
|
|
cc._RF.pop(); |