少年修仙传客户端代码仓库
hch
2025-06-12 204ef05a831c9484e2abc561d27ecbff7c797453
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using UnityEngine;
 
namespace vnxbqy.UI
{
    //福地-管理
    public class BlessedLandManageMouseButton : MonoBehaviour
    {
        [SerializeField] TextEx orgPrice;
        [SerializeField] ImageEx imgOnSale;
 
        [SerializeField] ButtonEx btnBuy;
        [SerializeField] TextEx txtOrgPrice;
        [SerializeField] TextEx txtPrice1;
        [SerializeField] TextEx txtPrice2;
        [SerializeField] TextEx txtHireDayCnt;
 
        BlessedLandModel blessedLandModel { get { return ModelCenter.Instance.GetModel<BlessedLandModel>(); } }
        VipModel vipModel { get { return ModelCenter.Instance.GetModelEx<VipModel>(); } }
        BlessedLandManageMouseModel model { get { return ModelCenter.Instance.GetModel<BlessedLandManageMouseModel>(); } }
 
        //type 1折的表现用图片还是下划线 1下划线 2 图片
        //index 管家档位购买对应充值ID列表中的1维索引
        public void Display(int type, int index)
        {
            if (model.butlerCTGArr.IsNullOrEmpty() || model.butlerCTGArr.Length <= index)
                return;
            if (model.butlerLevelDurationArr.IsNullOrEmpty() || model.butlerLevelDurationArr.Length <= index + 1)
                return;
 
            int ctgId = model.butlerCTGArr[index][0];
 
            bool isHasOrderInfo = vipModel.TryGetOrderInfo(ctgId, out var orderCfg);
            if (!isHasOrderInfo)
                return;
            string orgPriceEx = string.Empty;
            bool isHasOrgPrice = !model.orgPriceDict.IsNullOrEmpty() && model.orgPriceDict.TryGetValue(ctgId, out orgPriceEx);
            txtPrice1.SetActive(isHasOrgPrice);
            txtPrice2.SetActive(!isHasOrgPrice);
            txtOrgPrice.SetActive(isHasOrgPrice);
 
            float payRMBNum = orderCfg.PayRMBNum;
            orgPrice.SetActive(type == 1 && PlayerDatas.Instance.baseData.IsActive90Off);
            imgOnSale.SetActive(type == 2 && PlayerDatas.Instance.baseData.IsActive90Off);
 
            //隐藏0.1折显示
            orgPrice.SetActive(false);
            imgOnSale.SetActive(false);
 
            string payMoneyNum = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(payRMBNum));
            orgPrice.text = orderCfg.m_PayRMBNum.ToString();
            txtPrice1.text = payMoneyNum;
            txtPrice2.text = payMoneyNum;
            txtHireDayCnt.text = Language.Get("BlessedLand060", model.butlerLevelDurationArr[index + 1]);
 
            if (isHasOrgPrice)
            {
                txtOrgPrice.text = Language.Get("PayMoneyNum", UIHelper.GetMoneyFormat(double.Parse(orgPriceEx)));
            }
 
 
            btnBuy.SetListener(() =>
            {
                vipModel.CTG(ctgId);
            });
        }
    }
}