Commit 32db28aa authored by weishengfei's avatar weishengfei

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

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