Showing
3 changed files
with
9 additions
and
9 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-09-20 15:39:37 | 2 | * @Date: 2022-09-20 15:39:37 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2022-10-31 17:13:44 | 4 | + * @LastEditTime: 2022-10-31 18:37:02 |
| 5 | * @FilePath: /swx/src/components/activity-card.vue | 5 | * @FilePath: /swx/src/components/activity-card.vue |
| 6 | * @Description: 活动卡片组件 | 6 | * @Description: 活动卡片组件 |
| 7 | --> | 7 | --> |
| ... | @@ -86,13 +86,13 @@ const formatStatus = (item) => { | ... | @@ -86,13 +86,13 @@ const formatStatus = (item) => { |
| 86 | return '已结束'; | 86 | return '已结束'; |
| 87 | } else if (item?.status === 'disable') { | 87 | } else if (item?.status === 'disable') { |
| 88 | return '未发布'; | 88 | return '未发布'; |
| 89 | - } else if (moment(item.server_time).isBefore(moment(item.reg_begin_time))) { | 89 | + } else if (+new Date(item.server_time) > +new Date(item.reg_begin_time)) { |
| 90 | return '报名未开始'; | 90 | return '报名未开始'; |
| 91 | - } else if (moment(item.reg_begin_time).isBefore(moment(item.server_time)) && moment(item.server_time).isBefore(moment(item.reg_end_time))) { | 91 | + } else if (+new Date(item.reg_begin_time) > +new Date(item.server_time) && +new Date(item.server_time) > +new Date(item.reg_end_time)) { |
| 92 | return '报名中'; | 92 | return '报名中'; |
| 93 | - } else if (moment(item.reg_end_time).isBefore(moment(item.server_time)) && moment(item.server_time).isBefore(moment(item.activity_time))) { | 93 | + } else if (+new Date(item.reg_end_time) > +new Date(item.server_time) && +new Date(item.server_time) > +new Date(item.activity_time)) { |
| 94 | return '报名结束'; | 94 | return '报名结束'; |
| 95 | - } else if (moment(item.activity_time).isBefore(moment(item.server_time))) { | 95 | + } else if (+new Date(item.activity_time) > +new Date(item.server_time)) { |
| 96 | return '活动进行中'; | 96 | return '活动进行中'; |
| 97 | } | 97 | } |
| 98 | } | 98 | } | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-09-21 16:04:10 | 2 | * @Date: 2022-09-21 16:04:10 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2022-10-31 17:26:24 | 4 | + * @LastEditTime: 2022-10-31 18:42:52 |
| 5 | * @FilePath: /swx/src/pages/createActivity/index.vue | 5 | * @FilePath: /swx/src/pages/createActivity/index.vue |
| 6 | * @Description: 创建活动页面 | 6 | * @Description: 创建活动页面 |
| 7 | --> | 7 | --> |
| ... | @@ -693,11 +693,11 @@ const validForm = () => { // 校验表单 | ... | @@ -693,11 +693,11 @@ const validForm = () => { // 校验表单 |
| 693 | Toast('报名截止时间不能为空'); | 693 | Toast('报名截止时间不能为空'); |
| 694 | return false; | 694 | return false; |
| 695 | } | 695 | } |
| 696 | - if (!moment(reg_begin_time.value).isBefore(moment(reg_end_time.value))) { | 696 | + if (+new Date(reg_begin_time.value) > +new Date(reg_end_time.value)) { |
| 697 | Toast('报名开始时间不能晚于报名截止时间'); | 697 | Toast('报名开始时间不能晚于报名截止时间'); |
| 698 | return false; | 698 | return false; |
| 699 | } | 699 | } |
| 700 | - if (!moment(activity_time.value).isBetween(moment(reg_begin_time.value), moment(reg_end_time.value), null, '[]')) { | 700 | + if (+new Date(activity_time.value) < +new Date(reg_begin_time.value) || +new Date(activity_time.value) > (reg_end_time.value)) { |
| 701 | Toast('活动时间请在报名时间之间'); | 701 | Toast('活动时间请在报名时间之间'); |
| 702 | return false; | 702 | return false; |
| 703 | } | 703 | } | ... | ... |
| ... | @@ -159,7 +159,7 @@ export default { | ... | @@ -159,7 +159,7 @@ export default { |
| 159 | const info = await activityInfoAPI({ i: getCurrentPageParam().id }); | 159 | const info = await activityInfoAPI({ i: getCurrentPageParam().id }); |
| 160 | if (info.code) { | 160 | if (info.code) { |
| 161 | // 判断是否超过活动时间 | 161 | // 判断是否超过活动时间 |
| 162 | - if (moment(info.data.activity.activity_time).isBefore(moment(info.data.server_time))) { | 162 | + if (+new Date(info.data.activity.activity_time) > +new Date(info.data.server_time)) { |
| 163 | this.absent = true; | 163 | this.absent = true; |
| 164 | } | 164 | } |
| 165 | } | 165 | } | ... | ... |
-
Please register or login to post a comment