diff --git a/src/components/market/FilterLeft.vue b/src/components/market/FilterLeft.vue index 2a5616f..bfd29d0 100644 --- a/src/components/market/FilterLeft.vue +++ b/src/components/market/FilterLeft.vue @@ -26,6 +26,7 @@ @searchClear="searchClear" :value="value" :chipOptions="chipOptions" + @chipStatus="chipStatus" :chipList="chipList" :isType="isType" > @@ -33,6 +34,7 @@ v-else-if="nftType - 1 == 3" @searchClear="searchClear" :pieceList="pieceList" + @pieceStatus="pieceStatus" :pieceOptions="pieceOptions" :value="value" :isType="isType" @@ -57,8 +59,8 @@ export default { "chipList", "pieceList", "pieceOptions", - 'chipOptions', - 'weaponOptions' + "chipOptions", + "weaponOptions", ], components: { Herofilter, @@ -81,6 +83,12 @@ export default { jobStatus(item) { this.$emit("jobStatus", item); }, + chipStatus(item) { + this.$emit("chipStatus", item); + }, + pieceStatus(item) { + this.$emit("chipStatus", item); + }, heroLevelChange(levelSlider) { console.log(levelSlider, "levelSlider2"); this.$emit("heroLevelChange", levelSlider); diff --git a/src/components/market/MessageBox.vue b/src/components/market/MessageBox.vue index b55a6a5..b4bbf44 100644 --- a/src/components/market/MessageBox.vue +++ b/src/components/market/MessageBox.vue @@ -25,7 +25,7 @@ import Close from "./Close.vue"; export default { components: { Close }, - props: ["dialogVisible", "data", "isType"], + props: [ "data", "isType"], data() { return { dialogVisible: false, diff --git a/src/components/market/NftTypeBar.vue b/src/components/market/NftTypeBar.vue index 6c3a64e..dadc2fb 100644 --- a/src/components/market/NftTypeBar.vue +++ b/src/components/market/NftTypeBar.vue @@ -17,12 +17,12 @@ class="se" v-model="value" :popper-append-to-body="false" - @change="handSelect" + @change="handSortSelect" placeholder="请选择" popper-class="select-popper" > diff --git a/src/components/market/PropertySelect.vue b/src/components/market/PropertySelect.vue index 4aa3867..f6775fc 100644 --- a/src/components/market/PropertySelect.vue +++ b/src/components/market/PropertySelect.vue @@ -6,7 +6,7 @@ v-model="value" :popper-append-to-body="false" @change="handSelect" - placeholder="请选择" + placeholder="all" popper-class="select-popper" > { - // // 执行搜索请求 - // console.log(this.value); - // }, 1000); // 设置时间 + this.$emit("Search",this.value); }, disable(fn, delay) { let timer = null; diff --git a/src/components/market/filters/Chipfilter.vue b/src/components/market/filters/Chipfilter.vue index 5dddf9b..75d71b5 100644 --- a/src/components/market/filters/Chipfilter.vue +++ b/src/components/market/filters/Chipfilter.vue @@ -18,7 +18,7 @@
-
+
-
+
@@ -348,27 +352,47 @@ export default class MyNft extends Vue { label: "Trigger", }, { - value: 110240 , + value: 110240, label: "Ammo", }, { - value: 110250 , + value: 110250, label: "Bolt", }, - { - value: 110260 , + { + value: 110260, label: "Barrel", }, - { - value: 110270 , + { + value: 110270, label: "Grip", }, - { - value: 110280 , + { + value: 110280, label: "Clip", }, - - + ]; + sortOptions = [ + { + value: "1", + label: "Recently", + }, + { + value: "2", + label: "Highest Price", + }, + { + value: "3", + label: "Maximum Quality ", + }, + { + value: "4", + label: "Maximun Level ", + }, + { + value: "5", + label: "Maximum Energy", + }, ]; jobList = [ { @@ -462,12 +486,6 @@ export default class MyNft extends Vue { heroSearch(value: string) { this.searchFilters = value; debounce(this.getHeroNftList(this.currentPage), 2000); - // clearTimeout(this.timer); - // this.timer = setTimeout(() => { - // // 执行搜索请求 - // console.log(value, "-==-="); - - // }, 1000); // 设置时间 } searchClear(hero: string) { console.log(hero, "herio2020"); @@ -476,6 +494,10 @@ export default class MyNft extends Vue { this.searchFilters = value; this.getHeroNftList(this.currentPage); } + handSortSelect(value: string | number) { + this.orderMethod = value; + this.getHeroNftList(this.currentPage); + } jobStatus(item: any) { this.jobList[item.id].jobType = !this.jobList[item.id].jobType; @@ -485,13 +507,43 @@ export default class MyNft extends Vue { let arry = list.map((item) => { return item.id; }); - console.log(arry.join("|"), "list"); let newArray = arry.map(function (index) { return index + 1; }); this.jobFilters = newArray.join("|"); this.getHeroNftList(this.currentPage); } + pieceStatus(item: any) { + this.pieceList[item.id].jobType = !this.pieceList[item.id].jobType; + + let list = this.pieceList.filter((item) => { + return item.jobType == true; + }); + let arry = list.map((item) => { + return item.id; + }); + let newArray = arry.map(function (index) { + return index + 1; + }); + // this.jobFilters = newArray.join("|"); + // this.getHeroNftList(this.currentPage); + } + chipStatus(item: any) { + this.chipList[item.id].jobType = !this.chipList[item.id].jobType; + + let list = this.chipList.filter((item) => { + return item.jobType == true; + }); + let arry = list.map((item) => { + return item.id; + }); + let newArray = arry.map(function (index) { + return index + 1; + }); + // this.jobFilters = newArray.join("|"); + // this.getHeroNftList(this.currentPage); + } + heroLevelChange(levelSlider: any) { this.lvFilter = levelSlider; this.getHeroNftList(this.currentPage); @@ -512,7 +564,6 @@ export default class MyNft extends Vue { order_method: this.orderMethod, }; const res: any = await queryNftList(reqData); - console.log(res, "hero"); if (res.nfts) { let list = res.nfts; this.nftList = list.filter((item: any) => { @@ -533,7 +584,6 @@ export default class MyNft extends Vue { this.nftType = typeId; // this.fetchDatas(1); this.getHeroNftList(this.currentPage); - console.log("2222222222222"); } } sliderChange() {} @@ -558,9 +608,7 @@ export default class MyNft extends Vue { if (this.isLogin) { // this.fetchDatas(this.currentPage); this.checkOrderHistory(); - console.log("-----------------"); this.getHeroNftList(this.currentPage); - console.log("2222222222222"); } else { this.resetData(); }