修改金币卡筛选
This commit is contained in:
parent
3b36b36eb0
commit
de925ce596
@ -37,6 +37,7 @@ const overviewChild = (val) => {
|
||||
|
||||
const statusChild = (val) => {
|
||||
statusValue.value = val
|
||||
nftList.value = []
|
||||
getHistoryList()
|
||||
}
|
||||
|
||||
@ -77,6 +78,7 @@ const getHistoryList = async () => {
|
||||
sub.event.decimals = _data.decimals
|
||||
}
|
||||
}
|
||||
console.log(nftListBox)
|
||||
nftList.value = nftListBox
|
||||
}
|
||||
}
|
||||
|
@ -129,6 +129,7 @@ const clearOverviewAll = () => {
|
||||
marketplaceList.overview = ''
|
||||
toRaw(marketplaceList.getParamsData).search.name = ''
|
||||
reqData.value.search.name = ''
|
||||
marketplaceList.getParamsData.cursor = ''
|
||||
reqData.value.cursor = ''
|
||||
nftList.value = []
|
||||
getHeroData()
|
||||
@ -137,6 +138,7 @@ const overviewChild = (val) => {
|
||||
marketplaceList.overview = val
|
||||
toRaw(marketplaceList.getParamsData).search.name = val
|
||||
reqData.value.search.name = val
|
||||
marketplaceList.getParamsData.cursor = ''
|
||||
nftList.value = []
|
||||
getHeroData()
|
||||
}
|
||||
@ -145,6 +147,7 @@ const clearSortAll = () => {
|
||||
marketplaceList.sort = ''
|
||||
toRaw(marketplaceList.getParamsData).sort.fields[0].type = ''
|
||||
reqData.value.sort.fields[0].type = ''
|
||||
marketplaceList.getParamsData.cursor = ''
|
||||
reqData.value.cursor = ''
|
||||
nftList.value = []
|
||||
getHeroData()
|
||||
@ -155,6 +158,7 @@ const sortChild = (val) => {
|
||||
toRaw(marketplaceList.getParamsData).sort.fields[0].type = val
|
||||
reqData.value.sort.fields[0].type = val
|
||||
console.log(toRaw(marketplaceList.getParamsData).sort.fields[0].name)
|
||||
marketplaceList.getParamsData.cursor = ''
|
||||
nftList.value = []
|
||||
getHeroData()
|
||||
}
|
||||
@ -168,15 +172,17 @@ const clearPriceAll = () => {
|
||||
reqData.value.filter.price_min = ''
|
||||
reqData.value.filter.price_max = ''
|
||||
reqData.value.cursor = ''
|
||||
// nftList.value = []
|
||||
// getHeroData()
|
||||
marketplaceList.getParamsData.cursor = ''
|
||||
nftList.value = []
|
||||
getHeroData()
|
||||
}
|
||||
const priceChild = (minPrice, maxPrice) => {
|
||||
toRaw(marketplaceList.getParamsData).filter.price_min = minPrice
|
||||
toRaw(marketplaceList.getParamsData).filter.price_max = maxPrice
|
||||
toRaw(marketplaceList.getParamsData).filter.price_min = minPrice ? Number(minPrice) * 1e6 : ''
|
||||
toRaw(marketplaceList.getParamsData).filter.price_max = maxPrice ? Number(maxPrice) * 1e6 : ''
|
||||
toRaw(reqData.value).filter.price_min = minPrice ? Number(minPrice) * 1e6 : ''
|
||||
toRaw(reqData.value).filter.price_max = maxPrice ? Number(maxPrice) * 1e6 : ''
|
||||
reqData.value.cursor = ''
|
||||
marketplaceList.getParamsData.cursor = ''
|
||||
nftList.value = []
|
||||
getHeroData()
|
||||
}
|
||||
@ -186,6 +192,7 @@ const clearHeroAll = () => {
|
||||
reqData.value.filter.item_ids = [...marketplaceList.gold,...marketplaceList.hero]
|
||||
toRaw(marketplaceList.getParamsData).filter.item_ids = [...marketplaceList.gold,...marketplaceList.hero]
|
||||
reqData.value.cursor = ''
|
||||
marketplaceList.getParamsData.cursor = ''
|
||||
nftList.value = []
|
||||
getHeroData()
|
||||
}
|
||||
@ -193,6 +200,7 @@ const heroChild = (val) => {
|
||||
marketplaceList.hero = val
|
||||
reqData.value.filter.item_ids = [...marketplaceList.gold,...marketplaceList.hero]
|
||||
toRaw(marketplaceList.getParamsData).filter.item_ids = [...marketplaceList.gold,...marketplaceList.hero]
|
||||
marketplaceList.getParamsData.cursor = ''
|
||||
nftList.value = []
|
||||
getHeroData()
|
||||
}
|
||||
@ -202,6 +210,7 @@ const clearRankAll = () => {
|
||||
reqData.value.filter.hero_ranks = []
|
||||
toRaw(marketplaceList.getParamsData).filter.hero_ranks = []
|
||||
reqData.value.cursor = ''
|
||||
marketplaceList.getParamsData.cursor = ''
|
||||
nftList.value = []
|
||||
getHeroData()
|
||||
}
|
||||
@ -209,6 +218,7 @@ const rankChild = (val) => {
|
||||
marketplaceList.rank = val
|
||||
reqData.value.filter.hero_ranks = val
|
||||
toRaw(marketplaceList.getParamsData).filter.hero_ranks = val
|
||||
marketplaceList.getParamsData.cursor = ''
|
||||
nftList.value = []
|
||||
getHeroData()
|
||||
}
|
||||
@ -217,6 +227,7 @@ const clearGoldAll = () => {
|
||||
marketplaceList.gold = []
|
||||
reqData.value.filter.item_ids.filter.item_ids = [...marketplaceList.gold,...marketplaceList.hero]
|
||||
toRaw(marketplaceList.getParamsData).filter.item_ids = [...marketplaceList.gold,...marketplaceList.hero]
|
||||
marketplaceList.getParamsData.cursor = ''
|
||||
nftList.value = []
|
||||
getHeroData()
|
||||
}
|
||||
@ -224,6 +235,7 @@ const goldChild = (val) => {
|
||||
marketplaceList.gold = val
|
||||
reqData.value.filter.item_ids = [...marketplaceList.gold,...marketplaceList.hero]
|
||||
toRaw(marketplaceList.getParamsData).filter.item_ids = [...marketplaceList.gold,...marketplaceList.hero]
|
||||
marketplaceList.getParamsData.cursor = ''
|
||||
nftList.value = []
|
||||
getHeroData()
|
||||
}
|
||||
@ -236,7 +248,8 @@ const clearAll = () => {
|
||||
marketplaceList.hero = []
|
||||
marketplaceList.rank = []
|
||||
marketplaceList.gold = []
|
||||
reqData.value = {
|
||||
marketplaceList.getParamsData.cursor = ''
|
||||
marketplaceList.getParamsData = {
|
||||
page_size: 20,
|
||||
cursor: '',
|
||||
search: {
|
||||
@ -282,18 +295,18 @@ const getHeroData = async () => {
|
||||
try {
|
||||
let nftListBox
|
||||
// const { errcode, errmsg, rows, page } = await marketplaceList.getMarketplaceState(reqData.value)
|
||||
const { errcode, errmsg, rows, page } = await apiMarketplaceState(reqData.value)
|
||||
const { errcode, errmsg, rows, page } = await apiMarketplaceState(marketplaceList.getParamsData)
|
||||
// console.log((toRaw(marketplaceList.cursorObj))
|
||||
if(!errmsg) {
|
||||
nftList.value = [...nftList.value, ...rows]
|
||||
// nftList.value = Array.from(new Set(nftList.value.map(JSON.stringify))).map(JSON.parse);
|
||||
nftListBox = nftList.value.reduce((acc, obj) => {
|
||||
const existingObj = acc.find(item => item.event == obj.event)
|
||||
if(!existingObj) {
|
||||
acc.push(obj)
|
||||
}
|
||||
return acc
|
||||
},[])
|
||||
nftListBox = Array.from(new Set(nftList.value.map(JSON.stringify))).map(JSON.parse);
|
||||
// nftListBox = nftList.value.reduce((acc, obj) => {
|
||||
// const existingObj = acc.find(item => item.event == obj.event)
|
||||
// if(!existingObj) {
|
||||
// acc.push(obj)
|
||||
// }
|
||||
// return acc
|
||||
// },[])
|
||||
nftList.value = nftListBox
|
||||
totalCount.value = page.total_count
|
||||
cursorObj.value = page
|
||||
@ -328,7 +341,9 @@ const marketHandleScroll = () => {
|
||||
if (scrollTop + windowHeight == scrollHeight) {
|
||||
//请求数据接口
|
||||
if(toRaw(cursorObj.value).remaining != 0) {
|
||||
toRaw(reqData.value).cursor = toRaw(cursorObj.value).next_cursor
|
||||
// marketplaceList.getParamsData.cursor = ''
|
||||
// toRaw(reqData.value).cursor
|
||||
marketplaceList.getParamsData.cursor = toRaw(cursorObj.value).next_cursor
|
||||
getHeroData()
|
||||
} else {
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user