hookehuyr

🐞 fix: 活动时间创建时,需要落在报名时间之间

<!--
* @Date: 2022-09-21 16:04:10
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-21 17:53:26
* @LastEditTime: 2022-10-25 14:31:54
* @FilePath: /swx/src/pages/createActivity/index.vue
* @Description: 创建活动页面
-->
......@@ -277,6 +277,8 @@ import Toast from '@/components/vant-weapp/toast/toast';
import { randomId } from '@/utils/tools'
import * as dayjs from 'dayjs'
import { activityInfoAPI } from '@/api/Host/index';
var isBetween = require('dayjs/plugin/isBetween')
dayjs.extend(isBetween);
const activity_name = ref('');
const onChange = ({ detail }) => {
......@@ -695,6 +697,10 @@ const validForm = () => { // 校验表单
Toast('报名开始时间不能晚于报名截止时间');
return false;
}
if (!dayjs(activity_time.value).isBetween(dayjs(reg_begin_time.value), dayjs(reg_end_time.value), null, '[]')) {
Toast('活动时间请在报名时间之间');
return false;
}
if (reg_max.value === '') {
Toast('报名人数不能为空');
return false;
......