update:报名列表
This commit is contained in:
parent
9f5e6ddf32
commit
e668f2c593
@ -42,13 +42,12 @@ function normalizeBannerItem(raw) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function canCancelByEventStatus(rawEventStatus) {
|
function canCancelByEventStatus(rawEventStatus) {
|
||||||
return true;
|
|
||||||
// 仅报名中(Enrolling / 1)允许取消
|
// 仅报名中(Enrolling / 1)允许取消
|
||||||
// if (rawEventStatus === 'Enrolling') return true;
|
if (rawEventStatus === 'Enrolling') return true;
|
||||||
// const n = Number(rawEventStatus);
|
const n = Number(rawEventStatus);
|
||||||
// if (!Number.isNaN(n)) return n === 1;
|
if (!Number.isNaN(n)) return n === 1;
|
||||||
// const s = rawEventStatus == null ? '' : String(rawEventStatus).toLowerCase();
|
const s = rawEventStatus == null ? '' : String(rawEventStatus).toLowerCase();
|
||||||
// return s === 'enrolling' || s === '1';
|
return s === 'enrolling' || s === '1';
|
||||||
}
|
}
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
@ -214,6 +213,8 @@ Page({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onCancelRegistrationTap(e) {
|
onCancelRegistrationTap(e) {
|
||||||
|
const canCancel = e.currentTarget.dataset.cancancel;
|
||||||
|
if (!canCancel) return;
|
||||||
const registrationId = Number(e.currentTarget.dataset.registrationid);
|
const registrationId = Number(e.currentTarget.dataset.registrationid);
|
||||||
if (!registrationId) return;
|
if (!registrationId) return;
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
@ -224,6 +225,31 @@ Page({
|
|||||||
onUploadMaterialTap(e) {
|
onUploadMaterialTap(e) {
|
||||||
const registrationId = Number(e.currentTarget.dataset.registrationid);
|
const registrationId = Number(e.currentTarget.dataset.registrationid);
|
||||||
if (!registrationId) return;
|
if (!registrationId) return;
|
||||||
|
|
||||||
|
const now = Date.now();
|
||||||
|
console.log('时间', e.currentTarget.dataset.matstarttime, e.currentTarget.dataset.matendtime , now);
|
||||||
|
|
||||||
|
const matStartTime = e.currentTarget.dataset.matstarttime;
|
||||||
|
const matEndTime = e.currentTarget.dataset.matendtime;
|
||||||
|
const rangeText = e.currentTarget.dataset.materialrangetext || '';
|
||||||
|
|
||||||
|
if (matStartTime && now < Number(matStartTime)) {
|
||||||
|
wx.showToast({
|
||||||
|
title: `素材上传未开始,开始时间:${rangeText.split(' ~ ')[0] || rangeText}`,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2500
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (matEndTime && now > Number(matEndTime)) {
|
||||||
|
wx.showToast({
|
||||||
|
title: `素材上传已截止,截止时间:${rangeText.split(' ~ ')[1] || rangeText}`,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2500
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.openUploadPicker({ kind: 'material', registrationId });
|
this.openUploadPicker({ kind: 'material', registrationId });
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -458,6 +484,31 @@ Page({
|
|||||||
? item.status
|
? item.status
|
||||||
: item.Status;
|
: item.Status;
|
||||||
const eventStatusPill = eventStatusForPill(rawEventStatus);
|
const eventStatusPill = eventStatusForPill(rawEventStatus);
|
||||||
|
const matStart =
|
||||||
|
item.materialUploadStartTime ||
|
||||||
|
item.MaterialUploadStartTime ||
|
||||||
|
item.uploadMaterialStartTime ||
|
||||||
|
item.UploadMaterialStartTime;
|
||||||
|
const matEnd =
|
||||||
|
item.materialUploadEndTime ||
|
||||||
|
item.MaterialUploadEndTime ||
|
||||||
|
item.uploadMaterialEndTime ||
|
||||||
|
item.UploadMaterialEndTime;
|
||||||
|
const matDeadlineText =
|
||||||
|
item.materialUploadDeadlineText || item.MaterialUploadDeadlineText || '';
|
||||||
|
const matStartFmt = formatDateTime(matStart);
|
||||||
|
const matEndFmt = formatDateTime(matEnd);
|
||||||
|
let materialRangeText = matDeadlineText;
|
||||||
|
if (!materialRangeText) {
|
||||||
|
if (matStartFmt && matStartFmt !== '-' && matEndFmt && matEndFmt !== '-') {
|
||||||
|
materialRangeText = `${matStartFmt} ~ ${matEndFmt}`;
|
||||||
|
} else if (matStartFmt && matStartFmt !== '-') {
|
||||||
|
materialRangeText = matStartFmt;
|
||||||
|
} else if (matEndFmt && matEndFmt !== '-') {
|
||||||
|
materialRangeText = matEndFmt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: eid,
|
id: eid,
|
||||||
rowKey: `m-${rid}`,
|
rowKey: `m-${rid}`,
|
||||||
@ -466,6 +517,9 @@ Page({
|
|||||||
coverImage: item.coverImage,
|
coverImage: item.coverImage,
|
||||||
address: '',
|
address: '',
|
||||||
isNeedMaterial: !!item.isNeedMaterial,
|
isNeedMaterial: !!item.isNeedMaterial,
|
||||||
|
materialRangeText,
|
||||||
|
matStartTime: matStart ? new Date(matStart).getTime() : null,
|
||||||
|
matEndTime: matEnd ? new Date(matEnd).getTime() : null,
|
||||||
eventStatusPill,
|
eventStatusPill,
|
||||||
eventStatusText: eventStatusText(rawEventStatus) || '已报名',
|
eventStatusText: eventStatusText(rawEventStatus) || '已报名',
|
||||||
registrationTimeText: formatDateTime(item.registrationTime),
|
registrationTimeText: formatDateTime(item.registrationTime),
|
||||||
|
|||||||
@ -90,10 +90,13 @@
|
|||||||
<view class="meta-line" wx:if="{{item.projectCount != null}}">
|
<view class="meta-line" wx:if="{{item.projectCount != null}}">
|
||||||
已报项目:{{item.projectCount}} 项
|
已报项目:{{item.projectCount}} 项
|
||||||
</view>
|
</view>
|
||||||
|
<view class="meta-line" wx:if="{{item.isNeedMaterial && item.materialRangeText}}">
|
||||||
|
素材上传时间:{{item.materialRangeText}}
|
||||||
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
<view class="card-actions" wx:if="{{sectionTab === 'registered'}}" catchtap>
|
<view class="card-actions" wx:if="{{sectionTab === 'registered'}}" catchtap>
|
||||||
<view wx:if="{{item.isNeedMaterial}}" class="action-btn action-btn--ghost" catchtap="onUploadMaterialTap" data-registrationid="{{item.registrationId}}">
|
<view wx:if="{{item.isNeedMaterial}}" class="action-btn action-btn--ghost" catchtap="onUploadMaterialTap" data-registrationid="{{item.registrationId}}" data-matstarttime="{{item.matStartTime}}" data-matendtime="{{item.matEndTime}}" data-materialrangetext="{{item.materialRangeText}}">
|
||||||
上传素材
|
上传素材
|
||||||
</view>
|
</view>
|
||||||
<block wx:if="{{item.paymentStatus === 1}}">
|
<block wx:if="{{item.paymentStatus === 1}}">
|
||||||
@ -105,7 +108,12 @@
|
|||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<!-- <view class="action-btn action-btn--ghost" catchtap>更改参赛人</view> -->
|
<!-- <view class="action-btn action-btn--ghost" catchtap>更改参赛人</view> -->
|
||||||
<view class="action-btn action-btn--danger" wx:if="{{item.canCancel}}" catchtap="onCancelRegistrationTap" data-registrationid="{{item.registrationId}}">
|
<view
|
||||||
|
class="action-btn {{item.canCancel ? 'action-btn--danger' : 'action-btn--disabled'}}"
|
||||||
|
catchtap="onCancelRegistrationTap"
|
||||||
|
data-registrationid="{{item.registrationId}}"
|
||||||
|
data-cancancel="{{item.canCancel}}"
|
||||||
|
>
|
||||||
取消报名
|
取消报名
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@ -326,6 +326,12 @@ page {
|
|||||||
background: #fff;
|
background: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.action-btn--disabled {
|
||||||
|
border-color: #c8c9cc;
|
||||||
|
color: #c8c9cc;
|
||||||
|
background: #f7f8fa;
|
||||||
|
}
|
||||||
|
|
||||||
.action-btn--paid {
|
.action-btn--paid {
|
||||||
border-color: #00b56d;
|
border-color: #00b56d;
|
||||||
background: rgba(0, 181, 109, 0.12);
|
background: rgba(0, 181, 109, 0.12);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user