|
|
@@ -1,24 +1,24 @@
|
|
|
<template>
|
|
|
<van-pull-refresh
|
|
|
- success-text="加载成功"
|
|
|
- success-duration="500"
|
|
|
- class="discover"
|
|
|
- v-model="isLoading"
|
|
|
- @refresh="onRefresh"
|
|
|
- >
|
|
|
- <van-sticky ref="top">
|
|
|
- <div class="padding-safe-top">
|
|
|
- <div class="top">
|
|
|
- <img src="@assets/nav_logo.png" class="logo" alt="" />
|
|
|
-
|
|
|
- <div class="search" @click="$router.push('/productSearch')">
|
|
|
- <img src="@assets/icon-sosuo.png" alt="" />
|
|
|
- <span> 搜索你要的精彩 </span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </van-sticky>
|
|
|
- <!-- <swiper :slides-per-view="3" :space-between="16" class="mySwiper" :autoplay="{ delay: 3500 }">
|
|
|
+ success-text="加载成功"
|
|
|
+ success-duration="500"
|
|
|
+ class="discover"
|
|
|
+ v-model="isLoading"
|
|
|
+ @refresh="onRefresh"
|
|
|
+ >
|
|
|
+ <van-sticky ref="top">
|
|
|
+ <div class="padding-safe-top">
|
|
|
+ <div class="top">
|
|
|
+ <img src="@assets/nav_logo.png" class="logo" alt="" />
|
|
|
+
|
|
|
+ <div class="search" @click="$router.push('/productSearch')">
|
|
|
+ <img src="@assets/icon-sosuo.png" alt="" />
|
|
|
+ <span> 搜索你要的精彩 </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </van-sticky>
|
|
|
+ <!-- <swiper :slides-per-view="3" :space-between="16" class="mySwiper" :autoplay="{ delay: 3500 }">
|
|
|
<swiper-slide v-for="(item, index) in banners" :key="item.id">
|
|
|
<van-image
|
|
|
width="100%"
|
|
|
@@ -35,49 +35,49 @@
|
|
|
</swiper-slide>
|
|
|
</swiper> -->
|
|
|
|
|
|
- <div class="menu">
|
|
|
- <div class="menu-con menu-cons">
|
|
|
- <div
|
|
|
- class="menu-item_con menu-item_con_one"
|
|
|
- @click="$router.push('/hopeMarket')"
|
|
|
- v-if="!$store.state.review"
|
|
|
- >
|
|
|
- <img :src="require(`@assets/info_icon_banquanshichang@3x.png`)" alt="" class="menu-item_con_img" />
|
|
|
- <div>
|
|
|
- <div class="menu-item_con_title"> 元宇宙物资市场 </div>
|
|
|
- <div class="menu-item_con_text"> 买卖你的元宇宙资产 </div>
|
|
|
- </div>
|
|
|
- <img :src="require(`@assets/png-yuanyuzhou@3x.png`)" alt="" class="menu-item_con_bg" />
|
|
|
- </div>
|
|
|
- <div class="menu-item_con menu-item_con_two" @click="$router.push('/activityList')">
|
|
|
- <img
|
|
|
- :src="require(`@assets/info_icon_banquanshichang@3x (1).png`)"
|
|
|
- alt=""
|
|
|
- class="menu-item_con_img"
|
|
|
- />
|
|
|
- <div>
|
|
|
- <div class="menu-item_con_title"> 铸造合成中心 </div>
|
|
|
- <div class="menu-item_con_text"> 虚实结合,探索未知 </div>
|
|
|
- </div>
|
|
|
- <img src="../assets/png-hecheng@3x.png" alt="" class="menu-item_con_bg" />
|
|
|
- </div>
|
|
|
- <!-- <div class="text1">
|
|
|
+ <div class="menu">
|
|
|
+ <div class="menu-con menu-cons">
|
|
|
+ <div
|
|
|
+ class="menu-item_con menu-item_con_one"
|
|
|
+ @click="$router.push('/hopeMarket')"
|
|
|
+ v-if="!$store.state.review"
|
|
|
+ >
|
|
|
+ <img :src="require(`@assets/info_icon_banquanshichang@3x.png`)" alt="" class="menu-item_con_img" />
|
|
|
+ <div>
|
|
|
+ <div class="menu-item_con_title">元宇宙物资市场</div>
|
|
|
+ <div class="menu-item_con_text">买卖你的元宇宙资产</div>
|
|
|
+ </div>
|
|
|
+ <img :src="require(`@assets/png-yuanyuzhou@3x.png`)" alt="" class="menu-item_con_bg" />
|
|
|
+ </div>
|
|
|
+ <div class="menu-item_con menu-item_con_two" @click="$router.push('/activityList')">
|
|
|
+ <img
|
|
|
+ :src="require(`@assets/info_icon_banquanshichang@3x (1).png`)"
|
|
|
+ alt=""
|
|
|
+ class="menu-item_con_img"
|
|
|
+ />
|
|
|
+ <div>
|
|
|
+ <div class="menu-item_con_title">铸造合成中心</div>
|
|
|
+ <div class="menu-item_con_text">虚实结合,探索未知</div>
|
|
|
+ </div>
|
|
|
+ <img src="../assets/png-hecheng@3x.png" alt="" class="menu-item_con_bg" />
|
|
|
+ </div>
|
|
|
+ <!-- <div class="text1">
|
|
|
<img src="../assets/info_icon_yishuzhanguan.png" alt="" />
|
|
|
<span> 艺术展览 </span>
|
|
|
</div>
|
|
|
<div class="text2"> 环球捕猎顶级艺术展览,尽在绿洲宇宙! </div>
|
|
|
<img src="../assets/discover/yishuzhanlan-diwen.png" alt="" class="menu-bg" /> -->
|
|
|
- </div>
|
|
|
- <div class="menu-con">
|
|
|
- <div class="menu-item_con menu-item_con_three" @click="$router.push('/auction')">
|
|
|
- <img :src="require(`@assets/info_icon_paimaixilie@3x.png`)" alt="" class="menu-item_con_img" />
|
|
|
- <div>
|
|
|
- <div class="menu-item_con_title"> 绿洲易拍 </div>
|
|
|
- <div class="menu-item_con_text"> 精品元宇宙物资与数字艺术品拍卖商 </div>
|
|
|
- </div>
|
|
|
- <img :src="require(`@assets/png-yipai@3x.png`)" alt="" class="menu-item_con_bg" />
|
|
|
- </div>
|
|
|
- <!-- <div
|
|
|
+ </div>
|
|
|
+ <div class="menu-con">
|
|
|
+ <div class="menu-item_con menu-item_con_three" @click="$router.push('/auction')">
|
|
|
+ <img :src="require(`@assets/info_icon_paimaixilie@3x.png`)" alt="" class="menu-item_con_img" />
|
|
|
+ <div>
|
|
|
+ <div class="menu-item_con_title">绿洲易拍</div>
|
|
|
+ <div class="menu-item_con_text">精品元宇宙物资与数字艺术品拍卖商</div>
|
|
|
+ </div>
|
|
|
+ <img :src="require(`@assets/png-yipai@3x.png`)" alt="" class="menu-item_con_bg" />
|
|
|
+ </div>
|
|
|
+ <!-- <div
|
|
|
class="menu-item_con menu-item_con_four"
|
|
|
@click="
|
|
|
goWin(
|
|
|
@@ -85,22 +85,22 @@
|
|
|
)
|
|
|
"
|
|
|
> -->
|
|
|
- <div class="menu-item_con menu-item_con_four" @click="$router.push('/domainname')">
|
|
|
- <img :src="require(`@assets/info_icon_yanshengping@3x.png`)" alt="" class="menu-item_con_img" />
|
|
|
- <div>
|
|
|
- <div class="menu-item_con_title"> 元宇宙域名 </div>
|
|
|
- <div class="menu-item_con_text"> 属于你的元宇宙标识 </div>
|
|
|
- </div>
|
|
|
- <img src="../assets/png-yanshengpin@3x.png" alt="" class="menu-item_con_bg" />
|
|
|
- </div>
|
|
|
- <!-- <div class="text1">
|
|
|
+ <div class="menu-item_con menu-item_con_four" @click="$router.push('/domainname')">
|
|
|
+ <img :src="require(`@assets/info_icon_yanshengping@3x.png`)" alt="" class="menu-item_con_img" />
|
|
|
+ <div>
|
|
|
+ <div class="menu-item_con_title">元宇宙域名</div>
|
|
|
+ <div class="menu-item_con_text">属于你的元宇宙标识</div>
|
|
|
+ </div>
|
|
|
+ <img src="../assets/png-yanshengpin@3x.png" alt="" class="menu-item_con_bg" />
|
|
|
+ </div>
|
|
|
+ <!-- <div class="text1">
|
|
|
<img src="../assets/info_icon_yishuzhanguan.png" alt="" />
|
|
|
<span> 艺术展览 </span>
|
|
|
</div>
|
|
|
<div class="text2"> 环球捕猎顶级艺术展览,尽在绿洲宇宙! </div>
|
|
|
<img src="../assets/discover/yishuzhanlan-diwen.png" alt="" class="menu-bg" /> -->
|
|
|
- </div>
|
|
|
- <!-- <div class="menu-right">
|
|
|
+ </div>
|
|
|
+ <!-- <div class="menu-right">
|
|
|
<div class="menu-item" @click="$router.push('/hopeMarket')" v-if="!$store.state.review">
|
|
|
<div class="text1">
|
|
|
<img src="../assets/discover/info_icon_banquanshichang.png" alt="" />
|
|
|
@@ -125,9 +125,9 @@
|
|
|
<img src="../assets/shangcheng-diwen.png" alt="" class="menu-bg" />
|
|
|
</div>
|
|
|
</div> -->
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
|
|
|
- <!-- <van-grid :border="false" :column-num="$store.state.review ? 2 : 4">
|
|
|
+ <!-- <van-grid :border="false" :column-num="$store.state.review ? 2 : 4">
|
|
|
<van-grid-item
|
|
|
text="绿洲头条"
|
|
|
:to="{
|
|
|
@@ -158,75 +158,76 @@
|
|
|
<img class="grid-img" src="@assets/info_icon_weshoushichang.png" />
|
|
|
</template>
|
|
|
</van-grid-item> -->
|
|
|
- <!-- <van-grid-item text="铸造商店" @click="wait">
|
|
|
+ <!-- <van-grid-item text="铸造商店" @click="wait">
|
|
|
<template v-slot:icon>
|
|
|
<img class="grid-img" src="@assets/info_icon_zhuzaoshangdian.png" />
|
|
|
</template>
|
|
|
</van-grid-item> -->
|
|
|
- <!-- </van-grid> -->
|
|
|
-
|
|
|
- <div class="box" ref="box">
|
|
|
- <van-sticky :offset-top="tabOffSet">
|
|
|
- <van-tabs
|
|
|
- class="box-tabs"
|
|
|
- v-model:active="sort"
|
|
|
- shrink
|
|
|
- line-width="16"
|
|
|
- :before-change="beforeChange"
|
|
|
- line-height="2"
|
|
|
- @change="getList(true)"
|
|
|
- >
|
|
|
- <van-tab v-for="(item, index) in selectOptions" :key="index" :title="item.label" :name="item.value">
|
|
|
- </van-tab>
|
|
|
- </van-tabs>
|
|
|
- <div class="meta_domain_classify" v-if="sort == 'domain'">
|
|
|
- <div
|
|
|
- @click="buyingSelling"
|
|
|
- class="meta_domain_classify_con"
|
|
|
- :class="{ domainClassify: domainClassify == 1 }"
|
|
|
- >
|
|
|
- 最新发布 </div>
|
|
|
- <div
|
|
|
- @click="positionRanking"
|
|
|
- class="meta_domain_classify_con"
|
|
|
- :class="{ domainClassify: domainClassify == 2 }"
|
|
|
- >
|
|
|
- 最多点赞
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </van-sticky>
|
|
|
- <van-list
|
|
|
- style="padding-bottom: 100px"
|
|
|
- class="box-list"
|
|
|
- v-model:loading="loading"
|
|
|
- :finished="finished"
|
|
|
- finished-text=""
|
|
|
- @load="getList"
|
|
|
- :class="{ hotList: sort === 'hot' || sort === 'art_Exhibition' }"
|
|
|
- :immediate-check="false"
|
|
|
- >
|
|
|
- <template v-for="(item, index) in showList" :key="item.id">
|
|
|
- <product-info
|
|
|
- v-if="sort === 'collection' || sort === 'collection_MY' || sort === 'domain'"
|
|
|
- v-model:info="list[index]"
|
|
|
- dark
|
|
|
- >
|
|
|
- </product-info>
|
|
|
- <creator-small v-else-if="sort === 'creator'" v-model:info="list[index]"> </creator-small>
|
|
|
- <show-info v-else-if="sort === 'art_Exhibition'" v-model:info="list[item.index]" list> </show-info>
|
|
|
- <show-info v-else-if="sort === 'hot'" v-model:info="list[index]" list> </show-info>
|
|
|
- </template>
|
|
|
- <van-empty
|
|
|
- v-if="empty"
|
|
|
- :description="`还没有个人藏品哦`"
|
|
|
- :image="require(`@assets/empty_img_asset_dark.png`)"
|
|
|
- />
|
|
|
- </van-list>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="tabbar-placeholder"> </div>
|
|
|
- <img src="../assets/icon_zhiding.png" @click="goTop" class="goTop" v-if="bodyScroll > 100" alt="" />
|
|
|
- </van-pull-refresh>
|
|
|
+ <!-- </van-grid> -->
|
|
|
+
|
|
|
+ <div class="box" ref="box">
|
|
|
+ <van-sticky :offset-top="tabOffSet">
|
|
|
+ <van-tabs
|
|
|
+ class="box-tabs"
|
|
|
+ v-model:active="sort"
|
|
|
+ shrink
|
|
|
+ line-width="16"
|
|
|
+ :before-change="beforeChange"
|
|
|
+ line-height="2"
|
|
|
+ @change="getList(true)"
|
|
|
+ >
|
|
|
+ <van-tab v-for="(item, index) in selectOptions" :key="index" :title="item.label" :name="item.value">
|
|
|
+ </van-tab>
|
|
|
+ </van-tabs>
|
|
|
+ <div class="meta_domain_classify" v-if="sort == 'domain'">
|
|
|
+ <div
|
|
|
+ @click="buyingSelling"
|
|
|
+ class="meta_domain_classify_con"
|
|
|
+ :class="{ domainClassify: domainClassify == 1 }"
|
|
|
+ >
|
|
|
+ 最新发布
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ @click="positionRanking"
|
|
|
+ class="meta_domain_classify_con"
|
|
|
+ :class="{ domainClassify: domainClassify == 2 }"
|
|
|
+ >
|
|
|
+ 最多点赞
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </van-sticky>
|
|
|
+ <van-list
|
|
|
+ style="padding-bottom: 100px"
|
|
|
+ class="box-list"
|
|
|
+ v-model:loading="loading"
|
|
|
+ :finished="finished"
|
|
|
+ finished-text=""
|
|
|
+ @load="getList"
|
|
|
+ :class="{ hotList: sort === 'hot' || sort === 'art_Exhibition' }"
|
|
|
+ :immediate-check="false"
|
|
|
+ >
|
|
|
+ <template v-for="(item, index) in showList" :key="item.id">
|
|
|
+ <product-info
|
|
|
+ v-if="sort === 'collection' || sort === 'collection_MY' || sort === 'domain'"
|
|
|
+ v-model:info="list[index]"
|
|
|
+ dark
|
|
|
+ >
|
|
|
+ </product-info>
|
|
|
+ <creator-small v-else-if="sort === 'creator'" v-model:info="list[index]"> </creator-small>
|
|
|
+ <show-info v-else-if="sort === 'art_Exhibition'" v-model:info="list[item.index]" list> </show-info>
|
|
|
+ <show-info v-else-if="sort === 'hot'" v-model:info="list[index]" list> </show-info>
|
|
|
+ </template>
|
|
|
+ <van-empty
|
|
|
+ v-if="empty"
|
|
|
+ :description="`还没有个人藏品哦`"
|
|
|
+ :image="require(`@assets/empty_img_asset_dark.png`)"
|
|
|
+ />
|
|
|
+ </van-list>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="tabbar-placeholder"></div>
|
|
|
+ <img src="../assets/icon_zhiding.png" @click="goTop" class="goTop" v-if="bodyScroll > 100" alt="" />
|
|
|
+ </van-pull-refresh>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
@@ -237,335 +238,335 @@ import CreatorSmall from '../components/creator/CreatorSmall.vue';
|
|
|
import ShowInfo from '../components/asset/showInfo.vue';
|
|
|
import { useCssVar } from '@vueuse/core';
|
|
|
export default {
|
|
|
- name: 'discover',
|
|
|
- inject: ['bar', 'setKeeps', 'scrollWrapper', 'changeScroll', 'bodyScroll', 'safeTop'],
|
|
|
- mixins: [banner, product],
|
|
|
- components: {
|
|
|
- ProductInfo,
|
|
|
- CreatorSmall,
|
|
|
- ShowInfo
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- domainClassify: 1,
|
|
|
- stiky: null,
|
|
|
- banners: [],
|
|
|
- box: [],
|
|
|
- products: [],
|
|
|
- hots: [],
|
|
|
- miners: [],
|
|
|
- list: [],
|
|
|
- loading: false,
|
|
|
- finished: false,
|
|
|
- page: 0,
|
|
|
- empty: false,
|
|
|
- scrollTop: 0,
|
|
|
- sort: 'collection',
|
|
|
- selectOptions: [
|
|
|
- {
|
|
|
- label: '数字商品',
|
|
|
- value: 'collection'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '元域名',
|
|
|
- value: 'domain'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '个人作品',
|
|
|
- value: 'collection_MY'
|
|
|
- }
|
|
|
- ],
|
|
|
- icons: [
|
|
|
- require('../assets/info_icon_lvzhoutoutiao.png'),
|
|
|
- require('../assets/info_icon_lvzhougongyi.png'),
|
|
|
- require('../assets/info_icon_banquanshichang.png')
|
|
|
- ],
|
|
|
- swiperRef: null,
|
|
|
- notLike: '',
|
|
|
- safeTop: useCssVar('--safe-top', document.body)
|
|
|
- };
|
|
|
- },
|
|
|
- computed: {
|
|
|
- tabOffSet() {
|
|
|
- return Number((this.safeTop || '0').replace('px', '')) + 50;
|
|
|
- },
|
|
|
- showList() {
|
|
|
- if (this.sort === 'art_Exhibition') {
|
|
|
- let list = [...this.list];
|
|
|
- return list
|
|
|
- .map((item, index) => {
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- index: index
|
|
|
- };
|
|
|
- })
|
|
|
- .filter(item => {
|
|
|
- return item.collections && item.collections.length > 0;
|
|
|
- });
|
|
|
- } else {
|
|
|
- return this.list;
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- this.$store.dispatch('getUsedBuy');
|
|
|
- this.getInit();
|
|
|
-
|
|
|
- if (window.cordova && StatusBar && StatusBar.isVisible) {
|
|
|
- StatusBar.styleLightContent();
|
|
|
- }
|
|
|
- this.$http
|
|
|
- .get('/sysConfig/get/collect_not')
|
|
|
- .then(res => {
|
|
|
- console.log(res);
|
|
|
- this.notLike = res.value;
|
|
|
- return Promise.resolve();
|
|
|
- })
|
|
|
- .catch(e => {
|
|
|
- return Promise.resolve();
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.getList();
|
|
|
- });
|
|
|
-
|
|
|
- this.emitter.on('updateList', info => {
|
|
|
- let list = [...this.list];
|
|
|
- list.forEach((item, index) => {
|
|
|
- if (info.id === item.id) {
|
|
|
- list[index] = info;
|
|
|
- }
|
|
|
- });
|
|
|
- this.list = list;
|
|
|
- });
|
|
|
- },
|
|
|
- methods: {
|
|
|
- buyingSelling() {
|
|
|
- this.domainClassify = 1;
|
|
|
- this.getList(true);
|
|
|
- },
|
|
|
- positionRanking() {
|
|
|
- this.domainClassify = 2;
|
|
|
- this.getList(true);
|
|
|
- },
|
|
|
- getInit() {
|
|
|
- this.$toast.loading({
|
|
|
- message: '加载中...',
|
|
|
- forbidClick: true
|
|
|
- });
|
|
|
- return this.getBanner();
|
|
|
- // this.getProduct('BLIND_BOX', this.sortOptions['精选盲盒']).then(res => {
|
|
|
- // this.box = res;
|
|
|
- // });
|
|
|
- // this.getProduct('DEFAULT', this.sortOptions['最HOT收藏品'], 'TRANSFER', 4).then(res => {
|
|
|
- // this.hots = res;
|
|
|
- // });
|
|
|
- // this.getProduct('DEFAULT', this.sortOptions['本期推荐']).then(res => {
|
|
|
- // this.products = res;
|
|
|
- // });
|
|
|
- // this.getMiner();
|
|
|
- },
|
|
|
- setSwiperRef(ref) {
|
|
|
- this.swiperRef = ref;
|
|
|
- },
|
|
|
- getProduct(type = '', sort = 'sort,desc', source = 'OFFICIAL', size = 4) {
|
|
|
- return this.$http
|
|
|
- .post(
|
|
|
- '/collection/all',
|
|
|
- {
|
|
|
- page: 0,
|
|
|
- size: size,
|
|
|
- query: {
|
|
|
- type: type,
|
|
|
- onShelf: true,
|
|
|
- del: false,
|
|
|
- source: source
|
|
|
- },
|
|
|
- sort: sort
|
|
|
- },
|
|
|
- { body: 'json' }
|
|
|
- )
|
|
|
- .then(res => {
|
|
|
- return Promise.resolve(res.content);
|
|
|
- });
|
|
|
- },
|
|
|
- getBanner() {
|
|
|
- return this.$http
|
|
|
- .post(
|
|
|
- '/banner/all',
|
|
|
- {
|
|
|
- query: {
|
|
|
- type: 'DISCOVER',
|
|
|
- del: false
|
|
|
- },
|
|
|
- sort: 'sort,asc;createdAt,desc'
|
|
|
- },
|
|
|
- { body: 'json' }
|
|
|
- )
|
|
|
- .then(res => {
|
|
|
- this.banners = res.content;
|
|
|
- this.$toast.clear();
|
|
|
- if (this.swiperRef) {
|
|
|
- this.swiperRef.update();
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- beforeChange(index) {
|
|
|
- // if (index === 'hot') {
|
|
|
- // this.wait();
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- return true;
|
|
|
- },
|
|
|
- getList(isFirst = false) {
|
|
|
- if (isFirst) {
|
|
|
- this.page = 0;
|
|
|
- this.list = [];
|
|
|
- this.changeScroll(this.$refs.box.offsetTop - this.safeTop.split('px')[0].trim() - 50);
|
|
|
- }
|
|
|
- this.loading = true;
|
|
|
- this.finished = false;
|
|
|
- this.empty = false;
|
|
|
- let url = '/collection/all';
|
|
|
- let query = {
|
|
|
- onShelf: true,
|
|
|
- del: false,
|
|
|
- source: this.$store.state.reviewPay ? 'OFFICIAL' : '',
|
|
|
- notLike: this.notLike,
|
|
|
- type: 'DEFAULT,BLIND_BOX'
|
|
|
- };
|
|
|
- let sort = 'createdAt,desc';
|
|
|
- if (this.sort === 'collection_MY') {
|
|
|
- query.type = 'PICTURE';
|
|
|
- } else if (this.sort === 'domain') {
|
|
|
- url = '/collection/all';
|
|
|
- query = {
|
|
|
- type: 'DOMAIN'
|
|
|
- };
|
|
|
- if (this.domainClassify == 1) {
|
|
|
- sort = 'createdAt,desc';
|
|
|
- } else {
|
|
|
- sort = 'likes,desc';
|
|
|
- }
|
|
|
- } else if (this.sort === 'art_Exhibition') {
|
|
|
- url = 'showroom/all';
|
|
|
- query = {
|
|
|
- del: false,
|
|
|
- status: 'SUCCESS',
|
|
|
- publish: true,
|
|
|
- type: ''
|
|
|
- };
|
|
|
- sort = 'heats,desc';
|
|
|
- } else if (this.sort === 'hot') {
|
|
|
- url = 'showroom/all';
|
|
|
- query = {
|
|
|
- del: false,
|
|
|
- status: 'SUCCESS',
|
|
|
- publish: true
|
|
|
- };
|
|
|
- sort = 'heats,desc';
|
|
|
- } else {
|
|
|
- query.minPrice = 0;
|
|
|
- }
|
|
|
-
|
|
|
- return this.$http
|
|
|
- .post(
|
|
|
- url,
|
|
|
- {
|
|
|
- page: this.page,
|
|
|
- size: 20,
|
|
|
- query: query,
|
|
|
- sort: sort
|
|
|
- },
|
|
|
- { body: 'json' }
|
|
|
- )
|
|
|
- .then(res => {
|
|
|
- if (res.first) {
|
|
|
- this.page = 0;
|
|
|
- this.list = res.content;
|
|
|
- } else {
|
|
|
- this.list = [...this.list, ...res.content];
|
|
|
- }
|
|
|
- this.empty = res.empty;
|
|
|
- this.loading = false;
|
|
|
- this.finished = res.last;
|
|
|
- if (!res.last) {
|
|
|
- this.page = this.page + 1;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- getMiner() {
|
|
|
- this.$http
|
|
|
- .post(
|
|
|
- '/user/all',
|
|
|
- {
|
|
|
- page: 0,
|
|
|
- query: { minter: true },
|
|
|
- size: 5,
|
|
|
- sort: 'sales,desc'
|
|
|
- },
|
|
|
- { body: 'json' }
|
|
|
- )
|
|
|
- .then(res => {
|
|
|
- this.miners = res.content;
|
|
|
- // console.log(this.miners);
|
|
|
- });
|
|
|
- },
|
|
|
- onRefresh() {
|
|
|
- this.page = 0;
|
|
|
- Promise.all([this.getInit(), this.getList(), this.$store.dispatch('getUsedBuy')]).then(res => {
|
|
|
- this.isLoading = false;
|
|
|
- });
|
|
|
- },
|
|
|
- goTop() {
|
|
|
- this.changeScroll(0, true);
|
|
|
- },
|
|
|
- goHall() {
|
|
|
- this.$http
|
|
|
- .get('/sysConfig/get/hall_show')
|
|
|
- .then(res => {
|
|
|
- if (res.value === true || res.value === '1') {
|
|
|
- this.$router.push('/hallList');
|
|
|
- } else {
|
|
|
- return Promise.reject();
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.wait();
|
|
|
- });
|
|
|
- },
|
|
|
- goAuction() {
|
|
|
- this.$http
|
|
|
- .get('/sysConfig/get/auction_show')
|
|
|
- .then(res => {
|
|
|
- if (res.value === true || res.value === '1') {
|
|
|
- this.$router.push('/auction');
|
|
|
- } else {
|
|
|
- return Promise.reject();
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.$toast('升级改版中');
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- activated() {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.changeScroll(this.scrollTop);
|
|
|
- });
|
|
|
- if (window.cordova && StatusBar && StatusBar.isVisible) {
|
|
|
- StatusBar.styleLightContent();
|
|
|
- }
|
|
|
- },
|
|
|
- beforeRouteLeave(to, from, next) {
|
|
|
- if (!to.meta.menuPage || to.path === '/hall') {
|
|
|
- this.scrollTop = this.scrollWrapper.scrollTop;
|
|
|
- this.setKeeps(['index', 'discover']);
|
|
|
- } else {
|
|
|
- this.scrollTop = 0;
|
|
|
- this.setKeeps(['index', 'discover'], false);
|
|
|
- }
|
|
|
- next();
|
|
|
- }
|
|
|
+ name: 'discover',
|
|
|
+ inject: ['bar', 'setKeeps', 'scrollWrapper', 'changeScroll', 'bodyScroll', 'safeTop'],
|
|
|
+ mixins: [banner, product],
|
|
|
+ components: {
|
|
|
+ ProductInfo,
|
|
|
+ CreatorSmall,
|
|
|
+ ShowInfo
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ domainClassify: 1,
|
|
|
+ stiky: null,
|
|
|
+ banners: [],
|
|
|
+ box: [],
|
|
|
+ products: [],
|
|
|
+ hots: [],
|
|
|
+ miners: [],
|
|
|
+ list: [],
|
|
|
+ loading: false,
|
|
|
+ finished: false,
|
|
|
+ page: 0,
|
|
|
+ empty: false,
|
|
|
+ scrollTop: 0,
|
|
|
+ sort: 'collection',
|
|
|
+ selectOptions: [
|
|
|
+ {
|
|
|
+ label: '数字商品',
|
|
|
+ value: 'collection'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '元域名',
|
|
|
+ value: 'domain'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '个人作品',
|
|
|
+ value: 'collection_MY'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ icons: [
|
|
|
+ require('../assets/info_icon_lvzhoutoutiao.png'),
|
|
|
+ require('../assets/info_icon_lvzhougongyi.png'),
|
|
|
+ require('../assets/info_icon_banquanshichang.png')
|
|
|
+ ],
|
|
|
+ swiperRef: null,
|
|
|
+ notLike: '',
|
|
|
+ safeTop: useCssVar('--safe-top', document.body)
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ tabOffSet() {
|
|
|
+ return Number((this.safeTop || '0').replace('px', '')) + 50;
|
|
|
+ },
|
|
|
+ showList() {
|
|
|
+ if (this.sort === 'art_Exhibition') {
|
|
|
+ let list = [...this.list];
|
|
|
+ return list
|
|
|
+ .map((item, index) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ index: index
|
|
|
+ };
|
|
|
+ })
|
|
|
+ .filter(item => {
|
|
|
+ return item.collections && item.collections.length > 0;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return this.list;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.$store.dispatch('getUsedBuy');
|
|
|
+ this.getInit();
|
|
|
+
|
|
|
+ if (window.cordova && StatusBar && StatusBar.isVisible) {
|
|
|
+ StatusBar.styleLightContent();
|
|
|
+ }
|
|
|
+ this.$http
|
|
|
+ .get('/sysConfig/get/collect_not')
|
|
|
+ .then(res => {
|
|
|
+ console.log(res);
|
|
|
+ this.notLike = res.value;
|
|
|
+ return Promise.resolve();
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ return Promise.resolve();
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+
|
|
|
+ this.emitter.on('updateList', info => {
|
|
|
+ let list = [...this.list];
|
|
|
+ list.forEach((item, index) => {
|
|
|
+ if (info.id === item.id) {
|
|
|
+ list[index] = info;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.list = list;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ buyingSelling() {
|
|
|
+ this.domainClassify = 1;
|
|
|
+ this.getList(true);
|
|
|
+ },
|
|
|
+ positionRanking() {
|
|
|
+ this.domainClassify = 2;
|
|
|
+ this.getList(true);
|
|
|
+ },
|
|
|
+ getInit() {
|
|
|
+ this.$toast.loading({
|
|
|
+ message: '加载中...',
|
|
|
+ forbidClick: true
|
|
|
+ });
|
|
|
+ return this.getBanner();
|
|
|
+ // this.getProduct('BLIND_BOX', this.sortOptions['精选盲盒']).then(res => {
|
|
|
+ // this.box = res;
|
|
|
+ // });
|
|
|
+ // this.getProduct('DEFAULT', this.sortOptions['最HOT收藏品'], 'TRANSFER', 4).then(res => {
|
|
|
+ // this.hots = res;
|
|
|
+ // });
|
|
|
+ // this.getProduct('DEFAULT', this.sortOptions['本期推荐']).then(res => {
|
|
|
+ // this.products = res;
|
|
|
+ // });
|
|
|
+ // this.getMiner();
|
|
|
+ },
|
|
|
+ setSwiperRef(ref) {
|
|
|
+ this.swiperRef = ref;
|
|
|
+ },
|
|
|
+ getProduct(type = '', sort = 'sort,desc', source = 'OFFICIAL', size = 4) {
|
|
|
+ return this.$http
|
|
|
+ .post(
|
|
|
+ '/collection/all',
|
|
|
+ {
|
|
|
+ page: 0,
|
|
|
+ size: size,
|
|
|
+ query: {
|
|
|
+ type: type,
|
|
|
+ onShelf: true,
|
|
|
+ del: false,
|
|
|
+ source: source
|
|
|
+ },
|
|
|
+ sort: sort
|
|
|
+ },
|
|
|
+ { body: 'json' }
|
|
|
+ )
|
|
|
+ .then(res => {
|
|
|
+ return Promise.resolve(res.content);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getBanner() {
|
|
|
+ return this.$http
|
|
|
+ .post(
|
|
|
+ '/banner/all',
|
|
|
+ {
|
|
|
+ query: {
|
|
|
+ type: 'DISCOVER',
|
|
|
+ del: false
|
|
|
+ },
|
|
|
+ sort: 'sort,asc;createdAt,desc'
|
|
|
+ },
|
|
|
+ { body: 'json' }
|
|
|
+ )
|
|
|
+ .then(res => {
|
|
|
+ this.banners = res.content;
|
|
|
+ this.$toast.clear();
|
|
|
+ if (this.swiperRef) {
|
|
|
+ this.swiperRef.update();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ beforeChange(index) {
|
|
|
+ // if (index === 'hot') {
|
|
|
+ // this.wait();
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ return true;
|
|
|
+ },
|
|
|
+ getList(isFirst = false) {
|
|
|
+ if (isFirst) {
|
|
|
+ this.page = 0;
|
|
|
+ this.list = [];
|
|
|
+ this.changeScroll(this.$refs.box.offsetTop - this.safeTop.split('px')[0].trim() - 50);
|
|
|
+ }
|
|
|
+ this.loading = true;
|
|
|
+ this.finished = false;
|
|
|
+ this.empty = false;
|
|
|
+ let url = '/collection/all';
|
|
|
+ let query = {
|
|
|
+ onShelf: true,
|
|
|
+ del: false,
|
|
|
+ source: this.$store.state.reviewPay ? 'OFFICIAL' : '',
|
|
|
+ notLike: this.notLike,
|
|
|
+ type: 'DEFAULT,BLIND_BOX'
|
|
|
+ };
|
|
|
+ let sort = 'createdAt,desc';
|
|
|
+ if (this.sort === 'collection_MY') {
|
|
|
+ query.type = 'PICTURE';
|
|
|
+ } else if (this.sort === 'domain') {
|
|
|
+ url = '/collection/all';
|
|
|
+ query = {
|
|
|
+ type: 'DOMAIN'
|
|
|
+ };
|
|
|
+ if (this.domainClassify == 1) {
|
|
|
+ sort = 'createdAt,desc';
|
|
|
+ } else {
|
|
|
+ sort = 'likes,desc';
|
|
|
+ }
|
|
|
+ } else if (this.sort === 'art_Exhibition') {
|
|
|
+ url = 'showroom/all';
|
|
|
+ query = {
|
|
|
+ del: false,
|
|
|
+ status: 'SUCCESS',
|
|
|
+ publish: true,
|
|
|
+ type: ''
|
|
|
+ };
|
|
|
+ sort = 'heats,desc';
|
|
|
+ } else if (this.sort === 'hot') {
|
|
|
+ url = 'showroom/all';
|
|
|
+ query = {
|
|
|
+ del: false,
|
|
|
+ status: 'SUCCESS',
|
|
|
+ publish: true
|
|
|
+ };
|
|
|
+ sort = 'heats,desc';
|
|
|
+ } else {
|
|
|
+ query.minPrice = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return this.$http
|
|
|
+ .post(
|
|
|
+ url,
|
|
|
+ {
|
|
|
+ page: this.page,
|
|
|
+ size: 20,
|
|
|
+ query: query,
|
|
|
+ sort: sort
|
|
|
+ },
|
|
|
+ { body: 'json' }
|
|
|
+ )
|
|
|
+ .then(res => {
|
|
|
+ if (res.first) {
|
|
|
+ this.page = 0;
|
|
|
+ this.list = res.content;
|
|
|
+ } else {
|
|
|
+ this.list = [...this.list, ...res.content];
|
|
|
+ }
|
|
|
+ this.empty = res.empty;
|
|
|
+ this.loading = false;
|
|
|
+ this.finished = res.last;
|
|
|
+ if (!res.last) {
|
|
|
+ this.page = this.page + 1;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getMiner() {
|
|
|
+ this.$http
|
|
|
+ .post(
|
|
|
+ '/user/all',
|
|
|
+ {
|
|
|
+ page: 0,
|
|
|
+ query: { minter: true },
|
|
|
+ size: 5,
|
|
|
+ sort: 'sales,desc'
|
|
|
+ },
|
|
|
+ { body: 'json' }
|
|
|
+ )
|
|
|
+ .then(res => {
|
|
|
+ this.miners = res.content;
|
|
|
+ // console.log(this.miners);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ onRefresh() {
|
|
|
+ this.page = 0;
|
|
|
+ Promise.all([this.getInit(), this.getList(), this.$store.dispatch('getUsedBuy')]).then(res => {
|
|
|
+ this.isLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ goTop() {
|
|
|
+ this.changeScroll(0, true);
|
|
|
+ },
|
|
|
+ goHall() {
|
|
|
+ this.$http
|
|
|
+ .get('/sysConfig/get/hall_show')
|
|
|
+ .then(res => {
|
|
|
+ if (res.value === true || res.value === '1') {
|
|
|
+ this.$router.push('/hallList');
|
|
|
+ } else {
|
|
|
+ return Promise.reject();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.wait();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ goAuction() {
|
|
|
+ this.$http
|
|
|
+ .get('/sysConfig/get/auction_show')
|
|
|
+ .then(res => {
|
|
|
+ if (res.value === true || res.value === '1') {
|
|
|
+ this.$router.push('/auction');
|
|
|
+ } else {
|
|
|
+ return Promise.reject();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$toast('升级改版中');
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ activated() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.changeScroll(this.scrollTop);
|
|
|
+ });
|
|
|
+ if (window.cordova && StatusBar && StatusBar.isVisible) {
|
|
|
+ StatusBar.styleLightContent();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeRouteLeave(to, from, next) {
|
|
|
+ if (!to.meta.menuPage || to.path === '/hall') {
|
|
|
+ this.scrollTop = this.scrollWrapper.scrollTop;
|
|
|
+ this.setKeeps(['index', 'discover']);
|
|
|
+ } else {
|
|
|
+ this.scrollTop = 0;
|
|
|
+ this.setKeeps(['index', 'discover'], false);
|
|
|
+ }
|
|
|
+ next();
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
@@ -796,7 +797,7 @@ export default {
|
|
|
padding: 16px;
|
|
|
background: #272b2e;
|
|
|
|
|
|
- .showInfo+.showInfo {
|
|
|
+ .showInfo + .showInfo {
|
|
|
margin-top: 16px;
|
|
|
}
|
|
|
|