|
@@ -99,41 +99,6 @@ bool IAPCtlShopUI::create(Node* pNode, IAPConf* cfg, iapshop::ShopRequirement& r
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-void IAPCtlShopUI::showSlideCardsByCoinsIn(cocos2d::Node *pNode, int stillNeedCoins){
|
|
|
- clear();
|
|
|
-
|
|
|
- IAPCardView::sDotCfg cfg;
|
|
|
- cfg.hightSp = "内购版位_通用_图标_滑动点_已选中.png";
|
|
|
- cfg.normalSp = "内购版位_通用_图标_滑动点_未选中.png";
|
|
|
- cfg.sepWidth = 30.0f;
|
|
|
- cfg.yStart = 0;
|
|
|
-
|
|
|
- IAPConf::getInstance()->getAllGoods(_goodsInfo);
|
|
|
- float h = 0.0;
|
|
|
- for(const auto& goodInfo : _goodsInfo){
|
|
|
- h = std::max(h, goodInfo.sz.height);
|
|
|
- }
|
|
|
-
|
|
|
- auto visibleSize = Director::getInstance()->getVisibleSize();
|
|
|
- float width = visibleSize.width;
|
|
|
- cocos2d::Size sz = cocos2d::Size(width, h + 10);
|
|
|
-
|
|
|
- IAPCardView* cardView = IAPCardView::create(sz, cfg);
|
|
|
- cardView->setPosition(Vec2(cardView->getPosition()) + Vec2(0, 20));
|
|
|
-
|
|
|
- IAPTestCardViewDelegate* cardViewDelegate = new IAPTestCardViewDelegate();
|
|
|
- cardView->setDelegate(cardViewDelegate);
|
|
|
-
|
|
|
- for (const auto& goodInfo : _goodsInfo) {
|
|
|
- if(goodInfo.getCoinNumber() < stillNeedCoins)continue;
|
|
|
- auto item = IAPCtlShopItem::create(goodInfo, 1);
|
|
|
- _failItems.push_back(item);
|
|
|
- cardView->addCard(item);
|
|
|
- }
|
|
|
-
|
|
|
- pNode->addChild(cardView);
|
|
|
-}
|
|
|
-
|
|
|
bool IAPCtlShopUI::addAPlacement(const iapshop::IAPPlacement &plInfo){
|
|
|
// 如果该活动ID存在,则添加失败
|
|
|
if(_placements.count(plInfo.id) != 0)return false;
|