diff --git a/src/components/market/TheSellDialog.vue b/src/components/market/TheSellDialog.vue
index 451f0a8..be41537 100644
--- a/src/components/market/TheSellDialog.vue
+++ b/src/components/market/TheSellDialog.vue
@@ -17,7 +17,7 @@
@@ -78,6 +78,7 @@
height="51px"
alt=""
/>
+
@@ -86,6 +87,7 @@ import WeaponSellTop from "./WeaponSellTop.vue";
import PieceSellTop from "./PieceSellTop.vue";
import HeroSellTop from "./HeroSellTop.vue";
import ChipSellTop from "./ChipSellTop.vue";
+import MessageBox from "./MessageBox.vue";
import { AppModule } from "@/store/modules/app";
import { sellMyNft } from "@/api/Market";
import { CONTRACT_ADDRESS } from "@/configs/config_chain";
@@ -98,6 +100,7 @@ export default {
HeroSellTop,
ChipSellTop,
PieceSellTop,
+ MessageBox,
},
data() {
return {
@@ -105,8 +108,9 @@ export default {
price: "",
nft_Token: "",
chainManager: new ChainManager(),
+ loadingInstance: "",
cunout: 1,
- orderId:9,
+ orderId: 9,
dialogVisible: false,
isWeapon: false,
options: [],
@@ -130,7 +134,8 @@ export default {
this.$emit("handPutHide");
},
async handMessage() {
- if (this.data.selling ? this.data.selling > 0 : this.price.selling > 0) {
+
+ if (this.data.selling ? this.data.selling > 0 : this.piece.selling > 0) {
try {
const nftres = await this.chainManager.bc.beginUpdatePrice(
this.orderId,
@@ -166,7 +171,10 @@ export default {
amount: this.piece ? this.cunout : 1,
price: this.price,
marketAddress: CONTRACT_ADDRESS[AppModule.chainId].marketDddress,
+ nfttype:
+ this.type == "hero" || this.type == "weapon" ? false : true,
};
+ this.showLoading();
console.log(shellData, "shellData");
const nftres = await this.chainManager.bc.beginNftSell(
this.nft_Token,
@@ -174,10 +182,22 @@ export default {
this.piece ? this.piece.detail.token_id : this.data.detail.token_id,
this.piece ? this.cunout : 1,
this.price,
- CONTRACT_ADDRESS[AppModule.chainId].marketDddress
+ CONTRACT_ADDRESS[AppModule.chainId].marketDddress,
+ this.type == "hero" || this.type == "weapon" ? false : true
);
+ if (nftres.status == true) {
+ this.hideLoading();
+ this.$nextTick(() => {
+ this.$refs.message.open(1);
+ });
+ console.log("handMessage");
+ }
console.log(nftres, "beginSell");
} catch (err) {
+ this.hideLoading();
+ this.$nextTick(() => {
+ this.$refs.message.open(0);
+ });
console.log("query order status error", err);
}
}
@@ -193,11 +213,24 @@ export default {
this.cunout--;
}
},
+ handClick() {
+ // console.log(this.data.selling, "-==-=-=-=p1");
+ console.log(this.piece, "-==-=-=-=p2");
+ },
handPlus() {
- if (this.cunout < this.piece.balance) {
+ if (this.cunout <= this.piece.balance) {
this.cunout++;
}
},
+ showLoading() {
+ this.loadingInstance = this.$loading({
+ background: "rgba(0, 0, 0, 0.8)",
+ });
+ },
+
+ hideLoading() {
+ this.loadingInstance?.close();
+ },
},
};
diff --git a/src/components/market/nft/HeroNft.vue b/src/components/market/nft/HeroNft.vue
index b30b293..36fd51a 100644
--- a/src/components/market/nft/HeroNft.vue
+++ b/src/components/market/nft/HeroNft.vue
@@ -112,6 +112,7 @@
:currencyTypeList="currencyTypeList"
@handPutShow="handPutShow"
@handPutHide="handPutHide"
+ @handMessage="handMessage"
>
+