diff --git a/src/api/residentWX/nim.js b/src/api/residentWX/nim.js index db3fefe6820504c3b9a9d00c186ee57190e62011..efbec2f4ab7967ba3307854d906f8e8dfa5b50f1 100644 --- a/src/api/residentWX/nim.js +++ b/src/api/residentWX/nim.js @@ -9,3 +9,8 @@ export function getServiceDoc(params) { export function getAccount(idCard) { return fetchBase({ url: `/chronic-resident/v1/chronic-resident-im/refresh-token/${idCard}`, loading: true }) } + +// 获取聊天信息 +export function getSessionInfo(accountId) { + return fetchBase({ url: `/chronic-resident/v1/chronic-resident-im/doctorInfo/${accountId}`, loading: true }) +} diff --git a/src/residentWX/nim/Index.vue b/src/residentWX/nim/Index.vue index fe43f96416a55c7f56d9e2e2b84c45e0af09f4fd..e75aed732640676a159cbb7896d7be2b63dfffb9 100644 --- a/src/residentWX/nim/Index.vue +++ b/src/residentWX/nim/Index.vue @@ -38,6 +38,7 @@ import { useStore } from '@/residentWX/store' import { getServiceDoc } from '@/api/residentWX/nim.js' import { showFailToast } from 'vant' +import { getSessionInfo } from '@/api/residentWX/nim.js' export default { inject:['showNav', 'isResidentInfo'], @@ -85,6 +86,21 @@ export default { this.doctorList = doctorList this.orgList = ['咨询过的专家'].concat(orgList) this.activeOrg = this.orgList[0] + + // 获取咨询过的医生列表 + this.loadRecord() + }) + }, + loadRecord() { + getSessionInfo(this.userInfo.idCard).then(res =>{ + console.log('getSessionInfo', res) + const result = res.data || [] + const array = [] + result.forEach(e => { + const item = this.doctorList.find(i => e.idCard === i.identityCard) + item && array.push(item) + }) + this.recordList = array }) }, onOrgChange(item) { diff --git a/src/residentWX/nim/Session.vue b/src/residentWX/nim/Session.vue index 3c0fba69f6c10ff60670fb036cfc8ef63c8c262a..4ad37bb3f97359f5ea8bbfa0e17480ceac206c9d 100644 --- a/src/residentWX/nim/Session.vue +++ b/src/residentWX/nim/Session.vue @@ -92,7 +92,6 @@ export default { accountId: '', token: '', msgs: [], - nim: null, // 输入的信息 inputValue: '', // 是否已连接 @@ -113,6 +112,11 @@ export default { ] } }, + setup() { + return { + nim: null + } + }, computed: { userInfo() { return this.store.userInfo diff --git a/vue.config.js b/vue.config.js index 7029e2cc863930f51b3ccceda83ff111a779c7ba..9e245576f2ebce684acaf011912c1cec929df05a 100644 --- a/vue.config.js +++ b/vue.config.js @@ -39,12 +39,12 @@ module.exports = defineConfig({ } }, '/chronic-resident': { - // target: 'http://192.168.1.125:8903', - target: 'https://beta-tumour.zmnyjk.com', + target: 'http://192.168.1.105:8903', + // target: 'https://beta-tumour.zmnyjk.com', changOrigin: true, pathRewrite: { - // '^/chronic-resident': '/', - '^/chronic-resident': '/chronic-resident' + '^/chronic-resident': '/', + // '^/chronic-resident': '/chronic-resident' } } },