From 404fcd697e40dc1105bc2a0735b2589f07fa3136 Mon Sep 17 00:00:00 2001 From: wangxia <779219182@qq.com> Date: Sat, 30 Aug 2025 14:30:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/job.js | 1 + root/NEUIKit/pages/Chat/index.vue | 129 ++++++++++++++++------ root/NEUIKit/pages/Chat/message/message-input.vue | 4 +- root/NEUIKit/utils/api.js | 8 ++ utils/common.js | 7 +- 5 files changed, 112 insertions(+), 37 deletions(-) create mode 100644 root/NEUIKit/utils/api.js diff --git a/api/job.js b/api/job.js index 8361be3..a74e299 100644 --- a/api/job.js +++ b/api/job.js @@ -29,6 +29,7 @@ let jobInfo = { get_city_list: '/city/getAllCityLevel2', // 获取城市列表 new_job_list: '/yishoudan/custom/job/listV2', // 新职位列表 dao_job_list: '/yishoudan/store/job/platform/list', // 稻田职位列表 + get_userViewJobList: "/assistant/custom/job/v2/userViewJobList",// 获取用户浏览的职位列表 } export default jobInfo; \ No newline at end of file diff --git a/root/NEUIKit/pages/Chat/index.vue b/root/NEUIKit/pages/Chat/index.vue index 2eff01d..2cceef2 100644 --- a/root/NEUIKit/pages/Chat/index.vue +++ b/root/NEUIKit/pages/Chat/index.vue @@ -68,7 +68,15 @@ import { V2NIMMessage } from "nim-web-sdk-ng/dist/v2/NIM_UNIAPP_SDK/V2NIMMessage import { V2NIMConst } from "nim-web-sdk-ng/dist/v2/NIM_UNIAPP_SDK"; const G = getCurrentInstance().appContext.app.config.globalProperties.G; const F = getCurrentInstance().appContext.app.config.globalProperties.F; -const api = getCurrentInstance().appContext.app.config.globalProperties.api; +import api from "../../utils/api.js"; +console.log("apiapiapi", api); +const requestComeFrom = computed(() => { + let val = "isToC"; + if (G.globalConstantData.requestComeFrom && (G.globalConstantData.requestComeFrom == "assistant_miniapp" || G.globalConstantData.requestComeFrom == "supply_chain_miniapp")) { + val = "isToB"; + } + return val; // 小程序的判断 +}); // 小程序的判断 export interface YxReplyMsg { messageClientId: string; scene: V2NIMConst.V2NIMConversationType; @@ -80,23 +88,7 @@ export interface YxReplyMsg { } trackInit("ChatUIKit"); -const tabInfo = ref({ - list: [ - { - name: "我的", - classify: 1, - }, - { - name: "浏览", - classify: 2, - }, - { - name: "收藏", - classify: 3, - }, - ], - active: 0, -}); +const tabInfo = ref(); const title = ref(""); const jobListShow = ref(false); const toDetail = () => { @@ -424,9 +416,57 @@ onLoad((options) => { }); const msgHeight = ref(0); const beCollectedAgencyId = ref(0); - onMounted(() => { setNavTitle(); + console.log('uni.getStorageSync("apply-userinfo")', requestComeFrom.value); + let userInfo = uni.getStorageSync("apply-userinfo"); + // 小程序的判断 + if (requestComeFrom.value == "isToB") { + tabInfo.value = { + list: [ + { + name: "浏览", + classify: 2, + }, + { + name: "收藏", + classify: 3, + }, + { + name: "对方", + classify: 1, + }, + { + name: "我的", + classify: 99, + }, + ], + active: 0, + }; + // 如果是发单号则跳转到我的 + if (userInfo.supplierAccount == 1) { + tabInfo.value.active = 3; + } + } else { + // 招工宝 + tabInfo.value = { + list: [ + { + name: "浏览", + classify: 2, + }, + { + name: "想去", + classify: 3, + }, + { + name: "商家", + classify: 1, + }, + ], + active: 0, + }; + } agencyIdByAccId().then((res) => { beCollectedAgencyId.value = res.agencyId; getList(); @@ -480,17 +520,13 @@ const checkLength = (e) => { }; const handleUpdateTab = (e) => { console.log(e); + query.value.page = 1; tabInfo.value.active = e; uni.showLoading({ title: "加载中...", }); - if (e == 0 || e == 2) { - getList(); - } else { - getSeenList(); - } + getList(); }; -const getSeenList = () => {}; const agencyIdByAccId = () => { let accid = conversationId.split("|")[2]; return new Promise((reso) => { @@ -502,6 +538,9 @@ const agencyIdByAccId = () => { const searchJob = () => { query.value.list = []; query.value.page = 1; + uni.showLoading({ + title: "加载中...", + }); getList(); }; const getList = ($type = "init") => { @@ -512,17 +551,41 @@ const getList = ($type = "init") => { pageSize: query.value.size, keys: keyword.value, cityName: "全国", - sortTag: 2, }; - if (tabInfo.value.active === 0) { - parmas.agencyId = uni.getStorageSync("apply-agencyId"); - parmas.classify = 99; - } else if (tabInfo.value.active == 2) { - parmas.classify = 3; - parmas.beCollectedAgencyId = beCollectedAgencyId.value; + let url = "job_list"; + console.log("G.globalConstantData.requestComeFrom", requestComeFrom.value); + let classify = tabInfo.value.list[tabInfo.value.active].classify; + if (requestComeFrom.value == "isToC") { + url = "yi_job_list"; + parmas.classify = 1; + // classify: 3:想去 2:浏览历史 1:对方职位(商家) + if (classify == 3) { + parmas.ujc = 1; + } else if (classify == 2) { + parmas.beCollectedAgencyId = uni.getStorageSync("AGENCY_ID"); + url = "get_userViewJobList"; + } else if (classify == 1) { + parmas.agencyId = uni.getStorageSync("AGENCY_ID"); + } + } else { + // classify 99:我的职位 3:收藏 2:浏览历史 1:对方职位 + if (classify === 99) { + parmas.agencyId = uni.getStorageSync("apply-agencyId"); + parmas.classify = classify; + } else if (classify == 3) { + parmas.beCollectedAgencyId = beCollectedAgencyId.value; + parmas.classify = classify; + } else if (classify == 2) { + parmas.beCollectedAgencyId = beCollectedAgencyId.value; + url = "get_userViewJobList"; + } else if (classify == 1) { + parmas.agencyId = beCollectedAgencyId.value; + parmas.classify = classify; + } } + console.log("parmas", parmas); - G.Post(api.job_list, parmas, (res) => { + G.Post(api[url], parmas, (res) => { console.log("res", res); loading.value = false; uni.hideLoading(); diff --git a/root/NEUIKit/pages/Chat/message/message-input.vue b/root/NEUIKit/pages/Chat/message/message-input.vue index 2dc86e4..fef0c09 100644 --- a/root/NEUIKit/pages/Chat/message/message-input.vue +++ b/root/NEUIKit/pages/Chat/message/message-input.vue @@ -75,12 +75,12 @@ - +