This commit is contained in:
@jyuhsin
2025-09-16 19:34:40 +08:00
parent 20fe55813f
commit 372373a26e
45 changed files with 2637 additions and 2375 deletions
@@ -1,14 +1,19 @@
package com.budwk.app.zhgh.activity.family.controller.manage;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.sys.models.Sys_dict;
import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.sys.services.SysDictService;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.activity.basic.models.ActivityUserScope;
import com.budwk.app.zhgh.activity.family.models.*;
import com.budwk.app.zhgh.activity.family.service.FamilyActivityService;
import com.budwk.app.zhgh.activity.family.service.FamilyActivityStatisticsService;
@@ -16,6 +21,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.Static;
@@ -28,39 +34,56 @@ import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.*;
import java.util.concurrent.locks.ReentrantLock;
import java.util.stream.Collectors;
@Slf4j
@IocBean
@Ok("json:full")
@Api(tags = "活动报名")
@At("/platform/family/manage/apply")
@At("/platform/family/apply")
public class FamilyActivityApplyController {
private final ReentrantLock lock = new ReentrantLock(true);
@Inject
private FamilyActivityService familyActivityService;
@Inject
private SysDictService dictService;
@Inject
private FamilyActivityStatisticsService statisticsService;
@Inject
private Dao dao;
@At("")
@SaCheckPermission("family.manage.apply")
@At("/")
@SaCheckPermission("family.apply")
@Ok("beetl:/platform/zhgh/activity/family/apply/index.html")
public void index() {
}
@At("/h5")
@SaCheckPermission("h5.family.apply")
@Ok("beetl:/platform/zhghh5/activity/family/apply/index.html")
public void h5Index() {
}
@At("/list/h5")
@SaCheckPermission("h5.family.apply")
@Ok("beetl:/platform/zhghh5/activity/family/list/index.html")
public void listIndex() {
}
@At
@ApiOperation("活动查询")
@SaCheckPermission("family.manage.apply")
public Result activityData(PageForm pageForm,
@Param(value = "year") Integer year,
@Param(value = "activityType") Integer activityType) {
@SaCheckPermission(value = {"family.apply", "h5.family.apply"}, mode = SaMode.OR)
public Result activityPageData(PageForm pageForm,
@Param(value = "year") Integer year,
@Param(value = "activityType") Integer activityType,
@Param(value = "id") String id,
@Param(value = "dataType") String dataType) {
Cnd cnd = Cnd.NEW();
cnd.andEX("id", "=", id);
cnd.andEX("`year`", "=", year);
//查询报名中
if (activityType == 2) {
@@ -68,12 +91,18 @@ public class FamilyActivityApplyController {
}//查询已结束的
else if (activityType == 3) {
cnd.and(new Static("now() > activityEndTime"));
} else if (activityType == 4) {
cnd.and(new Static("now() < activitySignUpStartTime"));
}
if (AuthUtil.hasRole("H04") && !AuthUtil.hasRoleOr("sysadmin, A06")) {
cnd.and("activityMode", "=", 2).and("createdBy", "=", SecurityUtil.getUserId());
}
if("mine".equals(dataType)) {
cnd.and(new Static("id in (select activityId from family_user where userId = '%s')".formatted(SecurityUtil.getUserId())));
}
Pagination pagination = familyActivityService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
List<FamilyActivity> familyActivities = pagination.getList();
Map<String, String> familyTypeMap = dictService.getSubListByCode("FAMILY_SIGNUP_TYPE").stream().collect(Collectors.toMap(Sys_dict::getCode, Sys_dict::getName));
@@ -83,33 +112,16 @@ public class FamilyActivityApplyController {
@At
@ApiOperation("分活动查询")
@SaCheckPermission("family.manage.apply")
@SaCheckPermission(value = {"family.apply", "h5.family.apply"}, mode = SaMode.OR)
public Result pageData(PageForm pageForm,
@Param(value = "courseTypeId") String courseTypeId,
@Param(value = "activityId") String activityId,
@Param(value = "assortTypes") String[] assortTypes) {
@Param(value = "assortTypes") String[] assortTypes,
@Param(value = "dataType") String dataType) {
Sql sql = Sqls.create("""
SELECT
tsuc.id,
tsuc.activityId,
tsuc.courseName,
tsuc.coursePeopleNumber,
tsuc.courseLocation,
tsuc.courseType,
tsuc.courseLocationCoordinates,
tsuc.courseReservedNumber,
tsuc.courseInstructor,
tsuc.campus,
tsuc.unionLimit,
tsuc.isMobileSign,
tsuc.signType,
tsuc.isReceiveGift,
tsuc.giftType,
tsuc.reserveMode,
tsuc.waitingNum,
tsuc.assort,
type.typeName,
tsuc.courseIsLimitApply
tsuc.*,
type.typeName
FROM
`family_course` tsuc
LEFT JOIN family_type type ON type.id = tsuc.courseType
@@ -122,6 +134,10 @@ public class FamilyActivityApplyController {
cnd.and("tsuc.assort", "in", assortTypes);
}
if("mine".equals(dataType)) {
cnd.and(new Static("tsuc.id in (select courseId from family_user where userId = '%s')".formatted(SecurityUtil.getUserId())));
}
List<FamilyCourse> courseArray = familyActivityService.dao().query(FamilyCourse.class, Cnd.where("activityId", "=", activityId));
courseArray = familyActivityService.filterCourseByHostUnion(courseArray);
cnd.and("tsuc.id", "in", courseArray.stream().map(FamilyCourse::getId).toList());
@@ -134,6 +150,9 @@ public class FamilyActivityApplyController {
List<NutMap> courseList = pagination.getList();
courseList.forEach(c -> {
List<FamilyActivityCourse> courseTimes = dao.query(FamilyActivityCourse.class, Cnd.where("courseId", "=", c.getString("id")).asc("courseDate"));
c.put("courseTimes", courseTimes);
c.put("hasRegisterNum", statisticsService.queryCourseCount(c.getString("id"), c.getString("courseType")));
c.put("hasWaitingNum", statisticsService.queryCourseWaitCount(c.getString("id"), c.getString("courseType")));
//当前用户是否报过
@@ -154,7 +173,7 @@ public class FamilyActivityApplyController {
@At
@ApiOperation("获取分活动时间")
@SaCheckPermission("family.manage.apply")
@SaCheckPermission(value = {"family.apply", "h5.family.apply"}, mode = SaMode.OR)
public Result getCourseTime(String id) {
List<FamilyActivityCourse> list = familyActivityService.dao().query(FamilyActivityCourse.class, Cnd.where("courseId", "=", id));
return Result.success(list);
@@ -162,7 +181,7 @@ public class FamilyActivityApplyController {
@At
@ApiOperation("查询分类标识集合")
@SaCheckPermission("family.manage.apply")
@SaCheckPermission(value = {"family.apply", "h5.family.apply"}, mode = SaMode.OR)
public Result queryCourseAssort(String activityId) {
List<FamilyCourse> courseList = familyActivityService.dao().query(
FamilyCourse.class,
@@ -175,4 +194,219 @@ public class FamilyActivityApplyController {
return Result.success(assortList);
}
@At
@ApiOperation("验证是否能报名")
@SaCheckPermission(value = {"family.apply", "h5.family.apply"}, mode = SaMode.OR)
public Result validateSignUp(String courseId,
@Param(value = "currentFamilyNumber") Integer currentFamilyNumber) {
try {
lock.lock();
if(StrUtil.isBlank(courseId)) {
return Result.error(99, "报名信息为空");
}
currentFamilyNumber = currentFamilyNumber != null ? currentFamilyNumber : 0;
FamilyCourse course = dao.fetch(FamilyCourse.class, courseId);
FamilyActivity activity = dao.fetch(FamilyActivity.class, course.getActivityId());
//判断时间
if(DateUtil.compare(new Date(), activity.getActivitySignUpStartTime(), "yyyy-MM-dd HH:mm:ss") < 0) {
return Result.error(99,"报名未开始");
}
if(DateUtil.compare(new Date(), activity.getActivitySignUpEndTime(), "yyyy-MM-dd HH:mm:ss") > 0) {
return Result.error(99,"报名已结束");
}
//判断活动组别
int count = dao.count(ActivityUserScope.class, Cnd.where("groupId", "=", activity.getActivityGroupId()).and("userId", "=", SecurityUtil.getUserId()));
if(count == 0) {
return Result.error(99,"抱歉,您没有此次活动的权限");
}
//判断是否报名
boolean courseByUser = familyActivityService.isSignCourseByUser(courseId, SecurityUtil.getUserId());
if(courseByUser) {
return Result.error(99,"抱歉,您已经报名");
}
//判断活动人数
boolean signFull = familyActivityService.isSignFull(course, currentFamilyNumber);
if(signFull) {
return Result.error(99,"啊哦,目前报名人数已达上限。您可保持关注,如有老师取消之前的报名从而释放出名额,您可再来试试。谢谢!");
}
//判断活动限制
boolean signCourse = familyActivityService.isSignCourse(course, activity);
if(!signCourse) {
if(activity.getRestrictLimit() != 3) {
return Result.error(99,"您选择的类型已达上限,不能再报该类型的了");
} else {
return Result.error(99,activity.getActivityName() + "限制报" + activity.getLimitNum() + "个活动,已达上限");
}
}
//判断分工会人数限制
boolean signFullByUnionId = familyActivityService.isSignFullByUnionId(course, currentFamilyNumber);
if(signFullByUnionId) {
return Result.error(99,"您所在的分工会名额不足");
}
return Result.success();
}catch (Exception e) {
e.printStackTrace();
return Result.error(99,"报名失败");
} finally {
lock.unlock();
}
}
@At
@ApiOperation("查询子活动时间段")
@SaCheckPermission(value = {"family.apply", "h5.family.apply"}, mode = SaMode.OR)
public Object getCourseTimeSelectList(String courseId) {
// 查课程的时间段
List<FamilyActivityCourse> courseList = dao.query(FamilyActivityCourse.class, Cnd.where("courseId", "=", courseId).asc("courseStartTime"));
// 查课程的报名人数
List<FamilyUserCourse> applyUserList = dao.query(FamilyUserCourse.class, Cnd.where("courseId", "=", courseId));
List<FamilyUser> userList = dao.query(FamilyUser.class, Cnd.where("courseId", "=", courseId).and("state", "=", 1));
List<String> idList = userList.stream().map(FamilyUser::getUserId).toList();
applyUserList = applyUserList.stream().filter(o -> idList.contains(o.getUserId())).toList();
// 按照课程下面时间段去分组
Map<String, List<FamilyUserCourse>> collectMap = applyUserList.stream().collect(Collectors.groupingBy(FamilyUserCourse::getActivityCourseId));
List<NutMap> list = courseList.stream().map(v -> {
String id = v.getId();
NutMap nutMap = NutMap.NEW();
List<FamilyUserCourse> familyUserCourses = collectMap.get(id);
int remainingNum = v.getCourseLimitNum() != null ? v.getCourseLimitNum() : 0;
if (Lang.isNotEmpty(familyUserCourses)) {
remainingNum = v.getCourseLimitNum() - familyUserCourses.size();
}
nutMap.put("remainingNum", remainingNum);
nutMap.put("text", DateUtil.format(v.getCourseStartTime(), "HH:mm") + "" + DateUtil.format(v.getCourseEndTime(), "HH:mm") + "段(剩" + remainingNum + ")");
nutMap.put("value", id);
nutMap.put("disabled", remainingNum == 0);
return nutMap;
}).filter(v -> v.getInt("remainingNum") != 0).toList();
return Result.success(list);
}
@At
@ApiOperation("验证子活动是否能报名")
@SaCheckPermission(value = {"family.apply", "h5.family.apply"}, mode = SaMode.OR)
public Object validateSourceSignUp(String activityCourseId, String courseId) {
try {
lock.lock();
List<FamilyUser> userList = dao.query(FamilyUser.class, Cnd.where("courseId", "=", courseId).and("state", "=", 1));
List<String> isList = userList.stream().map(FamilyUser::getUserId).toList();
// 该时间段下已报名的人数
int count = dao.count(FamilyUserCourse.class, Cnd.where("activityCourseId", "=", activityCourseId)
.and("courseId", "=", courseId).and("userId", "in", isList));
// 获取改时间段下的活动课程限制报名人数
FamilyActivityCourse course = dao.fetch(FamilyActivityCourse.class, activityCourseId);
Integer courseLimitNum = course.getCourseLimitNum();
// 报名加上自己,如果大于了限制人数,那就无法报名
if (count + 1 > courseLimitNum) {
return Result.error(99,"该时间段名额已报满,请选择其他时段报名");
} else {
return Result.success();
}
} catch (Exception e) {
e.printStackTrace();
return Result.error(99,"报名失败");
} finally {
lock.unlock();
}
}
@At
@ApiOperation("活动报名")
@SaCheckPermission(value = {"family.apply", "h5.family.apply"}, mode = SaMode.OR)
@SLog(tag = "亲子活动-活动报名", msg = "活动报名")
public Result doSignUp(FamilyUser familyUser) {
try {
lock.lock();
boolean courseByUser = familyActivityService.isSignCourseByUser(familyUser.getCourseId(), SecurityUtil.getUserId());
if(courseByUser) {
return Result.error(99,"您已报过该活动");
}
FamilyActivity activity = familyActivityService.fetch(familyUser.getActivityId());
boolean validFamilyCount = familyActivityService.validFamilyCount(familyUser);
if(validFamilyCount) {
return Result.error(99,activity.getKeyWord() + "人数最多为" + activity.getFamilyMaxCount());
}
//判断人数
int number = 0;
FamilyCourse course = familyActivityService.dao().fetch(FamilyCourse.class, familyUser.getCourseId());
FamilyType type = familyActivityService.dao().fetch(FamilyType.class, course.getCourseType());
if(type != null) {
if(type.getIsBringFamily() && type.getIsAddFamily()) {
List<List<NutMap>> mobileColumnsValue = familyUser.getMobileColumnsValue();
number = Lang.isNotEmpty(mobileColumnsValue) ? mobileColumnsValue.size() : 0;
}
}
boolean signFull = familyActivityService.isSignFull(course, number);
if(signFull) {
return Result.error(99,"当前报名人数已满");
}
boolean signFullByUnionId = familyActivityService.isSignFullByUnionId(course, number);
if(signFullByUnionId) {
return Result.error(99,"该活动您所在的分工会名额不足");
}
familyActivityService.doSignUp(familyUser);
return Result.success("祝贺您!您已报名成功!请留意各分场活动的准确时间、地点,提前10-15分钟到达活动现场做好准备。如您因故不能参加活动,还请及时登录系统取消报名,以便将机会留给其他有需要的教职工。谢谢!");
} catch (Exception e) {
e.printStackTrace();
return Result.error("报名失败");
} finally {
lock.unlock();
}
}
@At
@ApiOperation("取消报名")
@SaCheckPermission(value = {"family.apply", "h5.family.apply"}, mode = SaMode.OR)
@SLog(tag = "亲子活动-活动报名", msg = "取消报名")
public Result cancelSignUp(@Param("activityId") String activityId, @Param("courseId") String courseId) {
String userId = SecurityUtil.getUserId();
//取消分两种情况
//第一种没有设置分工会人数限制,那么将候补的人按时间倒叙往上补
//第二种如果设置了分工会人数限制,那么只将本分工会的候补人员按照时间倒叙往上补,如果本分工会没有候补人员,则名额空出来,由校工会手动调整
FamilyCourse course = dao.fetch(FamilyCourse.class, courseId);
FamilyType type = dao.fetch(FamilyType.class, course.getCourseType());
//如果是正常报名取消了,将候补报名的按时间倒叙第一个改为正常报名
Cnd cnd = Cnd.where("activityId", "=", activityId).and("courseId", "=", courseId)
.and("state", "=", 2);
//如果设置了分工会报名人数限制,则只查本分工会
if (Lang.isNotEmpty(course.getUnionLimit())) {
cnd.and(new Static(" userId in (select id from user where unionid = '%s')".formatted(SecurityUtil.getUnionId())));
}
cnd.asc("signUpTime");
if (!type.getIsBringFamily() && course.getReserveMode() == 2) {
List<FamilyUser> signUpUsers = dao.query(FamilyUser.class, cnd);
int thisSignUpUserCount = dao.count(FamilyUser.class,
Cnd.where("activityId", "=", activityId)
.and("courseId", "=", courseId).and("userId", "=", userId)
.and("state", "in", List.of(1, 3)));
if (!signUpUsers.isEmpty() && thisSignUpUserCount > 0) {
FamilyUser familyUser = signUpUsers.get(0);
familyUser.setState(1);
dao.update(familyUser);
Sys_user user = dao.fetch(Sys_user.class, familyUser.getUserId());
//msgApi.sendTextMsg("【" + activity.getActivityName() + "】已候补成功,请按时参加活动!", user.getLoginname());
}
}
//删除报名记录
dao.clear("family_user_course", Cnd.where("activityId", "=", activityId)
.and("courseId", "=", courseId).and("userId", "=", userId));
dao.clear("family_user", Cnd.where("activityId", "=", activityId)
.and("courseId", "=", courseId).and("userId", "=", userId));
return Result.success();
}
}
@@ -99,7 +99,7 @@ public class FamilyActivityController {
@At
@ApiOperation("查询单个活动")
@SaCheckPermission("family.manage")
@SaCheckPermission("family")
public Result findOne(@Param("id") @NotNull String id) {
NutMap dataMap = familyActivityManageService.findOne(id, null, "");
String activityStartTime = dataMap.getString("activityStartTime");
@@ -36,7 +36,7 @@ import java.util.List;
@IocBean
@Ok("json:full")
@Api(tags = "亲子活动人员调整")
@At("/platform/family/manage/userAdjust")
@At("/platform/family/userAdjust")
public class FamilyAdjustController {
@Inject
@@ -49,7 +49,7 @@ public class FamilyAdjustController {
private FamilyActivityStatisticsService familyActivityStatisticsService;
@At("")
@SaCheckPermission("family.manage.activity.adjust")
@SaCheckPermission("family.adjust")
@Ok("beetl:/platform/zhgh/activity/family/userAdjust/index.html")
public void index() {
}
@@ -61,7 +61,7 @@ public class FamilyAdjustController {
*/
@At
@ApiOperation("活动列表")
@SaCheckPermission("family.manage.activity.adjust")
@SaCheckPermission("family.adjust")
public Result activityList(@Param(value = "year") Integer year) {
List<FamilyActivity> activityList = dao.query(FamilyActivity.class, Cnd.NEW().andEX("year", "=", year).andEX("isDisabled", "=", false).desc("activityStartTime"));
return Result.success(activityList);
@@ -69,7 +69,7 @@ public class FamilyAdjustController {
@At
@ApiOperation("分页查询")
@SaCheckPermission("family.manage.activity.adjust")
@SaCheckPermission("family.adjust")
public Result pageData(PageForm pageForm,
@Param(value = "activityId") String activityId) {
Pagination pagination = familyActivityStatisticsService.pageData(pageForm, activityId);
@@ -78,7 +78,7 @@ public class FamilyAdjustController {
@At
@ApiOperation("子活动查询")
@SaCheckPermission("family.manage.activity.adjust")
@SaCheckPermission("family.adjust")
public Result getCourse(String activityId) {
Sql sql = Sqls.create("""
SELECT
@@ -108,7 +108,7 @@ public class FamilyAdjustController {
@At
@ApiOperation("报名用户列表")
@SaCheckPermission("family.manage.activity.adjust")
@SaCheckPermission("family.adjust")
public Result registerUserList(@Param("courseId") String courseId,
@Param(value = "unionId") String unionId,
@Param(value = "unitId") String unitId,
@@ -120,7 +120,7 @@ public class FamilyAdjustController {
@At
@ApiOperation("人员调整")
@SaCheckPermission("family.manage.activity.adjust")
@SaCheckPermission("family.adjust")
@SLog(tag = "亲子活动-人员调整", msg = "人员调整")
public Result adjust(String activityId, String oldCourseId, String newCourseId, String userId) {
@@ -159,7 +159,7 @@ public class FamilyAdjustController {
@At
@ApiOperation("删除报名人员")
@SaCheckPermission("family.manage.activity.adjust")
@SaCheckPermission("family.adjust")
@SLog(tag = "亲子活动-人员调整", msg = "删除报名人员")
public Result deleteSignUser(String activityId, String courseId, String userId) {
@@ -0,0 +1,165 @@
package com.budwk.app.zhgh.activity.family.controller.manage;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.result.Result;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.activity.family.models.FamilyUserCourse;
import com.budwk.app.zhgh.activity.family.service.FamilyActivityService;
import com.budwk.app.zhgh.activity.trainSignUp.models.TrainSignUpUserCourse;
import com.budwk.app.zhgh.activity.trainSignUp.service.TrainSignUpActivityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import java.util.Date;
import java.util.List;
/**
* @ClassName FamilyMineController
* @Author JyuHsin
* @Date 2025/9/13 16:56
* @Version 1.0
* @Description TODO
*/
@Slf4j
@IocBean
@Ok("json:full")
@Api(tags = "活动报名")
@At("/platform/family/mine")
public class FamilyMineController {
@Inject
private Dao dao;
@Inject
private FamilyActivityService activityService;
@At("/")
@SaCheckPermission("family.mine")
@Ok("beetl:/platform/zhgh/activity/family/mine/index.html")
public void index() {
}
@At("/h5")
@SaCheckPermission("h5.family.mine")
@Ok("beetl:/platform/zhghh5/activity/family/mine/index.html")
public void h5Index() {
}
@At
@ApiOperation("主动扫码签到")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission(value = {"family.mine", "h5.family.mine"}, mode = SaMode.OR)
@SLog(tag = "品牌活动-活动签到", msg = "主动扫码签到")
public Result drivingScan(String courseId) {
// 主动扫码签到是用户自己打开扫一扫,扫二维码签到
int count = dao.count(FamilyUserCourse.class, Cnd.where("courseId", "=", courseId).and("userId", "=", SecurityUtil.getUserId()));
if (count == 0) {
return Result.error(99, "未查询到您的报名记录");
}
// 获取现在的日期,并往后推1个小时
String oneHourLater = DateUtil.offsetHour(new Date(), 1).toString("yyyy-MM-dd HH:mm:ss");
FamilyUserCourse userCourse = dao.fetch(
FamilyUserCourse.class,
Cnd.where("courseId", "=", courseId)
.and("userId", "=", SecurityUtil.getUserId())
.and("courseStartTime", "<=", oneHourLater)
.and("courseEndTime", ">=", oneHourLater)
);
if (userCourse == null) {
return Result.error(99, "未到签到时间");
}
userCourse.setAttend(true);
userCourse.setAttendTime(DateUtil.date());
dao.update(userCourse);
return Result.success();
}
@At
@ApiOperation("被动扫码签到")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission(value = {"family.mine", "h5.family.mine"}, mode = SaMode.OR)
@SLog(tag = "品牌活动-活动签到", msg = "被动扫码签到")
public Result passiveScan(String id) {
// id表示课程的某个时间段,userId表示是谁出示的二维码
FamilyUserCourse userCourse = dao.fetch(FamilyUserCourse.class, id);
if (userCourse == null) {
return Result.error("未查询到报名记录");
}
int isAfter = DateUtil.compare(new Date(), userCourse.getCourseStartTime());
if (isAfter > 0) {
return Result.error("抱歉,已经开始,无法签到");
}
long diffMillis = Math.abs(DateUtil.between(new Date(), userCourse.getCourseStartTime(), DateUnit.MS));
long oneHourInMs = 3600 * 1000;
if (diffMillis > oneHourInMs) {
return Result.error("签到时间为开始前1个小时");
}
userCourse.setAttend(true);
userCourse.setAttendTime(DateUtil.date());
dao.update(userCourse);
return Result.success();
}
@At
@ApiOperation("分活动查询")
@SaCheckPermission(value = {"family.mine", "h5.family.mine"}, mode = SaMode.OR)
public Result queryCourseSign(String courseId) {
Sql sql = Sqls.create("""
SELECT
uc.*,
date(uc.courseStartTime) as courseDate
FROM
`family_user_course` uc
WHERE
courseId = @courseId and userId = @userId
""");
sql.setParam("userId", SecurityUtil.getUserId());
sql.setParam("courseId", courseId);
List<NutMap> listMap = activityService.listMap(sql);
return Result.success(listMap);
}
@At
@ApiOperation("获取我报名的课程")
@SaCheckPermission(value = {"family.apply", "h5.family.apply"}, mode = SaMode.OR)
public Result queryMineCourse(String activityId) {
Sql sql = Sqls.create("""
SELECT
c.*,
u.mobileColumnsValue
FROM
family_user u
LEFT JOIN family_course c ON c.id = u.courseId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("u.activityId", "=", activityId);
cnd.and("u.userId", "=", SecurityUtil.getUserId());
sql.setCondition(cnd);
List<NutMap> listMap = activityService.listMap(sql);
return Result.success(listMap);
}
}
@@ -42,7 +42,7 @@ import java.util.List;
@IocBean
@Ok("json:full")
@Api(tags = "活动类型管理")
@At("/platform/family/manage/type")
@At("/platform/family/type")
public class FamilyTypeController {
@Inject
@@ -51,14 +51,14 @@ public class FamilyTypeController {
private BaseService baseService;
@At("")
@SaCheckPermission("family.manage.type")
@SaCheckPermission("family.type")
@Ok("beetl:/platform/zhgh/activity/family/type/index.html")
public void index() {
}
@At
@ApiOperation("分页查询")
@SaCheckPermission("family.manage.type")
@SaCheckPermission("family.type")
public Result pageData(PageForm pageForm,
@Param(value = "typeName") String typeName) {
Cnd cnd = Cnd.NEW();
@@ -89,7 +89,7 @@ public class FamilyTypeController {
@At
@ApiOperation("活动类型新增")
@SaCheckPermission("family.manage.type")
@SaCheckPermission("family.type")
@SLog(tag = "亲子活动-活动类型管理", msg = "活动类型新增")
public Result doAdd(@Param("data") String data) throws Exception {
FamilyType type = Json.fromJson(FamilyType.class, data);
@@ -105,7 +105,7 @@ public class FamilyTypeController {
@At
@ApiOperation("活动类型修改")
@SaCheckPermission("family.manage.type")
@SaCheckPermission("family.type")
@SLog(tag = "亲子活动-活动类型管理", msg = "活动类型修改")
public Result doEdit(FamilyType type) {
int count = dao.count(FamilyType.class, Cnd.where("code", "=", type.getCode()).and("id", "!=", type.getId()));
@@ -120,7 +120,7 @@ public class FamilyTypeController {
@At
@ApiOperation("活动类型删除")
@SaCheckPermission("family.manage.type")
@SaCheckPermission("family.type")
@SLog(tag = "亲子活动-活动类型管理", msg = "活动类型删除")
public Object doDelete(@Param(value = "id") String id) {
dao.clear(FamilyType.class, Cnd.where("id", "=", id));
@@ -131,7 +131,7 @@ public class FamilyTypeController {
@At
@Aop(TransAop.READ_COMMITTED)
@ApiOperation("排序号变更")
@SaCheckPermission("family.manage.type")
@SaCheckPermission("family.type")
public Object xhChange(String id, Integer xh, boolean toDown) {
if (toDown) {
FamilyType next = dao.fetch(FamilyType.class, Cnd.where("xh", "=", xh + 1));
@@ -158,7 +158,7 @@ public class FamilyTypeController {
@At
@ApiOperation("自定义表单字段类型")
@SaCheckPermission("family.manage.type")
@SaCheckPermission("family.type")
public Result getColumnType() {
List<String> names = EnumUtil.getNames(ColType.class);
names.add("JSON");
@@ -56,14 +56,14 @@ public class FamilyUserManageController {
private FamilyBlackListService familyBlackListService;
@At("")
@SaCheckPermission("family.user.activity")
@SaCheckPermission("family.userManage")
@Ok("beetl:/platform/zhgh/activity/family/userManage/index.html")
public void index() {
}
@At
@ApiOperation("分页查询")
@SaCheckPermission("family.user.activity")
@SaCheckPermission("family.userManage")
public Result pageData(PageForm pageForm,
@Param(value = "activityId") String activityId,
@Param(value = "courseId") String courseId,
@@ -87,7 +87,7 @@ public class FamilyUserManageController {
@At
@ApiOperation("报名人员处理")
@SaCheckPermission("family.user.activity")
@SaCheckPermission("family.userManage")
@SLog(tag = "亲子活动-人员调整", msg = "报名人员处理")
public Result doHandleUser(@Param("userId") String userId) {
familyBlackListService.doHandleUser(userId);
@@ -96,7 +96,7 @@ public class FamilyUserManageController {
@At
@ApiOperation("根据活动Id获取子活动")
@SaCheckPermission("family.user.activity")
@SaCheckPermission("family.userManage")
public Result getCourseByActivityId(@Param("activityId") String activityId) {
List<FamilyCourse> list = dao.query(FamilyCourse.class, Cnd.where("activityId", "=", activityId));
return Result.success(list);
@@ -104,7 +104,7 @@ public class FamilyUserManageController {
@At
@ApiOperation("获取子活动具体时间")
@SaCheckPermission("family.user.activity")
@SaCheckPermission("family.userManage")
public Result attendClassRecord(String userId) {
familyBlackListService.attendClassRecord(userId);
return Result.success();
@@ -112,7 +112,7 @@ public class FamilyUserManageController {
@At
@ApiOperation("获取候补人员")
@SaCheckPermission("family.user.activity")
@SaCheckPermission("family.userManage")
public Result getReserveUser(String courseId) {
Sql sql = Sqls.create("""
SELECT
@@ -133,7 +133,7 @@ public class FamilyUserManageController {
@At
@ApiOperation("补充人员")
@SaCheckPermission("family.user.activity")
@SaCheckPermission("family.userManage")
@SLog(tag = "亲子活动-人员管理", msg = "补充人员")
public Result reserveSingUp(String[] ids, String courseId) {
//先查询这个课程有多少个未签到的人员
@@ -1,369 +0,0 @@
package com.budwk.app.zhgh.activity.family.controller.mobile;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.activity.basic.models.ActivityUserScope;
import com.budwk.app.zhgh.activity.family.models.*;
import com.budwk.app.zhgh.activity.family.service.FamilyActivityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.util.cri.Static;
import org.nutz.integration.jedis.RedisService;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.locks.ReentrantLock;
import java.util.stream.Collectors;
/**
* @author zxy
* @Description TODO
* @createTime 2022年02月25日 13:44:00
*/
@IocBean
@Ok("json:full")
@Api(tags = "亲子活动移动端")
@At("/platform/mobile/familyActivity")
public class MFamilyActivityController {
private static final String REDIS_KEY_PREFIX = "m_family_activity";
private final ReentrantLock lock = new ReentrantLock(true);
@Inject
private Dao dao;
@Inject
private FamilyActivityService familyActivityService;
@Inject
private RedisService redisService;
@At("/familyList")
@Ok("beetl:/platform/zhghh5/activity/family/familyList/index.html")
@SaCheckPermission("h5.family.sign")
public void familyList() {
}
@At("/familyInfo")
@Ok("beetl:/platform/zhghh5/activity/family/familyInfo/index.html")
@SaCheckPermission("h5.family.sign")
public void familyInfo() {
}
@At("/activityInfo")
@Ok("beetl:/platform/zhghh5/activity/family/activityInfo/index.html")
@SaCheckPermission("h5.family.sign")
public void activityInfo() {
}
@At
@ApiOperation("分页查询")
@SaCheckPermission("h5.family.sign")
public Result pageData(PageForm pageForm,
@Param(value = "activityStatus") int activityStatus,
@Param(value = "year") Integer year,
@Param(value = "activityType") Integer activityType) {
Pagination pagination = familyActivityService.mPageData(pageForm, year, activityStatus, activityType);
return Result.success(pagination);
}
/**
* @param id 活动id
* @param tabIndex 0全部 1我的
* @return
*/
@At
@ApiOperation("查询单个活动")
@SaCheckPermission("h5.family.sign")
public Result findOne(@Param("id") String id,
@Param(value = "tabIndex") Integer tabIndex,
@Param(value = "fromMode") String fromMode) {
Cnd cnd = Cnd.NEW();
if (tabIndex > 0) {
List<FamilyUser> mySignCourseList = dao.query(FamilyUser.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("activityId", "=", id));
List<String> mySignCourseIdList = mySignCourseList.stream().map(FamilyUser::getCourseId).collect(Collectors.toList());
cnd.and("id", "in", mySignCourseIdList);
}
NutMap nutMap = familyActivityService.findOne(id, cnd, fromMode);
List<FamilyCourse> courseList = nutMap.getAsList("courseList", FamilyCourse.class);
courseList.forEach(v -> {
if (v.getCourseIsLimitApply() != null && v.getCourseIsLimitApply() && v.getIsSign()) {
FamilyActivityCourse course = dao.fetch(FamilyActivityCourse.class, Cnd.where("courseId", "=", v.getId()));
v.setCourseTimeName(DateUtil.format(course.getCourseStartTime(), "HH:mm") + "" + DateUtil.format(course.getCourseEndTime(), "HH:mm") + "");
}
});
return Result.success(nutMap);
}
@At
@ApiOperation("查询子活动时间段")
@SaCheckPermission("h5.family.sign")
public Object getCourseTimeSelectList(String courseId) {
// 查课程的时间段
List<FamilyActivityCourse> courseList = dao.query(FamilyActivityCourse.class, Cnd.where("courseId", "=", courseId));
// 查课程的报名人数
List<FamilyUserCourse> applyUserList = dao.query(FamilyUserCourse.class, Cnd.where("courseId", "=", courseId));
// 按照课程下面时间段去分组
Map<String, List<FamilyUserCourse>> collectMap = applyUserList.stream().collect(Collectors.groupingBy(FamilyUserCourse::getActivityCourseId));
List<NutMap> list = courseList.stream().map(v -> {
String id = v.getId();
NutMap nutMap = NutMap.NEW();
List<FamilyUserCourse> familyUserCourses = collectMap.get(id);
int remainingNum = v.getCourseLimitNum() != null ? v.getCourseLimitNum() : 0;
if (Lang.isNotEmpty(familyUserCourses)) {
remainingNum = v.getCourseLimitNum() - familyUserCourses.size();
}
nutMap.put("remainingNum", remainingNum);
nutMap.put("text", DateUtil.format(v.getCourseStartTime(), "HH:mm") + "" + DateUtil.format(v.getCourseEndTime(), "HH:mm") + "段(剩" + remainingNum + ")");
nutMap.put("value", id);
return nutMap;
}).filter(v -> v.getInt("remainingNum") != 0).toList();
return Result.success(list);
}
@At
@ApiOperation("活动报名")
@SaCheckPermission("h5.family.sign")
@SLog(tag = "亲子活动-活动报名", msg = "活动报名")
public Result doSignUp(FamilyUser familyUser) {
try {
lock.lock();
boolean courseByUser = familyActivityService.isSignCourseByUser(familyUser.getCourseId(), SecurityUtil.getUserId());
if(courseByUser) {
return Result.error("您已报过该活动");
}
//判断人数
int number = 0;
FamilyCourse course = familyActivityService.dao().fetch(FamilyCourse.class, familyUser.getCourseId());
FamilyType type = familyActivityService.dao().fetch(FamilyType.class, course.getCourseType());
if(type != null) {
if(type.getIsBringFamily() && type.getIsAddFamily()) {
List<List<NutMap>> mobileColumnsValue = familyUser.getMobileColumnsValue();
number = Lang.isNotEmpty(mobileColumnsValue) ? mobileColumnsValue.size() : 0;
}
}
boolean signFull = familyActivityService.isSignFull(course, number);
if(signFull) {
return Result.error("当前报名人数已满");
}
boolean signFullByUnionId = familyActivityService.isSignFullByUnionId(course, number);
if(signFullByUnionId) {
return Result.error("该活动您所在的分工会名额不足");
}
familyActivityService.doSignUp(familyUser);
return Result.success();
} catch (Exception e) {
e.printStackTrace();
return Result.success("报名失败");
} finally {
lock.unlock();
}
}
@At
@ApiOperation("取消报名")
@SaCheckPermission("h5.family.sign")
@SLog(tag = "亲子活动-活动报名", msg = "取消报名")
public Result cancelSignUp(@Param("activityId") String activityId, @Param("courseId") String courseId) {
String userId = SecurityUtil.getUserId();
//取消分两种情况
//第一种没有设置分工会人数限制,那么将候补的人按时间倒叙往上补
//第二种如果设置了分工会人数限制,那么只将本分工会的候补人员按照时间倒叙往上补,如果本分工会没有候补人员,则名额空出来,由校工会手动调整
FamilyActivity activity = dao.fetch(FamilyActivity.class, activityId);
FamilyCourse course = dao.fetch(FamilyCourse.class, courseId);
FamilyType type = dao.fetch(FamilyType.class, course.getCourseType());
//如果是正常报名取消了,将候补报名的按时间倒叙第一个改为正常报名
Cnd cnd = Cnd.where("activityId", "=", activityId).and("courseId", "=", courseId)
.and("state", "=", 2);
//如果设置了分工会报名人数限制,则只查本分工会
if (Lang.isNotEmpty(course.getUnionLimit())) {
cnd.and(new Static(" userId in (select id from user where unionid = '%s')".formatted(SecurityUtil.getUnionId())));
}
cnd.asc("signUpTime");
if (!type.getIsBringFamily() && course.getReserveMode() == 2) {
List<FamilyUser> signUpUsers = dao.query(FamilyUser.class, cnd);
int thisSignUpUserCount = dao.count(FamilyUser.class,
Cnd.where("activityId", "=", activityId)
.and("courseId", "=", courseId).and("userId", "=", userId)
.and("state", "in", List.of(1, 3)));
if (!signUpUsers.isEmpty() && thisSignUpUserCount > 0) {
FamilyUser familyUser = signUpUsers.get(0);
familyUser.setState(1);
dao.update(familyUser);
Sys_user user = dao.fetch(Sys_user.class, familyUser.getUserId());
//msgApi.sendTextMsg("【" + activity.getActivityName() + "】已候补成功,请按时参加活动!", user.getLoginname());
}
}
//删除报名记录
dao.clear("family_user_course", Cnd.where("activityId", "=", activityId)
.and("courseId", "=", courseId).and("userId", "=", userId));
dao.clear("family_user", Cnd.where("activityId", "=", activityId)
.and("courseId", "=", courseId).and("userId", "=", userId));
return Result.success();
}
@At
@ApiOperation("签到")
@SaCheckPermission("h5.family.sign")
@SLog(tag = "亲子活动-活动报名", msg = "活动签到")
public Result doQd(@Param("id") String id, @Param("courseId") String courseId, @Param("point") Double[] points) {
FamilyCourse course = dao.fetch(FamilyCourse.class, courseId);
List<Double> coursePoints = course.getCourseLocationCoordinates();
// if (Lang.isNotEmpty(coursePoints)) {
// //需要签到
// if (ArrayUtil.isEmpty(points) || ArrayUtil.hasNull(points)) {
// return Result.error().addMsg("请获取当前的坐标信息");
// }
// Double[] coursePointArray = coursePoints.toArray(new Double[]{});
// float distance = AMapUtils.calculateLineDistance(new LatLng(points[0], points[1]), new LatLng(coursePointArray[0], coursePointArray[1]));
//
// if (distance > 500) {
// return Result.error().addMsg("请到签到点位附近签到");
// }
// }
familyActivityService.doQd(id);
return Result.success();
}
/**
* 签到信息
*
* @param activityId
* @return
*/
@At
@ApiOperation("获取签到信息")
@SaCheckPermission("h5.family.sign")
public Result getQdInfoList(@Param("activityId") String activityId) {
List<NutMap> list = familyActivityService.qdInfoByUserId(SecurityUtil.getUserId(), activityId);
return Result.success(list);
}
@At
@ApiOperation("验证是否能报名")
@SaCheckPermission("h5.family.sign")
public Result validateSignUp(String courseId,
@Param(value = "currentFamilyNumber") Integer currentFamilyNumber) {
try {
lock.lock();
if(StrUtil.isBlank(courseId)) {
return Result.error("报名信息为空");
}
currentFamilyNumber = currentFamilyNumber != null ? currentFamilyNumber : 0;
FamilyCourse course = dao.fetch(FamilyCourse.class, courseId);
FamilyActivity activity = dao.fetch(FamilyActivity.class, course.getActivityId());
//判断时间
if(DateUtil.compare(new Date(), activity.getActivitySignUpStartTime(), "yyyy-MM-dd HH:mm:ss") < 0) {
return Result.error("报名未开始");
}
if(DateUtil.compare(new Date(), activity.getActivitySignUpEndTime(), "yyyy-MM-dd HH:mm:ss") > 0) {
return Result.error("报名已结束");
}
//判断活动组别
int count = dao.count(ActivityUserScope.class, Cnd.where("groupId", "=", activity.getActivityGroupId()).and("userId", "=", SecurityUtil.getUserId()));
if(count == 0) {
return Result.error("抱歉,您没有此次活动的权限");
}
//判断是否报名
boolean courseByUser = familyActivityService.isSignCourseByUser(courseId, SecurityUtil.getUserId());
if(courseByUser) {
return Result.error("抱歉,您已经报名");
}
//判断活动人数
boolean signFull = familyActivityService.isSignFull(course, currentFamilyNumber);
if(signFull) {
return Result.error("名额剩余数量不足");
}
//判断活动限制
boolean signCourse = familyActivityService.isSignCourse(course, activity);
if(!signCourse) {
if(activity.getRestrictLimit() != 3) {
return Result.error("您选择的类型已达上限,不能再报该类型的了");
} else {
return Result.error(activity.getActivityName() + "限制报" + activity.getLimitNum() + "个活动,已达上限");
}
}
//判断分工会人数限制
boolean signFullByUnionId = familyActivityService.isSignFullByUnionId(course, currentFamilyNumber);
if(signFullByUnionId) {
return Result.error("您所在的分工会名额不足");
}
return Result.success();
}catch (Exception e) {
e.printStackTrace();
return Result.error("报名失败");
} finally {
lock.unlock();
}
}
@At
@ApiOperation("验证子活动是否能报名")
@SaCheckPermission("h5.family.sign")
public Object validateSourceSignUp(String activityCourseId, String courseId) {
try {
lock.lock();
// 该时间段下已报名的人数
int count = dao.count(FamilyUserCourse.class, Cnd.where("activityCourseId", "=", activityCourseId)
.and("courseId", "=", courseId));
// 获取改时间段下的活动课程限制报名人数
FamilyActivityCourse course = dao.fetch(FamilyActivityCourse.class, activityCourseId);
Integer courseLimitNum = course.getCourseLimitNum();
// 报名加上自己,如果大于了限制人数,那就无法报名
if (count + 1 > courseLimitNum) {
return Result.error("该时间段名额已报满,请选择其他时段报名");
} else {
return Result.success();
}
} catch (Exception e) {
e.printStackTrace();
return Result.error("报名失败");
} finally {
lock.unlock();
}
}
@At
@ApiOperation("二维码签到")
@SaCheckPermission("h5.family.sign")
@SLog(tag = "亲子活动-活动报名", msg = "二维码签到")
public Result codeSign(String id, String codeCourseId, String clickCourseId) {
if(StrUtil.isBlank(codeCourseId) || StrUtil.isBlank(clickCourseId)) {
return Result.error("签到失败,没有获取到扫描信息");
}
if(!codeCourseId.equals(clickCourseId)) {
return Result.error("签到失败,二维码与您当前签到信息不符");
}
dao.update(FamilyUserCourse.class, Chain.make("isAttend", true)
.add("attendTime", new Date()), Cnd.where("id", "=", id));
return Result.success();
}
}
@@ -1,201 +0,0 @@
package com.budwk.app.zhgh.activity.family.controller.mobile;
import lombok.extern.slf4j.Slf4j;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
/**
* 品牌活动扫码
*/
@IocBean
@At("/platform/mobile/familyActivityScannerQrCode")
@Ok("json:full")
@Slf4j
public class MFamilyActivityScannerQrCodeController {
/*@Inject
private WxTokenUtil;
@Inject
private familyActivityService familyActivityService;
@Inject
private Dao dao;
@At("")
@Ok("beetl:/mobile/scannerQrCode.html")
public void scannerQrCode() {
}
*//**
* 微信js验证
*
* @param url
* @return
*//*
@At("/auth/sign")
@ViReturn
@RequiresAuthentication
public Object wxAuthSign(String url) {
String jsapi_ticket = wxTokenUtil.jsTicket();
return sign(jsapi_ticket, url);
}
*//**
* 二维码信息
*
* @param userId 用户id
* @param signId 签到记录id
* @param activityId 活动id
* @return
*//*
@At("/qrCodeInfo")
@RequiresAuthentication
public Object qrCodeInfo(@Param("userId") String userId, @Param("signId") String signId, @Param("activityId") String activityId) {
if (StrUtil.isBlank(userId) || StrUtil.isBlank(signId) || StrUtil.isBlank(activityId)) {
return Result.error("参数错误");
}
try {
// Sql activitySql = Sqls.create("select activityName,cover from family_activity where id = @activityId");
// activitySql.setParam("activityId",activityId);
// NutMap activityMap = (NutMap) Daos.query(dao, activitySql.toString(), Sqls.callback.map());
Sql signSql = Sqls.create("select isAttend,attendTime,isReceive,receiveTime from family_user_course where id = @signId");
signSql.setParam("signId", signId);
NutMap attendInfo = (NutMap) Daos.query(dao, signSql.toString(), Sqls.callback.map());
Sql userSql = Sqls.create("select id,username,loginname,unitname,unionname,sex from `user` where id = @userId");
userSql.setParam("userId", userId);
NutMap userMap = (NutMap) Daos.query(dao, userSql.toString(), Sqls.callback.map());
return Result.success(Map.of("signInfo", attendInfo, "userInfo", userMap));
} catch (Exception e) {
log.error(e.getMessage());
return Result.error("获取信息失败");
}
}
@At("/signInfo")
@RequiresAuthentication
public Object signInfo(@Param("signId") String signId) {
if (StrUtil.isBlank(signId)) {
return Result.error("参数错误");
}
try {
Sql signSql = Sqls.create("select isAttend,attendTime from family_user_course where id = @signId");
signSql.setParam("signId", signId);
NutMap signInfo = familyActivityService.fetch(signSql);
return Result.success(signInfo);
} catch (Exception e) {
log.error(e.getMessage());
return Result.error("获取信息失败");
}
}
*//**
* 发放礼品
*
* @param signId
* @return
*//*
@At("/grantGiftByQrCode")
@RequiresAuthentication
public Object grantGiftByQrCode(@Param("signId") String signId) {
if (StrUtil.isBlank(signId)) {
return Result.error("参数错误");
}
try {
Chain chain = Chain.make("isReceive", 1);
chain.add("receiveTime", new Date());
chain.add("giftScannerCodeUserId", ShiroUtil.getPrincipalProperty("id"));
dao.update(familyUserCourse.class, chain, Cnd.where("id", "=", signId));
Sql signSql = Sqls.create("select isAttend,attendTime,isReceive,receiveTime from family_user_course where id = @signId");
signSql.setParam("signId", signId);
NutMap signInfo = familyActivityService.fetch(signSql);
return Result.success(signInfo);
} catch (Exception e) {
log.error(e.getMessage());
return Result.error("获取信息失败");
}
}
*//**
* 二维码扫描确认签到
*
* @param signId
* @return
*//*
@At("/confirmSignByQrCode")
@RequiresAuthentication
public Object confirmSignByQrCode(@Param("signId") String signId) {
if (StrUtil.isBlank(signId)) {
return Result.error("参数错误");
}
try {
Chain chain = Chain.make("isAttend", 1);
chain.add("attendTime", new Date());
chain.add("signScannerCodeUserId", ShiroUtil.getPrincipalProperty("id"));
dao.update(familyUserCourse.class, chain, Cnd.where("id", "=", signId));
Sql signSql = Sqls.create("select isAttend,attendTime,isReceive,receiveTime from family_user_course where id = @signId");
signSql.setParam("signId", signId);
NutMap signInfo = familyActivityService.fetch(signSql);
return Result.success(signInfo);
} catch (Exception e) {
log.error(e.getMessage());
return Result.error("获取信息失败");
}
}
public static Map<String, String> sign(String jsapi_ticket, String url) {
Map<String, String> ret = new HashMap<String, String>();
String nonce_str = create_nonce_str();
String timestamp = create_timestamp();
String string1;
String signature = "";
//注意这里参数名必须全部小写,且必须有序
string1 = "jsapi_ticket=" + jsapi_ticket +
"&noncestr=" + nonce_str +
"&timestamp=" + timestamp +
"&url=" + url;
System.out.println(string1);
try {
MessageDigest crypt = MessageDigest.getInstance("SHA-1");
crypt.reset();
crypt.update(string1.getBytes("UTF-8"));
signature = byteToHex(crypt.digest());
} catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {
e.printStackTrace();
}
ret.put("url", url);
ret.put("jsapi_ticket", jsapi_ticket);
ret.put("nonceStr", nonce_str);
ret.put("timestamp", timestamp);
ret.put("signature", signature);
return ret;
}
private static String byteToHex(final byte[] hash) {
Formatter formatter = new Formatter();
for (byte b : hash) {
formatter.format("%02x", b);
}
String result = formatter.toString();
formatter.close();
return result;
}
private static String create_nonce_str() {
return UUID.randomUUID().toString();
}
private static String create_timestamp() {
return Long.toString(System.currentTimeMillis() / 1000);
}*/
}
@@ -62,7 +62,7 @@ import java.util.stream.Collectors;
@IocBean
@Ok("json:full")
@Api(tags = "亲子活动统计")
@At("/platform/family/statistics/activity")
@At("/platform/family/statistics")
public class FamilyActivityStatisticsController {
@Inject
@@ -73,14 +73,14 @@ public class FamilyActivityStatisticsController {
private Dao dao;
@At("")
@SaCheckPermission("family.statistics.activity")
@SaCheckPermission("family.statistics")
@Ok("beetl:/platform/zhgh/activity/family/statistics/index.html")
public void index() {
}
@At
@ApiOperation("分页查询")
@SaCheckPermission("family.statistics.activity")
@SaCheckPermission("family.statistics")
public Result pageData(PageForm pageForm,
@Param(value = "activityId") String activityId) {
Pagination pagination = familyActivityStatisticsService.pageData(pageForm, activityId);
@@ -95,7 +95,7 @@ public class FamilyActivityStatisticsController {
*/
@At
@ApiOperation("活动列表")
@SaCheckPermission("family.statistics.activity")
@SaCheckPermission("family.statistics")
public Result activityList(@Param(value = "year") Integer year) {
List<FamilyActivity> list = dao.query(FamilyActivity.class, Cnd.NEW().andEX("year", "=", year).desc("activityStartTime"));
return Result.success(list);
@@ -109,14 +109,14 @@ public class FamilyActivityStatisticsController {
*/
@At
@ApiOperation("报名人员列表")
@SaCheckPermission("family.statistics.activity")
@SaCheckPermission("family.statistics")
public Result registerUserList(@Param(value = "courseId") String courseId) {
return Result.success(familyActivityStatisticsService.registerUserList(courseId));
}
@At
@ApiOperation("报名动态列")
@SaCheckPermission("family.statistics.activity")
@SaCheckPermission("family.statistics")
public Object getTaleColumnInfo(@Param(value = "courseId") String courseId) {
return Result.success(familyActivityStatisticsService.getTaleColumnInfo(courseId));
}
@@ -129,14 +129,14 @@ public class FamilyActivityStatisticsController {
*/
@At
@ApiOperation("获取签到信息")
@SaCheckPermission("family.statistics.activity")
@SaCheckPermission("family.statistics")
public Result getSignInfo(@Param("courseId") String courseId) {
return Result.success(familyActivityStatisticsService.getSignInfo(courseId));
}
@At
@ApiOperation("开放报名")
@SaCheckPermission("family.statistics.activity")
@SaCheckPermission("family.statistics")
public Result signChange(@Param("courseId") String courseId, @Param("openOtherUnion") Boolean openOtherUnion) {
dao.update(FamilyCourse.class, Chain.make("openOtherUnion", openOtherUnion)
, Cnd.where("id", "=", courseId));
@@ -146,7 +146,7 @@ public class FamilyActivityStatisticsController {
@At
@Ok("void")
@ApiOperation("导出签到名单")
@SaCheckPermission("family.statistics.activity")
@SaCheckPermission("family.statistics")
public void exportSignUser(@Param(value = "activityId") String activityId,
HttpServletResponse response) throws IOException {
try {
@@ -24,113 +24,129 @@ import java.util.List;
@EqualsAndHashCode(callSuper = false)
public class FamilyActivity extends BaseModel implements Serializable, SysHomeConvert {
@Name
@PrevInsert(uu32 = true)
private String id;
@Name
@PrevInsert(uu32 = true)
private String id;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("活动名称")
private String activityName;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@Comment("活动名称")
private String activityName;
@Column
@ColDefine(type = ColType.INT)
@Comment("年度")
private Integer year;
@Column
@ColDefine(type = ColType.INT)
@Comment("年度")
private Integer year;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("活动报名开始时间")
private Date activitySignUpStartTime;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("活动报名开始时间")
private Date activitySignUpStartTime;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("活动报名开始时间")
private Date activitySignUpEndTime;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("活动报名开始时间")
private Date activitySignUpEndTime;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("活动开始时间")
private Date activityStartTime;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("活动开始时间")
private Date activityStartTime;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("活动结束时间")
private Date activityEndTime;
@Column
@ColDefine(type = ColType.DATETIME)
@Comment("活动结束时间")
private Date activityEndTime;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否禁用")
@Default("0")
private boolean isDisabled;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否禁用")
@Default("0")
private boolean isDisabled;
@Column
@ColDefine(customType = "longtext")
@Comment("活动介绍")
private String introduce;
@Column
@ColDefine(customType = "longtext")
@Comment("活动介绍")
private String introduce;
@Column
@ColDefine(type = ColType.INT, width = 10)
@Comment("活动限制标识")
private Integer restrictLimit;
@Column
@ColDefine(type = ColType.INT, width = 10)
@Comment("活动限制标识")
private Integer restrictLimit;
@Column
@ColDefine(type = ColType.INT, width = 10)
@Comment("活动限制报名个数")
private Integer limitNum;
@Column
@ColDefine(type = ColType.INT, width = 10)
@Comment("活动限制报名个数")
private Integer limitNum;
@Column
@ColDefine(type = ColType.VARCHAR, width = 100)
@Comment("活动封面")
private String cover;
@Column
@ColDefine(type = ColType.VARCHAR, width = 100)
@Comment("活动封面")
private String cover;
@Column
@ColDefine(type = ColType.VARCHAR, width = 100)
@Comment("微信群二维码")
private String wechat;
@Column
@ColDefine(type = ColType.VARCHAR, width = 100)
@Comment("微信群二维码")
private String wechat;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("上课前是否通知")
@Default("0")
private boolean notice;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("上课前是否通知")
@Default("0")
private boolean notice;
@Column
@Comment("活动范围Id")
@ColDefine(type = ColType.INT, width = 32)
private Integer activityGroupId;
@Column
@Comment("活动范围Id")
@ColDefine(type = ColType.INT, width = 32)
private Integer activityGroupId;
@Column
@Comment("活动范围名称")
@ColDefine(type = ColType.VARCHAR, width = 40)
private String activityGroupName;
@Column
@Comment("活动范围名称")
@ColDefine(type = ColType.VARCHAR, width = 40)
private String activityGroupName;
@Many(field = "activityId")
private List<FamilyCourse> courseList;
@Many(field = "activityId")
private List<FamilyCourse> courseList;
@Many(field = "activityId")
private List<FamilyTypeLimit> typeLimits;
@Many(field = "activityId")
private List<FamilyTypeLimit> typeLimits;
@Column
@Comment("活动类型")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String trainType;
@Column
@Comment("活动类型")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String trainType;
@Override
public Sys_home_activity covertToSysHomeActivity() {
Sys_home_activity sysHomeActivity = new Sys_home_activity();
sysHomeActivity.setId(this.getId());
sysHomeActivity.setName(this.getActivityName());
sysHomeActivity.setCover(this.getCover());
sysHomeActivity.setUrl("/platform/family/manage/apply");
sysHomeActivity.setH5Url("/platform/mobile/familyActivity/familyList");
if (Lang.isNotEmpty(this.getActivitySignUpStartTime())) {
sysHomeActivity.setStartDate(this.getActivitySignUpStartTime());
sysHomeActivity.setEndDate(this.getActivitySignUpEndTime());
}
sysHomeActivity.setAllowUserGroupId(this.getActivityGroupId());
sysHomeActivity.setEnable(!this.isDisabled());
sysHomeActivity.setClassPath(this.getClass().getPackageName() + this.getClass().getName());
return sysHomeActivity;
}
@Column
@Comment("关键词")
@Default("家属")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String keyWord;
@Column
@Comment("家属最多数")
@ColDefine(type = ColType.INT)
private Integer familyMaxCount;
@Column
@Comment("判断家属数量的唯一标识")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String onlyKey;
@Override
public Sys_home_activity covertToSysHomeActivity() {
Sys_home_activity sysHomeActivity = new Sys_home_activity();
sysHomeActivity.setId(this.getId());
sysHomeActivity.setName(this.getActivityName());
sysHomeActivity.setCover(this.getCover());
sysHomeActivity.setUrl("/platform/family/apply");
sysHomeActivity.setH5Url("/platform/family/apply/h5?id=" + this.getId());
if (Lang.isNotEmpty(this.getActivitySignUpStartTime())) {
sysHomeActivity.setStartDate(this.getActivitySignUpStartTime());
sysHomeActivity.setEndDate(this.getActivitySignUpEndTime());
}
sysHomeActivity.setAllowUserGroupId(this.getActivityGroupId());
sysHomeActivity.setEnable(!this.isDisabled());
sysHomeActivity.setClassPath(this.getClass().getPackageName() + this.getClass().getName());
return sysHomeActivity;
}
}
@@ -78,6 +78,11 @@ public class FamilyCourse extends BaseModel implements Serializable {
@Comment("序号")
private int orderNum;
@Column
@ColDefine(customType = "longtext")
@Comment("详细信息")
private String introduce;
@Many(field = "courseId")
private List<FamilyActivityCourse> courseTimeList;
@@ -89,6 +94,7 @@ public class FamilyCourse extends BaseModel implements Serializable {
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("移动端是否签到")
@Default("0")
private boolean isMobileSign;
@Column
@@ -99,6 +105,7 @@ public class FamilyCourse extends BaseModel implements Serializable {
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("移动端是否签收礼品")
@Default("0")
private boolean isReceiveGift;
@Column
@@ -137,6 +144,33 @@ public class FamilyCourse extends BaseModel implements Serializable {
@Comment("候补名额数")
private Integer waitingNum;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否限制年龄")
@Default("0")
private boolean familyAgeLimit;
@Column
@ColDefine(type = ColType.INT)
@Comment("最小年龄")
private Integer minAge;
@Column
@ColDefine(type = ColType.INT)
@Comment("最大年龄")
private Integer maxAge;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("是否限制性别")
@Default("0")
private boolean familySexLimit;
@Column
@ColDefine(type = ColType.VARCHAR)
@Comment("限制性别")
private String familySex;
private Integer hasWaitingNum;
private String courseTimeName;
private Integer hasRegisterNum;
@@ -84,4 +84,9 @@ public class FamilyMobileSignColumn implements Serializable {
@ColDefine(type = ColType.INT, width = 1)
private Integer columnIndex;
@Column
@Comment("验证规则")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String validRule;
}
@@ -16,101 +16,103 @@ import java.util.List;
*/
public interface FamilyActivityService extends BaseService<FamilyActivity> {
/**
* 添加活动
* @param activity 活动信息
* @param course 培训班信息
*/
void add(FamilyActivity activity, FamilyCourse course);
/**
* 添加活动
* @param activity 活动信息
* @param course 培训班信息
*/
void add(FamilyActivity activity, FamilyCourse course);
/**
* 编辑活动
* @param activity 活动信息
*/
void edit(FamilyActivity activity);
/**
* 编辑活动
* @param activity 活动信息
*/
void edit(FamilyActivity activity);
/**
* 更新活动状态
* @param activity 活动信息
*/
void updateActivityStatus(FamilyActivity activity);
/**
* 更新活动状态
* @param activity 活动信息
*/
void updateActivityStatus(FamilyActivity activity);
/**
* 查询单条活动信息
* @param id 活动ID
* @return 返回的数据与前端符合
*/
NutMap findOne(String id, Cnd cnd, String fromMode);
/**
* 查询单条活动信息
* @param id 活动ID
* @return 返回的数据与前端符合
*/
NutMap findOne(String id, Cnd cnd, String fromMode);
/**
* pc分页查询
* @param pageForm
* @param cnd
* @return
*/
Pagination pageData(PageForm pageForm, Cnd cnd);
/**
* pc分页查询
* @param pageForm
* @param cnd
* @return
*/
Pagination pageData(PageForm pageForm, Cnd cnd);
/**
* 手机端分页查询
* @param pageForm 分页
* @param year 年度
* @param activityStatus 报名状态 0全部 1进行中 2结束
* @return
*/
Pagination mPageData(PageForm pageForm, Integer year, int activityStatus, Integer activityType);
/**
* 手机端分页查询
* @param pageForm 分页
* @param year 年度
* @param activityStatus 报名状态 0全部 1进行中 2结束
* @return
*/
Pagination mPageData(PageForm pageForm, Integer year, int activityStatus, Integer activityType);
/**
* 手机端报名
* @param familyUser 活动ID
*/
void doSignUp(FamilyUser familyUser) throws Exception;
/**
* 手机端报名
* @param familyUser 活动ID
*/
void doSignUp(FamilyUser familyUser) throws Exception;
/**
* 异步插入每个报名成功人员的课程数据
* @param activityId
* @param courseId
* @param userId
*/
void asyncInsertUserCourse(String activityId, String courseId, String userId);
/**
* 异步插入每个报名成功人员的课程数据
* @param activityId
* @param courseId
* @param userId
*/
void asyncInsertUserCourse(String activityId, String courseId, String userId);
/**
* 该培训班每个分工会名额是否报满
* @return
*/
boolean isSignFullByUnionId(FamilyCourse course, Integer currentFamilyNumber);
/**
* 该培训班每个分工会名额是否报满
* @return
*/
boolean isSignFullByUnionId(FamilyCourse course, Integer currentFamilyNumber);
/**
* 该培训班是否报满
*/
boolean isSignFull(FamilyCourse course, Integer currentFamilyNumber);
/**
* 该培训班是否报满
*/
boolean isSignFull(FamilyCourse course, Integer currentFamilyNumber);
/**
* 还能报该类型的培训班吗 比如书画班最多报一项 健身班两项
* @return
*/
boolean isSignCourse(FamilyCourse course, FamilyActivity activity);
boolean validFamilyCount(FamilyUser user);
/**
* 当前用户是否已报过该培训班
* @param courseId
* @param userId
* @return
*/
boolean isSignCourseByUser(String courseId, String userId);
/**
* 还能报该类型的培训班吗 比如书画班最多报一项 健身班两项
* @return
*/
boolean isSignCourse(FamilyCourse course, FamilyActivity activity);
/**
* 手机端签到
* @param id 每个培训班每节课每个用户的记录ID
*/
void doQd(String id);
/**
* 当前用户是否已报过该培训班
* @param courseId
* @param userId
* @return
*/
boolean isSignCourseByUser(String courseId, String userId);
/**
* 某个用户的签到信息
* @param userId 用户id
* @param activityId 活动id
*/
List<NutMap> qdInfoByUserId(String userId, String activityId);
/**
* 手机端签到
* @param id 每个培训班每节课每个用户的记录ID
*/
void doQd(String id);
List<FamilyCourse> filterCourseByHostUnion(List<FamilyCourse> courseList);
/**
* 某个用户的签到信息
* @param userId 用户id
* @param activityId 活动id
*/
List<NutMap> qdInfoByUserId(String userId, String activityId);
List<FamilyCourse> filterCourseByHostUnion(List<FamilyCourse> courseList);
}
@@ -1,11 +1,9 @@
package com.budwk.app.zhgh.activity.family.service.impl;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.sys.models.Sys_home_activity;
import com.budwk.app.sys.views.View_user;
@@ -27,12 +25,10 @@ import org.nutz.dao.util.cri.Static;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
/**
@@ -373,6 +369,26 @@ public class FamilyActivityServiceImpl extends BaseServiceImpl<FamilyActivity> i
}
}
@Override
public boolean validFamilyCount(FamilyUser user) {
String activityId = user.getActivityId();
// 查询报名记录
List<FamilyUser> list = dao().query(FamilyUser.class, Cnd.where(FamilyUser::getActivityId, "=", activityId).and(FamilyUser::getUserId, "=", SecurityUtil.getUserId()));
if(Lang.isEmpty(list)) {
return false;
}
FamilyActivity activity = dao().fetch(FamilyActivity.class, activityId);
List<List<NutMap>> allMobileColumnsValue = new ArrayList<>(list.stream()
.map(FamilyUser::getMobileColumnsValue)
.filter(Objects::nonNull)
.flatMap(List::stream)
.toList());
allMobileColumnsValue.addAll(user.getMobileColumnsValue());
return allMobileColumnsValue.size() > activity.getFamilyMaxCount();
}
@Override
public boolean isSignCourse(FamilyCourse course, FamilyActivity activity) {
//培训班类型
@@ -98,7 +98,7 @@ public class TrainSignUpManageController {
@At
@ApiOperation("查询单个活动")
@SaCheckPermission("trainSingUp.manage")
@SaCheckPermission("trainSingUp")
public Result findOne(@Param("id") @NotNull String id) {
NutMap dataMap = trainSignUpActivityManageService.findOne(id, null, "");
String activityStartTime = dataMap.getString("activityStartTime");
@@ -140,4 +140,26 @@ public class TrainsignUpMineController {
List<NutMap> listMap = activityService.listMap(sql);
return Result.success(listMap);
}
@At
@ApiOperation("获取我报名的课程")
@SaCheckPermission(value = {"trainSingUp.mine", "h5.trainSingUp.mine"}, mode = SaMode.OR)
public Result queryMineCourse(String activityId) {
Sql sql = Sqls.create("""
SELECT
c.*,
u.mobileColumnsValue
FROM
train_sign_up_user u
LEFT JOIN train_sign_up_course c ON c.id = u.courseId
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("u.activityId", "=", activityId);
cnd.and("u.userId", "=", SecurityUtil.getUserId());
sql.setCondition(cnd);
List<NutMap> listMap = activityService.listMap(sql);
return Result.success(listMap);
}
}
@@ -36,6 +36,10 @@ module.exports = {
const doc = parser.parseFromString(this.content, 'text/html');
const link = doc.querySelector('a');
const href = link.getAttribute('href');
if(!href) {
this.pdf = false
return
}
this.$nextTick(() => {
this.pdfObj = new Pdfh5('#pdf-container', {
pdfurl: href,
@@ -1,5 +1,5 @@
<!--#include('signForm.js'){}#-->
const info = {
const courseList = {
template: /*language=HTML*/ `
<div>
<el-row :gutter="20">
@@ -15,12 +15,12 @@ const info = {
<el-col class="query-title hidden-xs-only">&emsp;&emsp;</el-col>
<el-col class="query-content">
<el-select
v-model="pageForm.courseTypeId"
placeholder="请选择类型"
filterable
clearable
style="width: 200px"
@change="doSearch"
v-model="pageForm.courseTypeId"
placeholder="请选择类型"
filterable
clearable
style="width: 200px"
@change="doSearch"
>
<el-option v-for="item in courseTypeList" :key="item.id" :label="item.typeName" :value="item.id"></el-option>
</el-select>
@@ -30,12 +30,12 @@ const info = {
<el-col class="query-title hidden-xs-only">分类标识</el-col>
<el-col class="query-content">
<el-tag
:effect="pageForm.assortTypes.includes(item) ? 'dark' : 'plain'"
:key="item"
:type="item"
@click="tagClick('assortTypes', item)"
style="margin-right: 10px; cursor: pointer"
v-for="item in assortList"
:effect="pageForm.assortTypes.includes(item) ? 'dark' : 'plain'"
:key="item"
:type="item"
@click="tagClick('assortTypes', item)"
style="margin-right: 10px; cursor: pointer"
v-for="item in assortList"
>
{{ item }}
</el-tag>
@@ -44,15 +44,15 @@ const info = {
<el-table :data="tableData" class="mt10">
<el-table-column :index="indexMethod" label="序号" type="index" width="80px"></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:key="column.prop"
:width="column.width"
:sortable="column.sortable"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
:label="column.label"
:prop="column.prop"
:key="column.prop"
:width="column.width"
:sortable="column.sortable"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template v-slot="{row}" v-if="column.prop=='courseLocationCoordinates'">
<el-button style="padding: 0" @click="openViewMap(row.courseLocationCoordinates)" type="text">
@@ -67,6 +67,12 @@ const info = {
<template v-slot="{row}" v-else-if="column.prop=='applyNum'">
<span v-html="calcSignUpCount(row)"></span>
</template>
<template v-slot="{row}" v-else-if="column.prop=='introduce'">
<span v-if="!row.introduce?.trim()">暂无</span>
<el-button v-else style="padding: 0" @click="onPreview(row.introduce)" type="text">点击查看</el-button>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template v-slot="{row}">
@@ -102,7 +108,14 @@ const info = {
<el-button @click="viewMapDialog = false"> </el-button>
</el-row>
</el-dialog>
<el-dialog :visible.sync="infoVisible" title="详细信息" append-to-body>
<div v-html="introduce"></div>
<el-row class="mt20" justify="end" type="flex">
<el-button @click="infoVisible = false"> </el-button>
</el-row>
</el-dialog>
<sign-form ref="signFormRef" @refresh="doSearch"></sign-form>
</div>
`,
@@ -123,18 +136,41 @@ const info = {
tableColumns: [
{ prop: "courseName", label: "名称" },
{ prop: "typeName", label: "类型", width: 130},
{ prop: "campus", label: "校区", width: 160 },
{ prop: "courseLocationCoordinates", label: "地点", width: 200 },
{ prop: "courseInstructor", label: "联系人", width: 100 },
{ prop: "courseTime", label: "时间", width: 200 },
{ prop: "courseTime", label: "时间", width: 160 },
{ prop: "introduce", label: "详细信息", width: 100 },
{ prop: "applyNum", label: "已报名人数", width: 200 }
],
activity: {},
courseTypeList: [],
activityType: '',
pdf: false,
infoVisible: false,
introduce: '',
}
},
methods: {
async onPreview(introduce) {
try {
const parser = new DOMParser();
const doc = parser.parseFromString(introduce, 'text/html');
const link = doc.querySelector('a');
const href = link.getAttribute('href');
const id = href.substring(href.indexOf("=") + 1)
const res = await this.$axios.post("/platform/sys/file/previewFileData", { ids: JSON.stringify([id]) })
this.pdf = true
window.open("/assets/platform/plugins/pdfJs/web/viewer.html?file=" + encodeURIComponent(res.data[0].downloadPath), res.data[0].name)
} catch (e) {
this.introduce = introduce
this.pdf = false
this.infoVisible = true
}
},
tagClick(key, val) {
let idx = this.pageForm[key].indexOf(val)
if (idx !== -1) {
@@ -153,7 +189,7 @@ const info = {
},
onSign(row) {
const courseType = this.courseTypeList.find((v) => v.id === row.courseType)
this.$axios.post("/platform/mobile/familyActivity/validateSignUp", {courseId: row.id})
this.$axios.post("/platform/family/apply/validateSignUp", {courseId: row.id})
.then((res) => {
if (res.code !== 0) {
this.$alert(res.msg, "提示", {
@@ -168,7 +204,7 @@ const info = {
type: "warning"
})
}
this.$refs.signFormRef.onOpen(row, courseType)
this.$refs.signFormRef.onOpen(row, courseType, this.activity)
}
})
},
@@ -178,7 +214,7 @@ const info = {
cancelButtonText: "取消",
type: "info"
}).then(async () => {
const resp = await this.$axios.post("/platform/mobile/familyActivity/cancelSignUp", {
const resp = await this.$axios.post("/platform/family/apply/cancelSignUp", {
activityId: row.activityId,
courseId: row.id
})
@@ -191,7 +227,7 @@ const info = {
})
},
async getCourseTypeList() {
const resp = await this.$axios.post("/platform/family/manage/type/getAllType")
const resp = await this.$axios.post("/platform/family/type/getAllType")
if (resp.code === 0) {
this.courseTypeList = resp.data
}
@@ -256,50 +292,6 @@ const info = {
},
style: /*language=CSS*/ `
.glow-box {
min-height: calc(100vh - 56px - 40px - 50px - 80px);
max-height: calc(100vh - 56px - 40px - 50px - 80px);
overflow-y: auto;
background: #F0F2F5;
}
img {
width: 100%;
height: 180px;
}
.title {
background: white;
height: 20px;
}
.query-row {
display: flex;
align-items: center;
padding: 6px 0;
}
.query-row:not(:last-child) {
border-bottom: 1px dashed rgb(230, 230, 230);
}
.query-row > .query-title {
width: 100px;
max-width: 100px;
min-width: 100px;
overflow: hidden;
}
.query-row > .query-content {
min-width: 200px;
overflow: hidden;
}
.query-row > .query-content > .el-tag {
margin-bottom: 5px;
margin-top: 5px;
}
@media screen and (max-width: 992px) {
.query-row:nth-child(4) .query-content .el-col:not(:last-child) {
margin-bottom: 5px;
}
.query-title {
display: none;
}
}
`
}
@@ -3,33 +3,81 @@ layout("/layouts/platform.html"){
#-->
<style>
.info-dialog .el-dialog__body {
max-height: 600px;
overflow-y: auto;
}
.glow-box {
min-height: calc(100vh - 56px - 40px - 50px - 80px);
max-height: calc(100vh - 56px - 40px - 50px - 80px);
overflow-y: auto;
background: #F0F2F5;
}
img {
width: 100%;
height: 180px;
}
.title {
background: white;
height: 20px;
}
.query-row {
display: flex;
align-items: center;
padding: 6px 0;
}
.query-row:not(:last-child) {
border-bottom: 1px dashed rgb(230, 230, 230);
}
.query-row > .query-title {
width: 100px;
max-width: 100px;
min-width: 100px;
overflow: hidden;
}
.query-row > .query-content {
min-width: 200px;
overflow: hidden;
}
.query-row > .query-content > .el-tag {
margin-bottom: 5px;
margin-top: 5px;
}
@media screen and (max-width: 992px) {
.query-row:nth-child(4) .query-content .el-col:not(:last-child) {
margin-bottom: 5px;
}
.query-title {
display: none;
}
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<el-card shadow="never">
<search @search="doSearch">
<search-item label="年度:">
<el-date-picker
placeholder="选择年度"
type="year"
style="width: 100%"
v-model="pageForm.year"
value-format="yyyy"
@change="doSearch"
></el-date-picker>
</search-item>
<search-item label="活动状态:">
<el-radio-group v-model="pageForm.activityType" @change="doSearch">
<el-radio-button :label="1">全部</el-radio-button>
<el-radio-button :label="2">报名中</el-radio-button>
<el-radio-button :label="3">已结束</el-radio-button>
</el-radio-group>
</search-item>
</search>
</el-card>
<search @search="doSearch">
<search-item label="年度:">
<el-date-picker
placeholder="选择年度"
type="year"
style="width: 100%"
v-model="pageForm.year"
value-format="yyyy"
@change="doSearch"
></el-date-picker>
</search-item>
<search-item label="活动状态:">
<el-select v-model="pageForm.activityType" @change="doSearch" style="width: 100%"
placeholder="请选择活动状态" filterable>
<el-option :value="1" label="全部"></el-option>
<el-option :value="4" label="即将开始"></el-option>
<el-option :value="2" label="报名中"></el-option>
<el-option :value="3" label="已结束"></el-option>
</el-select>
</search-item>
</search>
</el-card>
<el-card class="mt10" shadow="never">
@@ -58,8 +106,9 @@ layout("/layouts/platform.html"){
<span>{{$moment(row.activityEndTime).format('MM/DD HH:mm')}}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<el-table-column label="操作" width="300">
<template v-slot="{row}">
<el-button @click="onView(row)" size="mini" type="primary">查看介绍</el-button>
<el-button @click="onOpen(row)" size="mini" type="primary">去报名</el-button>
</template>
</el-table-column>
@@ -68,24 +117,50 @@ layout("/layouts/platform.html"){
</el-card>
<template #view>
<info ref="infoRef"></info>
<course-list ref="courseListRef"></course-list>
</template>
</guava>
<el-dialog title="详细信息" :visible.sync="infoVisible" width="60%" class="info-dialog">
<activity-info ref="infoRef"></activity-info>
<span slot="footer" class="dialog-footer">
<el-statistic
v-if="time < 0"
format="DD 天 HH 时 mm 分钟 ss 秒"
:value="new Date(infoRow.activitySignUpStartTime)"
time-indices
title="距离开始:"
@finish="time = 0"
>
</el-statistic>
<template v-else>
<el-button @click="infoVisible = false">取消</el-button>
<el-button type="primary" @click="onOpen(infoRow)" :disabled="time < 0">
去报名
</el-button>
</template>
</span>
</el-dialog>
</div>
<script>
<!--#include('info.js'){}#-->
<!--#include('courseList.js'){}#-->
<!--#include('../manage/info.js'){}#-->
new Vue({
el: "#app",
mixins: [initTableMixins],
components: {
"info": info,
"course-list": courseList,
"activity-info": info,
},
data() {
return {
pageForm: {
year: this.$moment().format("YYYY"),
activityType: "2"
activityType: 4
},
tableColumns: [
{ label: "活动名称", prop: "activityName", width: 600},
@@ -93,16 +168,32 @@ layout("/layouts/platform.html"){
{ label: "报名时间", prop: "activitySignUpStartTime"},
{ label: "活动时间", prop: "activityStartTime"},
],
time: 0,
infoRow: {},
infoVisible: false,
}
},
methods: {
onView(row) {
this.infoRow = row
this.time = this.$moment().diff(this.$moment(row.activitySignUpStartTime), 'milliseconds')
this.infoVisible = true
this.$nextTick(() => {
this.$refs.infoRef.initData(row.id)
})
},
onOpen(row) {
if(this.$moment().isBefore(this.$moment(row.activitySignUpStartTime))) {
this.onView(row)
return
}
this.infoVisible = false
this.$refs.guava.view(() => {
this.$refs.infoRef.onOpen(row)
this.$refs.courseListRef.onOpen(row)
})
},
pageData() {
this.$axios.post("/platform/family/manage/apply/activityData", this.pageForm).then((res) => {
this.$axios.post("/platform/family/apply/activityPageData", this.pageForm).then((res) => {
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
@@ -61,7 +61,7 @@ const signForm = {
style="display: flex; justify-content: space-between; align-items: center">
<div>家属信息</div>
<div>
<el-button type="primary" size="mini" @click="delFamily">
<el-button type="danger" size="mini" @click="delFamily">
删除家属
</el-button>
<el-button type="primary" size="mini" @click="addFamily">
@@ -76,28 +76,28 @@ const signForm = {
:name="index + ''"
:label="'家属' + (index + 1)"
:key="index">
<el-row>
<el-row class="mt20">
<el-col :span="24">
<el-form-item
v-for="(column, index) in item"
:label="column.columnName"
:key="column.columnCode"
:rules="{ required: column.isRequired,
v-for="(column, index) in item"
:label="column.columnName"
:key="column.columnCode"
:rules="{ required: column.isRequired,
message: (['SELECT', 'FILE'].includes(column.columnFormType) ? '请选择' : '请填写') + column.columnName,
trigger: 'blur'}"
>
<!--文本框-->
<template
v-if="!['SELECT'].includes(column.columnFormType) && ['VARCHAR','TEXT','INT'].includes(column.columnType)">
v-if="!['SELECT'].includes(column.columnFormType) && ['VARCHAR','TEXT','INT'].includes(column.columnType)">
<el-input
v-model="column.columnValue"
:placeholder="'请填写' + column.columnName"
:type="['INT'].includes(column.columnType) ? 'number' : ''"
v-model="column.columnValue"
:placeholder="'请填写' + column.columnName"
:type="['INT'].includes(column.columnType) ? 'number' : ''"
></el-input>
</template>
<!--选择框-->
<template
v-else-if="['SELECT'].includes(column.columnFormType) && ['VARCHAR','TEXT','INT'].includes(column.columnType)">
v-else-if="['SELECT'].includes(column.columnFormType) && ['VARCHAR','TEXT','INT'].includes(column.columnType)">
<el-select v-model="column.columnValue"
:placeholder="'请选择' + column.columnName"
style="width: 100%">
@@ -108,11 +108,11 @@ const signForm = {
<!--时间框-->
<template v-else-if="['DATE', 'DATETIME'].includes(column.columnType)">
<el-date-picker
style="width: 100%"
v-model="column.columnValue"
:type="column.columnType === 'DATE' ? 'date' : 'datetime'"
:placeholder="'请选择' + column.columnName"
:value-format="column.columnType === 'DATE' ? 'yyyy-MM-dd' : 'yyyy-MM-dd HH:mm:ss'"
style="width: 100%"
v-model="column.columnValue"
:type="column.columnType === 'DATE' ? 'date' : 'datetime'"
:placeholder="'请选择' + column.columnName"
:value-format="column.columnType === 'DATE' ? 'yyyy-MM-dd' : 'yyyy-MM-dd HH:mm:ss'"
></el-date-picker>
</template>
<!--文件-->
@@ -154,12 +154,14 @@ const signForm = {
courseTypeRow: {},
courseTimeSelectList: [],
active: '',
activity: {},
}
},
methods: {
addFamily() {
if(this.formData.mobileColumnsValue.length >= this.courseTypeRow.familyMaxCount) {
this.$message.warning('家属最多人数为' + this.courseTypeRow.familyMaxCount)
if(this.formData.mobileColumnsValue.length >= this.activity.familyMaxCount) {
this.$message.warning('家属最多人数为' + this.activity.familyMaxCount)
return
}
const list = clone(this.courseTypeRow.familyMobileSignColumnList)
@@ -170,53 +172,47 @@ const signForm = {
const ac = (Number(this.active) - 1)
this.active = '' + (ac >= 0 ? ac : 0)
},
validFamilyForm() {
for (let i = 0; i < this.formData.mobileColumnsValue.length; i++) {
const family = this.formData.mobileColumnsValue[i]
for (const familyColumn of family) {
if(familyColumn.isRequired && !familyColumn.columnValue) {
this.$message.error('家属' + (i + 1) + '的' + familyColumn.columnName + '不能为空')
return false
}
}
}
return true
},
async validSignUp() {
//获取家属是多少人
const res = await this.$axios.post("/platform/mobile/familyActivity/validateSignUp", {
const res = await this.$axios.post("/platform/family/apply/validateSignUp", {
courseId: this.formData.courseId,
currentFamilyNumber: this.formData.mobileColumnsValue.length || 0
})
if (res.code !== 0) {
this.$message.warning(res.msg)
this.$alert(res.msg, "提示", {
confirmButtonText: "确定",
type: "warning"
})
return false
}
return true
},
async validateSourceSignUp() {
if (this.courseRow.courseIsLimitApply) {
const resp = await $.post('/platform/mobile/familyActivity/validateSourceSignUp', {
const resp = await $.post('/platform/family/apply/validateSourceSignUp', {
activityCourseId: this.formData.activityCourseId,
courseId: this.courseRow.id
})
if (resp.code !== 0) {
this.$message.warning(resp.msg)
this.$alert(resp.msg, "提示", {
confirmButtonText: "确定",
type: "warning"
})
return false
}
}
return true
},
async getCourseTimeSelectList(o) {
const resp = await $.post('/platform/mobile/familyActivity/getCourseTimeSelectList', {courseId: o.id})
const resp = await $.post('/platform/family/apply/getCourseTimeSelectList', {courseId: o.id})
if (resp.code === 0) {
this.courseTimeSelectList = resp.data
} else {
this.$message.warning('获取时段信息失败,请联系管理员')
}
},
async onOpen(row, courseType) {
this.initData(row, courseType)
async onOpen(row, courseType, activity) {
this.initData(row, courseType, activity)
if (row.courseIsLimitApply) {
await this.getCourseTimeSelectList(row)
}
@@ -229,6 +225,135 @@ const signForm = {
this.courseTypeRow = courseType
this.signDialog = true
},
validateIdCard(idCard) {
if (!idCard) {
return false
}
// 18位身份证号码校验
if (idCard.length === 18) {
const idCardRegex = /^[1-9]\d{5}(18|19|20)?\d{2}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}(\d|[Xx])$/
if (!idCardRegex.test(idCard)) {
return false
}
// 校验码计算
const weights = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
const checksums = ["1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"]
let sum = 0
for (let i = 0; i < 17; i++) {
sum += idCard[i] * weights[i]
}
const checksum = checksums[sum % 11]
return checksum === idCard[17].toUpperCase()
}
// 15位身份证号码校验
else if (idCard.length === 15) {
const idCardRegex = /^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/
return idCardRegex.test(idCard)
}
// 外国人或其他情况
else {
return false
}
},
validFamilyForm() {
// 校验规则映射
const validators = {
idCard: (value) => this.validateIdCard(value),
mobile: (value) => /^1[3-9]\d{9}$/.test(value),
email: (value) => /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(value)
};
// 显示提示弹窗(直接传完整的 message)
const showAlert = (message) => {
this.$alert(message, "提示", {
confirmButtonText: "确定",
type: "warning"
})
};
const { mobileColumnsValue } = this.formData;
for (let i = 0; i < mobileColumnsValue.length; i++) {
const family = mobileColumnsValue[i];
for (const col of family) {
const value = col.columnValue?.trim(); // 安全处理空值和空格
// 必填校验
if (col.isRequired && !value) {
const message = this.activity.keyWord + (i + 1) + '的' + col.columnName + '不能为空';
showAlert(message);
return false;
}
// 格式校验
if (col.validRule && value) {
const validator = validators[col.validRule];
if (validator && !validator(value)) {
const message = this.activity.keyWord + (i + 1) + '的' + col.columnName + '格式不正确';
showAlert(message);
return false;
}
}
if(col.validRule === 'idCard' && this.courseRow.familyAgeLimit) {
const parseCard = this.parseIdCard(value)
if(this.courseRow.minAge && parseCard.age < this.courseRow.minAge) {
const message = '限制报名最小年龄为' + this.courseRow.minAge;
showAlert(message);
return false;
}
if(this.courseRow.maxAge && parseCard.age > this.courseRow.maxAge) {
const message = '限制报名最大年龄为' + this.courseRow.maxAge;
showAlert(message);
return false;
}
}
if(col.validRule === 'idCard' && this.courseRow.familySexLimit) {
const parseCard = this.parseIdCard(value)
if(this.courseRow.familySex && parseCard.sex !== this.courseRow.familySex) {
const message = '限制报名性别为' + this.courseRow.familySex;
showAlert(message);
return false;
}
}
}
}
return true;
},
parseIdCard(idCard) {
if (!idCard || (idCard.length !== 18 && idCard.length !== 15)) {
return null;
}
let birthStr = '';
let sexCode = '';
if (idCard.length === 15) {
birthStr = '19' + idCard.substring(6, 12);
sexCode = idCard.substring(14, 15); // 15位:第15位是性别
} else {
birthStr = idCard.substring(6, 14);
sexCode = idCard.substring(16, 17); // 18位:第17位是性别
}
const birthYear = parseInt(birthStr.substring(0, 4), 10);
const birthMonth = parseInt(birthStr.substring(4, 6), 10) - 1;
const birthDay = parseInt(birthStr.substring(6, 8), 10);
const birthDate = new Date(birthYear, birthMonth, birthDay);
const today = new Date();
let age = today.getFullYear() - birthDate.getFullYear();
const monthDiff = today.getMonth() - birthDate.getMonth();
const dayDiff = today.getDate() - birthDate.getDate();
if (monthDiff < 0 || (monthDiff === 0 && dayDiff < 0)) {
age--;
}
const sex = parseInt(sexCode, 10) % 2 === 1 ? '男' : '女';
return { age, sex, };
},
async onSubmit() {
//验证家属表单
if (!this.validFamilyForm()) return
@@ -241,8 +366,9 @@ const signForm = {
cancelButtonText: "取消",
type: "warning"
}).then(async () => {
const formData = clone(this.formData)
let array = []
this.formData.mobileColumnsValue.forEach(item => {
formData.mobileColumnsValue.forEach(item => {
const o = item.map((v) => {
return {
columnName: v.columnName,
@@ -253,11 +379,14 @@ const signForm = {
})
array.push(o)
})
this.formData.mobileColumnsValue = JSON.stringify(clone(array))
const resp = await this.$axios.post("/platform/mobile/familyActivity/doSignUp", this.formData)
formData.mobileColumnsValue = JSON.stringify(clone(array))
const resp = await this.$axios.post("/platform/family/apply/doSignUp", formData)
if (resp.code === 0) {
this.$alert(resp.msg, "提示", {
confirmButtonText: "确定",
type: "warning"
})
this.signDialog = false
this.$message.success(resp.msg)
this.$emit('refresh')
} else {
this.$message.warning(resp.msg)
@@ -266,7 +395,8 @@ const signForm = {
}
})
},
initData(row, courseType) {
initData(row, courseType, activity) {
this.activity = activity
this.formData = {
activityId: row.activityId,
courseId: row.id,
@@ -284,7 +414,7 @@ const signForm = {
},
},
style: /*language=CSS*/ `
.el-tabs__header {
::v-deep .el-tabs__header {
margin: 0 0 15px !important;
}
`
@@ -41,28 +41,28 @@ const basicForm = {
<el-col :span="12">
<el-form-item :rules="{required:true,message: '请选择活动时间', trigger: 'blur'}" label="活动时间" prop="activityTime">
<el-date-picker
:picker-options="pickerOptions"
end-placeholder="请选择活动结束日期"
range-separator="至"
start-placeholder="请选择活动开始日期"
style="width: 100%"
type="datetimerange"
v-model="formData.activityTime"
value-format="yyyy-MM-dd HH:mm"
:picker-options="pickerOptions"
end-placeholder="请选择活动结束日期"
range-separator="至"
start-placeholder="请选择活动开始日期"
style="width: 100%"
type="datetimerange"
v-model="formData.activityTime"
value-format="yyyy-MM-dd HH:mm"
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :rules="{required:true,message: '请选择报名时间', trigger: 'blur'}" label="报名时间" prop="activitySignTime">
<el-date-picker
:disabled="false"
end-placeholder="请选择报名结束日期"
range-separator="至"
start-placeholder="请选择报名开始日期"
style="width: 100%"
type="datetimerange"
v-model="formData.activitySignTime"
value-format="yyyy-MM-dd HH:mm"
:disabled="false"
end-placeholder="请选择报名结束日期"
range-separator="至"
start-placeholder="请选择报名开始日期"
style="width: 100%"
type="datetimerange"
v-model="formData.activitySignTime"
value-format="yyyy-MM-dd HH:mm"
></el-date-picker>
</el-form-item>
</el-col>
@@ -73,18 +73,18 @@ const basicForm = {
<div style="display: flex; justify-content: space-between">
<div style="width: 99%">
<el-select
@change="changeActivity"
clearable
filterable
placeholder="请选择可报名人员范围"
style="width: 99%"
v-model="formData.activityGroupId"
@change="changeActivity"
clearable
filterable
placeholder="请选择可报名人员范围"
style="width: 99%"
v-model="formData.activityGroupId"
>
<el-option
:key="item.groupId"
:label="item.groupName"
:value="item.groupId"
v-for="item in activityGroupList"
:key="item.groupId"
:label="item.groupName"
:value="item.groupId"
v-for="item in activityGroupList"
></el-option>
</el-select>
</div>
@@ -102,29 +102,41 @@ const basicForm = {
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" type="flex">
<el-col :span="12">
<el-form-item :rules="{required:true,message: '请输入关键词', trigger: 'blur'}" label="关键词" prop="keyWord">
<el-input maxlength="50" v-model="formData.keyWord" placeholder="请输入关键词"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :rules="{required:true,message: '请输入家属最多数', trigger: 'blur'}" label="家属最多数" prop="familyMaxCount">
<el-input maxlength="50" v-model="formData.familyMaxCount" placeholder="请输入家属最多数" type="number"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item :rules="{required:true,message: '请输入活动介绍', trigger: 'blur'}" label="活动介绍" prop="introduce">
<text-editor v-model="formData.introduce"></text-editor>
</el-form-item>
<el-form-item label="封面图片" prop="cover" :rules="{required:true,message: '请上传活动移动端封面图片', trigger: 'blur'}">
<el-col :span="12">
<file-upload
:upload_number="1"
:value.sync="formData.cover"
accept=".jpg,.jpeg,.png"
complete_result
upload_mode="image"
upload_result_category="interval"
:upload_number="1"
:value.sync="formData.cover"
accept=".jpg,.jpeg,.png"
complete_result
upload_mode="image"
upload_result_category="interval"
></file-upload>
</el-col>
<el-col :span="12">
<el-form-item label="微信群二维码" prop="wechat">
<file-upload
:upload_number="1"
:value.sync="formData.wechat"
accept=".jpg,.jpeg,.png"
complete_result
upload_mode="image"
upload_result_category="interval"
:upload_number="1"
:value.sync="formData.wechat"
accept=".jpg,.jpeg,.png"
complete_result
upload_mode="image"
upload_result_category="interval"
></file-upload>
</el-form-item>
</el-col>
@@ -141,17 +153,17 @@ const basicForm = {
<el-table-column label="序号" prop="orderNum" width="100px">
<template v-slot="{row}">
<el-input-number
v-model="row.orderNum"
@change="courseOrderNumChange"
:min="1"
:max="formData.courseList.length"
:step="1"
step-strictly
:precision="0"
controls-position="right"
style="width: 76px"
size="small"
label="序号"
v-model="row.orderNum"
@change="courseOrderNumChange"
:min="1"
:max="formData.courseList.length"
:step="1"
step-strictly
:precision="0"
controls-position="right"
style="width: 76px"
size="small"
label="序号"
></el-input-number>
</template>
</el-table-column>
@@ -173,32 +185,32 @@ const basicForm = {
<el-table-column :label="activityType + '人数'" prop="coursePeopleNumber" width="110px">
<template v-slot="{row}">
<el-input-number
:controls="false"
:max="9999"
size="small"
:min="0"
:precision="0"
step-strictly
style="max-width: 80px"
@change="(c, o) => validNumber(row, null)"
v-model="row.coursePeopleNumber"
placeholder="请输入人数"
:controls="false"
:max="9999"
size="small"
:min="0"
:precision="0"
step-strictly
style="max-width: 80px"
@change="(c, o) => validNumber(row, null)"
v-model="row.coursePeopleNumber"
placeholder="请输入人数"
></el-input-number>
</template>
</el-table-column>
<el-table-column label="预留名额" prop="courseReservedNumber" width="110px">
<template v-slot="{row}">
<el-input-number
:controls="false"
:max="1000"
:min="0"
size="small"
:precision="0"
step-strictly
style="max-width: 80px"
@change="(c, o) => validNumber(row, o)"
v-model="row.courseReservedNumber"
placeholder="请输入预留名额"
:controls="false"
:max="1000"
:min="0"
size="small"
:precision="0"
step-strictly
style="max-width: 80px"
@change="(c, o) => validNumber(row, o)"
v-model="row.courseReservedNumber"
placeholder="请输入预留名额"
></el-input-number>
</template>
</el-table-column>
@@ -265,6 +277,13 @@ const basicForm = {
</div>
</div>
</el-form-item>
<div class="left-span-label" style="margin-top: 20px">判断家属数量唯一标识</div>
<el-form-item label="唯一标识" prop="onlyKey">
<el-select @focus="keyFocus" v-model="formData.onlyKey" placeholder="请选择唯一标识">
<el-option v-for="item in typeArray" :key="item.columnCode" :label="item.columnName" :value="item.columnCode"></el-option>
</el-select>
</el-form-item>
</div>
</el-form>
<div style="float: right; margin: 20px 0">
@@ -292,12 +311,12 @@ const basicForm = {
</el-row>
</el-dialog>
<drawer-user-scope
@group_change="getActivityGroup"
ref="drawerUserScope"
:group_id.sync="formData.activityGroupId">
<drawer-user-scope
@group_change="getActivityGroup"
ref="drawerUserScope"
:group_id.sync="formData.activityGroupId">
</drawer-user-scope>
<course-time ref="courseTimeRef"></course-time>
<custom-form ref="customFormRef"></custom-form>
</div>
@@ -310,7 +329,17 @@ const basicForm = {
formData: {
notice: false,
courseList: [
{ orderNum: 1, courseName: "", courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1, courseIsLimitApply: false },
{
orderNum: 1,
courseName: "",
courseTimeList: [],
isMobileSign: false,
isReceiveGift: false,
reserveMode: 1,
courseIsLimitApply: false,
familyAgeLimit: false,
familySexLimit: false,
},
],
conditionStructure: {
method: "AND",
@@ -318,7 +347,8 @@ const basicForm = {
},
restrictLimit: 1,
limitNum: 1,
typeLimits: []
typeLimits: [],
keyWord: '家属'
},
historicalActList: [],
trainTypeList: [],
@@ -331,6 +361,8 @@ const basicForm = {
},
campusList: [],
courseTypeList: [],
typeArray: [],
}
},
components: {
@@ -339,6 +371,28 @@ const basicForm = {
"custom-form": customForm,
},
methods: {
keyFocus() {
const types = this.formData.courseList.filter(o => o.courseType !== undefined).map(o => o.courseType)
if(types.length === 0) {
this.$message.warning('请先设置' + this.activityType + '类型')
return
}
const typeList = this.courseTypeList.filter(o => types.includes(o.id))
let array = []
typeList.forEach(item => {
array = array.concat(item.familyMobileSignColumnList)
})
// 根据 columnCode 去重
const uniqueMap = new Map()
array.forEach(item => {
if (item.columnCode) {
uniqueMap.set(item.columnCode, item)
}
})
// 可选:保留没有 columnCode 的项
const withoutCode = array.filter(item => !item.columnCode)
this.typeArray = [...uniqueMap.values(), ...withoutCode]
},
async validNumber(row, old) {
if (GetQueryString("id") === "") {
if (row.courseReservedNumber > row.coursePeopleNumber && row.reserveMode === 1) {
@@ -371,7 +425,7 @@ const basicForm = {
}
},
async getRegisterUserCount(courseId) {
const resp = await this.$axios.post("/platform/family/manage/activity/getRegisterUserCount", { courseId })
const resp = await this.$axios.post("/platform/family/manage/getRegisterUserCount", { courseId })
return resp.code === 0 ? resp.data : 0
},
courseTypeChange(val, row) {
@@ -444,7 +498,7 @@ const basicForm = {
this.formData.courseList.push({ courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1, courseIsLimitApply: false })
},
async historicalActChange(val) {
const resp = await this.$axios.post("/platform/family/manage/activity/findOne", {id: val})
const resp = await this.$axios.post("/platform/family/manage/findOne", {id: val})
if (resp.code === 0) {
this.formData = resp.data
this.typeChange(this.formData.trainType)
@@ -468,7 +522,7 @@ const basicForm = {
return data
},
async getHistoricalActList() {
const resp = await this.$axios.post("/platform/family/manage/activity/getHistoricalActList", {})
const resp = await this.$axios.post("/platform/family/manage/getHistoricalActList", {})
return resp.data
},
async onSave() {
@@ -508,6 +562,18 @@ const basicForm = {
this.$message.warning("第" + (i + 1) + "行签到方式填写有误,请核查")
return true
}
if(v.familyAgeLimit === true && !v.minAge) {
this.$message.warning("第" + (i + 1) + "行最小年龄不能为空,请核查")
return true
}
if(v.familyAgeLimit === true && !v.maxAge) {
this.$message.warning("第" + (i + 1) + "行最大年龄不能为空,请核查")
return true
}
if(v.familySexLimit === true && !v.familySex) {
this.$message.warning("第" + (i + 1) + "行性别不能为空,请核查")
return true
}
return false
})
if (courseValid) return
@@ -543,7 +609,7 @@ const basicForm = {
type: "warning"
})
if (confirm !== "confirm") return
const resp = await this.$axios.post("/platform/family/manage/activity/doHandle", cloneData)
const resp = await this.$axios.post("/platform/family/manage/doHandle", cloneData)
if (resp.code === 0) {
this.$message.success(resp.msg)
this.step = 1
@@ -554,15 +620,16 @@ const basicForm = {
}
},
async getAllType() {
const resp = await this.$axios.post("/platform/family/manage/type/getAllType", {})
const resp = await this.$axios.post("/platform/family/type/getAllType", {})
return resp.data
},
async init(row) {
if (row && row.id) {
const resp = await this.$axios.post("/platform/family/manage/activity/findOne", {id: row.id})
const resp = await this.$axios.post("/platform/family/manage/findOne", {id: row.id})
if (resp.code === 0) {
this.formData = resp.data
this.typeChange(this.formData.trainType)
if(this.formData.onlyKey) this.keyFocus()
}
}
},
@@ -588,6 +655,6 @@ const basicForm = {
},
},
style: /*language=CSS*/ `
`
}
@@ -50,6 +50,69 @@ const customForm = {
</el-col>
</el-row>
<el-row :gutter="50" type="flex">
<el-col :span="4">
<span>是否限制年龄</span>
</el-col>
<el-col :span="20">
<el-radio-group v-model="formData.courseList[moreInfoIndex].familyAgeLimit" size="small">
<el-radio border :label="true">限制</el-radio>
<el-radio border :label="false">不限制</el-radio>
</el-radio-group>
</el-col>
</el-row>
<el-row :gutter="50" type="flex" v-if="formData.courseList[moreInfoIndex].familyAgeLimit === true">
<el-col :span="4">
<span>最小年龄</span>
</el-col>
<el-col :span="20">
<el-input-number :controls="false" style="width: 100%"
:max="100"
:min="0"
:precision="0"
step-strictly
placeholder="请输入最小年龄"
v-model="formData.courseList[moreInfoIndex].minAge"></el-input-number>
</el-col>
</el-row>
<el-row :gutter="50" type="flex" v-if="formData.courseList[moreInfoIndex].familyAgeLimit === true">
<el-col :span="4">
<span>最大年龄</span>
</el-col>
<el-col :span="20">
<el-input-number :controls="false" style="width: 100%"
:max="100"
:min="0"
:precision="0"
step-strictly
placeholder="请输入最大年龄"
v-model="formData.courseList[moreInfoIndex].maxAge"></el-input-number>
</el-col>
</el-row>
<el-row :gutter="50" type="flex">
<el-col :span="4">
<span>是否限制性别</span>
</el-col>
<el-col :span="20">
<el-radio-group v-model="formData.courseList[moreInfoIndex].familySexLimit" size="small">
<el-radio border :label="true">限制</el-radio>
<el-radio border :label="false">不限制</el-radio>
</el-radio-group>
</el-col>
</el-row>
<el-row :gutter="50" type="flex" v-if="formData.courseList[moreInfoIndex].familySexLimit === true">
<el-col :span="4">
<span>限制性别</span>
</el-col>
<el-col :span="20">
<el-select v-model="formData.courseList[moreInfoIndex].familySex" placeholder="请选择性别"
style="width: 100%" clearable>
<el-option label="男" value="男"></el-option>
<el-option label="女" value="女"></el-option>
</el-select>
</el-col>
</el-row>
<el-row :gutter="50" type="flex">
<el-col :span="4">
<span>是否签到</span>
@@ -132,7 +195,7 @@ const customForm = {
<span>候补数量</span>
</el-col>
<el-col :span="20">
<el-input-number :controls="false" size="small" style="width: 100%"
<el-input-number :controls="false" style="width: 100%"
:max="100"
:min="0"
:precision="0"
@@ -140,6 +203,16 @@ const customForm = {
v-model="formData.courseList[moreInfoIndex].waitingNum"></el-input-number>
</el-col>
</el-row>
<el-row :gutter="50" type="flex">
<el-col :span="4">
<span>详细信息</span>
</el-col>
<el-col :span="20">
<text-editor v-model="formData.courseList[moreInfoIndex].introduce"></text-editor>
</el-col>
</el-row>
<div style="text-align: right">
<el-button @click="moreInfoDrawer = false"> </el-button>
<el-button type="primary" @click="moreInfoDrawer = false"> </el-button>
@@ -195,17 +268,6 @@ const customForm = {
}
},
style: /*language=CSS*/ `
.my-drawer .el-col-4 {
text-align: right;
}
.my-drawer .el-row {
margin-bottom: 20px;
}
.el-drawer__body {
padding: 20px;
}
.el-row--flex {
align-items: center;
}
`
}
@@ -3,7 +3,18 @@ layout("/layouts/platform.html"){
#-->
<style>
.my-drawer .el-col-4 {
text-align: right;
}
.my-drawer .el-row {
margin-bottom: 20px;
}
.el-drawer__body {
padding: 20px;
}
.el-row--flex {
align-items: center;
}
</style>
<div id="app" v-cloak>
@@ -164,8 +175,7 @@ layout("/layouts/platform.html"){
})
},
openActivityCode(id) {
this.activityUrl = location.origin + "/platform/mobile/familyActivity/activityInfo?activityId="
+ id + '&isMySign=0'
this.activityUrl = location.origin + "/platform/family/apply/h5?id=" + id
this.codeDialogVisible = true
},
makeCode(row) {
@@ -11,6 +11,9 @@ const info = {
<el-descriptions-item label="活动结束时间">{{viewData.activityEndTime}}</el-descriptions-item>
<el-descriptions-item label="报名开始时间">{{viewData.activitySignUpStartTime}}</el-descriptions-item>
<el-descriptions-item label="报名结束时间">{{viewData.activitySignUpEndTime}}</el-descriptions-item>
<el-descriptions-item label="详细信息" :span="2">
<div v-html="viewData.introduce"></div>
</el-descriptions-item>
</el-descriptions>
</el-tab-pane>
<el-tab-pane :label="activityType + '信息'">
@@ -66,7 +69,7 @@ const info = {
},
methods: {
initData(id) {
this.$axios.post(loc() + "/findOne", { id: id })
this.$axios.post("/platform/family/manage/findOne", { id: id })
.then((resp) => {
if (resp.code === 0) {
this.viewData = resp.data
@@ -104,7 +107,7 @@ const info = {
},
},
style: /*language=CSS*/ `
.el-button--text {
::v-deep .el-button--text {
padding: 0;
}
`
@@ -66,8 +66,10 @@ const makeQrcode = {
this.courseDialog = true
},
makeCourseCode(row) {
const o = {courseId: row.id}
const content = jrQrcode.getQrBase64(JSON.stringify(o))
const url = '/platform/family/mine/drivingScan'
const data = url + '?courseId=' + row.id
console.log(data)
const content = jrQrcode.getQrBase64(data)
let image = new Image()
image.src = content
let viewer = new Viewer(image, {
@@ -150,7 +150,7 @@ const unionForm = {
!this.formData.courseList[this.unionLimitIndex].unionLimit ||
this.formData.courseList[this.unionLimitIndex].unionLimit.length === 0
) {
const resp = await this.$axios.get("/platform/family/manage/activity/getUnionLimit", {
const resp = await this.$axios.get("/platform/family/manage/getUnionLimit", {
activityScopeId: this.formData.activityGroupId
})
if (resp.code === 0) {
@@ -73,6 +73,16 @@ const basicForm = {
</template>
</el-table-column>
<el-table-column label="验证规则" prop="validRule">
<template v-slot="{row}">
<el-select v-model="row.validRule" style="width: 100%" filterable placeholder="请选择验证规则" clearable>
<el-option label="身份证" value="idCard"></el-option>
<el-option label="手机号" value="mobile"></el-option>
<el-option label="邮箱" value="email"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="控件类型" prop="columnFormType">
<template v-slot="{row, $index}">
<el-select
@@ -213,10 +213,10 @@ const userInfo = {
this.unitList = await this.$businessTool.listUnit(this.registerForm.unionId)
},
style: /*language=CSS*/ `
.adjustDialog .el-radio__label {
::v-deep .adjustDialog .el-radio__label {
display: none;
}
.adjustDialog .el-dialog__body {
::v-deep .adjustDialog .el-dialog__body {
max-height: 600px;
overflow-y: auto;
}
@@ -212,7 +212,7 @@ layout("/layouts/platform.html"){
await this.doSearch()
},
async getActivityList() {
const resp = await this.$axios.post("/platform/family/statistics/activity/activityList", { year: this.pageForm.year })
const resp = await this.$axios.post("/platform/family/statistics/activityList", { year: this.pageForm.year })
this.activityList = resp.data
if (this.activityList && this.activityList.length > 0) {
this.pageForm.activityId = this.activityList[0].id
@@ -69,7 +69,7 @@ const courseList = {
</template>
<template v-slot="{row}" v-else-if="column.prop=='introduce'">
<span v-if="!row.introduce">暂无</span>
<span v-if="!row.introduce?.trim()">暂无</span>
<el-button v-else style="padding: 0" @click="onPreview(row.introduce)" type="text">点击查看</el-button>
</template>
</el-table-column>
@@ -107,6 +107,13 @@ const courseList = {
<el-button @click="viewMapDialog = false"> </el-button>
</el-row>
</el-dialog>
<el-dialog :visible.sync="infoVisible" title="详细信息" append-to-body>
<div v-html="introduce"></div>
<el-row class="mt20" justify="end" type="flex">
<el-button @click="infoVisible = false"> </el-button>
</el-row>
</el-dialog>
<apply-form ref="formRef" @refresh="doSearch"></apply-form>
</div>
@@ -128,29 +135,40 @@ const courseList = {
tableColumns: [
{ prop: "courseName", label: "名称" },
{ prop: "typeName", label: "类型", width: 130},
{ prop: "campus", label: "校区", width: 160 },
{ prop: "courseLocationCoordinates", label: "地点", width: 200 },
{ prop: "courseInstructor", label: "联系人", width: 100 },
{ prop: "introduce", label: "详细介绍", width: 100 },
{ prop: "courseTime", label: "时间", width: 200 },
{ prop: "courseTime", label: "时间", width: 160 },
{ prop: "introduce", label: "详细信息", width: 100 },
{ prop: "applyNum", label: "已报名人数", width: 200 }
],
activity: {},
courseTypeList: [],
trainType: '',
pdf: false,
infoVisible: false,
introduce: '',
}
},
methods: {
async onPreview(introduce) {
const parser = new DOMParser();
const doc = parser.parseFromString(introduce, 'text/html');
const link = doc.querySelector('a');
const href = link.getAttribute('href');
try {
const parser = new DOMParser();
const doc = parser.parseFromString(introduce, 'text/html');
const link = doc.querySelector('a');
const href = link.getAttribute('href');
const id = href.substring(href.indexOf("=") + 1)
const res = await this.$axios.post("/platform/sys/file/previewFileData", { ids: JSON.stringify([id]) })
const id = href.substring(href.indexOf("=") + 1)
const res = await this.$axios.post("/platform/sys/file/previewFileData", { ids: JSON.stringify([id]) })
window.open("/assets/platform/plugins/pdfJs/web/viewer.html?file=" + encodeURIComponent(res.data[0].downloadPath), res.data[0].name)
this.pdf = true
window.open("/assets/platform/plugins/pdfJs/web/viewer.html?file=" + encodeURIComponent(res.data[0].downloadPath), res.data[0].name)
} catch (e) {
this.introduce = introduce
this.pdf = false
this.infoVisible = true
}
},
tagClick(key, val) {
let idx = this.pageForm[key].indexOf(val)
@@ -76,22 +76,22 @@ layout("/layouts/platform.html"){
<activity-info ref="infoRef"></activity-info>
<el-statistic
v-if="time < 0"
format="DD 天 HH 时 mm 分钟 ss 秒"
:value="new Date(infoRow.activitySignUpStartTime)"
time-indices
title="距离开始:"
@finish="time = 0"
style="margin-top: 30px"
>
</el-statistic>
<span slot="footer" class="dialog-footer">
<el-button @click="infoVisible = false">取消</el-button>
<el-button type="primary" @click="onOpen(infoRow)" :disabled="time < 0">
去报名
</el-button>
<el-statistic
v-if="time < 0"
format="DD 天 HH 时 mm 分钟 ss 秒"
:value="new Date(infoRow.activitySignUpStartTime)"
time-indices
title="距离开始:"
@finish="time = 0"
>
</el-statistic>
<template v-else>
<el-button @click="infoVisible = false">取消</el-button>
<el-button type="primary" @click="onOpen(infoRow)" :disabled="time < 0">
去报名
</el-button>
</template>
</span>
</el-dialog>
@@ -111,7 +111,7 @@ layout("/layouts/platform.html"){
return {
pageForm: {
year: this.$moment().format("YYYY"),
activityType: 2
activityType: 4
},
tableColumns: [
{ label: "活动名称", prop: "activityName", width: 600},
@@ -132,7 +132,7 @@ const customForm = {
<span>候补数量</span>
</el-col>
<el-col :span="20">
<el-input-number :controls="false" size="small" style="width: 100%"
<el-input-number :controls="false" style="width: 100%"
:max="100"
:min="0"
:precision="0"
@@ -3,18 +3,7 @@ layout("/layouts/platform.html"){
#-->
<style>
.my-drawer .el-col-4 {
text-align: right;
}
.my-drawer .el-row {
margin-bottom: 20px;
}
.el-drawer__body {
padding: 20px;
}
.el-row--flex {
align-items: center;
}
</style>
<div id="app" v-cloak>
@@ -0,0 +1,149 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<style scoped>
.info-title {
font-weight: bold;
background-color: white;
padding: 13px;
box-shadow: 0 8px 12px #ebedf0;
text-align: center !important;
}
.info-container {
margin-bottom: 60px;
}
.button {
position: fixed;
bottom: 0;
width: 100%;
}
.info-img {
display: block;
}
.van-count-down {
color: #fff;
}
</style>
<div id="app">
<van-nav-bar title="亲子活动" left-text="返回" left-arrow @click-left="historyBack" fixed placeholder></van-nav-bar>
<van-sticky offset-top="46px">
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
<year-van-dropdown-item :num="5" @change="doSearch" v-model="pageForm.year"></year-van-dropdown-item>
<van-dropdown-item v-model="pageForm.activityType" :options="typeOptions" :multiple="false"
@change="doSearch"></van-dropdown-item>
</van-dropdown-menu>
</van-sticky>
<table-list api="/platform/family/apply/activityPageData"
:page_form.sync="pageForm"
ref="tableListRef"
title="activityName"
img="cover"
@ready="onReady"
>
<template v-slot="{index,row}">
<table-column label="面向对象">{{row.activityGroupName}}</table-column>
<table-column label="报名时间">
{{$moment(row.activitySignUpStartTime).format('MM/DD HH:mm') + '~' + $moment(row.activitySignUpEndTime).format('MM/DD HH:mm')}}
</table-column>
<table-column label="活动时间">
{{$moment(row.activityStartTime).format('MM/DD HH:mm') + '~' + $moment(row.activityEndTime).format('MM/DD HH:mm')}}
</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
<i class="fa fa-eye"></i>
<span>查看介绍</span>
</div>
<div class="action-btn" @click="onApply(row)">
<i class="fa fa-edit"></i>
<span>去报名</span>
</div>
</template>
</table-list>
<van-action-sheet :close-on-click-overlay="false" title="详细信息" v-model="infoVisible">
<div class="info-container">
<div>
<van-image class="info-img" height="186" width="100%" :src="infoRow.cover"></van-image>
<div class="info-title">{{infoRow.activityName}}</div>
<pdf-preview :content="infoRow.introduce"></pdf-preview>
</div>
<div class="button">
<van-button @click="onApply(infoRow)" type="primary" block>
<span v-if="time >= 0">
去报名
</span>
<template v-else>
距离开始
<van-count-down :time="Math.abs(time)" class="count-down" format="DD 天 HH 时 mm 分 ss 秒" @finish="time = 0"></van-count-down>
</template>
</van-button>
</div>
</div>
</van-action-sheet>
</div>
<script>
const vue = new Vue({
el: "#app",
store,
components: {
"pdf-preview": httpVueLoader("/components/plugins/sysFilePreview/PdfIndex.vue?v=" + new Date().getTime())
},
data() {
return {
time: 0,
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: '',
year: new Date().getFullYear(),
activityType: 4,
},
typeOptions: [
{text: '全部', value: 1},
{text: '即将开始', value: 4},
{text: '报名中', value: 2},
{text: '已结束', value: 3},
],
infoVisible: false,
infoRow: {},
}
},
methods: {
onView(row) {
this.infoRow = row
this.time = this.$moment().diff(this.$moment(row.activitySignUpStartTime), 'milliseconds')
this.infoVisible = true
},
onApply(row) {
if(this.$moment().isBefore(this.$moment(row.activitySignUpStartTime))) {
this.onView(row)
return
}
this.$pjaxReplace('/platform/family/apply/list/h5?id=' + row.id)
},
onReady() {
this.doSearch()
},
doSearch() {
this.$nextTick(() => {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.$refs.tableListRef.doSearch()
})
}
},
})
</script>
<!--#
}
#-->
@@ -0,0 +1,89 @@
const times = {
template:
/*language=HTML*/
`
<div>
<van-action-sheet v-model="visible" title="时间段" cancel-text="取消">
<button v-for="(item,index) in row?.courseTimes" type="button" class="van-action-sheet__item">
<div style="display: flex; justify-content: space-between; align-items: center">
<div>
<div class="van-action-sheet__name">
<label>{{ weekdayCNMap[$moment(item.courseDate).day()] }}</label>
<label>{{ $moment(item.courseDate).format('YYYY-MM-DD') }}</label>
</div>
<div class="van-action-sheet__subname">
{{$moment(item.courseStartTime).format('MM-DD HH:mm') + ' 至 ' + $moment(item.courseEndTime).format('MM-DD HH:mm')}}
</div>
</div>
<div v-if="row.isSign === true && row.isMobileSign === true" class="sign_button">
<van-button v-if="item.isAttend !== true" @click.stop="onSign(item)" size="mini" type="info">签到</van-button>
<van-button v-if="item.isAttend === true" size="mini" type="info" disabled>已签到</van-button>
</div>
</div>
</button>
</van-action-sheet>
<van-popup round :safe-area-inset-bottom="true"
:close-on-click-overlay="false"
v-model="signVisible"
:style="{ width: '80%', height: '66%' }"
get-container="#app"
@close="onSignClose"
closeable
>
<scan-code ref="scanCodeRef"></scan-code>
</van-popup>
</div>
`,
store,
data() {
return {
visible:false,
row: null,
weekdayCNMap: {0: '周日', 1: '周一', 2: '周二', 3: '周三', 4: '周四', 5: '周五', 6: '周六'},
selectCourseTime: {},
signVisible: false,
}
},
components: {
"scan-code": httpVueLoader("/components/plugins/sysScanCode/index.vue?v=" + new Date().getTime())
},
methods: {
onSignClose() {
this.$refs.scanCodeRef.closeScan()
},
onOpen(row) {
this.row = row
this.visible = true
},
onSign(courseTime) {
this.selectCourseTime = courseTime
if(this.row.signType === 1) {
this.signVisible = true
this.$nextTick(() => {
this.$refs.scanCodeRef.init()
})
}
if(this.row.signType === 2) {
this.makeCode()
}
if(this.row.signType === 3) {
this.$toast('此签到模式正在升级中')
}
},
makeCode() {
const url = '/platform/family/mine/passiveScan'
const data = url + '?id=' + this.selectCourseTime.id
console.log(data)
const content = jrQrcode.getQrBase64(data)
vant.ImagePreview([content])
},
onClose(){
this.visible = false
},
},
style: /*language=CSS*/ `
`
}
@@ -0,0 +1,343 @@
const applyForm = {
template:
/*language=HTML*/
`
<div>
<van-action-sheet :close-on-click-overlay="false" title="报名信息" v-model="visible">
<van-form ref="formRef" class="form-container">
<van-cell-group title="活动信息" class="form-section">
<van-field label="活动名称" readonly v-model="row.courseName"></van-field>
<van-field label="校区" readonly v-model="row.campus"></van-field>
<van-field label="活动地点" readonly v-model="row.courseLocation"></van-field>
</van-cell-group>
<van-cell-group title="基础信息" class="form-section">
<van-field label="姓名" readonly v-model="formData.username"></van-field>
<van-field label="工号" readonly v-model="formData.loginname"></van-field>
<van-field label="所在单位" readonly v-model="formData.unitName"></van-field>
<van-field label="所属工会" readonly v-model="formData.unionName"></van-field>
<van-field label="性别" readonly v-model="formData.sex"></van-field>
<template v-if="row.courseIsLimitApply">
<van-field label="报名时段"
required
:rules="[{ required: true, message: '请选择报名时段' }]"
readonly
@click="showCoursePicker = true"
placeholder="请选择报名时段"
name="courseTimeName"
v-model="formData.courseTimeName">
</van-field>
<van-popup v-model="showCoursePicker" position="bottom">
<van-picker
show-toolbar
:columns="courseTimeSelectList"
@confirm="onCourseConfirm"
@cancel="showCoursePicker=false"
></van-picker>
</van-popup>
</template>
</van-cell-group>
<van-cell-group class="form-section">
<template #title>
<div style="display: flex; align-items: center; justify-content: space-between">
<div>{{activity.keyWord}}信息</div>
<div>
<van-tag @click="delFamily" size="large" type="primary" color="#ff3b30">删除{{activity.keyWord}}</van-tag>
<van-tag @click="addFamily" size="large" type="primary" color="#1867b0">添加{{activity.keyWord}}</van-tag>
</div>
</div>
</template>
<div v-if="formData.mobileColumnsValue && formData.mobileColumnsValue.length > 0" class="mt10">
<van-tabs v-model="familyActive" type="card" color="#0e78c5" animated>
<van-tab v-for="item, index in formData.mobileColumnsValue"
:name="index + ''"
:title="activity.keyWord + (index + 1)"
:key="index">
<train-dynamic-form v-model="formData.mobileColumnsValue[index]"></train-dynamic-form>
</van-tab>
</van-tabs>
</div>
<div v-if="formData.mobileColumnsValue?.length === 0" class="companionList_empty_text">
<span>
暂无数据请添加{{activity.keyWord}}
</span>
</div>
</van-cell-group>
<div class="button">
<van-button @click="onSubmit" round type="info">提交</van-button>
</div>
</van-form>
</van-action-sheet>
</div>
`,
data() {
return {
familyActive: '',
row: {},
activity: {},
visible: false,
formData: {},
showCoursePicker: false,
courseTimeSelectList: [],
courseType: {},
}
},
components: {
"train-dynamic-form": httpVueLoader("/components/module/trainSignUp/TrainDynamicForm.vue")
},
methods: {
addFamily() {
if(this.formData.mobileColumnsValue.length >= this.activity.familyMaxCount) {
this.$toast(this.activity.keyWord + '最多人数为' + this.activity.familyMaxCount)
return
}
const list = clone(this.courseType.familyMobileSignColumnList)
this.formData.mobileColumnsValue.push(list)
},
delFamily() {
this.formData.mobileColumnsValue.splice(this.familyActive, 1)
const ac = (Number(this.familyActive) - 1)
this.familyActive = '' + (ac >= 0 ? ac : 0)
},
async onOpen(row, courseType, activity) {
this.row = row
this.courseType = courseType
this.activity = activity
this.init(row, courseType)
if(row.courseIsLimitApply) {
await this.getCourseTimeSelectList(row)
}
this.visible = true
},
init(row, courseType) {
this.$set(this.formData, 'username', this.$store.state.user.username)
this.$set(this.formData, 'loginname', this.$store.state.user.loginname)
this.$set(this.formData, 'unionName', this.$store.state.user.union.name)
this.$set(this.formData, 'unitName', this.$store.state.user.unit.name)
this.$set(this.formData, 'sex', this.$store.state.user.sex)
this.$set(this.formData, 'activityId', row.activityId)
this.$set(this.formData, 'courseId', row.id)
this.$set(this.formData, 'mobileColumnsValue', [])
},
onCourseConfirm(val){
this.formData.activityCourseId = val.value
this.$set(this.formData, "activityCourseId", val.value)
this.$set(this.formData, "courseTimeName", val.text.substring(0, 12))
this.showCoursePicker = false
},
async getCourseTimeSelectList(o) {
const resp = await this.$axios.post('/platform/family/apply/getCourseTimeSelectList',{courseId: o.id})
if (resp.code === 0) {
this.courseTimeSelectList = resp.data
} else {
this.$toast.fail("获取时段信息失败,请联系管理员")
}
},
validateIdCard(idCard) {
if (!idCard) {
return false
}
// 18位身份证号码校验
if (idCard.length === 18) {
const idCardRegex = /^[1-9]\d{5}(18|19|20)?\d{2}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}(\d|[Xx])$/
if (!idCardRegex.test(idCard)) {
return false
}
// 校验码计算
const weights = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
const checksums = ["1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"]
let sum = 0
for (let i = 0; i < 17; i++) {
sum += idCard[i] * weights[i]
}
const checksum = checksums[sum % 11]
return checksum === idCard[17].toUpperCase()
}
// 15位身份证号码校验
else if (idCard.length === 15) {
const idCardRegex = /^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/
return idCardRegex.test(idCard)
}
// 外国人或其他情况
else {
return false
}
},
validFamilyForm() {
// 校验规则映射
const validators = {
idCard: (value) => this.validateIdCard(value),
mobile: (value) => /^1[3-9]\d{9}$/.test(value),
email: (value) => /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(value)
};
// 显示提示弹窗(直接传完整的 message)
const showAlert = (message) => {
vant.Dialog.alert({
title: '提示',
message: message, // 直接使用传入的完整消息
confirmButtonColor: '#1867b0'
});
};
const { mobileColumnsValue } = this.formData;
for (let i = 0; i < mobileColumnsValue.length; i++) {
const family = mobileColumnsValue[i];
for (const col of family) {
const value = col.columnValue?.trim(); // 安全处理空值和空格
// 必填校验
if (col.isRequired && !value) {
const message = this.activity.keyWord + (i + 1) + '的' + col.columnName + '不能为空';
showAlert(message);
return false;
}
// 格式校验
if (col.validRule && value) {
const validator = validators[col.validRule];
if (validator && !validator(value)) {
const message = this.activity.keyWord + (i + 1) + '的' + col.columnName + '格式不正确';
showAlert(message);
return false;
}
}
if(col.validRule === 'idCard' && this.row.familyAgeLimit) {
const parseCard = this.parseIdCard(value)
if(this.row.minAge && parseCard.age < this.row.minAge) {
const message = '限制报名最小年龄为' + this.row.minAge;
showAlert(message);
return false;
}
if(this.row.maxAge && parseCard.age > this.row.maxAge) {
const message = '限制报名最大年龄为' + this.row.maxAge;
showAlert(message);
return false;
}
}
if(col.validRule === 'idCard' && this.row.familySexLimit) {
const parseCard = this.parseIdCard(value)
if(this.row.familySex && parseCard.sex !== this.row.familySex) {
const message = '限制报名性别为' + this.row.familySex;
showAlert(message);
return false;
}
}
}
}
return true;
},
parseIdCard(idCard) {
if (!idCard || (idCard.length !== 18 && idCard.length !== 15)) {
return null;
}
let birthStr = '';
let sexCode = '';
if (idCard.length === 15) {
birthStr = '19' + idCard.substring(6, 12);
sexCode = idCard.substring(14, 15); // 15位:第15位是性别
} else {
birthStr = idCard.substring(6, 14);
sexCode = idCard.substring(16, 17); // 18位:第17位是性别
}
const birthYear = parseInt(birthStr.substring(0, 4), 10);
const birthMonth = parseInt(birthStr.substring(4, 6), 10) - 1;
const birthDay = parseInt(birthStr.substring(6, 8), 10);
const birthDate = new Date(birthYear, birthMonth, birthDay);
const today = new Date();
let age = today.getFullYear() - birthDate.getFullYear();
const monthDiff = today.getMonth() - birthDate.getMonth();
const dayDiff = today.getDate() - birthDate.getDate();
if (monthDiff < 0 || (monthDiff === 0 && dayDiff < 0)) {
age--;
}
const sex = parseInt(sexCode, 10) % 2 === 1 ? '男' : '女';
return { age, sex, };
},
async validateSignUp() {
// 获取家属人数
const res = await this.$axios.post("/platform/family/apply/validateSignUp", {
courseId: this.formData.courseId,
currentFamilyNumber: this.formData.mobileColumnsValue.length || 0
})
if(res.code !== 0) {
this.$dialog.alert({title: '温馨提示', message: res.msg})
}
return res.code === 0
},
async validateCourseTime() {
const res = await this.$axios.post('/platform/family/apply/validateSourceSignUp', {
activityCourseId: this.formData.activityCourseId,
courseId: this.row.id
})
if(res.code !== 0) {
this.$dialog.alert({title: '温馨提示', message: res.msg})
}
return res.code === 0
},
async onSubmit() {
if (!this.validFamilyForm()) return
if (!await this.validateSignUp()) return
this.$refs.formRef.validate().then(() => {
this.$dialog.confirm({
title: "提示",
message: "您确定要提交吗?"
}).then(async () => {
if (this.row.courseIsLimitApply) {
if(!await this.validateCourseTime()) return
}
const formData = clone(this.formData)
let array = []
formData.mobileColumnsValue.forEach(item => {
const o = item.map((v) => {
return {
columnName: v.columnName,
columnValue: v.columnValue,
columnCode: v.columnCode,
columnFormType: v.columnFormType
}
})
array.push(o)
})
formData.mobileColumnsValue = JSON.stringify(clone(array))
this.$axios.post("/platform/family/apply/doSignUp", formData).then(res => {
this.$dialog.alert({title: '温馨提示', message: res.msg})
.then(() => {
if (res.code === 0) {
this.visible = false
this.$emit('refresh')
}
})
})
})
})
},
},
style: /*language=CSS*/ `
::v-deep .companionList_empty_text {
text-align: center;
padding: 10px 0;
font-size: 14px;
color: grey;
}
::v-deep .button {
position: fixed;
bottom: 0;
width: 100%;
}
`
}
@@ -0,0 +1,230 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<style scoped>
.primary-color {
color: var(--color-primary);
}
.sign_button .van-button{
width: 66px;
height: 30px;
font-size: 14px;
border-radius: 6px;
}
</style>
<div id="app">
<van-nav-bar title="活动报名" left-text="返回" left-arrow @click-left="historyBack" fixed placeholder></van-nav-bar>
<van-sticky offset-top="46px">
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
<van-dropdown-item v-model="pageForm.courseTypeId" :options="typeOptions" :multiple="false"
@change="doSearch"></van-dropdown-item>
</van-dropdown-menu>
</van-sticky>
<table-list api="/platform/family/apply/pageData"
:page_form.sync="pageForm"
ref="tableListRef"
@ready="onReady"
>
<template #header="{index,row}">
<div class="item-header">
<div class="item-title">{{ row.courseName }}</div>
<div v-html="calcSignUpCount(row)"></div>
</div>
</template>
<template v-slot="{index,row}">
<table-column label="类型">{{row.typeName}}</table-column>
<table-column label="校区">{{row.campus}}</table-column>
<table-column label="地点">{{row.courseLocation}}</table-column>
<table-column label="联系人">{{row.courseInstructor}}</table-column>
<table-column label="时间">
<span v-if="row.courseTimes && row.courseTimes.length === 1" class="primary-color" @click="onTime(row)">
{{ weekdayCNMap[$moment(row.courseTimes[0].courseDate).day()]
+ ' '
+ $moment(row.courseTimes[0].courseStartTime).format('MM月DD日 HH:mm')
+ '~'
+ $moment(row.courseTimes[0].courseEndTime).format('HH:mm') }}
</span>
<span v-else @click="onTime(row)" class="primary-color">点我查看</span>
</table-column>
<table-column v-if="row.introduce?.trim()" label="详细信息">
<span @click="introduceRow = row; introduceVisible = true" class="primary-color">点我查看</span>
</table-column>
</template>
<template #actions="{index,row}">
<div v-if="activity.wechat && row.isSign" class="action-btn" @click="this.vant.ImagePreview([activity.wechat])">
<i class="fa fa-wechat"></i>
<span>微信群二维码</span>
</div>
<template v-if="$moment().isBefore($moment(activity.activitySignUpEndTime))">
<div v-if="row.isSign === false" class="action-btn" @click="onApply(row)">
<i class="fa fa-sign-in"></i>
<span>我要报名</span>
</div>
<div v-if="row.isSign === true" class="action-btn delete" @click="onCancel(row)">
<i class="fa fa-trash"></i>
<span>取消报名</span>
</div>
</template>
<div v-if="row.isSign === true && row.isMobileSign === true && $moment().isAfter($moment(activity.activitySignUpEndTime))"
class="action-btn"
@click="onTime(row)"
>
<i class="fa fa-sign-in"></i>
<span>签到</span>
</div>
</template>
</table-list>
<van-action-sheet :close-on-click-overlay="false" title="详细信息" v-model="introduceVisible" cancel-text="取消">
<pdf-preview :content="introduceRow.introduce"></pdf-preview>
</van-action-sheet>
<times ref="timesRef"></times>
<apply-form ref="formRef" @refresh="refresh"></apply-form>
</div>
<script src="${base!}/assets/platform/plugins/jr-qrcode/jr-qrcode.js"></script>
<script>
<!--#include('../common/times.js'){}#-->
<!--#include('applyForm.js'){}#-->
const vue = new Vue({
el: "#app",
store,
components: {
'times': times,
'apply-form': applyForm,
"pdf-preview": httpVueLoader("/components/plugins/sysFilePreview/PdfIndex.vue?v=" + new Date().getTime())
},
data() {
return {
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: '',
year: new Date().getFullYear(),
courseTypeId: null,
activityId: GetQueryString('id'),
dataType: GetQueryString('dataType'),
},
typeOptions: [],
assortOptions: [],
sourceTypeOptions: [],
introduceVisible: false,
introduceRow: {},
activity: {},
weekdayCNMap: {0: '周日', 1: '周一', 2: '周二', 3: '周三', 4: '周四', 5: '周五', 6: '周六'},
}
},
methods: {
refresh() {
this.doSearch()
},
async onTime(row) {
// 如果设置签到,并且也报名的话
if(row.isMobileSign === true && row.isSign === true) {
const res = await this.$axios.post('/platform/family/mine/queryCourseSign', {
courseId: row.id
})
row.courseTimes = res.data
}
this.$refs.timesRef.onOpen(row)
},
onApply(row) {
const courseType = this.sourceTypeOptions.find((v) => v.id === row.courseType)
this.$axios.post('/platform/family/apply/validateSignUp', {
courseId: row.id
})
.then((res) => {
if (res.code !== 0) {
vant.Dialog.alert({
title: '提示',
message: res.msg,
confirmButtonColor: '#1867b0'
})
} else {
let lave = row.coursePeopleNumber - (row.hasRegisterNum + row.courseReservedNumber)
if(row.reserveMode === 2 && lave <= 0) {
vant.Dialog.alert({
title: '提示',
message: '您当前的报名为候补报名状态',
confirmButtonColor: '#1867b0'
})
}
this.$refs.formRef.onOpen(row, courseType, this.activity)
}
})
},
onCancel(row) {
vant.Dialog.confirm({
title: '温馨提示',
message: "您确定要<span style='color: red'>取消【" + row.courseName + "】</span>吗?",
confirmButtonColor: '#1867b0',
}).then(async () => {
const resp = await this.$axios.post('/platform/family/apply/cancelSignUp', {
activityId: row.activityId,
courseId: row.id
})
this.$toast(resp.msg)
if (resp.code === 0) {
this.doSearch()
}
}).catch(() => {})
},
calcSignUpCount(row) {
if(!row.coursePeopleNumber || row.coursePeopleNumber === 0) {
return "名额数不限制"
}
let lave = row.coursePeopleNumber - (row.hasRegisterNum + row.courseReservedNumber)
if(row.reserveMode === 2) {
let lave2 = row.waitingNum - row.hasWaitingNum
return "<span style='color: red'>余" + lave +"</span>/" + row.coursePeopleNumber + "人"
+ "<span style='color: red'>候补余" + lave2 + "</span>/" + row.waitingNum + "人"
} else {
return "<span style='color: red'>余" + lave +"</span>/" + row.coursePeopleNumber + "人"
}
},
async onReady() {
const typeList = await this.getCourseTypeList()
this.sourceTypeOptions = clone(typeList)
this.typeOptions = [
{
text: "全部类型",
value: null
}
].concat(typeList.map((v) => ({ text: v.typeName, value: v.id })))
if (this.typeOptions.length > 0) {
this.pageForm.type = this.typeOptions[0].value
this.doSearch()
}
this.fetchActivity()
},
fetchActivity() {
this.$axios.post('/platform/family/manage/findOne', {id: this.pageForm.activityId})
.then((res) => {
this.activity = res.data
})
},
async getCourseTypeList() {
const resp = await this.$axios.post("/platform/family/type/getAllType")
return resp.data
},
doSearch() {
this.$nextTick(() => {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.$refs.tableListRef.doSearch()
})
}
},
})
</script>
<!--#
}
#-->
@@ -0,0 +1,347 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<style scoped>
.info-title {
font-weight: bold;
background-color: white;
padding: 13px;
box-shadow: 0 8px 12px #ebedf0;
text-align: center !important;
}
.info-container {
}
.button {
position: fixed;
bottom: 0;
width: 100%;
}
.info-img {
display: block;
}
.van-count-down {
color: #fff;
}
.table-list-container {
padding: 0;
margin-top: 10px;
}
.table-list-container .table-list-item {
background-color: #fff;
border-bottom: 1px solid #eaecef;
padding: 16px;
position: relative;
margin-bottom: 10px;
}
.table-list-container .table-list-item:last-child {
border-bottom: none;
margin-bottom: 0;
}
.table-list-container .table-list-item .item-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 10px;
}
.table-list-container .table-list-item .item-title {
font-size: 16px;
font-weight: 500;
color: #1f2f3d;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1;
padding-right: 10px;
}
.table-list-container .table-list-item .img-container {
width: 100px;
height: 100px;
flex-shrink: 0;
border-radius: 6px;
}
.table-list-container .table-list-item .img-container img {
width: 100%;
height: 100%;
border-radius: 6px;
}
.table-list-container .table-list-item .item-meta {
display: flex;
color: #606266;
font-size: 14px;
margin-bottom: 5px;
padding: 4px 0;
}
.table-list-container .table-list-item .meta-item {
display: flex;
align-items: center;
gap: 8px;
width: 100%;
}
.table-list-container .table-list-item .meta-item i {
font-size: 14px;
color: #909399;
width: 16px;
text-align: center;
}
.table-list-container .table-list-item .item-content {
color: #606266;
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
line-height: 1.5;
}
.table-list-container .table-list-item .item-footer {
display: flex;
justify-content: space-between;
margin-top: 12px;
padding-top: 8px;
border-top: 1px dashed #eaecef;
color: #909399;
font-size: 13px;
}
.table-list-container .table-list-item .item-actions {
display: flex;
column-gap: 20px;
justify-content: end;
margin-top: 15px;
padding-top: 12px;
border-top: 1px solid #eaecef;
}
.table-list-container .table-list-item .action-btn {
display: flex;
align-items: center;
justify-content: end;
font-size: 14px;
color: var(--color-primary);
padding: 4px 0;
}
.table-list-container .table-list-item .action-btn i {
margin-right: 6px;
font-size: 16px;
}
.table-list-container .table-list-item .action-btn.delete {
color: #ff0000;
}
.table-list-container .table-list-item .action-btn.review {
color: #67c23a;
}
.table-list-container .empty-state {
text-align: center;
padding: 60px 20px;
color: #909399;
}
.table-list-container .empty-state i {
font-size: 60px;
margin-bottom: 16px;
color: #dcdee0;
}
.table-list-container .empty-state p {
margin-top: 10px;
font-size: 14px;
}
.table-column {
display: flex;
padding: 6px 0;
align-items: center;
}
.label {
color: #333;
font-size: 14px;
flex-shrink: 0;
max-width: 120px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.value {
color: #555;
font-size: 14px;
flex-grow: 1; /* 动态占据剩余部分 */
white-space: nowrap; /* 防止换行 */
overflow: hidden; /* 隐藏溢出的部分 */
text-overflow: ellipsis; /* 省略号 */
}
</style>
<div id="app">
<van-nav-bar title="亲子活动-我的报名" left-text="返回" left-arrow @click-left="historyBack" fixed placeholder></van-nav-bar>
<van-sticky offset-top="46px">
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
<year-van-dropdown-item :num="5" @change="doSearch" v-model="pageForm.year"></year-van-dropdown-item>
<van-dropdown-item v-model="pageForm.activityType" :options="typeOptions" :multiple="false"
@change="doSearch"></van-dropdown-item>
</van-dropdown-menu>
</van-sticky>
<table-list api="/platform/family/apply/activityPageData"
:page_form.sync="pageForm"
ref="tableListRef"
title="activityName"
img="cover"
@ready="onReady"
>
<template v-slot="{index,row}">
<table-column label="面向对象">{{row.activityGroupName}}</table-column>
<table-column label="报名时间">
{{$moment(row.activitySignUpStartTime).format('MM/DD HH:mm') + '~' + $moment(row.activitySignUpEndTime).format('MM/DD HH:mm')}}
</table-column>
<table-column label="活动时间">
{{$moment(row.activityStartTime).format('MM/DD HH:mm') + '~' + $moment(row.activityEndTime).format('MM/DD HH:mm')}}
</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
<i class="fa fa-eye"></i>
<span>活动介绍</span>
</div>
<div class="action-btn" @click="onInfo(row)">
<i class="fa fa-eye"></i>
<span>{{row.keyWord}}信息</span>
</div>
<div class="action-btn" @click="onApply(row)">
<i class="fa fa-edit"></i>
<span>操作</span>
</div>
</template>
</table-list>
<van-action-sheet :close-on-click-overlay="false" title="活动详细信息" v-model="infoVisible" cancel-text="取消">
<div class="info-container">
<div>
<van-image class="info-img" height="186" width="100%" :src="infoRow.cover"></van-image>
<div class="info-title">{{infoRow.activityName}}</div>
<pdf-preview :content="infoRow.introduce"></pdf-preview>
</div>
</div>
</van-action-sheet>
<van-action-sheet :close-on-click-overlay="false" title="报名信息" v-model="courseVisible" cancel-text="取消">
<div class="table-list-container">
<div v-for="(row, index) in mineCourses" :key="index" class="table-list-item">
<div class="item-header">
<div class="item-title" style="white-space: normal">{{ row.courseName }}</div>
</div>
<div style="display: flex;column-gap: 10px">
<div class="table-column">
<div class="label">校区:</div>
<div class="value">{{ row.campus }}</div>
</div>
</div>
<div style="display: flex;column-gap: 10px">
<div class="table-column">
<div class="label">地点:</div>
<div class="value">{{ row.courseLocation }}</div>
</div>
</div>
<div style="display: flex;column-gap: 10px">
<div class="table-column">
<div class="label">联系人:</div>
<div class="value">{{ row.courseInstructor }}</div>
</div>
</div>
<div style="display: flex;column-gap: 10px">
<div class="table-column">
<div class="label">家属人数:</div>
<div class="value">
{{ row.mobileColumnsValue ? JSON.parse(row.mobileColumnsValue).length : '暂无' }}
</div>
</div>
</div>
</div>
<div class="item-actions"></div>
</div>
</van-action-sheet>
</div>
<script>
const vue = new Vue({
el: "#app",
store,
components: {
"pdf-preview": httpVueLoader("/components/plugins/sysFilePreview/PdfIndex.vue?v=" + new Date().getTime())
},
data() {
return {
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: '',
year: new Date().getFullYear(),
activityType: 1,
dataType: 'mine'
},
typeOptions: [
{text: '全部', value: 1},
{text: '报名中', value: 2},
{text: '已结束', value: 3},
],
infoVisible: false,
infoRow: {},
mineCourses: [],
courseVisible: false,
}
},
methods: {
onView(row) {
this.infoRow = row
this.infoVisible = true
},
onApply(row) {
this.$pjaxReplace('/platform/family/apply/list/h5?id=' + row.id + '&dataType=mine')
},
onInfo(row) {
this.$axios.post('/platform/family/mine/queryMineCourse', {activityId: row.id})
.then((res) => {
this.mineCourses = res.data
this.courseVisible = true
})
},
onReady() {
this.doSearch()
},
doSearch() {
this.$nextTick(() => {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.$refs.tableListRef.doSearch()
})
}
},
})
</script>
<!--#
}
#-->
@@ -1,142 +0,0 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<style>
.van-image {
display: inherit;
}
.title {
font-weight: bold;
background-color: white;
padding: 13px;
box-shadow: 0 8px 12px #ebedf0;
text-align: center !important;
}
.van-tabs {
margin-top: 10px;
}
.van-tab {
-webkit-flex: none;
}
.van-tab--active {
color: #1867b0;
}
.van-tabs__nav--line {
padding-left: 10px;
}
.van-tabs__content {
padding: 13px 13px 50px 13px;
background-color: white;
line-height: 28px;
}
.content_title {
text-align: center;
}
.pre_text {
white-space: break-spaces;
padding-left: 7px;
/*margin-top: 30px;*/
}
</style>
<div id="app" v-cloak>
<van-nav-bar
title="活动详情"
left-text="返回"
left-arrow
@click-left="$pjaxReplace('/platform/mobile/trainSignUpActivity/trainList')"
></van-nav-bar>
<van-image height="186" src="/assets/mobile/img/trainSignUp/3quhtakfd4heeqsk6irqhft60p.png"></van-image>
<div class="title">{{activity.activityName}}</div>
<van-tabs v-model:active="tabActive" shrink>
<van-tab title="详细信息" name="a">
<div class="pre_text" v-html="activity.introduce"></div>
</van-tab>
</van-tabs>
<van-button @click="toSign" type="primary" block style="position: fixed; bottom: 0; z-index: 2">去报名</van-button>
</div>
<script>
new Vue({
el: "#app",
data() {
return {
trainType: "培训班",
trainTypeList: [],
tabActive: "a",
activityId: "",
activity: {}
}
},
methods: {
async findOne() {
const resp = await this.$axios.post("/platform/mobile/trainSignUpActivity/findOne", {
id: this.activityId,
tabIndex: 0
})
if (resp.code === 0) {
this.activity = resp.data
}
},
async toSign() {
const nowTime = this.$moment().unix()
if (nowTime < this.$moment(this.activity.activitySignUpStartTime).unix()) {
vant.Dialog.alert({
title: "提示",
message: "活动报名还未开始"
})
return
}
if (nowTime > this.$moment(this.activity.activitySignUpEndTime).unix()) {
vant.Dialog.alert({
title: "提示",
message: "活动报名已结束"
})
return
}
if (this.activity.activityGroupId != null) {
const isExist = await this.getScopeUser(this.activity.activityGroupId)
if (!isExist) {
vant.Dialog.alert({
title: "参加人员范围",
message: this.activity.activityGroupName
})
return
}
}
this.$pjaxReplace(
"/platform/mobile/trainSignUpActivity/trainInfo?activityId=" +
this.activity.id +
"&endTime=" +
this.activity.activitySignUpEndTime +
"&isMySign=" +
GetQueryString("isMySign")
)
},
async getScopeUser(activityGroupId) {
const resp = await this.$axios.post("/platform/activity/basic/scope/getScopeUser", { activityGroupId: activityGroupId })
return resp.data
}
},
async created() {
this.$businessTool.getDictOptions("TRAIN_SIGNUP_TYPE").then((data) => {
this.trainTypeList = data
})
this.activityId = GetQueryString("activityId")
this.findOne()
}
})
</script>
<!--#
}
#-->
@@ -11,9 +11,12 @@ layout("/layouts/platform_h5.html"){
text-align: center !important;
}
.info-container {
height: calc(100vh - 46px - 44px);
min-height: calc(100vh - 46px - 44px);
overflow-y: auto;
margin-bottom: 60px;
}
.button {
position: fixed;
bottom: 0;
width: 100%;
}
.info-img {
display: block;
@@ -62,25 +65,27 @@ layout("/layouts/platform_h5.html"){
</template>
</table-list>
<van-popup v-model="infoVisible" position="right" :style="{ width: '100%', height: '100%' }">
<van-nav-bar title="详细信息" left-text="返回" left-arrow @click-left="infoVisible = false" fixed placeholder></van-nav-bar>
<van-action-sheet :close-on-click-overlay="false" title="详细信息" v-model="infoVisible">
<div class="info-container">
<van-image class="info-img" height="186" width="100%" :src="infoRow.cover"></van-image>
<div class="info-title">{{infoRow.activityName}}</div>
<pdf-preview style="height: calc(100vh - 46px - 44px - 186px - 57px)" :content="infoRow.introduce"></pdf-preview>
<div>
<van-image class="info-img" height="186" width="100%" :src="infoRow.cover"></van-image>
<div class="info-title">{{infoRow.activityName}}</div>
<pdf-preview :content="infoRow.introduce"></pdf-preview>
</div>
<div class="button">
<van-button @click="onApply(infoRow)" type="primary" block>
<span v-if="time >= 0">
去报名
</span>
<template v-else>
距离开始
<van-count-down :time="Math.abs(time)" class="count-down" format="DD 天 HH 时 mm 分 ss 秒" @finish="time = 0"></van-count-down>
</template>
</van-button>
</div>
</div>
<van-button @click="onApply(infoRow)" type="primary" block>
<span v-if="time >= 0">
去报名
</span>
<template v-else>
距离开始
<van-count-down :time="Math.abs(time)" class="count-down" format="DD 天 HH 时 mm 分 ss 秒" @finish="time = 0"></van-count-down>
</template>
</van-button>
</van-popup>
</van-action-sheet>
</div>
@@ -100,7 +105,7 @@ layout("/layouts/platform_h5.html"){
totalCount: 0,
searchKeyword: '',
year: new Date().getFullYear(),
activityType: 2,
activityType: 4,
},
typeOptions: [
{text: '全部', value: 1},
@@ -3,8 +3,7 @@ const applyForm = {
/*language=HTML*/
`
<div>
<van-popup v-model="visible" position="right" :style="{ width: '100%', height: '100%', 'background-color': '#F7F8FA' }">
<van-nav-bar title="报名信息" left-text="返回" left-arrow @click-left="visible = false" fixed placeholder></van-nav-bar>
<van-action-sheet :close-on-click-overlay="false" title="报名信息" v-model="visible">
<van-form ref="formRef" class="form-container">
<van-cell-group title="活动信息" class="form-section">
<van-field label="活动名称" readonly v-model="row.courseName"></van-field>
@@ -18,12 +17,12 @@ const applyForm = {
<van-field label="所属工会" readonly v-model="formData.unionName"></van-field>
<van-field label="性别" readonly v-model="formData.sex"></van-field>
<template v-if="row.courseIsLimitApply">
<van-field label="报名时段"
required
<van-field label="报名时段"
required
:rules="[{ required: true, message: '请选择报名时段' }]"
readonly
readonly
@click="showCoursePicker = true"
placeholder="请选择报名时段"
placeholder="请选择报名时段"
name="courseTimeName"
v-model="formData.courseTimeName">
</van-field>
@@ -39,11 +38,11 @@ const applyForm = {
<train-dynamic-form v-model="dynamicColumnsData" ref="dynamicForm"></train-dynamic-form>
</van-cell-group>
<div class="form-actions">
<div class="button">
<van-button @click="onSubmit" round type="info">提交</van-button>
</div>
</van-form>
</van-popup>
</van-action-sheet>
</div>
`,
data() {
@@ -61,15 +60,15 @@ const applyForm = {
"train-dynamic-form": httpVueLoader("/components/module/trainSignUp/TrainDynamicForm.vue")
},
methods: {
async onOpen(row, course) {
async onOpen(row, courseType) {
this.row = row
this.init(row, course)
this.init(row, courseType)
if(row.courseIsLimitApply) {
await this.getCourseTimeSelectList(row)
}
this.visible = true
},
init(row, course) {
init(row, courseType) {
this.$set(this.formData, 'username', this.$store.state.user.username)
this.$set(this.formData, 'loginname', this.$store.state.user.loginname)
this.$set(this.formData, 'unionName', this.$store.state.user.union.name)
@@ -78,7 +77,7 @@ const applyForm = {
this.$set(this.formData, 'activityId', row.activityId)
this.$set(this.formData, 'courseId', row.id)
this.dynamicColumnsData = course ? course.trainMobileSignColumnList : []
this.dynamicColumnsData = courseType ? courseType.trainMobileSignColumnList : []
this.dynamicColumnsData.forEach((item) => {
item.columnValue = this.$store.state.user[item.columnCode] || ""
})
@@ -151,6 +150,10 @@ const applyForm = {
},
},
style: /*language=CSS*/ `
.button {
position: fixed;
bottom: 0;
width: 100%;
}
`
}
@@ -37,11 +37,16 @@ layout("/layouts/platform_h5.html"){
</template>
<template v-slot="{index,row}">
<table-column label="类型">{{row.typeName}}</table-column>
<table-column label="校区">{{row.campus}}</table-column>
<table-column label="地点">{{row.courseLocation}}</table-column>
<table-column label="联系人">{{row.courseInstructor}}</table-column>
<table-column label="时间">
<span v-if="row.courseTimes && row.courseTimes.length === 1">
{{ $moment(row.courseTimes[0].courseStartTime).format('HH:mm') + '~' + $moment(row.courseTimes[0].courseEndTime).format('HH:mm') }}
<span v-if="row.courseTimes && row.courseTimes.length === 1" class="primary-color" @click="onTime(row)">
{{ weekdayCNMap[$moment(row.courseTimes[0].courseDate).day()]
+ ' '
+ $moment(row.courseTimes[0].courseStartTime).format('MM月DD日 HH:mm')
+ '~'
+ $moment(row.courseTimes[0].courseEndTime).format('HH:mm') }}
</span>
<span v-else @click="onTime(row)" class="primary-color">点我查看</span>
</table-column>
@@ -74,10 +79,9 @@ layout("/layouts/platform_h5.html"){
</template>
</table-list>
<van-popup v-model="introduceVisible" position="right" :style="{ width: '100%', height: '100%', 'background-color': '#F7F8FA' }">
<van-nav-bar title="详细信息" left-text="返回" left-arrow @click-left="introduceVisible = false" fixed placeholder></van-nav-bar>
<pdf-preview style="height: calc(100vh - 46px)" :content="introduceRow.introduce"></pdf-preview>
</van-popup>
<van-action-sheet :close-on-click-overlay="false" title="详细信息" v-model="introduceVisible" cancel-text="取消">
<pdf-preview :content="introduceRow.introduce"></pdf-preview>
</van-action-sheet>
<times ref="timesRef"></times>
<apply-form ref="formRef" @refresh="refresh"></apply-form>
@@ -114,6 +118,8 @@ layout("/layouts/platform_h5.html"){
introduceRow: {},
activity: {},
weekdayCNMap: {0: '周日', 1: '周一', 2: '周二', 3: '周三', 4: '周四', 5: '周五', 6: '周六'},
}
},
methods: {
@@ -131,7 +137,7 @@ layout("/layouts/platform_h5.html"){
this.$refs.timesRef.onOpen(row)
},
onApply(row) {
const course = this.sourceTypeOptions.find((v) => v.id === row.courseType)
const courseType = this.sourceTypeOptions.find((v) => v.id === row.courseType)
this.$axios.post('/platform/trainSingUp/apply/validateSignUp', {
courseId: row.id
})
@@ -151,7 +157,7 @@ layout("/layouts/platform_h5.html"){
confirmButtonColor: '#1867b0'
})
}
this.$refs.formRef.onOpen(row, course)
this.$refs.formRef.onOpen(row, courseType)
}
})
},
@@ -172,6 +178,9 @@ layout("/layouts/platform_h5.html"){
}).catch(() => {})
},
calcSignUpCount(row) {
if(!row.coursePeopleNumber || row.coursePeopleNumber === 0) {
return "名额数不限制"
}
let lave = row.coursePeopleNumber - (row.hasRegisterNum + row.courseReservedNumber)
if(row.reserveMode === 2) {
let lave2 = row.waitingNum - row.hasWaitingNum
@@ -11,9 +11,12 @@ layout("/layouts/platform_h5.html"){
text-align: center !important;
}
.info-container {
height: calc(100vh - 46px - 44px);
min-height: calc(100vh - 46px - 44px);
overflow-y: auto;
}
.button {
position: fixed;
bottom: 0;
width: 100%;
}
.info-img {
display: block;
@@ -62,17 +65,16 @@ layout("/layouts/platform_h5.html"){
</template>
</table-list>
<van-popup v-model="infoVisible" position="right" :style="{ width: '100%', height: '100%' }">
<van-nav-bar title="详细信息" left-text="返回" left-arrow @click-left="infoVisible = false" fixed placeholder></van-nav-bar>
<van-action-sheet :close-on-click-overlay="false" title="活动详细信息" v-model="infoVisible" cancel-text="取消">
<div class="info-container">
<van-image class="info-img" height="186" width="100%" :src="infoRow.cover"></van-image>
<div class="info-title">{{infoRow.activityName}}</div>
<pdf-preview style="height: calc(100vh - 46px - 44px - 186px - 57px)" :content="infoRow.introduce"></pdf-preview>
<div>
<van-image class="info-img" height="186" width="100%" :src="infoRow.cover"></van-image>
<div class="info-title">{{infoRow.activityName}}</div>
<pdf-preview :content="infoRow.introduce"></pdf-preview>
</div>
</div>
<van-button @click="onApply(infoRow)" type="primary" block>下一步</van-button>
</van-popup>
</van-action-sheet>
</div>
@@ -1,817 +0,0 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<style>
.van-card {
background: #ffffff;
margin-top: 10px;
}
.van-card__thumb {
display: flex;
align-items: center;
justify-content: center;
}
.van-card__content > div {
display: flex;
flex-direction: column;
}
.van-doc-card {
margin: 14px;
padding: 16px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 8px 12px #ebedf0;
line-height: 25px;
font-size: 12px;
}
.van-doc-card-my {
margin: 14px;
padding: 16px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 8px 12px #ebedf0;
line-height: 25px;
font-size: 12px;
}
.train-title {
color: grey;
}
.content {
padding: 16px 16px 10px;
min-height: 100px;
max-height: 360px;
}
.text {
color: #cccdd1;
}
.time {
font-family: -webkit-pictograph, serif;
text-align: right;
}
.popup {
width: 90%;
max-height: 70%;
overflow-y: auto;
border-radius: 10px;
padding: 2px 10px 12px 10px;
}
.van-card__thumb {
width: 35px;
height: 38px;
margin-right: 20px;
margin-top: 5px;
}
.van-card__content {
min-height: 30px;
}
.van-card__title {
font-weight: bold;
font-size: 13px;
margin-top: 4px;
}
.van-dropdown-menu__item {
flex: auto;
}
.van-empty {
background-color: transparent;
position: relative;
transform: translate(0%, 50%);
left: 0;
}
.joinPopup {
width: 100%;
height: 100%;
background-color: #f6f7f9;
}
.join_content {
padding: 20px;
/*height: calc(100% - 40px - 46px - 60px);*/
height: calc(100vh - 46px - 50px);
overflow-y: auto;
}
.join_submit {
width: 100% !important;
}
.van-card-header {
padding: 14px 20px;
border-bottom: 1px solid #ebeef5;
box-sizing: border-box;
color: #0e78c5;
font-weight: bold;
}
.van-card-body {
padding: 0px 10px 0px 10px;
}
.van-doc-card-two {
background-color: #fff;
border-radius: 10px;
box-shadow: 0 8px 12px #ebedf0;
line-height: 25px;
font-size: 12px;
}
.footer .van-button {
border-radius: 6px;
}
.amap-logo {
display: none !important;
}
.amap-copyright {
opacity: 0;
}
.van-tabs__nav--complete {
padding: 0;
}
</style>
<div id="app" v-cloak>
<van-nav-bar
:title="trainType + '列表'"
left-text="返回"
left-arrow
@click-left="$pjaxReplace('/platform/mobile/trainSignUpActivity/trainList?isMySign=' + isMySign)"
></van-nav-bar>
<van-sticky>
<van-dropdown-menu>
<van-dropdown-item @change="tabChange" v-model="activityStatus" :options="activityOptions"></van-dropdown-item>
<van-dropdown-item @change="courseChange" v-model="courseType" :options="courseOptions"></van-dropdown-item>
</van-dropdown-menu>
</van-sticky>
<van-tabs v-if="activityStatus != '1' && assortList.length > 0" v-model="assort" type="card" style="margin-top: 10px" @click="tabClick">
<van-tab v-for="item in assortList" :key="item" :name="item" :title="item"></van-tab>
</van-tabs>
<template>
<div id="parentDiv" v-if="tableData.courseList && tableData.courseList.length>0">
<template v-for="o in tableData.courseList">
<div style="position: relative" :class="activityStatus !== '1' ? 'van-doc-card' : 'van-doc-card-my'">
<div>
<van-tag :plain="false" type="primary" size="medium">{{getCourseTypeName(o)}}</van-tag>
<span style="font-weight: bold; font-size: 14px">
{{o.courseName}}
<span v-if="activityStatus !== '1'">
<span v-html="calcSignUpCount(o)"></span>
</span>
</span>
</div>
<div>
<span class="train-title">&emsp;&emsp;区:</span>
<span>{{o.campus}}</span>
</div>
<div>
<span class="train-title">活动地点:</span>
<span>{{o.courseLocation}}</span>
</div>
<div>
<span class="train-title">&ensp;&ensp;人:</span>
<span>{{o.courseInstructor}}</span>
</div>
<div>
<span class="train-title">活动时间:</span>
<span v-if="o.courseTimeList && o.courseTimeList.length > 1" @click="trainClick(o)" style="color: #1867b0">点我查看</span>
<span @click="trainClick(o)" v-if="o.courseTimeList && o.courseTimeList.length === 1" style="color: #1867b0">
{{o.courseTimeList[0].courseStartTime.substring(11, 19) + ' ~ ' + o.courseTimeList[0].courseEndTime.substring(11, 19)}}
</span>
</div>
<div>
<span @click.stop="showPic(tableData.wechat)" v-if="o.isSign === true && tableData.wechat" style="color: #dd6363">
点我查看微信群二维码
</span>
</div>
<van-button
type="primary"
round
size="mini"
v-if="activityStatus !== '1' && o.isSign === false"
style="position: absolute; left: 74%; bottom: 10%; width: 74px; height: 28px"
@click.stop="signUp(o)"
>
我要报名
</van-button>
<van-button
type="primary"
color="#dd6363"
round
size="mini"
v-if="o.isSign === true && $moment().valueOf() < $moment(activity.activitySignUpEndTime).valueOf()"
style="position: absolute; left: 74%; bottom: 10%; width: 74px; height: 28px"
@click.stop="cancel(o)"
>
取消报名
</van-button>
<image
v-if="activityStatus !== '1' && o.isSign === true && $moment().valueOf() >= $moment(activity.activitySignUpEndTime).valueOf()"
style="position: absolute; left: 77%; top: 58%"
src="/assets/mobile/svg/trainSignUp/sign_up.svg"
></image>
<div
@click="trainClick(o)"
v-if="activityStatus === '1'"
style="
text-align: center;
line-height: 40px;
width: 40px;
height: 40px;
display: inline-block;
font-size: 14px;
position: absolute;
right: -10px;
top: 8%;
background-color: #00c698;
border-radius: 7px;
color: white;
"
>
签到
</div>
</div>
</template>
</div>
<van-empty v-else image="/assets/platform/plugins/vant-green/images/nodata/nodata.png" description="暂无数据"></van-empty>
</template>
<van-popup v-model:show="popupShow" class="popup">
<div id="map" v-if="course.isMobileSign === true && course.signType === 3" style="width: 100%; height: 250px"></div>
<van-card
:title="item.courseStartTime.substring(0, 10) + '' +
getWeek(item.courseStartTime.substring(0, 10)) + ''"
v-for="(item,index) in qdArray"
:key="index"
thumb="/assets/mobile/svg/trainSignUp/qd1.svg"
>
<template #desc>
<div style="margin-top: 7px">{{item.courseStartTime.substring(11, 19) + ' ~ ' + item.courseEndTime.substring(11, 19)}}</div>
<div v-if="item.courseLocationCoordinates && item.isMobileSign === true && activityStatus === '1'">
<van-button
type="primary"
color="#1867b0"
round
size="mini"
@click.stop="showQRCode(item, 2)"
v-if="(item.isAttend === true && course.giftType === 1 && item.state === 1)
|| ($moment().unix() > $moment(item.courseEndTime).unix() && item.state === 3 && item.isAttend === true && course.giftType === 1)"
style="position: absolute; right: 65px; top: 25%; width: 60px; height: 25px"
>
礼品码
</van-button>
<van-button
type="primary"
color="#e1e1e1"
round
size="mini"
v-if="(item.isAttend === false && findTime(item) === false && item.state === 1)
|| ($moment().unix() > $moment(item.courseEndTime).unix() && item.state === 3 && item.isAttend === false)"
style="position: absolute; right: 0; top: 25%; width: 60px; height: 25px"
>
未签到
</van-button>
<van-button
type="primary"
color="#1867b0"
round
size="mini"
v-if="(item.isAttend === false && findTime(item) === true && item.state === 1)
|| ($moment().unix() > $moment(item.courseEndTime).unix() && item.state === 3 && item.isAttend === false)"
style="position: absolute; right: 0; top: 25%; width: 60px; height: 25px"
@click.stop="signIn(item)"
>
签 到
</van-button>
<van-button
type="primary"
color="#61ce98"
round
size="mini"
v-if="(item.isAttend === true && item.state === 1)
|| ($moment().unix() > $moment(item.courseEndTime).unix() && item.state === 3 && item.isAttend === true)"
style="position: absolute; right: 0; top: 25%; width: 60px; height: 25px"
>
已签到
</van-button>
</div>
</template>
</van-card>
</van-popup>
<van-popup class="joinPopup" position="right" v-model:show="joinPopup">
<van-nav-bar @click-left="joinPopup = false" left-text="返回" fixed left-arrow placeholder title="活动报名"></van-nav-bar>
<div class="join_content">
<van-form @submit="joinSubmit" :show-error-message="false">
<div class="van-doc-card-two" style="margin: 0 0 16px 0">
<div></div>
<div class="van-card-header">基础信息</div>
<div class="van-card-body">
<van-field name="userName" label="姓名" readonly v-model="formData.userName"></van-field>
<van-field name="loginName" label="工号" readonly v-model="formData.loginName"></van-field>
<van-field name="unitName" label="所在单位" readonly v-model="formData.unitName"></van-field>
<van-field name="unionName" label="所属工会" readonly v-model="formData.unionName"></van-field>
<van-field name="sex" label="性别" readonly v-model="formData.sex"></van-field>
<van-field
label="联系方式"
required
name="mobile"
:rules="[{ required: true, message: '请填写联系方式' }]"
placeholder="请填写联系方式"
v-model="formData.mobile"
></van-field>
<train-dynamic-form v-model="dynamicColumnsData" ref="trainDynamicForm"></train-dynamic-form>
</div>
</div>
<div class="footer">
<van-button class="join_submit" type="primary">提交报名</van-button>
</div>
</van-form>
</div>
</van-popup>
</div>
<script src="${base!}/assets/platform/plugins/jr-qrcode/jr-qrcode.js"></script>
<script>
let locations = null
let map = null
let geolocation = null
new Vue({
el: "#app",
store,
data() {
return {
loading: false,
tableData: [],
formData: {},
assort: "",
assortList: [],
allColumnsData: [],
dynamicColumnsData: [],
trainType: "培训班",
trainTypeList: [],
actionShow: false,
timeList: [],
activityId: "",
activityStatus: "0",
joinPopup: false,
popupShow: false,
courseText: "",
qdInfoList: [],
course: [],
qdArray: [],
activityOptions: [
{ text: "全部", value: "0" },
{ text: "我报名的", value: "1" }
],
courseOptions: [],
courseType: "0",
tempArray: [],
activitySignUpStartTime: null,
choose: {},
activity: "",
isMySign: 0
}
},
components: {
"train-dynamic-form": httpVueLoader("/components/module/trainSignUp/TrainDynamicForm.vue")
},
methods: {
tabClick(name, title) {
if (this.courseType === "0" && this.activityStatus !== "1") {
this.tableData.courseList = this.tempArray.courseList.filter((o) => o.assort === title)
} else {
this.tableData.courseList = this.tempArray.courseList.filter((o) => o.assort === title && o.courseType === this.courseType)
}
},
calcSignUpCount(o) {
let lave = (o.coursePeopleNumber + o.hasWaitingNum) - (o.hasRegisterNum + o.courseReservedNumber)
if(o.reserveMode === 2) {
let lave2 = o.waitingNum - o.hasWaitingNum
let str = "<span style='color: red'>余" + lave +"</span>/" + o.coursePeopleNumber + "人"
+ "<span style='color: red'>候补余" + lave2 + "</span>/" + o.waitingNum + "人)"
return str
} else {
return "<span style='color: red'>余" + lave +"</span>/" + o.coursePeopleNumber + "人)"
}
},
getCourseTypeName(o) {
const b = this.courseOptions.find((item) => item.value === o.courseType)
return b ? b.text : ""
},
//二维码
showQRCode(item, type) {
const o = {
userId: item.userId,
signId: item.id,
activityId: item.activityId,
activityCourseId: item.activityCourseId,
isMobileSign: item.isMobileSign,
signType: item.signType,
isReceiveGift: item.isReceiveGift,
giftType: item.giftType,
type: type
}
// 生成二维码的 base64 编码
const content = jrQrcode.getQrBase64(JSON.stringify(o))
vant.ImagePreview([content])
},
showPic(url) {
vant.ImagePreview([url])
},
findTime(o) {
const today = this.$moment().format("YYYY-MM-DD")
return o.courseStartTime.substr(0, 10) === today
},
findQd() {
const today = this.$moment().format("YYYY-MM-DD")
const day = this.qdInfoList.find((item) => {
return item.courseStartTime.substr(0, 10) === today
})
if (day === undefined) {
return 3
} else {
return day.isAttend ? 2 : 1
}
},
async signIn(o) {
if (o.signType === 1) {
vant.Dialog.alert({ message: "功能马上推出,敬请期待!" })
return
}
if (o.signType === 2) {
this.showQRCode(o, 1)
}
if (o.signType === 3) {
const start = new Date(o.courseStartTime).getTime() - 1000 * 60 * 30
const end = new Date(o.courseEndTime).getTime()
const now = new Date().getTime()
if (now < start || now > end) {
vant.Toast("请在规定时间签到")
return
}
const that = this
geolocation.getCurrentPosition(async function (status, result) {
if (status === "complete") {
locations = [result.position.getLng(), result.position.getLat()]
//用户当前位置
const userPoint = new AMap.LngLat(result.position.getLng(), result.position.getLat())
//课程位置
const coursePoint = new AMap.LngLat(that.course.courseLocationCoordinates[0], that.course.courseLocationCoordinates[1])
const distance = Math.round(userPoint.distance(coursePoint))
if (distance > 250) {
vant.Toast("请在250米内签到")
return
}
const array = [result.position.getLng(), result.position.getLat()]
const resp = await this.$axios.post("/platform/mobile/trainSignUpActivity/doQd", {
id: o.id,
courseId: that.course.id,
point: JSON.stringify(array)
})
if (resp.code === 0) {
await that.pageData()
}
vant.Toast(resp.msg)
that.popupShow = false
} else {
}
})
}
},
//获取当前坐标点
getPoint() {
/*return new Promise((resolve, reject) => {
window.navigator.geolocation.getCurrentPosition(position => {
pointArray = [position.coords.longitude, position.coords.latitude]
resolve(pointArray)
}, error => {
vant.Toast(error.message)
pointArray = []
reject([])
})
})*/
geolocation.getCurrentPosition(function (status, result) {
if (status === "complete") {
//alert(result.position)
locations = result.position
} else {
}
})
},
cancel(o) {
vant.Dialog.confirm({
title: "温馨提示",
message: "您确定要<span style='color: red'>取消【" + o.courseName + "】</span>吗?",
confirmButtonColor: "#1867b0"
})
.then(async () => {
const resp = await this.$axios.post("/platform/mobile/trainSignUpActivity/cancelSignUp", {
activityId: o.activityId,
courseId: o.id
})
vant.Toast(resp.msg)
if (resp.code === 0) {
await this.pageData()
}
})
.catch(() => {})
},
async signUp(o) {
this.choose = o
const res = await this.$axios.post("/platform/mobile/trainSignUpActivity/validateSignUp", {
courseId: o.id
})
if (res.code !== 0) {
vant.Dialog.alert({
title: "提示",
message: res.msg
})
if (res.code !== 3) {
return
}
}
this.formData = {
userName: this.$store.state.user.username,
loginName: this.$store.state.user.loginname,
mobile: this.$store.state.user.mobile,
sex: this.$store.state.user.sex,
birthday: this.$store.state.user.birthday,
unionName: this.$store.state.user.union.name,
unitName: this.$store.state.user.unit.name
}
this.$set(this.formData, "activityId", o.activityId)
this.$set(this.formData, "courseId", o.id)
const column = this.allColumnsData.find((x) => x.id === o.courseType)
this.dynamicColumnsData = column ? column.trainMobileSignColumnList : []
this.dynamicColumnsData.forEach((item) => {
item.columnValue = ""
})
this.joinPopup = true
},
async joinSubmit() {
let valid = false
try {
await this.$refs.trainDynamicForm.$refs.form.validate()
valid = true
} catch (e) {
valid = false
}
if (!valid) return
//获取家属是多少人
let per = 0
this.dynamicColumnsData.forEach((item) => {
if (item.columnCode === "xdqsrs") {
per += Number(item.columnValue)
}
})
const res = await this.$axios.post("/platform/mobile/trainSignUpActivity/validateSignUp", {
courseId: this.choose.id,
currentFamilyNumber: per
})
if (res.code !== 0) {
vant.Dialog.alert({
title: "提示",
message: res.msg
})
return
}
vant.Dialog.confirm({
title: "温馨提示",
message: "您确定要选择【" + this.choose.courseName + "】吗?"
})
.then(async () => {
const toast = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
message: "努力提交中"
})
const mobileColumnsValue = this.dynamicColumnsData.map((v) => {
return {
columnName: v.columnName,
columnValue: v.columnValue,
columnCode: v.columnCode,
columnFormType: v.columnFormType
}
})
this.formData.mobileColumnsValue = JSON.stringify(mobileColumnsValue)
const resp = await this.$axios.post("/platform/mobile/trainSignUpActivity/doSignUp", this.formData)
vant.Toast(resp.msg)
if (resp.code === 0) {
await this.pageData()
this.joinPopup = false
}
toast.clear()
})
.catch(() => {})
},
trainClick(o) {
this.timeList = o.courseTimeList
this.course = o
this.qdArray =
this.activityStatus === "0"
? o.courseTimeList
: this.qdInfoList.filter((item) => {
return item.courseId === o.id
})
if (o.signType === 3) {
this.initMap(o)
}
this.popupShow = true
},
initMap(o) {
if (o.courseLocationCoordinates && o.courseLocationCoordinates.length < 2) {
return
}
this.$nextTick(async () => {
// 地图初始化应该在地图容器div已经添加到DOM树之后
map = new AMap.Map("map", {
zoom: 12,
center: o.courseLocationCoordinates,
resizeEnable: true,
scrollWheel: true
})
AMap.plugin("AMap.Geolocation", function () {
geolocation = new AMap.Geolocation({
// 是否使用高精度定位,默认:true
enableHighAccuracy: true,
// 设置定位超时时间,默认:无穷大
timeout: 10000,
// 定位按钮的停靠位置的偏移量,默认:Pixel(10, 20)
buttonOffset: new AMap.Pixel(10, 20),
// 定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
//zoomToAccuracy: true,
// 定位按钮的排放位置, RB表示右下
buttonPosition: "RB",
showCircle: false
//showButton: false,
})
map.addControl(geolocation)
})
// 创建一个 Marker 实例:
var marker = new AMap.Marker({
position: new AMap.LngLat(o.courseLocationCoordinates[0], o.courseLocationCoordinates[1]), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
title: "签到点"
})
//获取当前坐标点
await this.getPoint()
var circle = new AMap.Circle({
center: new AMap.LngLat(o.courseLocationCoordinates[0], o.courseLocationCoordinates[1]), // 圆心位置
radius: 250, // 圆半径
borderWeight: 1,
strokeOpacity: 1,
fillOpacity: 0.4
})
map.add(circle)
// 缩放地图到合适的视野级别
map.setFitView([circle])
// 多个点实例组成的数组
var markerList = [marker]
map.add(markerList)
})
},
async pageData() {
const resp = await this.$axios.post("/platform/mobile/trainSignUpActivity/findOne", {
id: this.activityId,
tabIndex: this.activityStatus
})
if (resp.code === 0) {
this.tableData = resp.data
this.assortList = Array.from(new Set(this.tableData.courseList.map((o) => o.assort).filter((o) => o !== "" && o !== undefined)))
this.tempArray = JSON.parse(JSON.stringify(this.tableData))
if (this.assortList.length > 0 && this.activityStatus !== "1") {
this.tableData.courseList = this.tableData.courseList.filter((o) => o.assort === this.assortList[0])
}
const type = this.trainTypeList.find((o) => o.code === this.tableData.trainType)
this.trainType = type ? type.name : "培训班"
} else {
this.tableData = []
this.loading = false
}
await this.getQdInfoList()
this.courseChange(this.courseType, 1)
this.loading = false
},
async getQdInfoList() {
const resp = await this.$axios.post("/platform/mobile/trainSignUpActivity/getQdInfoList", {
activityId: this.activityId
})
if (resp.code === 0) {
this.qdInfoList = resp.data
}
},
getWeek(dateString) {
var dateArray = dateString.split("-")
const date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2])
return "周" + "日一二三四五六".charAt(date.getDay())
},
tabChange(val) {
this.tabName = val
this.tableData = []
this.pageData()
},
async getAllType() {
const resp = await this.$axios.post("/platform/trainSingUp/type/getAllType", {})
this.allColumnsData = resp.data
return resp.data
},
async getCourseText() {
const courseArray = await this.getAllType()
this.courseOptions = []
this.courseOptions.push({ text: "全部类型", value: "0" })
for (const item of courseArray) {
if (item.personMaxRegisterNum > 0) {
this.courseText += item.value + "报名最多选" + item.personMaxRegisterNum + "项,"
}
this.courseOptions.push({ text: item.typeName, value: item.id })
}
this.courseText = this.courseText.substr(0, this.courseText.length - 1)
},
courseChange(value, item) {
if (item === undefined) {
this.tableData.courseList = []
}
if (this.assortList.length > 0 && this.activityStatus !== "1") {
if (value === "0") {
this.tableData.courseList = this.tempArray.courseList.filter((o) => o.assort === this.assort)
} else {
this.tableData.courseList = this.tempArray.courseList.filter(
(item) => item.courseType === value && item.assort === this.assort
)
}
} else {
this.tableData.courseList =
value === "0" ? this.tempArray.courseList : this.tempArray.courseList.filter((item) => item.courseType === value)
}
},
async getActivity() {
const resp = await this.$axios.post("/platform/mobile/trainSignUpActivity/findOne", {
id: this.activityId,
tabIndex: 0
})
if (resp.code === 0) {
this.activity = resp.data
}
}
},
async created() {
this.$businessTool.getDictOptions("TRAIN_SIGNUP_TYPE").then((data) => {
this.trainTypeList = data
})
this.activityId = GetQueryString("activityId")
this.isMySign = Number(GetQueryString("isMySign"))
const time = GetQueryString("endTime")
if (this.isMySign === 1) {
this.activityOptions = [{ text: "我报名的", value: "1" }]
this.activityStatus = "1"
} else {
this.activityOptions = [
{ text: "全部", value: "0" },
{ text: "我报名的", value: "1" }
]
this.activityStatus = new Date().getTime() > new Date(time).getTime() ? "1" : "0"
}
this.activitySignUpStartTime = GetQueryString("activitySignUpStartTime")
vant.Toast.setDefaultOptions({ duration: 2000 })
this.pageData()
await this.getCourseText()
await this.getActivity()
}
})
</script>
<!--#
}
#-->
@@ -1,258 +0,0 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<style>
.van-card {
background: #ffffff;
margin: 10px auto 0;
width: 96%;
border-radius: 10px;
padding: 14px 12px;
}
.van-card__thumb {
display: flex;
align-items: center;
justify-content: center;
}
.van-card__content > div {
height: 100%;
display: flex;
flex-direction: column;
}
.train-title {
flex: 0.6;
margin-top: 4px;
}
.van-doc-card {
margin: 14px;
padding: 12px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 8px 12px #ebedf0;
line-height: 20px;
font-size: 12px;
position: relative;
}
.van-divider {
margin: 6px 0 5px 0px;
border-color: #1867b0;
}
.van-image__img {
max-height: 200px;
}
.van-image__error,
.van-image__loading {
height: 200px;
position: relative;
}
.tag {
position: absolute;
display: inline-block;
background-color: #1867b0;
color: #fff;
font-size: 10px;
top: 1px;
border-radius: 6px;
right: -8px;
padding: 1px 7px;
transform: rotate(17deg);
}
</style>
<div id="app" v-cloak>
<van-nav-bar title="活动列表" @click-left="historyBack" left-arrow left-text="返回" placeholder fixed></van-nav-bar>
<van-sticky offset-top="46px">
<van-dropdown-menu>
<van-dropdown-item v-model="pageForm.year" :options="yearList" @change="formChange"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.activityStatus" :options="activityStatusList" @change="formChange"></van-dropdown-item>
</van-dropdown-menu>
</van-sticky>
<div>
<van-list :finished="finished" finished-text="没有更多了" v-if="tableData && tableData.length>0" v-model="loading" @load="pageData">
<div v-for="o in tableData" class="van-doc-card">
<div>
<div class="tag" style="background-color: #bc62c5" v-if="o.isDisabled">活动未开启</div>
<div class="tag" v-else-if="!o.isDisabled && $moment(o.activitySignUpStartTime).valueOf() > $moment().valueOf()">未开始报名</div>
<div
class="tag"
v-else-if="!o.isDisabled && $moment(o.activitySignUpEndTime).valueOf() > $moment().valueOf() && $moment().valueOf() > $moment(o.activitySignUpStartTime).valueOf()"
>
报名中
</div>
<div
class="tag"
style="background-color: #f14646"
v-else-if="!o.isDisabled && $moment(o.activityEndTime).valueOf() < $moment().valueOf() && $moment().valueOf() < $moment(o.activityStartTime).valueOf()"
>
报名结束
</div>
<div
class="tag"
v-else-if="!o.isDisabled && $moment(o.activityStartTime).valueOf() < $moment().valueOf() && $moment().valueOf() < $moment(o.activityEndTime).valueOf()"
>
活动进行中
</div>
<div
class="tag"
style="background-color: #f14646"
v-else-if="!o.isDisabled && $moment().valueOf() > $moment(o.activityEndTime).valueOf()"
>
活动结束
</div>
</div>
<div @click="activityClick(o)">
<div>
<van-image :src="o.cover" style="display: contents" v-if="o.cover"></van-image>
<van-image src="" style="display: contents" v-else></van-image>
</div>
<div>
<div class="van-ellipsis" style="margin-top: 6px; font-size: 15px; font-weight: bold; flex: 1">{{o.activityName}}</div>
</div>
<div>
<div class="train-title">
<span style="color: grey">&emsp;&nbsp;&emsp;度:</span>
<span>{{o.year}}</span>
</div>
<div class="train-title">
<span style="color: grey">活动对象:</span>
<span>{{o.activityGroupName}}</span>
</div>
<van-divider></van-divider>
</div>
<div class="train-title">
<span style="color: grey">报名时间:</span>
<span>{{$moment(o.activitySignUpStartTime).format('YYYY-MM-DD HH:mm')}}</span>
<span>~</span>
<span>{{$moment(o.activitySignUpEndTime).format('YYYY-MM-DD HH:mm') }}</span>
</div>
<div style="margin-top: 6px">
<span style="color: grey">活动时间:</span>
<span>{{$moment(o.activityStartTime).format('YYYY-MM-DD HH:mm')}}</span>
<span>~</span>
<span>{{$moment(o.activityEndTime).format('YYYY-MM-DD HH:mm') }}</span>
</div>
</div>
</div>
</van-list>
<van-empty v-else image="/assets/platform/plugins/vant-green/images/nodata/nodata.png" description="暂无数据"></van-empty>
</div>
<van-tabbar v-model="pageForm.activityType" @change="doSearch">
<van-tabbar-item icon="wap-home-o">活动列表</van-tabbar-item>
<van-tabbar-item icon="user-o">我报名的</van-tabbar-item>
</van-tabbar>
</div>
<script>
new Vue({
el: "#app",
store,
data() {
return {
finished: false,
loading: false,
tableData: [],
tarBarActive: 0,
pageForm: {
year: "",
activityStatus: null,
pageNumber: 1,
pageSize: 5,
totalCount: 0,
searchKeyword: "",
activityType: 0
},
activityLevelList: [],
activityStatusList: [
{ text: "全部", value: 1 },
{ text: "未开始", value: 6 },
{ text: "报名中", value: 2 },
{ text: "进行中", value: 3 },
{ text: "已结束", value: 4 }
],
yearList: []
}
},
methods: {
createYearList() {
for (let i = new Date().getFullYear() - 50; i <= new Date().getFullYear(); i++) {
this.yearList.unshift({ value: i, text: i + "年" })
}
},
doSearch() {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.tableData = []
this.pageData()
},
formChange() {
this.pageForm.pageNumber = 1
this.tableData = []
this.pageData()
},
async activityClick(o) {
if (o.isDisabled) {
this.$toast("活动未开启")
return
}
if (this.$moment(o.applyStartTime).valueOf() > this.$moment().valueOf()) {
this.$toast("活动未开始报名")
return
}
this.$pjaxReplace(
"/platform/mobile/trainSignUpActivity/activityInfo?activityId=" +
o.id +
"&endTime=" +
o.activitySignUpEndTime +
"&isMySign=" +
this.pageForm.activityType
)
},
async pageData() {
const resp = await this.$axios.post("/platform/mobile/trainSignUpActivity/pageData", this.pageForm)
if (resp.code === 0) {
if (resp.data.list.length === 0) {
this.tableData = []
this.loading = false
this.finished = true
} else {
this.tableData = this.tableData.concat(resp.data.list)
}
if (this.tableData.length === resp.data.totalCount) {
this.finished = true
} else {
this.pageForm.pageNumber++
}
}
this.loading = false
},
tabChange(val) {
this.tabName = val
this.tableData = []
this.pageForm.pageNumber = 1
this.pageData()
},
async init() {
this.$set(this.pageForm, "activityStatus", 1)
this.$set(this.pageForm, "year", new Date().getFullYear())
}
},
async created() {
this.createYearList()
await this.init()
this.pageData()
this.pageForm.activityType = Number(GetQueryString("isMySign"))
}
})
</script>
<!--#
}
#-->