This commit is contained in:
huangjinming 2023-01-05 14:51:57 +08:00
parent 09f2639117
commit 25cfcbadc7
13 changed files with 189 additions and 94 deletions

View File

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

View File

@ -136,16 +136,16 @@ export default {
console.log(this.type, "-=-", AppModule.chainId);
"1338";
console.log(CONTRACT_ADDRESS[AppModule.chainId]);
this.nft_Token = CONTRACT_ADDRESS["1338"].hero;
this.nft_Token = CONTRACT_ADDRESS[AppModule.chainId].hero;
break;
case "weapon":
this.nft_Token = CONTRACT_ADDRESS["1338"].weapon;
this.nft_Token = CONTRACT_ADDRESS[AppModule.chainId].weapon;
break;
case "chip":
this.nft_Token = CONTRACT_ADDRESS["1338"].chip;
this.nft_Token = CONTRACT_ADDRESS[AppModule.chainId].chip;
break;
case "piece":
this.nft_Token = CONTRACT_ADDRESS["1338"].piece;
this.nft_Token = CONTRACT_ADDRESS[AppModule.chainId].piece;
break;
}
try {
@ -157,7 +157,7 @@ export default {
: this.data.detail.token_id,
amount: this.piece ? this.cunout : 1,
price: this.price,
marketAddress: CONTRACT_ADDRESS["1338"].address,
marketAddress: CONTRACT_ADDRESS[AppModule.chainId].address,
};
console.log(shellData, "shellData");
const nftres = await this.chainManager.bc.beginNftSell(
@ -166,7 +166,7 @@ export default {
this.piece ? this.piece.detail.token_id : this.data.detail.token_id,
this.piece ? this.cunout : 1,
this.price,
CONTRACT_ADDRESS["1338"].address
CONTRACT_ADDRESS[AppModule.chainId].address
);
console.log(nftres, "beginSell");
} catch (err) {

View File

@ -249,7 +249,7 @@ export default class HeroNft extends Vue {
background: #3c3c3c;
border: 4px solid #cdd8fd;
opacity: 0.8;
z-index: 11;
z-index: 9;
border-radius: 16px;
.for-rent-img {
margin-top: 100px;

View File

@ -229,7 +229,7 @@ export default {
background: #3c3c3c;
border: 4px solid #cdd8fd;
opacity: 0.8;
z-index: 11;
z-index: 9;
border-radius: 16px;
}
}

View File

@ -5,7 +5,7 @@
<img src="../../../assets/market/filter-left/job.png" alt="" />
</div>
<div class="job-options">
<div class="job-item" v-for="(item, i) in jobList" :key="i">
<div class="job-item" v-for="(item, i) in chipList" :key="i">
<div class="job-status" @click="jobStatus(item)">
<img v-if="item.jobType === true" :src="item.jobImg" alt="" />
<img v-else :src="item.disImg" alt="" />
@ -31,7 +31,6 @@
</div>
</div>
</div>
</div>
<div class="price">
<div class="price-btn" @click="priceFilter">Price</div>
@ -60,9 +59,10 @@
import Slider from "./Slider.vue";
import PropertySelect from "./PropertySelect.vue";
export default {
props: ["chipList"],
components: {
Slider,
PropertySelect
PropertySelect,
},
data() {
return {
@ -72,23 +72,6 @@ export default {
value3: 7,
value: 7,
priceMax: "",
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"),
},
],
};
},
mounted() {
@ -321,4 +304,3 @@ export default {
background-size: contain;
}
</style>

View File

@ -16,6 +16,9 @@
</div>
<Transition>
<HeroFilter
:jobList="jobList"
:options="options"
@jobStatus="jobStatus"
v-if="nftType == 1 && nftNumber"
class="filter-modal"
></HeroFilter>
@ -26,8 +29,10 @@
<ChipFilter
v-else-if="nftType == 3 && nftNumber"
class="filter-modal"
:chipList="chipList"
></ChipFilter>
<PieceFilter
:pieceList="pieceList"
v-else-if="nftType == 4 && nftNumber"
class="filter-modal"
></PieceFilter>
@ -41,12 +46,12 @@ import WeaponFilter from "@/components/mobile/main/WeaponFilter.vue";
import ChipFilter from "@/components/mobile/main/ChipFilter.vue";
import PieceFilter from "@/components/mobile/main/PieceFilter.vue";
export default {
props: ["nftType"],
props: ["nftType", "jobList", "chipList", "pieceList", "options"],
components: {
HeroFilter,
WeaponFilter,
ChipFilter,
PieceFilter
PieceFilter,
},
created() {
console.log();
@ -59,13 +64,16 @@ export default {
},
methods: {
search() {
this.$emit("handSearch",this.value);
console.log('handSearch');
this.$emit("handSearch", this.value);
console.log("handSearch");
},
handClear() {},
handFilter() {
this.nftNumber = !this.nftNumber;
},
jobStatus(item) {
this.$emit("jobStatus", item);
},
},
};
</script>

View File

@ -14,7 +14,6 @@
</div>
<PropertySelect
:options="options"
:selectValue="selectValue"
@handSelect="handHeroSelect"
></PropertySelect>
</div>
@ -83,6 +82,7 @@
import Slider from "./Slider.vue";
import PropertySelect from "./PropertySelect.vue";
export default {
props: ["jobList",'options'],
components: {
Slider,
PropertySelect,
@ -95,36 +95,6 @@ export default {
value3: 7,
value: 7,
priceMax: "",
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"),
},
],
};
},
mounted() {
@ -132,7 +102,7 @@ export default {
},
methods: {
jobStatus(item) {
this.jobList[item.id].jobType = !this.jobList[item.id].jobType;
this.$emit("jobStatus", item);
},
searchClear() {
this.hero = "";

View File

@ -5,7 +5,7 @@
<img src="../../../assets/market/filter-left/job.png" alt="" />
</div>
<div class="job-options">
<div class="job-item" v-for="(item, i) in jobList" :key="i">
<div class="job-item" v-for="(item, i) in pieceList" :key="i">
<div class="job-status" @click="jobStatus(item)">
<img v-if="item.jobType === true" :src="item.jobImg" alt="" />
<img v-else :src="item.disImg" alt="" />
@ -46,6 +46,7 @@
import Slider from "./Slider.vue";
import PropertySelect from "./PropertySelect.vue";
export default {
props: ["pieceList"],
components: {
Slider,
PropertySelect,

View File

@ -182,7 +182,7 @@ export const AllChains = [
{
name: "Local Testnet",
type: "Local",
rpc: "http://192.168.100.24:8545/",
rpc: "https://login-test.kingsome.cn/rpc",
id: 1338,
symbol: "ETH",
explorerurl: "https://explorer.harmony.one",

View File

@ -25,7 +25,7 @@ export const ALL_PROVIDERS = [
}
]
export const AVAILABLE_CHAINS = env === 'production' ? [321] : [80001]
export const AVAILABLE_CHAINS = env === 'production' ? [321] : [1338]
// [80001]:[1338] [322]
export const OFFICE_ACCOUNT = env === 'production'
? '0x565edA4ef351EB78F03B8AfCb6dCF02E29cAD62e'

View File

@ -597,7 +597,7 @@ export default class Market extends Vue {
if (!AppModule.accountId) {
return;
}
this.showLoading();
// this.showLoading();
const reqData: any = {
page_size: this.pageSize,
start: this.starts,
@ -626,7 +626,7 @@ export default class Market extends Vue {
this.starts = page.start;
this.currentPage = page.start / page.page_size + 1;
}
this.hideLoading();
// this.hideLoading();
}
}
@Watch("isLogin")

View File

@ -632,7 +632,7 @@ export default class MyNft extends Vue {
if (!AppModule.accountId) {
return;
}
this.showLoading();
// this.showLoading();
const reqData: any = {
page_size: this.pageSize,
start: this.starts,
@ -663,7 +663,7 @@ export default class MyNft extends Vue {
this.starts = page.start;
this.currentPage = page.start / page.page_size + 1;
}
this.hideLoading();
// this.hideLoading();
}
}
async getCurrencyType() {

View File

@ -1,7 +1,15 @@
<template>
<div class="container">
<mobile-header current-section="market"></mobile-header>
<FilterTop :nftType="nftType" @handSearch="handSearch"></FilterTop>
<FilterTop
:nftType="nftType"
@handSearch="handSearch"
@jobStatus="jobStatus"
:chipList="chipList"
:pieceList="pieceList"
:jobList="jobList"
:options="options"
></FilterTop>
<NftTypeBar
:nftType="nftType"
:sortOptions="sortOptions"
@ -95,6 +103,118 @@ export default {
label: "Energy",
},
],
options: [
{
value: null,
label: "All",
},
{
value: "Hill",
label: "Hill",
},
{
value: "Yamato",
label: "Yamato",
},
{
value: "Highest",
label: "Highest",
},
{
value: "Aoi",
label: "Aoi",
},
{
value: "Astral",
label: "Astral",
},
{
value: "Miffy",
label: "Miffy",
},
{
value: "Canoe",
label: "Canoe",
},
{
value: "Mariana",
label: "Mariana",
},
{
value: "Dragonscale",
label: "Dragonscale",
},
{
value: "Lazer",
label: "Lazer",
},
{
value: "Kurosawa",
label: "Kurosawa",
},
],
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"),
},
],
chipList: [
{
id: 0,
jobname: "raider",
jobType: true,
jobImg: require("../../assets/market/filter-left/hero-chip.png"),
disImg: require("../../assets/market/filter-left/hero-chip-disable.png"),
},
{
id: 1,
jobname: "guardian",
jobType: true,
jobImg: require("../../assets/market/filter-left/gun-chip.png"),
disImg: require("../../assets/market/filter-left/gun-chip-disable.png"),
},
],
pieceList: [
{
id: 0,
jobname: "raider",
jobType: true,
jobImg: require("../../assets/market/filter-left/hero-chip.png"),
disImg: require("../../assets/market/filter-left/hero-chip-disable.png"),
},
{
id: 1,
jobname: "guardian",
jobType: true,
jobImg: require("../../assets/market/filter-left/gun-chip.png"),
disImg: require("../../assets/market/filter-left/gun-chip-disable.png"),
},
],
value: "",
};
},
@ -130,12 +250,26 @@ export default {
this.isFiters = !this.isFiters;
},
handSearch(value) {
this.searchFilters =value;
this.debounce()
this.searchFilters = value;
this.debounce();
},
handClear() {
this.hero = "";
},
jobStatus(item) {
this.jobList[item.id].jobType = !this.jobList[item.id].jobType;
let list = this.jobList.filter((item) => {
return item.jobType == true;
});
let arry = list.map((item) => {
return item.id;
});
let newArray = arry.map(function (index) {
return index + 1;
});
this.jobFilters = newArray.join("|");
this.getHeroNftList(this.starts);
},
async getHeroNftList(pageNo) {
if (!AppModule.accountId) {
return;