// Learn TypeScript: // - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html // Learn Attribute: // - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html // Learn life-cycle callbacks: // - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html import TaskManager, { MainTaskIdEnum } from "../JuQingChat/TaskManager"; import BagManager from "./BagManager"; // let gameConfigs = [ // {saveNum:15, buyNum:14, goodId:1401,descStr:'鸡蛋', goodName:'鸡蛋', priceNum:2}, // {saveNum:15, buyNum:14, goodId:1402,descStr:'鸡爪',goodName:'鸡爪', priceNum:2}, // {saveNum:15, buyNum:14, goodId:1403,descStr:'食盐',goodName:'食盐', priceNum:2}, // {saveNum:15, buyNum:14, goodId:1404,descStr:'铅笔',goodName:'铅笔', priceNum:3}, // {saveNum:15, buyNum:14, goodId:1405,descStr:'绿茶',goodName:'绿茶', priceNum:4}, // {saveNum:15, buyNum:14, goodId:1406,descStr:'作业本',goodName:'作业本', priceNum:5}, // {saveNum:15, buyNum:14, goodId:1407,descStr:'巧乐兹',goodName:'巧乐兹', priceNum:5}, // {saveNum:15, buyNum:14, goodId:1408,descStr:'咸豆腐花',goodName:'咸豆腐花', priceNum:5}, // {saveNum:15, buyNum:14, goodId:1409,descStr:'泡面',goodName:'泡面', priceNum:5}, // {saveNum:15, buyNum:14, goodId:1410,descStr:'巧克力', goodName:'巧克力', priceNum:8 }, // {saveNum:15, buyNum:14, goodId:1411,descStr:'功能饮料', goodName:'功能饮料', priceNum:8}, // {saveNum:15, buyNum:14, goodId:1412,descStr:'烤红薯', goodName:'烤红薯', priceNum:10}, // {saveNum:15, buyNum:14, goodId:1413,descStr:'摆盘冻梨', goodName:'摆盘冻梨', priceNum:10}, // {saveNum:10, buyNum:9, goodId:1414,descStr:'沙琪玛', goodName:'沙琪玛', priceNum:12}, // {saveNum:10, buyNum:9, goodId:1415,descStr:'椰子', goodName:'椰子', priceNum:12}, // {saveNum:10, buyNum:9, goodId:1416,descStr:'珠珠奶茶', goodName:'珠珠奶茶', priceNum:12}, // {saveNum:10, buyNum:9, goodId:1417,descStr:'酱香拿铁', goodName:'酱香拿铁', priceNum:14}, // {saveNum:10, buyNum:9, goodId:1418,descStr:'切段甘蔗', goodName:'切段甘蔗', priceNum:15}, // {saveNum:10, buyNum:9, goodId:1419,descStr:'整箱砂糖橘', goodName:'整箱砂糖橘', priceNum:29}, // {saveNum:10, buyNum:9, goodId:1420,descStr:'芭比娃娃', goodName:'芭比娃娃', priceNum:30}, // {saveNum:10, buyNum:9, goodId:1421,descStr:'新鲜蔓越莓', goodName:'新鲜蔓越莓', priceNum:32}, // {saveNum:10, buyNum:9, goodId:1422,descStr:'书包', goodName:'书包', priceNum:50}, // {saveNum:10, buyNum:9, goodId:1423,descStr:'新棉被', goodName:'新棉被', priceNum:60}, // {saveNum:10, buyNum:9, goodId:1424,descStr:'保温手套', goodName:'保温手套', priceNum:66}, // {saveNum:10, buyNum:9, goodId:1425,descStr:'年货大礼包', goodName:'年货大礼包', priceNum:88}, // {saveNum:8, buyNum:7, goodId:1426,descStr:'篮球', goodName:'篮球', priceNum:100}, // {saveNum:8, buyNum:7, goodId:1427,descStr:'新窗帘', goodName:'新窗帘', priceNum:220}, // {saveNum:8, buyNum:7, goodId:1428,descStr:'地板', goodName:'地板', priceNum:300}, // {saveNum:8, buyNum:7, goodId:1429,descStr:'摇摇车', goodName:'摇摇车', priceNum:300}, // {saveNum:8, buyNum:7, goodId:1430,descStr:'大花袄', goodName:'大花袄', priceNum:500}, // {saveNum:8, buyNum:7, goodId:1431,descStr:'黄金', goodName:'黄金', priceNum:620}, // {saveNum:5, buyNum:4, goodId:1432,descStr:'冰箱', goodName:'冰箱', priceNum:1000}, // {saveNum:5, buyNum:4, goodId:1433,descStr:'团圆饭一桌', goodName:'团圆饭一桌', priceNum:1200}, // {saveNum:5, buyNum:4, goodId:1434,descStr:'彩电', goodName:'彩电', priceNum:2000}, // {saveNum:5, buyNum:4, goodId:1435,descStr:'墙纸', goodName:'墙纸', priceNum:2500}, // {saveNum:5, buyNum:4, goodId:1436,descStr:'金镯子', goodName:'金镯子', priceNum:3100}, // {saveNum:3, buyNum:2, goodId:1437,descStr:'玉镯子', goodName:'玉镯子', priceNum:5100}, // {saveNum:3, buyNum:2, goodId:1438,descStr:'花为手机', goodName:'花为手机', priceNum:6000}, // {saveNum:2, buyNum:1, goodId:1439,descStr:'千年灵芝', goodName:'千年灵芝', priceNum:8000} // ] export default class BuyShopManager{ static gameConfigs = []; public static getManagerConfigs(){ return this.gameConfigs } public static initManager(callFunc){ let self = this cc.loader.loadRes('Json/gameConfig/buyShop.json', function (err, gameconfig) { if (err) { console.log(err); return; } self.gameConfigs = gameconfig.json; // console.log("游戏配置加载成功", self.gameConfigs); callFunc() }); } public static getCurGoodList(){ //将剧情道具替换掉最后的商品 let mainTaskInfo:any = TaskManager.getCurUnLockMainTaskInfo() let mainId = mainTaskInfo.Id let replaceGoodsTab = [] // if(mainId == MainTaskIdEnum.MainTask_602){ // let goodInfo4 = BagManager.getJuQingGoodConfig(1701) // replaceGoodsTab.push(goodInfo4) // } // else if(mainId == MainTaskIdEnum.MainTask_508){ // let goodInfo = BagManager.getJuQingGoodConfig(1707) // replaceGoodsTab.push(goodInfo) // }else if(mainId == MainTaskIdEnum.MainTask_511){ // let goodInfo = BagManager.getJuQingGoodConfig(1708) // replaceGoodsTab.push(goodInfo) // }else if(mainId == MainTaskIdEnum.MainTask_514){ // let goodInfo = BagManager.getJuQingGoodConfig(1713) // replaceGoodsTab.push(goodInfo) // }else if(mainId == MainTaskIdEnum.MainTask_557){ // let goodInfo = BagManager.getJuQingGoodConfig(2711) // replaceGoodsTab.push(goodInfo) // } let useConfig = [] for(let i=0;i