diff --git a/App.vue b/App.vue index 2eaa067..cdad63a 100644 --- a/App.vue +++ b/App.vue @@ -154,59 +154,10 @@ }, onShow: function(e) { - // console.log('App Show') - // this.$store.dispatch('initLogin') // 解析scene里面的参数 if (e === undefined) return {}; - // 检查是否已登录,如果未登录才检查配置并决定是否静默登录 - // const token = uni.getStorageSync('token'); - // const userInfo = uni.getStorageSync('userinfo'); - // if (!token || !userInfo) { - // // 未登录,获取系统配置,判断是否需要静默登录 - // try { - // const configRes = getSystemConfig({ - // method: "get", - // data: { - // store_id: uni.getStorageSync('store_id') || '11001' - // } - // }); - // - // // 根据配置决定是否静默登录 - // // 注意:需要根据实际接口返回格式解析 need_login 字段 - // const isGuest = isGuestMode(); - // let needLogin = false; // 默认需要登录页 - // - // if (isGuest && (configRes.data.code === 0 || configRes.data.code === '0')) { - // // 新格式:从 result 中获取 - // const configData = configRes.data.result || {}; - // needLogin = configData.need_login !== false; // false 表示静默登录 - // } else if (!isGuest && (configRes.data?.errcode === 0 || configRes.data?.errcode === '0')) { - // // 旧格式:从 data 中获取 - // const configData = configRes.data.data || {}; - // needLogin = configData.need_login !== false; // false 表示静默登录 - // } - // - // // 如果配置为静默登录(need_login: false),直接执行静默登录 - // if (!needLogin) { - // // 执行静默登录(不显示提示,不跳转) - // silentLogin().then((loginResult) => { - // if (loginResult.success) { - // console.log('静默登录成功'); - // } else { - // console.error('静默登录失败:', loginResult.message); - // } - // }).catch((error) => { - // console.error('静默登录异常:', error); - // }); - // } - // // 如果配置为需要登录页(need_login: true),不执行任何操作,等待用户手动登录 - // } catch (error) { - // // 配置接口调用失败,不影响应用启动,仅记录日志 - // console.error('获取系统配置失败:', error); - // } - // } const scene = decodeURIComponent(e.query.scene) // 这里接收扫码参数 if (scene) { @@ -241,6 +192,20 @@ console.log('userId', userId, st_id[0].split('su_id=')[1], res); }) } + // 5.3 处理门店切换/设置 + // const storeId = uni.getStorageSync('store_id'); + // if (storeId) { + // storeChange({ + // method: "post", + // data: { + // store_id: storeId + // } + // }).catch((err) => { + // console.error('切换门店失败:', err); + // }); + // } else { + // uni.setStorageSync('store_id', res.data.data.data.store_id); + // } // console.log(st_id, '4444111111111'); // console.log(scene, '4444'); } diff --git a/pages/cate/index.vue b/pages/cate/index.vue index ea4a4e3..e8e41db 100644 --- a/pages/cate/index.vue +++ b/pages/cate/index.vue @@ -102,16 +102,19 @@ } }).then((res) => { // console.log(res, 'list'); - if (res.data.errcode == 0) { - // console.log(res, 'res'); - this.categoryLists = res.data.data.list - this.cid = res.data.data.list.map(x => x.id) - this.num = res.data.data.list[0].id //初始选中 - // this.current = res.data.data[0].subs[0].id //初始选中2 + if (res.data.code == 0) { + const list = (res.data.result && res.data.result.list) || [] + this.categoryLists = list + if (!list.length) { + this.infoList = [] + return + } + const firstId = list[0].id + this.num = firstId + this.cid = firstId + this.getArticleList() } }) - - this.getArticleList() }, // 文章列表 getArticleList() { @@ -123,8 +126,8 @@ } }).then((res) => { // console.log(res, 'list'); - if (res.data.errcode == 0) { - this.infoList = res.data.data.list + if (res.data.code == 0) { + this.infoList = (res.data.result && res.data.result.list) || [] // console.log(res, 'list') } diff --git a/pages/cate/info-detail.vue b/pages/cate/info-detail.vue index 6ed6dfe..9e42115 100644 --- a/pages/cate/info-detail.vue +++ b/pages/cate/info-detail.vue @@ -44,9 +44,9 @@ } }).then((res) => { // console.log(res, 'list'); - if (res.data.errcode == 0) { - this.infoList = res.data.data - this.content = res.data.data.content + if (res.data.code == 0 && res.data.result) { + this.infoList = res.data.result + this.content = res.data.result.content } }) }, diff --git a/pages/home/home.vue b/pages/home/home.vue index ac38280..ecef247 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -117,7 +117,8 @@ {{item.good_at}} - 咨询 + + 查看 @@ -275,10 +276,10 @@ export default { }, onReady() { - console.log('调试静默登陆', isLoggedIn()); + // console.log('调试静默登陆', isLoggedIn()); // 判断是否已登录 if (!isLoggedIn()) { - console.log('调试静默登陆2', isLoggedIn()); + // console.log('调试静默登陆2', isLoggedIn()); // 未登录时设置guest模式标记和store_id // setGuestMode(); @@ -660,6 +661,7 @@ export default { }, onShow() { this.storeId = uni.getStorageSync('store_id'); + this.toChang(this.storeId) this.getStore(); this.getList(); this.getProductList(); diff --git a/request/api/api.js b/request/api/api.js index b7a69be..b605932 100644 --- a/request/api/api.js +++ b/request/api/api.js @@ -329,21 +329,21 @@ export async function getUpdateUseWay(params) { return data } -//资讯列表 /v1/info/article-list +//资讯列表(Laravel guest-info,列表不含正文) export async function articleList(params) { - let data = await http('/oldApi/v1/info/article-list', params) + let data = await http('/xkApi/guest/guest-info/article-list', params) return data } -//分类列表 /v1/info/categories +//分类列表 export async function categoriesList(params) { - let data = await http('/oldApi/v1/info/categories', params) + let data = await http('/xkApi/guest/guest-info/categories', params) return data } -//资讯详情 /v1/info/article-info +//资讯详情(含正文) export async function articleInfo(params) { - let data = await http('/oldApi/v1/info/article-info', params) + let data = await http('/xkApi/guest/guest-info/article-info', params) return data } diff --git a/request/api/request.js b/request/api/request.js index d58f6ba..a970b39 100644 --- a/request/api/request.js +++ b/request/api/request.js @@ -121,6 +121,15 @@ function request(url, params, method = 0) { } else if (url.indexOf('/oldApi/v1/doctor/office-list') !== -1) { url = url.replace('/oldApi/v1/doctor/office-list', '/guest/guest-doctor/office-list'); baseURL = envUrls.xkApi; + } else if (url.indexOf('/oldApi/v1/info/categories') !== -1) { + url = url.replace('/oldApi/v1/info/categories', '/guest/guest-info/categories'); + baseURL = envUrls.xkApi; + } else if (url.indexOf('/oldApi/v1/info/article-list') !== -1) { + url = url.replace('/oldApi/v1/info/article-list', '/guest/guest-info/article-list'); + baseURL = envUrls.xkApi; + } else if (url.indexOf('/oldApi/v1/info/article-info') !== -1) { + url = url.replace('/oldApi/v1/info/article-info', '/guest/guest-info/article-info'); + baseURL = envUrls.xkApi; } } diff --git a/subPackages/doctor/components/FollowUpDrugDrawer.vue b/subPackages/doctor/components/FollowUpDrugDrawer.vue index 32802c7..a39f96a 100644 --- a/subPackages/doctor/components/FollowUpDrugDrawer.vue +++ b/subPackages/doctor/components/FollowUpDrugDrawer.vue @@ -1,300 +1,386 @@ - - - - - + + + + + + \ No newline at end of file diff --git a/subPackages/doctor/doctor-userinfo.vue b/subPackages/doctor/doctor-userinfo.vue index b51e682..47f24bb 100644 --- a/subPackages/doctor/doctor-userinfo.vue +++ b/subPackages/doctor/doctor-userinfo.vue @@ -10,6 +10,9 @@ {{ registerTypeLabel }} + + 委托诊所:{{ delegateStoreName }} 委托医生:{{ delegateDoctorName }} + 请选择患者信息,以便医生给出更准确的诊疗建议,患者信息仅医生可见 @@ -64,11 +67,9 @@ - 暂无可选西药 @@ -158,10 +159,13 @@ import { userList, userEidtPatient, - registe + registe, + storeInfo, + doctorDetail, } from '@/request/api/api.js' +import { getClinicOnlineConsultationInfoApi } from '@/request/api/product'; import {checkDev} from "@/utils/utils"; -import {createRegisterInfoApi, getWesternDrugsForFollowUpApi, genOrderApi, saveRegisterInfoApi} from "@/request/api/order"; +import {createRegisterInfoApi, genOrderApi, saveRegisterInfoApi} from "@/request/api/order"; import request from "@/request/api/request"; export default { data() { @@ -217,8 +221,9 @@ export default { rInfo: [], // 健康信息 registerType: "0", // 新增:挂号类型(0线下/1线上) delegateStoreId: '', // 委托诊所ID(购药时使用) + delegateStoreName: '', + delegateDoctorName: '', chiefComplaint: '', - followUpDrugList: [], selectedFollowUpDrugs: [], } }, @@ -247,6 +252,7 @@ export default { // 获取委托诊所ID(如果有) this.delegateStoreId = e.delegate_store_id || ''; + this.loadDelegateDisplayInfo(); console.log(e) }, computed: { @@ -281,7 +287,11 @@ export default { showFollowUpForm() { const t = this.registerType; return (t === '2' || t === '3') && !this.hasPrefilledFollowUpInfo; - } + }, + showDelegateInfo() { + const isFollowUp = this.registerType === '2' || this.registerType === '3'; + return isFollowUp && !!(this.delegateStoreName || this.delegateDoctorName); + }, }, methods: { checkDev, @@ -290,16 +300,33 @@ export default { ? this.delegateStoreId : (uni.getStorageSync('store_id') || '11001'); }, - async loadFollowUpWesternDrugs() { - if (!this.showFollowUpForm) return; - const storeId = this.resolveRegisterStoreId(); + async loadDelegateDisplayInfo() { + if (this.registerType !== '2' && this.registerType !== '3') return; + const currentStoreId = uni.getStorageSync('store_id') || '11001'; try { - const res = await getWesternDrugsForFollowUpApi({ store_id: storeId }); - const list = res.data?.result; - this.followUpDrugList = Array.isArray(list) ? list : []; + if (this.registerType === '2') { + const res = await getClinicOnlineConsultationInfoApi({ store_id: currentStoreId }); + const result = res.data?.result; + if (res.data?.code === 0 && result) { + this.delegateStoreName = result.delegate_store_name || result.store_name || ''; + this.delegateDoctorName = result.doctor_name || ''; + } + } else { + const storeId = this.delegateStoreId || this.resolveRegisterStoreId(); + const [storeRes, doctorRes] = await Promise.all([ + storeInfo({ method: 'post', data: { store_id: storeId } }), + doctorDetail({ method: 'post', data: { doctor_id: this.Did, store_id: currentStoreId } }), + ]); + if (storeRes.data?.errcode == 0) { + this.delegateStoreName = storeRes.data.data?.store?.name || ''; + } + const doctorData = doctorRes.data?.data || doctorRes.data?.result; + if (doctorRes.data?.errcode == 0 || doctorRes.data?.code === 0) { + this.delegateDoctorName = doctorData?.name || ''; + } + } } catch (e) { - console.error('加载复诊西药列表失败', e); - this.followUpDrugList = []; + console.warn('loadDelegateDisplayInfo', e); } }, followUpDrugIdsForApi() { @@ -652,11 +679,9 @@ export default { }, mounted() { this.getInfolist() - this.loadFollowUpWesternDrugs() }, onShow() { this.getInfolist() - this.loadFollowUpWesternDrugs() } } @@ -710,6 +735,15 @@ export default { color: #64748B; line-height: 1.5; } + + .delegate-info { + display: block; + font-size: 26rpx; + font-weight: 400; + color: #4175EE; + line-height: 1.5; + margin-bottom: 8rpx; + } } /* 原有就诊人卡片区 */ diff --git a/subPackages/follow-up/medication-info.vue b/subPackages/follow-up/medication-info.vue index 3277d61..2445de0 100644 --- a/subPackages/follow-up/medication-info.vue +++ b/subPackages/follow-up/medication-info.vue @@ -59,15 +59,27 @@ - + + 症状 + + + - + @@ -97,16 +109,6 @@ - - @@ -151,7 +153,8 @@ export default { illnessInfo: '', }, illnessOptions: [], - showIllnessPicker: false, + selectedIllnessIndexes: [], + illnessOtherText: '', delegateStoreId: '', doctorIdFromQuery: '', submitted: false, @@ -253,6 +256,11 @@ export default { } return parseFloat(this.productDetail.price || 0); }, + showIllnessOtherInput() { + return this.selectedIllnessIndexes.some( + (idx) => this.illnessOptions[idx] && this.illnessOptions[idx].value === '__other__', + ); + }, }, onLoad(options) { if (options.mode === 'clinic_post_register') { @@ -511,19 +519,39 @@ export default { if (res.data.code === 0) { const data = res.data.result; Object.assign(this.productDetail, data); - if (data.indications_array && data.indications_array.length > 0) { - this.illnessOptions = data.indications_array.map((item) => ({ - value: item.label || item.value, - label: item.label || item.value, - })); - } + const options = (data.indications_array || []).map((item) => ({ + value: item.label || item.value, + label: item.label || item.value, + })); + options.push({ value: '__other__', label: '其他' }); + this.illnessOptions = options; } }); }, - onIllnessConfirm(e) { - const index = e[0]; - this.prescriptionFormData.illnessInfo = this.illnessOptions[index].value; - this.showIllnessPicker = false; + toggleIllnessTag(index) { + const pos = this.selectedIllnessIndexes.indexOf(index); + if (pos === -1) { + this.selectedIllnessIndexes.push(index); + } else { + this.selectedIllnessIndexes.splice(pos, 1); + if (this.illnessOptions[index] && this.illnessOptions[index].value === '__other__') { + this.illnessOtherText = ''; + } + } + this.syncIllnessInfo(); + }, + syncIllnessInfo() { + const parts = this.selectedIllnessIndexes + .map((idx) => { + const opt = this.illnessOptions[idx]; + if (!opt) return ''; + if (opt.value === '__other__') { + return (this.illnessOtherText || '').trim(); + } + return opt.label || opt.value; + }) + .filter(Boolean); + this.prescriptionFormData.illnessInfo = parts.join('、'); }, async getDefaultDoctorId() { try { @@ -657,10 +685,23 @@ export default { }); }, async submitPharmacy() { - if (!this.prescriptionFormData.hasVisited || !this.prescriptionFormData.hasUsedDrug || !this.prescriptionFormData.illnessInfo) { + if (!this.prescriptionFormData.hasVisited || !this.prescriptionFormData.hasUsedDrug) { uni.showToast({ title: '请填写完整信息', icon: 'none' }); return; } + if (!this.selectedIllnessIndexes.length) { + uni.showToast({ title: '请选择症状', icon: 'none' }); + return; + } + if (this.showIllnessOtherInput && !(this.illnessOtherText || '').trim()) { + uni.showToast({ title: '请填写具体症状', icon: 'none' }); + return; + } + this.syncIllnessInfo(); + if (!this.prescriptionFormData.illnessInfo) { + uni.showToast({ title: '请选择症状', icon: 'none' }); + return; + } if (this.submitted) return; const formData = { ...this.prescriptionFormData }; const quantity = this.prescriptionQuantity; @@ -792,6 +833,21 @@ export default { color: #333; } } +.illness-section { + padding: 20rpx 0; + .illness-label { + font-size: 28rpx; + color: #333; + margin-bottom: 16rpx; + } + .illness-tags { + display: flex; + flex-wrap: wrap; + ::v-deep .u-tag { + margin: 0 20rpx 16rpx 0; + } + } +} .popup-actions { display: flex; gap: 30rpx;