This commit is contained in:
huangjinming 2022-12-22 16:01:09 +08:00
parent 1ccc4c03bd
commit 3f661ce8dc
5 changed files with 68 additions and 128 deletions

View File

@ -1,22 +1,22 @@
module.exports = { // module.exports = {
plugins: { // plugins: {
autoprefixer: {}, // 用来给不同的浏览器自动添加相应前缀,如-webkit--moz-等等 // autoprefixer: {}, // 用来给不同的浏览器自动添加相应前缀,如-webkit--moz-等等
"postcss-px-to-viewport": { // "postcss-px-to-viewport": {
unitToConvert: "px", // 要转化的单位 // unitToConvert: "px", // 要转化的单位
viewportWidth: 1080, // UI设计稿的宽度 // viewportWidth: 1080, // UI设计稿的宽度
unitPrecision: 6, // 转换后的精度,即小数点位数 // unitPrecision: 6, // 转换后的精度,即小数点位数
propList: ["*"], // 指定转换的css属性的单位*代表全部css属性的单位都进行转换 // propList: ["*"], // 指定转换的css属性的单位*代表全部css属性的单位都进行转换
viewportUnit: "vw", // 指定需要转换成的视窗单位默认vw // viewportUnit: "vw", // 指定需要转换成的视窗单位默认vw
fontViewportUnit: "vw", // 指定字体需要转换成的视窗单位默认vw // fontViewportUnit: "vw", // 指定字体需要转换成的视窗单位默认vw
selectorBlackList: ["wrap"], // 指定不转换为视窗单位的类名, // selectorBlackList: ["wrap"], // 指定不转换为视窗单位的类名,
minPixelValue: 1, // 默认值1小于或等于1px则不进行转换 // minPixelValue: 1, // 默认值1小于或等于1px则不进行转换
mediaQuery: true, // 是否在媒体查询的css代码中也进行转换默认false // mediaQuery: true, // 是否在媒体查询的css代码中也进行转换默认false
replace: true, // 是否转换后直接更换属性值 // replace: true, // 是否转换后直接更换属性值
exclude: [/\/src\/views\/desktop\//], // 设置忽略文件,用正则做目录名匹配 // exclude: [/\/src\/views\/desktop\//], // 设置忽略文件,用正则做目录名匹配
landscape: false // 是否处理横屏情况 // landscape: false // 是否处理横屏情况
}, // },
} // }
}; // };

View File

@ -19,7 +19,7 @@ import { isMobile } from '@/utils/resize'
import { hasMetamask, toHexChainId } from '@/utils/chain.util' import { hasMetamask, toHexChainId } from '@/utils/chain.util'
import { AllChains } from '@/configs/allchain' import { AllChains } from '@/configs/allchain'
import { MessageBox } from 'element-ui' import { MessageBox } from 'element-ui'
import { ERC20ABI } from '@/configs/contracts' import { ERC20ABI, MARKET_ABI } from '@/configs/contracts'
import { TransactionReceipt } from 'web3-core' import { TransactionReceipt } from 'web3-core'
const EIP721_DOMAIN_DATA = [ const EIP721_DOMAIN_DATA = [
@ -465,6 +465,14 @@ export class Blockchain {
.send({ gas: 1000000 }) .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 signData(signObj: any, signer: string) { public async signData(signObj: any, signer: string) {
const msgParams = JSON.stringify(signObj) const msgParams = JSON.stringify(signObj)
const from = signer const from = signer

View File

@ -173,20 +173,7 @@
<div>#3006985843100103 (NFTLink)</div> <div>#3006985843100103 (NFTLink)</div>
</div> </div>
</div> </div>
<!-- <div class="def-content">
<div class="def-item">
<div>DEF PCT</div>
<div>+8%</div>
</div>
<div class="def-item">
<div>DEF PCT</div>
<div>+7.2%</div>
</div>
<div class="def-item" style="justify-content: center">
Unlocked at Lv.5
</div>
<div class="def-item">LUCKY Unlocked at Lv.5</div>
</div> -->
<DefContent <DefContent
:chipsinfo=" :chipsinfo="
chipsid == 5 ? hero.detail.chip_core : hero.detail.chips_info chipsid == 5 ? hero.detail.chip_core : hero.detail.chips_info
@ -196,27 +183,7 @@
</div> </div>
</div> </div>
</div> </div>
<!-- <div class="buy-price">
<div class="price"><span class="price-number">9999.99</span></div>
<div>
<a href="javascript:void(0)">
<img
width="263px"
height="71px"
src="../../assets/market/hero/buy.png"
alt="aoi-hero"
/></a>
</div>
</div> -->
</div> </div>
<!-- <span @click="closeTip" class="close">
<img
src="../../assets/market/hero/cose.png"
width="56px"
height="56px"
alt=""
/></span> -->
</div> </div>
</template> </template>

View File

@ -16,7 +16,7 @@
<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" v-model="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
@ -81,6 +81,8 @@ 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"; import { sellMyNft } from "@/api/Market";
import ChainManager from "@/chain/ChainManager";
export default { export default {
props: ["isPiecePut", "type", "data"], props: ["isPiecePut", "type", "data"],
components: { components: {
@ -92,7 +94,8 @@ export default {
data() { data() {
return { return {
piece: "", piece: "",
price:'', price: "",
chainManager: new ChainManager(),
cunout: 1, cunout: 1,
dialogVisible: false, dialogVisible: false,
isWeapon: false, isWeapon: false,
@ -133,9 +136,41 @@ export default {
s_price: this.price, s_price: this.price,
amount: this.piece ? this.cunout : null, amount: this.piece ? this.cunout : null,
}; };
const res = await sellMyNft(data); const res = await sellMyNft(data);
try {
const shellData = {
nftToken: "",
currency: "",
tokenId: this.piece
? this.piece.detail.token_id
: this.data.detail.token_id,
amount: this.piece ? this.cunout : null,
price: this.price,
marketAddress: "",
};
const res = await this.beginSell(shellData);
console.log(res);
} catch (err) {
console.log(err);
this.$message({
type: "info",
message: "error transfer",
});
}
console.log("handMessage1", res); console.log("handMessage1", res);
}, },
async beginSell(data) {
return this.chainManager.beginNftSell({
nftToken: data.nftToken,
currency: data.currency,
tokenId: data.tokenId,
amount: data.amount,
price: data.price,
marketAddress: data.marketAddress,
});
},
init(data) { init(data) {
this.dialogVisible = true; this.dialogVisible = true;
this.piece = data; this.piece = data;

View File

@ -33,25 +33,7 @@
</div> </div>
</div> </div>
</div> </div>
<!-- <div class="level-filter">
<div class="level-item">
<div class="btn-bg">Quility</div>
<div class="level-slider">
<div>
<Slider
:max="15"
@sliderChange="sliderChange"
:min="0"
:value="value"
></Slider>
</div>
<div class="slider-number">
<div>0</div>
<div>15</div>
</div>
</div>
</div>
</div> -->
</div> </div>
<div class="filterbottom"> <div class="filterbottom">
<PriceFilter <PriceFilter
@ -88,59 +70,7 @@ export default {
}, },
data() { data() {
return { return {
hero: "", hero: ""
jobList: [
{
id: 0,
jobname: "raider",
jobType: false,
jobImg: require("../../../assets/market/filter-left/raider.png"),
disImg: require("../../../assets/market/filter-left/raider-disabled.png"),
},
{
id: 1,
jobname: "guardian",
jobType: true,
jobImg: require("../../../assets/market/filter-left/guardian.png"),
disImg: require("../../../assets/market/filter-left/guardian-disabled.png"),
},
{
id: 2,
jobname: "machinist",
jobType: true,
jobImg: require("../../../assets/market/filter-left/machinist.png"),
disImg: require("../../../assets/market/filter-left/machinist-disabled.png"),
},
{
id: 3,
jobname: "medic",
jobType: true,
jobImg: require("../../../assets/market/filter-left/medic.png"),
disImg: require("../../../assets/market/filter-left/medic-disabled.png"),
},
],
options: [
{
value: "选项1",
label: "Lowest",
},
{
value: "选项2",
label: "Lowest",
},
{
value: "选项3",
label: "Highest",
},
{
value: "选项4",
label: "Quaility",
},
{
value: "选项5",
label: "Level",
},
],
}; };
}, },