This commit is contained in:
huangjinming 2022-12-21 16:01:54 +08:00
parent 454dff9194
commit 8a841d8d26
15 changed files with 165 additions and 48 deletions

View File

@ -108,4 +108,10 @@ export const queryPhase3Box = (data: any) =>
url: 'webapp/index.php?c=Market&a=listSellNfts', url: 'webapp/index.php?c=Market&a=listSellNfts',
method: 'get', method: 'get',
params: data params: data
})
export const sellMyNft = (data: any) =>
request({
url: 'webapp/index.php?c=Market&a=sellMyNft',
method: 'get',
params: data
}) })

View File

@ -24,17 +24,29 @@ export default {
methods: { methods: {
// -- // --
formatSelect(value) { formatSelect(value) {
console.log(value,'date'); console.log(value, "date");
let date = new Date(value * 1000); let date = new Date(value * 1000);
console.log(date,'date'); console.log(date, "date");
let year = date.getUTCFullYear(); let year = date.getUTCFullYear();
let month = date.getUTCMonth(); let month = date.getUTCMonth() + 1;
let day = date.getUTCDate(); let day = date.getUTCDate();
let hour = date.getUTCHours(); let hour = date.getUTCHours();
let minute = date.getUTCMinutes(); let minute = date.getUTCMinutes();
let second = date.getUTCSeconds(); let second = date.getUTCSeconds();
return year + "-" + month + "-" + day +' ' +hour+':'+minute+':'+second; return (
year +
"-" +
month +
"-" +
day +
" " +
hour +
":" +
minute +
":" +
second
);
}, },
}, },
computed: { computed: {

View File

@ -1,7 +1,21 @@
<template> <template>
<div> <div>
<div class="piece-top"> <div class="piece-top">
<div class="piece-left"></div> <div class="piece-left">
<div class="piece-img">
<img
v-if="data.item_id"
width="97px"
:src="
require('@/assets/market/chip/details/' +
data.item_id +
'_full.png')
"
alt=""
/>
</div>
<div class="name">{{ data.detail.chip_name }}</div>
</div>
<div class="piece-right"> <div class="piece-right">
<div class="userinfo"> <div class="userinfo">
<div class="srabded"> <div class="srabded">
@ -10,7 +24,7 @@
</div> </div>
<div class="token-id"> <div class="token-id">
<div>Token id</div> <div>Token id</div>
<div>#3006985843100103</div> <div>#{{ data.token_id }}</div>
</div> </div>
<div class="amount"> <div class="amount">
<div>Amount</div> <div>Amount</div>
@ -39,7 +53,9 @@
</template> </template>
<script> <script>
export default {}; export default {
props: ["data"],
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -65,16 +81,14 @@ export default {};
margin-right: 12px; margin-right: 12px;
// margin-top: 9px; // margin-top: 9px;
} }
.srabded{ .srabded {
margin-top: 9px; margin-top: 9px;
} }
.token-id{ .token-id {
margin-top: 7px; margin-top: 7px;
} }
.amount { .amount {
margin-top: 7px; margin-top: 7px;
} }
} }
.sellers { .sellers {
@ -105,8 +119,8 @@ export default {};
margin-left: 20px; margin-left: 20px;
} }
.service-img { .service-img {
display: flex; display: flex;
align-items: center; align-items: center;
margin-left: 17px; margin-left: 17px;
margin-right: 45px; margin-right: 45px;
} }
@ -121,5 +135,13 @@ export default {};
height: 150px; height: 150px;
background: url("../../assets/market/chip/bg-there.png") no-repeat; background: url("../../assets/market/chip/bg-there.png") no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
.piece-img {
margin-top: 20px;
margin-left: 21px;
}
.name{
width: 100%;
text-align: center;
}
} }
</style> </style>

View File

@ -10,7 +10,7 @@
</div> </div>
<div class="token-id"> <div class="token-id">
<div>Token id</div> <div>Token id</div>
<div>#3006985843100103</div> <div>#{{ data.detail.token_id }}</div>
</div> </div>
<div class="amount"> <div class="amount">
<div>Amount</div> <div>Amount</div>
@ -39,7 +39,9 @@
</template> </template>
<script> <script>
export default {}; export default {
props: ["data"],
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -10,7 +10,7 @@
</div> </div>
<div class="token-id"> <div class="token-id">
<div>Token id</div> <div>Token id</div>
<div>#3006985843100103</div> <div>#{{ data.token_id }}</div>
</div> </div>
<!-- <div class="amount"> <!-- <div class="amount">
<div>Amount</div> <div>Amount</div>
@ -49,19 +49,18 @@
<script> <script>
export default { export default {
props: ["data",'cunout'],
data() { data() {
return { return {
cunout: 0,
}; };
}, },
methods: { methods: {
handReduce() { handReduce() {
if (this.cunout > 0) { this.$emit("handReduce");
this.cunout--;
}
}, },
handPlus() { handPlus() {
this.cunout++; this.$emit("handPlus");
}, },
}, },
}; };
@ -116,8 +115,8 @@ export default {
margin-left: 20px; margin-left: 20px;
} }
.service-img { .service-img {
display: flex; display: flex;
align-items: center; align-items: center;
margin-left: 17px; margin-left: 17px;
margin-right: 45px; margin-right: 45px;
} }

View File

@ -14,7 +14,7 @@
alt="" alt=""
/> />
<img <img
v-else v-else-if="piece.item_id"
width="214px" width="214px"
:src=" :src="
require('@/assets/market/piece/details/' + require('@/assets/market/piece/details/' +
@ -156,7 +156,7 @@ export default {
console.log(this.piece.detail.balance, "this.piece.detail.balance"); console.log(this.piece.detail.balance, "this.piece.detail.balance");
}, },
handPutShow() { handPutShow() {
this.$emit("handPutShow"); this.$emit("handPutShow",this.piece);
console.log("ppwowerw"); console.log("ppwowerw");
}, },
showTip() { showTip() {

View File

@ -3,14 +3,20 @@
<div class="bg"></div> <div class="bg"></div>
<div class="container"> <div class="container">
<div class="price-title">PRIECE SETTIONG</div> <div class="price-title">PRIECE SETTIONG</div>
<HeroSellTop v-show="type === 'hero'" /> <HeroSellTop :data="data" v-if="type === 'hero'" />
<PieceSellTop v-show="type === 'piece'" /> <WeaponSellTop :data="data" v-else-if="type === 'weapon'" />
<ChipSellTop v-show="type === 'chip'" /> <ChipSellTop :data="data" v-else-if="type === 'chip'" />
<WeaponSellTop v-show="type === 'weapon'" /> <PieceSellTop
@handReduce="handReduce"
@handPlus="handPlus"
:data="piece"
:cunout="cunout"
v-else
/>
<div class="piece-bottom"> <div class="piece-bottom">
<div class="piece-bottom-top"> <div class="piece-bottom-top">
<div class="price-input"> <div class="price-input">
<el-input placeholder="Input your price"></el-input> <el-input placeholder="Input your price" v-model="price"></el-input>
</div> </div>
<div class="attributes"> <div class="attributes">
<el-select <el-select
@ -54,7 +60,7 @@
</div> </div>
</div> </div>
<div class="pending"> <div class="pending">
<div class="pending-order" @click="handMessage">PEBDING ORDER</div> <div class="pending-order" @click="handMessage">PEBDING ORDER</div>
<div class="confirm">CONFIRM</div> <div class="confirm">CONFIRM</div>
</div> </div>
</div> </div>
@ -74,8 +80,9 @@ import WeaponSellTop from "./WeaponSellTop.vue";
import PieceSellTop from "./PieceSellTop.vue"; import PieceSellTop from "./PieceSellTop.vue";
import HeroSellTop from "./HeroSellTop.vue"; import HeroSellTop from "./HeroSellTop.vue";
import ChipSellTop from "./ChipSellTop.vue"; import ChipSellTop from "./ChipSellTop.vue";
import { sellMyNft } from "@/api/Market";
export default { export default {
props: ["isPiecePut", "type"], props: ["isPiecePut", "type", "data"],
components: { components: {
WeaponSellTop, WeaponSellTop,
HeroSellTop, HeroSellTop,
@ -85,6 +92,8 @@ export default {
data() { data() {
return { return {
piece: "", piece: "",
price:0,
cunout: 1,
dialogVisible: false, dialogVisible: false,
isWeapon: false, isWeapon: false,
options: [ options: [
@ -108,14 +117,41 @@ export default {
value: "", value: "",
}; };
}, },
created() {
console.log(this.data, "data");
},
methods: { methods: {
closeTip() { closeTip() {
this.$emit("handPutHide"); this.$emit("handPutHide");
}, },
handMessage(){ async handMessage() {
this.$emit("handMessage"); // this.$emit("handMessage");
console.log('handMessage1'); const data = {
} nft_token: this.piece
? this.piece.detail.token_id
: this.data.detail.token_id,
s_price: this.price,
amount: this.piece ? this.cunout : null,
};
const res = await sellMyNft(data);
console.log("handMessage1", res);
},
init(data) {
this.dialogVisible = true;
this.piece = data;
console.log(data, "dfgdg");
console.log(this.piece.detail.balance, "this.piece.detail.balance");
},
handReduce() {
if (this.cunout > 0) {
this.cunout--;
}
},
handPlus() {
if (this.cunout < this.piece.balance) {
this.cunout++;
}
},
}, },
}; };
</script> </script>

View File

@ -11,7 +11,7 @@
</div> </div>
<div class="token-id"> <div class="token-id">
<div>Token id</div> <div>Token id</div>
<div>#3006985843100103</div> <div>#{{ data.detail.token_id }}</div>
</div> </div>
<div class="amount"> <div class="amount">
<div>Amount</div> <div>Amount</div>
@ -41,7 +41,9 @@
</template> </template>
<script> <script>
export default {}; export default {
props: ["data"],
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -66,11 +66,13 @@
<ChipBuyDialog <ChipBuyDialog
:type="type" :type="type"
:isBuy="isBuy" :isBuy="isBuy"
@handBuyShow="handBuyShow" @handBuyShow="handBuyShow"
@handBuyHide="handBuyHide" @handBuyHide="handBuyHide"
></ChipBuyDialog> ></ChipBuyDialog>
<PriceSetting <PriceSetting
:type="type" :type="type"
:data="chip"
:isPiecePut="isPiecePut" :isPiecePut="isPiecePut"
@handPutShow="handPutShow" @handPutShow="handPutShow"
@handPutHide="handPutHide" @handPutHide="handPutHide"

View File

@ -133,7 +133,7 @@
<TheSellDialog <TheSellDialog
:type="type" :type="type"
:isPiecePut="isPiecePut" :isPiecePut="isPiecePut"
:hero="data" :data="data"
@handPutShow="handPutShow" @handPutShow="handPutShow"
@handPutHide="handPutHide" @handPutHide="handPutHide"
></TheSellDialog> ></TheSellDialog>

View File

@ -31,7 +31,7 @@
/> />
<span class="amount" <span class="amount"
>{{ >{{
piece.balance ? piece.balance : piece.detail.balance piece.amount ? piece.amount : piece.balance
}}</span }}</span
> >
</div> </div>
@ -83,6 +83,7 @@
@handPutHide="handPutHide" @handPutHide="handPutHide"
></Piecedialog> ></Piecedialog>
<TheSell <TheSell
ref="selldialog"
:type="type" :type="type"
:isPiecePut="isPiecePut" :isPiecePut="isPiecePut"
@handMessage="handMessage" @handMessage="handMessage"
@ -175,8 +176,14 @@ export default {
this.$refs.dialog.init(data); this.$refs.dialog.init(data);
}); });
}, },
handPutShow() { handPutShow(piece) {
this.isPiecePut = true; this.isPiecePut = true;
this.$nextTick(() => {
//dialogdialog-componentref
//initdialog-componentinit
//data
this.$refs.selldialog.init(piece);
});
console.log(""); console.log("");
}, },

View File

@ -105,6 +105,7 @@
></Dundialog> ></Dundialog>
<TheSellDialog <TheSellDialog
:type="type" :type="type"
:data="weapon"
:isPiecePut="isPiecePut" :isPiecePut="isPiecePut"
@handPutShow="handPutShow" @handPutShow="handPutShow"
@handPutHide="handPutHide" @handPutHide="handPutHide"

View File

@ -1,8 +1,7 @@
export const formatSelect = function (value) { export const formatSelect = function (value) {
let date = new Date(value * 1000); let date = new Date(value * 1000);
let year = date.getUTCFullYear(); let year = date.getUTCFullYear();
let month = date.getUTCMonth(); let month = date.getUTCMonth() + 1;
let day = date.getUTCDate(); let day = date.getUTCDate();
let hour = date.getUTCHours(); let hour = date.getUTCHours();
let minute = date.getUTCMinutes(); let minute = date.getUTCMinutes();

View File

@ -646,7 +646,22 @@ export default class Market extends Vue {
onNftTypeClicked(id: number) { onNftTypeClicked(id: number) {
console.log("nft type clicked: ", id); console.log("nft type clicked: ", id);
this.nftType = id; this.nftType = id;
this.searchFilters = null; this.jobFilters = "1|2|3|4";
const jobList = this.jobList.map((item) => {
item.jobType = true;
});
const chipList = this.chipList.map((item) => {
item.jobType = true;
});
const pieceList = this.pieceList.map((item) => {
item.jobType = true;
});
this.qualityFilter = 0;
this.durabilityFilter = null;
this.lvFilter = 0;
console.log(jobList, "jobList");
this.searchFilters = null;
this.getHeroNftList(this.starts); this.getHeroNftList(this.starts);
} }

View File

@ -673,7 +673,21 @@ export default class MyNft extends Vue {
if (this.nftType !== typeId) { if (this.nftType !== typeId) {
this.nftType = typeId; this.nftType = typeId;
// this.jobFilters = "1|2|3|4"; this.jobFilters = "1|2|3|4";
const jobList = this.jobList.map((item) => {
item.jobType = true;
});
const chipList = this.chipList.map((item) => {
item.jobType = true;
});
const pieceList = this.pieceList.map((item) => {
item.jobType = true;
});
this.qualityFilter = 1;
this.durabilityFilter = null;
this.lvFilter = 1;
console.log(jobList, "jobList");
this.searchFilters = null; this.searchFilters = null;
// this.fetchDatas(1); // this.fetchDatas(1);
this.getHeroNftList(this.starts); this.getHeroNftList(this.starts);