瀏覽代碼

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

# Conflicts:
#	apps/bigmember_pc/src/views/search/bidding/model/index.js
zhangsiya 1 年之前
父節點
當前提交
801947b8d6

+ 12 - 0
apps/bigmember_pc/src/store/user.js

@@ -22,6 +22,14 @@ const vtMap = {
   bigmember: 'm'
 }
 
+const UserVTypeMap = {
+  v: 'vType',
+  m: 'mType',
+  s: 'eType',
+  f: 'fType',
+  q: 'eType' // 企业订阅-也需调商机管理订阅信息接口,定义q为了区分企业订阅和个人订阅(商机管理)所传参数
+}
+
 export default {
   namespaced: true,
   state: () => ({
@@ -406,6 +414,10 @@ export default {
         return vtMap.free
       }
     },
+    // 获取后端所需的用户 type,用于接口
+    userType(state, getters) {
+      return UserVTypeMap[getters.vt] || 'fType'
+    },
     // 大会员子账号
     isSubCount: (state) => state.info.isSubCount,
     // 大会员权限

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

@@ -11,7 +11,7 @@ import RegionSelector from '@/components/filter-items/RegionSelector'
 
 const SearchBidBaseSchema = [
   {
-    key: 'publishtime',
+    key: 'publishTime',
     label: '发布时间:',
     defaultVal: 'thisyear',
     _name: 'time',

+ 8 - 3
apps/bigmember_pc/src/views/search/bidding/model/index.js

@@ -1,4 +1,4 @@
-import { computed, reactive, getCurrentInstance } from 'vue'
+import { computed, reactive } from 'vue'
 import { without } from 'lodash'
 // API 业务模型
 import useQuickSearchModel from '@jy/data-models/modules/quick-search/model'
@@ -8,6 +8,7 @@ import { useSearchInputKeywordsModel } from './modules/filter-keywords'
 import { useSearchListHeaderActionsModel } from './modules/list-header-actions'
 import { useSearchTabsModel } from './modules/tabs'
 import { saveFilterActionsModel } from './modules/save-filter-actions'
+import { useStore } from '@/store'
 
 // 解构基础业务
 const APIModel = useQuickSearchModel({
@@ -147,8 +148,12 @@ function getParams(params = {}) {
   const result = Object.assign(
     {
       reqType: 'lastNews',
-      pageNumber: listState.pageNum,
-      pageSize: listState.pageSize
+      pageNum: listState.pageNum,
+      pageSize: listState.pageSize,
+      // 该接口与用户身份有关
+      _expand: {
+        type: userType.value
+      }
     },
     getFormatOfInputKeywords(),
     getFormatOfFilter(),

+ 1 - 1
apps/bigmember_pc/src/views/search/bidding/model/modules/filter-keywords.js

@@ -25,7 +25,7 @@ export function useSearchInputKeywordsModel() {
 
   function getFormatAPIParams() {
     const params = {
-      searchvalue: inputKeywordsState.value.input,
+      keyWords: inputKeywordsState.value.input,
       searchMode: Number(inputKeywordsState.value.searchMode)
     }
 

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

@@ -28,20 +28,20 @@ export function useSearchFilterModel() {
     // 采购单位
     buyer: [],
     // 中标企业
-    winner : [],
+    winner: [],
     // 招标代理机构
     agency: []
   })
 
   function getFormatAPIParams() {
     const params = {
-      publishtime: filterState.value.publishtime,
+      publishTime: filterState.value.publishtime,
       selectType: filterState.value.selectType.join(','),
-      subtype: filterState.value.subtype,
+      subtype: filterState.value.subtype.join(','),
       notkey: filterState.value.notkey.join(','),
       buyer: filterState.value.buyer.join(','),
       winner: filterState.value.winner.join(','),
-      agency: filterState.value.agency.join(','),
+      agency: filterState.value.agency.join(',')
     }
 
     return params

+ 7 - 1
apps/bigmember_pc/src/views/search/purchase/model/index.js

@@ -1,6 +1,7 @@
 import { computed, reactive, ref } from 'vue'
 import useQuickSearchModel from '@jy/data-models/modules/quick-search/model'
 import { filterState } from './modules/filter'
+import { useStore } from '@/store'
 
 // 解构基础业务
 const APIModel = useQuickSearchModel({
@@ -77,11 +78,16 @@ function doChangeFilter() {
   doQuery()
 }
 
+// 获取 store getters
+const userType = computed(() => {
+  return useStore().getters['user/userType']
+})
+
 function getParams() {
   return {
     // 该接口与用户身份有关
     _expand: {
-      type: 'eType'
+      type: userType.value
     },
     searchType: 'title',
     keywords: inputKeywordsState.value.input,

+ 3 - 4
data/data-models/modules/quick-search/api/search-bid.js

@@ -1,9 +1,8 @@
 import { useRequest } from '../../../api'
-import qs from 'qs'
-export function ajaxGetSearchBidList(data) {
+export function ajaxGetSearchBidList(type, data) {
   return useRequest({
-    url: '/front/pcAjaxReq',
+    url: `/jyapi/jybx/core/${type}/searchList`,
     method: 'post',
-    data: qs.stringify(data)
+    data
   })
 }

+ 7 - 5
data/data-models/modules/quick-search/plugins/search-bid.js

@@ -10,15 +10,17 @@ export default class SearchBidListApi extends SearchListApiBase {
    * 覆写请求
    */
   async ajaxQuery(params) {
-    return ajaxGetSearchBidList(params).then((res) => {
+    const type = params._expand.type
+    delete params._expand
+    return ajaxGetSearchBidList(type, params).then((res) => {
       console.log(res, 'res')
-      let success = res?.status === 1
+      let success = res?.error_code === 0
 
       return {
         success: success,
-        list: res?.list || [],
-        total: res?.total || 0,
-        origin: res
+        list: res.data?.list || [],
+        total: res.data?.total || 0,
+        origin: res.data
       }
     })
   }