浏览代码

feat: 筛选组件拓展vip组件是否展示showVip

zhangsiya 1 年之前
父节点
当前提交
d0dcc2a34e

+ 6 - 2
apps/bigmember_pc/src/components/filter-items/BasePowerLayout.vue

@@ -3,7 +3,7 @@
     <div class="base-power-module default-module">
       <slot name="default"></slot>
     </div>
-    <div class="base-power-module vip-module">
+    <div class="base-power-module vip-module" v-if='vipShow'>
       <slot name="vip"></slot>
       <div v-if="vipMask" class="vip-mask pointer" @click="clickMask"></div>
     </div>
@@ -17,6 +17,10 @@ export default {
     vipMask: {
       type: Boolean,
       default: false
+    },
+    vipShow: {
+      type: Boolean,
+      default: false
     }
   },
   methods: {
@@ -38,7 +42,7 @@ $gold: #c98f37;
 .base-power-module {
   display: flex;
   align-items: center;
-  padding: 4px 12px 4px 6px;
+  padding: 0 12px 0 6px;
   border-radius: 4px;
 }
 .default-module {

+ 6 - 2
apps/bigmember_pc/src/components/filter-items/SelectorWithBasePower.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="selector-with-base-power">
-    <BasePowerLayout @clickMask="clickMask" :vipMask="vipMask">
+    <BasePowerLayout @clickMask="clickMask" :vipMask="vipMask" :vipShow='vipShow'>
       <component
         :is="component"
         :value="value"
@@ -42,6 +42,10 @@ export default {
       type: Boolean,
       default: false
     },
+    vipShow: {
+      type: Boolean,
+      default: false
+    },
     commonConf: {
       type: Object,
       default: () => {}
@@ -53,7 +57,7 @@ export default {
     vipConf: {
       type: Object,
       default: () => {}
-    }
+    },
   },
   model: {
     prop: 'value',

+ 66 - 19
apps/bigmember_pc/src/views/search/bidding/components/search-bid-filter.vue

@@ -12,6 +12,9 @@ import {
 import { getEntSearchPower } from '@/api/modules'
 
 const {
+  goLogin,
+  isLogin,
+  isInApp,
   filterState,
   doQuery,
   showFilter
@@ -31,13 +34,40 @@ const searchBidMoreVipSchema = ref([])
 
 const conf = computed(() => {
   return {
-    vipUser: isVip.value,
-    oldUser: isOld.value
+    vipUser: isVip.value && isInApp.value,
+    oldUser: isOld.value && isInApp.value,
+    showVip: isLogin.value && isInApp.value
   }
 })
 
+
+// 获取用户信息
+async function getUserPowerInfo () {
+  const { error_code: code, data } = await getEntSearchPower()
+  if (code === 0 && data) {
+    const { entniche, member, vip,  isOld: old } = data
+    isVip.value = entniche || member || vip > 0
+    isOld.value = old
+    disposeSchema()
+  }
+}
+if(isLogin.value) {
+  getUserPowerInfo()
+} else {
+  disposeSchema()
+}
+
+function disposeSchema () {
+  SearchBidBaseSchema.value =  createSearchBidBaseSchema(conf.value)
+  SearchBidMoreSchema.value =  createSearchBidMoreSchema()
+
+  searchBidMoreFreeSchema.value = SearchBidMoreSchema.value?.filter((s) => !s.vipMark)
+  searchBidMoreVipSchema.value = SearchBidMoreSchema.value?.filter((s) => s.vipMark)
+}
+
 const customMoreSchema = computed(() => {
   return {
+    vipShow: true,
     commonConf: {
       showLabel: false,
       styleType: 'row'
@@ -52,23 +82,6 @@ const customMoreSchema = computed(() => {
     }
   }
 })
-// 获取用户信息
-async function getUserPowerInfo () {
-  const { error_code: code, data } = await getEntSearchPower()
-  if (code === 0 && data) {
-    const { entniche, member, vip,  isOld: old } = data
-    isVip.value = entniche || member || vip > 0
-    isOld.value = old
-
-    SearchBidBaseSchema.value =  createSearchBidBaseSchema(conf.value)
-    SearchBidMoreSchema.value =  createSearchBidMoreSchema()
-
-    searchBidMoreFreeSchema.value = SearchBidMoreSchema.value?.filter((s) => !s.vipMark)
-    searchBidMoreVipSchema.value = SearchBidMoreSchema.value?.filter((s) => s.vipMark)
-  }
-}
-
-getUserPowerInfo()
 
 function noPower() {
   $bus.$emit('search:filter:no-power')
@@ -77,11 +90,19 @@ function noPower() {
 function doChangeFilter() {
   doQuery()
 }
+
 </script>
 
 <template>
   <el-collapse-transition >
     <div class="search-bid-filter" v-show="showFilter">
+      <div class="guide-go-workspace">
+        最近五年数据查询以及更多筛选条件请
+        <span class="highlight-text">"</span>
+        <span class="cursor-button highlight-text" @click="goLogin">{{ isLogin ? '' : '登录后' }}进入工作台</span>
+        <span class="highlight-text">"</span>
+        检索
+      </div>
       <!--  标准筛选  -->
       <search-schema-filter
         v-model="filterState"
@@ -113,6 +134,7 @@ function doChangeFilter() {
             :vipConf="customMoreSchema.vipConf"
             v-model="filterState"
             vipMask
+            :vipShow="isInApp && isLogin"
             @clickMask="noPower"
             @change="doChangeFilter"
           ></SelectorWithBasePower>
@@ -135,6 +157,7 @@ function doChangeFilter() {
   }
 }
 .search-bid-filter {
+  position: relative;
   padding: 16px 32px;
   .wrap-line {
     ::v-deep {
@@ -143,5 +166,29 @@ function doChangeFilter() {
       }
     }
   }
+  .guide-go-workspace{
+    left: 345px;
+    position: absolute;
+    border-radius: 4px;
+    background: linear-gradient(270deg, rgba(42, 190, 209, 0.24) 1.5%, rgba(42, 190, 209, 0.12) 97.45%);
+    padding: 2px 8px;
+    color: #1D1D1D;
+    font-size: 16px;
+    font-style: normal;
+    font-weight: 400;
+    line-height: 22px;
+
+    .highlight-text{
+      color: #2ABED1;
+      font-weight: 700;
+      font-family: -apple-system, system-ui, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
+    }
+    .cursor-button{
+      text-decoration-line: underline;
+      background: transparent;
+      padding: 0;
+      cursor: pointer;
+    }
+  }
 }
 </style>

+ 3 - 0
apps/bigmember_pc/src/views/search/bidding/constant/search-filters.js

@@ -32,6 +32,7 @@ const moreFiltersNeedVipKeyList = [
 function createSearchBidBaseSchema(conf = {}) {
   const vipUser = conf.vipUser || false
   const oldUser = conf.oldUser || false
+  const showVip = conf.showVip || false
 
   // 发布时间
   const publishTimeExpandFree = {
@@ -39,6 +40,7 @@ function createSearchBidBaseSchema(conf = {}) {
     props: {
       component: SearchTimeScopeSelector,
       vipMask: true,
+      vipShow: showVip,
       freeConf: {
         options: ['lately7', 'lately30', 'sinceLastYear'],
       },
@@ -63,6 +65,7 @@ function createSearchBidBaseSchema(conf = {}) {
   const searchScopeExpandFree = {
     component: SelectorWithBasePower,
     props: {
+      vipShow: showVip,
       component: SearchScopeSelector,
       options: defaultScopeOptions,
       freeConf: {

+ 23 - 0
apps/bigmember_pc/src/views/search/bidding/model/base.js

@@ -52,6 +52,7 @@ export default function () {
 
   // 是否在工作台内
   const isInApp = ref(InContainer.inApp)
+
   // 是否是渠道商
   const cooperateCode = ref(false)
   // 一切都好渠道商,是否是渠道商
@@ -486,6 +487,27 @@ export default function () {
 
   /******开通超级订阅弹窗end**********/
 
+  function guideGoWorkSpace () {
+    if (!isLogin.value) {
+      goLogin()
+      return
+    }
+    goWorkSpace()
+  }
+  // 跳转到工作台
+  function goWorkSpace () {
+    var formNode_ = $('#zbSeatchT')
+    var goHref_ = location.origin + '/jylab/supsearch/index.html'
+    window.location.replace('/swordfish/page_big_pc/search/bidding')
+    // if(getParam('tab') === '2') {
+    //   // 超前项目查询
+    //   window.location.replace('/page_workDesktop/work-bench/page?link=' + encodeURIComponent(goHref_ + '?goback&tab=2&' + formNode_.serialize()))
+    // } else {
+    //   window.location.replace('/page_workDesktop/work-bench/page?link=' + encodeURIComponent(goHref_ + '?goback&' + formNode_.serialize()))
+    // }
+  }
+
+
   /** 保存、重置筛选条件部分 start ****/
 
   const disposeFilterActionModel = saveFilterActionsModel()
@@ -837,6 +859,7 @@ export default function () {
     inBIPropertyIframe,
     inInjectBI,
     isInBI,
+    goLogin,
     cooperateCode,
     list,
     searchModelOptions,