Browse Source

fix:订阅列表有匹配词才会显示正文,微信端搜索下方非超级订阅且是大会员被判断为免费用户问题调整

Signed-off-by: tangshizhe <48740614+tangshizhe@users.noreply.github.com>
tangshizhe 1 year ago
parent
commit
c5c3e0638d

+ 14 - 7
apps/bigmember_pc/src/components/article-item/ArticleItem.vue

@@ -32,7 +32,11 @@
         </div>
         </div>
       </div>
       </div>
     </div>
     </div>
-    <div v-if="config.push && article.detail" class="a-i-detail ellipsis" v-html="calcDetail"></div>
+    <div
+      v-if="config.push && article.detail && calcDetail"
+      class="a-i-detail ellipsis"
+      v-html="calcDetail"
+    ></div>
     <div class="a-i-right">
     <div class="a-i-right">
       <div class="tags">
       <div class="tags">
         <span
         <span
@@ -336,14 +340,17 @@ export default {
         return `${this.index}. ${hightLightedTitle}`
         return `${this.index}. ${hightLightedTitle}`
       }
       }
     },
     },
-    // 处理正文显示
+    // 处理正文显示,有匹配词才显示正文
     calcDetail() {
     calcDetail() {
       const extractDetail = extractKeywords(this.article.detail, this.article.matchKeys)
       const extractDetail = extractKeywords(this.article.detail, this.article.matchKeys)
-      return replaceKeyword(
-        extractDetail,
-        this.article.matchKeys,
-        ['<span class="highlight-text">', '</span>']
-      )
+      if (this.article.matchKeys && this.article.matchKeys.length) {
+        return replaceKeyword(extractDetail, this.article.matchKeys, [
+          '<span class="highlight-text">',
+          '</span>'
+        ])
+      } else {
+        return ''
+      }
     },
     },
     // 处理关键词在附件中
     // 处理关键词在附件中
     calcFileText() {
     calcFileText() {

+ 7 - 2
apps/mobile/src/ui/project-cell/index.vue

@@ -72,7 +72,7 @@
     </div>
     </div>
     <div
     <div
       class="detail"
       class="detail"
-      v-if="detail"
+      v-if="detail && getDetail"
       :class="{ 'van-ellipsis': ellipsis }"
       :class="{ 'van-ellipsis': ellipsis }"
       v-html="getDetail"
       v-html="getDetail"
     ></div>
     ></div>
@@ -299,7 +299,12 @@ export default {
       return replaceKeyword(this.title, this.keys)
       return replaceKeyword(this.title, this.keys)
     },
     },
     getDetail() {
     getDetail() {
-      return replaceKeyword(this.setDetailText, this.keys)
+      // 有匹配词才显示正文
+      if (this.keys && this.keys.length) {
+        return replaceKeyword(this.setDetailText, this.keys)
+      } else {
+        return ''
+      }
     },
     },
     // 正文开头和高亮词之间,最多保留10个字符
     // 正文开头和高亮词之间,最多保留10个字符
     setDetailText() {
     setDetailText() {

+ 2 - 2
apps/mobile/src/views/search/result/bidding/index.vue

@@ -1911,8 +1911,8 @@ export default {
       //           --> 选择区域-关键词列表
       //           --> 选择区域-关键词列表
       //    --> 新用户-未选择区域-订阅页面
       //    --> 新用户-未选择区域-订阅页面
       //           --> 选择区域-关键词列表
       //           --> 选择区域-关键词列表
-      const { inWX } = this.$envs
-      const superUser = inWX ? this.isSuper : this.isSuper || this.isMember
+      // const { inWX } = this.$envs
+      const superUser = this.isSuper || this.isMember
       if (superUser) {
       if (superUser) {
         const params = {
         const params = {
           pageType: 'keyWords',
           pageType: 'keyWords',