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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -543,8 +543,8 @@ export default class MyNft extends Vue {
let newArray = arry.map(function (index) {
return index + 1;
});
// this.jobFilters = newArray.join("|");
// this.getHeroNftList(this.pageSize);
this.jobFilters = newArray.join("|");
this.getHeroNftList(this.pageSize);
}
chipStatus(item: any) {
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) {
return index + 1;
});
// this.jobFilters = newArray.join("|");
// this.getHeroNftList(this.pageSize);
this.jobFilters = newArray.join("|");
this.getHeroNftList(this.pageSize);
}
heroLevelChange(levelSlider: any) {