修改bug

This commit is contained in:
zhouyanli
2026-08-26 18:00:43 +08:00
parent c862c6ae4b
commit 56641cbc56
6 changed files with 35 additions and 36 deletions

View File

@@ -90,17 +90,14 @@
<!-- 招募要求 -->
<view class="section">
<view class="section-title">招募要求</view>
<view class="section-content">
{{activityConent.requirements}}
</view>
<view class="section-content" v-html="formatRichText(activityConent.requirements)"></view>
</view>
<!-- 活动详情 -->
<view class="section" style="margin-bottom: 40rpx;">
<view class="section-title">活动详情</view>
<view class="section-content rich-content">
<view v-html="activityConent.content"></view>
<view></view>
<view v-html="formatRichText(activityConent.content)"></view>
</view>
</view>
</view>
@@ -170,7 +167,7 @@
报名
</button>
<!-- 已报名状态显示取消报名按钮活动已结束则隐藏 -->
<!-- 已报名状态显示取消报名按钮 -->
<button
v-if="hasSigned && !isActivityEnded && activeTab === 'detail'"
class="action-btn cancel-btn"
@@ -246,10 +243,7 @@ const liveRecords = ref([])
// 判断活动是否已结束
const isActivityEnded = computed(() => {
// 优先使用列表页传入的statusText
if (statusTextFromParam.value === '已结束') return true
// 其次使用后端详情接口返回的状态字段
// if (activityConent.value.statusText === '已结束') return true
// 报名截止时间已过
if (activityConent.value.applyDeadline && moment().isAfter(moment(activityConent.value.applyDeadline))) return true
// 活动结束时间已过
@@ -269,9 +263,6 @@ const isActivityEndedByTime = computed(() => {
return moment().isAfter(moment(activityConent.value.endTime))
})
// ========方法=====
// 时间格式化函数
const formatTime = (timeStr) => {
@@ -279,13 +270,27 @@ const formatTime = (timeStr) => {
return moment(timeStr).format('YYYY-MM-DD HH:mm')
}
// 富文本处理:给 img 注入内联样式
const formatRichText = (html) => {
if (!html) return ''
return html.replace(/<img\b([^>]*)>/gi, (match, attrs) => {
// 去掉尾部自闭合斜杠,避免 style 追加到斜杠之后
const inner = attrs.replace(/\/\s*$/, '')
const imgStyle = 'max-width:100%;height:auto;display:block;'
if (/style\s*=/i.test(inner)) {
// 已有 style在 style 值开头注入
return `<img${inner.replace(/(style\s*=\s*["'])/i, `$1${imgStyle}`)}>`
}
return `<img${inner} style="${imgStyle}">`
})
}
// ---接收参数---
const statusTextFromParam = ref('') // 从列表页传入的活动状态文本
onLoad((option) =>{
navTitle.value = option?.title
curActivityId.value = option?.id
statusTextFromParam.value = option?.statusText || ''
// 处理applied参数
hasSigned.value = option?.applied === 'true'
// console.log('hasSigned.value',hasSigned.value)
// 2. 初始化数据

View File

@@ -151,7 +151,7 @@ onLoad(() =>{
.door-open-page {
display: flex;
flex-direction: column;
height: 100%;
min-height: 100%;
overflow: hidden;
background: linear-gradient(180deg, #E2F0FF, #F6FAFF);
box-sizing: border-box;
@@ -161,7 +161,7 @@ onLoad(() =>{
flex: 1;
height: 0;
overflow-y: auto;
padding: 30rpx 40rpx;
padding: 30rpx 40rpx 160rpx;
box-sizing: border-box;
}
@@ -292,7 +292,12 @@ onLoad(() =>{
/* 确认按钮 */
.confirm-btn {
width: 100%;
position: fixed;
left: 40rpx;
right: 40rpx;
bottom: 20rpx;
bottom: calc(20rpx + constant(safe-area-inset-bottom));
bottom: calc(20rpx + env(safe-area-inset-bottom));
height: 88rpx;
line-height: 88rpx;
background-color: #2F77FD;
@@ -300,7 +305,7 @@ onLoad(() =>{
font-size: 28rpx;
border-radius: 20rpx;
border: none;
flex-shrink: 0;
z-index: 10;
}
.confirm-btn::after {
border: none; /* 去除uni-app默认按钮边框 */

View File

@@ -313,7 +313,7 @@ onUnload(() =>{
.repair-type-tabs {
display: flex;
/* background-color: #fff; */
padding: 10px;
padding: 10px 0;
}
.type-tab {
flex: 1;
@@ -321,7 +321,7 @@ onUnload(() =>{
flex-direction: column;
align-items: center;
justify-content: center;
height: 85px;
height: 90px;
border-radius: 8px;
color: #fff;
font-size: 14px;

View File

@@ -2,7 +2,7 @@
<view class="contentStyle">
<scroll-view class="page" scroll-y="true">
<view class="survey-title">{{ detailItem.title || '' }}</view>
<view class="survey-desc">
<view class="survey-desc" v-if="questionList.length > 0">
为了给您提供更好的服务希望您能抽出几分钟时间将最近的感受和建议告诉我们
我们十分重视每位用户的宝贵意见期待您的参与
</view>

View File

@@ -12,7 +12,7 @@
<!-- 问卷说明 -->
<!-- <view class="survey-desc">{{ detailItem.description || '' }}</view> -->
<view class="survey-desc">
<view class="survey-desc" v-if="questionList.length >0">
为了给您提供更好的服务希望您能抽出几分钟时间将最近的感受和建议告诉我们
我们十分重视每位用户的宝贵意见期待您的参与
</view>