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',
method: 'get',
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: {
// --
formatSelect(value) {
console.log(value,'date');
console.log(value, "date");
let date = new Date(value * 1000);
console.log(date,'date');
console.log(date, "date");
let year = date.getUTCFullYear();
let month = date.getUTCMonth();
let month = date.getUTCMonth() + 1;
let day = date.getUTCDate();
let hour = date.getUTCHours();
let minute = date.getUTCMinutes();
let second = date.getUTCSeconds();
return year + "-" + month + "-" + day +' ' +hour+':'+minute+':'+second;
return (
year +
"-" +
month +
"-" +
day +
" " +
hour +
":" +
minute +
":" +
second
);
},
},
computed: {

View File

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

View File

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

View File

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

View File

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

View File

@ -3,14 +3,20 @@
<div class="bg"></div>
<div class="container">
<div class="price-title">PRIECE SETTIONG</div>
<HeroSellTop v-show="type === 'hero'" />
<PieceSellTop v-show="type === 'piece'" />
<ChipSellTop v-show="type === 'chip'" />
<WeaponSellTop v-show="type === 'weapon'" />
<HeroSellTop :data="data" v-if="type === 'hero'" />
<WeaponSellTop :data="data" v-else-if="type === 'weapon'" />
<ChipSellTop :data="data" v-else-if="type === 'chip'" />
<PieceSellTop
@handReduce="handReduce"
@handPlus="handPlus"
:data="piece"
:cunout="cunout"
v-else
/>
<div class="piece-bottom">
<div class="piece-bottom-top">
<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 class="attributes">
<el-select
@ -54,7 +60,7 @@
</div>
</div>
<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>
</div>
@ -74,8 +80,9 @@ import WeaponSellTop from "./WeaponSellTop.vue";
import PieceSellTop from "./PieceSellTop.vue";
import HeroSellTop from "./HeroSellTop.vue";
import ChipSellTop from "./ChipSellTop.vue";
import { sellMyNft } from "@/api/Market";
export default {
props: ["isPiecePut", "type"],
props: ["isPiecePut", "type", "data"],
components: {
WeaponSellTop,
HeroSellTop,
@ -85,6 +92,8 @@ export default {
data() {
return {
piece: "",
price:0,
cunout: 1,
dialogVisible: false,
isWeapon: false,
options: [
@ -108,14 +117,41 @@ export default {
value: "",
};
},
created() {
console.log(this.data, "data");
},
methods: {
closeTip() {
this.$emit("handPutHide");
},
handMessage(){
this.$emit("handMessage");
console.log('handMessage1');
}
async handMessage() {
// this.$emit("handMessage");
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>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -646,7 +646,22 @@ export default class Market extends Vue {
onNftTypeClicked(id: number) {
console.log("nft type clicked: ", 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);
}

View File

@ -673,7 +673,21 @@ export default class MyNft extends Vue {
if (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.fetchDatas(1);
this.getHeroNftList(this.starts);