panhui il y a 2 ans
Parent
commit
f2e07f984a

+ 2 - 1
src/views/asset/Detail.vue

@@ -524,7 +524,7 @@
                             <img src="@/assets/icon_xingtu.png" alt="" />
                             <div>铸造星图</div>
                         </div>
-                        <div class="btn-img" @click="showLock = true" v-if="info.category !== '元域名'">
+                        <div class="btn-img" @click="showLock = true">
                             <img src="@/assets/icon_fengcun.png" alt="" />
                             <div>封存</div>
                         </div>
@@ -2710,6 +2710,7 @@ export default {
             color: #ffffff;
             line-height: 24px;
             margin-top: 10px;
+            white-space: nowrap;
         }
     }
 }

+ 1 - 1
src/views/search/SearchAll.vue

@@ -44,7 +44,7 @@
                         <div class="flex1"></div>
                         <div class="time">{{ getTime(item.obj.createdAt) }}</div>
                     </div>
-                    <van-image width="160" height="70" radius="8" :src="item.obj.pic" fit="cover" />
+                    <van-image width="100" height="70" radius="8" :src="item.obj.pic" fit="cover" />
                     <img src="@assets/search-all-newsBg.png" class="news-bg" alt="" />
                 </div>
             </div>

+ 104 - 29
src/views/search/SearchResult.vue

@@ -12,43 +12,70 @@
         </van-sticky>
 
         <div class="content">
-            <van-tabs v-if="!loading" ref="tabs" v-model:active="active" scrollspy sticky :offset-top="topHeight + 106">
+            <van-tabs
+                v-if="!loading && !isEmpty"
+                ref="tabs"
+                v-model:active="active"
+                scrollspy
+                sticky
+                :offset-top="topHeight + 106"
+            >
+                <van-tab title="全部">
+                    <div></div>
+                </van-tab>
                 <van-tab
                     v-for="(item, index) in options"
                     :title-class="item.listKey && searchInfo[item.listKey].length <= 0 ? 'hideTab' : ''"
                     :key="searchKey + index"
                     :title="item.label"
                 >
-                    <div class="tab-title" v-if="item.listKey && searchInfo[item.listKey].length > 0">
-                        {{ item.label }}
-                    </div>
-                    <div
-                        class="van-list"
-                        :class="{
-                            list:
-                                item.listKey === 'news' || item.listKey === 'mintActivities' || item.listKey === 'users'
-                        }"
-                    >
-                        <template v-if="item.listKey">
-                            <component
-                                :is="item.com"
-                                dark
-                                v-model:info="searchInfo[item.listKey][infoIndex]"
-                                v-for="(info, infoIndex) in searchInfo[item.listKey]"
-                                :key="infoIndex"
-                                list
-                            ></component>
-                        </template>
+                    <template v-if="item.listKey && searchInfo[item.listKey].length > 0">
+                        <div class="tab-title" v-if="item.listKey && searchInfo[item.listKey].length > 0">
+                            <span> {{ item.label }}</span>
+
+                            <span
+                                class="tab-more"
+                                v-if="item.listKey && searchInfo[item.listKey].length > 0 && !searchInfo[item.allKey]"
+                                @click="goDetail(item)"
+                                >更多</span
+                            >
+                        </div>
                         <div
-                            class="more"
-                            v-if="item.listKey && searchInfo[item.listKey].length > 0 && !searchInfo[item.allKey]"
-                            @click="goDetail(item)"
+                            class="van-list"
+                            :class="{
+                                list:
+                                    item.listKey === 'news' ||
+                                    item.listKey === 'mintActivities' ||
+                                    item.listKey === 'users'
+                            }"
                         >
-                            查看更多
+                            <template v-if="item.listKey">
+                                <component
+                                    :is="item.com"
+                                    dark
+                                    v-model:info="searchInfo[item.listKey][infoIndex]"
+                                    v-for="(info, infoIndex) in searchInfo[item.listKey]"
+                                    :key="infoIndex"
+                                    list
+                                ></component>
+                            </template>
+                            <!-- <div
+                                class="more"
+                                v-if="item.listKey && searchInfo[item.listKey].length > 0 && !searchInfo[item.allKey]"
+                                @click="goDetail(item)"
+                            >
+                                查看更多
+                            </div> -->
                         </div>
-                    </div>
+                    </template>
                 </van-tab>
             </van-tabs>
+
+            <van-empty
+                v-if="isEmpty"
+                description="什么都没有搜到哦~"
+                :image="require('@assets/empty_img_asset_dark.png')"
+            />
         </div>
     </div>
 </template>
@@ -127,7 +154,8 @@ export default {
                 news: [],
                 mintActivities: [],
                 minters: [],
-                users: []
+                users: [],
+                showrooms: []
             },
             scrollTop: 0
         };
@@ -150,6 +178,19 @@ export default {
             return options.filter(item => {
                 return this.searchInfo[item.listKey] && this.searchInfo[item.listKey].length > 0;
             });
+        },
+        isEmpty() {
+            return (
+                this.searchInfo.collections.length === 0 &&
+                this.searchInfo.domains.length === 0 &&
+                this.searchInfo.pictures.length === 0 &&
+                this.searchInfo.news.length === 0 &&
+                this.searchInfo.mintActivities.length === 0 &&
+                this.searchInfo.minters.length === 0 &&
+                this.searchInfo.users.length === 0 &&
+                this.searchInfo.showrooms.length === 0 &&
+                !this.loading
+            );
         }
     },
     mounted() {
@@ -160,12 +201,17 @@ export default {
     },
     methods: {
         getSearch() {
+            if (!this.search) {
+                this.$toast('搜索内容不能为空');
+                return;
+            }
             this.loading = true;
             this.$toast.loading({
                 message: '加载中...',
                 forbidClick: true
             });
             this.searchKey = this.search;
+            this.active = 0;
             this.$http
                 .post('/statistic/globalSearch', {
                     search: this.search
@@ -269,10 +315,31 @@ export default {
     color: #ffffff;
     line-height: 24px;
     padding: 10px 16px 7px;
+    position: relative;
+    .flex();
+    justify-content: space-between;
     // position: sticky;
     // z-index: 20;
     // top: calc(var(--safe-top) + 148px);
     // background-color: #000;
+    .tab-more {
+        font-size: 12px;
+        color: #ffffff80;
+        &::after {
+            content: '>';
+            margin-left: 3px;
+        }
+    }
+
+    &::after {
+        content: '';
+        position: absolute;
+        bottom: 0;
+        left: 16px;
+        right: 16px;
+        background: #272728;
+        height: 1px;
+    }
 }
 
 .block {
@@ -281,7 +348,7 @@ export default {
 }
 
 .van-list {
-    padding: 8px;
+    padding: 4px 8px;
     --bg2: #2b2b2c;
     --text0: #fff;
     --btnplaintBg: rgba(255, 255, 255, 0.08);
@@ -298,10 +365,14 @@ export default {
     .showInfo + .showInfo {
         margin-top: 16px;
     }
+
+    .product.dark {
+        background-color: #2b2b2c;
+    }
 }
 
 .list {
-    margin: 8px 16px 0;
+    margin: 12px 16px 0;
     padding: 0;
     border-radius: 8px;
     overflow: hidden;
@@ -320,4 +391,8 @@ export default {
         margin-left: 10px;
     }
 }
+
+.content {
+    padding-bottom: 100px;
+}
 </style>

+ 8 - 1
src/views/user/SuperLink.vue

@@ -13,6 +13,11 @@
                     <div class="link-btn" @click="goChange(item)">更改</div>
                 </div>
             </div>
+            <van-empty
+                v-if="list.length === 0 && !loading"
+                description="暂未绑定超链"
+                :image="require('@assets/empty_img_asset_dark.png')"
+            />
         </div>
     </div>
 </template>
@@ -22,13 +27,15 @@ import superLink from '@/mixins/superLink';
 export default {
     data() {
         return {
-            list: []
+            list: [],
+            loading: true
         };
     },
     mixins: [product, superLink],
     mounted() {
         this.$http.get('/domainOrder/showMyHyperLink').then(res => {
             this.list = res;
+            this.loading = false;
         });
     },
     methods: {