From 01638bd36dd973e2e925b3b41045b157f3e64d4e Mon Sep 17 00:00:00 2001
From: client_Zxw <826696702@qq.com>
Date: 星期三, 10 十月 2018 15:48:19 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/Store/Logic/BuyBoxInfoWin.cs |   50 ++++++++++++++++----------------------------------
 1 files changed, 16 insertions(+), 34 deletions(-)

diff --git a/System/Store/Logic/BuyBoxInfoWin.cs b/System/Store/Logic/BuyBoxInfoWin.cs
index 3ba8b58..5e333ed 100644
--- a/System/Store/Logic/BuyBoxInfoWin.cs
+++ b/System/Store/Logic/BuyBoxInfoWin.cs
@@ -336,16 +336,7 @@
             int addBuyCnt = 0;
             bool isLimitCnt = buyItem.CheckIsLimitBuyCnt(buyItem.storeConfig,out canBuyCnt,out addBuyCnt);
             bool isReachUpper = false;
-            buyCnt = buyItem.GetCurBuyCnt(1, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
-            if (itemTipsModel.curAttrData.itemConfig.PackCount > 1)
-            {
-                numberGo.gameObject.SetActive(true);
-            }
-            else
-            {
-                numberGo.gameObject.SetActive(false);
-            }
-
+            buyCnt = buyItem.GetCurBuyCnt(1, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
             if(isVipBuy)
             {
                 if(nextVipIndex != -1)
@@ -365,7 +356,7 @@
                 else
                 {
                     buyBtn.gameObject.SetActive(false);
-                    buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, isVipBuy, out isReachUpper);
+                    buyCnt = buyItem.GetCurBuyCnt(0, canBuyCnt, out isReachUpper);
                 }
             }
             else
@@ -402,15 +393,24 @@
 
             if (_price <= 0)
             {
-                numberGo.gameObject.SetActive(false);
                 moneyRect.gameObject.SetActive(false);
                 buyBtnText.text = Language.Get("MailReceive");
             }
             else
             {
-                numberGo.gameObject.SetActive(true);
                 moneyRect.gameObject.SetActive(true);
                 buyBtnText.text = Language.Get("ItemHandle_buy");
+            }
+
+            if (_price <= 0 || itemTipsModel.curAttrData.itemConfig.PackCount < 2)
+            {
+                numberGo.gameObject.SetActive(false);
+              
+            }
+            else
+            {
+                numberGo.gameObject.SetActive(true);
+               
             }
         }
         #region 鐐瑰嚮浜嬩欢
@@ -419,28 +419,10 @@
             numKeyboard.gameObject.SetActive(true);
         }
 
-        private int GetRemainBuyCnt()
-        {
-            int haveBuyCnt = 0;
-            if (shopItemLimit != null)
-            {
-                haveBuyCnt = shopItemLimit.BuyCnt;
-            }
-            int remainCnt = canBuyCnt - haveBuyCnt;
-            if (remainCnt >= 0)
-            {
-                return remainCnt;
-            }
-            else
-            {
-                return 0;
-            }
-        }
-
         private void OnClickNum()
         {
             bool isReachUpper = false;
-            buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value),GetRemainBuyCnt(), isVipBuy,out isReachUpper);
+            buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value), buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy),out isReachUpper);
             RefreshBuyPrice(buyCnt);
             numKeyboard.Value = buyCnt.ToString();
             if (isReachUpper)
@@ -462,7 +444,7 @@
         {
             buyCnt += 1;
             bool isReachUpper = false;
-            buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
+            buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy), out isReachUpper);
             buyCountText.text = buyCnt.ToString();
             RefreshBuyPrice(buyCnt);
             if (isReachUpper)
@@ -475,7 +457,7 @@
         {
             buyCnt -= 1;
             bool isReachUpper = false;
-            buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy,out isReachUpper);
+            buyCnt = buyItem.GetCurBuyCnt(buyCnt, buyItem.GetRemainBuyCnt(canBuyCnt, shopItemLimit, isVipBuy),out isReachUpper);
             buyCountText.text = buyCnt.ToString();
             RefreshBuyPrice(buyCnt);
         }

--
Gitblit v1.8.0