|
@@ -63,7 +63,7 @@ void IAPCtlShopUI::clear() {
|
|
|
_cb = nullptr;
|
|
|
}
|
|
|
|
|
|
-bool IAPCtlShopUI::create(Node* pNode, IAPConf* cfg, iap::ShopRequirement& requirement,int placementId) {
|
|
|
+bool IAPCtlShopUI::create(Node* pNode, IAPConf* cfg, iapshop::ShopRequirement& requirement,int placementId) {
|
|
|
redutils::Platform::getInstance()->reportLog("open iap");
|
|
|
_cfg = cfg;
|
|
|
_bUIShowing = true;
|
|
@@ -134,7 +134,7 @@ void IAPCtlShopUI::showSlideCardsByCoinsIn(cocos2d::Node *pNode, int stillNeedCo
|
|
|
pNode->addChild(cardView);
|
|
|
}
|
|
|
|
|
|
-bool IAPCtlShopUI::addAPlacement(const iap::IAPPlacement &plInfo){
|
|
|
+bool IAPCtlShopUI::addAPlacement(const iapshop::IAPPlacement &plInfo){
|
|
|
// 如果该活动ID存在,则添加失败
|
|
|
if(_placements.count(plInfo.id) != 0)return false;
|
|
|
|
|
@@ -153,7 +153,7 @@ void IAPCtlShopUI::removePlacement(const std::string &id){
|
|
|
|
|
|
}
|
|
|
|
|
|
-bool IAPCtlShopUI::addCardToPlacement(const std::string &id, iap::IAPCard *card){
|
|
|
+bool IAPCtlShopUI::addCardToPlacement(const std::string &id, iapshop::IAPCard *card){
|
|
|
if(_placements.count(id) == 0)return false;
|
|
|
_placements[id].cards.push_back(card);
|
|
|
return true;
|
|
@@ -198,7 +198,7 @@ void IAPCtlShopUI::_onNotifyDevelopment(const redutils::ReboltNotifyData& data)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-void IAPCtlShopUI::constructShopItem(bool bShowAll, iap::ShopRequirement& requirement) {
|
|
|
+void IAPCtlShopUI::constructShopItem(bool bShowAll, iapshop::ShopRequirement& requirement) {
|
|
|
int index = 0;
|
|
|
_tableData.setCascadeOpacity(true);
|
|
|
_tableData.clear();
|
|
@@ -221,9 +221,9 @@ void IAPCtlShopUI::constructShopItem(bool bShowAll, iap::ShopRequirement& requir
|
|
|
IAPConf::getInstance()->getAllGoods(_goodsInfo);
|
|
|
// 获取版位信息
|
|
|
int bigPackCount,smallPackCount; // 需要显示的礼包
|
|
|
- auto iapCtlShop = iap::IAPCtlShop::createWith();
|
|
|
- auto userBuyType = iap::IAPRunTimeData::getInstance()->getUserBuyType();
|
|
|
- int leval = iap::IAPRunTimeData::getInstance()->getDeviceLevel(); //获取设备等级
|
|
|
+ auto iapCtlShop = iapshop::IAPCtlShop::createWith();
|
|
|
+ auto userBuyType = iapshop::IAPRunTimeData::getInstance()->getUserBuyType();
|
|
|
+ int leval = iapshop::IAPRunTimeData::getInstance()->getDeviceLevel(); //获取设备等级
|
|
|
size_t placementCount = iapCtlShop->getPlacementCount(); // 获取活动礼包数量
|
|
|
switch(leval){
|
|
|
case 1:
|
|
@@ -292,16 +292,16 @@ void IAPCtlShopUI::constructShopItem(bool bShowAll, iap::ShopRequirement& requir
|
|
|
}
|
|
|
// 根据用户类型进行礼包排序
|
|
|
switch (userBuyType) {
|
|
|
- case iap::UserBuyType::NoShopping:
|
|
|
+ case iapshop::UserBuyType::NoShopping:
|
|
|
sortGoods(true);
|
|
|
break;
|
|
|
- case iap::UserBuyType::LittleShopping:
|
|
|
+ case iapshop::UserBuyType::LittleShopping:
|
|
|
sortGoods(true);
|
|
|
break;
|
|
|
- case iap::UserBuyType::NormalShopping:
|
|
|
+ case iapshop::UserBuyType::NormalShopping:
|
|
|
sortGoods(true);
|
|
|
break;
|
|
|
- case iap::UserBuyType::LotShopping:
|
|
|
+ case iapshop::UserBuyType::LotShopping:
|
|
|
sortGoods(false);
|
|
|
break;
|
|
|
default:
|
|
@@ -313,10 +313,10 @@ void IAPCtlShopUI::constructShopItem(bool bShowAll, iap::ShopRequirement& requir
|
|
|
filterGoods(requirement);
|
|
|
}
|
|
|
// 判断是否为正常消费
|
|
|
- if(userBuyType == iap::UserBuyType::NormalShopping && !bShowAll){
|
|
|
+ if(userBuyType == iapshop::UserBuyType::NormalShopping && !bShowAll){
|
|
|
// (当前已按 大礼包 > 小礼包,金额小 > 金额大 的优先级排序)
|
|
|
// 获取购买过的最大金额
|
|
|
- float maxn = iap::IAPRunTimeData::getInstance()->getUserBuyMaxAmount();
|
|
|
+ float maxn = iapshop::IAPRunTimeData::getInstance()->getUserBuyMaxAmount();
|
|
|
// 构建大礼包
|
|
|
if(bigPackCount == 2){
|
|
|
// 查找购买过的最高金额更高一级对应的常规礼包
|
|
@@ -538,7 +538,7 @@ void IAPCtlShopUI::constructShopItem(bool bShowAll, iap::ShopRequirement& requir
|
|
|
}
|
|
|
_allSizes.clear();
|
|
|
|
|
|
- iap::ShopRequirement req;
|
|
|
+ iapshop::ShopRequirement req;
|
|
|
req.coinsMin = 0;
|
|
|
constructShopItem(true, req);
|
|
|
|
|
@@ -584,7 +584,7 @@ void IAPCtlShopUI::constructShopItem(bool bShowAll, iap::ShopRequirement& requir
|
|
|
}, 0.05, "SCH_Update_Cells");
|
|
|
}
|
|
|
|
|
|
-Node* IAPCtlShopUI::createPlacementUI(const iap::IAPPlacement& placement){
|
|
|
+Node* IAPCtlShopUI::createPlacementUI(const iapshop::IAPPlacement& placement){
|
|
|
Node* node = Node::create();
|
|
|
|
|
|
IAPCardView::sDotCfg cfg;
|
|
@@ -609,7 +609,7 @@ Node* IAPCtlShopUI::createPlacementUI(const iap::IAPPlacement& placement){
|
|
|
return node;
|
|
|
}
|
|
|
|
|
|
-void IAPCtlShopUI::filterGoods(iap::ShopRequirement &requirement){
|
|
|
+void IAPCtlShopUI::filterGoods(iapshop::ShopRequirement &requirement){
|
|
|
std::map<int, bool> m;
|
|
|
int cnt = 0;
|
|
|
for(const auto& goodInfo : _goodsInfo){
|