786 lines
15 KiB
JavaScript
786 lines
15 KiB
JavaScript
import request from "./http";
|
||
|
||
export async function getUserInfo(code, launchOptions) {
|
||
return await request({
|
||
url: "/getAlipayData",
|
||
data: {
|
||
type: "getUserInfo",
|
||
code,
|
||
launchOptions
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function getCommonDiseases() {
|
||
return await request({
|
||
url: "/getYoucanData/corp",
|
||
data: {
|
||
type: "getCustomCorpInfo",
|
||
fields: ['diseases'],
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function getHisCustomer(idCard) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getHisCustomer",
|
||
idCard,
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function bindHisPatient({
|
||
idCard,
|
||
name,
|
||
mobile,
|
||
address,
|
||
psnToken,
|
||
}) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "addHisCustomer",
|
||
idCard,
|
||
name,
|
||
mobile,
|
||
address,
|
||
psnToken,
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function bindFamilyProfile(data) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "addFamilyProfile",
|
||
...data,
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function getFamilyProfileList(userId) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getFamilyProfile",
|
||
userId,
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function updateFamilyProfile(data) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "updateFamilyProfile",
|
||
...data,
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function autoAddHlwPatient(data) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "autoAddHlwPatient",
|
||
...data,
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function getHlwPatientList(accountId) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getHlwPatientList",
|
||
accountId,
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function getHlwPatient(accountId, id) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getHlwPatient",
|
||
accountId,
|
||
id,
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function addHlwPatient(data) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "addHlwPatient",
|
||
...data,
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function updateHlwPatient(data) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "updateHlwPatient",
|
||
...data,
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function sm4Encrypt(data) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "sm4Encrypt",
|
||
...data,
|
||
},
|
||
});
|
||
}
|
||
|
||
|
||
export async function getDrugs(data) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getDrugInfo",
|
||
...data,
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function getHlwDoctorList(data) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getHlwDoctorList",
|
||
onlineStatus: "online",
|
||
serviceStatus: "enabled",
|
||
...data,
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function getRandomOnlineDoctor(data) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getRandomOnlineDoctor",
|
||
...data,
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function getDisease(data) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getDiagnosisList",
|
||
...data,
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function addConsultOrder(params) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "addConsultOrder",
|
||
params,
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function getConsultOrder(data) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getConsultOrder",
|
||
...data,
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function getPayStatus(data) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getPayStatus",
|
||
...data,
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function updateConsultOrderStatus(data) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "updateConsultOrderStatus",
|
||
...data,
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function sendSystemNotification(data) {
|
||
const res = await useHlw({
|
||
type: "sendSystemNotification",
|
||
...data,
|
||
});
|
||
return res;
|
||
}
|
||
|
||
export async function getPatientOrder(data) {
|
||
const res = await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getPatientOrder",
|
||
...data,
|
||
},
|
||
});
|
||
return res;
|
||
}
|
||
|
||
export async function getPatientDiagnosisRecord(data) {
|
||
const res = await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getPatientDiagnosisRecord",
|
||
...data,
|
||
},
|
||
});
|
||
return res;
|
||
}
|
||
|
||
export async function startConsultOrder(data) {
|
||
const res = await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "startConsultOrder",
|
||
...data,
|
||
},
|
||
});
|
||
return res;
|
||
}
|
||
|
||
export async function generateUserSig(data) {
|
||
const res = await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "generateUserSig",
|
||
...data,
|
||
},
|
||
});
|
||
return res;
|
||
}
|
||
|
||
export async function cancelConsultOrder(data) {
|
||
const res = await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "cancelConsultOrder",
|
||
...data,
|
||
},
|
||
});
|
||
return res;
|
||
}
|
||
|
||
export async function refreshOrderPayStatus(data, showLoading) {
|
||
const res = await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "refreshOrderPayStatus",
|
||
...data,
|
||
},
|
||
}, showLoading);
|
||
return res;
|
||
}
|
||
|
||
export async function isDoctorOnline() {
|
||
const res = await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "isDoctorOnline"
|
||
},
|
||
});
|
||
return res;
|
||
}
|
||
|
||
export async function getSealImage(uniqueId) {
|
||
const res = await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getSealImage",
|
||
uniqueId
|
||
},
|
||
});
|
||
return res;
|
||
}
|
||
|
||
export async function getOrderDiagnosis(data) {
|
||
const res = await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getOrderDiagnosis",
|
||
...data
|
||
},
|
||
});
|
||
return res;
|
||
}
|
||
|
||
export async function getDrugStoreList(storeId) {
|
||
const res = await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getDrugStoreList",
|
||
storeId,
|
||
pageSize: 1
|
||
},
|
||
});
|
||
return res;
|
||
}
|
||
|
||
export async function validHlwOrderConfig(key) {
|
||
const res = await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "validHlwOrderConfig",
|
||
key
|
||
},
|
||
});
|
||
return res;
|
||
}
|
||
|
||
export async function applyRefundOrder(data) {
|
||
const res = await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "applyRefundOrder",
|
||
...data
|
||
},
|
||
});
|
||
return res;
|
||
}
|
||
|
||
export async function getRecent90daysDrugRecord(patientId) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getRecent90daysDrugRecord",
|
||
patientId,
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function checkRxUploadStatus(data) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "checkRxUploadStatus",
|
||
...data,
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function getAddressList(accountId) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getAddressList",
|
||
accountId,
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function addAddress(data) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "addAddress",
|
||
...data,
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function getDefaultAddress(accountId) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getDefaultAddress",
|
||
accountId
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function updateAddress(data) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "updateAddress",
|
||
...data,
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function deleteAddress(accountId, id) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "deleteAddress",
|
||
accountId,
|
||
id
|
||
},
|
||
});
|
||
}
|
||
|
||
// ==================== 阿里音视频通话(MRTC)相关 API ====================
|
||
|
||
// 获取音视频通话配置(含签名等),由后端统一生成
|
||
export async function getMrtcConfig(data) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getMrtcConfig",
|
||
...data,
|
||
},
|
||
});
|
||
}
|
||
export async function getHlwConfigByCorpIds(corpIds) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getHlwConfigByCorpIds",
|
||
corpIds
|
||
},
|
||
});
|
||
}
|
||
|
||
// 通知后端:前端已成功创建视频房间(记录 roomId、rtoken 等)
|
||
export async function notifyVideoRoomCreated(data) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "notifyVideoRoomCreated",
|
||
...data,
|
||
},
|
||
});
|
||
}
|
||
export async function getMedicinePurchaseList({ accountId, page, pageSize, statusList }) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getMedicinePurchaseOrderList",
|
||
accountId,
|
||
page,
|
||
pageSize,
|
||
statusList,
|
||
},
|
||
});
|
||
}
|
||
|
||
// 通知后端:视频问诊结束(更新房间状态)
|
||
export async function notifyVideoRoomEnded(data) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "notifyVideoRoomEnded",
|
||
...data,
|
||
},
|
||
});
|
||
}
|
||
export async function getAccountRxList({ accountId, page, pageSize }) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getAccountRxList",
|
||
accountId,
|
||
page,
|
||
pageSize,
|
||
},
|
||
});
|
||
}
|
||
|
||
// ==================== 文章相关 API ====================
|
||
|
||
/**
|
||
* 获取文章分类列表
|
||
*/
|
||
export async function getArticleCateList() {
|
||
return await request({
|
||
url: "/getYoucanData/knowledgeBase",
|
||
data: {
|
||
type: "getArticleCateList",
|
||
},
|
||
});
|
||
}
|
||
|
||
/**
|
||
* 获取文章列表
|
||
* @param {Object} data - 查询参数
|
||
* @param {string} data.cateId - 分类ID
|
||
* @param {string} data.title - 标题搜索
|
||
* @param {number} data.page - 页码
|
||
* @param {number} data.pageSize - 每页数量
|
||
*/
|
||
export async function getArticleList(data) {
|
||
return await request({
|
||
url: "/getYoucanData/knowledgeBase",
|
||
data: {
|
||
type: "getArticleList",
|
||
enable: true,
|
||
...data,
|
||
},
|
||
});
|
||
}
|
||
|
||
/**
|
||
* 获取文章详情
|
||
* @param {string} id - 文章ID
|
||
*/
|
||
export async function getArticle(id) {
|
||
return await request({
|
||
url: "/getYoucanData/knowledgeBase",
|
||
data: {
|
||
type: "getArticle",
|
||
id,
|
||
},
|
||
});
|
||
}
|
||
|
||
/**
|
||
* 文章阅读打点(用于统计查看量)
|
||
* @param {Object} data
|
||
* @param {string} data.articleId - 文章ID
|
||
* @param {string} [data.accountId] - 登录用户账号ID(小程序登录后优先使用)
|
||
* @param {string} [data.unionid] - 匿名访问者标识(小程序侧使用本地生成的 visitorId)
|
||
*/
|
||
export async function addArticleReadRecord(data) {
|
||
return await request(
|
||
{
|
||
url: "/getYoucanData/knowledgeBase",
|
||
data: {
|
||
type: "addArticleReadRecord",
|
||
...data,
|
||
},
|
||
},
|
||
false
|
||
);
|
||
}
|
||
export async function getRxDetail(id, accountId) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getRxDetail",
|
||
id,
|
||
accountId
|
||
},
|
||
});
|
||
}
|
||
|
||
/**
|
||
* 根据ID列表获取文章
|
||
* @param {string} ids - 文章ID,多个用逗号分隔
|
||
*/
|
||
export async function getArticleByIds(ids) {
|
||
return await request({
|
||
url: "/getYoucanData/knowledgeBase",
|
||
data: {
|
||
type: "getArticleByIds",
|
||
ids,
|
||
},
|
||
});
|
||
}
|
||
export async function getOnlineDrugList({ page, pageSize, keyword }) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getOnlineDrugList",
|
||
page,
|
||
pageSize,
|
||
keyword
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function addLackMedicineReg(data) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "addLackMedicineReg",
|
||
...data
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function checkOnlineDrugInfoStock({ areaCode, drugs, accountId, patientId, patientName, phone }) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "checkOnlineDrugInfoStock",
|
||
areaCode,
|
||
drugs,
|
||
accountId,
|
||
patientId,
|
||
patientName,
|
||
phone
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function getRxMedicinePurchaseOrderId({ accountId, rpNo }) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getRxMedicinePurchaseOrderId",
|
||
accountId,
|
||
rpNo
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function getMedicinePurchaseOrder({ accountId, id, withExpressInfo }) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getMedicinePurchaseOrder",
|
||
accountId,
|
||
id,
|
||
withExpressInfo
|
||
},
|
||
});
|
||
}
|
||
export async function testFengniaoAvailable({ orderNo, address, longitude, latitude }) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "testFengniaoAvailable",
|
||
orderNo,
|
||
address,
|
||
longitude,
|
||
latitude
|
||
},
|
||
});
|
||
}
|
||
|
||
|
||
export async function getMedicineOrderTradeNo({ accountId, id, shippingType, receiveName, receivePhone, receiveRegion, receiveAddress, receiveLongitude, receiveLatitude }) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getMedicineOrderTradeNo",
|
||
accountId,
|
||
id,
|
||
shippingType,
|
||
receiveName,
|
||
receivePhone,
|
||
receiveRegion,
|
||
receiveAddress,
|
||
receiveLongitude,
|
||
receiveLatitude
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function getShippingDetail({ accountId, id }) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getShippingDetail",
|
||
accountId,
|
||
id
|
||
},
|
||
});
|
||
}
|
||
|
||
|
||
export async function getAccountHistoryDrugs({ accountId, patientId, page, pageSize }) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getAccountHistoryDrugs",
|
||
accountId,
|
||
patientId,
|
||
page,
|
||
pageSize
|
||
},
|
||
});
|
||
}
|
||
|
||
|
||
export async function getOnlineSimilarDrugInfo({ accountId, patientId, patientName, phone, drugs }) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getOnlineSimilarDrugInfo",
|
||
accountId,
|
||
patientId,
|
||
patientName,
|
||
phone,
|
||
drugs
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function getStoreSimilarDrugInfo({ accountId, patientId, patientName, phone, drugs }) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getStoreSimilarDrugInfo",
|
||
accountId,
|
||
patientId,
|
||
patientName,
|
||
phone,
|
||
drugs
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function getHisInvoice({ patientId, orderNo }) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getHisInvoice",
|
||
patientId,
|
||
orderNo
|
||
},
|
||
});
|
||
|
||
}
|
||
|
||
|
||
export async function getRxMedicineOrderStatus({ accountId, id }) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getRxMedicineOrderStatus",
|
||
accountId,
|
||
id
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function getPatientHomeRxCount(accountId) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "getPatientHomeRxCount",
|
||
accountId
|
||
},
|
||
});
|
||
}
|
||
|
||
export async function addAlipayMiniAppLaunchLog({ accountId, scene, storeId }) {
|
||
return await request({
|
||
url: "/getYoucanData/hlw",
|
||
data: {
|
||
type: "addAlipayMiniAppLaunchLog",
|
||
accountId,
|
||
scene,
|
||
storeId
|
||
},
|
||
});
|
||
}
|