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'}
* @returns
*/
export const getInfo = (data) => api.get('/maternity_checkup/home',data);
export const getInfo = (data) => api.get('/c/maternityCheckup/home',data);
/**
* 产看产检详情
* @returns
*/
export const getDetail = (data) => api.get('/maternityCheckup/detail',data);
export const getDetail = (data) => api.get('/c/maternityCheckup/detail',data);
/**
* 删除报告单
* @returns
*/
export const getDelete = (data) => api.get('/maternityCheckup/delete',data);
export const getDelete = (data) => api.get('/c/maternityCheckup/delete',data);
/**
* 产检项目列表
* @returns
*/
export const getExaminationItems = (data) => api.get('/maternityCheckup/examinationItems',data);
export const getExaminationItems = (data) => api.get('/c/maternityCheckup/examinationItems',data);
/**
* 修改产检记录
* @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);
* @returns
*/
export const getAdd = (data) => api.post('/maternityCheckup/add',data);
export const getAdd = (data) => api.post('/c/maternityCheckup/add',data);
/**
* 我的报告单列表
* @returns
*/
export const getReportList = () => api.get('/maternityCheckup/reportList');
\ No newline at end of file
export const getReportList = () => api.get('/c/maternityCheckup/reportList');
\ No newline at end of file
......@@ -17,7 +17,8 @@ const {
// 通常可以吧 baseUrl 单独放在一个 js 文件了
// const baseUrl = "http://172.16.224.178:7777/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 = {}) => {
// 在这里可以对请求头进行一些设置
......
......@@ -37,7 +37,7 @@
</template>
<script setup>
import { ref, watch, onMounted } from 'vue'
import { ref, watch, onMounted, computed } from 'vue'
const props = defineProps({
visible: {
......@@ -53,27 +53,81 @@ const props = defineProps({
const emit = defineEmits(['update:visible', 'confirm'])
// 日期选择器相关状态
const dueDate = ref(uni.getStorageSync('dueDate') || '')
const date = new Date()
const timeValue = ref([]) // 日期选择器当前值
// 年份数据 (2010-当前年份+2)
const years = ref([])
const currentYear = date.getFullYear()
for (let i = 2010; i <= currentYear + 2; i++) {
years.value.push(i)
}
// 计算日期范围
const minDate = computed(() => {
if (!dueDate.value) return new Date(2010, 0, 1)
const due = new Date(dueDate.value)
const min = new Date(due)
min.setDate(min.getDate() - 280) // 280天前
return min
})
// 月份数据
const months = ref([])
for (let i = 1; i <= 12; i++) {
months.value.push(i)
}
const maxDate = computed(() => {
if (!dueDate.value) return new Date(date.getFullYear() + 2, 11, 31)
return new Date(dueDate.value)
})
// 年份数据 (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 selectedDay = ref(date.getDate())
......@@ -82,21 +136,6 @@ function getDaysInMonth(year, month) {
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 yearIndex = years.value.indexOf(selectedYear.value)
......@@ -105,7 +144,55 @@ const updateValueIndices = () => {
if (yearIndex !== -1 && monthIndex !== -1 && dayIndex !== -1) {
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()
}
// 设置日期
......@@ -157,28 +244,28 @@ const initDate = () => {
selectedMonth.value = month
selectedDay.value = day
// 更新 timeValue 的索引
const yearIndex = years.value.indexOf(year)
const monthIndex = months.value.indexOf(month)
const dayIndex = days.value.indexOf(day)
timeValue.value = [yearIndex, monthIndex, dayIndex]
// 调整到合法日期
adjustToValidDate()
} else {
// 如果没有时间,设置为当前日期
// 如果没有时间,设置为当前日期或最大允许日期
const today = new Date()
const yearIndex = years.value.indexOf(today.getFullYear())
const monthIndex = months.value.indexOf(today.getMonth() + 1)
const dayIndex = days.value.indexOf(today.getDate())
timeValue.value = [yearIndex, monthIndex, dayIndex]
if (today > maxDate.value) {
selectedYear.value = maxDate.value.getFullYear()
selectedMonth.value = maxDate.value.getMonth() + 1
selectedDay.value = maxDate.value.getDate()
} 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) => {
setDate(newVal)
......@@ -191,12 +278,22 @@ watch(() => props.visible, (newVal) => {
}
})
// 监听dueDate变化,重新初始化
watch(() => uni.getStorageSync('dueDate'), (newVal) => {
dueDate.value = newVal
if (props.visible) {
initDate()
}
})
onMounted(() => {
updateDays()
dueDate.value = uni.getStorageSync('dueDate')
initDate()
})
</script>
<style lang="less" scoped>
/* 保持原有样式不变 */
.picker-layer-mask {
position: fixed;
left: 0;
......@@ -207,7 +304,6 @@ onMounted(() => {
z-index: 3999;
}
/* 遮罩层样式 */
.picker-layer-popup {
position: fixed;
left: 0;
......@@ -230,7 +326,6 @@ onMounted(() => {
}
}
/* 弹窗容器样式 */
.picker-layer-panel {
width: 100vw;
height: 50vh;
......
......@@ -30,7 +30,7 @@
<view class="item-name">
{{ itemName }}
</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>
......@@ -53,7 +53,7 @@
</view>
<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>
</view>
<image @click="onImageDel(item)" class="img" src="/static/chanjianTool/icon14.png"></image>
......@@ -145,7 +145,6 @@ import {
// 导入日期选择器组件
import DatePicker from '@/components/DatePicker.vue'
// 默认产检时间
const time = ref('');
......@@ -245,21 +244,29 @@ const saveSelection = () => {
listData.value = Array.from(uniqueMap.values());
onPopupClose();
};
// 移除已选项目
const removeSelected = (airport) => {
const index = selectedAirports.value.findIndex(item => item.id === airport.id);
if (index !== -1) {
selectedAirports.value.splice(index, 1);
}
};
// // 移除已选项目
// const removeSelected = (airport) => {
// const index = selectedAirports.value.findIndex(item => item.id === airport.id);
// if (index !== -1) {
// selectedAirports.value.splice(index, 1);
// }
// };
// 删除所选产品项目
const onDetele = (id) => {
const onDelete = (id) => {
listData.value.filter((item, index) => {
if (item.id == id) {
listData.value.splice(index, 1)
}
})
}
// 图片预览
const onPreviewImage = (url) => {
console.log(url)
uni.previewImage({
current: '1',
urls: [url]
})
}
// 删除上传图片
const onImageDel = (e) => {
bgdImgList.value.filter((item, index) => {
......@@ -270,9 +277,16 @@ const onImageDel = (e) => {
}
// 上传图片
const onUpload = throttleTap(() => {
if (bgdImgList.value.length == 15) {
uni.showToast({
title: "最多上传15张图片",
icon: "none",
});
return;
}
// 唤起图片选择器
uni.chooseImage({
count: 15,
count: 1,
sizeType: ["original", "compressed"],
sourceType: ["album", "camera"],
success: async (res) => {
......@@ -301,7 +315,7 @@ const onUpload = throttleTap(() => {
})
// 保存
const onSave = throttleTap(() => {
const onSave = throttleTap( async () => {
if (listData.value.length == 0) {
uni.showToast({
title: '还没有添加产检项哦',
......@@ -309,6 +323,13 @@ const onSave = throttleTap(() => {
})
return
}
if (bgdImgList.value.length == 0) {
uni.showToast({
title: '还没有上传报告单哦',
icon: 'none'
})
return
}
const ids = listData.value.map(item => item.id).join(',');
const param = {
checkupDate: time.value,
......@@ -317,12 +338,7 @@ const onSave = throttleTap(() => {
}
console.log(param, '参数')
showLoading();
// const {success, data} = await getAdd(data);
const { success, data, message } = {
success: true,
message: '',
data: {}
}
const {success, data} = await getAdd(param);
hideLoading();
if (success) {
uni.showToast({
......@@ -340,7 +356,7 @@ const onSave = throttleTap(() => {
// 查看更多
const onSeeBtn = () => {
// 跳转之前得缓存一下数据
// 跳转
uni.navigateTo({
url: '/pages/myReportCard/myReportCard'
})
......@@ -348,41 +364,41 @@ const onSeeBtn = () => {
// 获取产检项目列表
const getList = async () => {
// 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": [{
id: 'B001',
itemName: "保山机场",
introduction: 'NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1'
},
{
id: 'B002',
itemName: "包头机场",
introduction: 'NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1'
}
]
}
]
}
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": [{
// id: 'B001',
// itemName: "保山机场",
// introduction: 'NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1'
// },
// {
// id: 'B002',
// itemName: "包头机场",
// introduction: 'NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1'
// }
// ]
// }
// ]
// }
if (success) {
examinationList.value = data
}
......
......@@ -19,7 +19,7 @@
<view class="item-name">
{{ itemName }}
</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>
......@@ -184,14 +184,14 @@ const saveSelection = () => {
onPopupClose();
};
// 移除已选项目
const removeSelected = (airport) => {
const index = selectedAirports.value.findIndex(item => item.id == airport.id);
if (index !== -1) {
selectedAirports.value.splice(index, 1);
}
};
// const removeSelected = (airport) => {
// const index = selectedAirports.value.findIndex(item => item.id == airport.id);
// if (index !== -1) {
// selectedAirports.value.splice(index, 1);
// }
// };
// 删除所选产品项目
const onDetele = (id) => {
const onDelete = (id) => {
listData.value.filter((item, index) => {
if (item.id == id) {
listData.value.splice(index, 1)
......@@ -201,7 +201,7 @@ const onDetele = (id) => {
// 保存
const onSave = throttleTap(() => {
const onSave = throttleTap(async () => {
if (listData.value.length == 0) {
uni.showToast({
title: '还没有添加产检项哦',
......@@ -216,12 +216,7 @@ const onSave = throttleTap(() => {
}
console.log(param, '参数')
showLoading();
// const {success, data} = await getUpdate(data);
const { success, data, message } = {
success: true,
message: '',
data: {}
}
const {success, data} = await getUpdate(param);
hideLoading();
if (success) {
uni.showToast({
......@@ -247,41 +242,7 @@ const onSave = throttleTap(() => {
// 获取产检项目列表
const getList = async () => {
// 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'
}
]
}
]
}
const {success, data, message} = await getExaminationItems()
if (success) {
examinationList.value = data
}
......
......@@ -14,6 +14,7 @@
</customize-navigation>
<view class="report-card-con">
<view class="con-box">
<template v-if="listData.length > 0">
<view class="list-item" v-for="(item, index) in listData" :key="index">
<view class="item-time">
<view class="item-time-l">
......@@ -48,6 +49,12 @@
</view>
</view>
</view>
</template>
<template v-else>
<view class="no-data">
<image src="/static/chanjianTool/icon28.png"></image>
</view>
</template>
</view>
</view>
<!-- 查看更多图片 -->
......@@ -140,13 +147,13 @@
}
// 删除报告单
const getDeleteFn = async (id) => {
// const { code, message, data, success } = await getDelete({id})
const { code, message, data, success } = {
code: 200,
message: '成功',
success: true,
data: {}
}
const { code, message, data, success } = await getDelete({id})
// const { code, message, data, success } = {
// code: 200,
// message: '成功',
// success: true,
// data: {}
// }
if (success) {
uni.showToast({
title: '删除成功',
......@@ -164,40 +171,7 @@
// 获取报告单
const getReportListFn = async () => {
console.log('获取报告单')
// 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'
]
}
]
}
const { code, message, data, success } = await getReportList()
if (success) {
listData.value = data
} else {
......@@ -231,6 +205,16 @@
width: 682rpx;
height: calc(100vh - 220rpx);
overflow-y: auto;
.no-data{
height: 100%;
display: flex;
align-items: center;
justify-content: center;
image{
width: 168rpx;
height: 167rpx;
}
}
}
.list-item {
......@@ -271,7 +255,7 @@
width: 100%;
height: 1rpx;
margin: 30rpx 0;
background-image: url(/static/chanjianTool/icon20.png);
background: #f4e1c4;
}
.item-content {
......
......@@ -25,21 +25,22 @@
<!-- 孕期信息 -->
<view class="postnatal-con-info">
<view class="info-l">
孕{{homeInfo.gestationalWeeks}}周
孕{{ homeInfo.gestationalWeeks }}周
</view>
<view class="info-c">
<image class="info-img" src="/static/chanjianTool/line.png"></image>
</view>
<view class="info-r">
预产期:{{homeInfo.dueDate}}
预产期:{{ homeInfo.dueDate }}
</view>
</view>
<!-- 按钮 -->
<view class="postnatal-con-btn">
<view class="btn-item" v-for="({name, imageSrc, type}, index) in btnList" :key="index" @click="onBtn(type)">
<view class="btn-item" v-for="({ name, imageSrc, type }, index) in btnList" :key="index"
@click="onBtn(type)">
<image class="image1" :src="`${imageSrc}`"></image>
<view class="btn-item-text">
{{name}}
{{ name }}
</view>
<image class="image2" src="/static/chanjianTool/right.png"></image>
</view>
......@@ -47,18 +48,19 @@
<!-- 产检记录 -->
<view class="postnatal-con-record">
<view class="record-item"
v-for="({id, checkupDate, index, pregnancyWeek, status, examinationItems, type}, i) in homeInfo.checkupList"
v-for="({ id, checkupDate, index, pregnancyWeek, status, examinationItems, type }, i) in homeInfo.checkupList"
@click="onDetails(id)" :key="i">
<image class="add-image" v-if="type === 1 " src="/static/chanjianTool/bs.png"></image>
<image class="add-image" v-if="type === '1'" src="/static/chanjianTool/bs.png"></image>
<view class="item-t">
<view class="item-t-l">
第{{index}}次产检
第{{ index }}次产检
</view>
<view class="item-t-r">
<view class="">
产检时间:{{ checkupDate ? checkupDate : '---'}}
产检时间:{{ checkupDate ? checkupDate : '---' }}
</view>
<image @click.stop="onEdit(id, checkupDate)" class="edit-img" src="/static/chanjianTool/edit.png">
<image @click.stop="onEdit(id, checkupDate)" class="edit-img"
src="/static/chanjianTool/edit.png">
</image>
</view>
</view>
......@@ -67,14 +69,14 @@
</view>
<view class="item-c">
<view class="item-c-l">
孕期{{pregnancyWeek}}周
孕期{{ pregnancyWeek }}周
</view>
<view class="">
<image class="record-img" :src="getSrcUrl(status)"></image>
</view>
</view>
<view class="item-b">
重点:{{getProject(examinationItems)}}
重点:{{ getProject(examinationItems) }}
</view>
</view>
</view>
......@@ -90,75 +92,74 @@
</template>
<script setup>
import {
import {
ref,
getCurrentInstance,
onMounted
} from 'vue'
import {
} from 'vue'
import {
onLoad,
onShow
} from '@dcloudio/uni-app'
import {
} from '@dcloudio/uni-app'
import {
jump,
JumpType,
throttleTap
} from '@/utils/index.js';
import md from '../../md';
import {
} from '@/utils/index.js';
import md from '../../md';
import {
getInfo,
getUpdate,
postnatalJSON
} from '../../api/obstetric.js';
// 导入日期选择器组件
import DatePicker from '@/components/DatePicker.vue'
import { type } from 'os';
const {
} from '../../api/obstetric.js';
// 导入日期选择器组件
import DatePicker from '@/components/DatePicker.vue'
const {
proxy
} = getCurrentInstance();
const $baseUrl = proxy.$baseUrl;
const back_btn = ref('')
} = getCurrentInstance();
const $baseUrl = proxy.$baseUrl;
const back_btn = ref('')
// 时间弹窗控制
const visible = ref(false)
// 时间弹窗控制
const visible = ref(false)
// 时间
const time = ref('')
// 时间
const time = ref('')
// 保存要修改的id
const editId = ref(null)
// 保存要修改的id
const editId = ref(null)
// 轮播图
const bannerList = ref([])
// 轮播图
const bannerList = ref([])
// 首页信息
const homeInfo = ref({})
// 首页信息
const homeInfo = ref({})
// 按钮列表
const btnList = ref([{
// 按钮列表
const btnList = ref([{
name: '报告单',
imageSrc: '/static/chanjianTool/icon2.png',
type: 1
},
{
},
{
name: '日历',
imageSrc: '/static/chanjianTool/icon3.png',
type: 2
}
])
}
])
// 跳转产检详情页面
const onDetails = (id) => {
// 跳转产检详情页面
const onDetails = (id) => {
uni.navigateTo({
url: `/pages/productionDetails/productionDetails?id=${id}`
})
}
// 拼接检查项目名称
const getProject = (projects) => {
}
// 拼接检查项目名称
const getProject = (projects) => {
return projects.map(project => project.itemName).join('、');
}
// 根据状态返回图片
const getSrcUrl = (status) => {
}
// 根据状态返回图片
const getSrcUrl = (status) => {
const imageMap = {
'pending': '/static/chanjianTool/icon4.png',
'expired': '/static/chanjianTool/icon5.png',
......@@ -166,9 +167,9 @@ import { type } from 'os';
};
return imageMap[status];
}
// 首页组件逻辑
const backHandler = () => {
}
// 首页组件逻辑
const backHandler = () => {
if (!back_btn) {
uni.navigateBack();
} else {
......@@ -177,12 +178,12 @@ import { type } from 'os';
url: `/pages/index/index`
})
}
}
// 点击轮播图事件
const handleBannerClick = (item, index) => {
}
// 点击轮播图事件
const handleBannerClick = (item, index) => {
console.log(item)
// 跳转
if(item?.url != ""){
if (item?.url != "") {
jump({
type: item.type,
url: item.url
......@@ -206,15 +207,15 @@ import { type } from 'os';
// pageName: "产品提醒页-首屏",
// buttonName: buttonName,
// });
}
// 新增体检
const onAdd = () => {
}
// 新增体检
const onAdd = () => {
uni.navigateTo({
url: '/pages/addPostnatal/addPostnatal'
})
}
// 按钮点击
const onBtn = (type) => {
}
// 按钮点击
const onBtn = (type) => {
// const items = JSON.stringify(homeInfo.value)
// type 1 报告单 2 日历
switch (type) {
......@@ -231,30 +232,25 @@ import { type } from 'os';
default:
break;
}
}
}
// 编辑时间
const onEdit = (id, newTime) => {
// 编辑时间
const onEdit = (id, newTime) => {
console.log(id, newTime)
time.value = newTime
visible.value = true
editId.value = id
}
// 选择日期回调确认
const handleDateConfirm = (date) => {
}
// 选择日期回调确认
const handleDateConfirm = (date) => {
console.log('选择的日期是:', date);
time.value = date;
console.log(editId.value, time.value)
onEditTime()
}
// 修改产检时间
const onEditTime = async () => {
// const { code, success, message } = await getUpdate({id: editId.value,checkupDate: time.value})
const { code, success, message } = {
code: 200,
success: true,
message: '成功',
}
}
// 修改产检时间
const onEditTime = async () => {
const { code, success, message } = await getUpdate({id: editId.value,checkupDate: time.value})
if (success) {
uni.showToast({
title: '修改成功',
......@@ -268,290 +264,53 @@ import { type } from 'os';
icon: 'none'
})
}
}
// 获取信息接口
const getInfoFn = async () => {
}
// 获取信息接口
const getInfoFn = async () => {
console.log('获取信息')
// 获取信息
// const {code,success, message, data } = await getInfo()
const {
code,
success,
message,
data
} = {
code: 200,
success: true,
message: '成功',
data: {
gestationalWeeks: '8', // 几周
dueDate: '2025-10-20', // 预产期
// 产检记录
checkupList: [{
type: 0, // 1 是 0 否
id: 1,
checkupDate: '2025-07-12',
index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数
status: 'completed', //待产检、已过期、已产检,
// 产检项目
examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2
}
]
},
{
type: 0, // 1 是 0 否
id: 1,
checkupDate: '2025-07-12',
index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数
status: 'completed', //待产检、已过期、已产检,
// 产检项目
examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2
}
]
},
{
type: 0, // 1 是 0 否
id: 1,
checkupDate: '2025-07-12',
index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数
status: 'completed', //待产检、已过期、已产检,
// 产检项目
examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2
}
]
},
{
type: 0, // 1 是 0 否
id: 1,
checkupDate: '2025-07-12',
index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数
status: 'completed', //待产检、已过期、已产检,
// 产检项目
examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2
}
]
},
{
type: 0, // 1 是 0 否
id: 1,
checkupDate: '2025-07-12',
index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数
status: 'completed', //待产检、已过期、已产检,
// 产检项目
examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2
}
]
},
{
type: 0, // 1 是 0 否
id: 1,
checkupDate: '2025-07-12',
index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数
status: 'completed', //待产检、已过期、已产检,
// 产检项目
examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2
}
]
},
{
type: 0, // 1 是 0 否
id: 1,
checkupDate: '2025-07-12',
index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数
status: 'completed', //待产检、已过期、已产检,
// 产检项目
examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2
}
]
},
{
type: 0, // 1 是 0 否
id: 1,
checkupDate: '2025-07-12',
index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数
status: 'completed', //待产检、已过期、已产检,
// 产检项目
examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2
}
]
},
{
type: 0, // 1 是 0 否
id: 1,
checkupDate: '2025-07-12',
index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数
status: 'completed', //待产检、已过期、已产检,
// 产检项目
examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2
}
]
},
{
type: 0, // 1 是 0 否
id: 1,
checkupDate: '2025-07-12',
index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数
status: 'completed', //待产检、已过期、已产检,
// 产检项目
examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2
}
]
},
{
type: 0, // 1 是 0 否
id: 1,
checkupDate: '2025-07-12',
index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数
status: 'completed', //待产检、已过期、已产检,
// 产检项目
examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2
}
]
}
]
}
}
const { code, success, message, data } = await getInfo()
if (success) {
homeInfo.value = data
} else{
uni.setStorageSync('dueDate', data.dueDate);
} else {
uni.showToast({
title: message,
icon: "none",
});
}
}
}
// 获取banner图
const postnatalJSONFn = async ()=>{
// const { success, data, message } = await postnatalJSON()
const { success, data, message } = {
success: true,
message:'成功',
data: {
// 轮播数据
bannerList: [{
img: 'https://course.feihe.com/momclub-picture/contentLibrary/1003/banner-cl0.png',
url: `https://mp.weixin.qq.com/s/Xn5dh96OaQ9CcsVMZ5jnvg`,
type: 3
},
{
img: 'https://course.feihe.com/momclub-picture/contentLibrary/1003/banner-cl1.png',
url: ``,
type: 3
},
{
img: 'https://course.feihe.com/momclub-picture/contentLibrary/1003/banner-cl2.png',
url: `https://www.baidu.com`,
type: 3
}
]
}
}
// 获取banner图
const postnatalJSONFn = async () => {
const { success, data, message } = await postnatalJSON()
if (success) {
bannerList.value = data.bannerList
} else{
} else {
uni.showToast({
title: message,
icon: "none",
});
}
}
}
onShow(() => {
onShow(() => {
// 获取banner图
postnatalJSONFn()
// 获取信息
getInfoFn()
})
})
</script>
<style lang="less" scoped>
@import "@/common.less";
@import "@/common.less";
.postnatal {
.postnatal {
// position: absolute;
width: 100%;
min-height: 100vh;
background-color: #fdf6eb;
&-con {
position: absolute;
// width: 750rpx;
......@@ -703,9 +462,9 @@ import { type } from 'os';
height: 113rpx;
}
}
}
}
.banner-swiper {
.banner-swiper {
width: 687rpx;
height: 177rpx;
border-radius: 12rpx;
......@@ -716,23 +475,23 @@ import { type } from 'os';
height: 100%;
// border-radius: 16rpx;
}
}
}
.page-top {
.page-top {
width: 100%;
display: flex;
align-items: center;
}
}
.btnback {
.btnback {
width: 16rpx;
height: 29rpx;
// margin-top: 110rpx;
// margin-left: 35rpx;
}
}
.page_title {
.page_title {
width: 100%;
font-size: 34rpx;
font-weight: 500;
......@@ -741,5 +500,5 @@ import { type } from 'os';
line-height: 36rpx;
// margin-top: -46rpx;
// margin-left: 0rpx;
}
}
</style>
\ No newline at end of file
......@@ -392,217 +392,217 @@ const onDetails = (id) => {
const getInfoFn = async () => {
console.log('获取信息')
// 获取信息
// const {code,success, message, data } = await getInfo()
const {
code,
success,
message,
data
} = {
code: 200,
success: true,
message: '成功',
data: {
gestationalWeeks: '8', // 几周
dueDate: '2025-10-20', // 预产期
// 轮播数据
bannerList: [{
imageUrl: 'https://course.feihe.com/momclub-picture/contentLibrary/1003/banner-cl0.png',
jumpUrl: `https://www.baidu.com`
},
{
imageUrl: 'https://course.feihe.com/momclub-picture/contentLibrary/1003/banner-cl1.png',
jumpUrl: `https://www.baidu.com`
},
{
imageUrl: 'https://course.feihe.com/momclub-picture/contentLibrary/1003/banner-cl2.png',
jumpUrl: `https://www.baidu.com`
}
],
// 产检记录
checkupList: [{
type: 0, // 1 是 0 否
id: 1,
checkupDate: '2025-07-22',
index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数
status: '待产检', //待产检、已过期、已产检,
// 产检项目
examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2
}
]
},
{
type: 0, // 1 是 0 否
id: 1,
checkupDate: '2025-07-21',
index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数
status: '待产检', //待产检、已过期、已产检,
// 产检项目
examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2
}
]
},
{
type: 0, // 1 是 0 否
id: 1,
checkupDate: '2025-07-23',
index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数
status: '待产检', //待产检、已过期、已产检,
// 产检项目
examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2
}
]
},
{
type: 0, // 1 是 0 否
id: 1,
checkupDate: '2025-07-23',
index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数
status: '待产检', //待产检、已过期、已产检,
// 产检项目
examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2
}
]
},
{
type: 0, // 1 是 0 否
id: 1,
checkupDate: '2025-07-23',
index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数
status: '待产检', //待产检、已过期、已产检,
// 产检项目
examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2
}
]
},
{
type: 0, // 1 是 0 否
id: 1,
checkupDate: '2025-07-23',
index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数
status: '待产检', //待产检、已过期、已产检,
// 产检项目
examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2
}
]
},
{
type: 0, // 1 是 0 否
id: 1,
checkupDate: '2025-07-23',
index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数
status: '待产检', //待产检、已过期、已产检,
// 产检项目
examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2
}
]
},
{
type: 0, // 1 是 0 否
id: 1,
checkupDate: '2025-07-23',
index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数
status: '待产检', //待产检、已过期、已产检,
// 产检项目
examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2
}
]
},
{
type: 0, // 1 是 0 否
id: 1,
checkupDate: '2025-07-23',
index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数
status: '待产检', //待产检、已过期、已产检,
// 产检项目
examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2
}
]
},
{
type: 0, // 1 是 0 否
id: 1,
checkupDate: '2025-07-23',
index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数
status: '待产检', //待产检、已过期、已产检,
// 产检项目
examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2
}
]
}
]
}
}
const {code,success, message, data } = await getInfo()
// const {
// code,
// success,
// message,
// data
// } = {
// code: 200,
// success: true,
// message: '成功',
// data: {
// gestationalWeeks: '8', // 几周
// dueDate: '2025-10-20', // 预产期
// // 轮播数据
// bannerList: [{
// imageUrl: 'https://course.feihe.com/momclub-picture/contentLibrary/1003/banner-cl0.png',
// jumpUrl: `https://www.baidu.com`
// },
// {
// imageUrl: 'https://course.feihe.com/momclub-picture/contentLibrary/1003/banner-cl1.png',
// jumpUrl: `https://www.baidu.com`
// },
// {
// imageUrl: 'https://course.feihe.com/momclub-picture/contentLibrary/1003/banner-cl2.png',
// jumpUrl: `https://www.baidu.com`
// }
// ],
// // 产检记录
// checkupList: [{
// type: 0, // 1 是 0 否
// id: 1,
// checkupDate: '2025-07-22',
// index: '一', // 产检次数
// pregnancyWeek: '5-6', // 周数
// status: '待产检', //待产检、已过期、已产检,
// // 产检项目
// examinationItems: [{
// itemName: '测量胎儿颈部透明层厚度(NT)',
// id: 1
// },
// {
// itemName: '无创产前基因检测(NIPT)(非必查)',
// id: 2
// }
// ]
// },
// {
// type: 0, // 1 是 0 否
// id: 1,
// checkupDate: '2025-07-21',
// index: '一', // 产检次数
// pregnancyWeek: '5-6', // 周数
// status: '待产检', //待产检、已过期、已产检,
// // 产检项目
// examinationItems: [{
// itemName: '测量胎儿颈部透明层厚度(NT)',
// id: 1
// },
// {
// itemName: '无创产前基因检测(NIPT)(非必查)',
// id: 2
// }
// ]
// },
// {
// type: 0, // 1 是 0 否
// id: 1,
// checkupDate: '2025-07-23',
// index: '一', // 产检次数
// pregnancyWeek: '5-6', // 周数
// status: '待产检', //待产检、已过期、已产检,
// // 产检项目
// examinationItems: [{
// itemName: '测量胎儿颈部透明层厚度(NT)',
// id: 1
// },
// {
// itemName: '无创产前基因检测(NIPT)(非必查)',
// id: 2
// }
// ]
// },
// {
// type: 0, // 1 是 0 否
// id: 1,
// checkupDate: '2025-07-23',
// index: '一', // 产检次数
// pregnancyWeek: '5-6', // 周数
// status: '待产检', //待产检、已过期、已产检,
// // 产检项目
// examinationItems: [{
// itemName: '测量胎儿颈部透明层厚度(NT)',
// id: 1
// },
// {
// itemName: '无创产前基因检测(NIPT)(非必查)',
// id: 2
// }
// ]
// },
// {
// type: 0, // 1 是 0 否
// id: 1,
// checkupDate: '2025-07-23',
// index: '一', // 产检次数
// pregnancyWeek: '5-6', // 周数
// status: '待产检', //待产检、已过期、已产检,
// // 产检项目
// examinationItems: [{
// itemName: '测量胎儿颈部透明层厚度(NT)',
// id: 1
// },
// {
// itemName: '无创产前基因检测(NIPT)(非必查)',
// id: 2
// }
// ]
// },
// {
// type: 0, // 1 是 0 否
// id: 1,
// checkupDate: '2025-07-23',
// index: '一', // 产检次数
// pregnancyWeek: '5-6', // 周数
// status: '待产检', //待产检、已过期、已产检,
// // 产检项目
// examinationItems: [{
// itemName: '测量胎儿颈部透明层厚度(NT)',
// id: 1
// },
// {
// itemName: '无创产前基因检测(NIPT)(非必查)',
// id: 2
// }
// ]
// },
// {
// type: 0, // 1 是 0 否
// id: 1,
// checkupDate: '2025-07-23',
// index: '一', // 产检次数
// pregnancyWeek: '5-6', // 周数
// status: '待产检', //待产检、已过期、已产检,
// // 产检项目
// examinationItems: [{
// itemName: '测量胎儿颈部透明层厚度(NT)',
// id: 1
// },
// {
// itemName: '无创产前基因检测(NIPT)(非必查)',
// id: 2
// }
// ]
// },
// {
// type: 0, // 1 是 0 否
// id: 1,
// checkupDate: '2025-07-23',
// index: '一', // 产检次数
// pregnancyWeek: '5-6', // 周数
// status: '待产检', //待产检、已过期、已产检,
// // 产检项目
// examinationItems: [{
// itemName: '测量胎儿颈部透明层厚度(NT)',
// id: 1
// },
// {
// itemName: '无创产前基因检测(NIPT)(非必查)',
// id: 2
// }
// ]
// },
// {
// type: 0, // 1 是 0 否
// id: 1,
// checkupDate: '2025-07-23',
// index: '一', // 产检次数
// pregnancyWeek: '5-6', // 周数
// status: '待产检', //待产检、已过期、已产检,
// // 产检项目
// examinationItems: [{
// itemName: '测量胎儿颈部透明层厚度(NT)',
// id: 1
// },
// {
// itemName: '无创产前基因检测(NIPT)(非必查)',
// id: 2
// }
// ]
// },
// {
// type: 0, // 1 是 0 否
// id: 1,
// checkupDate: '2025-07-23',
// index: '一', // 产检次数
// pregnancyWeek: '5-6', // 周数
// status: '待产检', //待产检、已过期、已产检,
// // 产检项目
// examinationItems: [{
// itemName: '测量胎儿颈部透明层厚度(NT)',
// id: 1
// },
// {
// itemName: '无创产前基因检测(NIPT)(非必查)',
// id: 2
// }
// ]
// }
// ]
// }
// }
if (success) {
info.value = data
} else {
......@@ -1058,4 +1058,10 @@ onShow(() => {
::v-deep .uni-datetime-picker-btn-text {
color: #D4A574 !important;
}
::v-deep .uni-calendar--fixed{
z-index: 100 !important;
}
::v-deep .uni-calendar__mask{
z-index: 100 !important;
}
</style>
\ No newline at end of file
......@@ -45,7 +45,7 @@
</view>
</view>
<view class="container-4 pad">
建议时间:{{ infoData.suggestionCheckupDate }}
建议时间:{{ infoData.suggestionCheckup}}
</view>
<!-- 产检须知 -->
<view class="project-box" id="section-0">
......@@ -101,7 +101,7 @@
</view>
<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>
</view>
<image @click="onImageDel(item)" class="img" src="/static/chanjianTool/icon14.png"></image>
......@@ -116,24 +116,25 @@
<!-- 弹窗内容区 -->
<view v-if="showPicker" class="picker-layer-popup">
<view class="picker-layer-panel">
<!-- 可自定义头部 -->
<view class="picker-layer-header">
<text class="picker-layer-cancel" @click="close">取消</text>
<text class="picker-layer-confirm" @click="handleConfirm">确定</text>
<view class="picker-layer-title">
设置提醒时间
</view>
<view class="picker-layer-content">
<view class="content-item"
v-for="(item, index) in options"
:key="index"
:class="{'item-active': pickerValue === index}"
@click="handleChange(index)"
>
{{ item }}
</view>
</view>
<view class="picker-layer-view-mask-top"></view>
<view class="picker-layer-view-mask-bottom"></view>
<!-- picker-view 选择器核心 -->
<picker-view class="picker-layer-view"
mask-style="background: rgb(246, 248, 250); z-index: 0;"
indicator-style="border-radius: 10px; height: 50px; background:#ffffff; z-index:0"
:value="pickerValue" @change="handleChange" :immediate-change="true">
<picker-view-column>
<view class="picker-layer-item" v-for="(item, index) in options" :key="index">
{{ item }}</view>
</picker-view-column>
</picker-view>
<view class="picker-layer-bottom">
<text class="bottom-close btn" @click="close">取消</text>
<text class="bottom-confirm btn" @click="handleConfirm">确定</text>
</view>
</view>
</view>
</view>
......@@ -172,7 +173,7 @@ import {
// 提醒选择器相关状态
const showPicker = ref(false)
const options = ['当天', '前一天', '前三天'] // 提醒时间选项
const pickerValue = ref([0]) // 当前选中的索引
const pickerValue = ref(0) // 当前选中的索引
const selectedValue = ref('') // 选中的值
const tabInfo = [{
......@@ -307,6 +308,14 @@ const numberToChinese = (num) => {
return str.replace(/零$/, ''); // 去掉末尾的零
}
// 图片预览
const onPreviewImage = (url) => {
console.log(url)
uni.previewImage({
current: '1',
urls: [url]
})
}
// 删除上传图片
const onImageDel = (id) => {
bgdImgList.value.filter((item, index) => {
......@@ -324,6 +333,13 @@ const onImageDel = (id) => {
}
// 上传图片
const onUpload = throttleTap(() => {
if (bgdImgList.value.length == 15) {
uni.showToast({
title: "最多上传15张图片",
icon: "none",
});
return;
}
// 唤起图片选择器
uni.chooseImage({
count: 15,
......@@ -381,12 +397,12 @@ const close = () => {
// 选择提醒事件
const handleChange = (e) => {
pickerValue.value = e.detail.value;
pickerValue.value = e;
}
// 确认选择
const handleConfirm = () => {
selectedValue.value = options[pickerValue.value];
close();
selectedValue.value = options[pickerValue.value[0]];
// 订阅提醒
uni.requestSubscribeMessage({
tmplIds: [infoData.wxTemplateId],
......@@ -401,12 +417,20 @@ const handleConfirm = () => {
// 完成检查
const onComplete = () => {
if(infoData.checkupDate == ''){
uni.showToast({
title: '请选择产检日期',
icon: 'none',
duration: 2000
})
return
}
// 切换状态
isCompleted.value = !isCompleted.value
console.log(isCompleted.value)
const params = {
id: editId.value,
status: isCompleted.value
status: isCompleted.value ? 'completed' : 'pending'
}
onEditTime(params)
}
......@@ -440,17 +464,8 @@ const onModify = (item) => {
// 修改产检接口
const onEditTime = async (params) => {
console.log(params)
// const { code, success, message } = await getUpdate(params)
const { code, success, message } = {
code: 200,
success: true,
message: '成功',
}
const { code, success, message } = await getUpdate(params)
if (success) {
// uni.showToast({
// title: '修改成功',
// icon: 'none'
// })
// 重新获取信息
getDetailFn(editId.value)
} else {
......@@ -464,60 +479,12 @@ const onEditTime = async (params) => {
const getDetailFn = async (id) => {
console.log('获取信息', id)
// 获取信息
// const {code,success, message, data } = await getDetail({id})
const {
code,
success,
message,
data
} = {
code: 200,
success: true,
message: '成功',
data: {
// 产检记录
checkupList: {
type: 0, // 1 是 0 否
id: 1,
checkupDate: '2025-8-22',
index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数,
content: `
<p>一、产检目的</p>
</br>
<p>这期间需要进行胎儿NT(胎儿颈项透明层厚度)的超声检查,初步筛查胎儿是否存在染色体异常、先天性心脏病、某些遗传综合征等。如果胎这期间需要进行胎儿NT(胎儿颈项透明层厚度)的超声检查,初步筛查胎儿是否存在染色体异常、先天性心脏病、某些遗传综合征等。如果胎</p>
</br>
<p>二、产检内容</p>
</br>
<p>第一次产检对于很多孕妇来说,既充满期待又可能会感到紧张和焦虑。担心检查结果是否正常,害怕胎儿出现问题等。孕妇要调整好心态,保持这期间需要进行胎儿NT(胎儿颈项透明层厚度)的超声检查,初步筛查胎儿是否存在染色体异常、先天性心脏病、某些遗传综合征等。如果胎</p>
`, // 产检须知
suggestionCheckupDate: '2025-08-09至2025-09-16', // 建议时间
wxTemplateId: '', // 订阅模版id
status: 'completed', // 待产检 - pending,已过期 - expired, 已产检 - completed
// 产检项目
examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1,
introduction: 'NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1'
},
{
itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2,
introduction: 'NT可以帮助判断胎宝宝是否患有唐氏综合征等染色体异常,或存在畸形的风险,有助于早期发现胎儿异常风险问题。 NT检查通常在孕 1'
}
],
// 报告单
reportImages: []
}
}
}
const {code, success, message, data } = await getDetail({id})
if (success) {
const {
checkupList
} = data
infoData.value = checkupList
bgdImgList.value = checkupList.reportImages
isCompleted.value = checkupList.status === 'completed'
infoData.value = data
bgdImgList.value = data.reportImages
isCompleted.value = data.status === 'completed'
} else {
uni.showToast({
title: message,
......@@ -867,95 +834,61 @@ onLoad((options) => {
/* 弹窗容器样式 */
.picker-layer-panel {
width: 100vw;
height: 50vh;
height: 52vh;
background: #f6f8fa;
border-top-left-radius: 24rpx;
border-top-right-radius: 24rpx;
overflow: hidden;
display: flex;
flex-direction: column;
position: relative;
padding: 32rpx;
box-sizing: border-box;
}
.picker-layer-header {
.picker-layer-title{
font-size: 34rpx;
color: #000000;
font-weight: bold;
}
.picker-layer-content{
margin-top: 40rpx;
margin-bottom: 50rpx;
.content-item{
width: 100%;
height: 126rpx;
border-radius: 16rpx;
font-size: 28rpx;
display: flex;
justify-content: space-between;
align-items: center;
height: 140rpx;
justify-content: center;
border: 2rpx solid #fff;
box-sizing: border-box;
background: #f6f8fa;
padding: 0 32rpx;
.picker-layer-cancel {
color: #6f6d67;
font-size: 28rpx;
width: 136rpx;
height: 74rpx;
border-radius: 20rpx;
margin-bottom: 20rpx;
background: #ffffff;
}
.item-active{
background: #fffbed;
border-color: #d3a358;
}
}
.picker-layer-bottom {
display: flex;
justify-content: space-between;
align-items: center;
justify-content: center;
}
.picker-layer-confirm {
color: #ffffff;
font-size: 28rpx;
width: 136rpx;
height: 74rpx;
border-radius: 20rpx;
background: #d3a358;
.btn{
width: 334rpx;
height: 97rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 48.5rpx;
font-size: 38rpx;
}
.picker-layer-title {
color: #222;
font-size: 32rpx;
font-weight: bold;
}
}
.picker-layer-view {
flex: 1;
width: 100%;
height: 100%;
}
.picker-layer-item {
height: 100rpx;
line-height: 100rpx;
text-align: center;
font-size: 32rpx;
color: #1d1e25;
.bottom-close {
color: #d3a358;
background: #ffffff;
}
.picker-layer-view-mask-top {
position: absolute;
top: 140rpx;
left: 0;
width: 100%;
height: calc(50% - 100rpx);
z-index: 1;
background: linear-gradient(to bottom,
rgb(246, 248, 250) 0%,
rgba(255, 255, 255, 0.5) 100%);
pointer-events: none;
.bottom-confirm {
color: #ffffff;
background: #d3a358;
}
.picker-layer-view-mask-bottom {
position: absolute;
bottom: 0rpx;
left: 0;
width: 100%;
height: calc(50% - 100rpx);
z-index: 1;
background: linear-gradient(to top,
rgb(246, 248, 250) 0%,
rgba(255, 255, 255, 0.5) 100%);
pointer-events: none;
}
}
</style>
\ No newline at end of file
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