Explorar o código

feat: 移动端首页样式调整

cuiyalong hai 1 ano
pai
achega
0fb23dbfee

+ 3 - 2
apps/mobile/src/components/ad/Swipe.vue

@@ -13,6 +13,7 @@
           v-for="(item, index) in getImages"
           :key="index"
           :style="{ width: getItemWidth }"
+          class="van-clickable"
           @click="open(item)"
         >
           <van-image
@@ -132,9 +133,9 @@ export default {
 $swipe-item-fill-color: #edeff2;
 
 $swipe-item-width: 343px;
-$swipe-item-height: 120px;
+$swipe-item-height: 88px;
 $swipe-item-margin: 16px;
-$swipe-item-radius: 8px;
+$swipe-item-radius: 12px;
 $swipe-indicator-bottom: 6px;
 $swipe-indicator-size: 4px;
 

+ 45 - 17
apps/mobile/src/components/home/list.vue

@@ -1,19 +1,25 @@
 <template>
   <div class="home-list">
-    <p class="title">最新标讯</p>
+    <div class="divider-container">
+      <van-divider>最新标讯</van-divider>
+    </div>
     <van-loading v-if="loading" style="text-align: center" />
-    <div class="to-setting-container" v-if="showToSettingTip">
-      <div class="to-setting-content">
+    <div class="to-setting-container float-bottom" v-if="showToSettingTip">
+      <div class="to-setting-content bg-white">
         <div class="to-setting-text">
           为了使您接收更多信息,可对关键词进行新增或修改。
         </div>
-        <van-button
+        <button class="action-button clickable">
+          <span>去设置</span>
+          <van-icon name="arrow" />
+        </button>
+        <!-- <van-button
           size="mini"
           class="setting-button"
           type="confirm"
           @click="gotoKeySettingPage"
           >去设置</van-button
-        >
+        > -->
       </div>
     </div>
     <div class="list">
@@ -143,7 +149,7 @@
 </template>
 
 <script>
-import { Button, Loading, Popup } from 'vant'
+import { Button, Loading, Popup, Divider, Icon } from 'vant'
 import bidStatusNode from '@/components/bid-update/BidUpdate'
 import { AppEmpty, AppIcon, ProjectCell } from '@/ui'
 import {
@@ -167,9 +173,11 @@ export default {
     [AppEmpty.name]: AppEmpty,
     [AppIcon.name]: AppIcon,
     [ProjectCell.name]: ProjectCell,
+    [Icon.name]: Icon,
     [Popup.name]: Popup,
     [Button.name]: Button,
     [Loading.name]: Loading,
+    [Divider.name]: Divider,
     bidStatusNode
   },
   data() {
@@ -556,11 +564,15 @@ export default {
   .list {
     background: #f5f6f7;
   }
-  .title {
-    font-size: 18px;
-    line-height: 26px;
-    color: #171826;
-    padding: 16px 16px 2px 16px;
+  .divider-container {
+    padding: 0 34px;
+    ::v-deep {
+      .van-divider {
+        font-size: 11px;
+        color: rgba(0, 0, 0, 0.5);
+      }
+    }
+    // padding: 16px 16px 2px 16px;
   }
   .right-event {
     margin-left: 24px;
@@ -582,7 +594,8 @@ export default {
     margin-top: 2px;
   }
   .right-bottom {
-    margin-bottom: 8px;
+    margin: 8px;
+    border-radius: 12px;
     &::after {
       margin-left: 16px;
     }
@@ -613,22 +626,37 @@ export default {
     }
   }
 }
+.action-button {
+  white-space: nowrap;
+  color: $main;
+  background: transparent;
+}
+.float-bottom {
+  position: fixed;
+  left: 50%;
+  bottom: calc(50px + 16px);
+  transform: translateX(-50%);
+  z-index: 98;
+}
 .to-setting-container {
   margin-top: 6px;
   padding: 8px 16px;
+
   .to-setting-content {
     display: flex;
     align-items: center;
     justify-content: space-between;
-    padding: 10px 12px;
-    font-size: 14px;
-    line-height: 20px;
+    padding: 11px 8px;
+    font-size: 11px;
+    line-height: 18px;
     color: #171826;
     border-radius: 8px;
-    border: 0.5px solid rgba(0, 0, 0, 0.12);
+    background: linear-gradient(180deg, #E8FFFF 0%, #FFFFFF 100%);
+    box-shadow: 0px 4px 16px 0px #081F2614;
+    border: 0.5px solid $main;
   }
   .to-setting-text {
-    margin-right: 16px;
+    white-space: nowrap;
   }
   .setting-button {
     display: flex;

+ 9 - 6
apps/mobile/src/components/message/message-card.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="message-bg" v-if="list.length">
-    <div class="message-main" :style="{ height: setHeight + 'vw' }">
+    <div class="message-main clickable" :style="{ height: setHeight + 'vw' }">
       <div class="message-unread" v-if="msgData.unread > 0">
         {{ setUnRead }}条未读
       </div>
@@ -238,24 +238,27 @@ export default {
 <style lang="scss" scoped>
 .message-bg {
   background-color: #f5f6f7;
-  padding: 8px 0;
+  padding: 8px 12px;
 }
 .message-main {
+  position: relative;
   display: flex;
   flex-direction: column;
   justify-content: center;
   height: 100%;
   background-color: #fff;
+  border-radius: 12px;
   overflow: hidden;
   .message-unread {
-    margin-top: 6px;
+    position: absolute;
+    left: 0;
+    top: 0;
     padding: 0 6px;
     width: fit-content;
-    height: 15px;
     line-height: 15px;
     background: #fb483d;
-    color: #ffffff;
-    border-radius: 0px 40px 40px 0px;
+    color: #fff;
+    border-radius: 40px 40px 40px 0;
     font-size: 11px;
   }
 }

+ 1 - 1
apps/mobile/src/views/search/layout.vue

@@ -147,7 +147,7 @@ export default {
     updatePlaceholder(name) {
       this.topSearch.placeholder = ''
       if (name.indexOf('bidding') !== -1) {
-        this.topSearch.placeholder = '请输入项目名称等关键词'
+        this.topSearch.placeholder = '请输入产品或业务名称关键词'
       }
       if (name.indexOf('company') !== -1) {
         this.topSearch.placeholder = '企业名称'

+ 84 - 25
apps/mobile/src/views/tabbar/Home.vue

@@ -7,11 +7,14 @@
     :class="{ 'app-header-top': appHeaderTop }"
   >
     <!-- 头部广告位 -->
-    <div class="header-exposure" v-if="getPlatformAD.header && isLogin">
-      <img :src="AD.header.pic" alt="" />
-    </div>
-    <h5 class="logo-title tabbar-header" v-if="getPlatformAD.header && isLogin">
-      剑鱼标讯
+    <div class="header-exposure" v-if="isLogin"></div>
+    <h5 class="logo-title tabbar-header" v-if="isLogin">
+      <div class="logo-img-container">
+        <img
+          src="@/assets/image/public/logo-text-transparent-bg@2x.png"
+          alt=""
+        />
+      </div>
     </h5>
     <!-- 搜索框 -->
     <van-sticky
@@ -21,20 +24,30 @@
       <div class="search-box" :class="{ 'app-header-top': appHeaderTop }">
         <div class="search" @click="goSearch">
           <AppIcon name="search" />
-          <span>请输入项目名称等关键词</span>
+          <span>找项目 搜采购 拓客户 查企业</span>
         </div>
       </div>
     </van-sticky>
-    <!-- 轮播广告位 -->
-    <swipe :images="AD.swipe" v-if="isLogin"></swipe>
-    <!-- 金刚区广告位 -->
-    <swipe-floor :images="AD.floor" v-if="isLogin"></swipe-floor>
-    <!-- 内容区域 -->
-    <!-- 消息 -->
-    <message-card></message-card>
-    <div class="divider-placeholder" v-if="!isLogin"></div>
-    <!-- 最新标讯 -->
-    <home-list ref="list"></home-list>
+    <HotKeyList
+      v-if="isLogin"
+      class="hot-key-wrapper"
+      @clickTag="clickHotTag"
+    />
+    <div :class="{ 'home-content-container': isLogin }">
+      <!-- 金刚区广告位 -->
+      <swipe-floor
+        class="swipe-floor"
+        :images="AD.floor"
+        v-if="isLogin"
+      ></swipe-floor>
+      <!-- 轮播广告位 -->
+      <swipe :images="AD.swipe" v-if="isLogin"></swipe>
+      <!-- 内容区域 -->
+      <!-- 消息 -->
+      <message-card></message-card>
+      <!-- 最新标讯 -->
+      <home-list ref="list"></home-list>
+    </div>
     <!-- 侧边广告位 -->
     <ad-side :config="AD.side" :scroll-status="sideStatus"></ad-side>
     <!-- 弹窗广告位 -->
@@ -69,6 +82,7 @@ import Swipe from '@/components/ad/Swipe'
 import SwipeFloor from '@/components/ad/SwipeFloor'
 import Side from '@/components/ad/Side'
 import HomeList from '@/components/home/list'
+import HotKeyList from '@/components/home/HotKeyList'
 import {
   ajaxGetAD,
   ajaxGetNewUserAD,
@@ -100,6 +114,7 @@ export default {
   mixins: [mixinHeader, setPageTdk],
   components: {
     AdSingle,
+    HotKeyList,
     AdPopScreen,
     HomeList,
     MessageCard,
@@ -276,7 +291,7 @@ export default {
       const { toSearch } = this.cacheState
       if (!toSearch) return false
       this.cacheState.toSearch = false
-      this.toSearch()
+      this.toSearchFocus()
     },
     doSave() {
       callHideTab(1)
@@ -359,9 +374,9 @@ export default {
       }
     },
     goSearch() {
-      this.toSearch()
+      this.toSearchFocus()
       // if (this.isLogin) {
-      //   this.toSearch()
+      //   this.toSearchFocus()
       // } else {
       //   this.cacheState.toSearch = true
       //   this.doSaveToSearch()
@@ -369,11 +384,22 @@ export default {
       //   this.toLogin()
       // }
     },
-    toSearch() {
+    toSearchFocus() {
+      this.toSearch({
+        focus: true
+      })
+    },
+    toSearchAutoSearch(keyword) {
+      this.toSearch({
+        input: keyword,
+        autoSearch: true
+      })
+    },
+    toSearch(params = {}) {
       this.$router.push({
         name: 'search-middle-bidding',
         params: {
-          focus: true
+          ...params
         }
       })
     },
@@ -388,6 +414,9 @@ export default {
       const scrollTop = e.target.scrollTop
       this.sideStatus = scrollTop < 60
     },
+    clickHotTag(item) {
+      this.toSearchAutoSearch(item.label)
+    },
     /**
      * 获取对应广告位数据
      * @param codes
@@ -401,7 +430,7 @@ export default {
       const codes = [
         this.getPlatformAD.side,
         this.getPlatformAD.full,
-        this.getPlatformAD.header,
+        // this.getPlatformAD.header,
         this.getPlatformAD.swipe,
         this.getPlatformAD.floor
       ].filter((v) => v)
@@ -564,9 +593,38 @@ export default {
   overflow-x: hidden;
 
   .logo-title {
+    padding-top: 12px;
+    padding-bottom: 6px;
     color: $white;
-    height: 64px - 8px;
+    height: 44px;
+    .logo-img-container {
+      padding: 0 14px;
+    }
+    img {
+      width: 100%;
+      max-width: 100%;
+    }
+  }
+
+  .hot-key-wrapper {
+    padding: 0 16px;
+    padding-bottom: 12px;
   }
+
+  .home-content-container {
+    border-top-left-radius: 16px;
+    border-top-right-radius: 16px;
+    overflow: hidden;
+    background: #f5f6f7;
+  }
+  .swipe-floor {
+    background: linear-gradient(180deg, #fff 0%, #f5f6f7 100%);
+    box-shadow: 0px -4px 16px 0px #081f2614;
+  }
+  .message-bg {
+    padding-bottom: 0;
+  }
+
   .van-sticky--fixed,
   .deep-color {
     .search-box {
@@ -592,7 +650,7 @@ export default {
       display: flex;
       flex-direction: row;
       align-items: center;
-      height: 36px;
+      height: 40px;
       padding: 0 12px;
       background: #ffffff;
       transition: background-color 0.2s;
@@ -613,7 +671,8 @@ export default {
     top: 0;
     left: 0;
     width: 100%;
-    height: auto;
+    min-height: 240px;
+    background: linear-gradient(180deg, #00aee6 0%, #05b6cd 38%, #87efea 100%);
     img {
       width: 100%;
       max-width: 100%;