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 {
......
...@@ -5,15 +5,15 @@ ...@@ -5,15 +5,15 @@
<image @tap="backHandler" class="btnback" src="/static/chanjianTool/back.png"></image> <image @tap="backHandler" class="btnback" src="/static/chanjianTool/back.png"></image>
<view class="page_title">产检提醒</view> <view class="page_title">产检提醒</view>
</view> --> </view> -->
<!-- 自定义导航 --> <!-- 自定义导航 -->
<customize-navigation> <customize-navigation>
<template v-slot:navbar-content> <template v-slot:navbar-content>
<view class="page-top"> <view class="page-top">
<image @tap="backHandler" class="btnback" src="/static/chanjianTool/back.png"></image> <image @tap="backHandler" class="btnback" src="/static/chanjianTool/back.png"></image>
<view class="page_title">产检提醒</view> <view class="page_title">产检提醒</view>
</view> </view>
</template> </template>
</customize-navigation> </customize-navigation>
<view class="postnatal-con"> <view class="postnatal-con">
<!-- 轮播图 --> <!-- 轮播图 -->
<swiper class="banner-swiper" :autoplay="true" :circular="true"> <swiper class="banner-swiper" :autoplay="true" :circular="true">
...@@ -25,21 +25,22 @@ ...@@ -25,21 +25,22 @@
<!-- 孕期信息 --> <!-- 孕期信息 -->
<view class="postnatal-con-info"> <view class="postnatal-con-info">
<view class="info-l"> <view class="info-l">
孕{{homeInfo.gestationalWeeks}}周 孕{{ homeInfo.gestationalWeeks }}周
</view> </view>
<view class="info-c"> <view class="info-c">
<image class="info-img" src="/static/chanjianTool/line.png"></image> <image class="info-img" src="/static/chanjianTool/line.png"></image>
</view> </view>
<view class="info-r"> <view class="info-r">
预产期:{{homeInfo.dueDate}} 预产期:{{ homeInfo.dueDate }}
</view> </view>
</view> </view>
<!-- 按钮 --> <!-- 按钮 -->
<view class="postnatal-con-btn"> <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> <image class="image1" :src="`${imageSrc}`"></image>
<view class="btn-item-text"> <view class="btn-item-text">
{{name}} {{ name }}
</view> </view>
<image class="image2" src="/static/chanjianTool/right.png"></image> <image class="image2" src="/static/chanjianTool/right.png"></image>
</view> </view>
...@@ -47,18 +48,19 @@ ...@@ -47,18 +48,19 @@
<!-- 产检记录 --> <!-- 产检记录 -->
<view class="postnatal-con-record"> <view class="postnatal-con-record">
<view class="record-item" <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"> @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">
<view class="item-t-l"> <view class="item-t-l">
第{{index}}次产检 第{{ index }}次产检
</view> </view>
<view class="item-t-r"> <view class="item-t-r">
<view class=""> <view class="">
产检时间:{{ checkupDate ? checkupDate : '---'}} 产检时间:{{ checkupDate ? checkupDate : '---' }}
</view> </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> </image>
</view> </view>
</view> </view>
...@@ -67,14 +69,14 @@ ...@@ -67,14 +69,14 @@
</view> </view>
<view class="item-c"> <view class="item-c">
<view class="item-c-l"> <view class="item-c-l">
孕期{{pregnancyWeek}}周 孕期{{ pregnancyWeek }}周
</view> </view>
<view class=""> <view class="">
<image class="record-img" :src="getSrcUrl(status)"></image> <image class="record-img" :src="getSrcUrl(status)"></image>
</view> </view>
</view> </view>
<view class="item-b"> <view class="item-b">
重点:{{getProject(examinationItems)}} 重点:{{ getProject(examinationItems) }}
</view> </view>
</view> </view>
</view> </view>
...@@ -90,656 +92,413 @@ ...@@ -90,656 +92,413 @@
</template> </template>
<script setup> <script setup>
import { import {
ref, ref,
getCurrentInstance, getCurrentInstance,
onMounted onMounted
} from 'vue' } from 'vue'
import { import {
onLoad, onLoad,
onShow onShow
} from '@dcloudio/uni-app' } from '@dcloudio/uni-app'
import { import {
jump, jump,
JumpType, JumpType,
throttleTap throttleTap
} from '@/utils/index.js'; } from '@/utils/index.js';
import md from '../../md'; import md from '../../md';
import { import {
getInfo, getInfo,
getUpdate, getUpdate,
postnatalJSON postnatalJSON
} from '../../api/obstetric.js'; } from '../../api/obstetric.js';
// 导入日期选择器组件 // 导入日期选择器组件
import DatePicker from '@/components/DatePicker.vue' import DatePicker from '@/components/DatePicker.vue'
import { type } from 'os'; const {
const { proxy
proxy } = getCurrentInstance();
} = getCurrentInstance(); const $baseUrl = proxy.$baseUrl;
const $baseUrl = proxy.$baseUrl; const back_btn = ref('')
const back_btn = ref('')
// 时间弹窗控制
// 时间弹窗控制 const visible = ref(false)
const visible = ref(false)
// 时间
// 时间 const time = ref('')
const time = ref('')
// 保存要修改的id
// 保存要修改的id const editId = ref(null)
const editId = ref(null)
// 轮播图
// 轮播图 const bannerList = ref([])
const bannerList = ref([])
// 首页信息
// 首页信息 const homeInfo = ref({})
const homeInfo = ref({})
// 按钮列表
// 按钮列表 const btnList = ref([{
const btnList = ref([{ name: '报告单',
name: '报告单', imageSrc: '/static/chanjianTool/icon2.png',
imageSrc: '/static/chanjianTool/icon2.png', type: 1
type: 1 },
}, {
{ name: '日历',
name: '日历', imageSrc: '/static/chanjianTool/icon3.png',
imageSrc: '/static/chanjianTool/icon3.png', type: 2
type: 2 }
} ])
])
// 跳转产检详情页面
// 跳转产检详情页面 const onDetails = (id) => {
const onDetails = (id) => { uni.navigateTo({
uni.navigateTo({ url: `/pages/productionDetails/productionDetails?id=${id}`
url: `/pages/productionDetails/productionDetails?id=${id}` })
}
// 拼接检查项目名称
const getProject = (projects) => {
return projects.map(project => project.itemName).join('、');
}
// 根据状态返回图片
const getSrcUrl = (status) => {
const imageMap = {
'pending': '/static/chanjianTool/icon4.png',
'expired': '/static/chanjianTool/icon5.png',
'completed': '/static/chanjianTool/icon6.png',
};
return imageMap[status];
}
// 首页组件逻辑
const backHandler = () => {
if (!back_btn) {
uni.navigateBack();
} else {
jump({
type: JumpType.INNER,
url: `/pages/index/index`
}) })
} }
// 拼接检查项目名称 }
const getProject = (projects) => { // 点击轮播图事件
return projects.map(project => project.itemName).join('、'); const handleBannerClick = (item, index) => {
} console.log(item)
// 根据状态返回图片 // 跳转
const getSrcUrl = (status) => { if (item?.url != "") {
const imageMap = { jump({
'pending': '/static/chanjianTool/icon4.png',
'expired': '/static/chanjianTool/icon5.png',
'completed': '/static/chanjianTool/icon6.png',
};
return imageMap[status];
}
// 首页组件逻辑
const backHandler = () => {
if (!back_btn) {
uni.navigateBack();
} else {
jump({
type: JumpType.INNER,
url: `/pages/index/index`
})
}
}
// 点击轮播图事件
const handleBannerClick = (item, index) => {
console.log(item)
// 跳转
if(item?.url != ""){
jump({
type: item.type, type: item.type,
url: item.url url: item.url
})
}
// let buttonName = '';
// switch(index){
// case 0:
// buttonName = '第一张焦点图';
// break;
// case 1:
// buttonName = '第二张焦点图';
// break;
// case 2:
// buttonName = '第三张焦点图';
// break;
// }
// md.sensorLogTake({
// xcxClick: "产品提醒页-首屏页面点击",
// pageName: "产品提醒页-首屏",
// buttonName: buttonName,
// });
}
// 新增体检
const onAdd = () => {
uni.navigateTo({
url: '/pages/addPostnatal/addPostnatal'
}) })
} }
// 按钮点击
const onBtn = (type) => {
// const items = JSON.stringify(homeInfo.value)
// type 1 报告单 2 日历
switch (type) {
case 1:
uni.navigateTo({
url: '/pages/myReportCard/myReportCard'
})
break;
case 2:
uni.navigateTo({
url: `/pages/productionCalendar/productionCalendar`
})
break;
default:
break;
}
}
// 编辑时间 // let buttonName = '';
const onEdit = (id, newTime) => { // switch(index){
console.log(id, newTime) // case 0:
time.value = newTime // buttonName = '第一张焦点图';
visible.value = true // break;
editId.value = id // case 1:
} // buttonName = '第二张焦点图';
// 选择日期回调确认 // break;
const handleDateConfirm = (date) => { // case 2:
console.log('选择的日期是:', date); // buttonName = '第三张焦点图';
time.value = date; // break;
console.log(editId.value, time.value) // }
onEditTime() // md.sensorLogTake({
} // xcxClick: "产品提醒页-首屏页面点击",
// 修改产检时间 // pageName: "产品提醒页-首屏",
const onEditTime = async () => { // buttonName: buttonName,
// const { code, success, message } = await getUpdate({id: editId.value,checkupDate: time.value}) // });
const { code, success, message } = { }
code: 200, // 新增体检
success: true, const onAdd = () => {
message: '成功', uni.navigateTo({
} url: '/pages/addPostnatal/addPostnatal'
if (success) { })
uni.showToast({ }
title: '修改成功', // 按钮点击
icon: 'none' const onBtn = (type) => {
// const items = JSON.stringify(homeInfo.value)
// type 1 报告单 2 日历
switch (type) {
case 1:
uni.navigateTo({
url: '/pages/myReportCard/myReportCard'
}) })
// 重新获取信息 break;
getInfoFn() case 2:
} else { uni.navigateTo({
uni.showToast({ url: `/pages/productionCalendar/productionCalendar`
title: message,
icon: 'none'
}) })
} break;
default:
break;
} }
// 获取信息接口 }
const getInfoFn = async () => {
console.log('获取信息') // 编辑时间
// 获取信息 const onEdit = (id, newTime) => {
// const {code,success, message, data } = await getInfo() console.log(id, newTime)
const { time.value = newTime
code, visible.value = true
success, editId.value = id
message, }
data // 选择日期回调确认
} = { const handleDateConfirm = (date) => {
code: 200, console.log('选择的日期是:', date);
success: true, time.value = date;
message: '成功', console.log(editId.value, time.value)
data: { onEditTime()
gestationalWeeks: '8', // 几周 }
dueDate: '2025-10-20', // 预产期 // 修改产检时间
// 产检记录 const onEditTime = async () => {
checkupList: [{ const { code, success, message } = await getUpdate({id: editId.value,checkupDate: time.value})
type: 0, // 1 是 0 否 if (success) {
id: 1, uni.showToast({
checkupDate: '2025-07-12', title: '修改成功',
index: '一', // 产检次数 icon: 'none'
pregnancyWeek: '5-6', // 周数 })
status: 'completed', //待产检、已过期、已产检, // 重新获取信息
// 产检项目 getInfoFn()
examinationItems: [{ } else {
itemName: '测量胎儿颈部透明层厚度(NT)', uni.showToast({
id: 1 title: message,
}, icon: 'none'
{ })
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
}
]
}
]
}
}
if (success) {
homeInfo.value = data
} else{
uni.showToast({
title: message,
icon: "none",
});
}
} }
}
// 获取banner图 // 获取信息接口
const postnatalJSONFn = async ()=>{ const getInfoFn = async () => {
// const { success, data, message } = await postnatalJSON() console.log('获取信息')
const { success, data, message } = { // 获取信息
success: true, const { code, success, message, data } = await getInfo()
message:'成功', if (success) {
data: { homeInfo.value = data
// 轮播数据 uni.setStorageSync('dueDate', data.dueDate);
bannerList: [{ } else {
img: 'https://course.feihe.com/momclub-picture/contentLibrary/1003/banner-cl0.png', uni.showToast({
url: `https://mp.weixin.qq.com/s/Xn5dh96OaQ9CcsVMZ5jnvg`, title: message,
type: 3 icon: "none",
}, });
{ }
img: 'https://course.feihe.com/momclub-picture/contentLibrary/1003/banner-cl1.png', }
url: ``,
type: 3 // 获取banner图
}, const postnatalJSONFn = async () => {
{ const { success, data, message } = await postnatalJSON()
img: 'https://course.feihe.com/momclub-picture/contentLibrary/1003/banner-cl2.png', if (success) {
url: `https://www.baidu.com`, bannerList.value = data.bannerList
type: 3 } else {
} uni.showToast({
] title: message,
} icon: "none",
} });
if (success) {
bannerList.value = data.bannerList
} else{
uni.showToast({
title: message,
icon: "none",
});
}
} }
}
onShow(() => { onShow(() => {
// 获取banner图 // 获取banner图
postnatalJSONFn() postnatalJSONFn()
// 获取信息 // 获取信息
getInfoFn() getInfoFn()
}) })
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import "@/common.less"; @import "@/common.less";
.postnatal {
// position: absolute;
width: 100%;
min-height: 100vh;
background-color: #fdf6eb;
&-con {
position: absolute;
// width: 750rpx;
top: 190rpx;
left: 31rpx;
&-info {
font-size: 24rpx;
display: flex;
align-items: center;
margin-top: 50rpx;
font-weight: 500;
.info-c {
width: 2rpx;
height: 22rpx;
margin: 0 16rpx;
.info-img {
display: block;
width: 100%;
height: 100%;
}
}
}
.postnatal { &-btn {
// position: absolute; margin-top: 55rpx;
width: 100%; display: flex;
min-height: 100vh; justify-content: space-between;
background-color: #fdf6eb; margin-bottom: 30rpx;
&-con {
position: absolute; .btn-item {
// width: 750rpx;
top: 190rpx;
left: 31rpx;
&-info {
font-size: 24rpx;
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 50rpx; // justify-content: center;
font-weight: 500; width: 334rpx;
height: 115rpx;
.info-c { background: #ffffff;
width: 2rpx; border-radius: 16rpx;
height: 22rpx; font-size: 34rpx;
margin: 0 16rpx;
.image1 {
.info-img { width: 58rpx;
display: block; height: 58rpx;
width: 100%; margin-left: 80rpx;
height: 100%; }
}
.btn-item-text {
margin-left: 12rpx;
margin-right: 52rpx;
}
.image2 {
width: 12rpx;
height: 23rpx;
} }
} }
}
&-btn { &-record {
margin-top: 55rpx; height: calc(100vh - 650rpx);
display: flex; overflow-y: auto;
justify-content: space-between;
.record-item {
width: 687rpx;
background-color: #fff;
margin-bottom: 30rpx; margin-bottom: 30rpx;
border-radius: 24rpx;
box-sizing: border-box;
padding: 40rpx 32rpx;
position: relative;
.add-image {
position: absolute;
left: 0;
top: 0;
width: 111rpx;
height: 30rpx;
}
.btn-item { .item-t,
.item-c {
display: flex; display: flex;
align-items: center; align-items: center;
// justify-content: center; justify-content: space-between;
width: 334rpx; }
height: 115rpx;
background: #ffffff;
border-radius: 16rpx;
font-size: 34rpx;
.image1 {
width: 58rpx;
height: 58rpx;
margin-left: 80rpx;
}
.btn-item-text {
margin-left: 12rpx;
margin-right: 52rpx;
}
.image2 { .item-line {
width: 12rpx; width: 100%;
height: 23rpx; height: 2rpx;
} background-color: #fcf5ec;
margin: 20rpx 0;
} }
}
&-record { .item-t {
height: calc(100vh - 650rpx); font-size: 24rpx;
overflow-y: auto; font-weight: 500px;
color: #000000;
.record-item {
width: 687rpx;
background-color: #fff;
margin-bottom: 30rpx;
border-radius: 24rpx;
box-sizing: border-box;
padding: 40rpx 32rpx;
position: relative;
.add-image {
position: absolute;
left: 0;
top: 0;
width: 111rpx;
height: 30rpx;
}
.item-t, .item-t-r {
.item-c {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
}
.item-line {
width: 100%;
height: 2rpx;
background-color: #fcf5ec;
margin: 20rpx 0;
}
.item-t {
font-size: 24rpx;
font-weight: 500px;
color: #000000;
.item-t-r {
display: flex;
align-items: center;
}
}
.edit-img {
width: 21rpx;
height: 21rpx;
margin-left: 14rpx;
} }
}
.record-img { .edit-img {
width: 142rpx; width: 21rpx;
height: 35rpx; height: 21rpx;
} margin-left: 14rpx;
}
.item-c { .record-img {
&-l { width: 142rpx;
font-size: 38rpx; height: 35rpx;
color: @color-gold-cover; }
}
.item-c {
&-l {
font-size: 38rpx;
color: @color-gold-cover;
} }
.item-b {
width: 100%;
white-space: nowrap;
/* 禁止换行 */
overflow: hidden;
/* 超出部分隐藏 */
text-overflow: ellipsis;
/* 显示省略号 */
margin-top: 20rpx;
color: #6f6d67;
font-size: 24rpx
}
} }
}
}
&-add {
position: fixed;
right: 31rpx;
bottom: 230rpx;
image { .item-b {
width: 112rpx; width: 100%;
height: 113rpx; white-space: nowrap;
/* 禁止换行 */
overflow: hidden;
/* 超出部分隐藏 */
text-overflow: ellipsis;
/* 显示省略号 */
margin-top: 20rpx;
color: #6f6d67;
font-size: 24rpx
}
} }
} }
} }
.banner-swiper { &-add {
width: 687rpx; position: fixed;
height: 177rpx; right: 31rpx;
border-radius: 12rpx; bottom: 230rpx;
overflow: hidden;
.banner-img { image {
width: 100%; width: 112rpx;
height: 100%; height: 113rpx;
// border-radius: 16rpx;
} }
} }
}
.banner-swiper {
width: 687rpx;
height: 177rpx;
border-radius: 12rpx;
overflow: hidden;
.page-top { .banner-img {
width: 100%;
display: flex;
align-items: center;
}
.btnback {
width: 16rpx;
height: 29rpx;
// margin-top: 110rpx;
// margin-left: 35rpx;
}
.page_title {
width: 100%; width: 100%;
font-size: 34rpx; height: 100%;
font-weight: 500; // border-radius: 16rpx;
text-align: center;
color: #1d1e25;
line-height: 36rpx;
// margin-top: -46rpx;
// margin-left: 0rpx;
} }
}
.page-top {
width: 100%;
display: flex;
align-items: center;
}
.btnback {
width: 16rpx;
height: 29rpx;
// margin-top: 110rpx;
// margin-left: 35rpx;
}
.page_title {
width: 100%;
font-size: 34rpx;
font-weight: 500;
text-align: center;
color: #1d1e25;
line-height: 36rpx;
// margin-top: -46rpx;
// margin-left: 0rpx;
}
</style> </style>
\ No newline at end of file
...@@ -392,217 +392,217 @@ const onDetails = (id) => { ...@@ -392,217 +392,217 @@ const onDetails = (id) => {
const getInfoFn = async () => { const getInfoFn = async () => {
console.log('获取信息') console.log('获取信息')
// 获取信息 // 获取信息
// const {code,success, message, data } = await getInfo() const {code,success, message, data } = await getInfo()
const { // const {
code, // code,
success, // success,
message, // message,
data // data
} = { // } = {
code: 200, // code: 200,
success: true, // success: true,
message: '成功', // message: '成功',
data: { // data: {
gestationalWeeks: '8', // 几周 // gestationalWeeks: '8', // 几周
dueDate: '2025-10-20', // 预产期 // dueDate: '2025-10-20', // 预产期
// 轮播数据 // // 轮播数据
bannerList: [{ // bannerList: [{
imageUrl: 'https://course.feihe.com/momclub-picture/contentLibrary/1003/banner-cl0.png', // imageUrl: 'https://course.feihe.com/momclub-picture/contentLibrary/1003/banner-cl0.png',
jumpUrl: `https://www.baidu.com` // jumpUrl: `https://www.baidu.com`
}, // },
{ // {
imageUrl: 'https://course.feihe.com/momclub-picture/contentLibrary/1003/banner-cl1.png', // imageUrl: 'https://course.feihe.com/momclub-picture/contentLibrary/1003/banner-cl1.png',
jumpUrl: `https://www.baidu.com` // jumpUrl: `https://www.baidu.com`
}, // },
{ // {
imageUrl: 'https://course.feihe.com/momclub-picture/contentLibrary/1003/banner-cl2.png', // imageUrl: 'https://course.feihe.com/momclub-picture/contentLibrary/1003/banner-cl2.png',
jumpUrl: `https://www.baidu.com` // jumpUrl: `https://www.baidu.com`
} // }
], // ],
// 产检记录 // // 产检记录
checkupList: [{ // checkupList: [{
type: 0, // 1 是 0 否 // type: 0, // 1 是 0 否
id: 1, // id: 1,
checkupDate: '2025-07-22', // checkupDate: '2025-07-22',
index: '一', // 产检次数 // index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数 // pregnancyWeek: '5-6', // 周数
status: '待产检', //待产检、已过期、已产检, // status: '待产检', //待产检、已过期、已产检,
// 产检项目 // // 产检项目
examinationItems: [{ // examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)', // itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1 // id: 1
}, // },
{ // {
itemName: '无创产前基因检测(NIPT)(非必查)', // itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2 // id: 2
} // }
] // ]
}, // },
{ // {
type: 0, // 1 是 0 否 // type: 0, // 1 是 0 否
id: 1, // id: 1,
checkupDate: '2025-07-21', // checkupDate: '2025-07-21',
index: '一', // 产检次数 // index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数 // pregnancyWeek: '5-6', // 周数
status: '待产检', //待产检、已过期、已产检, // status: '待产检', //待产检、已过期、已产检,
// 产检项目 // // 产检项目
examinationItems: [{ // examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)', // itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1 // id: 1
}, // },
{ // {
itemName: '无创产前基因检测(NIPT)(非必查)', // itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2 // id: 2
} // }
] // ]
}, // },
{ // {
type: 0, // 1 是 0 否 // type: 0, // 1 是 0 否
id: 1, // id: 1,
checkupDate: '2025-07-23', // checkupDate: '2025-07-23',
index: '一', // 产检次数 // index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数 // pregnancyWeek: '5-6', // 周数
status: '待产检', //待产检、已过期、已产检, // status: '待产检', //待产检、已过期、已产检,
// 产检项目 // // 产检项目
examinationItems: [{ // examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)', // itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1 // id: 1
}, // },
{ // {
itemName: '无创产前基因检测(NIPT)(非必查)', // itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2 // id: 2
} // }
] // ]
}, // },
{ // {
type: 0, // 1 是 0 否 // type: 0, // 1 是 0 否
id: 1, // id: 1,
checkupDate: '2025-07-23', // checkupDate: '2025-07-23',
index: '一', // 产检次数 // index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数 // pregnancyWeek: '5-6', // 周数
status: '待产检', //待产检、已过期、已产检, // status: '待产检', //待产检、已过期、已产检,
// 产检项目 // // 产检项目
examinationItems: [{ // examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)', // itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1 // id: 1
}, // },
{ // {
itemName: '无创产前基因检测(NIPT)(非必查)', // itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2 // id: 2
} // }
] // ]
}, // },
{ // {
type: 0, // 1 是 0 否 // type: 0, // 1 是 0 否
id: 1, // id: 1,
checkupDate: '2025-07-23', // checkupDate: '2025-07-23',
index: '一', // 产检次数 // index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数 // pregnancyWeek: '5-6', // 周数
status: '待产检', //待产检、已过期、已产检, // status: '待产检', //待产检、已过期、已产检,
// 产检项目 // // 产检项目
examinationItems: [{ // examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)', // itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1 // id: 1
}, // },
{ // {
itemName: '无创产前基因检测(NIPT)(非必查)', // itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2 // id: 2
} // }
] // ]
}, // },
{ // {
type: 0, // 1 是 0 否 // type: 0, // 1 是 0 否
id: 1, // id: 1,
checkupDate: '2025-07-23', // checkupDate: '2025-07-23',
index: '一', // 产检次数 // index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数 // pregnancyWeek: '5-6', // 周数
status: '待产检', //待产检、已过期、已产检, // status: '待产检', //待产检、已过期、已产检,
// 产检项目 // // 产检项目
examinationItems: [{ // examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)', // itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1 // id: 1
}, // },
{ // {
itemName: '无创产前基因检测(NIPT)(非必查)', // itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2 // id: 2
} // }
] // ]
}, // },
{ // {
type: 0, // 1 是 0 否 // type: 0, // 1 是 0 否
id: 1, // id: 1,
checkupDate: '2025-07-23', // checkupDate: '2025-07-23',
index: '一', // 产检次数 // index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数 // pregnancyWeek: '5-6', // 周数
status: '待产检', //待产检、已过期、已产检, // status: '待产检', //待产检、已过期、已产检,
// 产检项目 // // 产检项目
examinationItems: [{ // examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)', // itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1 // id: 1
}, // },
{ // {
itemName: '无创产前基因检测(NIPT)(非必查)', // itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2 // id: 2
} // }
] // ]
}, // },
{ // {
type: 0, // 1 是 0 否 // type: 0, // 1 是 0 否
id: 1, // id: 1,
checkupDate: '2025-07-23', // checkupDate: '2025-07-23',
index: '一', // 产检次数 // index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数 // pregnancyWeek: '5-6', // 周数
status: '待产检', //待产检、已过期、已产检, // status: '待产检', //待产检、已过期、已产检,
// 产检项目 // // 产检项目
examinationItems: [{ // examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)', // itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1 // id: 1
}, // },
{ // {
itemName: '无创产前基因检测(NIPT)(非必查)', // itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2 // id: 2
} // }
] // ]
}, // },
{ // {
type: 0, // 1 是 0 否 // type: 0, // 1 是 0 否
id: 1, // id: 1,
checkupDate: '2025-07-23', // checkupDate: '2025-07-23',
index: '一', // 产检次数 // index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数 // pregnancyWeek: '5-6', // 周数
status: '待产检', //待产检、已过期、已产检, // status: '待产检', //待产检、已过期、已产检,
// 产检项目 // // 产检项目
examinationItems: [{ // examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)', // itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1 // id: 1
}, // },
{ // {
itemName: '无创产前基因检测(NIPT)(非必查)', // itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2 // id: 2
} // }
] // ]
}, // },
{ // {
type: 0, // 1 是 0 否 // type: 0, // 1 是 0 否
id: 1, // id: 1,
checkupDate: '2025-07-23', // checkupDate: '2025-07-23',
index: '一', // 产检次数 // index: '一', // 产检次数
pregnancyWeek: '5-6', // 周数 // pregnancyWeek: '5-6', // 周数
status: '待产检', //待产检、已过期、已产检, // status: '待产检', //待产检、已过期、已产检,
// 产检项目 // // 产检项目
examinationItems: [{ // examinationItems: [{
itemName: '测量胎儿颈部透明层厚度(NT)', // itemName: '测量胎儿颈部透明层厚度(NT)',
id: 1 // id: 1
}, // },
{ // {
itemName: '无创产前基因检测(NIPT)(非必查)', // itemName: '无创产前基因检测(NIPT)(非必查)',
id: 2 // id: 2
} // }
] // ]
} // }
] // ]
} // }
} // }
if (success) { if (success) {
info.value = data info.value = data
} else { } else {
...@@ -1058,4 +1058,10 @@ onShow(() => { ...@@ -1058,4 +1058,10 @@ onShow(() => {
::v-deep .uni-datetime-picker-btn-text { ::v-deep .uni-datetime-picker-btn-text {
color: #D4A574 !important; color: #D4A574 !important;
} }
::v-deep .uni-calendar--fixed{
z-index: 100 !important;
}
::v-deep .uni-calendar__mask{
z-index: 100 !important;
}
</style> </style>
\ No newline at end of file
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</view> </view>
</view> </view>
<view class="container-4 pad"> <view class="container-4 pad">
建议时间:{{ infoData.suggestionCheckupDate }} 建议时间:{{ infoData.suggestionCheckup}}
</view> </view>
<!-- 产检须知 --> <!-- 产检须知 -->
<view class="project-box" id="section-0"> <view class="project-box" id="section-0">
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,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>
...@@ -116,24 +116,25 @@ ...@@ -116,24 +116,25 @@
<!-- 弹窗内容区 --> <!-- 弹窗内容区 -->
<view v-if="showPicker" class="picker-layer-popup"> <view v-if="showPicker" class="picker-layer-popup">
<view class="picker-layer-panel"> <view class="picker-layer-panel">
<!-- 可自定义头部 -->
<view class="picker-layer-header"> <view class="picker-layer-title">
<text class="picker-layer-cancel" @click="close">取消</text> 设置提醒时间
<text class="picker-layer-confirm" @click="handleConfirm">确定</text> </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-bottom">
<text class="bottom-close btn" @click="close">取消</text>
<text class="bottom-confirm btn" @click="handleConfirm">确定</text>
</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> </view>
</view> </view>
</view> </view>
...@@ -172,7 +173,7 @@ import { ...@@ -172,7 +173,7 @@ import {
// 提醒选择器相关状态 // 提醒选择器相关状态
const showPicker = ref(false) const showPicker = ref(false)
const options = ['当天', '前一天', '前三天'] // 提醒时间选项 const options = ['当天', '前一天', '前三天'] // 提醒时间选项
const pickerValue = ref([0]) // 当前选中的索引 const pickerValue = ref(0) // 当前选中的索引
const selectedValue = ref('') // 选中的值 const selectedValue = ref('') // 选中的值
const tabInfo = [{ const tabInfo = [{
...@@ -307,6 +308,14 @@ const numberToChinese = (num) => { ...@@ -307,6 +308,14 @@ const numberToChinese = (num) => {
return str.replace(/零$/, ''); // 去掉末尾的零 return str.replace(/零$/, ''); // 去掉末尾的零
} }
// 图片预览
const onPreviewImage = (url) => {
console.log(url)
uni.previewImage({
current: '1',
urls: [url]
})
}
// 删除上传图片 // 删除上传图片
const onImageDel = (id) => { const onImageDel = (id) => {
bgdImgList.value.filter((item, index) => { bgdImgList.value.filter((item, index) => {
...@@ -324,6 +333,13 @@ const onImageDel = (id) => { ...@@ -324,6 +333,13 @@ const onImageDel = (id) => {
} }
// 上传图片 // 上传图片
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: 15,
...@@ -376,17 +392,17 @@ const onRemind = () => { ...@@ -376,17 +392,17 @@ const onRemind = () => {
// 提醒关闭 // 提醒关闭
const close = () => { const close = () => {
showPicker.value = false; showPicker.value = false;
} }
// 选择提醒事件 // 选择提醒事件
const handleChange = (e) => { const handleChange = (e) => {
pickerValue.value = e.detail.value; pickerValue.value = e;
} }
// 确认选择 // 确认选择
const handleConfirm = () => { const handleConfirm = () => {
selectedValue.value = options[pickerValue.value];
close(); close();
selectedValue.value = options[pickerValue.value[0]];
// 订阅提醒 // 订阅提醒
uni.requestSubscribeMessage({ uni.requestSubscribeMessage({
tmplIds: [infoData.wxTemplateId], tmplIds: [infoData.wxTemplateId],
...@@ -401,12 +417,20 @@ const handleConfirm = () => { ...@@ -401,12 +417,20 @@ const handleConfirm = () => {
// 完成检查 // 完成检查
const onComplete = () => { const onComplete = () => {
if(infoData.checkupDate == ''){
uni.showToast({
title: '请选择产检日期',
icon: 'none',
duration: 2000
})
return
}
// 切换状态 // 切换状态
isCompleted.value = !isCompleted.value isCompleted.value = !isCompleted.value
console.log(isCompleted.value) console.log(isCompleted.value)
const params = { const params = {
id: editId.value, id: editId.value,
status: isCompleted.value status: isCompleted.value ? 'completed' : 'pending'
} }
onEditTime(params) onEditTime(params)
} }
...@@ -440,17 +464,8 @@ const onModify = (item) => { ...@@ -440,17 +464,8 @@ const onModify = (item) => {
// 修改产检接口 // 修改产检接口
const onEditTime = async (params) => { const onEditTime = async (params) => {
console.log(params) console.log(params)
// const { code, success, message } = await getUpdate(params) const { code, success, message } = await getUpdate(params)
const { code, success, message } = {
code: 200,
success: true,
message: '成功',
}
if (success) { if (success) {
// uni.showToast({
// title: '修改成功',
// icon: 'none'
// })
// 重新获取信息 // 重新获取信息
getDetailFn(editId.value) getDetailFn(editId.value)
} else { } else {
...@@ -464,60 +479,12 @@ const onEditTime = async (params) => { ...@@ -464,60 +479,12 @@ const onEditTime = async (params) => {
const getDetailFn = async (id) => { const getDetailFn = async (id) => {
console.log('获取信息', id) console.log('获取信息', id)
// 获取信息 // 获取信息
// const {code,success, message, data } = await getDetail({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: []
}
}
}
if (success) { if (success) {
const {
checkupList infoData.value = data
} = data bgdImgList.value = data.reportImages
infoData.value = checkupList isCompleted.value = data.status === 'completed'
bgdImgList.value = checkupList.reportImages
isCompleted.value = checkupList.status === 'completed'
} else { } else {
uni.showToast({ uni.showToast({
title: message, title: message,
...@@ -867,95 +834,61 @@ onLoad((options) => { ...@@ -867,95 +834,61 @@ onLoad((options) => {
/* 弹窗容器样式 */ /* 弹窗容器样式 */
.picker-layer-panel { .picker-layer-panel {
width: 100vw; width: 100vw;
height: 50vh; height: 52vh;
background: #f6f8fa; background: #f6f8fa;
border-top-left-radius: 24rpx; border-top-left-radius: 24rpx;
border-top-right-radius: 24rpx; border-top-right-radius: 24rpx;
overflow: hidden; overflow: hidden;
display: flex; padding: 32rpx;
flex-direction: column; box-sizing: border-box;
position: relative;
} }
.picker-layer-title{
.picker-layer-header { 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;
align-items: center;
justify-content: center;
border: 2rpx solid #fff;
box-sizing: border-box;
margin-bottom: 20rpx;
background: #ffffff;
}
.item-active{
background: #fffbed;
border-color: #d3a358;
}
}
.picker-layer-bottom {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
height: 140rpx; .btn{
box-sizing: border-box; width: 334rpx;
background: #f6f8fa; height: 97rpx;
padding: 0 32rpx;
.picker-layer-cancel {
color: #6f6d67;
font-size: 28rpx;
width: 136rpx;
height: 74rpx;
border-radius: 20rpx;
background: #ffffff;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border-radius: 48.5rpx;
font-size: 38rpx;
} }
.bottom-close {
.picker-layer-confirm { color: #d3a358;
background: #ffffff;
}
.bottom-confirm {
color: #ffffff; color: #ffffff;
font-size: 28rpx;
width: 136rpx;
height: 74rpx;
border-radius: 20rpx;
background: #d3a358; background: #d3a358;
display: flex;
align-items: center;
justify-content: center;
}
.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;
}
.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;
}
.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> </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