Commit 3f3577ab authored by weishengfei's avatar weishengfei

feat(obstetric): 更新产检相关功能

- 修改 API 路径,增加 '/c' 前缀
- 优化日期选择器组件,支持根据预产期动态生成日期范围
- 修复添加和编辑产检页面的删除按钮点击事件
- 增加上传图片数量限制,并优化图片预览功能
- 优化我的报告卡页面,增加空数据状态显示
- 更新请求环境为测试环境
parent 32db28aa
...@@ -14,35 +14,35 @@ export const postnatalJSON = () => api.get('/c/front/content',{type:'postnatal'} ...@@ -14,35 +14,35 @@ export const postnatalJSON = () => api.get('/c/front/content',{type:'postnatal'}
* @returns * @returns
*/ */
export const getInfo = (data) => api.get('/maternity_checkup/home',data); export const getInfo = (data) => api.get('/c/maternityCheckup/home',data);
/** /**
* 产看产检详情 * 产看产检详情
* @returns * @returns
*/ */
export const getDetail = (data) => api.get('/maternityCheckup/detail',data); export const getDetail = (data) => api.get('/c/maternityCheckup/detail',data);
/** /**
* 删除报告单 * 删除报告单
* @returns * @returns
*/ */
export const getDelete = (data) => api.get('/maternityCheckup/delete',data); export const getDelete = (data) => api.get('/c/maternityCheckup/delete',data);
/** /**
* 产检项目列表 * 产检项目列表
* @returns * @returns
*/ */
export const getExaminationItems = (data) => api.get('/maternityCheckup/examinationItems',data); export const getExaminationItems = (data) => api.get('/c/maternityCheckup/examinationItems',data);
/** /**
* 修改产检记录 * 修改产检记录
* @returns * @returns
*/ */
export const getUpdate = (data) => api.post('/maternityCheckup/update',data); export const getUpdate = (data) => api.post('/c/maternityCheckup/update',data);
/** /**
* *
...@@ -51,11 +51,11 @@ export const getUpdate = (data) => api.post('/maternityCheckup/update',data); ...@@ -51,11 +51,11 @@ export const getUpdate = (data) => api.post('/maternityCheckup/update',data);
* @returns * @returns
*/ */
export const getAdd = (data) => api.post('/maternityCheckup/add',data); export const getAdd = (data) => api.post('/c/maternityCheckup/add',data);
/** /**
* 我的报告单列表 * 我的报告单列表
* @returns * @returns
*/ */
export const getReportList = () => api.get('/maternityCheckup/reportList'); export const getReportList = () => api.get('/c/maternityCheckup/reportList');
\ No newline at end of file \ No newline at end of file
...@@ -17,16 +17,17 @@ const { ...@@ -17,16 +17,17 @@ const {
// 通常可以吧 baseUrl 单独放在一个 js 文件了 // 通常可以吧 baseUrl 单独放在一个 js 文件了
// const baseUrl = "http://172.16.224.178:7777/pmall"; // const baseUrl = "http://172.16.224.178:7777/pmall";
// const baseUrl = "https://momclub-uat.feihe.com/pmall";//测试环境 // const baseUrl = "https://momclub-uat.feihe.com/pmall";//测试环境
const baseUrl = "https://momclub.feihe.com/pmall";//生产环境 // const baseUrl = "https://momclub.feihe.com/pmall";//生产环境
const baseUrl = "https://feihe.m.duibatest.com.cn/pmall";//测试环境
const request = (options = {}) => { const request = (options = {}) => {
// 在这里可以对请求头进行一些设置 // 在这里可以对请求头进行一些设置
// 例如: // 例如:
// options.header = { // options.header = {
// "Content-Type": "application/x-www-form-urlencoded" // "Content-Type": "application/x-www-form-urlencoded"
// } // }
// if(options.url == '/c/ai/chat/query'){ // if(options.url == '/c/ai/chat/query'){
// baseUrl = "https://docs.dui88.com/mock/1956"; // baseUrl = "https://docs.dui88.com/mock/1956";
// } // }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni uni
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</template> </template>
<script setup> <script setup>
import { ref, watch, onMounted } from 'vue' import { ref, watch, onMounted, computed } from 'vue'
const props = defineProps({ const props = defineProps({
visible: { visible: {
...@@ -53,27 +53,81 @@ const props = defineProps({ ...@@ -53,27 +53,81 @@ const props = defineProps({
const emit = defineEmits(['update:visible', 'confirm']) const emit = defineEmits(['update:visible', 'confirm'])
// 日期选择器相关状态 // 日期选择器相关状态
const dueDate = ref(uni.getStorageSync('dueDate') || '')
const date = new Date() const date = new Date()
const timeValue = ref([]) // 日期选择器当前值 const timeValue = ref([]) // 日期选择器当前值
// 年份数据 (2010-当前年份+2) // 计算日期范围
const years = ref([]) const minDate = computed(() => {
const currentYear = date.getFullYear() if (!dueDate.value) return new Date(2010, 0, 1)
for (let i = 2010; i <= currentYear + 2; i++) { const due = new Date(dueDate.value)
years.value.push(i) const min = new Date(due)
} min.setDate(min.getDate() - 280) // 280天前
return min
})
// 月份数据 const maxDate = computed(() => {
const months = ref([]) if (!dueDate.value) return new Date(date.getFullYear() + 2, 11, 31)
for (let i = 1; i <= 12; i++) { return new Date(dueDate.value)
months.value.push(i) })
}
// 年份数据 (minDate的年份到maxDate的年份)
const years = computed(() => {
const yearList = []
const minYear = minDate.value.getFullYear()
const maxYear = maxDate.value.getFullYear()
for (let i = minYear; i <= maxYear; i++) {
yearList.push(i)
}
return yearList
})
// 月份数据 (根据当前选中的年份动态生成)
const months = computed(() => {
const monthList = []
let minMonth = 1
let maxMonth = 12
if (selectedYear.value === minDate.value.getFullYear()) {
minMonth = minDate.value.getMonth() + 1
}
if (selectedYear.value === maxDate.value.getFullYear()) {
maxMonth = maxDate.value.getMonth() + 1
}
for (let i = minMonth; i <= maxMonth; i++) {
monthList.push(i)
}
return monthList
})
// 日期数据 (动态生成) // 日期数据 (动态生成)
const days = ref([]) const days = computed(() => {
const dayList = []
let minDay = 1
let maxDay = getDaysInMonth(selectedYear.value, selectedMonth.value)
// 如果是范围的最小年月
if (selectedYear.value === minDate.value.getFullYear() &&
selectedMonth.value === minDate.value.getMonth() + 1) {
minDay = minDate.value.getDate()
}
// 如果是范围的最大年月
if (selectedYear.value === maxDate.value.getFullYear() &&
selectedMonth.value === maxDate.value.getMonth() + 1) {
maxDay = maxDate.value.getDate()
}
for (let i = minDay; i <= maxDay; i++) {
dayList.push(i)
}
return dayList
})
// 当前选中的年月日 // 当前选中的年月日
const selectedYear = ref(currentYear) const selectedYear = ref(date.getFullYear())
const selectedMonth = ref(date.getMonth() + 1) const selectedMonth = ref(date.getMonth() + 1)
const selectedDay = ref(date.getDate()) const selectedDay = ref(date.getDate())
...@@ -82,21 +136,6 @@ function getDaysInMonth(year, month) { ...@@ -82,21 +136,6 @@ function getDaysInMonth(year, month) {
return new Date(year, month, 0).getDate() return new Date(year, month, 0).getDate()
} }
// 更新日期数据
const updateDays = () => {
const daysInMonth = getDaysInMonth(selectedYear.value, selectedMonth.value)
days.value = []
for (let i = 1; i <= daysInMonth; i++) {
days.value.push(i)
}
// 确保选中的日期不超过当月最大天数
if (selectedDay.value > days.value.length) {
selectedDay.value = days.value.length
}
// 更新选择器的索引值
updateValueIndices()
}
// 更新选择器的索引值 // 更新选择器的索引值
const updateValueIndices = () => { const updateValueIndices = () => {
const yearIndex = years.value.indexOf(selectedYear.value) const yearIndex = years.value.indexOf(selectedYear.value)
...@@ -105,9 +144,57 @@ const updateValueIndices = () => { ...@@ -105,9 +144,57 @@ const updateValueIndices = () => {
if (yearIndex !== -1 && monthIndex !== -1 && dayIndex !== -1) { if (yearIndex !== -1 && monthIndex !== -1 && dayIndex !== -1) {
timeValue.value = [yearIndex, monthIndex, dayIndex] timeValue.value = [yearIndex, monthIndex, dayIndex]
} else {
// 如果当前选中的值不在范围内,自动调整到最近的合法值
adjustToValidDate()
} }
} }
// 调整到合法的日期
const adjustToValidDate = () => {
let year = selectedYear.value
let month = selectedMonth.value
let day = selectedDay.value
// 调整年份
if (year < minDate.value.getFullYear()) {
year = minDate.value.getFullYear()
} else if (year > maxDate.value.getFullYear()) {
year = maxDate.value.getFullYear()
}
// 调整月份
if (year === minDate.value.getFullYear() && month < minDate.value.getMonth() + 1) {
month = minDate.value.getMonth() + 1
} else if (year === maxDate.value.getFullYear() && month > maxDate.value.getMonth() + 1) {
month = maxDate.value.getMonth() + 1
}
// 调整日期
const maxDays = getDaysInMonth(year, month)
if (day > maxDays) {
day = maxDays
}
if (year === minDate.value.getFullYear() &&
month === minDate.value.getMonth() + 1 &&
day < minDate.value.getDate()) {
day = minDate.value.getDate()
}
if (year === maxDate.value.getFullYear() &&
month === maxDate.value.getMonth() + 1 &&
day > maxDate.value.getDate()) {
day = maxDate.value.getDate()
}
selectedYear.value = year
selectedMonth.value = month
selectedDay.value = day
updateValueIndices()
}
// 设置日期 // 设置日期
const setDate = (indices) => { const setDate = (indices) => {
if (!indices || indices.length !== 3) return if (!indices || indices.length !== 3) return
...@@ -157,28 +244,28 @@ const initDate = () => { ...@@ -157,28 +244,28 @@ const initDate = () => {
selectedMonth.value = month selectedMonth.value = month
selectedDay.value = day selectedDay.value = day
// 更新 timeValue 的索引 // 调整到合法日期
const yearIndex = years.value.indexOf(year) adjustToValidDate()
const monthIndex = months.value.indexOf(month)
const dayIndex = days.value.indexOf(day)
timeValue.value = [yearIndex, monthIndex, dayIndex]
} else { } else {
// 如果没有时间,设置为当前日期 // 如果没有时间,设置为当前日期或最大允许日期
const today = new Date() const today = new Date()
const yearIndex = years.value.indexOf(today.getFullYear()) if (today > maxDate.value) {
const monthIndex = months.value.indexOf(today.getMonth() + 1) selectedYear.value = maxDate.value.getFullYear()
const dayIndex = days.value.indexOf(today.getDate()) selectedMonth.value = maxDate.value.getMonth() + 1
selectedDay.value = maxDate.value.getDate()
timeValue.value = [yearIndex, monthIndex, dayIndex] } else if (today < minDate.value) {
selectedYear.value = minDate.value.getFullYear()
selectedMonth.value = minDate.value.getMonth() + 1
selectedDay.value = minDate.value.getDate()
} else {
selectedYear.value = today.getFullYear()
selectedMonth.value = today.getMonth() + 1
selectedDay.value = today.getDate()
}
updateValueIndices()
} }
} }
// 监听年份和月份变化,更新日期数据
watch([selectedYear, selectedMonth], () => {
updateDays()
})
// 监听选择器值变化,更新选中日期 // 监听选择器值变化,更新选中日期
watch(() => timeValue.value, (newVal) => { watch(() => timeValue.value, (newVal) => {
setDate(newVal) setDate(newVal)
...@@ -191,12 +278,22 @@ watch(() => props.visible, (newVal) => { ...@@ -191,12 +278,22 @@ watch(() => props.visible, (newVal) => {
} }
}) })
// 监听dueDate变化,重新初始化
watch(() => uni.getStorageSync('dueDate'), (newVal) => {
dueDate.value = newVal
if (props.visible) {
initDate()
}
})
onMounted(() => { onMounted(() => {
updateDays() dueDate.value = uni.getStorageSync('dueDate')
initDate()
}) })
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
/* 保持原有样式不变 */
.picker-layer-mask { .picker-layer-mask {
position: fixed; position: fixed;
left: 0; left: 0;
...@@ -207,7 +304,6 @@ onMounted(() => { ...@@ -207,7 +304,6 @@ onMounted(() => {
z-index: 3999; z-index: 3999;
} }
/* 遮罩层样式 */
.picker-layer-popup { .picker-layer-popup {
position: fixed; position: fixed;
left: 0; left: 0;
...@@ -230,7 +326,6 @@ onMounted(() => { ...@@ -230,7 +326,6 @@ onMounted(() => {
} }
} }
/* 弹窗容器样式 */
.picker-layer-panel { .picker-layer-panel {
width: 100vw; width: 100vw;
height: 50vh; height: 50vh;
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<view class="item-name"> <view class="item-name">
{{ itemName }} {{ itemName }}
</view> </view>
<image @click="onDetele(id)" class="item-img" src="/static/chanjianTool/delete.png"></image> <image @click="onDelete(id)" class="item-img" src="/static/chanjianTool/delete.png"></image>
</view> </view>
</view> </view>
</view> </view>
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</view> </view>
<view class="img-list-item" v-for="(item, index) in bgdImgList" :key="index"> <view class="img-list-item" v-for="(item, index) in bgdImgList" :key="index">
<view class="item-image"> <view class="item-image" @click="onPreviewImage(item)">
<image class="img1" :src="item" mode="widthFix"></image> <image class="img1" :src="item" mode="widthFix"></image>
</view> </view>
<image @click="onImageDel(item)" class="img" src="/static/chanjianTool/icon14.png"></image> <image @click="onImageDel(item)" class="img" src="/static/chanjianTool/icon14.png"></image>
...@@ -145,7 +145,6 @@ import { ...@@ -145,7 +145,6 @@ import {
// 导入日期选择器组件 // 导入日期选择器组件
import DatePicker from '@/components/DatePicker.vue' import DatePicker from '@/components/DatePicker.vue'
// 默认产检时间 // 默认产检时间
const time = ref(''); const time = ref('');
...@@ -245,21 +244,29 @@ const saveSelection = () => { ...@@ -245,21 +244,29 @@ const saveSelection = () => {
listData.value = Array.from(uniqueMap.values()); listData.value = Array.from(uniqueMap.values());
onPopupClose(); onPopupClose();
}; };
// 移除已选项目 // // 移除已选项目
const removeSelected = (airport) => { // const removeSelected = (airport) => {
const index = selectedAirports.value.findIndex(item => item.id === airport.id); // const index = selectedAirports.value.findIndex(item => item.id === airport.id);
if (index !== -1) { // if (index !== -1) {
selectedAirports.value.splice(index, 1); // selectedAirports.value.splice(index, 1);
} // }
}; // };
// 删除所选产品项目 // 删除所选产品项目
const onDetele = (id) => { const onDelete = (id) => {
listData.value.filter((item, index) => { listData.value.filter((item, index) => {
if (item.id == id) { if (item.id == id) {
listData.value.splice(index, 1) listData.value.splice(index, 1)
} }
}) })
} }
// 图片预览
const onPreviewImage = (url) => {
console.log(url)
uni.previewImage({
current: '1',
urls: [url]
})
}
// 删除上传图片 // 删除上传图片
const onImageDel = (e) => { const onImageDel = (e) => {
bgdImgList.value.filter((item, index) => { bgdImgList.value.filter((item, index) => {
...@@ -270,9 +277,16 @@ const onImageDel = (e) => { ...@@ -270,9 +277,16 @@ const onImageDel = (e) => {
} }
// 上传图片 // 上传图片
const onUpload = throttleTap(() => { const onUpload = throttleTap(() => {
if (bgdImgList.value.length == 15) {
uni.showToast({
title: "最多上传15张图片",
icon: "none",
});
return;
}
// 唤起图片选择器 // 唤起图片选择器
uni.chooseImage({ uni.chooseImage({
count: 15, count: 1,
sizeType: ["original", "compressed"], sizeType: ["original", "compressed"],
sourceType: ["album", "camera"], sourceType: ["album", "camera"],
success: async (res) => { success: async (res) => {
...@@ -301,7 +315,7 @@ const onUpload = throttleTap(() => { ...@@ -301,7 +315,7 @@ const onUpload = throttleTap(() => {
}) })
// 保存 // 保存
const onSave = throttleTap(() => { const onSave = throttleTap( async () => {
if (listData.value.length == 0) { if (listData.value.length == 0) {
uni.showToast({ uni.showToast({
title: '还没有添加产检项哦', title: '还没有添加产检项哦',
...@@ -309,6 +323,13 @@ const onSave = throttleTap(() => { ...@@ -309,6 +323,13 @@ const onSave = throttleTap(() => {
}) })
return return
} }
if (bgdImgList.value.length == 0) {
uni.showToast({
title: '还没有上传报告单哦',
icon: 'none'
})
return
}
const ids = listData.value.map(item => item.id).join(','); const ids = listData.value.map(item => item.id).join(',');
const param = { const param = {
checkupDate: time.value, checkupDate: time.value,
...@@ -317,12 +338,7 @@ const onSave = throttleTap(() => { ...@@ -317,12 +338,7 @@ const onSave = throttleTap(() => {
} }
console.log(param, '参数') console.log(param, '参数')
showLoading(); showLoading();
// const {success, data} = await getAdd(data); const {success, data} = await getAdd(param);
const { success, data, message } = {
success: true,
message: '',
data: {}
}
hideLoading(); hideLoading();
if (success) { if (success) {
uni.showToast({ uni.showToast({
...@@ -340,7 +356,7 @@ const onSave = throttleTap(() => { ...@@ -340,7 +356,7 @@ const onSave = throttleTap(() => {
// 查看更多 // 查看更多
const onSeeBtn = () => { const onSeeBtn = () => {
// 跳转之前得缓存一下数据 // 跳转
uni.navigateTo({ uni.navigateTo({
url: '/pages/myReportCard/myReportCard' url: '/pages/myReportCard/myReportCard'
}) })
...@@ -348,41 +364,41 @@ const onSeeBtn = () => { ...@@ -348,41 +364,41 @@ const onSeeBtn = () => {
// 获取产检项目列表 // 获取产检项目列表
const getList = async () => { const getList = async () => {
// const {success, data, message} = await getExaminationItems() const {success, data, message} = await getExaminationItems()
const { success, message, data } = { // const { success, message, data } = {
success: true, // success: true,
message: '', // message: '',
data: // data:
[ // [
{ // {
"groupName": "A", // "groupName": "A",
"list": [{ // "list": [{
id: 'A001', // id: 'A001',
itemName: "阿克苏机场", // itemName: "阿克苏机场",
introduction: 'NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1' // introduction: 'NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1'
}, // },
{ // {
id: 'A002', // id: 'A002',
itemName: "阿拉山口机场阿拉山口机场阿拉山口机场", // itemName: "阿拉山口机场阿拉山口机场阿拉山口机场",
introduction: 'NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1' // introduction: 'NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1'
} // }
] // ]
}, { // }, {
"groupName": "B", // "groupName": "B",
"list": [{ // "list": [{
id: 'B001', // id: 'B001',
itemName: "保山机场", // itemName: "保山机场",
introduction: 'NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1' // introduction: 'NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1'
}, // },
{ // {
id: 'B002', // id: 'B002',
itemName: "包头机场", // itemName: "包头机场",
introduction: 'NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1' // introduction: 'NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1'
} // }
] // ]
} // }
] // ]
} // }
if (success) { if (success) {
examinationList.value = data examinationList.value = data
} }
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<view class="item-name"> <view class="item-name">
{{ itemName }} {{ itemName }}
</view> </view>
<image @click="onDetele(id)" class="item-img" src="/static/chanjianTool/delete.png"></image> <image @click="onDelete(id)" class="item-img" src="/static/chanjianTool/delete.png"></image>
</view> </view>
</view> </view>
</view> </view>
...@@ -184,14 +184,14 @@ const saveSelection = () => { ...@@ -184,14 +184,14 @@ const saveSelection = () => {
onPopupClose(); onPopupClose();
}; };
// 移除已选项目 // 移除已选项目
const removeSelected = (airport) => { // const removeSelected = (airport) => {
const index = selectedAirports.value.findIndex(item => item.id == airport.id); // const index = selectedAirports.value.findIndex(item => item.id == airport.id);
if (index !== -1) { // if (index !== -1) {
selectedAirports.value.splice(index, 1); // selectedAirports.value.splice(index, 1);
} // }
}; // };
// 删除所选产品项目 // 删除所选产品项目
const onDetele = (id) => { const onDelete = (id) => {
listData.value.filter((item, index) => { listData.value.filter((item, index) => {
if (item.id == id) { if (item.id == id) {
listData.value.splice(index, 1) listData.value.splice(index, 1)
...@@ -201,7 +201,7 @@ const onDetele = (id) => { ...@@ -201,7 +201,7 @@ const onDetele = (id) => {
// 保存 // 保存
const onSave = throttleTap(() => { const onSave = throttleTap(async () => {
if (listData.value.length == 0) { if (listData.value.length == 0) {
uni.showToast({ uni.showToast({
title: '还没有添加产检项哦', title: '还没有添加产检项哦',
...@@ -216,12 +216,7 @@ const onSave = throttleTap(() => { ...@@ -216,12 +216,7 @@ const onSave = throttleTap(() => {
} }
console.log(param, '参数') console.log(param, '参数')
showLoading(); showLoading();
// const {success, data} = await getUpdate(data); const {success, data} = await getUpdate(param);
const { success, data, message } = {
success: true,
message: '',
data: {}
}
hideLoading(); hideLoading();
if (success) { if (success) {
uni.showToast({ uni.showToast({
...@@ -247,41 +242,7 @@ const onSave = throttleTap(() => { ...@@ -247,41 +242,7 @@ const onSave = throttleTap(() => {
// 获取产检项目列表 // 获取产检项目列表
const getList = async () => { const getList = async () => {
// const {success, data, message} = await getExaminationItems() const {success, data, message} = await getExaminationItems()
const { success, message, data } = {
success: true,
message: '',
data: [
{
"groupName": "A",
"list": [{
id: 'A001',
itemName: "阿克苏机场",
introduction: 'NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1'
},
{
id: 'A002',
itemName: "阿拉山口机场阿拉山口机场阿拉山口机场",
introduction: 'NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1'
}
]
}, {
"groupName": "B",
"list": [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: '1',
introduction: 'NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1'
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: '2',
introduction: 'NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1'
}
]
}
]
}
if (success) { if (success) {
examinationList.value = data examinationList.value = data
} }
......
...@@ -14,40 +14,47 @@ ...@@ -14,40 +14,47 @@
</customize-navigation> </customize-navigation>
<view class="report-card-con"> <view class="report-card-con">
<view class="con-box"> <view class="con-box">
<view class="list-item" v-for="(item, index) in listData" :key="index"> <template v-if="listData.length > 0">
<view class="item-time"> <view class="list-item" v-for="(item, index) in listData" :key="index">
<view class="item-time-l"> <view class="item-time">
<image src="/static/chanjianTool/icon19.png"></image> <view class="item-time-l">
{{item.checkupDate}} <image src="/static/chanjianTool/icon19.png"></image>
{{item.checkupDate}}
</view>
<view class="item-time-r" @click="onDelete(item.id)">
<image src="/static/chanjianTool/delete.png"></image>
</view>
</view> </view>
<view class="item-line">
<view class="item-time-r" @click="onDelete(item.id)">
<image src="/static/chanjianTool/delete.png"></image>
</view> </view>
</view> <view class="item-content">
<view class="item-line"> <view class="content-1">
{{item.checkupTimes}}次产检:孕{{item.pregnancyCycle}}
</view> </view>
<view class="item-content"> <view class="content-2">
<view class="content-1"> 重点: {{getProject(item.items)}}
第{{item.checkupTimes}}次产检:孕{{item.pregnancyCycle}}周 </view>
</view> <view class="content-3">
<view class="content-2"> <template v-for="(e, i) in item.reportImages.slice(0, 3)" :key="i">
重点: {{getProject(item.items)}} <view class="content-3-v" :class="{ 'has-more': i === 2 && item.reportImages.length > 3 }">
</view> <image @click="onPreviewImage(e)" :src="e" mode="widthFix"></image>
<view class="content-3"> <view @click="onMoreImage(item.reportImages)" class="more-count"
<template v-for="(e, i) in item.reportImages.slice(0, 3)" :key="i"> v-if="i === 2 && item.reportImages.length > 3">
<view class="content-3-v" :class="{ 'has-more': i === 2 && item.reportImages.length > 3 }"> +{{ item.reportImages.length - 3 }}
<image @click="onPreviewImage(e)" :src="e" mode="widthFix"></image> </view>
<view @click="onMoreImage(item.reportImages)" class="more-count"
v-if="i === 2 && item.reportImages.length > 3">
+{{ item.reportImages.length - 3 }}
</view> </view>
</view> </template>
</template> </view>
</view> </view>
</view> </view>
</view> </template>
<template v-else>
<view class="no-data">
<image src="/static/chanjianTool/icon28.png"></image>
</view>
</template>
</view> </view>
</view> </view>
<!-- 查看更多图片 --> <!-- 查看更多图片 -->
...@@ -140,13 +147,13 @@ ...@@ -140,13 +147,13 @@
} }
// 删除报告单 // 删除报告单
const getDeleteFn = async (id) => { const getDeleteFn = async (id) => {
// const { code, message, data, success } = await getDelete({id}) const { code, message, data, success } = await getDelete({id})
const { code, message, data, success } = { // const { code, message, data, success } = {
code: 200, // code: 200,
message: '成功', // message: '成功',
success: true, // success: true,
data: {} // data: {}
} // }
if (success) { if (success) {
uni.showToast({ uni.showToast({
title: '删除成功', title: '删除成功',
...@@ -164,40 +171,7 @@ ...@@ -164,40 +171,7 @@
// 获取报告单 // 获取报告单
const getReportListFn = async () => { const getReportListFn = async () => {
console.log('获取报告单') console.log('获取报告单')
// const { code, message, data, success } = await getReportList() const { code, message, data, success } = await getReportList()
const {
code,
message,
data,
success
} = {
code: 200,
message: '成功',
success: true,
data: [{
id: 1,
checkupDate: '2025-07-09',
checkupTimes: '一', // 产检次数
pregnancyCycle: '5-6', // 周数
// 产检项目
items: [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2
}
],
reportImages: [
'https://momclub-picture-1253290912.cos.ap-beijing.myqcloud.com/xmh-mini-program/user/image/2025/07/17/xmh-mini-program_1752739702325_167279.jpeg',
'https://momclub-picture-1253290912.cos.ap-beijing.myqcloud.com/xmh-mini-program/user/image/2025/07/17/xmh-mini-program_1752739702325_167279.jpeg',
'https://momclub-picture-1253290912.cos.ap-beijing.myqcloud.com/xmh-mini-program/user/image/2025/07/17/xmh-mini-program_1752739702325_167279.jpeg',
'https://momclub-picture-1253290912.cos.ap-beijing.myqcloud.com/xmh-mini-program/user/image/2025/07/17/xmh-mini-program_1752739702325_167279.jpeg'
]
}
]
}
if (success) { if (success) {
listData.value = data listData.value = data
} else { } else {
...@@ -231,6 +205,16 @@ ...@@ -231,6 +205,16 @@
width: 682rpx; width: 682rpx;
height: calc(100vh - 220rpx); height: calc(100vh - 220rpx);
overflow-y: auto; overflow-y: auto;
.no-data{
height: 100%;
display: flex;
align-items: center;
justify-content: center;
image{
width: 168rpx;
height: 167rpx;
}
}
} }
.list-item { .list-item {
...@@ -271,7 +255,7 @@ ...@@ -271,7 +255,7 @@
width: 100%; width: 100%;
height: 1rpx; height: 1rpx;
margin: 30rpx 0; margin: 30rpx 0;
background-image: url(/static/chanjianTool/icon20.png); background: #f4e1c4;
} }
.item-content { .item-content {
......
This diff is collapsed.
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