Commit d5d9a8c8 authored by weishengfei's avatar weishengfei

refactor(pages): 优化日志输出信息

- 在多个页面中,将通用的 console.log 输出语句替换为更具描述性的日志信息
- 在 My.vue 中添加了产检提醒页面的跳转逻辑判断
parent 9e648467
......@@ -336,7 +336,7 @@ const onSave = throttleTap( async () => {
checkupItems: ids,
reportImages: bgdImgList.value
}
console.log(param, '参数')
console.log(param, '新增产检保存参数')
showLoading();
const {success, data } = await getAdd(param);
hideLoading();
......@@ -365,6 +365,7 @@ const onSeeBtn = () => {
// 获取产检项目列表
const getList = async () => {
const {success, data, message } = await getExaminationItems()
console.log(success, data, message, '获取产检项目列表')
if (success) {
examinationList.value = data
}
......
......@@ -214,7 +214,7 @@ const onSave = throttleTap(async () => {
id: editId.value,
checkupItems: ids
}
console.log(param, '参数')
console.log(param, '产检项目编辑保存参数')
showLoading();
const {success, data} = await getUpdate(param);
hideLoading();
......@@ -243,6 +243,7 @@ const onSave = throttleTap(async () => {
// 获取产检项目列表
const getList = async () => {
const {success, data, message} = await getExaminationItems()
console.log(success, data, message, '获取产检项目列表')
if (success) {
examinationList.value = data
}
......
......@@ -166,8 +166,8 @@ const getDeleteFn = async (id) => {
}
// 获取报告单
const getReportListFn = async () => {
console.log('获取报告单')
const { code, message, data, success } = await getReportList()
console.log('报告单列表', code, message, data, success)
if (success) {
listData.value = data
} else {
......
......@@ -269,11 +269,12 @@ const onEditTime = async () => {
}
// 获取信息接口
const getInfoFn = async () => {
console.log('获取信息')
// 获取信息
const { code, success, message, data } = await getInfo()
console.log('产检提醒首页获取信息', code, success, message, datacode, success, message, data)
if (success) {
homeInfo.value = data
uni.setStorageSync('dueDate', data.dueDate);
} else {
uni.showToast({
......
......@@ -397,9 +397,10 @@ const onDetails = (id) => {
// 获取信息接口
const getInfoFn = async () => {
console.log('获取信息')
// 获取信息
const {code,success, message, data } = await getInfo()
console.log('日历页面获取信息', code, success, message, data)
if (success) {
info.value = data
} else {
......
......@@ -523,9 +523,9 @@ const onEditTime = async (params) => {
}
// 获取详情接口
const getDetailFn = async (id) => {
console.log('获取信息', id)
// 获取信息
const {code, success, message, data } = await getDetail({id})
console.log('详情页面获取信息', code, success, message, data)
if (success) {
infoData.value = data
bgdImgList.value = data.reportImages == null ? [] : data.reportImages
......
......@@ -270,6 +270,9 @@ const handleToolClick = async (item) => {
buttonName: item.title,
});
// 跳转产检提醒页面判断
const listData = userStore.babyInfo.allBabyBaseInfo || []
if (item.title === "医生问诊") {
if (!cfgStatus.value.isRegister) return;
......@@ -301,8 +304,20 @@ const handleToolClick = async (item) => {
},
},
});
} else if(item.title === "产检提醒"){
if(listData.length > 0){
const hasPregnancy = listData.some(item => item.typeName === "孕中")
console.log(hasPregnancy, 'hasPregnancy')
if(hasPregnancy){
jump({ type: item.link.type, url: item.link.url});
} else{
uni.showToast({
title: "需要是孕中状态哦",
icon: "none",
});
}
}
} else {
const extra = item.link.extra;
if(extra && extra.babyId){
jump({ type: item.link.type, url: item.link.url+'?babyId='+extra.babyId});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment