Эх сурвалжийг харах

Merge branch 'dev/1.0.36_zsy' of jianyu/web into feature/v1.0.36

zhangsiya 1 жил өмнө
parent
commit
42a980a3fd

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

@@ -38,7 +38,7 @@ $gold: #c98f37;
 .base-power-module {
 .base-power-module {
   display: flex;
   display: flex;
   align-items: center;
   align-items: center;
-  padding: 4px 12px;
+  padding: 4px 12px 4px 6px;
   border-radius: 4px;
   border-radius: 4px;
 }
 }
 .default-module {
 .default-module {

+ 1 - 0
apps/bigmember_pc/src/components/filter-items/SearchScopeSelector.vue

@@ -62,6 +62,7 @@ export default {
   methods: {
   methods: {
     onChange(value) {
     onChange(value) {
       this.$emit('change', value)
       this.$emit('change', value)
+      this.$emit('input', value)
     }
     }
   }
   }
 }
 }

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

@@ -8,7 +8,7 @@
           ...commonConf,
           ...commonConf,
           ...freeConf,
           ...freeConf,
         }"
         }"
-        @change="onChange"
+        @input="onChange"
       ></component>
       ></component>
       <component
       <component
         slot="vip"
         slot="vip"

+ 4 - 3
apps/bigmember_pc/src/components/selector/TimeSelectorContent.vue

@@ -225,7 +225,7 @@ function getTimeSelectList(map) {
   return uniqed
   return uniqed
 }
 }
 
 
-const timeSelectListAll = getTimeSelectList(timeSelectMap)
+// const timeSelectListAll = getTimeSelectList(timeSelectMap)
 
 
 export default {
 export default {
   name: 'time-selector-content',
   name: 'time-selector-content',
@@ -310,17 +310,18 @@ export default {
     dateFormatter,
     dateFormatter,
     calcTimeSelectList() {
     calcTimeSelectList() {
       let timeSelectList = []
       let timeSelectList = []
+      const propTimeSelectList = timeSelectMap[this.selectorTime]
       if (this.options.length) {
       if (this.options.length) {
         timeSelectList = this.options
         timeSelectList = this.options
           .map((item) => {
           .map((item) => {
-            const conf = timeSelectListAll.find((t) => {
+            const conf = propTimeSelectList.find((t) => {
               return t.value === item
               return t.value === item
             })
             })
             return conf
             return conf
           })
           })
           .filter((v) => !!v)
           .filter((v) => !!v)
       } else {
       } else {
-        timeSelectList = timeSelectMap[this.selectorTime]
+        timeSelectList = propTimeSelectList
       }
       }
       return timeSelectList
       return timeSelectList
     },
     },

+ 54 - 4
apps/bigmember_pc/src/utils/format/search-bid-filter.js

@@ -501,6 +501,8 @@ export class FilterHistoryViewModel2AjaxModel {
     const buyerClass = this.formatBuyerClass(map.buyerclass)
     const buyerClass = this.formatBuyerClass(map.buyerclass)
     // 包含关系、多个关键词
     // 包含关系、多个关键词
     const { additionalWords, wordsMode } = this.formatSelectMoreKey(map.selectMoreKey, map.additionalWords, map.wordsMode)
     const { additionalWords, wordsMode } = this.formatSelectMoreKey(map.selectMoreKey, map.additionalWords, map.wordsMode)
+    // tab值
+    const searchGroup = this.formatSearchGroup(map.searchGroup)
 
 
     const formatted = {
     const formatted = {
       searchvalue: map.input,
       searchvalue: map.input,
@@ -519,7 +521,7 @@ export class FilterHistoryViewModel2AjaxModel {
       agency: map.agency ? map.agency.join(',') : '', // 招标代理机构
       agency: map.agency ? map.agency.join(',') : '', // 招标代理机构
       fileExists: map.fileExists, // 附件
       fileExists: map.fileExists, // 附件
       regionMap: map.regionMap, // 地区
       regionMap: map.regionMap, // 地区
-      searchGroup: map.searchGroup, // 搜索分组:默认0:全部;1:招标采购公告;2:超前项目
+      searchGroup: searchGroup, // 搜索分组:默认0:全部;1:招标采购公告;2:超前项目
       searchMode: Number(map.searchMode),  // 搜索模式:0:精准搜索;1:模糊搜索
       searchMode: Number(map.searchMode),  // 搜索模式:0:精准搜索;1:模糊搜索
       wordsMode: wordsMode, // 搜索关键词模式;默认0:包含所有,1:包含任意
       wordsMode: wordsMode, // 搜索关键词模式;默认0:包含所有,1:包含任意
       additionalWords: additionalWords, //关键词:附加关键词(副:五组,每组最多15个字符)
       additionalWords: additionalWords, //关键词:附加关键词(副:五组,每组最多15个字符)
@@ -705,6 +707,34 @@ export class FilterHistoryViewModel2AjaxModel {
       wordsMode: wMode
       wordsMode: wMode
     }
     }
   }
   }
+
+  /**
+   * 整理当前搜索分组tab 搜索分组:默认全部0 招标采购公告1 超前项目2
+   * @param m
+   */
+  static formatSearchGroup(val) {
+    let result = 0
+    if (val !== undefined && val !== null) {
+      const nVal = Number(val)
+      switch (nVal) {
+        case 0:
+        case 4:
+        case 5:
+          result = 0
+          break
+        case 3:
+        case 1:
+          result = 3
+          break
+        case 2:
+          result = 2
+          break
+        default:
+          result = 0
+      }
+    }
+    return result
+  }
 }
 }
 
 
 
 
@@ -763,7 +793,7 @@ export class FilterHistoryAjaxModelRestore {
     const matchKeys = this.formatMatchKeys(map.keywords, additionalWords)
     const matchKeys = this.formatMatchKeys(map.keywords, additionalWords)
     // 精准匹配/模糊匹配
     // 精准匹配/模糊匹配
     const searchMode= this.formatSearchMode(map.searchMode)
     const searchMode= this.formatSearchMode(map.searchMode)
-    //
+    // tab值
     const searchGroup = this.formatSearchGroup(map.searchGroup)
     const searchGroup = this.formatSearchGroup(map.searchGroup)
     // 采购单位
     // 采购单位
     const { buyerClass } = this.formatBuyerClass(map.buyerClass)
     const { buyerClass } = this.formatBuyerClass(map.buyerClass)
@@ -846,8 +876,28 @@ export class FilterHistoryAjaxModelRestore {
    * 整理当前搜索分组tab 搜索分组:默认全部0 招标采购公告1 超前项目2
    * 整理当前搜索分组tab 搜索分组:默认全部0 招标采购公告1 超前项目2
    * @param m
    * @param m
    */
    */
-  static formatSearchGroup(m) {
-    return m
+  static formatSearchGroup(val) {
+    let result = 0
+    if (val !== undefined && val !== null) {
+      const nVal = Number(val)
+      switch (nVal) {
+        case 0:
+        case 4:
+        case 5:
+          result = 0
+          break
+        case 3:
+        case 1:
+          result = 1
+          break
+        case 2:
+          result = 2
+          break
+        default:
+          result = 0
+      }
+    }
+    return result
   }
   }
   /**
   /**
    * 行业整理
    * 行业整理

+ 69 - 34
apps/bigmember_pc/src/views/search/bidding/components/search-bid-filter.vue

@@ -1,5 +1,5 @@
 <script setup>
 <script setup>
-import { ref } from 'vue'
+import { ref, computed } from 'vue'
 import { SearchBidModel } from '../model/index'
 import { SearchBidModel } from '../model/index'
 import SearchSchemaFilter from '@/views/search/components/search-schema-filter.vue'
 import SearchSchemaFilter from '@/views/search/components/search-schema-filter.vue'
 import SelectorWithBasePower from '@/components/filter-items/SelectorWithBasePower.vue'
 import SelectorWithBasePower from '@/components/filter-items/SelectorWithBasePower.vue'
@@ -9,45 +9,71 @@ import {
   createSearchBidMoreSchema
   createSearchBidMoreSchema
 } from '@/views/search/bidding/constant/search-filters'
 } from '@/views/search/bidding/constant/search-filters'
 
 
-const conf = ref({
-  vipUser: false,
-  oldUser: true
+import { getEntSearchPower } from '@/api/modules'
+
+const {
+  filterState,
+  doQuery,
+  showFilter
+} = SearchBidModel
+
+
+// 是否是VIP
+const isVip = ref(false)
+// 是否是老用户
+const isOld = ref(false)
+
+const SearchBidBaseSchema = ref([])
+const SearchBidMoreSchema = ref([])
+
+const searchBidMoreFreeSchema = ref([])
+const searchBidMoreVipSchema = ref([])
+
+const conf = computed(() => {
+  return {
+    vipUser: isVip.value,
+    oldUser: isOld.value
+  }
 })
 })
-const SearchBidBaseSchema = createSearchBidBaseSchema(conf.value)
-const SearchBidMoreSchema = createSearchBidMoreSchema()
-
-const searchBidMoreFreeSchema = SearchBidMoreSchema.filter((s) => !s.vipMark)
-const searchBidMoreVipSchema = SearchBidMoreSchema.filter((s) => s.vipMark)
-
-const customMoreSchema = {
-  commonConf: {
-    showLabel: false,
-    styleType: 'row'
-  },
-  freeConf: {
-    showRowLabel: true,
-    rowLabelText: '更多筛选:',
-    schema: searchBidMoreFreeSchema
-  },
-  vipConf: {
-    schema: searchBidMoreVipSchema
+
+const customMoreSchema = computed(() => {
+  return {
+    commonConf: {
+      showLabel: false,
+      styleType: 'row'
+    },
+    freeConf: {
+      showRowLabel: true,
+      rowLabelText: '更多筛选:',
+      schema: searchBidMoreFreeSchema.value
+    },
+    vipConf: {
+      schema: searchBidMoreVipSchema.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
+
+    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() {
 function noPower() {
   $bus.$emit('search:filter:no-power')
   $bus.$emit('search:filter:no-power')
-  console.log('showDialog')
 }
 }
 
 
-console.log(SearchBidBaseSchema)
-console.log(SearchBidMoreSchema)
-
-const {
-  filterState,
-  doQuery,
-  showFilter
-} = SearchBidModel
-
 function doChangeFilter() {
 function doChangeFilter() {
   doQuery()
   doQuery()
 }
 }
@@ -97,9 +123,19 @@ function doChangeFilter() {
 </template>
 </template>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
+.in-app {
+  .search-bid-filter {
+    .wrap-line {
+      ::v-deep {
+        .vip-module {
+          margin-left: 0;
+        }
+      }
+    }
+  }
+}
 .search-bid-filter {
 .search-bid-filter {
   padding: 16px 32px;
   padding: 16px 32px;
-
   .wrap-line {
   .wrap-line {
     ::v-deep {
     ::v-deep {
       .vip-module {
       .vip-module {
@@ -107,6 +143,5 @@ function doChangeFilter() {
       }
       }
     }
     }
   }
   }
-  
 }
 }
 </style>
 </style>

+ 3 - 2
apps/bigmember_pc/src/views/search/bidding/components/search-bid-header.vue

@@ -13,11 +13,12 @@ const {
   cooperateCode,
   cooperateCode,
   inputKeywordsState,
   inputKeywordsState,
   doQuery,
   doQuery,
+  onChangeTab,
   searchModelOptions,
   searchModelOptions,
   SearchTabsModel
   SearchTabsModel
 } = SearchBidModel
 } = SearchBidModel
 
 
-const { searchTabs, doChangeTab } = SearchTabsModel
+const { searchTabs } = SearchTabsModel
 
 
 const that = getCurrentInstance().proxy
 const that = getCurrentInstance().proxy
 
 
@@ -50,7 +51,7 @@ function goToPublish () {
       v-model="inputKeywordsState.input"
       v-model="inputKeywordsState.input"
       :tabs="searchTabs"
       :tabs="searchTabs"
       placeholder="招标信息搜索"
       placeholder="招标信息搜索"
-      @change-tab="doChangeTab"
+      @change-tab="onChangeTab"
       @search="doSearch"
       @search="doSearch"
       :show-wx-qr="!cooperateCode"
       :show-wx-qr="!cooperateCode"
     >
     >

+ 1 - 2
apps/bigmember_pc/src/views/search/bidding/constant/search-filters.js

@@ -9,12 +9,11 @@ import IndustrySelector from '@/components/filter-items/IndustrySelector.vue'
 import KeywordTagsSelector from '@/components/filter-items/KeywordTagsSelector'
 import KeywordTagsSelector from '@/components/filter-items/KeywordTagsSelector'
 import RegionSelector from '@/components/filter-items/RegionSelector'
 import RegionSelector from '@/components/filter-items/RegionSelector'
 import SelectorWithBasePower from '@/components/filter-items/SelectorWithBasePower.vue'
 import SelectorWithBasePower from '@/components/filter-items/SelectorWithBasePower.vue'
-import { calcSearchScope } from '@/assets/js/selector.js'
+import { calcSearchScope } from '@/assets/js/selector/scope.js'
 import $bus from '@/utils/bus'
 import $bus from '@/utils/bus'
 
 
 function noPower() {
 function noPower() {
   $bus.$emit('search:filter:no-power')
   $bus.$emit('search:filter:no-power')
-  console.log('showDialog')
 }
 }
 
 
 // 更多筛选中需要vip的筛选项
 // 更多筛选中需要vip的筛选项

+ 33 - 9
apps/bigmember_pc/src/views/search/bidding/index.vue

@@ -54,15 +54,21 @@ const {
   propertyIframeSrc,
   propertyIframeSrc,
   onSingleEmploy,
   onSingleEmploy,
   onAddInfoOfBI,
   onAddInfoOfBI,
-  onSingleAddInfo
+  onSingleAddInfo,
+  vipDialogConf,
+  closeVipDialog
 } = SearchBidModel
 } = SearchBidModel
 
 
-// 展示开通超级订阅弹窗
-const showVipDialog = ref(false)
+const {
+  show: showVipDialog,
+  text: vipDialogText,
+  type: vipDialogType
+} = vipDialogConf
+
 
 
 // 开通超级订阅
 // 开通超级订阅
 function toBuySvip () {
 function toBuySvip () {
-
+  window.open('/swordfish/page_big_pc/free/svip/buy?type=buy')
 }
 }
 
 
 // 列表-单条-配置
 // 列表-单条-配置
@@ -76,7 +82,6 @@ const articleRef = ref({
   push: false
   push: false
 })
 })
 
 
-
 </script>
 </script>
 
 
 <template>
 <template>
@@ -219,12 +224,10 @@ const articleRef = ref({
       center
       center
       :visible.sync="showVipDialog"
       :visible.sync="showVipDialog"
     >
     >
-      立享列表展示更多公告关键信息,例如:采购单位、中标单位、招标代理机构等,提高公告查看效率
+      {{ vipDialogText}}
       <template #footer>
       <template #footer>
         <button class="action-button confirm" @click="toBuySvip">去开通</button>
         <button class="action-button confirm" @click="toBuySvip">去开通</button>
-        <button class="action-button cancel" @click="showVipDialog = false">
-          取消
-        </button>
+        <button class="action-button cancel" @click="closeVipDialog">取消</button>
       </template>
       </template>
     </CustomDialog>
     </CustomDialog>
     <!-- 分发企业选择, 只有企业展示,默认vt为企业-->
     <!-- 分发企业选择, 只有企业展示,默认vt为企业-->
@@ -255,6 +258,27 @@ const articleRef = ref({
 </template>
 </template>
 
 
 <style lang='scss'>
 <style lang='scss'>
+.open-vip-dialog {
+  width: 380px;
+
+  .el-dialog__header {
+    padding: 32px 32px 20px;
+  }
+
+  .el-dialog__body {
+    padding: 0 32px 0;
+    text-align: center;
+  }
+
+  .el-dialog__footer {
+    padding: 32px;
+  }
+
+  .el-button {
+    width: 132px;
+    font-size: 16px;
+  }
+}
 .search-bidding-page .sub-collection.tags-box {
 .search-bidding-page .sub-collection.tags-box {
   .tags-list .tags-item {
   .tags-list .tags-item {
     float: left;
     float: left;

+ 59 - 7
apps/bigmember_pc/src/views/search/bidding/model/base.js

@@ -1,4 +1,4 @@
-import { computed, reactive, ref, onMounted, getCurrentInstance } from 'vue'
+import { computed, reactive, ref, toRefs, onMounted, getCurrentInstance } from 'vue'
 import { without, throttle } from 'lodash'
 import { without, throttle } from 'lodash'
 import { useStore } from '@/store'
 import { useStore } from '@/store'
 import { useRoute, useRouter } from 'vue-router/composables'
 import { useRoute, useRouter } from 'vue-router/composables'
@@ -119,7 +119,15 @@ export default function () {
     activeHeaderActions,
     activeHeaderActions,
     disabledHeaderActions
     disabledHeaderActions
   } = useSearchListHeaderActionsModel()
   } = useSearchListHeaderActionsModel()
+
+  // 页面tab切换Model
   const SearchTabsModel = useSearchTabsModel()
   const SearchTabsModel = useSearchTabsModel()
+  const { activeTab, doChangeTab } = SearchTabsModel
+  // tab切换处理
+  function onChangeTab (item) {
+    doChangeTab(item)
+    doQuery()
+  }
 
 
   // 列表状态
   // 列表状态
   const listState = reactive({
   const listState = reactive({
@@ -211,7 +219,7 @@ export default function () {
         break
         break
       }
       }
       case 'detailed-list': {
       case 'detailed-list': {
-        doChangeItemStyleType(key)
+        detailListClick(key)
         break
         break
       }
       }
       case 'table': {
       case 'table': {
@@ -236,8 +244,13 @@ export default function () {
       }
       }
     }
     }
   }
   }
-
-
+  function detailListClick (key) {
+    if(isFree.value) {
+      openListVipDialog()
+      return
+    }
+    doChangeItemStyleType(key)
+  }
   // 全选复选框事件
   // 全选复选框事件
   function doChangeAllSelect(type) {
   function doChangeAllSelect(type) {
     doToggleListSelection(type)
     doToggleListSelection(type)
@@ -359,7 +372,8 @@ export default function () {
     // 合并所有模型的搜索筛选项
     // 合并所有模型的搜索筛选项
     const result = Object.assign(
     const result = Object.assign(
       {
       {
-        reqType: 'lastNews',
+        searchGroup: activeTab.value,
+        reqType: 'lastNews', // cache:空搜索缓存数据;lastNews:最新数据
         pageNum: listState.pageNum,
         pageNum: listState.pageNum,
         pageSize: listState.pageSize,
         pageSize: listState.pageSize,
         // 该接口与用户身份有关
         // 该接口与用户身份有关
@@ -439,6 +453,39 @@ export default function () {
     showFilter.value = !showFilter.value
     showFilter.value = !showFilter.value
   }
   }
 
 
+  /******开通超级订阅弹窗start**********/
+
+  // 开通超级订阅弹窗配置
+  const vipDialogConfig = reactive({
+    type: 'filter',
+    show: false,
+    text: '立享更多搜索权限,寻找商机更精准'
+  })
+
+  // 筛选条件打开超级订阅弹窗
+  function openFilterVipDialog () {
+    vipDialogConfig.type = 'filter'
+    vipDialogConfig.show =  true
+    vipDialogConfig.text = '立享更多搜索权限,寻找商机更精准'
+  }
+  // 关闭超级订阅弹窗
+  function closeVipDialog () {
+    vipDialogConfig.show = false
+  }
+  // 数据列表--开通超级订阅弹窗
+  function openListVipDialog () {
+    vipDialogConfig.type = 'list'
+    vipDialogConfig.show = true
+    vipDialogConfig.text = '立享列表展示更多公告关键信息,例如:采购单位、中标单位、招标代理机构等,提高公告查看效率'
+  }
+
+  const vipDialogConf = toRefs(vipDialogConfig)
+
+  // 筛选条件无权限提示开通超级订阅弹窗
+  $bus.$on('search:filter:no-power', openFilterVipDialog)
+
+  /******开通超级订阅弹窗end**********/
+
   /** 保存、重置筛选条件部分 start ****/
   /** 保存、重置筛选条件部分 start ****/
 
 
   const disposeFilterActionModel = saveFilterActionsModel()
   const disposeFilterActionModel = saveFilterActionsModel()
@@ -457,7 +504,9 @@ export default function () {
    */
    */
   async function onSaveFilter() {
   async function onSaveFilter() {
     const originParams = Object.assign(
     const originParams = Object.assign(
-      {},
+      {
+        searchGroup: activeTab.value,
+      },
       filterState.value,
       filterState.value,
       inputKeywordsState.value
       inputKeywordsState.value
     )
     )
@@ -525,6 +574,7 @@ export default function () {
       additionalWords: resultFilter.additionalWords,
       additionalWords: resultFilter.additionalWords,
       selectMoreKey: resultFilter.additionalWords?.length > 0
       selectMoreKey: resultFilter.additionalWords?.length > 0
     }
     }
+    doChangeTab({ key: resultFilter.searchGroup })
     historyFilterDialogVisible.value = false
     historyFilterDialogVisible.value = false
     doQuery()
     doQuery()
   }
   }
@@ -780,7 +830,6 @@ export default function () {
   }
   }
   /*****BI添加操作end*********/
   /*****BI添加操作end*********/
 
 
-
   return {
   return {
     isLogin,
     isLogin,
     isInApp,
     isInApp,
@@ -803,6 +852,9 @@ export default function () {
     doChangeSelect,
     doChangeSelect,
     doChangePageNum,
     doChangePageNum,
     doChangePageSize,
     doChangePageSize,
+    onChangeTab,
+    vipDialogConf,
+    closeVipDialog,
     onSaveFilter, // 以下存筛选条件相关
     onSaveFilter, // 以下存筛选条件相关
     disposeFilterActionModel,
     disposeFilterActionModel,
     historyFilterDialogVisible,
     historyFilterDialogVisible,

+ 5 - 4
apps/bigmember_pc/src/views/search/bidding/model/modules/tabs.js

@@ -1,20 +1,20 @@
 import { computed, ref } from 'vue'
 import { computed, ref } from 'vue'
 
 
 export function useSearchTabsModel() {
 export function useSearchTabsModel() {
-  const activeTab = ref('all')
+  const activeTab = ref(0)
   const Tabs = [
   const Tabs = [
     {
     {
       label: '全部',
       label: '全部',
-      key: 'all'
+      key: 0
     },
     },
     {
     {
       label: '招标采购公告',
       label: '招标采购公告',
-      key: 'bid'
+      key: 1
     },
     },
     {
     {
       label: '超前项目',
       label: '超前项目',
       badge: '推荐',
       badge: '推荐',
-      key: 'project'
+      key: 2
     }
     }
   ]
   ]
   const searchTabs = computed(() => {
   const searchTabs = computed(() => {
@@ -28,6 +28,7 @@ export function useSearchTabsModel() {
     activeTab.value = tab.key
     activeTab.value = tab.key
   }
   }
 
 
+
   return {
   return {
     searchTabs,
     searchTabs,
     activeTab,
     activeTab,

+ 1 - 1
apps/bigmember_pc/src/views/search/components/search-schema-filter.vue

@@ -39,7 +39,7 @@ function doChangeInput(key, event) {
     [key]: event
     [key]: event
   })
   })
   emit('input', result)
   emit('input', result)
-  emit('change')
+  emit('change', result)
 }
 }
 
 
 const getPrefix = {
 const getPrefix = {