This commit is contained in:
zoujiandong
2025-08-29 09:46:07 +08:00
parent cc0ddd0bc9
commit da6e4ae551
10 changed files with 1121 additions and 624 deletions
+52 -4
View File
@@ -9,12 +9,34 @@
<!-- 弹窗内容 -->
<view class="dialog-content">
<slot name="content">
<text class="default-content">{{ content }}</text>
<view class="default-content" >
<view v-for="item in formatContent(content)" :key="item">{{item}}</view>
</view>
</slot>
</view>
<!-- 弹窗底部按钮 -->
<view class="dialog-footer">
<view class="dialog-footer cancelFooter" v-if="showCancel">
<view
class="dialog-btn"
@click="oncancel"
>
<text class="btn-text">{{cancelText}}</text>
</view>
</view>
<view class="dialog-footer okFooter" v-else-if="showConfirm">
<view
class="dialog-btn okBtn"
@click="onconfirm"
>
<text class="btn-text">{{confirmText}}</text>
</view>
</view>
<view class="dialog-footer" v-else>
<view
class="dialog-btn cancel"
@@ -49,13 +71,35 @@
type: String,
default: ''
},
cancelText:{
type: String,
default: '取消'
},
confirmText:{
type: String,
default: '确定'
},
showCancel:{
type:Boolean,
default:false,
},
showConfirm:{
type:Boolean,
default:false,
},
closeOnOverlay: {
type: Boolean,
default: true
}
})
const formatContent=(val)=>{
console.log(val)
if(!val) return [];
// 将字符串按 \n 切割成数组,并过滤掉空字符串
const lines = val.split('<br>').filter(line => line.trim() !== '');
console.log('格式化后的内容数组:', lines);
return lines;
}
const emit = defineEmits(['close'])
@@ -110,6 +154,7 @@
justify-content: center;
.default-content {
white-space:pre-wrap;
font-size: 32rpx;
color: #333;
line-height: 1.5;
@@ -163,4 +208,7 @@
}
}
}
.cancelFooter,.okFooter{
padding: 0;
}
</style>
+11 -15
View File
@@ -9,23 +9,19 @@
>
<!-- 图标容器 -->
<view class="icon-container">
<!-- <uni-icons
:type="currentTab === index ? item.activeIcon : item.icon"
:size="currentTab === index ? 28 : 24"
:color="currentTab === index ? item.activeColor : item.color"
></uni-icons> -->
<image class="img" :src="currentTab === index ? item.activeIcon : item.icon" alt="" />
<!-- 徽章 -->
<view class="badge" v-if="item.badge && item.badge > 0">
<!-- <view class="badge" v-if="item.badge && item.badge > 0">
<uni-badge
:text="item.badge > 99 ? '99+' : item.badge.toString()"
type="error"
size="small"
></uni-badge>
</view>
</view> -->
<!-- 红点 -->
<view class="red-dot" v-if="item.showRedDot"></view>
<!-- <view class="red-dot" v-if="item.showRedDot"></view> -->
</view>
<!-- 文字 -->
@@ -82,9 +78,9 @@
text: '患教学堂',
color: '#999999',
activeColor: '#007aff',
badge: 5,
badge:0,
showRedDot: false,
pagePath: '/pages/education/education'
pagePath: '/pages/patientClass/patientClass'
},
{
icon: live,
@@ -93,8 +89,8 @@
color: '#999999',
activeColor: '#007aff',
badge: 0,
showRedDot: true,
pagePath: '/pages/meeting/meeting'
showRedDot: false,
pagePath: '/pages/live/live'
},
{
icon: education,
@@ -102,9 +98,9 @@
text: '继续教育',
color: '#999999',
activeColor: '#007aff',
badge: 12,
badge: 0,
showRedDot: false,
pagePath: '/pages/education/continuing'
pagePath: '/pages/education/education'
},
{
icon: my,
@@ -114,7 +110,7 @@
activeColor: '#007aff',
badge: 0,
showRedDot: false,
pagePath: '/pages/profile/profile'
pagePath: '/pages/my/my'
}
]);