少年修仙传客户端代码仓库
client_Wu Xijin
2019-02-25 862ef8b6cc1ccc7993d3dcd5c1cf0799ec12a752
6255 【前端】【2.0】神秘商店开发
19个文件已修改
6个文件已添加
668 ■■■■■ 已修改文件
Core/GameEngine/DataToCtl/PackageRegedit.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Login/LaunchPostProcess.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ClientPack/ClientToMapServer/CA2_Interaction/CA232_tagCMRefreshMysticalShop.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ClientPack/ClientToMapServer/CA2_Interaction/CA232_tagCMRefreshMysticalShop.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HA8_Item/DTCA816_tagMCMysticalShopInfo.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HA8_Item/DTCA816_tagMCMysticalShopInfo.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ServerPack/HA8_Item/HA816_tagMCMysticalShopInfo.cs 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ServerPack/HA8_Item/HA816_tagMCMysticalShopInfo.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Lua/Gen/StoreModelWrap.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/BlastFurnace/DanDrugRecycleTip.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/CrossServerOneVsOne/CrossServerOneVsOneHonorStoreWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/CrossServerOneVsOne/CrossServerOneVsOneModel.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HappyXB/HappyXBModel.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HappyXB/XBStoreWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/FBHelpPointExchageModel.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/Logic/LegendPropertyUtility.cs 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/New/FBHelpPointExchageNotify.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/HighSettingTip.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Store/BagStoreWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Store/Logic/BuyItemInfoWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Store/Logic/BuyPetMatInfoWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Store/StoreModel.cs 92 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Store/StoreUIBasic.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Store/StoreWin.cs 415 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Store/UnionStoreWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/DataToCtl/PackageRegedit.cs
@@ -25,6 +25,7 @@
    public static void Init()
    {
        // 登记相应的数据体及对应的数据转逻辑类
        Register(typeof(HA816_tagMCMysticalShopInfo), typeof(DTCA816_tagMCMysticalShopInfo));
        Register(typeof(HAC11_tagGCFeastRedPacketInfo), typeof(DTCAC11_tagGCFeastRedPacketInfo));
        Register(typeof(HAB25_tagMCFeastRedPackInfo), typeof(DTCAB25_tagMCFeastRedPackInfo));
        Register(typeof(HB213_tagMCZhuXianTowerInfo), typeof(DTCB213_tagMCZhuXianTowerInfo));
Core/GameEngine/Login/LaunchPostProcess.cs
@@ -29,6 +29,7 @@
            try
            {
                InGameDownLoad.Instance.ParseRewardConfig();
                LegendPropertyUtility.Init();
                ItemLogicUtility.Instance.Init();
                ModelCenter.Instance.Init();
                SkillHelper.Instance.Init();
Core/NetworkPackage/ClientPack/ClientToMapServer/CA2_Interaction/CA232_tagCMRefreshMysticalShop.cs
New file
@@ -0,0 +1,19 @@
using UnityEngine;
using System.Collections;
// A2 32 神秘商店刷新 #tagCMRefreshMysticalShop
public class CA232_tagCMRefreshMysticalShop : GameNetPackBasic
{
    public CA232_tagCMRefreshMysticalShop()
    {
        combineCmd = (ushort)0x03FE;
        _cmd = (ushort)0xA232;
    }
    public override void WriteToBytes()
    {
    }
}
Core/NetworkPackage/ClientPack/ClientToMapServer/CA2_Interaction/CA232_tagCMRefreshMysticalShop.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 18beaa3b153bbc145a3d8de5fff41866
timeCreated: 1551083019
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Core/NetworkPackage/DTCFile/ServerPack/HA8_Item/DTCA816_tagMCMysticalShopInfo.cs
New file
@@ -0,0 +1,11 @@
using UnityEngine;
using System.Collections;
// A8 16 神秘商店商品信息 #tagMCMysticalShopInfo
public class DTCA816_tagMCMysticalShopInfo : DtcBasic {
    public override void Done(GameNetPackBasic vNetPack) {
        base.Done(vNetPack);
        HA816_tagMCMysticalShopInfo vNetData = vNetPack as HA816_tagMCMysticalShopInfo;
    }
}
Core/NetworkPackage/DTCFile/ServerPack/HA8_Item/DTCA816_tagMCMysticalShopInfo.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 6c8ba6cba809df34286ebed23fe074a4
timeCreated: 1551081427
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Core/NetworkPackage/ServerPack/HA8_Item/HA816_tagMCMysticalShopInfo.cs
New file
@@ -0,0 +1,29 @@
using UnityEngine;
using System.Collections;
// A8 16 神秘商店商品信息 #tagMCMysticalShopInfo
public class HA816_tagMCMysticalShopInfo : GameNetPackBasic {
    public ushort RefreshCnt;    // 刷新次数
    public byte Count;    // 商品数
    public  tagMCMysticalShopGoods[] GoodsList = null;    // 商品信息
    public HA816_tagMCMysticalShopInfo () {
        _cmd = (ushort)0xA816;
    }
    public override void ReadFromBytes (byte[] vBytes) {
        TransBytes (out RefreshCnt, vBytes, NetDataType.WORD);
        TransBytes (out Count, vBytes, NetDataType.BYTE);
        GoodsList = new tagMCMysticalShopGoods[Count];
        for (int i = 0; i < Count; i ++) {
            GoodsList[i] = new tagMCMysticalShopGoods();
            TransBytes (out GoodsList[i].GoodsID, vBytes, NetDataType.DWORD);
        }
    }
    public struct tagMCMysticalShopGoods {
        public uint GoodsID;        // 商品ID
    }
}
Core/NetworkPackage/ServerPack/HA8_Item/HA816_tagMCMysticalShopInfo.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: ae2fc63d69f962e4980c3b46c7a6a5a3
timeCreated: 1551081427
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Lua/Gen/StoreModelWrap.cs
@@ -415,9 +415,6 @@
                {
                    int _type = LuaAPI.xlua_tointeger(L, 2);
                    
                        System.Collections.Generic.List<StoreModel.StoreData> gen_ret = gen_to_be_invoked.TryGetStoreDatas( _type );
                        translator.Push(L, gen_ret);
                    
                    
                    return 1;
System/BlastFurnace/DanDrugRecycleTip.cs
@@ -116,7 +116,7 @@
        private void CreateShopCell()
        {
            shopCtrl.Refresh();
            shoplist = m_storeModel.TryGetStoreDatas((int)m_storeModel.storeFuncType);
            shoplist = m_storeModel.TryGetStoreDatas(m_storeModel.storeFuncType);
            if (shoplist.Count > 0)
            {
                int i = 0;
System/CrossServerOneVsOne/CrossServerOneVsOneHonorStoreWin.cs
@@ -53,7 +53,7 @@
        private void CreateShopCell()
        {
         
            shoplist = m_storeModel.TryGetStoreDatas((int)m_storeModel.storeFuncType);
            shoplist = m_storeModel.TryGetStoreDatas(m_storeModel.storeFuncType);
            if(shoplist == null)
            {
                DebugEx.Log("跨服商店数据为空");
System/CrossServerOneVsOne/CrossServerOneVsOneModel.cs
@@ -755,7 +755,7 @@
            var pkSeason = CrossServerOneVsOnePKSeason.Instance;
            if (!pkSeason.IsEnterCrossServer()) return;
            List<StoreModel.StoreData> storeDatas = storeModel.TryGetStoreDatas((int)StoreFunc.CrossOneVsOneHonor);
            List<StoreModel.StoreData> storeDatas = storeModel.TryGetStoreDatas(StoreFunc.CrossOneVsOneHonor);
            if (storeDatas != null)
            {
                for (int i = 0; i < storeDatas.Count; i++)
System/HappyXB/HappyXBModel.cs
@@ -20,8 +20,7 @@
        PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
  
        StoreModel _storeModel;
        StoreModel m_storeModel
        {
        StoreModel m_storeModel {
            get { return _storeModel ?? (_storeModel = ModelCenter.Instance.GetModel<StoreModel>()); }
        }
@@ -983,7 +982,7 @@
            ulong moneyNum = UIHelper.GetMoneyCnt(25);
            for(int i = 11; i < 14; i++)
            {
                storelist = m_storeModel.TryGetStoreDatas(i);
                storelist = m_storeModel.TryGetStoreDatas((StoreFunc)i);
                if(storelist.Count > 0)
                {
                    List<StoreModel.StoreData> orderlist = new List<StoreModel.StoreData>();
System/HappyXB/XBStoreWin.cs
@@ -108,7 +108,7 @@
        private void CreateShopCell()
        {
            shopCtrl.Refresh();
            shoplist = m_storeModel.TryGetStoreDatas((int)m_storeModel.storeFuncType);
            shoplist = m_storeModel.TryGetStoreDatas(m_storeModel.storeFuncType);
            if (shoplist.Count > 0)
            {
                int i = 0;
System/KnapSack/FBHelpPointExchageModel.cs
@@ -132,7 +132,7 @@
            if (type != PlayerDataRefresh.FBHelpPoint 
                || !FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Store)) return;
            var storeDatas = storeModel.TryGetStoreDatas((int)StoreFunc.IntegralStore);
            var storeDatas = storeModel.TryGetStoreDatas(StoreFunc.IntegralStore);
            if(storeDatas != null)
            {
                for(int i = 0; i < storeDatas.Count; i++)
System/KnapSack/Logic/LegendPropertyUtility.cs
@@ -226,7 +226,9 @@
            foreach (var item in json.Keys)
            {
                var type = (LegendAttrType)(int.Parse(item) - 1);
                propertyTypes[(int)json[item]] = type;
                var propertyId = 0;
                int.TryParse(json[item].ToString(), out propertyId);
                propertyTypes[propertyId] = type;
            }
            json = JsonMapper.ToObject(placeConfig);
@@ -239,12 +241,15 @@
                if (json[key].IsArray)
                {
                    var subJson = json[key];
                    foreach (var type in subJson.Keys)
                    for (var i = 0; i < subJson.Count; i++)
                    {
                        for (var i = 0; i < subJson[type].Count; i++)
                        if (subJson[i].IsArray)
                        {
                            var propertyId = (int)subJson[type][i];
                            for (var j = 0; j < subJson[i].Count; j++)
                            {
                                var propertyId = (int)subJson[i][j];
                            properties.Add(propertyId);
                            }
                        }
                    }
                }
@@ -358,10 +363,14 @@
                    var star = int.Parse(key);
                    var typeCounts = counts[star] = new Dictionary<LegendAttrType, int>();
                    var subJson = json[key];
                    foreach (var item in subJson.Keys)
                    if (subJson.IsArray)
                    {
                        var type = (LegendAttrType)(int.Parse(item));
                        typeCounts[type] = (int)subJson[item];
                        for (int i = 0; i < subJson.Count; i++)
                        {
                            var type = (LegendAttrType)(i);
                            typeCounts[type] = (int)subJson[i];
                        }
                    }
                }
            }
@@ -541,11 +550,16 @@
                    var count = subJson[propertyId].Count;
                    var values = new List<int>();
                    levelValues[int.Parse(propertyId)] = values;
                    foreach (var item in subJson[propertyId].Keys)
                    if (subJson[propertyId].IsArray)
                    {
                        values.Add((int)subJson[propertyId][item]);
                        for (var i = 0; i < subJson[propertyId].Count; i++)
                        {
                            values.Add((int)subJson[propertyId][i]);
                    }
                }
                }
            }
        }
System/KnapSack/New/FBHelpPointExchageNotify.cs
@@ -35,7 +35,7 @@
            storeModel.SetJumpModel(StoreFunc.IntegralStore, ExchageModel.currentShopId);
            switch ((StoreFunc)storeConfig.ShopType)
            {
                case StoreFunc.WeekStore:
                case StoreFunc.MysteryStore:
                    WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.StoreFunc1);
                    break;
                case StoreFunc.CommonStore:
System/MainInterfacePanel/HighSettingTip.cs
@@ -476,7 +476,7 @@
                || !storeModel.IsNewDay(storeModel.StoreEffectRecord_Key))
                return;
            var storeDatas = storeModel.TryGetStoreDatas((int)StoreFunc.WeekStore);
            var storeDatas = storeModel.TryGetStoreDatas(StoreFunc.MysteryStore);
            if (storeDatas != null
                && storeDatas.Count > 0 
                && !m_StoreEffect.IsPlaying)
System/Store/BagStoreWin.cs
@@ -79,7 +79,7 @@
                SuccessConfig successConfig = SuccessConfig.Get(AchievementGoto.guideAchievementId);
                if (successConfig.Type == 96)
                {
                    p_shopItemlist = m_storeModel.TryGetStoreDatas((int)m_storeModel.storeFuncType);
                    p_shopItemlist = m_storeModel.TryGetStoreDatas(m_storeModel.storeFuncType);
                    for (int i = 0; i < p_shopItemlist.Count; i++)
                    {
                        var storeData = p_shopItemlist[i];
System/Store/Logic/BuyItemInfoWin.cs
@@ -372,7 +372,7 @@
                int unionLv = PlayerDatas.Instance.fairyData.fairy.FamilyLV;
                switch (m_storeModel.storeFuncType)
                {
                    case StoreFunc.WeekStore:
                    case StoreFunc.MysteryStore:
                        break;
                    case StoreFunc.CommonStore:
                        break;
System/Store/Logic/BuyPetMatInfoWin.cs
@@ -342,7 +342,7 @@
                int unionLv = PlayerDatas.Instance.fairyData.fairy.FamilyLV;
                switch (m_storeModel.storeFuncType)
                {
                    case StoreFunc.WeekStore:
                    case StoreFunc.MysteryStore:
                        break;
                    case StoreFunc.CommonStore:
                        break;
System/Store/StoreModel.cs
@@ -40,19 +40,16 @@
    public Dictionary<int, int> showCoinsUIDict { get; private set; }
    public int storeTrailerLv { get; private set; }
    int mysteryRefreshedCount = 0;
    List<int> mysteryCommondities = new List<int>();
    bool isLogin = true;
    public event Action mysteryShopRefreshEvent;
    RuneModel runeModel { get { return ModelCenter.Instance.GetModel<RuneModel>(); } }
    PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
    ItemTipsModel itemTipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
    ItemTipsModel _itemTipsModel;
    ItemTipsModel itemTipsModel
    {
        get
        {
            return _itemTipsModel ?? (_itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>());
        }
    }
    private bool isUpdatePlayerLv;
    public override void Init()
@@ -92,7 +89,7 @@
        petAndMountPushlist.Clear();
        ClearPushData();
        tagTowerModel = null;
        storeFuncType = StoreFunc.WeekStore;
        storeFuncType = StoreFunc.MysteryStore;
        tcbRefreshDict.Clear();
     
    }
@@ -130,6 +127,45 @@
    public override void UnInit()
    {
        MainInterfaceWin.IsCopyOfThePanel -= OnMoveTopPart;
    }
    public void RefreshMysteryShop()
    {
        var consumablesOwn = 0;
        var consumablesNeed = 1;
        if (consumablesOwn >= consumablesNeed)
        {
            var info = new CA232_tagCMRefreshMysticalShop();
            GameNetSystem.Instance.SendInfo(info);
            return;
        }
        var moneyOwn = 0;
        var moneyNeed = 0;
        if (moneyOwn >= moneyNeed)
        {
            var info = new CA232_tagCMRefreshMysticalShop();
            GameNetSystem.Instance.SendInfo(info);
            return;
        }
        //去充值吧
    }
    public void UpdateMysteryCommondities(HA816_tagMCMysticalShopInfo info)
    {
        mysteryRefreshedCount = info.RefreshCnt;
        mysteryCommondities.Clear();
        foreach (var item in info.GoodsList)
        {
            mysteryCommondities.Add((int)item.GoodsID);
        }
        if (mysteryShopRefreshEvent != null)
        {
            mysteryShopRefreshEvent();
        }
    }
    #region 解析本地数据
@@ -381,10 +417,28 @@
        return false;
    }
    public List<StoreData> TryGetStoreDatas(int type)
    public List<StoreData> TryGetStoreDatas(StoreFunc type)
    {
        List<StoreData> datas = null;
        showStoreTypeDict.TryGetValue(type,out datas);
        if (showStoreTypeDict.TryGetValue((int)type, out datas))
        {
            switch (type)
            {
                case StoreFunc.MysteryStore:
                    for (var i = datas.Count - 1; i >= 0; i--)
                    {
                        var data = datas[i];
                        if (!mysteryCommondities.Contains(data.storeConfig.ID))
                        {
                            mysteryCommondities.RemoveAt(i);
                        }
                    }
                    break;
                default:
                    break;
            }
        }
        return datas;
    }
@@ -694,7 +748,7 @@
    public event Action RefreshBuyShopLimitEvent;
    public StoreFunc storeFuncType = StoreFunc.WeekStore;
    public StoreFunc storeFuncType = StoreFunc.MysteryStore;
    private Dictionary<uint, BuyShopItemLimit> shopItemlimitDict = new Dictionary<uint, BuyShopItemLimit>();
    private Dictionary<string, RuneTowerFloorConfig> tagTowerModel;
@@ -800,7 +854,7 @@
    public bool TryGetShopItemInfo(StoreFunc _type, int _id, out List<ShopItemInfo> _shopItems)
    {
        _shopItems = null;
        var _list = TryGetStoreDatas((int)_type);
        var _list = TryGetStoreDatas(_type);
        var _index = _list.FindIndex((x) =>
        {
            return x.shopId == _id;
@@ -981,10 +1035,8 @@
    {
        int playerTower = (int)runeModel.RuneTowerOpenLV;
        int offset = playerTower - limitTower;
        if (offset >= 0)
            return true;
        else
            return false;
        return offset >= 0;
    }
    public bool MoneyIsEnough(int moneyType, ulong money)
@@ -1026,8 +1078,6 @@
                ControllerRedPoint();
                break;
        }
    }
    public bool IsNewDay(string recordKey)
@@ -1517,7 +1567,7 @@
    {
        if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Store)) return;
        List<StoreData> storelist = TryGetStoreDatas((int)StoreFunc.BindStore);
        List<StoreData> storelist = TryGetStoreDatas(StoreFunc.BindStore);
        if (storelist == null) return;
        for(int i = 0; i < storelist.Count; i++)
@@ -1811,7 +1861,7 @@
public enum StoreFunc
{
    WeekStore = 1, //1:每周限购
    MysteryStore = 1, //1:每周限购
    CommonStore = 2, //2:常用道具
    GrowStrongerStore = 3, //3:成长变强
    BindStore = 4,  //4:绑玉商城
System/Store/StoreUIBasic.cs
@@ -53,7 +53,7 @@
         virtual protected void CreateShopItemCell(ScrollerController shopCtrl,int row)
        {
            shopCtrl.Refresh();
            p_shopItemlist = m_storeModel.TryGetStoreDatas((int)m_storeModel.storeFuncType);
            p_shopItemlist = m_storeModel.TryGetStoreDatas(m_storeModel.storeFuncType);
            if (p_shopItemlist.Count > 0)
            {
                int i = 0;
System/Store/StoreWin.cs
@@ -11,62 +11,35 @@
using Snxxz.UI;
namespace Snxxz.UI {
namespace Snxxz.UI
{
    public class StoreWin : Window
    {
        #region 成员变量
        [SerializeField]
        private FunctionButton _weekStoreTitle;
        [SerializeField]
        private FunctionButton _commonStoreTitle;
        [SerializeField]
        private FunctionButton _growStrongerStoreTitle;
        [SerializeField]
        private FunctionButton _bindStoreTitle;
        [SerializeField]
        private FunctionButton _integralStoreTitle;
        [SerializeField]
        private FunctionButtonGroup _funcBtnGroup;
        [SerializeField] FunctionButton m_WeekStoreTitle;
        [SerializeField] FunctionButton m_CommonStoreTitle;
        [SerializeField] FunctionButton m_GrowStrongerStoreTitle;
        [SerializeField] FunctionButton m_BindStoreTitle;
        [SerializeField] FunctionButton m_IntegralStoreTitle;
        [SerializeField] FunctionButtonGroup m_FuncBtnGroup;
        [SerializeField] Button m_LeftBtn;
        [SerializeField] Button m_RightBtn;
        [SerializeField] Button m_CloseBtn;
        [SerializeField] ScrollerController m_ShopCtrl;
        [SerializeField] GameObject m_FollowStoreBottom;
        [SerializeField] Text m_CoinsType1;
        [SerializeField] Text m_CoinsType2;
        [SerializeField] Text m_CoinsType3;
        [SerializeField] RectTransform m_RefreshContainer;
        [SerializeField] Button m_RefreshCommodities;
        [SerializeField] Text m_RefreshTimeText;
        [SerializeField] GameObject m_IntegralBottom;
        [SerializeField] Button m_AssistBtn;
        [SerializeField]
        private Button _leftBtn;
        StoreModel model { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
        [SerializeField]
        private Button _rightBtn;
        [SerializeField]
        private Button _closeBtn;
        [SerializeField]
        private ScrollerController _shopCtrl;
        [SerializeField]
        private GameObject _followStoreBottom;
        [SerializeField]
        private Text _coinsType1;
        [SerializeField]
        private Text _coinsType2;
        [SerializeField]
        private Text _resetRefreshTimeText;
        [SerializeField]
        private GameObject _integralBottom;
        [SerializeField]
        private Text _coinsType3;
        [SerializeField] Button assistBtn;
        #endregion
        StoreModel _storeModel;
        StoreModel m_storeModel
        {
            get { return _storeModel ?? (_storeModel = ModelCenter.Instance.GetModel<StoreModel>()); }
        }
        private List<StoreModel.StoreData> _tagStoreModellist;
        private FuncConfigConfig _tagFuncModel1;
        private FuncConfigConfig _tagFuncModel2;
        private List<StoreModel.StoreData> commodities;
        private int shopId = 0;
        #region Built-in
        protected override void BindController()
        {
@@ -74,28 +47,30 @@
        protected override void AddListeners()
        {
            _shopCtrl.OnRefreshCell += RefreshShopCell;
            _shopCtrl.lockType = EnhanceLockType.KeepVertical;
            m_ShopCtrl.OnRefreshCell += RefreshShopCell;
            m_ShopCtrl.lockType = EnhanceLockType.KeepVertical;
            _weekStoreTitle.onClick.AddListener(()=> { OnClickWeekStore(); });
            _commonStoreTitle.onClick.AddListener(()=> { OnClickCommonStore();});
            _growStrongerStoreTitle.onClick.AddListener(()=>{ OnClickStrengthStore();});
            _bindStoreTitle.onClick.AddListener(()=> { OnClickBindStore(); });
            _integralStoreTitle.onClick.AddListener(()=> { OnClickIntegralStore(); });
            _leftBtn.onClick.AddListener(OnClickLeftBtn);
            _rightBtn.onClick.AddListener(OnClickRightBtn);
            _closeBtn.onClick.AddListener(OnClickClose);
            assistBtn.AddListener(ClickAssistBtn);
            m_WeekStoreTitle.SetListener(OpenMysteryStore);
            m_CommonStoreTitle.SetListener(OpenCommonStore);
            m_GrowStrongerStoreTitle.SetListener(OpenStrengthStore);
            m_BindStoreTitle.SetListener(OpenBindGoldStore);
            m_IntegralStoreTitle.SetListener(OpenIntegralStore);
            m_AssistBtn.SetListener(ViewAssistRecorders);
            m_RefreshCommodities.SetListener(RefreshCommondities);
            m_LeftBtn.SetListener(() => { m_FuncBtnGroup.TriggerLast(); });
            m_RightBtn.SetListener(() => { m_FuncBtnGroup.TriggerNext(); });
            m_CloseBtn.SetListener(() => { CloseImmediately(); });
        }
        protected override void OnPreOpen()
        {
            shopId = 0;
            m_storeModel.RefreshTCBPlayerDataEvent += OnRefreshPlayerInfo;
            m_storeModel.RefreshBuyShopLimitEvent += OnCreate;
            model.RefreshTCBPlayerDataEvent += OnRefreshPlayerInfo;
            model.RefreshBuyShopLimitEvent += OnCreate;
            GlobalTimeEvent.Instance.secondEvent += UpdateRefreshTime;
            RefreshCoins();
            RefreshResetTime();
            m_storeModel.SetPushPetAndMountWinState(true,true);
            UpdateRefreshTime();
            model.SetPushPetAndMountWinState(true, true);
        }
        protected override void OnActived()
@@ -103,34 +78,34 @@
            base.OnActived();
            if(!WindowJumpMgr.Instance.IsJumpState && functionOrder == 0)
            {
                if(m_storeModel.storeFunc1Point.state == RedPointState.Simple)
                if (model.storeFunc1Point.state == RedPointState.Simple)
                {
                    functionOrder = _weekStoreTitle.order;
                    functionOrder = m_WeekStoreTitle.order;
                }
                else if(m_storeModel.storeFunc2Point.state == RedPointState.Simple)
                else if (model.storeFunc2Point.state == RedPointState.Simple)
                {
                    functionOrder = _commonStoreTitle.order;
                    functionOrder = m_CommonStoreTitle.order;
                }
                else if (m_storeModel.storeFunc3Point.state == RedPointState.Simple)
                else if (model.storeFunc3Point.state == RedPointState.Simple)
                {
                    functionOrder = _growStrongerStoreTitle.order;
                    functionOrder = m_GrowStrongerStoreTitle.order;
                }
                else if (m_storeModel.storeFunc4Point.state == RedPointState.Simple)
                else if (model.storeFunc4Point.state == RedPointState.Simple)
                {
                    functionOrder = _bindStoreTitle.order;
                    functionOrder = m_BindStoreTitle.order;
                }
                else if (m_storeModel.storeFunc5Point.state == RedPointState.Simple)
                else if (model.storeFunc5Point.state == RedPointState.Simple)
                {
                    functionOrder = _integralStoreTitle.order;
                    functionOrder = m_IntegralStoreTitle.order;
                }
            }
            if(!WindowJumpMgr.Instance.IsJumpState && m_storeModel.funcOrder != -1)
            if (!WindowJumpMgr.Instance.IsJumpState && model.funcOrder != -1)
            {
                functionOrder = m_storeModel.funcOrder;
                functionOrder = model.funcOrder;
            }
            _funcBtnGroup.TriggerByOrder(functionOrder);
            GlobalTimeEvent.Instance.secondEvent += RefreshResetTime;
            m_FuncBtnGroup.TriggerByOrder(functionOrder);
        }
        protected override void OnAfterOpen()
@@ -140,12 +115,11 @@
        protected override void OnPreClose()
        {
            m_storeModel.CloseAllRedpoint(StoreFunc.WeekStore);
            m_storeModel.storeFuncType = StoreFunc.WeekStore;
            m_storeModel.RefreshBuyShopLimitEvent -= OnCreate;
            GlobalTimeEvent.Instance.secondEvent -= RefreshResetTime;
            m_storeModel.RefreshTCBPlayerDataEvent -= OnRefreshPlayerInfo;
            model.CloseAllRedpoint(StoreFunc.MysteryStore);
            model.storeFuncType = StoreFunc.MysteryStore;
            model.RefreshBuyShopLimitEvent -= OnCreate;
            GlobalTimeEvent.Instance.secondEvent -= UpdateRefreshTime;
            model.RefreshTCBPlayerDataEvent -= OnRefreshPlayerInfo;
        }
        protected override void OnAfterClose()
@@ -161,21 +135,21 @@
        {
            if (AchievementGoto.guideAchievementId != 0)
            {
                SuccessConfig successConfig = SuccessConfig.Get(AchievementGoto.guideAchievementId);
                var successConfig = SuccessConfig.Get(AchievementGoto.guideAchievementId);
                if(successConfig.Type == 97)
                {
                    _tagStoreModellist = m_storeModel.TryGetStoreDatas((int)m_storeModel.storeFuncType);
                    commodities = model.TryGetStoreDatas(model.storeFuncType);
                    List<StoreModel.StoreData> orderlist = new List<StoreModel.StoreData>();
                    orderlist.AddRange(_tagStoreModellist);
                    orderlist.AddRange(commodities);
                    orderlist.Sort(CompareByMoney);
                    for (int i = 0; i < _tagStoreModellist.Count; i++)
                    for (int i = 0; i < commodities.Count; i++)
                    {
                        if (_tagStoreModellist[i].shopId == orderlist[0].shopId)
                        if (commodities[i].shopId == orderlist[0].shopId)
                        {
                            shopId = _tagStoreModellist[i].shopId;
                            shopId = commodities[i].shopId;
                            int index = i / 2;
                            _shopCtrl.JumpIndex(index);
                            _shopCtrl.m_Scorller.RefreshActiveCellViews();
                            m_ShopCtrl.JumpIndex(index);
                            m_ShopCtrl.m_Scorller.RefreshActiveCellViews();
                            break;
                        }
                    }
@@ -184,144 +158,159 @@
            }
            else
            {
                if(m_storeModel.jumpShopId != 0)
                if (model.jumpShopId != 0)
                {
                    _tagStoreModellist = m_storeModel.TryGetStoreDatas((int)m_storeModel.storeFuncType);
                    for (int i = 0; i < _tagStoreModellist.Count; i++)
                    commodities = model.TryGetStoreDatas(model.storeFuncType);
                    for (int i = 0; i < commodities.Count; i++)
                    {
                        if (_tagStoreModellist[i].shopId == m_storeModel.jumpShopId)
                        if (commodities[i].shopId == model.jumpShopId)
                        {
                            shopId = _tagStoreModellist[i].shopId;
                            shopId = commodities[i].shopId;
                            int index = i / 2 ;
                            _shopCtrl.JumpIndex(index > 2 ? index - 1 : index);
                            _shopCtrl.m_Scorller.RefreshActiveCellViews();
                            m_ShopCtrl.JumpIndex(index > 2 ? index - 1 : index);
                            m_ShopCtrl.m_Scorller.RefreshActiveCellViews();
                            break;
                        }
                    }
                    m_storeModel.ClearJumpModel();
                    model.ClearJumpModel();
                }
            }
        }
        private void RefreshResetTime()
        private void UpdateRefreshTime()
        {
            if(_tagStoreModellist == null || _tagStoreModellist.Count < 1)
            if (commodities == null || commodities.Count < 1)
            {
                _tagStoreModellist = m_storeModel.TryGetStoreDatas((int)m_storeModel.storeFuncType);
                commodities = model.TryGetStoreDatas(model.storeFuncType);
            }
            if(_tagStoreModellist.Count > 0)
            if (commodities == null || commodities.Count == 0)
            {
                if (_tagStoreModellist[0].storeConfig.RefreshType == 0)
                return;
            }
            var refreshType = commodities[0].storeConfig.RefreshType;
            if (refreshType == 0)
                {
                    _resetRefreshTimeText.gameObject.SetActive(false);
                m_RefreshContainer.gameObject.SetActive(false);
                }
                else
                {
                    _resetRefreshTimeText.gameObject.SetActive(true);
                    _resetRefreshTimeText.text = m_storeModel.GetStoreRefreshTimeByType(_tagStoreModellist[0].storeConfig.RefreshType);
                }
            }
                m_RefreshCommodities.gameObject.SetActive(model.storeFuncType == StoreFunc.MysteryStore);
                m_RefreshContainer.gameObject.SetActive(true);
                m_RefreshTimeText.text = model.GetStoreRefreshTimeByType(refreshType);
        }
        }
        public int CompareByMoney(StoreModel.StoreData start, StoreModel.StoreData end)
        int CompareByMoney(StoreModel.StoreData start, StoreModel.StoreData end)
        {
            int money1 = start.storeConfig.MoneyNumber;
            int money2 = end.storeConfig.MoneyNumber;
            if (money1.CompareTo(money2) != 0) return money1.CompareTo(money2);
            int index1 = _tagStoreModellist.IndexOf(start);
            int index2 = _tagStoreModellist.IndexOf(end);
            if (index1.CompareTo(index2) != 0) return index1.CompareTo(index2);
            if (money1 != money2)
            {
                return money1.CompareTo(money2);
            }
            int index1 = commodities.IndexOf(start);
            int index2 = commodities.IndexOf(end);
            if (index1 != index2)
            {
                return index1.CompareTo(index2);
            }
            return 0;
        }
        private void RefreshUI()
        {
            if (_tagStoreModellist.Count < 1)
            if (commodities.Count < 1)
            {
                return;
            if(m_storeModel.showCoinsUIDict != null && m_storeModel.showCoinsUIDict.ContainsKey(_tagStoreModellist[0].storeConfig.ShopType))
            {
                if(m_storeModel.showCoinsUIDict[_tagStoreModellist[0].storeConfig.ShopType] == 1)
                {
                    _followStoreBottom.gameObject.SetActive(true);
                    _integralBottom.gameObject.SetActive(false);
                }
                else if(m_storeModel.showCoinsUIDict[_tagStoreModellist[0].storeConfig.ShopType] == 2)
                {
                    _followStoreBottom.gameObject.SetActive(false);
                    _integralBottom.gameObject.SetActive(true);
                }
            }
            var shopType = commodities[0].storeConfig.ShopType;
            if (model.showCoinsUIDict != null && model.showCoinsUIDict.ContainsKey(shopType))
            {
                if (model.showCoinsUIDict[shopType] == 1)
                {
                    m_FollowStoreBottom.gameObject.SetActive(true);
                    m_IntegralBottom.gameObject.SetActive(false);
                }
                else if (model.showCoinsUIDict[shopType] == 2)
                {
                    m_FollowStoreBottom.gameObject.SetActive(false);
                    m_IntegralBottom.gameObject.SetActive(true);
                }
            }
        }
        public void RefreshCoins()
        {
            _coinsType1.text = UIHelper.GetMoneyCnt(1).ToString();
            _coinsType2.text = UIHelper.GetMoneyCnt(2).ToString();
            _coinsType3.text = UIHelper.ReplaceXianYuanCoinsNum(UIHelper.GetMoneyCnt(17));
            m_CoinsType1.text = UIHelper.GetMoneyCnt(1).ToString();
            m_CoinsType2.text = UIHelper.GetMoneyCnt(2).ToString();
            m_CoinsType3.text = UIHelper.ReplaceXianYuanCoinsNum(UIHelper.GetMoneyCnt(17));
        }
        private void OnCreate()
        {
            shopId = 0;
            _tagStoreModellist = m_storeModel.TryGetStoreDatas((int)m_storeModel.storeFuncType);
            _shopCtrl.Refresh();
            if (_tagStoreModellist.Count > 0)
            commodities = model.TryGetStoreDatas(model.storeFuncType);
            m_ShopCtrl.Refresh();
            if (commodities.Count > 0)
            {
                int i = 0;
                int remain = _tagStoreModellist.Count % 2;
                int line = (int)_tagStoreModellist.Count / 2;
                int remain = commodities.Count % 2;
                int line = (int)commodities.Count / 2;
                if (remain > 0)
                {
                    line += 1;
                }
                for (i = 0; i < line; i++)
                for (var i = 0; i < line; i++)
                {
                    _shopCtrl.AddCell(ScrollerDataType.Header, i);
                    m_ShopCtrl.AddCell(ScrollerDataType.Header, i);
                }
            }
            _shopCtrl.Restart();
            _shopCtrl.JumpIndex(0);
            m_ShopCtrl.Restart();
            m_ShopCtrl.JumpIndex(0);
            RefreshUI();
        }
        private void OnRefreshPlayerInfo(PlayerDataRefresh refreshType)
        {
            if (refreshType == PlayerDataRefresh.VIPLv)
            switch (refreshType)
            {
                case PlayerDataRefresh.VIPLv:
                OnCreate();
            else if (refreshType == PlayerDataRefresh.Gold)
                    break;
                case PlayerDataRefresh.Gold:
                case PlayerDataRefresh.GoldPaper:
                case PlayerDataRefresh.FBHelpPoint:
                RefreshCoins();
            else if (refreshType == PlayerDataRefresh.GoldPaper)
                RefreshCoins();
            else if(refreshType == PlayerDataRefresh.FBHelpPoint)
                RefreshCoins();
                    break;
                default:
                    break;
            }
        }
        private void RefreshShopCell(ScrollerDataType type, CellView cell)
        {
            int childCode = 0;
            for (childCode = 0; childCode < cell.transform.childCount; childCode++)
            for (var i = 0; i < cell.transform.childCount; i++)
            {
                int cellCount = (cell.transform.childCount) * cell.index + (childCode + 1);
                ShopItemCell shopItemCell = cell.transform.GetChild(childCode).GetComponent<ShopItemCell>();
                var cellCount = (cell.transform.childCount) * cell.index + (i + 1);
                var shopItemCell = cell.transform.GetChild(i).GetComponent<ShopItemCell>();
                if(shopItemCell == null)
                {
                    shopItemCell = cell.transform.GetChild(childCode).gameObject.AddComponent<ShopItemCell>();
                    shopItemCell = cell.transform.GetChild(i).gameObject.AddComponent<ShopItemCell>();
                }
                if (_tagStoreModellist.Count >= cellCount)
                if (commodities.Count >= cellCount)
                {
                    StoreConfig shopInfo = _tagStoreModellist[cellCount - 1].storeConfig;
                    if(m_storeModel.shopRedDict.ContainsKey(shopInfo.ID))
                    StoreConfig shopInfo = commodities[cellCount - 1].storeConfig;
                    if (model.shopRedDict.ContainsKey(shopInfo.ID))
                    {
                        shopItemCell.redpoint.redpointId = m_storeModel.shopRedDict[shopInfo.ID].id;
                        shopItemCell.redpoint.redpointId = model.shopRedDict[shopInfo.ID].id;
                    }
                    cell.transform.GetChild(childCode).gameObject.SetActive(true);
                    cell.transform.GetChild(i).gameObject.SetActive(true);
                    if (shopInfo.SalesStatus.Trim() != "")
                    {
                        shopItemCell.stateImage.gameObject.SetActive(true);
@@ -333,12 +322,12 @@
                        shopItemCell.stateImage.gameObject.SetActive(false);
                    }
                    ItemConfig chinModel = ItemConfig.Get(m_storeModel.GetReplaceId(shopInfo.ID,shopInfo.ItemID));
                    if(chinModel != null)
                    var config = ItemConfig.Get(model.GetReplaceId(shopInfo.ID, shopInfo.ItemID));
                    if (config != null)
                    {
                        ItemCellModel cellModel = new ItemCellModel(chinModel.ID,true,0,shopInfo.IsBind,"",PackType.Deleted,true);
                        ItemCellModel cellModel = new ItemCellModel(config.ID, true, 0, shopInfo.IsBind, "", PackType.Deleted, true);
                        shopItemCell.itemCell.Init(cellModel);
                        shopItemCell.itemNameText.text = chinModel.ItemName;
                        shopItemCell.itemNameText.text = config.ItemName;
                        shopItemCell.coinsIcon.SetIconWithMoneyType(shopInfo.MoneyType);
                        ulong shopCost = (ulong)(shopInfo.MoneyNumber);
                        shopItemCell.coinNumText.text = UIHelper.ReplaceLargeNum(shopCost);
@@ -374,7 +363,7 @@
                            if (canBuyCnt > 0)
                            {
                                shopItemCell.itemCell.countText.gameObject.SetActive(true);
                                BuyShopItemLimit shopItemLimit = m_storeModel.GetBuyShopLimit((uint)shopInfo.ID);
                                BuyShopItemLimit shopItemLimit = model.GetBuyShopLimit((uint)shopInfo.ID);
                                int remainNum = canBuyCnt;
                                if (shopItemLimit != null)
                                {
@@ -383,20 +372,19 @@
                                if (remainNum > 0)
                                {
                                    shopItemCell.itemCell.countText.text = StringUtility.Contact(remainNum.ToString(),
                                        "/" + canBuyCnt.ToString());
                                    shopItemCell.itemCell.countText.text = StringUtility.Contact(remainNum, "/" + canBuyCnt);
                                    shopItemCell.sellImage.gameObject.SetActive(false);
                                }
                                else
                                {
                                    shopItemCell.itemCell.countText.text = StringUtility.Contact(UIHelper.AppendStringColor(TextColType.Red, remainNum.ToString()),
                                        "/" + canBuyCnt.ToString());
                                    var remainNumDescription = UIHelper.AppendStringColor(TextColType.Red, remainNum.ToString());
                                    shopItemCell.itemCell.countText.text = StringUtility.Contact(remainNumDescription, "/", canBuyCnt);
                                    shopItemCell.sellImage.gameObject.SetActive(true);
                                    shopItemCell.stateImage.gameObject.SetActive(false);
                                }
                            }
                            shopItemCell.itemNameText.color = UIHelper.GetUIColor(chinModel.ItemColor,true);
                            shopItemCell.itemNameText.color = UIHelper.GetUIColor(config.ItemColor, true);
                            shopItemCell.vipText.color = UIHelper.GetUIColor(TextColType.Black,true);
                        }
@@ -404,90 +392,79 @@
                    }
                    shopItemCell.ShopCellBtn.RemoveAllListeners();
                    shopItemCell.ShopCellBtn.AddListener(()=> {
                    shopItemCell.ShopCellBtn.AddListener(() =>
                    {
                        if(shopInfo.ID == shopId)
                        {
                            shopId = 0;
                            shopItemCell.LoadGuidEffectCtrl(shopInfo.ID, shopId);
                        }
                        m_storeModel.CloseRedPoint(shopInfo);
                        m_storeModel.OnClickShopCell(shopInfo);
                        model.CloseRedPoint(shopInfo);
                        model.OnClickShopCell(shopInfo);
                    });
                }
                else
                {
                    cell.transform.GetChild(childCode).gameObject.SetActive(false);
                    cell.transform.GetChild(i).gameObject.SetActive(false);
                }
            }
        }
        #region 点击事件
        private void OnClickIntegralStore()
        private void OpenIntegralStore()
        {
            m_storeModel.CloseAllRedpoint(StoreFunc.IntegralStore);
            m_storeModel.storeFuncType = StoreFunc.IntegralStore;
            model.CloseAllRedpoint(StoreFunc.IntegralStore);
            model.storeFuncType = StoreFunc.IntegralStore;
            OnCreate();
            RefreshResetTime();
            functionOrder = _integralStoreTitle.order;
            UpdateRefreshTime();
            functionOrder = m_IntegralStoreTitle.order;
        }
        private void OnClickBindStore()
        private void OpenBindGoldStore()
        {
            m_storeModel.CloseAllRedpoint(StoreFunc.BindStore);
            m_storeModel.storeFuncType = StoreFunc.BindStore;
            model.CloseAllRedpoint(StoreFunc.BindStore);
            model.storeFuncType = StoreFunc.BindStore;
            OnCreate();
            RefreshResetTime();
            functionOrder = _bindStoreTitle.order;
            UpdateRefreshTime();
            functionOrder = m_BindStoreTitle.order;
        }
        private void OnClickStrengthStore()
        private void OpenStrengthStore()
        {
            m_storeModel.CloseAllRedpoint(StoreFunc.GrowStrongerStore);
            m_storeModel.storeFuncType = StoreFunc.GrowStrongerStore;
            model.CloseAllRedpoint(StoreFunc.GrowStrongerStore);
            model.storeFuncType = StoreFunc.GrowStrongerStore;
            OnCreate();
            RefreshResetTime();
            functionOrder = _growStrongerStoreTitle.order;
            UpdateRefreshTime();
            functionOrder = m_GrowStrongerStoreTitle.order;
        }
        private void OnClickCommonStore()
        private void OpenCommonStore()
        {
            m_storeModel.CloseAllRedpoint(StoreFunc.CommonStore);
            m_storeModel.storeFuncType = StoreFunc.CommonStore;
            model.CloseAllRedpoint(StoreFunc.CommonStore);
            model.storeFuncType = StoreFunc.CommonStore;
            OnCreate();
            RefreshResetTime();
            functionOrder = _commonStoreTitle.order;
            UpdateRefreshTime();
            functionOrder = m_CommonStoreTitle.order;
        }
        private void OnClickWeekStore()
        private void OpenMysteryStore()
        {
            m_storeModel.CloseAllRedpoint(StoreFunc.WeekStore);
            m_storeModel.storeFuncType = StoreFunc.WeekStore;
            model.CloseAllRedpoint(StoreFunc.MysteryStore);
            model.storeFuncType = StoreFunc.MysteryStore;
            OnCreate();
            RefreshResetTime();
            functionOrder = _weekStoreTitle.order;
            UpdateRefreshTime();
            functionOrder = m_WeekStoreTitle.order;
        }
        private void OnClickRightBtn()
        {
            _funcBtnGroup.TriggerNext();
        }
        private void OnClickLeftBtn()
        {
            _funcBtnGroup.TriggerLast();
        }
        private void OnClickClose()
        {
            CloseImmediately();
        }
        private void ClickAssistBtn()
        private void ViewAssistRecorders()
        {
            WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.DungeonAssitCheckIn);
        }
        #endregion
        private void RefreshCommondities()
        {
            model.RefreshMysteryShop();
        }
    }
}
System/Store/UnionStoreWin.cs
@@ -107,7 +107,7 @@
                SuccessConfig successConfig = SuccessConfig.Get(AchievementGoto.guideAchievementId);
                if (successConfig.Type == 97)
                {
                    p_shopItemlist = m_storeModel.TryGetStoreDatas((int)m_storeModel.storeFuncType);
                    p_shopItemlist = m_storeModel.TryGetStoreDatas(m_storeModel.storeFuncType);
                    List<StoreModel.StoreData> orderlist = new List<StoreModel.StoreData>();
                    orderlist.AddRange(p_shopItemlist);
                    orderlist.Sort(CompareByMoney);