Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
swx_weapp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2022-11-03 18:10:04 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0068b94afb09742d65a71bdcdf22c10a35c7d89b
0068b94a
1 parent
4af90184
🐞 fix: 时间比对兼容性问题处理
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
16 deletions
src/components/activity-card.vue
src/pages/activityDetail/index.vue
src/pages/createActivity/index.vue
src/pages/myCreateActivity/index.vue
src/components/activity-card.vue
View file @
0068b94
<!--
* @Date: 2022-09-20 15:39:37
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-11-03 1
6:17:22
* @LastEditTime: 2022-11-03 1
8:05:26
* @FilePath: /swx/src/components/activity-card.vue
* @Description: 活动卡片组件
-->
...
...
@@ -82,13 +82,13 @@ const formatStatus = (item) => {
return '已结束';
} else if (item?.status === 'disable') {
return '未发布';
} else if (
+new Date(item.server_time) < +new Date(item.reg_begin_time)
) {
} else if (
item?.server_time < item?.reg_begin_time
) {
return '报名未开始';
} else if (
+new Date(item.server_time) > +new Date(item.reg_begin_time) && +new Date(item.server_time) < +new Date(item.reg_end_time)
) {
} else if (
item?.server_time > item?.reg_begin_time && item?.server_time < item?.reg_end_time
) {
return '报名中';
} else if (
+new Date(item.server_time) > +new Date(item.reg_end_time)
) {
} else if (
item?.server_time > item?.reg_end_time
) {
return '报名结束';
} else if (
+new Date(item.activity_time) < +new Date(item.server_time)
) {
} else if (
item?.activity_time < item?.server_time1
) {
return '活动进行中';
}
}
...
...
src/pages/activityDetail/index.vue
View file @
0068b94
<!--
* @Date: 2022-09-26 14:36:57
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-11-03 1
6:27:17
* @LastEditTime: 2022-11-03 1
8:06:24
* @FilePath: /swx/src/pages/activityDetail/index.vue
* @Description: 活动详情页
-->
...
...
@@ -625,7 +625,7 @@ export default {
if (this.activity.reg_max && (this.activity.reg_count === this.activity.reg_max)) {
Toast('活动人员已满');
return false;
} else if (
+new Date(this.server_time) > +new Date(this.activity.reg_end_time)
) {
} else if (
this.server_time > this.activity.reg_end_time
) {
Toast('报名已结束');
return false;
} else if (type === 'join') {
...
...
src/pages/createActivity/index.vue
View file @
0068b94
<!--
* @Date: 2022-09-21 16:04:10
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-11-03 1
5:47:2
8
* @LastEditTime: 2022-11-03 1
8:07:0
8
* @FilePath: /swx/src/pages/createActivity/index.vue
* @Description: 创建活动页面
-->
...
...
@@ -722,11 +722,11 @@ const validForm = () => { // 校验表单
Toast('报名截止时间不能为空');
return false;
}
if (
+new Date(reg_begin_time.value) > +new Date(reg_end_time.value)
) {
if (
reg_begin_time.value > reg_end_time.value
) {
Toast('报名开始时间不能晚于报名截止时间');
return false;
}
if (
+new Date(activity_time.value) < +new Date(reg_begin_time.value) || +new Date(activity_time.value) > (reg_end_time.value)
) {
if (
activity_time.value < reg_begin_time.value || activity_time.value > reg_end_time.value
) {
Toast('活动时间请在报名时间之间');
return false;
}
...
...
src/pages/myCreateActivity/index.vue
View file @
0068b94
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-11-03 1
5:35:34
* @LastEditTime: 2022-11-03 1
8:07:49
* @FilePath: /swx/src/pages/myCreateActivity/index.vue
* @Description: 创建的活动页面
-->
...
...
@@ -228,14 +228,14 @@ export default {
}
const { code, data } = await addListAPI(params);
if (code) {
this.server_time = formatDate(data.server_time);
data.activity_list.forEach(item => {
item.server_time = formatDate(data.server_time);
});
this.activity_list = data.activity_list;
this.activity_count = data.activity_count ? data.activity_count : 0;
this.volunteer_count = data.volunteer_count ? data.volunteer_count : 0;
this.player_count = data.player_count ? data.player_count : 0;
this.server_time = formatDate(data.server_time);
this.activity_list.forEach(item => {
item.server_time = this.server_time
});
this.page = this.page + 1;
}
},
...
...
@@ -492,7 +492,7 @@ export default {
this.currentEndDate = new Date().getTime();
},
confirmTime () { // 确认时间区间
if (
+new Date(this.filter_begin_time) > +new Date(this.filter_end_time)
) {
if (
this.filter_begin_time > this.filter_end_time
) {
Toast('开始时间不能大于结束时间')
} else {
this.show_time_popup = false;
...
...
Please
register
or
login
to post a comment