Merge branch 'new-CounterFire' of http://git.kingsome.cn/huangjinming/CounterFireGames into new-CounterFire
This commit is contained in:
commit
ae8ab187e1
@ -112,7 +112,31 @@ const addCart = async (val) => {
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
let res = await marketplaceList.getCartListState()
|
||||
if (res.data && res.data.length) {
|
||||
let exists = res.data.find(item => {
|
||||
return item.nft.token_id == val.nft.token_id && item.nft.contract_address == val.nft.contract_address
|
||||
})
|
||||
if (exists) {
|
||||
message.error('already in the shopping cart')
|
||||
return
|
||||
}
|
||||
|
||||
const currency = res.data[0].event?.data?.buy[0].contract_address || ''
|
||||
const type = res.data[0].event?.data?.buy[0].item_type || ''
|
||||
const currentCurrency = val.event?.data?.buy[0].contract_address || ''
|
||||
const currentType = val.event?.data?.buy[0].item_type || ''
|
||||
|
||||
if (currency != currentCurrency || type != currentType) {
|
||||
// TODO: 提示用户添加相同类型的商品
|
||||
message.error('Please add the same type of item to the shopping cart')
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
const { errcode, errmsg } = await marketplaceList.addCartListState(data)
|
||||
console.log(errcode, errmsg)
|
||||
if(errcode == 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user