GameData.ts 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763
  1. import FunBtns from "../game/FunBtns";
  2. import Game from "../game/Game";
  3. /**
  4. * @description 游戏核心玩法数据
  5. * @author 邹勇
  6. */
  7. export class GameData {
  8. public dataFinish: boolean = false;
  9. public savePropFinish: boolean = false;
  10. public savePropsFinish: boolean = false;
  11. public getPropsFnish: boolean = false;
  12. public configs: any = {};
  13. public adShowConfig: ADShowCfg;
  14. /** 功能开启 */
  15. public funOpenData: string[] = [];
  16. public gameData: PlayerProp = null;
  17. /** 标志位:刷新主界面货币 */
  18. public init_coin: boolean = false;
  19. public updatePiggyBankValue: boolean = false;
  20. /** 标志位:刷新主界面头像 */
  21. public init_head: boolean = false;
  22. /** 标志位:刷新主界面红点 */
  23. public init_red_point: boolean = true;
  24. /** 属性存储字典 */
  25. public props: Map<number, any> = new Map<number, any>();
  26. public pools = [
  27. { url: "game/prefab/tips", num: 20 },
  28. { url: "game/prefab/coin", num: 20 }
  29. ];
  30. /** 主页样式脚本 */
  31. public gameStyle: Game = null;
  32. /** 入口按钮 */
  33. public funBtns: FunBtns = null;
  34. /**
  35. * 初始化游戏数据:网络配置信息,用户信息
  36. * @returns
  37. */
  38. public async init() {
  39. let data: any = { "versionCode": gData.appData.version };
  40. let response = await mk.http.sendData('getAllConfigInfo', data);
  41. if (response.errcode != 0) {
  42. if (response.errcode == -10003 || response.errcode == -20003) {
  43. //清除缓存
  44. gData.loginData.reload();
  45. }
  46. return;
  47. }
  48. mk.console.logSingle("getAllConfigInfo", response.data);
  49. this.initConfigs(response.data);
  50. //初始化topon
  51. mk.ad.init();
  52. data = {};
  53. response = await mk.http.sendData('getInfoCrypt', data);
  54. if (response.errcode != 0) {
  55. return;
  56. }
  57. mk.console.logSingle("getInfoCrypt", response.data);
  58. this.initPlayerProp(response.data)
  59. this.initProps(response.data.gameUserData);
  60. gData.guideData.init();
  61. gData.guideWeakData.init();
  62. gData.moduleData.forEach(element => {
  63. element.init();
  64. });
  65. data = {};
  66. response = await mk.http.sendData('user/adShowConfig', data);
  67. if (response.errcode != 0) {
  68. return;
  69. }
  70. this.adShowConfig = response.data;
  71. mk.console.logSingle("user/adShowConfig", response.data);
  72. gData.adData.setFullInterShowStr();
  73. this.dataFinish = true;
  74. }
  75. private initConfigs(data) {
  76. // console.log('config ', data);
  77. this.configs = data;
  78. this.funOpenData = this.configs.ServerConfig.Functionswitch.split(",");
  79. // this.setProductMapFromJson();
  80. gData.configData.loadConfig();
  81. }
  82. /**
  83. * 初始化玩家数据
  84. */
  85. private initPlayerProp(res_data) {
  86. this.gameData = new PlayerProp();
  87. this.gameData.cashIndex = res_data.cashIndex;
  88. this.gameData.gameUserData = res_data.gameUserData;
  89. this.gameData.isSignInToday = res_data.isSignInToday;
  90. this.gameData.isWithdrawable = res_data.isWithdrawable;
  91. this.gameData.lastTime = res_data.lastTime;
  92. this.gameData.loginDays = res_data.loginDays;
  93. this.gameData.newPlayer = res_data.newPlayer;
  94. this.gameData.initPiggyBank(res_data.piggyBank);
  95. this.gameData.piggyBankCashTimes = res_data.piggyBankCashTimes;
  96. this.gameData.redMoney = res_data.redMoney == null ? 0 : res_data.redMoney;
  97. this.gameData.signInDay = res_data.signInDay;
  98. this.gameData.totalPiggyBankCashTimes = res_data.totalPiggyBankCashTimes;
  99. this.gameData.turntableTimes = res_data.turntableTimes;
  100. this.gameData.userTuCaoInfo = res_data.userTuCaoInfo;
  101. this.gameData.versioncfg = res_data.versioncfg;
  102. this.gameData.isFirstRedMoney = res_data.isFirstRedMoney;
  103. gData.adData.watchNumToday = res_data.dayVideoTimesForRedMoney == null ? 0 : res_data.dayVideoTimesForRedMoney;
  104. this.setFramDataMapByServer();
  105. }
  106. /**
  107. * 保存单个数据
  108. */
  109. public async setProp(key: GameProp, value: any) {
  110. let data = {
  111. key: key + '',
  112. value: value
  113. };
  114. this.props.set(key, value);
  115. await mk.http.sendData('savePlayerProp', data);
  116. this.savePropFinish = true;
  117. }
  118. /**
  119. * 保存多个数据
  120. */
  121. public async setProps(arr: { key: GameProp, value: any }[]) {
  122. let needProp = {};
  123. for (let i = 0; i < arr.length; i++) {
  124. needProp[arr[i].key + ''] = arr[i].value;
  125. }
  126. let data = {
  127. needProp: needProp
  128. };
  129. for (let i = 0; i < arr.length; i++) {
  130. this.props.set(arr[i].key, arr[i].value);
  131. }
  132. await mk.http.sendData('saveAllPlayerProp', data);
  133. this.savePropsFinish = true;
  134. }
  135. /** 获取属性 */
  136. public getProp(key: GameProp): number {
  137. if (this.props == null) {
  138. return 0;
  139. }
  140. let value = this.props.get(key);
  141. return value;
  142. }
  143. /**
  144. * 向服务器请求所有属性后更新
  145. */
  146. public async getAllProps() {
  147. let response = await mk.http.sendData('getAllPlayerProp', {});
  148. if (response.errcode != 0) {
  149. return;
  150. }
  151. this.initProps(response.data);
  152. this.getPropsFnish = true;
  153. }
  154. private initProps(data) {
  155. if (data == null) {
  156. return;
  157. }
  158. for (let key in data) {
  159. this.props.set(parseInt(key), data[key]);
  160. }
  161. }
  162. /**
  163. * 第二天需要重置的数据
  164. */
  165. public resetProps() {
  166. let arr = [];
  167. arr.push({ key: GameProp.sign_can, value: 1 });
  168. arr.push({ key: GameProp.isAutoOpenPanel, value: 1 });
  169. arr.push({ key: GameProp.isOpenBankOnCloseCash, value: 0 });
  170. this.setProps(arr);
  171. }
  172. /** 是否是新用户 */
  173. public isNewPlayer(): boolean {
  174. let v = this.getProp(GameProp.newPlayer);
  175. return v == 0;
  176. }
  177. //*********** ================= 农场数据 ================== */
  178. // public needReloadData = false;
  179. // private _productingListMap: Map<number, Array<{ productID: number, ripeDate: number }>> = new Map();
  180. // /**建筑生产队列列表 */
  181. // public getProductingList(id: number): Array<{ productID: number, ripeDate: number }> {
  182. // if (!this._productingListMap.has(id)) {
  183. // this._productingListMap.set(id, []);
  184. // }
  185. // return this._productingListMap.get(id);
  186. // }
  187. // /**已激活的建筑列表 */
  188. // private buildDataMap: Map<number, number> = new Map();
  189. // public hasBuildData(id: number): boolean {
  190. // return this.buildDataMap.has(id);
  191. // }
  192. // public getBuildData(id: number): number {
  193. // return this.buildDataMap.get(id);
  194. // }
  195. // public setBuildData(id: number, userBuildID: number): void {
  196. // this.buildDataMap.set(id, userBuildID);
  197. // }
  198. // // /**设置建筑数据(生产队列,流水线数量,激活情况等) */
  199. // // public async setGameData(data: any) {
  200. // // this._productingListMap = new Map();
  201. // // this._unlockMap = new Map();
  202. // // this.buildDataMap = new Map();
  203. // // let product = ConfigData.configMap.get("product");
  204. // // for (let i = 0; i < data.length; i++) {
  205. // // const build = data[i];
  206. // // if (!this.buildDataMap.has(build.buildID)) {
  207. // // this.buildDataMap.set(build.buildID, build.userBuildID);
  208. // // this.setUnlock(build.buildID, build.addValue + 1);
  209. // // }
  210. // // if (build.productID != 0) {
  211. // // let result = product[build.productID];
  212. // // this.getProductingList(build.buildID).push({ productID: build.productID, ripeDate: build.plantTime * 1000 + result["time"] * 1000 });
  213. // // }
  214. // // }
  215. // // }
  216. // /**是否有任务可领取 */
  217. // public taskReceive = false;
  218. // /**是否有3日活动任务可领取 */
  219. // public threeDayTaskReceive = 0;
  220. // /**3日活动还需要邀请人数 */
  221. // public needChildCount: number = 0;
  222. // /**3日活动激活后结束时间 */
  223. // public threedayTaskTime: number = 0
  224. // /**种植奖励数据 */
  225. // public productPrize = null;
  226. // // /**排行榜数据*/
  227. // // public rankData: RankData;
  228. // // /**排行榜积分数据*/
  229. // // public rankScore: number = 0;
  230. // // /**是否刷新排行榜活动倒计时*/
  231. // // public isRefreshRankTime: boolean;
  232. // // /**是否可以领取排行榜奖励*/
  233. // // public isCanGetRankReward: boolean;
  234. /** 农田数据 服务器数据 */
  235. private _farmData = [];
  236. /** 农田字典 本地数据,方便操作*/
  237. private _farmDataMap: Map<number, any> = new Map();
  238. //刷新农田
  239. public needFreshArr = [];
  240. public setFarmDataMap(id, data, sendToServer = true) {
  241. this._farmDataMap.set(id, data);
  242. let len = this._farmData.length;
  243. for (var i = 0; i < len; i++) {
  244. if (this._farmData[i].id == id) {
  245. this._farmData[i].state = data.state;
  246. this._farmData[i].productID = data.productID;
  247. this._farmData[i].growSpan = data.growSpan;
  248. break;
  249. }
  250. }
  251. this.needFreshArr.push(id);
  252. // //更新到服务器
  253. // if (sendToServer) {
  254. // this.setProp(GameProp.farmData, this._farmData);
  255. // }
  256. }
  257. public getFarmDataMap(id) {
  258. return this._farmDataMap.get(id);
  259. }
  260. /** 服务器数据设置到本地 */
  261. public setFramDataMapByServer() {
  262. let len = this._farmData.length;
  263. //新玩家初始化农田数据
  264. if (len <= 18) {
  265. let id = 31000;
  266. let data = null;
  267. for (var i = 0; i < 18; i++) {
  268. if (i < 3) {
  269. data = { id: id, state: FarmState.Empty, productID: 0, growSpan: 0 };
  270. }
  271. else if (i == 3) {
  272. data = { id: id, state: FarmState.CanUnlock, productID: 0, growSpan: 0 };
  273. }
  274. else {
  275. data = { id: id, state: FarmState.Lock, productID: 0, growSpan: 0 };
  276. }
  277. this._farmData.push(data);
  278. this._farmDataMap.set(id, data);
  279. id++;
  280. }
  281. //更新到服务器
  282. this.setProp(GameProp.farmData, this._farmData);
  283. }
  284. else {
  285. for (var i = 0; i < len; i++) {
  286. this._farmDataMap.set(this._farmData[i].id, this._farmData[i]);
  287. }
  288. }
  289. }
  290. /** puduct配置数据 <picture, config> */
  291. private _productMap: Map<number, any> = new Map();
  292. /** puduct类型配置数据 <tab, 类型数组> */
  293. private _productTypeMap: Map<string, any> = new Map();
  294. /** 设置puduct配置数据 */
  295. public setProductMapFromJson() {
  296. // let productJson = this.configs.product;
  297. //先用本地数据
  298. let productJson = gData.configData.configMap.get('product');
  299. let len = productJson.length;
  300. let product = null;
  301. for (var i = 0; i < len; i++) {
  302. product = productJson[i];
  303. this._productMap.set(product['picture'], product);
  304. let arr = [];
  305. if (this.getProductArrByType(product['tab'])) {
  306. arr = this.getProductArrByType(product['tab']);
  307. }
  308. else {
  309. this._productTypeMap.set(product['tab'], arr);
  310. }
  311. arr.push(product);
  312. }
  313. }
  314. /** 根据id获取单个数据 */
  315. public getProductMap(id) {
  316. return this._productMap.get(id);
  317. }
  318. /** 根据tab获取数组 */
  319. public getProductArrByType(type: ProductType) {
  320. return this._productTypeMap.get(type);
  321. }
  322. /** 产品生产/种植次数 服务器数据 */
  323. private _productMakeTimesData = [];
  324. /** 产品生产/种植次数 */
  325. private _productMakeTimesMap: Map<number, number> = new Map();
  326. addProductMakeTimesById(id: number) {
  327. let times = this._productMakeTimesMap.get(id);
  328. if (!times) {
  329. times = 0;
  330. }
  331. times++;
  332. this._productMakeTimesMap.set(id, times);
  333. //更新到服务器
  334. let has = false;
  335. let len = this._productMakeTimesData.length;
  336. for (var i = 0; i < len; i++) {
  337. if (this._productMakeTimesData[i].id == id) {
  338. this._productMakeTimesData[i].times = times;
  339. has = true;
  340. break;
  341. }
  342. }
  343. if (!has) {
  344. let data = { 'id': id, 'times': times };
  345. this._productMakeTimesData.push(data);
  346. }
  347. this.setProp(GameProp.productMakeTimes, this._productMakeTimesData);
  348. }
  349. getProductMakeTimesById(id: number) {
  350. let times = this._productMakeTimesMap.get(id);
  351. if (!times) {
  352. times = 0
  353. }
  354. return times;
  355. }
  356. }
  357. /**
  358. * 所有模块的非校验数据
  359. */
  360. export enum GameProp {
  361. /** -------------------- 通用玩家数据 ------------------------- */
  362. /** 是否新手 0新手 1老手 */
  363. newPlayer = 1,
  364. /** 当前新手引导步骤 */
  365. guideID = 2,
  366. /** 需要自动弹界面 每次登录都弹 除首次 表示今日是否要自动开 1自动开 2不自动开 其他不处理*/
  367. isAutoOpenPanel = 3,
  368. /** 关闭常规提现时需要自动开存钱罐 每天一次 表示今日有没有开过 */
  369. isOpenBankOnCloseCash = 4,
  370. //看视频次数
  371. videoTimes = 5,
  372. //提现次数
  373. cashTimes = 6,
  374. /** ------------------ 游戏核心数据 --------------------------- */
  375. /** 农场等级 */
  376. levelNum = 10,
  377. /** 农田数据 */
  378. farmData = 11,
  379. /** 产品生产次数 */
  380. productMakeTimes = 12,
  381. /** ------------------ 转盘数据 ------------------------------ */
  382. turnable_leftTimes = 20,
  383. /** ------------------ 存钱罐数据 ----------------------------- */
  384. /** ------------------ 签到数据 ----------------------------- */
  385. /** 上次签到进度 */
  386. sign_last_bar = 120,
  387. /** 当前能否签到 */
  388. sign_can = 121,
  389. /** ------------------ 红包提现 ----------------------------- */
  390. /** 提现进度 */
  391. redBag_cash_bar = 220,
  392. }
  393. /**
  394. * 玩家数据
  395. */
  396. class PlayerProp {
  397. /** 自定义不需要校验的数据 */
  398. gameUserData = 0;
  399. _isSignInToday = 0;
  400. /**
  401. * 今日是否有签到
  402. * - 0 未签到,表示可以签到
  403. * - 1 有签到,表示不可签到
  404. */
  405. set isSignInToday(value: number) {
  406. this._isSignInToday = value;
  407. gData.sign.init_data = true;
  408. gData.gameData.init_red_point = true;
  409. }
  410. get isSignInToday(): number {
  411. return this._isSignInToday;
  412. }
  413. private _piggyBank: number = 0;
  414. /** 存钱罐存款 */
  415. set piggyBank(value: number) {
  416. if (this._piggyBank === value) return;
  417. if (gData.gameData.gameData.isWithdrawable && value > 0) return;// 存钱罐可提现状态,不能增加存钱罐金额
  418. this._piggyBank = value;
  419. gData.gameData.init_coin = true;
  420. gData.pigbank.init_data = true;
  421. gData.gameData.init_red_point = true;
  422. }
  423. get piggyBank(): number {
  424. return this._piggyBank;
  425. }
  426. /** 初始化 */
  427. initPiggyBank(v) {
  428. this._piggyBank = v;
  429. }
  430. _isWithdrawable = 0;
  431. /**
  432. * 存钱罐能否提现
  433. * - 0 不能提现
  434. * - 1 能提现
  435. */
  436. set isWithdrawable(value: number) {
  437. if (this._isWithdrawable != value) {
  438. this._isWithdrawable = value;
  439. gData.pigbank.init_data = true;
  440. gData.gameData.init_red_point = true;
  441. }
  442. }
  443. get isWithdrawable(): number {
  444. return this._isWithdrawable;
  445. }
  446. /** 存钱罐每日提现次数 */
  447. piggyBankCashTimes = 0;
  448. /** 累计存钱罐每日提现次数 */
  449. totalPiggyBankCashTimes = 0;
  450. /** 提现进度 */
  451. cashIndex = 0;
  452. /** 上次登录时间 */
  453. lastTime = 0;
  454. /** 登录天数 */
  455. loginDays = 0;
  456. newPlayer = 0;
  457. private _redMoney: number = 0;
  458. /** 红包币数量 */
  459. set redMoney(value: number) {
  460. this._redMoney = value;
  461. gData.gameData.init_coin = true;
  462. gData.gameData.init_red_point = true;
  463. }
  464. get redMoney(): number {
  465. return this._redMoney;
  466. }
  467. _signInDay = 0;
  468. /** 累计签到次数 客户端理解 上次签到天数 */
  469. set signInDay(value: number) {
  470. if (this._signInDay === value) return;
  471. this._signInDay = value;
  472. gData.sign.init_data = true;
  473. }
  474. get signInDay(): number {
  475. return this._signInDay;
  476. }
  477. /** 转盘次数 */
  478. turntableTimes = 0;
  479. /** 版本号 */
  480. versioncfg = 0;
  481. /** 福袋数据 */
  482. userTuCaoInfo = 0;
  483. /** 关卡数 */
  484. levelNum = 0;
  485. /** 锤子道具数目 */
  486. hammerPropNum = 0;
  487. /** 重设道具数目 */
  488. resetPropNum = 0;
  489. /** 变色道具数目 */
  490. changePropNum = 0;
  491. /** 能免费领红包 1 表示是新人第一次产出红包币,不用看视频*/
  492. isFirstRedMoney = 0;
  493. //玩家等级
  494. gradeLevel = 1;
  495. }
  496. /**
  497. * 奖励状态
  498. */
  499. export enum RewardState {
  500. /** 已领取 */
  501. none = 1,
  502. /** 未解锁 */
  503. lock = 2,
  504. /** 可领取 */
  505. unlock = 3
  506. }
  507. /**
  508. * 奖励类型
  509. */
  510. export enum RewardType {
  511. /** 红包币 */
  512. redBag = 1,
  513. /** 毛币 */
  514. rmb = 2,
  515. /** 金猪币 */
  516. pigRmb = 3,
  517. }
  518. /**
  519. * 音频路径
  520. */
  521. export enum AUDIO_TYPE {
  522. /**主界面背景音乐*/
  523. bgm = 'bgm',
  524. /**打开存钱罐界面播放一次*/
  525. pigBank = 'pigBank',
  526. /**关卡玩法背景音乐*/
  527. missionBg = 'missionBg',
  528. /**红包币领取界面关闭音效*/
  529. rewardClose = 'rewardClose',
  530. /**红包币领取界面开启音效*/
  531. rewardOpen = 'rewardOpen',
  532. /**红包界面打开音效*/
  533. reward = 'reward',
  534. /**提现到账界面打开播放一次*/
  535. receiptNotice = 'receiptNotice',
  536. /**通用按钮点击音效 */
  537. button = 'button',
  538. /**转盘转动音效*/
  539. turnableplay = 'turnableplay',
  540. /**转盘转动音效*/
  541. turnplateDrawEnd = 'turnplateDrawEnd',
  542. /**主页背景音乐 */
  543. music_startBg = "music_startBg",
  544. /**游戏背景音乐 */
  545. music_gameBg = "music_gameBg",
  546. /**按钮点击 */
  547. ef_button_click = "ef_button_click",
  548. /**红包打开 */
  549. ef_redPacket_open = "ef_redPacket_open",
  550. /**红包来了音效 */
  551. ef_redPacket_come = "ef_redPacket_come",
  552. /**消除4个 */
  553. ef_bonus4 = "ef_bonus4",
  554. /**消除5个 */
  555. ef_bonus5 = "ef_bonus5",
  556. /**消除6个 */
  557. ef_bonus6 = "ef_bonus6",
  558. /**消除7个 */
  559. ef_bonus7 = "ef_bonus7",
  560. /**消除8个 */
  561. ef_bonus8 = "ef_bonus8",
  562. /**普通消除音效 */
  563. ef_eliminate = "ef_eliminate",
  564. /**bouns消除音效 */
  565. ef_eliminate_bonus = "ef_eliminate_bonus",
  566. /**胜利音效 */
  567. ef_win = "ef_win",
  568. /**锤子 */
  569. ef_change = "ef_change",
  570. /**刷新 */
  571. ef_refresh = "ef_refresh",
  572. /**飞翔 */
  573. ef_fly = "ef_fly",
  574. /**关闭按钮音效*/
  575. closeButton = "closeButton",
  576. }
  577. /** ECPM */
  578. type ADShowCfg = {
  579. average_ecpm: number,
  580. insert_probability: number,
  581. is_show_banner: number,
  582. is_show_inter: number,
  583. }
  584. type PlayerInfoType = {
  585. /** 自定义不需要校验的数据 */
  586. gameUserData: object,
  587. /** 今日是否有签到 */
  588. isSignInToday: number,
  589. /** 存钱罐存款 */
  590. piggyBank: number,
  591. /** 存钱罐能否提现 */
  592. isWithdrawable: boolean,
  593. /** 存钱罐每日提现次数 */
  594. piggyBankCashTimes: number,
  595. /** 累计存钱罐每日提现次数 */
  596. totalPiggyBankCashTimes: number,
  597. /** 提现进度 */
  598. cashIndex: number,
  599. /** 上次登录时间 */
  600. lastTime: number,
  601. /** 登录天数 */
  602. loginDays: number,
  603. newPlayer: Boolean,
  604. /** 红包币数量 */
  605. redMoney: number,
  606. /** 累计签到次数 客户端理解 上次签到天数 */
  607. signInDay: number,
  608. /** 转盘次数 */
  609. turntableTimes: number,
  610. /** 版本号 */
  611. versioncfg: string,
  612. /** 福袋数据 */
  613. userTuCaoInfo: object,
  614. }
  615. /**事件类型 */
  616. export enum EVENT_TYPE {
  617. BACK_WxAuth = "BACK_WxAuth",
  618. UPDATE_CashNum = "UPDATE_CashNum",
  619. }
  620. /** 数据事件Id */
  621. export enum DataEventId {
  622. /** 点击 */
  623. guide = "guide",
  624. /** 按钮点击 */
  625. button_click = "button_click",
  626. /** 看视频 */
  627. video_init = "video_init",
  628. /** 看视频完成 */
  629. video_end = "video_end",
  630. /** 福袋功能 */
  631. fudaiFunction = "fudaiFunction",
  632. /** 互推功能 */
  633. hutuiFunction = "hutuiFunction",
  634. /** 关卡 */
  635. level = "level",
  636. /** 常规提现-红包币提现 */
  637. commonWithDrawal = "commonWithDrawl",
  638. /** 存钱罐提现 */
  639. jarWithDrawal = "jarWithDrawal",
  640. /** 签到提现 */
  641. signWithDrawal = "signWithDrawal",
  642. }
  643. /** 视频广告类型 */
  644. export enum VideoAdType {
  645. Null = "",
  646. /** 关卡积分红包 */
  647. LevelScoreRedBag = "关卡积分红包",
  648. /** 主界面气泡红包 */
  649. StartQiPaoRedBag = "主界面气泡红包",
  650. /** 关卡气泡红包 */
  651. LevelQiPaoRedBag = "关卡气泡红包",
  652. /** 转盘 */
  653. Turntable = "转盘视频",
  654. /** 福袋视频" */
  655. Fudai = "福袋视频",
  656. /** 签到视频 */
  657. Sign = "签到视频",
  658. //钱包提现新手视频
  659. CashOutNoviceWelfare = "钱包提现新手视频",
  660. //钱包提现加现金视频
  661. CashOutAddCash = "钱包提现加现金视频"
  662. }
  663. export enum FarmState {
  664. Lock,
  665. CanUnlock,
  666. Empty,
  667. Growing,
  668. Ripe
  669. }
  670. export enum ProductType {
  671. nzw = '农作物',
  672. dw = '动物',
  673. bmhc = '爆米花厂',
  674. gdp = '糕点铺',
  675. ztc = '制糖厂',
  676. gfmg = '功夫面馆',
  677. kcd = '快餐店'
  678. }