This commit is contained in:
huangjinming 2022-12-16 10:20:24 +08:00
parent 8ddceee2d7
commit de066a9cc6
9 changed files with 122 additions and 59 deletions

View File

@ -18,6 +18,8 @@
:selectValue="selectValue" :selectValue="selectValue"
:options="options" :options="options"
:isType="isType" :isType="isType"
:priceMax="priceMax"
:priceMin="priceMin"
></Herofilter> ></Herofilter>
<Weaponfilter <Weaponfilter
v-else-if="nftType - 1 == 1" v-else-if="nftType - 1 == 1"
@ -33,6 +35,8 @@
:value="value" :value="value"
:weaponOptions="weaponOptions" :weaponOptions="weaponOptions"
:isType="isType" :isType="isType"
:priceMax="priceMax"
:priceMin="priceMin"
></Weaponfilter> ></Weaponfilter>
<Chipfilter <Chipfilter
v-else-if="nftType - 1 == 2" v-else-if="nftType - 1 == 2"
@ -48,6 +52,8 @@
:chipOptions="chipOptions" :chipOptions="chipOptions"
:chipList="chipList" :chipList="chipList"
:isType="isType" :isType="isType"
:priceMax="priceMax"
:priceMin="priceMin"
></Chipfilter> ></Chipfilter>
<Piecefilter <Piecefilter
v-else-if="nftType - 1 == 3" v-else-if="nftType - 1 == 3"
@ -62,6 +68,8 @@
:pieceOptions="pieceOptions" :pieceOptions="pieceOptions"
:value="value" :value="value"
:isType="isType" :isType="isType"
:priceMax="priceMax"
:priceMin="priceMin"
></Piecefilter> ></Piecefilter>
</div> </div>
</template> </template>
@ -73,6 +81,8 @@ import Chipfilter from "@/components/market/filters/Chipfilter";
import Piecefilter from "@/components/market/filters/Piecefilter"; import Piecefilter from "@/components/market/filters/Piecefilter";
export default { export default {
props: [ props: [
'priceMax',
'priceMin',
"nftType", "nftType",
"value", "value",
"isType", "isType",
@ -165,9 +175,9 @@ export default {
handPriceMin(value) { handPriceMin(value) {
this.$emit("handPriceMin", value); this.$emit("handPriceMin", value);
}, },
handPriceFilter() { handPriceFilter() {
this.$emit("handPriceFilter"); this.$emit("handPriceFilter");
} },
}, },
}; };
</script> </script>

View File

@ -35,7 +35,12 @@
<span class="level-name">Amount</span> <span class="level-name">Amount</span>
<!-- <span class="level-number">04</span> --> <!-- <span class="level-number">04</span> -->
</div> </div>
<div class="piece-number">{{ piece.balance }}</div> <div class="piece-number" v-if="isType == 'mynft'">
{{ piece.balance }}
</div>
<div class="piece-number" v-else>
<span> {{ balance }}</span>
</div>
</div> </div>
</div> </div>
<div class="owner"> <div class="owner">
@ -63,7 +68,7 @@
<div class="maeket" v-else> <div class="maeket" v-else>
<div class="price"> <div class="price">
<span class="price-number">{{ <span class="price-number">{{
data.s_price ? data.s_price : " " piece.s_price ? piece.s_price : " "
}}</span> }}</span>
</div> </div>
<div> <div>
@ -106,10 +111,21 @@ export default {
}, },
computed: { computed: {
time() { time() {
return formatSelect(this.piece.modifytime); if (this.piece.modifytime) {
return formatSelect(this.piece.modifytime);
}
}, },
owner() { owner() {
return formatAddress(this.piece.owner_address); if (this.piece.owner_address) {
return formatAddress(this.piece.owner_address);
}
},
balance() {
if (this.piece.detail) {
return this.piece.detail.balance;
} else {
return this.piece.balance;
}
}, },
}, },
methods: { methods: {
@ -124,6 +140,7 @@ export default {
this.dialogVisible = true; this.dialogVisible = true;
this.piece = data; this.piece = data;
console.log(data, "dfgdg"); console.log(data, "dfgdg");
console.log(this.piece.detail.balance, "this.piece.detail.balance");
}, },
handPutShow() { handPutShow() {
this.$emit("handPutShow"); this.$emit("handPutShow");

View File

@ -57,7 +57,9 @@
<div class="filterbottom"> <div class="filterbottom">
<PriceFilter <PriceFilter
v-show="isType !== 'mynft'" v-show="isType !== 'mynft'"
@priceFilter="priceFilter" @handPriceFilter="handPriceFilter"
@handPriceMax="handPriceMax"
@handPriceMin="handPriceMin"
:priceMin="priceMin" :priceMin="priceMin"
:priceMax="priceMax" :priceMax="priceMax"
/> />
@ -71,7 +73,7 @@ import SearchInput from "../SearchInput";
import PriceFilter from "../PriceFilter.vue"; import PriceFilter from "../PriceFilter.vue";
import PropertySelect from "../PropertySelect.vue"; import PropertySelect from "../PropertySelect.vue";
export default { export default {
props: ["value", "isType", "chipList", "chipOptions"], props: ["value", "isType", "chipList", "chipOptions", "priceMax", "priceMin"],
components: { components: {
Slider, Slider,
SearchInput, SearchInput,
@ -81,8 +83,6 @@ export default {
data() { data() {
return { return {
hero: "", hero: "",
priceMin: "",
priceMax: "",
jobList: [ jobList: [
{ {
id: 0, id: 0,
@ -150,9 +150,14 @@ export default {
sliderChange() { sliderChange() {
this.$emit("sliderChange", value); this.$emit("sliderChange", value);
}, },
priceFilter() { handPriceMax(value) {
this.priceMin = ""; this.$emit("handPriceMax", value);
this.priceMax = ""; },
handPriceMin(value) {
this.$emit("handPriceMin", value);
},
handPriceFilter() {
this.$emit("handPriceFilter");
}, },
handChipSelect(value) { handChipSelect(value) {
this.$emit("handChipSelect", value); this.$emit("handChipSelect", value);
@ -160,9 +165,9 @@ export default {
chipSearch(value) { chipSearch(value) {
this.$emit("chipSearch", value); this.$emit("chipSearch", value);
}, },
chipLevelChange(value){ chipLevelChange(value) {
this.$emit("chipLevelChange", value); this.$emit("chipLevelChange", value);
} },
}, },
}; };
</script> </script>

View File

@ -92,7 +92,7 @@
<div class="filterbottom"> <div class="filterbottom">
<PriceFilter <PriceFilter
v-show="isType !== 'mynft'" v-show="isType !== 'mynft'"
@priceFilter="priceFilter" @handPriceFilter="handPriceFilter"
@handPriceMax="handPriceMax" @handPriceMax="handPriceMax"
@handPriceMin="handPriceMin" @handPriceMin="handPriceMin"
:priceMin="priceMin" :priceMin="priceMin"
@ -108,7 +108,16 @@ import SearchInput from "../SearchInput";
import PriceFilter from "../PriceFilter.vue"; import PriceFilter from "../PriceFilter.vue";
import PropertySelect from "../PropertySelect.vue"; import PropertySelect from "../PropertySelect.vue";
export default { export default {
props: ["value", "isType", "options", "selectValue", "jobList", "heroValue"], props: [
"value",
"isType",
"options",
"selectValue",
"jobList",
"heroValue",
"priceMax",
"priceMin",
],
components: { components: {
Slider, Slider,
PriceFilter, PriceFilter,
@ -118,23 +127,23 @@ export default {
data() { data() {
return { return {
hero: "", hero: "",
priceMin: "",
priceMax: "",
}; };
}, },
methods: { methods: {
handPriceMax(value) { handPriceMax(value) {
this.$emit('handPriceMax',value) this.$emit("handPriceMax", value);
}, },
handPriceMin(value) { handPriceMin(value) {
this.$emit('handPriceMin',value) this.$emit("handPriceMin", value);
},
handPriceFilter() {
this.$emit("handPriceFilter");
}, },
jobStatus(item) { jobStatus(item) {
this.$emit("jobStatus", item); this.$emit("jobStatus", item);
}, },
heroSearch(value) { heroSearch(value) {
console.log(value, "-==-=3");
this.$emit("heroSearch", value); this.$emit("heroSearch", value);
}, },
searchClear(hero) { searchClear(hero) {
@ -143,10 +152,6 @@ export default {
sliderChange() { sliderChange() {
this.$emit("sliderChange", value); this.$emit("sliderChange", value);
}, },
priceFilter() {
this.priceMin = "";
this.priceMax = "";
},
handSelect(value) { handSelect(value) {
this.$emit("handSelect", value); this.$emit("handSelect", value);
}, },

View File

@ -57,7 +57,9 @@
<div class="filterbottom"> <div class="filterbottom">
<PriceFilter <PriceFilter
v-show="isType !== 'mynft'" v-show="isType !== 'mynft'"
@priceFilter="priceFilter" @handPriceFilter="handPriceFilter"
@handPriceMax="handPriceMax"
@handPriceMin="handPriceMin"
:priceMin="priceMin" :priceMin="priceMin"
:priceMax="priceMax" :priceMax="priceMax"
/> />
@ -71,7 +73,14 @@ import SearchInput from "../SearchInput";
import PriceFilter from "../PriceFilter.vue"; import PriceFilter from "../PriceFilter.vue";
import PropertySelect from "../PropertySelect.vue"; import PropertySelect from "../PropertySelect.vue";
export default { export default {
props: ["value", "isType", "pieceList", "pieceOptions"], props: [
"value",
"isType",
"pieceList",
"pieceOptions",
"priceMax",
"priceMin",
],
components: { components: {
Slider, Slider,
SearchInput, SearchInput,
@ -81,8 +90,6 @@ export default {
data() { data() {
return { return {
hero: "", hero: "",
priceMin: "",
priceMax: "",
jobList: [ jobList: [
{ {
id: 0, id: 0,
@ -149,12 +156,17 @@ export default {
sliderChange() { sliderChange() {
this.$emit("sliderChange", value); this.$emit("sliderChange", value);
}, },
priceFilter() { handPriceMax(value) {
this.priceMin = ""; this.$emit("handPriceMax", value);
this.priceMax = ""; },
handPriceMin(value) {
this.$emit("handPriceMin", value);
},
handPriceFilter() {
this.$emit("handPriceFilter");
}, },
pieceSearch(value) { pieceSearch(value) {
this.$emit("pieceSearch",value); this.$emit("pieceSearch", value);
}, },
handPieceSelect(value) { handPieceSelect(value) {
this.$emit("handPieceSelect", value); this.$emit("handPieceSelect", value);

View File

@ -69,7 +69,9 @@
<div class="filterbottom"> <div class="filterbottom">
<PriceFilter <PriceFilter
v-show="isType !== 'mynft'" v-show="isType !== 'mynft'"
@priceFilter="priceFilter" @handPriceFilter="handPriceFilter"
@handPriceMax="handPriceMax"
@handPriceMin="handPriceMin"
:priceMin="priceMin" :priceMin="priceMin"
:priceMax="priceMax" :priceMax="priceMax"
/> />
@ -83,7 +85,7 @@ import SearchInput from "../SearchInput";
import PriceFilter from "../PriceFilter.vue"; import PriceFilter from "../PriceFilter.vue";
import PropertySelect from "../PropertySelect.vue"; import PropertySelect from "../PropertySelect.vue";
export default { export default {
props: ["value", , "isType", "weaponOptions"], props: ["value", , "isType", "weaponOptions", "priceMin", "priceMax"],
components: { components: {
SearchInput, SearchInput,
Slider, Slider,
@ -93,8 +95,6 @@ export default {
data() { data() {
return { return {
hero: "", hero: "",
priceMin: "",
priceMax: "",
jobList: [ jobList: [
{ {
id: 0, id: 0,
@ -164,9 +164,14 @@ export default {
sliderChange() { sliderChange() {
this.$emit("sliderChange", value); this.$emit("sliderChange", value);
}, },
priceFilter() { handPriceMax(value) {
this.priceMin = ""; this.$emit("handPriceMax", value);
this.priceMax = ""; },
handPriceMin(value) {
this.$emit("handPriceMin", value);
},
handPriceFilter() {
this.$emit("handPriceFilter");
}, },
handWeaponSelect(value) { handWeaponSelect(value) {
// console.log(value); // console.log(value);

View File

@ -20,7 +20,11 @@
:src="require('@/assets/market/piece/piece_' + '01' + '.png')" :src="require('@/assets/market/piece/piece_' + '01' + '.png')"
alt="" alt=""
/> />
<span class="amount">Amount{{ piece.balance }}</span> <span class="amount"
>Amount{{
piece.balance ? piece.balance : piece.detail.balance
}}</span
>
</div> </div>
<div class="level-content"> <div class="level-content">
<!-- <div class="level-lv"> <!-- <div class="level-lv">
@ -290,7 +294,6 @@ export default {
position: absolute; position: absolute;
right: 11px; right: 11px;
bottom: -78px; bottom: -78px;
} }
} }
.tree-guard { .tree-guard {

View File

@ -38,6 +38,8 @@
:chipOptions="chipOptions" :chipOptions="chipOptions"
:nft-type="nftType" :nft-type="nftType"
:value="value" :value="value"
:priceMax="priceMax"
:priceMin="priceMin"
></FilterLeft> ></FilterLeft>
<div class="right-part"> <div class="right-part">
<nft-type-bar <nft-type-bar
@ -106,6 +108,8 @@ export default class Market extends Vue {
private durabilityFilter: any = null; private durabilityFilter: any = null;
private orderMethod: any = 0; private orderMethod: any = 0;
private priceFilter: any = "0|10000"; private priceFilter: any = "0|10000";
private priceMax = 10000;
private priceMin = 0;
private options = [ private options = [
{ {
@ -485,8 +489,8 @@ export default class Market extends Vue {
let newArray = arry.map(function (index) { let newArray = arry.map(function (index) {
return index + 1; return index + 1;
}); });
// this.jobFilters = newArray.join("|"); this.jobFilters = newArray.join("|");
// this.getHeroNftList(this.pageSize); this.getHeroNftList(this.pageSize);
} }
chipStatus(item: any) { chipStatus(item: any) {
this.chipList[item.id].jobType = !this.chipList[item.id].jobType; this.chipList[item.id].jobType = !this.chipList[item.id].jobType;
@ -500,8 +504,8 @@ export default class Market extends Vue {
let newArray = arry.map(function (index) { let newArray = arry.map(function (index) {
return index + 1; return index + 1;
}); });
// this.jobFilters = newArray.join("|"); this.jobFilters = newArray.join("|");
// this.getHeroNftList(this.pageSize); this.getHeroNftList(this.pageSize);
} }
heroLevelChange(levelSlider: any) { heroLevelChange(levelSlider: any) {
@ -553,15 +557,19 @@ export default class Market extends Vue {
this.searchFilters = value; this.searchFilters = value;
this.debounce(); this.debounce();
} }
handPieceSelect() {} handPieceSelect(value:any) {
this.searchFilters = value;
this.getHeroNftList(this.pageSize);
}
handPriceMax(value: any) { handPriceMax(value: any) {
this.$emit("handPriceMax", value); this.priceMax = value;
} }
handPriceMin(value: any) { handPriceMin(value: any) {
this.$emit("handPriceMin", value); this.priceMin = value;
} }
handPriceFilter() { handPriceFilter() {
this.$emit("priceFilter"); this.priceFilter = this.priceMin + "|" + this.priceMax;
this.getHeroNftList(this.pageSize);
} }
async getHeroNftList(pageNo: number) { async getHeroNftList(pageNo: number) {
if (!AppModule.accountId) { if (!AppModule.accountId) {
@ -571,11 +579,11 @@ export default class Market extends Vue {
page_size: pageNo, page_size: pageNo,
type: this.nftType == 4 ? 5 : this.nftType, type: this.nftType == 4 ? 5 : this.nftType,
account: "0x9a4d9dd2bfcad659975f0f5a480625c7929e9385", account: "0x9a4d9dd2bfcad659975f0f5a480625c7929e9385",
job_filters: this.jobFilters, job_filters:this.nftType == 2 ||this.nftType == 5? null: this.jobFilters,
search_filters: this.searchFilters, search_filters: this.searchFilters,
quality_filter: this.qualityFilter, quality_filter: this.qualityFilter,
durability_filter: this.durabilityFilter, durability_filter: this.durabilityFilter,
lv_filter: this.lvFilter, lv_filter: this.lvFilter,
order_asc: this.orderAsc, order_asc: this.orderAsc,
order_method: this.orderMethod, order_method: this.orderMethod,
price_filter: this.priceFilter, price_filter: this.priceFilter,
@ -602,8 +610,6 @@ export default class Market extends Vue {
if (this.isLogin) { if (this.isLogin) {
// this.fetchDatas(this.pageSize); // this.fetchDatas(this.pageSize);
// this.checkOrderHistory(); // this.checkOrderHistory();
console.log("-----------------");
this.getHeroNftList(this.pageSize); this.getHeroNftList(this.pageSize);
console.log("2222222222222"); console.log("2222222222222");
} else { } else {

View File

@ -543,8 +543,8 @@ export default class MyNft extends Vue {
let newArray = arry.map(function (index) { let newArray = arry.map(function (index) {
return index + 1; return index + 1;
}); });
// this.jobFilters = newArray.join("|"); this.jobFilters = newArray.join("|");
// this.getHeroNftList(this.pageSize); this.getHeroNftList(this.pageSize);
} }
chipStatus(item: any) { chipStatus(item: any) {
this.chipList[item.id].jobType = !this.chipList[item.id].jobType; this.chipList[item.id].jobType = !this.chipList[item.id].jobType;
@ -558,8 +558,8 @@ export default class MyNft extends Vue {
let newArray = arry.map(function (index) { let newArray = arry.map(function (index) {
return index + 1; return index + 1;
}); });
// this.jobFilters = newArray.join("|"); this.jobFilters = newArray.join("|");
// this.getHeroNftList(this.pageSize); this.getHeroNftList(this.pageSize);
} }
heroLevelChange(levelSlider: any) { heroLevelChange(levelSlider: any) {