This commit is contained in:
aozhiwei 2024-08-09 16:25:53 +08:00
parent 9c35f1e244
commit 42e8591392
5 changed files with 5 additions and 100 deletions

View File

@ -6,20 +6,6 @@ class OutAppNft(object):
def __init__(self): def __init__(self):
self.apis = [ self.apis = [
{
'name': 'getNftList',
'desc': 'nft列表',
'group': 'OutAppNft',
'url': 'webapp/index.php?c=OutAppNft&a=getNftList',
'params': [
['address', '', '钱包地址'],
['type', 0, '类型 1:英雄 6:gacha 7:勋章 8:星球'],
],
'response': [
_common.RspHead(),
['!nfts', [NftInfo()], 'nft列表'],
]
},
{ {
'name': 'getWebInfo', 'name': 'getWebInfo',
'desc': 'web信息', 'desc': 'web信息',

View File

@ -56,6 +56,7 @@
* 删除 c=BlockChain&a=getJumpInfo * 删除 c=BlockChain&a=getJumpInfo
* 删除 c=BlockChain&a=buyDiamond * 删除 c=BlockChain&a=buyDiamond
* 删除 c=BlockChain&a=buyMallProduct * 删除 c=BlockChain&a=buyMallProduct
* 删除 c=OutAppNft&a=getNftList
* *
* *
*/ */

View File

@ -1758,6 +1758,9 @@ class NftHeroDetailNew(object):
['def', 0, '攻击'], ['def', 0, '攻击'],
['block', 0, '格挡'], ['block', 0, '格挡'],
['crit', 0, '暴击'], ['crit', 0, '暴击'],
['chip_slots', 0, '芯片槽数'],
['combat_ability_1', '', '战斗能力1'],
['combat_ability_2', '', '战斗能力2'],
] ]
class NftGoldBullionDetail(object): class NftGoldBullionDetail(object):

View File

@ -341,6 +341,7 @@ class BigwheelController extends BaseAuthedController {
'property_chg' => $this->propertyChgService->toDto(), 'property_chg' => $this->propertyChgService->toDto(),
'info' => $info 'info' => $info
)); ));
//myself()->_fireEvent('Bigwheel', 'onBuyOk', $info);
} }
private function getMidDataKey() private function getMidDataKey()

View File

@ -14,40 +14,6 @@ use models\Hero;
class OutAppNftController extends BaseController { class OutAppNftController extends BaseController {
public function getNftList(){
$address = getReqVal('address', '');
$type = getReqVal('type', '');
if ($type){
$nftList = Nft::getNftListByType($address,$type);
}else{
$nftList = Nft::getNftList($address);
}
$listInfo = array();
if ($nftList){
foreach ($nftList as $nft) {
$image = 'https://www.cebg.games/res/avatars/' . $nft['item_id'] . '.png';
$full_image = 'https://www.cebg.games/res/avatars/full_' . $nft['item_id'] . '.png';
$info = array(
"idx" => $nft['idx'],
"owner_address" => $nft['owner_address'],
"item_id" => $nft['item_id'],
"token_id" => $nft['token_id'],
"token_type" => $nft['token_type'],
"contract_address" => $nft['contract_address'],
'image' => $image,
'full_image' => $full_image,
"details" => array(),
);
array_push($listInfo,$info);
}
}
$this->_rspData(array(
'nfts' => $listInfo,
));
}
public function getWebInfo(){ public function getWebInfo(){
$channel = getReqVal('channel', ''); $channel = getReqVal('channel', '');
$openId = getReqVal('openId', ''); $openId = getReqVal('openId', '');
@ -211,9 +177,6 @@ class OutAppNftController extends BaseController {
"trait_type" => "Luck Value", "trait_type" => "Luck Value",
"value" => floor($lucky * (1+$lucky_rate)), "value" => floor($lucky * (1+$lucky_rate)),
)); ));
if ($this->isCloseBox()) {
$this->fillBoxMeta($info);
}
} }
break; break;
case Nft::GOLD_BULLION_TYPE: case Nft::GOLD_BULLION_TYPE:
@ -223,9 +186,6 @@ class OutAppNftController extends BaseController {
$info['name'] = $nftMeta['name']; $info['name'] = $nftMeta['name'];
$info['description'] = $nftMeta['desc']; $info['description'] = $nftMeta['desc'];
$info['image'] = "https://res2.counterfire.games/nft/meta/".$nftDb['item_id'].".png"; $info['image'] = "https://res2.counterfire.games/nft/meta/".$nftDb['item_id'].".png";
if ($this->isCloseBox()) {
$this->fillBoxMeta($info);
}
} }
break; break;
} }
@ -355,9 +315,6 @@ class OutAppNftController extends BaseController {
$info['detail']['crit'] = $heroAbility['critical']; $info['detail']['crit'] = $heroAbility['critical'];
} }
} }
if ($this->isCloseBox()) {
$this->fillBoxDetail($info);
}
} }
break; break;
case Nft::GOLD_BULLION_TYPE: case Nft::GOLD_BULLION_TYPE:
@ -371,9 +328,6 @@ class OutAppNftController extends BaseController {
$info['image'] = 'https://res2.counterfire.games/nft/meta/' . $nftMeta['item_id'] . '.png'; $info['image'] = 'https://res2.counterfire.games/nft/meta/' . $nftMeta['item_id'] . '.png';
$info['detail']['gold_coins'] = $this->getGoldBullionGoldNum($nftDb['item_id']); $info['detail']['gold_coins'] = $this->getGoldBullionGoldNum($nftDb['item_id']);
} }
if ($this->isCloseBox()) {
$this->fillBoxDetail($info);
}
} }
break; break;
case Nft::FOUNDER_TAG_TYPE: case Nft::FOUNDER_TAG_TYPE:
@ -426,46 +380,6 @@ class OutAppNftController extends BaseController {
} }
} }
private function isCloseBox()
{
$tokenId = getReqVal('token_id', '');
if ($tokenId == '6240619010000001') {
return false;
}
$openTime = 1719828000 + 3600 * 24;
if (myself()->_getNowTime() < $openTime) {
if (SERVER_ENV == _ONLINE) {
return true;
}
}
return false;
}
private function fillBoxMeta(&$info)
{
$info['name'] = 'Genesis Hero';
$info['description'] = 'Genesis Hero';
$info['image'] = "https://res2.counterfire.games/nft/box/Gen2_raw.gif";
$info['attributes'] = array();
}
private function fillBoxDetail(&$info)
{
$info = array(
'net_id' => $info['net_id'],
'contract_address' => $info['contract_address'],
'token_id' => $info['token_id'],
'owner_address' => $info['owner_address'],
'meta_url' => $info['meta_url'],
'name' => 'Genesis Hero',
'item_id' => 0,
'type' => $info['type'],
'image' => "https://res2.counterfire.games/nft/box/Gen2_raw.gif",
'on_sale' => $info['on_sale'],
'detail' => array()
);
}
private function nftIsOnSale($netId, $contractAddress, $tokenId) private function nftIsOnSale($netId, $contractAddress, $tokenId)
{ {
$row = SqlHelper::ormSelectOne( $row = SqlHelper::ormSelectOne(