98 lines
2.8 KiB
JavaScript
98 lines
2.8 KiB
JavaScript
|
|
// 患者管理模块 API 封装
|
|||
|
|
import api from '../utils/http.js'
|
|||
|
|
|
|||
|
|
// API 基础路径
|
|||
|
|
const BASE_PATH = '/order'
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 初始化咨询订单
|
|||
|
|
*/
|
|||
|
|
export function initConsultOrder({ doctorCode, accountId, openId, memberId }) {
|
|||
|
|
return api.post(`${BASE_PATH}/consult-orders/init`, { doctorCode, accountId, openId, memberId })
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 绑定订单的患者信息
|
|||
|
|
*/
|
|||
|
|
export function bindOrderPatient({ accountId, memberId, orderId }) {
|
|||
|
|
return api.post(`${BASE_PATH}/consult-orders/bind-member`, { accountId, memberId, orderId })
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 补充病情描述
|
|||
|
|
*/
|
|||
|
|
export function submitOrderDescription({ accountId, orderId, description, diseases, images, hasVisitedHospital }) {
|
|||
|
|
return api.post(`${BASE_PATH}/consult-orders/supplement-description`, { accountId, orderId, description, diseases, images, hasVisitedHospital })
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 获取订单信息
|
|||
|
|
*/
|
|||
|
|
export function getOrderInfo({ orderId }) {
|
|||
|
|
return api.post(`${BASE_PATH}/consult-orders/get`, { orderId })
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 获取订单列表
|
|||
|
|
*/
|
|||
|
|
export function getOrderList({ accountId, page, pageSize: limit, orderStatus }) {
|
|||
|
|
return api.post(`${BASE_PATH}/consult-orders/list`, { accountId, page, limit, orderStatus })
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 获取最新订单
|
|||
|
|
*/
|
|||
|
|
export function getLatestOrder({ accountId, chatGroupId }) {
|
|||
|
|
return api.post(`${BASE_PATH}/consult-orders/latest`, { accountId, chatGroupId })
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 获取订单支付信息
|
|||
|
|
*/
|
|||
|
|
export function getOrderTradeNo({ orderId, accountId }) {
|
|||
|
|
return api.post(`${BASE_PATH}/consult-orders/get-trade-no`, { accountId, orderId })
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 取消订单
|
|||
|
|
*/
|
|||
|
|
export function cancelOrder({ orderId, accountId }) {
|
|||
|
|
return api.post(`${BASE_PATH}/consult-orders/cancel`, { orderId, accountId })
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 获取账号统计信息
|
|||
|
|
*/
|
|||
|
|
export function getAccountStats(accountId, statusList) {
|
|||
|
|
return api.post(`${BASE_PATH}/consult-orders/account-stats`, { accountId, statusList })
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
export function getConsultInfo({doctorCode, memberId, accountId}) {
|
|||
|
|
return api.post(`${BASE_PATH}/consult-orders/get-consult-info`, { doctorCode, memberId, accountId })
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 更新订单最后一条消息ID
|
|||
|
|
*/
|
|||
|
|
export function updateLastMessageId({ orderId, lastMessageId }) {
|
|||
|
|
return api.post(`${BASE_PATH}/consult-orders/update-last-message`, { orderId, lastMessageId })
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 发送消息到群组
|
|||
|
|
* @param {Object} params
|
|||
|
|
* @param {string} params.groupId - 群组ID
|
|||
|
|
* @param {string} params.desc - 消息描述/类型,如:'WAIT_DOCTOR_ACCEPT'
|
|||
|
|
* @param {string} params.message - 消息内容
|
|||
|
|
* @param {string} params.ext - 扩展信息(JSON字符串)
|
|||
|
|
* @param {string} params.fromAccount - 发送者账号(可选)
|
|||
|
|
*/
|
|||
|
|
export function sendMessageToGroup({ groupId, desc, message, ext, fromAccount }) {
|
|||
|
|
return api.post(`${BASE_PATH}/consult-orders/send-message-to-group`, {
|
|||
|
|
groupId,
|
|||
|
|
desc,
|
|||
|
|
message,
|
|||
|
|
ext,
|
|||
|
|
fromAccount
|
|||
|
|
})
|
|||
|
|
}
|