|
|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="container">
|
|
|
- <div class="title">欢迎来到 NFT 市场</div>
|
|
|
+ <div class="title" ref="anchor">欢迎来到 NFT 市场</div>
|
|
|
<div class="tabs">
|
|
|
<div
|
|
|
class="tab"
|
|
|
@@ -12,92 +12,162 @@
|
|
|
{{ item }}
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="border"></div>
|
|
|
- <search-info></search-info>
|
|
|
- <goods-info></goods-info>
|
|
|
- <!-- <div>
|
|
|
+ <el-radio-group class="menu" v-model="type" size="normal">
|
|
|
+ <el-radio-button v-for="(item, index) in typeList" :key="index" :label="item.value">
|
|
|
+ <div class="radio-item">
|
|
|
+ <i class="font_family" :class="[item.icon]"></i>
|
|
|
+ <span>{{ item.label }}</span>
|
|
|
+ </div>
|
|
|
+ </el-radio-button>
|
|
|
+ </el-radio-group>
|
|
|
+
|
|
|
+ <div class="border" style="margin-top: 30px"></div>
|
|
|
+ <div class="search-list">
|
|
|
+ <el-input
|
|
|
+ class="search"
|
|
|
+ prefix-icon="el-icon-search"
|
|
|
+ placeholder="请输入您想找到的作品名称…"
|
|
|
+ v-model="search"
|
|
|
+ clearable
|
|
|
+ @change="getData"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ <el-select class="select" v-model="sortStr" placeholder="请选择">
|
|
|
+ <el-option v-for="item in sortList" :key="item.value" :label="item.label" :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="list" v-loading="fetchingData">
|
|
|
+ <router-link
|
|
|
+ :to="{ path: '/castingDetail?id=' + item.id }"
|
|
|
+ class="content"
|
|
|
+ v-for="item in list"
|
|
|
+ :key="item.id"
|
|
|
+ >
|
|
|
+ <el-image
|
|
|
+ class="imgBox"
|
|
|
+ :src="item.bg || require('../assets/defaultBg.jpg')"
|
|
|
+ fit="cover"
|
|
|
+ :lazy="true"
|
|
|
+ ></el-image>
|
|
|
+ <img class="img" :src="item.avatar || require('../assets/img_default_photo.png')" alt="" />
|
|
|
+ <div class="text">
|
|
|
+ <div class="name">{{ item.nickname }}</div>
|
|
|
+ <img class="img1" src="../assets/img/renzheng_icon@3x.png" alt="" />
|
|
|
+ </div>
|
|
|
+ <div class="text">
|
|
|
+ <div class="name name1">{{ item.id }}</div>
|
|
|
+ <img class="img1 img2" src="../assets/img/copy_icon@3x.png" alt="" />
|
|
|
+ </div>
|
|
|
+ <div class="introduce">{{ item.intro || '该用户什么都没留下...' }}</div>
|
|
|
+ <div class="border"></div>
|
|
|
+ <div class="fans">
|
|
|
+ <div class="followers">
|
|
|
+ <div class="text3">{{ item.followers }}</div>
|
|
|
+ <div class="text4">粉丝</div>
|
|
|
+ </div>
|
|
|
+ <div class="follow" @click.prevent="like(item)">{{ item.follow ? '已关注' : '关注' }}</div>
|
|
|
+ </div>
|
|
|
+ </router-link>
|
|
|
+
|
|
|
+ <el-empty v-if="empty" description="还没有该类型的藏品哦~"></el-empty>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="pagination-wrapper">
|
|
|
<el-pagination
|
|
|
- @size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- :current-page="currentPage4"
|
|
|
+ @size-change="onSizeChange"
|
|
|
+ @current-change="onCurrentChange"
|
|
|
+ :current-page="page"
|
|
|
:page-sizes="[10, 20, 30, 40, 50]"
|
|
|
- :page-size="100"
|
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
|
|
- :total="400"
|
|
|
+ :page-size="pageSize"
|
|
|
+ layout="total, prev, pager, next"
|
|
|
+ :total="totalElements"
|
|
|
>
|
|
|
</el-pagination>
|
|
|
- </div> -->
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import GoodsInfo from '../components/GoodsInfo.vue';
|
|
|
-import SearchInfo from '../components/SearchInfo.vue';
|
|
|
+import pageableTable from '../mixins/pageableTable';
|
|
|
export default {
|
|
|
- components: { GoodsInfo, SearchInfo },
|
|
|
data() {
|
|
|
return {
|
|
|
- tabs: ['全部', '新品', '转让', '拍卖'],
|
|
|
- active: '全部',
|
|
|
- currentPage4: 4
|
|
|
+ typeList: [
|
|
|
+ {
|
|
|
+ label: '全部',
|
|
|
+ icon: 'icon-icon-quanbu',
|
|
|
+ value: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '新品',
|
|
|
+ icon: 'icon-icon-zuixin',
|
|
|
+ value: 'DEFAULT'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '盲盒',
|
|
|
+ icon: 'icon-icon-zhuanrang',
|
|
|
+ value: 'BLIND_BOX'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '拍卖',
|
|
|
+ icon: 'icon-icon-paimai',
|
|
|
+ value: 'AUCTION'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ sortList: [
|
|
|
+ {
|
|
|
+ label: '综合排序',
|
|
|
+ value: 'createdAt,desc'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '热门排序',
|
|
|
+ value: 'likes,desc'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '价格降序',
|
|
|
+ value: 'price,desc'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '价格升序',
|
|
|
+ value: 'price,asc'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ search: '',
|
|
|
+ type: '',
|
|
|
+ url: '/collection/all',
|
|
|
+ list: []
|
|
|
};
|
|
|
},
|
|
|
+ mixins: [pageableTable],
|
|
|
+ watch: {
|
|
|
+ type() {
|
|
|
+ this.$router
|
|
|
+ .replace({
|
|
|
+ query: {
|
|
|
+ ...this.$route.query,
|
|
|
+ type: this.type
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ this.getData();
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
- tab(item) {
|
|
|
- this.active = item;
|
|
|
+ beforeGetData() {
|
|
|
+ return {
|
|
|
+ search: this.search,
|
|
|
+ query: {
|
|
|
+ type: this.type
|
|
|
+ }
|
|
|
+ };
|
|
|
},
|
|
|
- handleSizeChange(val) {
|
|
|
- console.log(`每页 ${val} 条`);
|
|
|
- },
|
|
|
- handleCurrentChange(val) {
|
|
|
- console.log(`当前页: ${val}`);
|
|
|
+ setList(list) {
|
|
|
+ this.list = list;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
-.container {
|
|
|
- padding: 0 200px;
|
|
|
- .title {
|
|
|
- height: 42px;
|
|
|
- font-size: 32px;
|
|
|
- font-weight: 400;
|
|
|
- color: #ffffff;
|
|
|
- line-height: 42px;
|
|
|
- padding: 60px 0;
|
|
|
- }
|
|
|
- .tabs {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- padding-bottom: 30px;
|
|
|
- text-align: center;
|
|
|
- .tab {
|
|
|
- width: 140px;
|
|
|
- border: 1px solid #939599;
|
|
|
- height: 42px;
|
|
|
- font-size: 18px;
|
|
|
- font-weight: bold;
|
|
|
- color: #949699;
|
|
|
- line-height: 42px;
|
|
|
- &.active {
|
|
|
- color: #ffffff;
|
|
|
- background: linear-gradient(46deg, #00ffcb 0%, #006eff 100%);
|
|
|
- }
|
|
|
- &:first-child {
|
|
|
- border-radius: 8px 0px 0px 8px;
|
|
|
- }
|
|
|
- &:last-child {
|
|
|
- border-radius: 0px 8px 8px 0px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .border {
|
|
|
- height: 1px;
|
|
|
- background: #494a4d;
|
|
|
- border-radius: 1px;
|
|
|
- }
|
|
|
-
|
|
|
- // .footer {
|
|
|
- // flex-shrink: 0;
|
|
|
- // }
|
|
|
-}
|
|
|
+@import url('../styles/list.less');
|
|
|
</style>
|