diff --git a/src/chain/blockchain.ts b/src/chain/blockchain.ts
index 6e87fed..bd58529 100644
--- a/src/chain/blockchain.ts
+++ b/src/chain/blockchain.ts
@@ -454,35 +454,37 @@ export class Blockchain {
.transfer(account, amountBN)
.send({ gas: 1000000 })
}
- public async beginNftSell(nftToken: string, currency: string, tokenId: string, amount: number, price: number,marketAddress:string ,nftType:boolean) {
- const nftInstance = await this.getContractInstance(nftToken, ERC721ABI)
- nftType == true? await nftInstance.methods.setApprovalForAll(marketAddress, true).send({ gas: 1000000}):
- await nftInstance.methods.approve(marketAddress, tokenId).send({ gas: 1000000})
- const priceBN = this.web3.utils.toBN(this.web3.utils.toWei(price + ''))
- const marketInstance: any = await this.getContractInstance(marketAddress, MARKET_ABI)
- return marketInstance.methods
- .sell(nftToken, currency, tokenId,priceBN, amount)
- .send({ gas: 1000000 })
- }
- public async beginApproveSell( tokenId: string,marketAddress:string,nftToken:string,nftType:boolean){
- const nftInstance = await this.getContractInstance(nftToken, ERC721ABI)
- nftType == true? await nftInstance.methods.setApprovalForAll(marketAddress, true).send({ gas: 1000000}):
- await nftInstance.methods.approve(marketAddress, tokenId).send({ gas: 1000000})
- }
- // public async beginNftSell(nftToken: string, currency: string, tokenId: string, amount: number, price: number,marketAddress:string ) {
+ // public async beginNftSell(nftToken: string, currency: string, tokenId: string, amount: number, price: number,marketAddress:string ,nftType:boolean) {
+ // const nftInstance = await this.getContractInstance(nftToken, ERC721ABI)
+ // nftType == true? await nftInstance.methods.setApprovalForAll(marketAddress, true).send({ gas: 1000000}):
+ // await nftInstance.methods.approve(marketAddress, tokenId).send({ gas: 1000000})
// const priceBN = this.web3.utils.toBN(this.web3.utils.toWei(price + ''))
// const marketInstance: any = await this.getContractInstance(marketAddress, MARKET_ABI)
// return marketInstance.methods
// .sell(nftToken, currency, tokenId,priceBN, amount)
// .send({ gas: 1000000 })
// }
-public async beginApproveBuy( currency: string,marketAddress:string,price:string){
- const coinInstance: any = await this.getContractInstance(currency)
- const res = await coinInstance.methods.increaseAllowance(marketAddress, price).send({ gas: 1000000 })
+public async beginApproveSell( tokenId: string,nftToken:string,nftType:boolean,marketAddress:string){
+ const nftInstance = await this.getContractInstance(nftToken, ERC721ABI)
+ if(nftType == true){
+ return nftInstance.methods.setApprovalForAll(marketAddress, true).send({ gas: 1000000})}else {
+ return nftInstance.methods.approve(marketAddress, tokenId).send({ gas: 1000000})
+ }
}
-public async beginBuy(orderId:string,price:number,currency:string,marketAddress:string){
- const coinInstance: any = await this.getContractInstance(currency)
- const res = await coinInstance.methods.increaseAllowance(marketAddress, price).send({ gas: 1000000 })
+public async beginNftSell(nftToken: string, currency: string, tokenId: string, amount: number, price: number,marketAddress:string ) {
+ const priceBN = this.web3.utils.toBN(this.web3.utils.toWei(price + ''))
+ const marketInstance: any = await this.getContractInstance(marketAddress, MARKET_ABI)
+ return marketInstance.methods
+ .sell(nftToken, currency, tokenId,priceBN, amount)
+ .send({ gas: 1000000 })
+ }
+public async beginApproveBuy( currency: string,price:string,marketAddress:string){
+ const coinInstance: any = await this.getContractInstance(currency)
+ return coinInstance.methods.increaseAllowance(marketAddress, price).send({ gas: 1000000 })
+ }
+public async beginBuy(orderId:string,marketAddress:string){
+ // const coinInstance: any = await this.getContractInstance(currency)
+ // const res = await coinInstance.methods.increaseAllowance(marketAddress, price).send({ gas: 1000000 })
const marketInstance: any = await this.getContractInstance(marketAddress, MARKET_ABI)
return marketInstance.methods
.buy(orderId)
diff --git a/src/components/market/ChipBuyDialog.vue b/src/components/market/ChipBuyDialog.vue
index 76ac696..a24f71a 100644
--- a/src/components/market/ChipBuyDialog.vue
+++ b/src/components/market/ChipBuyDialog.vue
@@ -40,7 +40,12 @@
- {{formatPriceShow(piece.s_price ? piece.s_price : data.s_price,18) }}
+ {{
+ formatPriceShow(
+ piece.s_price ? piece.s_price : data.s_price,
+ 18
+ )
+ }}
@@ -54,7 +59,14 @@
Price
-
{{formatPriceShow(piece.s_price ? piece.s_price : data.s_price,18) }}
+
+ {{
+ formatPriceShow(
+ piece.s_price ? piece.s_price : data.s_price,
+ 18
+ )
+ }}
+
Balance
@@ -78,7 +90,9 @@
-
PEBDING ORDER
+
+ {{ isApprove == true ? "CONFIRM" : "PEBDING ORDER" }}
+
CONFIRM
@@ -104,28 +118,39 @@ export default {
return {
piece: "",
orderId: 1,
+ isApprove:false,
chainManager: new ChainManager(),
dialogVisible: false,
+ loadingInstance: null,
};
},
methods: {
async haldBuy() {
- const data = {
- o_link: this.piece.o_link ? this.piece.o_link : this.data.o_link,
+ const data = {
+ currency: this.piece.s_currency
+ ? this.piece.s_currency
+ : this.data.s_currency,
price: this.piece.s_price ? this.piece.s_price : this.data.s_price,
- currency: this.piece.s_currency ? this.piece.s_currency : this.data.s_currency,
marketDddress: CONTRACT_ADDRESS[AppModule.chainId].marketDddress,
};
- console.log(data,'data');
+ console.log(data, "beginApproveBuy");
try {
- const nftres = await this.chainManager.bc.beginBuy(
- this.piece.o_link ? this.piece.o_link : this.data.o_link,
- this.piece.s_price ? this.piece.s_price : this.data.s_price,
+ this.showLoading();
+ const nftres = await this.chainManager.bc.beginApproveBuy(
this.piece.s_currency ? this.piece.s_currency : this.data.s_currency,
+ this.piece.s_price ? this.piece.s_price : this.data.s_price,
CONTRACT_ADDRESS[AppModule.chainId].marketDddress
);
- console.log(nftres, "beginSell");
+ console.log(nftres, "beginApproveBuy");
+ if (nftres.status == true) {
+ this.isApprove = true;
+ this.hideLoading();
+ this.handBeginBuy();
+ }
} catch (err) {
+ this.isApprove = false;
+ this.hideLoading();
+ this.$emit("handMessage", 0);
console.log("query order status error", err);
}
},
@@ -133,9 +158,41 @@ export default {
// 分发自定义事件(事件名: closeTip)
this.$emit("handBuyHide", false);
},
+ async handBeginBuy() {
+ const data = {
+ o_link: this.piece.o_link ? this.piece.o_link : this.data.o_link,
+ marketDddress: CONTRACT_ADDRESS[AppModule.chainId].marketDddress,
+ };
+ console.log(data, "data");
+ try {
+ this.showLoading();
+ const nftres = await this.chainManager.bc.beginBuy(
+ this.piece.o_link ? this.piece.o_link : this.data.o_link,
+ CONTRACT_ADDRESS[AppModule.chainId].marketDddress
+ );
+ if (nftres.status == true) {
+ this.hideLoading();
+ this.$emit("handMessage", 1);
+ }
+ console.log(nftres, "beginBuy");
+ } catch (err) {
+ this.hideLoading();
+ this.$emit("handMessage", 0);
+ console.log("query order status error", err);
+ }
+ },
formatPriceShow(price, decimals, fixed = 2) {
return formatPrice(price, decimals, fixed);
},
+ showLoading() {
+ this.loadingInstance = this.$loading({
+ background: "rgba(0, 0, 0, 0.8)",
+ });
+ },
+
+ hideLoading() {
+ this.loadingInstance?.close();
+ },
init(data) {
this.piece = data;
},
@@ -357,6 +414,7 @@ export default {
.confirm {
width: 426px;
height: 76px;
+ opacity: 0;
text-align: center;
line-height: 76px;
cursor: pointer;
diff --git a/src/components/market/ChipSellTop.vue b/src/components/market/ChipSellTop.vue
index 9c0f0c5..68026f8 100644
--- a/src/components/market/ChipSellTop.vue
+++ b/src/components/market/ChipSellTop.vue
@@ -13,6 +13,16 @@
"
alt=""
/>
+
{{ data.detail.chip_name }}
diff --git a/src/components/market/Chipdialog.vue b/src/components/market/Chipdialog.vue
index 1f53ba4..63a1b48 100644
--- a/src/components/market/Chipdialog.vue
+++ b/src/components/market/Chipdialog.vue
@@ -146,6 +146,7 @@ export default {
data() {
return {
chainManager: new ChainManager(),
+ loadingInstance:null,
chipArrid: {
39: "Hp Pct",
40: "Atk Pct",
@@ -198,15 +199,31 @@ export default {
CONTRACT_ADDRESS[AppModule.chainId].marketDddress
);
try {
+ this.showLoading()
const nftres = await this.chainManager.bc.beginCancelOrder(
this.data.o_link,
CONTRACT_ADDRESS[AppModule.chainId].marketDddress
);
console.log(nftres, "beginSell");
+ if (nftres.status == true) {
+ this.$emit("handMessage", 1);
+ this.hideLoading();
+ }
} catch (err) {
console.log("query order status error", err);
+ this.hideLoading();
+ this.$emit("handMessage", 1);
}
},
+ showLoading() {
+ this.loadingInstance = this.$loading({
+ background: "rgba(0, 0, 0, 0.8)",
+ });
+ },
+
+ hideLoading() {
+ this.loadingInstance?.close();
+ },
},
};
diff --git a/src/components/market/Dundialog.vue b/src/components/market/Dundialog.vue
index 9d1566d..9f66f4a 100644
--- a/src/components/market/Dundialog.vue
+++ b/src/components/market/Dundialog.vue
@@ -244,7 +244,7 @@
{{
- formatPriceShow( data.s_price ? data.s_price : " ",18)
+ formatPriceShow(data.s_price ? data.s_price : " ", 18)
}}
@@ -303,6 +303,7 @@ export default {
data() {
return {
isTabs: false,
+ loadingInstance: null,
chainManager: new ChainManager(),
};
},
@@ -318,7 +319,7 @@ export default {
this.$emit("on-open");
//如果需要传参的话,可以在"on-close"后面再加参数,然后在父组件的函数里接收就可以了。
},
- formatPriceShow(price, decimals, fixed = 2) {
+ formatPriceShow(price, decimals, fixed = 2) {
return formatPrice(price, decimals, fixed);
},
handHeroTab() {
@@ -339,15 +340,32 @@ export default {
},
async handRemove() {
try {
+ this.showLoading()
const nftres = await this.chainManager.bc.beginCancelOrder(
this.data.o_link,
CONTRACT_ADDRESS[AppModule.chainId].marketDddress
);
console.log(nftres, "beginSell");
+ if (nftres.status == true) {
+
+ this.$emit("handMessage", 1);
+ this.hideLoading();
+ }
} catch (err) {
+ this.hideLoading();
+ this.$emit("handMessage", 0);
console.log("query order status error", err);
}
},
+ showLoading() {
+ this.loadingInstance = this.$loading({
+ background: "rgba(0, 0, 0, 0.8)",
+ });
+ },
+
+ hideLoading() {
+ this.loadingInstance?.close();
+ },
},
};
diff --git a/src/components/market/HeroBuyDialog.vue b/src/components/market/HeroBuyDialog.vue
index b2c8dc7..fe2a504 100644
--- a/src/components/market/HeroBuyDialog.vue
+++ b/src/components/market/HeroBuyDialog.vue
@@ -37,7 +37,9 @@
-
PEBDING ORDER
+
+ {{ isApprove == true ? "CONFIRM" : "PEBDING ORDER" }}
+
CONFIRM
@@ -65,6 +67,7 @@ export default {
return {
piece: "",
orderId: 2,
+ isApprove: false,
loadingInstance: null,
chainManager: new ChainManager(),
dialogVisible: false,
@@ -73,19 +76,41 @@ export default {
methods: {
async haldBuy() {
const data = {
- o_link: this.data.o_link,
- price: this.data.s_price,
currency: this.data.s_currency,
+ price: this.data.s_price,
marketDddress: CONTRACT_ADDRESS[AppModule.chainId].marketDddress,
};
console.log(data, "data");
try {
-
- this.showLoading()
+ this.showLoading();
+ const nftres = await this.chainManager.bc.beginApproveBuy(
+ this.data.s_currency,
+ this.data.s_price,
+ CONTRACT_ADDRESS[AppModule.chainId].marketDddress
+ );
+ console.log(nftres, "beginSell");
+ if (nftres.status == true) {
+ this.isApprove = true;
+ this.hideLoading();
+ this.handBeginBuy();
+ }
+ } catch (err) {
+ this.isApprove = false;
+ this.hideLoading();
+ this.$emit("handMessage", 0);
+ console.log("query order status error", err);
+ }
+ },
+ async handBeginBuy() {
+ const data = {
+ o_link: this.data.o_link,
+ marketDddress: CONTRACT_ADDRESS[AppModule.chainId].marketDddress,
+ };
+ console.log(data, "data");
+ try {
+ this.showLoading();
const nftres = await this.chainManager.bc.beginBuy(
this.data.o_link,
- this.data.s_price,
- this.data.s_currency,
CONTRACT_ADDRESS[AppModule.chainId].marketDddress
);
console.log(nftres, "beginSell");
@@ -337,6 +362,7 @@ export default {
.confirm {
width: 426px;
height: 76px;
+ opacity: 0;
text-align: center;
line-height: 76px;
cursor: pointer;
diff --git a/src/components/market/HeroSellTop.vue b/src/components/market/HeroSellTop.vue
index 62216ab..f06d360 100644
--- a/src/components/market/HeroSellTop.vue
+++ b/src/components/market/HeroSellTop.vue
@@ -9,6 +9,12 @@
:src="require('@/assets/market/hero/' + data.item_id + '.png')"
alt=""
/>
+
![]()
{{ cunout }}
- Max
+ Max
Sellers pay 5% fee to platform for completing the transaction.
@@ -72,6 +72,9 @@ export default {
handPlus() {
this.$emit("handPlus");
},
+ handMax(){
+ this.$emit("handMax");
+ }
},
};
diff --git a/src/components/market/Piecedialog.vue b/src/components/market/Piecedialog.vue
index b64e35c..a6e3ef0 100644
--- a/src/components/market/Piecedialog.vue
+++ b/src/components/market/Piecedialog.vue
@@ -89,7 +89,7 @@
{{
- formatPriceShow(piece.s_price ? piece.s_price : " ",18)
+ formatPriceShow(piece.s_price ? piece.s_price : " ", 18)
}}
@@ -128,6 +128,7 @@ export default {
data() {
return {
piece: "",
+ loadingInstance: null,
dialogVisible: false,
chainManager: new ChainManager(),
};
@@ -176,18 +177,36 @@ export default {
console.log("handBuyShow");
},
async handRemove() {
- console.log(this.piece.o_link,
- CONTRACT_ADDRESS[AppModule.chainId].marketDddress);
+ console.log(
+ this.piece.o_link,
+ CONTRACT_ADDRESS[AppModule.chainId].marketDddress
+ );
try {
+ this.showLoading();
const nftres = await this.chainManager.bc.beginCancelOrder(
this.piece.o_link,
CONTRACT_ADDRESS[AppModule.chainId].marketDddress
);
console.log(nftres, "beginSell");
+ if (nftres.status == true) {
+ this.$emit("handMessage", 1);
+ this.hideLoading();
+ }
} catch (err) {
+ this.hideLoading();
+ this.$emit("handMessage", 0);
console.log("query order status error", err);
}
},
+ showLoading() {
+ this.loadingInstance = this.$loading({
+ background: "rgba(0, 0, 0, 0.8)",
+ });
+ },
+
+ hideLoading() {
+ this.loadingInstance?.close();
+ },
},
};
diff --git a/src/components/market/TheSellDialog.vue b/src/components/market/TheSellDialog.vue
index bf8052c..8b9e1f0 100644
--- a/src/components/market/TheSellDialog.vue
+++ b/src/components/market/TheSellDialog.vue
@@ -9,6 +9,7 @@
-
PEBDING ORDER
-
CONFIRM
+
+ {{ isApprove == true ? "CONFIRM" : "PEBDING ORDER" }}
+
+
CONFIRM
@@ -79,7 +82,6 @@
height="51px"
alt=""
/>
-
@@ -115,6 +117,7 @@ export default {
orderId: 9,
dialogVisible: false,
isWeapon: false,
+ isApprove: false,
options: [],
value: "",
FormRules: {
@@ -135,11 +138,6 @@ export default {
};
},
created() {
- // alert(/^[1-9]{1,3}([1-8])?(\.\d{1,2})?$|^(\d{6})$/.test("1888.99"));
- // /^[1-9][0-9]{0,5}.(\d){2}$/
- // alert(/^[1-9]{1,3}([1-8])?(\.\d{1,2})?$|^(\d{4})$/.test("9999.99"));
-
- // alert(/^[1-9]{1,3}([1-8])?(\.\d{1,2})?$|^(\d{4})$/.test("9999"));
console.log(
/^0\.([1-9]|\d[1-9])$|^[1-9]\d{0,5}\.\d{0,2}$|^[1-9]\d{0,5}$/.test(
"0.01"
@@ -161,11 +159,11 @@ export default {
async handMessage() {
// this.$emit('handMessage',0)
this.$message({
- message: 'You just copied accountId',
- type: 'success',
- duration: 5 * 1000
- })
- console.log("handMessage",1);
+ message: "You just copied accountId",
+ type: "success",
+ duration: 5 * 1000,
+ });
+ console.log("handMessage", 1);
// switch (this.type) {
// case "hero":
// this.nft_Token = CONTRACT_ADDRESS[AppModule.chainId].hero;
@@ -201,6 +199,7 @@ export default {
this.type == "piece" ? this.piece.o_link > 0 : this.data.o_link > 0
) {
try {
+ this.showLoading();
const nftres = await this.chainManager.bc.beginUpdatePrice(
this.type == "piece" ? this.piece.o_link : this.data.o_link,
this.shell.price,
@@ -209,11 +208,11 @@ export default {
console.log(nftres, "beginSell");
if (nftres.status == true) {
this.hideLoading();
- this.$emit('handMessage',1)
+ this.$emit("handMessage", 1);
}
} catch (err) {
- this.hideLoading();
- this.$emit('handMessage',0)
+ this.hideLoading();
+ this.$emit("handMessage", 0);
console.log("query order status error", err);
}
} else {
@@ -231,41 +230,38 @@ export default {
this.nft_Token = CONTRACT_ADDRESS[AppModule.chainId].piece;
break;
}
+ const data = {
+ tokenId: this.piece
+ ? this.piece.detail.token_id
+ : this.data.detail.token_id,
+ nftToken: this.nft_Token,
+ nftType:
+ this.type == "hero" || this.type == "weapon" ? false : true,
+ marketAddress: CONTRACT_ADDRESS[AppModule.chainId].marketDddress,
+ };
+ console.log(data, "dataap");
try {
- const shellData = {
- nftToken: this.nft_Token,
- currency: this.value,
- tokenId: this.piece
- ? this.piece.detail.token_id
- : this.data.detail.token_id,
- amount: this.piece ? this.cunout : 1,
- price: this.shell.price,
- marketAddress:
- CONTRACT_ADDRESS[AppModule.chainId].marketDddress,
- nfttype:
- this.type == "hero" || this.type == "weapon" ? false : true,
- };
this.showLoading();
- console.log(shellData, "shellData", "999999990000000000000000");
- const nftres = await this.chainManager.bc.beginNftSell(
- this.nft_Token,
- this.value,
+ const nftres = await this.chainManager.bc.beginApproveSell(
this.piece
? this.piece.detail.token_id
: this.data.detail.token_id,
- this.piece ? this.cunout : 1,
- this.shell.price,
- CONTRACT_ADDRESS[AppModule.chainId].marketDddress,
- this.type == "hero" || this.type == "weapon" ? false : true
+ this.nft_Token,
+ this.type == "hero" || this.type == "weapon" ? false : true,
+ CONTRACT_ADDRESS[AppModule.chainId].marketDddress
);
+ console.log(nftres, "beginApproveSell");
if (nftres.status == true) {
+ this.isApprove = true;
this.hideLoading();
- this.$emit('handMessage',1)
+ // this.$emit("handMessage", 1);
+
+ this.handBeginNftSell();
}
- console.log(nftres, "beginSell");
} catch (err) {
this.hideLoading();
- this.$emit('handMessage',0)
+ this.isApprove = false;
+ this.$emit("handMessage", 0);
console.log("query order status error", err);
}
}
@@ -278,16 +274,72 @@ export default {
// console.log(data, "dfgdg");
// console.log(this.piece.detail.balance, "this.piece.detail.balance");
},
+ async handBeginNftSell() {
+ this.$refs.deptForm.validate(async (valid) => {
+ if (valid) {
+ switch (this.type) {
+ case "hero":
+ this.nft_Token = CONTRACT_ADDRESS[AppModule.chainId].hero;
+ break;
+ case "weapon":
+ this.nft_Token = CONTRACT_ADDRESS[AppModule.chainId].weapon;
+ break;
+ case "chip":
+ this.nft_Token = CONTRACT_ADDRESS[AppModule.chainId].chip;
+ break;
+ case "piece":
+ this.nft_Token = CONTRACT_ADDRESS[AppModule.chainId].piece;
+ break;
+ }
+ try {
+ const shellData = {
+ nftToken: this.nft_Token,
+ currency: this.value,
+ tokenId: this.piece
+ ? this.piece.detail.token_id
+ : this.data.detail.token_id,
+ amount: this.piece ? this.cunout : 1,
+ price: this.shell.price,
+ marketAddress: CONTRACT_ADDRESS[AppModule.chainId].marketDddress,
+ };
+ this.showLoading();
+ console.log(shellData, "shellData", "999999990000000000000000");
+ const nftres = await this.chainManager.bc.beginNftSell(
+ this.nft_Token,
+ this.value,
+ this.piece
+ ? this.piece.detail.token_id
+ : this.data.detail.token_id,
+ this.piece ? this.cunout : 1,
+ this.shell.price,
+ CONTRACT_ADDRESS[AppModule.chainId].marketDddress
+ );
+ if (nftres.status == true) {
+ this.hideLoading();
+ this.$emit("handMessage", 1);
+ }
+ console.log(nftres, "beginSell");
+ } catch (err) {
+ this.hideLoading();
+ this.$emit("handMessage", 0);
+ console.log("query order status error", err);
+ }
+ }
+ });
+ },
handReduce() {
- if (this.cunout > 0) {
+ if (this.cunout > 1) {
this.cunout--;
}
},
handPlus() {
- if (this.cunout <= this.piece.balance) {
+ if (this.cunout < this.piece.balance) {
this.cunout++;
}
},
+ handMax() {
+ this.cunout = this.piece.balance;
+ },
showLoading() {
this.loadingInstance = this.$loading({
background: "rgba(0, 0, 0, 0.8)",
@@ -479,6 +531,7 @@ $item-size: 22px;
.confirm {
width: 401px;
height: 78px;
+ opacity: 0;
text-align: center;
line-height: 78px;
cursor: pointer;
diff --git a/src/components/market/WeaponBuyDialog.vue b/src/components/market/WeaponBuyDialog.vue
index 3b6b8aa..0cad006 100644
--- a/src/components/market/WeaponBuyDialog.vue
+++ b/src/components/market/WeaponBuyDialog.vue
@@ -68,7 +68,9 @@
-
PEBDING ORDER
+
+ {{ isApprove == true ? "CONFIRM" : "PEBDING ORDER" }}
+
CONFIRM
@@ -95,6 +97,7 @@ export default {
return {
piece: "",
orderId: "",
+ isApprove: false,
loadingInstance: null,
chainManager: new ChainManager(),
dialogVisible: false,
@@ -103,18 +106,41 @@ export default {
methods: {
async haldBuy() {
const data = {
- o_link: this.data.o_link,
- price: this.data.s_price,
currency: this.data.s_currency,
+ price: this.data.s_price,
marketDddress: CONTRACT_ADDRESS[AppModule.chainId].marketDddress,
};
console.log(data, "data");
try {
- this.showLoading()
+ this.showLoading();
+ const nftres = await this.chainManager.bc.beginApproveBuy(
+ this.data.s_currency,
+ this.data.s_price,
+ CONTRACT_ADDRESS[AppModule.chainId].marketDddress
+ );
+ console.log(nftres, "beginSell");
+ if (nftres.status == true) {
+ this.isApprove = true;
+ this.hideLoading();
+ this.handBeginBuy();
+ }
+ } catch (err) {
+ this.isApprove = false;
+ this.hideLoading();
+ this.$emit("handMessage", 0);
+ console.log("query order status error", err);
+ }
+ },
+ async handBeginBuy() {
+ const data = {
+ o_link: this.data.o_link,
+ marketDddress: CONTRACT_ADDRESS[AppModule.chainId].marketDddress,
+ };
+ console.log(data, "data");
+ try {
+ this.showLoading();
const nftres = await this.chainManager.bc.beginBuy(
this.data.o_link,
- this.data.s_price,
- this.data.s_currency,
CONTRACT_ADDRESS[AppModule.chainId].marketDddress
);
console.log(nftres, "beginSell");
@@ -124,7 +150,7 @@ export default {
}
} catch (err) {
this.hideLoading();
- this.$emit("handMessage", 0);
+ this.$emit("handMessage", 0);
console.log("query order status error", err);
}
},
@@ -383,6 +409,8 @@ export default {
.confirm {
width: 426px;
height: 76px;
+ opacity: 0;
+ opacity: 0;
text-align: center;
line-height: 76px;
cursor: pointer;
diff --git a/src/components/market/WeaponSellTop.vue b/src/components/market/WeaponSellTop.vue
index 05d64f6..5ea047b 100644
--- a/src/components/market/WeaponSellTop.vue
+++ b/src/components/market/WeaponSellTop.vue
@@ -10,6 +10,12 @@
:src="require('@/assets/market/weapon/' + data.item_id + '.png')"
alt=""
/>
+
{{ data.detail.gun_name }}
diff --git a/src/components/market/nft/Chip.vue b/src/components/market/nft/Chip.vue
index 0d8045a..2deeb53 100644
--- a/src/components/market/nft/Chip.vue
+++ b/src/components/market/nft/Chip.vue
@@ -64,6 +64,7 @@
@handPutHide="handPutHide"
@handBuyShow="handBuyShow"
@handBuyHide="handBuyHide"
+ @handMessage="handMessage"
:data="chip"
:isType="isType"
:isPiecePut="isPiecePut"
diff --git a/src/components/market/nft/HeroNft.vue b/src/components/market/nft/HeroNft.vue
index cdd2b4b..dddf369 100644
--- a/src/components/market/nft/HeroNft.vue
+++ b/src/components/market/nft/HeroNft.vue
@@ -100,6 +100,7 @@
:isBuy="isBuy"
@handBuyShow="handBuyShow"
@handBuyHide="handBuyHide"
+ @handMessage="handMessage"
@closeTip="closeTip"
@showTip="showTip"
@on-click="handDialog"
diff --git a/src/components/market/nft/PieceNft.vue b/src/components/market/nft/PieceNft.vue
index b896242..afd5dde 100644
--- a/src/components/market/nft/PieceNft.vue
+++ b/src/components/market/nft/PieceNft.vue
@@ -42,8 +42,7 @@
{{ formatPriceShow(piece.s_price ? piece.s_price : " ", 18) }}
-
-
+
Sell
@@ -82,6 +81,7 @@
@handBuyHide="handBuyHide"
@handPutShow="handPutShow"
@handPutHide="handPutHide"
+ @handMessage="handMessage"
>
diff --git a/src/components/market/nft/WeaponList.vue b/src/components/market/nft/WeaponList.vue
index f8b2164..ec5dd55 100644
--- a/src/components/market/nft/WeaponList.vue
+++ b/src/components/market/nft/WeaponList.vue
@@ -83,6 +83,7 @@
@handBuyHide="handBuyHide"
@handPutShow="handPutShow"
@handPutHide="handPutHide"
+ @handMessage="handMessage"
>