Sfoglia il codice sorgente

feat:首页-订阅设置提示改为滚动到咨询展示

zhangsiya 11 mesi fa
parent
commit
e6e71923b0

+ 7 - 1
apps/mobile/src/components/home/list.vue

@@ -185,6 +185,12 @@ export default {
     [Divider.name]: Divider,
     bidStatusNode
   },
+  props: {
+    showSetTip: {
+      type: Boolean,
+      default: false
+    }
+  },
   data() {
     return {
       info: {
@@ -224,7 +230,7 @@ export default {
       return 'yyyy-MM-dd'
     },
     showToSettingTip() {
-      return this.showTip === 2
+      return this.showTip === 2 && this.showSetTip
     },
     ...mapGetters('user', ['isLogin', 'isFree'])
   },

+ 9 - 2
apps/mobile/src/views/tabbar/Home.vue

@@ -46,7 +46,7 @@
       <!-- 消息 -->
       <message-card></message-card>
       <!-- 最新标讯 -->
-      <home-list ref="list" @bottomSetTip="bottomSetTip"></home-list>
+      <home-list ref="list" @bottomSetTip="bottomSetTip" :show-set-tip="showSetTip"></home-list>
     </div>
     <!-- 侧边广告位 -->
     <ad-side :config="AD.side" :scroll-status="sideStatus" :bottom-position="hasBottomSetTip ? '22%' :'18%'"></ad-side>
@@ -191,7 +191,8 @@ export default {
       showNextFullPop: false,
       showBottomPop: false
     },
-    hasBottomSetTip: false
+    hasBottomSetTip: false,
+    showSetTip: false
   }),
   computed: {
     ...mapGetters('user', ['isLogin']),
@@ -432,6 +433,12 @@ export default {
     onScroll(e) {
       const scrollTop = e.target.scrollTop
       this.sideStatus = scrollTop < 60
+      // P599需求,滚动到最新咨询展示
+      if(this.$refs.list) {
+        const listRect = this.$refs.list.$el.getBoundingClientRect() || {}
+        const listTop = listRect.top
+        this.showSetTip = listTop <= scrollTop
+      }
     },
     clickHotTag(item) {
       this.toSearchAutoSearch(item.label)