70 lines
1.7 KiB
JavaScript
70 lines
1.7 KiB
JavaScript
import { defineStore } from 'pinia';
|
|
import { ref } from 'vue';
|
|
// import { apiMarketplaceState } from "@/utils/marketplace"
|
|
|
|
export const useMarketplaceStore = defineStore('marketplace', () => {
|
|
const overview = ref('')
|
|
const sort = ref()
|
|
const minPrice = ref()
|
|
const maxPrice = ref()
|
|
const hero = ref([])
|
|
const rank = ref([])
|
|
const gold = ref([])
|
|
const status = ref([])
|
|
const cartList = ref()
|
|
const updateOverviewStatus = (_connected) => {
|
|
overview.value = _connected;
|
|
}
|
|
const updateSortStatus = (_connected) => {
|
|
sort.value = _connected;
|
|
}
|
|
const updateMinPriceStatus = (_connected) => {
|
|
minPrice.value = _connected;
|
|
}
|
|
const updateMaxPriceStatus = (_connected) => {
|
|
maxPrice.value = _connected;
|
|
}
|
|
const updateHeroStatus = (_connected) => {
|
|
hero.value = _connected;
|
|
}
|
|
const updateRankStatus = (_connected) => {
|
|
rank.value = _connected;
|
|
}
|
|
const updateGoldStatus = (_connected) => {
|
|
gold.value = _connected;
|
|
}
|
|
const updateStatusStatus = (_connected) => {
|
|
status.value = _connected;
|
|
}
|
|
|
|
// async function getMarketPlaceData() {
|
|
// const result = async apiMarketplaceState(13473,'0x8c10Ae04BF525734eaC00d5F7c062567461c207F')
|
|
// console.log(result)
|
|
// }
|
|
|
|
// actions: {
|
|
// const getCartList = async () => {
|
|
// return '可以'
|
|
// }
|
|
// }
|
|
const getCartList = async () => {
|
|
cartList.value = '可以'
|
|
}
|
|
|
|
return {
|
|
overview, updateOverviewStatus,
|
|
sort, updateSortStatus,
|
|
minPrice, updateMinPriceStatus,
|
|
maxPrice, updateMaxPriceStatus,
|
|
hero, updateHeroStatus,
|
|
rank, updateRankStatus,
|
|
gold, updateGoldStatus,
|
|
status, updateStatusStatus,
|
|
cartList, getCartList,
|
|
}
|
|
},
|
|
{
|
|
persist: true,
|
|
}
|
|
)
|