促销无法跳转打折

This commit is contained in:
xiaohui.wang 2022-04-15 16:54:10 +08:00
parent 86f23c9dc0
commit 816416a4f9
1 changed files with 3 additions and 1 deletions

View File

@ -43,12 +43,14 @@ public class ShopItemView : MonoBehaviour
{ {
m_shopData = shopData; m_shopData = shopData;
long dateNowTime = GameDataManager.GetTimeStamp(DateTime.Now); long dateNowTime = GameDataManager.GetTimeStamp(DateTime.Now);
DateTime dateTime = DateTime.Now;
if (GameDataManager.sale >= dateNowTime&&(ShopItemType)shopData.consumeType== ShopItemType.Consumable) if (GameDataManager.sale >= dateNowTime&&(ShopItemType)shopData.consumeType== ShopItemType.Consumable)
{ {
nomalPrice = shopData.price>nomalPrice?shopData.price:nomalPrice; nomalPrice = shopData.price>nomalPrice?shopData.price:nomalPrice;
shopData.price = (int)(nomalPrice * 0.8f); shopData.price = (int)(nomalPrice * 0.8f);
} }
else if (sale) else if (sale|| dateTime.Hour == JoypacUtils.OnlineParametersIntByJoypacSDK(StaticOnlineParams.SaleTime1) || dateTime.Hour == JoypacUtils.OnlineParametersIntByJoypacSDK(StaticOnlineParams.SaleTime2))
{ {
nomalPrice = shopData.price > nomalPrice ? shopData.price : nomalPrice; nomalPrice = shopData.price > nomalPrice ? shopData.price : nomalPrice;
shopData.price = (int)(nomalPrice * 0.8f); shopData.price = (int)(nomalPrice * 0.8f);