Ver código fonte

feat: 新增阳光采购广告位

cuiyalong 8 meses atrás
pai
commit
e4295457c7

+ 12 - 3
apps/bigmember_pc/src/components/common/ContentLayout.vue

@@ -89,11 +89,20 @@ export default {
       ]
     }
   },
+  watch: {
+    needAd: {
+      immediate: true,
+      handler(n) {
+        if (n) {
+          this.$nextTick(() => {
+            this.getAdvertisementList()
+          })
+        }
+      }
+    }
+  },
   created() {
     this.routerName = this.$route.name
-    if (this.needAd) {
-      this.getAdvertisementList()
-    }
   },
   methods: {
     getRandomString,

+ 11 - 7
apps/bigmember_pc/src/views/article-content/composables/useContentStore.js

@@ -8,16 +8,16 @@ import {
 } from '@/api/modules/detail'
 import { getUserResource } from '@/api/modules/bi'
 
-function setPageTDK({ title, description, keywords }) {
+function setPageTDK({ title, description, keywords }, doc = document) {
   const descriptionDOM
-    = document.querySelector('meta[name=description]')
-    || document.querySelector('meta[name=Description]')
+    = doc.querySelector('meta[name=description]')
+    || doc.querySelector('meta[name=Description]')
   const keywordsDOM
-    = document.querySelector('meta[name=keywords]')
-    || document.querySelector('meta[name=Keywords]')
+    = doc.querySelector('meta[name=keywords]')
+    || doc.querySelector('meta[name=Keywords]')
 
   if (title) {
-    document.title = title
+    doc.title = title
   }
   try {
     if (description) {
@@ -101,7 +101,11 @@ async function useContentStore() {
     .then(Content.transformModel)
     .then((model) => {
       ContentPageLoading.value = false
-      setPageTDK(model.content.tdk)
+      if (IsSunPublishContent.value && model.content.changedTitle) {
+        setPageTDK(model.content.tdk, window.top.document)
+      } else {
+        setPageTDK(model.content.tdk)
+      }
     })
 
   if (AgentInfo.value.baseToken && ContentModel.value.isCanRead) {

+ 18 - 3
apps/bigmember_pc/src/views/article-content/pages/Article.vue

@@ -155,6 +155,21 @@ const showGetInLibTip = computed(() => {
   }
 })
 
+const articleAdMap = computed(() => {
+  if (IsSunPublishContent.value) {
+    return {
+      contentRight: 'jy-sun-pccontent-right',
+      footer: 'jy-sun-pccontent-bottom',
+      footerFixed: 'jy-sun-pc-article-bottom-fixed'
+    }
+  } else {
+    return {
+      contentRight: undefined,
+      footer: 'jy-pccontent-bottom',
+      footerFixed: 'jy-pc-article-bottom-fixed'
+    }
+  }
+})
 
 function doHideTabContent(label) {
   tabContentState.value[label] = false
@@ -448,7 +463,7 @@ const sunLeaveInfo = () => {
 }
 </script>
 <template>
-  <ContentLayout :need-ad="true" class="article-page-container">
+  <ContentLayout :need-ad="!ContentPageLoading" class="article-page-container" :ad-code="articleAdMap.contentRight">
     <ContentError v-if="ContentIsError" :error-text="ContentErrorText"></ContentError>
     <el-skeleton
       v-else
@@ -635,7 +650,7 @@ const sunLeaveInfo = () => {
           </div>
           <!--  内容底部广告  -->
           <div class="article-content-footer-container">
-            <adsense code="jy-pccontent-bottom"></adsense>
+            <adsense :code="articleAdMap.footer"></adsense>
           </div>
         </div>
       </template>
@@ -666,7 +681,7 @@ const sunLeaveInfo = () => {
     <!--  底部悬浮广告  -->
     <footer-ad
       v-if="!canShowMask.show"
-      code="jy-pc-article-bottom-fixed"
+      :code="articleAdMap.footerFixed"
     ></footer-ad>
     <!--  查看原文链接  -->
     <origin-link

+ 1 - 1
apps/bigmember_pc/src/views/search/sun/index.vue

@@ -307,7 +307,7 @@ const leaveSource = () => {
       </div>
     </div>
 
-    <adsense class="footer-look-container" code="jy-pcsearch-bottom"></adsense>
+    <adsense class="footer-look-container" code="pc-sunlightlist-search-bottom"></adsense>
 
     <!--  留资弹窗  -->
     <collect-info ref="collectElementRef"></collect-info>

+ 15 - 8
apps/bigmember_pc/src/views/search/sun/model/base.js

@@ -512,16 +512,23 @@ export default function () {
   }
 
   function scrollToTopInWork(offset = 0) {
-    try {
-      const workContainer = document.querySelector('.micro-app--layout')
-      if (workContainer) {
-        const scrollWrapper = workContainer.parentElement
-        if (scrollWrapper) {
-          scrollWrapper.scrollTop = offset || 0
+    if (isInApp.value) {
+      try {
+        const workContainer = document.querySelector('.micro-app--layout')
+        if (workContainer) {
+          const scrollWrapper = workContainer.parentElement
+          if (scrollWrapper) {
+            scrollWrapper.scrollTop = offset || 0
+          }
         }
+      } catch (error) {
+        console.log(error)
+      }
+    } else if (isInWeb.value) {
+      const wrapper = document.documentElement
+      if (wrapper) {
+        wrapper.scrollTop = offset || 0
       }
-    } catch (error) {
-      console.log(error)
     }
   }
 

+ 6 - 4
apps/mobile/src/components/search/sun/filters.vue

@@ -236,7 +236,7 @@
         <AreaCitySidebar
           class="area-city-sidebar"
           :tagTextOnlySelectedCount="true"
-          :disabledCitySelect="noLoginOrFree"
+          :disabledCitySelect="false"
           :useProvinceCitySplit="true"
           v-model="cacheMoreFilters.jfArea"
           @onDisabledCityClick="onNoPower"
@@ -275,7 +275,7 @@
         <AreaCitySidebar
           class="area-city-sidebar"
           :tagTextOnlySelectedCount="true"
-          :disabledCitySelect="noLoginOrFree"
+          :disabledCitySelect="false"
           :useProvinceCitySplit="true"
           v-model="cacheMoreFilters.projectArea"
           @onDisabledCityClick="onNoPower"
@@ -648,7 +648,8 @@ export default {
         return {
           label,
           ref,
-          vip: free ? false : this.noLoginOrFree
+          // vip: free ? false : this.noLoginOrFree
+          vip: false
         }
       })
     }
@@ -898,6 +899,7 @@ export default {
             fileExists,
             signUpEndTime,
             jfArea,
+            publisher,
             industry
           } = this.defaultFilterState
           // 更多关键词
@@ -921,7 +923,7 @@ export default {
             filters.jfArea = jfArea
             this.cacheMoreFilters.jfArea = jfArea
           }
-          if (Array.isArray(projectArea)) {
+          if (projectArea) {
             filters.projectArea = projectArea
             this.cacheMoreFilters.projectArea = projectArea
           }

+ 2 - 1
apps/mobile/src/views/article/content.vue

@@ -382,7 +382,8 @@ export default {
       return this.expandModel.recommendCustomers?.isPower
     },
     getContentAdID() {
-      return (this.$envs.inWX ? 'jy' : 'jyapp') + '-wxcontent-bottom'
+      const sun = this.IsSunPublishContent ? '-sun' : ''
+      return (this.$envs.inWX ? 'jy' : 'jyapp') + `${sun}-wxcontent-bottom`
     }
   },
   async created() {

+ 24 - 18
apps/mobile/src/views/search/result/sun/index.vue

@@ -1005,7 +1005,7 @@ export default {
       let { filters } = this.$route.params
       if (!filters) {
         // 取标讯详情页-推荐项目模块-查看更多 跳转过来带的筛选条件
-        filters = this.$storage.get('bidding-search-filters-restore', false, {
+        filters = this.$storage.get('sun-search-filters-restore', false, {
           storage: sessionStorage,
           login: true
         })
@@ -1367,9 +1367,11 @@ export default {
         this.toggleSearchBlurData.count = ''
 
         if (searchMode === 0) {
-          const canAutoToggleBlurMode = count < 1 && blurCount > count
-          const canShowToggleBlurModeTip =
-            count >= 1 && count < 50 && blurCount > count
+          // const canAutoToggleBlurMode = count < 1 && blurCount > count
+          // const canShowToggleBlurModeTip =
+          //   count >= 1 && count < 50 && blurCount > count
+          const canAutoToggleBlurMode = count < 1
+          const canShowToggleBlurModeTip = count >= 1 && count < 50
 
           if (canShowToggleBlurModeTip) {
             this.toggleSearchBlurData.show = true
@@ -1456,7 +1458,7 @@ export default {
       if (item.buyerPerson === markText || item.buyerTel === markText) {
         buyerPersonTelText = markText
       } else {
-        buyerPersonTelText = `${item.buyerPerson || ''} ${item.buyerTel || ''}`
+        buyerPersonTelText = `${item.buyerPerson || ''} ${item.buyerTel || ''}`.trim()
       }
 
       // 详细列表数据
@@ -1964,7 +1966,7 @@ export default {
         cachedArr = defaultScope
       }
       // 持久存储scope
-      this.$storage.set('biddingSearchScopePrevSelected', cachedArr)
+      this.$storage.set('sunSearchScopePrevSelected', cachedArr)
     },
     // url取参判断当前是否强制不走缓存
     checkIsDisabledCache() {
@@ -2011,7 +2013,7 @@ export default {
     },
     // 恢复以前选过的scope
     restoreDefaultScope() {
-      const scope = this.$storage.get('biddingSearchScopePrevSelected', false)
+      const scope = this.$storage.get('sunSearchScopePrevSelected', false)
       if (Array.isArray(scope) && scope.length) {
         this.conf.defaultFilterState.scope = scope
       }
@@ -2172,17 +2174,21 @@ export default {
       this.scrollStatus = scrollTop < 60
     },
     onListTabClick(name) {
-      if (!this.isLogin) {
-        if (name === 'detailedList') {
-          return this.toLogin()
-        }
-      }
-      const isPass = this.beforeTabActiveChange(name)
-      if (isPass) {
-        this.pageState.listTabActive = name
-        this.onListTabChange(name)
-        this.showPopover = false
-      }
+      // if (!this.isLogin) {
+      //   if (name === 'detailedList') {
+      //     return this.toLogin()
+      //   }
+      // }
+      // const isPass = this.beforeTabActiveChange(name)
+      // if (isPass) {
+      //   this.pageState.listTabActive = name
+      //   this.onListTabChange(name)
+      //   this.showPopover = false
+      // }
+
+      this.pageState.listTabActive = name
+      this.onListTabChange(name)
+      this.showPopover = false
     },
     // 清空已选筛选条件,恢复到默认值
     onClearFilter() {

+ 3 - 1
data/data-models/modules/article/transform/content.js

@@ -74,7 +74,8 @@ class CommonContentModel extends BaseModel {
 
     if (result.IsSunPublishContent) {
       // 处理拆条信息
-      this.changeChaiTitle(baseInfo, abstract, result)
+      const changedTitle = this.changeChaiTitle(baseInfo, abstract, result)
+      result.changedTitle = changedTitle
     }
 
     // TDK
@@ -211,6 +212,7 @@ class CommonContentModel extends BaseModel {
           // console.log(r)
           if (r && r.title) {
             result.title = r.title + '等'
+            return true
           }
         }
       }