修改活动报名显示问题,升级版本bug,支付正在开发
This commit is contained in:
@@ -150,9 +150,9 @@
|
||||
|
||||
<!-- 底部操作栏 -->
|
||||
<view class="bottom-bar">
|
||||
<!-- 活动已结束且未报名,显示不可点击的结束按钮 -->
|
||||
<!-- 活动已结束,显示不可点击的结束按钮 -->
|
||||
<button
|
||||
v-if="isActivityEnded && !hasSigned && activeTab === 'detail'"
|
||||
v-if="isActivityEnded && activeTab === 'detail'"
|
||||
class="action-btn ended-btn"
|
||||
disabled
|
||||
>
|
||||
@@ -168,9 +168,9 @@
|
||||
报名
|
||||
</button>
|
||||
|
||||
<!-- 已报名状态显示取消报名按钮 -->
|
||||
<!-- 已报名状态显示取消报名按钮(活动已结束则隐藏) -->
|
||||
<button
|
||||
v-if="hasSigned && activeTab === 'detail'"
|
||||
v-if="hasSigned && !isActivityEnded && activeTab === 'detail'"
|
||||
class="action-btn cancel-btn"
|
||||
@tap="handleCancelSignup"
|
||||
>
|
||||
@@ -178,7 +178,7 @@
|
||||
</button>
|
||||
|
||||
<!-- 活动实况页显示添加实况按钮 -->
|
||||
<button class="action-btn add-status-btn" v-if="hasSigned &&activeTab === 'status'" @click="liveClick">添加实况</button>
|
||||
<button class="action-btn add-status-btn" v-if="hasSigned && !isActivityEnded && activeTab === 'status'" @click="liveClick">添加实况</button>
|
||||
</view>
|
||||
|
||||
<!-- 报名确认模态框 -->
|
||||
@@ -235,33 +235,23 @@ const newStatusContent = ref('')
|
||||
const navTitle = ref('')
|
||||
const curActivityId = ref('') // 当前活动的id
|
||||
const activityConent = ref({}) // 获取详情数据
|
||||
// 实况记录数据
|
||||
const liveRecords = ref([])
|
||||
|
||||
// 判断活动是否已结束
|
||||
const isActivityEnded = computed(() => {
|
||||
// 优先使用后端返回的状态字段(status: '2' 或 statusText: '已结束')
|
||||
if (activityConent.value.status === '2' || activityConent.value.statusText === '已结束') return true
|
||||
// 备选:通过 endTime 时间判断
|
||||
if (!activityConent.value.applyDeadline) return false
|
||||
return moment().isAfter(moment(activityConent.value.applyDeadline))
|
||||
// 优先使用列表页传入的statusText
|
||||
if (statusTextFromParam.value === '已结束') return true
|
||||
// 其次使用后端详情接口返回的状态字段
|
||||
// if (activityConent.value.statusText === '已结束') return true
|
||||
// 报名截止时间已过
|
||||
if (activityConent.value.applyDeadline && moment().isAfter(moment(activityConent.value.applyDeadline))) return true
|
||||
// 活动结束时间已过
|
||||
if (activityConent.value.endTime && moment().isAfter(moment(activityConent.value.endTime))) return true
|
||||
return false
|
||||
})
|
||||
|
||||
// 实况记录数据
|
||||
const liveRecords = ref([
|
||||
// {
|
||||
// id: 1,
|
||||
// user: '微信用户',
|
||||
// time: '2023-08-20 16:00:02',
|
||||
// content: '参与活动打卡',
|
||||
// images: []
|
||||
// },
|
||||
// {
|
||||
// id: 2,
|
||||
// user: '微信用户',
|
||||
// time: '2023-08-20 16:20:02',
|
||||
// content: '目前现场的互动氛围很好',
|
||||
// images: ['http://47.104.199.163:9090/images/logo.png', 'http://47.104.199.163:9090/images/repair/house1.png']
|
||||
// }
|
||||
])
|
||||
|
||||
|
||||
|
||||
// ========方法=====
|
||||
@@ -272,11 +262,13 @@ const formatTime = (timeStr) => {
|
||||
}
|
||||
|
||||
// ---接收参数---
|
||||
const statusTextFromParam = ref('') // 从列表页传入的活动状态文本
|
||||
onLoad((option) =>{
|
||||
navTitle.value = option?.title
|
||||
curActivityId.value = option?.id
|
||||
// 处理applied参数(可能是字符串类型,需要转布尔)
|
||||
hasSigned.value = option?.applied === 'true' || option?.applied === true
|
||||
statusTextFromParam.value = option?.statusText || ''
|
||||
// 处理applied参数
|
||||
hasSigned.value = option?.applied === true
|
||||
// console.log('hasSigned.value',hasSigned.value)
|
||||
// 2. 初始化数据
|
||||
if (curActivityId.value) {
|
||||
|
||||
Reference in New Issue
Block a user