| | |
| | | namespace Snxxz.UI
|
| | | { |
| | | |
| | | public class FullServiceAuctioncell : ScrollerUI
|
| | | public class FullServiceAuctioncell : MonoBehaviour
|
| | | {
|
| | | [SerializeField] GameObject m_NeedImage;//需要
|
| | | [SerializeField] GameObject m_ParticipateImage;//参与竞价
|
| | |
| | | AuctionHelpModel auctionHelpModel { get { return ModelCenter.Instance.GetModel<AuctionHelpModel>(); } }
|
| | | private AuctionItemConfig AuctionItem;
|
| | | private AuctionItemClass FullServiceAuction;
|
| | | public override void Refresh(CellView cell)
|
| | |
|
| | | public void GetFullServiceAuctionGUID(string GUID,int index)
|
| | | {
|
| | | m_NeedImage.SetActive(false);
|
| | | m_ParticipateImage.SetActive(false);
|
| | | m_BiddingTextObj.SetActive(false);
|
| | | m_HighestPriceImage.SetActive(false);
|
| | | m_EquipmentScoreObj.SetActive(false);
|
| | | var index = cell.index;
|
| | | if (index >= model.FullServiceAuctionList.Count)
|
| | | var indexList = model.FullServiceAuctionList.FindIndex((x) => { return x.ItemGUID == GUID; });
|
| | | if (indexList == -1)
|
| | | {
|
| | | DebugEx.LogError("超出数据存储范围");
|
| | | DebugEx.LogError("未查找到相应的列表数据");
|
| | | return;
|
| | | }
|
| | |
|
| | | var fullServiceAuction = model.FullServiceAuctionList[index];
|
| | | if (index == 1)
|
| | | {
|
| | | var sendNumber = AuctionInquiry.Instance.GetSendNumber();
|
| | | if (sendNumber != 0 && auctionHelpModel.Wait && model.QueryRemaining.DownBool)
|
| | | {
|
| | | AuctionInquiry.Instance.SendQueryAuction(string.Empty, sendNumber, 2);
|
| | | auctionHelpModel.Wait = false;
|
| | | }
|
| | | } else if (index== model.FullServiceAuctionList.Count-2)
|
| | | var fullServiceAuction = model.FullServiceAuctionList[indexList];
|
| | | if (index <5)
|
| | | {
|
| | | var sendNumber = AuctionInquiry.Instance.GetSendNumber();
|
| | | if (sendNumber != 0 && auctionHelpModel.Wait && model.QueryRemaining.UpBool)
|
| | | {
|
| | | AuctionInquiry.Instance.SendQueryAuction(string.Empty, sendNumber, 1);
|
| | | AuctionInquiry.Instance.SendQueryAuction(fullServiceAuction.ItemGUID, sendNumber, 2);
|
| | | auctionHelpModel.Wait = false;
|
| | | }
|
| | | }
|
| | | else if (index >= model.FullServiceAuctionList.Count - 3)
|
| | | {
|
| | | var sendNumber = AuctionInquiry.Instance.GetSendNumber();
|
| | | if (sendNumber != 0 && auctionHelpModel.Wait && model.QueryRemaining.DownBool)
|
| | | {
|
| | | AuctionInquiry.Instance.SendQueryAuction(fullServiceAuction.ItemGUID, sendNumber, 1);
|
| | | auctionHelpModel.Wait = false;
|
| | | }
|
| | | }
|
| | | FullServiceAuction = fullServiceAuction;
|
| | | var playerId = PlayerDatas.Instance.baseData.PlayerID;
|
| | | var auctionItem = AuctionItemConfig.Get(fullServiceAuction.ItemID); |
| | | var auctionItem = AuctionItemConfig.Get(fullServiceAuction.ItemID);
|
| | | var itemConfig = ItemConfig.Get(fullServiceAuction.ItemID);
|
| | | if (itemConfig == null)
|
| | | {
|
| | |
| | | }
|
| | | if (auctionItem == null)
|
| | | {
|
| | | DebugEx.LogError("拍卖物品表没有找到该物品,物品ID为"+ fullServiceAuction.ItemID);
|
| | | DebugEx.LogError("拍卖物品表没有找到该物品,物品ID为" + fullServiceAuction.ItemID);
|
| | | return;
|
| | | }
|
| | | AuctionItem = auctionItem;
|
| | |
| | | m_BiddingTextObj.SetActive(true);
|
| | | }
|
| | | }
|
| | | ItemCellModel cellModel = new ItemCellModel(fullServiceAuction.ItemID, true, |
| | | ItemCellModel cellModel = new ItemCellModel(fullServiceAuction.ItemID, true,
|
| | | (ulong)fullServiceAuction.ItemCount, itemConfig.BindType);
|
| | | m_ItemCell.Init(cellModel);
|
| | | m_ItemName.text = itemConfig.ItemName;
|
| | | if (itemConfig.EquipPlace != 0)
|
| | | {
|
| | | m_EquipmentScoreObj.SetActive(true);
|
| | | // m_Score.text
|
| | | // m_Score.text
|
| | | }
|
| | | int needJade = 0;
|
| | | if (fullServiceAuction.BidderPrice == 0)
|
| | |
| | | }
|
| | | m_JadeNumber.text = needJade.ToString();
|
| | | m_JadeNumber1.text = auctionItem.BuyoutPrice.ToString();
|
| | | m_PriceButton.SetListener(()=> //一口价
|
| | | m_PriceButton.SetListener(() => //一口价
|
| | | {
|
| | | int jade = (int)PlayerDatas.Instance.baseData.diamond;
|
| | | string str = "是否花费" + auctionItem.BuyoutPrice + "立即拍下商品?";
|
| | |
| | | });
|
| | | });
|
| | | m_JadeNumber2.text = needJade.ToString();
|
| | | m_BiddingButton.SetListener(()=> //竞价
|
| | | m_BiddingButton.SetListener(() => //竞价
|
| | | {
|
| | | int jade = (int)PlayerDatas.Instance.baseData.diamond;
|
| | | string str = "是否花费" + needJade + "参与竞价?";
|
| | |
| | | });
|
| | | });
|
| | | }
|
| | | //public override void Refresh(CellView cell)
|
| | | //{
|
| | | // m_NeedImage.SetActive(false);
|
| | | // m_ParticipateImage.SetActive(false);
|
| | | // m_BiddingTextObj.SetActive(false);
|
| | | // m_HighestPriceImage.SetActive(false);
|
| | | // m_EquipmentScoreObj.SetActive(false);
|
| | | // var index = cell.index;
|
| | | // if (index >= model.FullServiceAuctionList.Count)
|
| | | // {
|
| | | // DebugEx.LogError("超出数据存储范围");
|
| | | // return;
|
| | | // }
|
| | |
|
| | | // var fullServiceAuction = model.FullServiceAuctionList[index];
|
| | | // if (index == 1)
|
| | | // {
|
| | | // var sendNumber = AuctionInquiry.Instance.GetSendNumber();
|
| | | // if (sendNumber != 0 && auctionHelpModel.Wait && model.QueryRemaining.UpBool)
|
| | | // {
|
| | | // AuctionInquiry.Instance.SendQueryAuction(fullServiceAuction.ItemGUID, sendNumber, 2);
|
| | | // auctionHelpModel.Wait = false;
|
| | | // }
|
| | | // } else if (index== model.FullServiceAuctionList.Count-2)
|
| | | // {
|
| | | // var sendNumber = AuctionInquiry.Instance.GetSendNumber();
|
| | | // if (sendNumber != 0 && auctionHelpModel.Wait && model.QueryRemaining.DownBool)
|
| | | // {
|
| | | // AuctionInquiry.Instance.SendQueryAuction(fullServiceAuction.ItemGUID, sendNumber, 1);
|
| | | // auctionHelpModel.Wait = false;
|
| | | // }
|
| | | // }
|
| | | // FullServiceAuction = fullServiceAuction;
|
| | | // var playerId = PlayerDatas.Instance.baseData.PlayerID;
|
| | | // var auctionItem = AuctionItemConfig.Get(fullServiceAuction.ItemID); |
| | | // var itemConfig = ItemConfig.Get(fullServiceAuction.ItemID);
|
| | | // if (itemConfig == null)
|
| | | // {
|
| | | // DebugEx.LogError("物品表没有找到该物品,物品ID为" + fullServiceAuction.ItemID);
|
| | | // return;
|
| | | // }
|
| | | // if (auctionItem == null)
|
| | | // {
|
| | | // DebugEx.LogError("拍卖物品表没有找到该物品,物品ID为"+ fullServiceAuction.ItemID);
|
| | | // return;
|
| | | // }
|
| | | // AuctionItem = auctionItem;
|
| | | // if (model.BiddingItemInfoDic.ContainsKey(fullServiceAuction.ItemGUID))//参与了竞价的物品
|
| | | // {
|
| | | // var biddingItemInfo = model.BiddingItemInfoDic[fullServiceAuction.ItemGUID];
|
| | | // m_ParticipateImage.SetActive(true);
|
| | | // if (biddingItemInfo.BidderID == playerId)//判断是否最高竞价
|
| | | // {
|
| | | // m_HighestPriceImage.SetActive(true);
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // m_BiddingTextObj.SetActive(true);
|
| | | // }
|
| | | // }
|
| | | // ItemCellModel cellModel = new ItemCellModel(fullServiceAuction.ItemID, true, |
| | | // (ulong)fullServiceAuction.ItemCount, itemConfig.BindType);
|
| | | // m_ItemCell.Init(cellModel);
|
| | | // m_ItemName.text = itemConfig.ItemName;
|
| | | // if (itemConfig.EquipPlace != 0)
|
| | | // {
|
| | | // m_EquipmentScoreObj.SetActive(true);
|
| | | // // m_Score.text
|
| | | // }
|
| | | // int needJade = 0;
|
| | | // if (fullServiceAuction.BidderPrice == 0)
|
| | | // {
|
| | | // needJade = auctionItem.BasePrice;
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // needJade = fullServiceAuction.BidderPrice + auctionItem.BiddingAdd;
|
| | | // }
|
| | | // m_JadeNumber.text = needJade.ToString();
|
| | | // m_JadeNumber1.text = auctionItem.BuyoutPrice.ToString();
|
| | | // m_PriceButton.SetListener(()=> //一口价
|
| | | // {
|
| | | // int jade = (int)PlayerDatas.Instance.baseData.diamond;
|
| | | // string str = "是否花费" + auctionItem.BuyoutPrice + "立即拍下商品?";
|
| | | // ConfirmCancel.ShowPopConfirm(Language.Get("L1003"), str, (bool isOk) => {
|
| | | // if (jade >= auctionItem.BuyoutPrice)
|
| | | // {
|
| | | // AuctionInquiry.Instance.SendSellAuctionItem(fullServiceAuction.ItemGUID, auctionItem.BuyoutPrice);
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | // }
|
| | | // });
|
| | | // });
|
| | | // m_JadeNumber2.text = needJade.ToString();
|
| | | // m_BiddingButton.SetListener(()=> //竞价
|
| | | // {
|
| | | // int jade = (int)PlayerDatas.Instance.baseData.diamond;
|
| | | // string str = "是否花费" + needJade + "参与竞价?";
|
| | | // ConfirmCancel.ShowPopConfirm(Language.Get("L1003"), str, (bool isOk) => {
|
| | | // if (jade >= needJade)
|
| | | // {
|
| | | // AuctionInquiry.Instance.SendSellAuctionItem(fullServiceAuction.ItemGUID, needJade);
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | // }
|
| | | // });
|
| | | // });
|
| | | //}
|
| | | private void LateUpdate()
|
| | | {
|
| | | if (AuctionItem != null && FullServiceAuction != null)
|