Commit 32db28aa authored by weishengfei's avatar weishengfei

refactor(pages): 优化产检相关页面样式和功能

- 调整产检项目列表样式,增加文字溢出处理
- 优化时间选择器功能,支持直接修改时间
- 修复部分页面跳转和数据传递问题
- 统一数字转换为中文的逻辑
- 调整微信模板消息订阅逻辑
parent 06d9984f
...@@ -82,10 +82,14 @@ ...@@ -82,10 +82,14 @@
<view class="box"> <view class="box">
<view v-for="item in group.list" :key="item.id" class="airport-item"> <view v-for="item in group.list" :key="item.id" class="airport-item">
<view class="airport-item-radio" @click="toggleSelect(item)"> <view class="airport-item-radio" @click="toggleSelect(item)">
<image class="image-1" v-if="isSelected(item.id)" <image class="image-1" v-if="isSelected(item.id)"
src="/static/chanjianTool/icon17.png" mode=""></image> src="/static/chanjianTool/icon17.png" mode=""></image>
<image class="image-2" v-else src="/static/chanjianTool/icon18.png"></image> <image class="image-2" v-else src="/static/chanjianTool/icon18.png"></image>
{{ item.itemName }} <view class="image-3">
{{ item.itemName }}
</view>
</view> </view>
<view class="airport-item-image" @click.stop="onView(item)"> <view class="airport-item-image" @click.stop="onView(item)">
<image src="/static/chanjianTool/icon16.png"></image> <image src="/static/chanjianTool/icon16.png"></image>
...@@ -665,9 +669,7 @@ onLoad((options) => { ...@@ -665,9 +669,7 @@ onLoad((options) => {
flex: 1; flex: 1;
display: flex; display: flex;
align-items: center; align-items: center;
white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis;
image { image {
margin-right: 8rpx; margin-right: 8rpx;
...@@ -683,6 +685,12 @@ onLoad((options) => { ...@@ -683,6 +685,12 @@ onLoad((options) => {
width: 29rpx; width: 29rpx;
height: 29rpx; height: 29rpx;
} }
.image-3{
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
} }
.action-bar { .action-bar {
...@@ -758,11 +766,12 @@ onLoad((options) => { ...@@ -758,11 +766,12 @@ onLoad((options) => {
flex: 1; flex: 1;
font-size: 34rpx; font-size: 34rpx;
font-weight: 700; font-weight: 700;
margin-right: 37rpx;
} }
image { image {
position: absolute; position: absolute;
top: 10.5rpx; top: 9.5rpx;
right: 0rpx; right: 0rpx;
width: 28rpx; width: 28rpx;
height: 29rpx; height: 29rpx;
......
...@@ -46,7 +46,10 @@ ...@@ -46,7 +46,10 @@
<image class="image-1" v-if="isSelected(item.id)" <image class="image-1" v-if="isSelected(item.id)"
src="/static/chanjianTool/icon17.png" mode=""></image> src="/static/chanjianTool/icon17.png" mode=""></image>
<image class="image-2" v-else src="/static/chanjianTool/icon18.png"></image> <image class="image-2" v-else src="/static/chanjianTool/icon18.png"></image>
{{ item.itemName }} <view class="image-3">
{{ item.itemName }}
</view>
</view> </view>
<view class="airport-item-image" @click.stop="onView(item)"> <view class="airport-item-image" @click.stop="onView(item)">
<image src="/static/chanjianTool/icon16.png"></image> <image src="/static/chanjianTool/icon16.png"></image>
...@@ -563,9 +566,7 @@ onLoad((options) => { ...@@ -563,9 +566,7 @@ onLoad((options) => {
flex: 1; flex: 1;
display: flex; display: flex;
align-items: center; align-items: center;
white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis;
image { image {
margin-right: 8rpx; margin-right: 8rpx;
...@@ -581,6 +582,12 @@ onLoad((options) => { ...@@ -581,6 +582,12 @@ onLoad((options) => {
width: 29rpx; width: 29rpx;
height: 29rpx; height: 29rpx;
} }
.image-3 {
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
} }
.action-bar { .action-bar {
...@@ -656,11 +663,12 @@ onLoad((options) => { ...@@ -656,11 +663,12 @@ onLoad((options) => {
flex: 1; flex: 1;
font-size: 34rpx; font-size: 34rpx;
font-weight: 700; font-weight: 700;
margin-right: 37rpx;
} }
image { image {
position: absolute; position: absolute;
top: 10.5rpx; top: 9.5rpx;
right: 0rpx; right: 0rpx;
width: 28rpx; width: 28rpx;
height: 29rpx; height: 29rpx;
......
...@@ -182,10 +182,13 @@ import { type } from 'os'; ...@@ -182,10 +182,13 @@ import { type } from 'os';
const handleBannerClick = (item, index) => { const handleBannerClick = (item, index) => {
console.log(item) console.log(item)
// 跳转 // 跳转
jump({ if(item?.url != ""){
jump({
type: item.type, type: item.type,
url: item.url url: item.url
}) })
}
// let buttonName = ''; // let buttonName = '';
// switch(index){ // switch(index){
// case 0: // case 0:
...@@ -511,7 +514,7 @@ import { type } from 'os'; ...@@ -511,7 +514,7 @@ import { type } from 'os';
}, },
{ {
img: 'https://course.feihe.com/momclub-picture/contentLibrary/1003/banner-cl1.png', img: 'https://course.feihe.com/momclub-picture/contentLibrary/1003/banner-cl1.png',
url: `https://mp.weixin.qq.com/s/Xn5dh96OaQ9CcsVMZ5jnvg`, url: ``,
type: 3 type: 3
}, },
{ {
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<view class="container-3-l"> <view class="container-3-l">
产检时间 产检时间
</view> </view>
<view class="container-3-r" @click="onChangeTime"> <view class="container-3-r" @click="onChangeTime(infoData.checkupDate)">
{{ infoData.checkupDate ? infoData.checkupDate : '选择时间' }} {{ infoData.checkupDate ? infoData.checkupDate : '选择时间' }}
<image src="/static/chanjianTool/edit.png"></image> <image src="/static/chanjianTool/edit.png"></image>
</view> </view>
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<view class="project-content"> <view class="project-content">
<view class="project-list" v-for="(item, index) in infoData.examinationItems" :key="index"> <view class="project-list" v-for="(item, index) in infoData.examinationItems" :key="index">
<view class="list-itemName"> <view class="list-itemName">
{{numberToChinese(index+1)}}{{ item.itemName }} {{ numberToChinese(index + 1) }}{{ item.itemName }}
</view> </view>
<view class="list-introduction"> <view class="list-introduction">
<rich-text :nodes="item.introduction"></rich-text> <rich-text :nodes="item.introduction"></rich-text>
...@@ -195,16 +195,8 @@ const infoData = ref({}) ...@@ -195,16 +195,8 @@ const infoData = ref({})
// 临时储存报告单 // 临时储存报告单
const bgdImgList = ref([]) const bgdImgList = ref([])
const time = ref('2025-07-21') // 时间组件参数
const time = ref('')
// 修改项目
const onModify = (item) => {
console.log(item)
const items = JSON.stringify(item)
uni.navigateTo({
url: `/pages/editPostnatal/editPostnatal?item=${items}`
})
}
// 新增完成状态 // 新增完成状态
const isCompleted = ref(false) const isCompleted = ref(false)
...@@ -212,25 +204,6 @@ const isCompleted = ref(false) ...@@ -212,25 +204,6 @@ const isCompleted = ref(false)
// 日期选择器 // 日期选择器
const visible = ref(false) const visible = ref(false)
// 更完整的转换函数(支持0-99)
const numberToChinese = (num) => {
const chineseNumbers = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
const units = ['', '十'];
if (num === 0) return chineseNumbers[0];
if (num <= 10) return num === 10 ? '十' : chineseNumbers[num];
let str = '';
if (num > 10 && num < 20) {
str = '十' + chineseNumbers[num % 10];
} else if (num >= 20 && num < 100) {
str = chineseNumbers[Math.floor(num / 10)] + '十' + chineseNumbers[num % 10];
} else {
return num.toString(); // 超过范围返回原数字
}
return str.replace(/零$/, ''); // 去掉末尾的零
}
// 滚动相关状态 // 滚动相关状态
const scrollTop = ref(0) const scrollTop = ref(0)
...@@ -312,7 +285,27 @@ const scrollToSection = (index) => { ...@@ -312,7 +285,27 @@ const scrollToSection = (index) => {
scrolling.value = false; scrolling.value = false;
}, 300); }, 300);
}); });
}; }
// 更完整的转换函数(支持0-99)
const numberToChinese = (num) => {
const chineseNumbers = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
const units = ['', '十'];
if (num === 0) return chineseNumbers[0];
if (num <= 10) return num === 10 ? '十' : chineseNumbers[num];
let str = '';
if (num > 10 && num < 20) {
str = '十' + chineseNumbers[num % 10];
} else if (num >= 20 && num < 100) {
str = chineseNumbers[Math.floor(num / 10)] + '十' + chineseNumbers[num % 10];
} else {
return num.toString(); // 超过范围返回原数字
}
return str.replace(/零$/, ''); // 去掉末尾的零
}
// 删除上传图片 // 删除上传图片
const onImageDel = (id) => { const onImageDel = (id) => {
...@@ -396,8 +389,11 @@ const handleConfirm = () => { ...@@ -396,8 +389,11 @@ const handleConfirm = () => {
selectedValue.value = options[pickerValue.value[0]]; selectedValue.value = options[pickerValue.value[0]];
// 订阅提醒 // 订阅提醒
uni.requestSubscribeMessage({ uni.requestSubscribeMessage({
tmplIds: [infoData.wxTemplateId], tmplIds: [infoData.wxTemplateId],
success (res) { success(res) {
console.log(res)
},
fail(res) {
console.log(res) console.log(res)
} }
}) })
...@@ -416,8 +412,9 @@ const onComplete = () => { ...@@ -416,8 +412,9 @@ const onComplete = () => {
} }
// 修改时间 // 修改时间
const onChangeTime = throttleTap(() => { const onChangeTime = throttleTap((date) => {
visible.value = true visible.value = true
time.value = date
}) })
// 选择时间 // 选择时间
...@@ -431,6 +428,15 @@ const handleDateConfirm = (date) => { ...@@ -431,6 +428,15 @@ const handleDateConfirm = (date) => {
onEditTime(params) onEditTime(params)
} }
// 修改项目
const onModify = (item) => {
console.log(item)
const items = JSON.stringify(item)
uni.navigateTo({
url: `/pages/editPostnatal/editPostnatal?item=${items}`
})
}
// 修改产检接口 // 修改产检接口
const onEditTime = async (params) => { const onEditTime = async (params) => {
console.log(params) console.log(params)
...@@ -441,10 +447,10 @@ const onEditTime = async (params) => { ...@@ -441,10 +447,10 @@ const onEditTime = async (params) => {
message: '成功', message: '成功',
} }
if (success) { if (success) {
uni.showToast({ // uni.showToast({
title: '修改成功', // title: '修改成功',
icon: 'none' // icon: 'none'
}) // })
// 重新获取信息 // 重新获取信息
getDetailFn(editId.value) getDetailFn(editId.value)
} else { } else {
...@@ -757,20 +763,25 @@ onLoad((options) => { ...@@ -757,20 +763,25 @@ onLoad((options) => {
} }
} }
} }
.project-content{
.project-list{ .project-content {
.list-itemName{ .project-list {
.list-itemName {
font-size: 28rpx; font-size: 28rpx;
font-weight: bold font-weight: bold
} }
.list-introduction{
font-size: 26rpx; .list-introduction {
font-size: 26rpx;
} }
.list-itemName , .list-introduction{
margin-bottom: 15rpx; .list-itemName,
.list-introduction {
margin-bottom: 15rpx;
} }
} }
} }
.img-list { .img-list {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
......
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