This commit is contained in:
server
2025-11-27 10:45:45 +08:00
parent d2cdc72f3c
commit 4b12f3d5a5
22 changed files with 265 additions and 173 deletions
@@ -1,5 +1,6 @@
package com.budwk.app.sys.controller; package com.budwk.app.sys.controller;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.stp.StpUtil; import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
@@ -77,9 +78,7 @@ public class SysLoginController {
@At("/noPermission") @At("/noPermission")
@Ok("beetl:/platform/sys/noPermission.html") @Ok("beetl:/platform/sys/noPermission.html")
@Filters @Filters
public void noPermission() { public void noPermission() {}
}
@At("/doLogin") @At("/doLogin")
@Ok("json") @Ok("json")
@@ -142,43 +141,22 @@ public class SysLoginController {
@At @At
@Ok("json") @Ok("re")
@ApiOperation("小程序账号密码登录") @SaCheckLogin
public Result weAppLogin(@Param("username") String username, @Param("password") String password, HttpServletRequest req) { @ApiOperation("小程序桥接界面")
if (StrUtil.isBlank(username)) { public String weAppLogin() {
return Result.error("用户名不能为空"); return "beetl:/platform/zhghh5/sys/weappcheck/index.html";
}
if (StrUtil.isBlank(password)) {
return Result.error("密码不能为空");
}
String lockKey = RedisConstant.USER_LOGIN_LOCK_PREFIX + username;
int errCount = Convert.toInt(StrUtil.blankToDefault(redisService.get(lockKey), "0"));
log.info("用户名:" + username + "登录失败次数:" + errCount);
if (errCount > 5) {
redisService.setex(lockKey, 5 * 60, String.valueOf(errCount + 1));
return Result.error("登录失败次数过多,请5分钟后再试");
}
try {
Sys_user user = sysUserService.loginByIdCardLastNum(username, password);
if (user == null) {
throw new BaseException("用户登录失败");
}
sysUserService.loginPlus(user, LoginType.WE_APP, req);
// redisService.del(lockKey);
return Result.success("login.success").addData(StpUtil.getTokenInfo());
} catch (Exception e) {
log.error(e.getMessage(), e);
redisService.set(lockKey, Convert.toStr(errCount + 1));
return Result.error(e.getMessage());
}
} }
@At
@Ok("json")
@ApiOperation("登录信息")
@SaCheckLogin
public Result getWeAppToken(){
return Result.success("login.success").addData(StpUtil.getTokenInfo());
}
@At(value = "/platform/wxwork/oauth2/callback", top = true) @At(value = "/platform/wxwork/oauth2/callback", top = true)
@Ok("re") @Ok("re")
@@ -305,7 +305,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<Sys_user> implements Sys
String decodePwd = Base64Decoder.decodeStr(passowrd); String decodePwd = Base64Decoder.decodeStr(passowrd);
String hashedPassword = PwdUtil.getPassword(decodePwd, user.getSalt()); String hashedPassword = PwdUtil.getPassword(decodePwd, user.getSalt());
if (!Strings.sNull(hashedPassword).equalsIgnoreCase(user.getPassword())) { if (!Strings.sNull(hashedPassword).equalsIgnoreCase(user.getPassword())) {
// throw new BaseException("用户名或者密码不正确"); throw new BaseException("用户名或者密码不正确");
} }
user = this.fetchLinks(user, "unit"); user = this.fetchLinks(user, "unit");
if (Lang.isNotEmpty(user.getUnit()) && StrUtil.isNotBlank(user.getUnit().getUnionId())) { if (Lang.isNotEmpty(user.getUnit()) && StrUtil.isNotBlank(user.getUnit().getUnionId())) {
@@ -320,7 +320,9 @@ public class ActivityBasicScopeController {
if (activityUserScopePageParam.getActivityGroupId() != null) { if (activityUserScopePageParam.getActivityGroupId() != null) {
Sql sqlx = Sqls.createf("SELECT userId FROM activity_user_scope where groupId = '%s'", activityUserScopePageParam.getActivityGroupId()); Sql sqlx = Sqls.createf("SELECT userId FROM activity_user_scope where groupId = '%s'", activityUserScopePageParam.getActivityGroupId());
cnd.and("u.id", activityUserScopePageParam.getReverseSelection() ? "IN" : "NOT IN", sqlx); List<NutMap> userList = baseService.listMap(sqlx);
List<String> userIds = userList.stream().map(v -> v.getString("userId")).toList();
cnd.and("u.id", activityUserScopePageParam.getReverseSelection() ? "IN" : "NOT IN", userIds);
} }
cnd.andEX("u.id", IN_OR_NIN_OP, activityUserScopePageParam.getUserId()); cnd.andEX("u.id", IN_OR_NIN_OP, activityUserScopePageParam.getUserId());
@@ -49,7 +49,7 @@ public class QsvSurveyServiceImpl extends BaseServiceImpl<QsvUserAnswerRecord> i
try { try {
// 查询用户答题记录 // 查询用户答题记录
List<QsvUserAnswerRecord> answerRecords = dao().query(QsvUserAnswerRecord.class, Cnd.where(QsvUserAnswerRecord::getActivityId, "=", activityId)); List<QsvUserAnswerRecord> answerRecords = dao().query(QsvUserAnswerRecord.class, Cnd.where(QsvUserAnswerRecord::getActivityId, "=", activityId).and("isFinish","=",1));
// 将答题记录的扩展JSON转换为JSONObject列表 // 将答题记录的扩展JSON转换为JSONObject列表
List<JSONObject> answerExtList = answerRecords.stream().map(QsvUserAnswerRecord::getExtJson).toList(); List<JSONObject> answerExtList = answerRecords.stream().map(QsvUserAnswerRecord::getExtJson).toList();
@@ -88,11 +88,23 @@ public class ActivitySchoolEvent extends BaseModel implements Serializable {
@ColDefine(type = ColType.INT, width = 8) @ColDefine(type = ColType.INT, width = 8)
private Integer leanderNum; private Integer leanderNum;
@Column
@Comment("领队是否必须是运动员")
@ColDefine(type = ColType.BOOLEAN)
@Default("0")
private Boolean leanderIsAthlete;
@Column @Column
@Comment("组合方式2:教练人数") @Comment("组合方式2:教练人数")
@ColDefine(type = ColType.INT, width = 8) @ColDefine(type = ColType.INT, width = 8)
private Integer coachNum; private Integer coachNum;
@Column
@Comment("教练是否必须是运动员")
@ColDefine(type = ColType.BOOLEAN)
@Default("0")
private Boolean coachIsAthlete;
@Column @Column
@Comment("组合方式2:女队人数") @Comment("组合方式2:女队人数")
@ColDefine(type = ColType.INT, width = 8) @ColDefine(type = ColType.INT, width = 8)
@@ -104,7 +104,7 @@ public class ActivitySportsApplyUserServiceImpl extends BaseServiceImpl<Activity
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(),
RoleConstant.BRANCH_UNION_CHAIRMAN.name())) { RoleConstant.BRANCH_UNION_CHAIRMAN.name(), RoleConstant.BRANCH_UNION_WENTI_WY.name())) {
// cnd.where().andLike("school.applyWay ", "1"); // cnd.where().andLike("school.applyWay ", "1");
cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=school.activityGroupId AND userId='%s') >0".formatted(SecurityUtil.getUserId()))); cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=school.activityGroupId AND userId='%s') >0".formatted(SecurityUtil.getUserId())));
@@ -166,7 +166,7 @@ public class ActivitySportsApplyUserServiceImpl extends BaseServiceImpl<Activity
//查询报名中 //查询报名中
if (isActivity == 2) { if (isActivity == 2) {
cnd.and(new Static("now() >applyStartTime and now() < applyEndTime")); cnd.and(new Static("(now() >applyStartTime and now() < applyEndTime) or now() <applyStartTime"));
}//查询已结束的 }//查询已结束的
else if (isActivity == 3) { else if (isActivity == 3) {
cnd.and(new Static("now() > school.applyEndTime")); cnd.and(new Static("now() > school.applyEndTime"));
@@ -182,7 +182,7 @@ public class ActivitySportsApplyUserServiceImpl extends BaseServiceImpl<Activity
} }
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(),
RoleConstant.BRANCH_UNION_CHAIRMAN.name())) { RoleConstant.BRANCH_UNION_CHAIRMAN.name(), RoleConstant.BRANCH_UNION_WENTI_WY.name())) {
// cnd.and(new Static("JSON_CONTAINS(school.applyWay,JSON_ARRAY( 1))>0")); // cnd.and(new Static("JSON_CONTAINS(school.applyWay,JSON_ARRAY( 1))>0"));
cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=school.activityGroupId AND userId='%s') >0".formatted(SecurityUtil.getUserId()))); cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=school.activityGroupId AND userId='%s') >0".formatted(SecurityUtil.getUserId())));
} }
@@ -233,7 +233,7 @@ public class MTrainSignUpActivityController {
.and("state", "!=", 2)); .and("state", "!=", 2));
int hasRegisterNum = signUpUsers.size() + 1;//+1是算自己 int hasRegisterNum = signUpUsers.size() + 1;//+1是算自己
if(hasRegisterNum > course.getCoursePeopleNumber()) { if(hasRegisterNum > course.getCoursePeopleNumber()) {
return Result.error(3, "您当前的报名为候补报名状态"); return Result.error(99, "您当前的报名为候补报名状态");
} }
} }
return Result.success(); return Result.success();
@@ -5,6 +5,7 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.export.ExcelExportService; import cn.afterturn.easypoi.excel.export.ExcelExportService;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.page.Pagination; import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm; import com.budwk.app.base.param.PageForm;
@@ -139,6 +140,7 @@ public class TrainSignUpActivityStatisticsController {
u.unitName, u.unitName,
u.unionName, u.unionName,
u.sex, u.sex,
u.personType,
if(ts.mobile is null, u.mobile, ts.mobile) as mobile, if(ts.mobile is null, u.mobile, ts.mobile) as mobile,
u.birthday, u.birthday,
tsc.courseName, tsc.courseName,
@@ -150,7 +152,7 @@ public class TrainSignUpActivityStatisticsController {
left join train_sign_up_course tsc on tsc.id = ts.courseId left join train_sign_up_course tsc on tsc.id = ts.courseId
WHERE WHERE
ts.activityId = @activityId ts.activityId = @activityId
ORDER BY FIELD( ts.state, 1, 3, 2, 4 ),u.unionid desc, u.unitid desc ORDER BY FIELD( ts.state, 1, 3, 2, 4 ),u.unionid desc, u.unitid desc,ts.signUpTime asc
""").setParam("activityId", activityId); """).setParam("activityId", activityId);
List<NutMap> userList = trainSignUpActivityManageService.listMap(sql); List<NutMap> userList = trainSignUpActivityManageService.listMap(sql);
userList.forEach(item -> { userList.forEach(item -> {
@@ -163,6 +165,8 @@ public class TrainSignUpActivityStatisticsController {
} else if (item.getInt("state") == 4) { } else if (item.getInt("state") == 4) {
item.setv("stateName", "无效报名(缺席)"); item.setv("stateName", "无效报名(缺席)");
} }
item.setv("birthday", DateUtil.format(item.getTime("birthday"),"yyyy-MM-dd"));
item.setv("signUpTime", DateUtil.format(item.getTime("signUpTime"),"yyyy-MM-dd HH:mm:ss"));
}); });
List<ExcelExportEntity> excelCommonExportEntity = new ArrayList<>(); List<ExcelExportEntity> excelCommonExportEntity = new ArrayList<>();
@@ -172,8 +176,9 @@ public class TrainSignUpActivityStatisticsController {
excelCommonExportEntity.add(new ExcelExportEntity("分工会", "unionName", 20)); excelCommonExportEntity.add(new ExcelExportEntity("分工会", "unionName", 20));
excelCommonExportEntity.add(new ExcelExportEntity("性别", "sex", 20)); excelCommonExportEntity.add(new ExcelExportEntity("性别", "sex", 20));
excelCommonExportEntity.add(new ExcelExportEntity("手机号", "mobile", 20)); excelCommonExportEntity.add(new ExcelExportEntity("手机号", "mobile", 20));
excelCommonExportEntity.add(new ExcelExportEntity("生日", "birthday", 20)); excelCommonExportEntity.add(new ExcelExportEntity("教职工类别", "personType", 20));
excelCommonExportEntity.add(new ExcelExportEntity("报名状态", "stateName", 20)); excelCommonExportEntity.add(new ExcelExportEntity("报名状态", "stateName", 20));
excelCommonExportEntity.add(new ExcelExportEntity("报名时间", "signUpTime", 30));
List<TrainSignUpCourse> courseList = dao.query(TrainSignUpCourse.class, Cnd.where("activityId", "=", activityId)); List<TrainSignUpCourse> courseList = dao.query(TrainSignUpCourse.class, Cnd.where("activityId", "=", activityId));
Map<String, TrainSignUpCourse> courseMap = courseList.stream().collect(Collectors.toMap(o -> o.getId(), o -> o)); Map<String, TrainSignUpCourse> courseMap = courseList.stream().collect(Collectors.toMap(o -> o.getId(), o -> o));
@@ -105,7 +105,7 @@ public class SysClub extends BaseModel {
private List<JSONObject> establishReport; private List<JSONObject> establishReport;
@Column @Column
@Comment("章程草案") @Comment("章程")
@ColDefine(type = ColType.MYSQL_JSON) @ColDefine(type = ColType.MYSQL_JSON)
private List<JSONObject> rulesFile; private List<JSONObject> rulesFile;
@@ -77,9 +77,11 @@ var ACTIVITY_SPORTS_APPLY_USER = {
<!--如果是正常报名--> <!--如果是正常报名-->
<template v-if="!activityTableData.isLeader"> <template v-if="!activityTableData.isLeader">
<div style="display: flex;margin: 20px 0;align-items: center;"> <div style="display: flex;margin: 20px 0;align-items: center;">
<el-divider content-position="left">每支队伍最多 <!-- 每支队伍最多
{{activityTableData.restrictMaxNum}} {{activityTableData.restrictMaxNum}}
人,其中领队{{activityTableData.leanderNum}}人, 人,其中-->
<el-divider content-position="left">
报名人员限制:领队{{activityTableData.leanderNum}}人,
教练{{activityTableData.coachNum}}人, 教练{{activityTableData.coachNum}}人,
运动员必须设置{{activityTableData.athleteMaxNum}}人, 运动员必须设置{{activityTableData.athleteMaxNum}}人,
替补{{activityTableData.substituteNum}}人。 替补{{activityTableData.substituteNum}}人。
@@ -507,6 +509,8 @@ var ACTIVITY_SPORTS_APPLY_USER = {
restrictGirlNum, restrictGirlNum,
restrictBoyNum, restrictBoyNum,
leanderNum, leanderNum,
leanderIsAthlete,
coachIsAthlete,
coachNum, coachNum,
deputyDirectorNum, deputyDirectorNum,
substituteNum, substituteNum,
@@ -542,6 +546,14 @@ var ACTIVITY_SPORTS_APPLY_USER = {
message = teamName + "领队应设置" + leanderNum + "人" message = teamName + "领队应设置" + leanderNum + "人"
break break
} }
if (leanderNum > 0 && leanderIsAthlete) {
const num = teamApplyData[i].filter((v) => v.identity.includes("3") && !v.identity.includes("1")).length
if (num>0){
msgFlag = false
message = teamName + "领队必须是运动员!"
break
}
}
//教练 //教练
const jlNum = teamApplyData[i].filter((v) => v.identity.includes("2")).length const jlNum = teamApplyData[i].filter((v) => v.identity.includes("2")).length
if (coachNum > 0 && (jlNum > coachNum || jlNum === 0)) { if (coachNum > 0 && (jlNum > coachNum || jlNum === 0)) {
@@ -549,6 +561,15 @@ var ACTIVITY_SPORTS_APPLY_USER = {
message = teamName + "教练应设置" + coachNum + "人" message = teamName + "教练应设置" + coachNum + "人"
break break
} }
debugger
if (coachNum > 0 && coachIsAthlete) {
const num = teamApplyData[i].filter((v) => v.identity.includes("2") && !v.identity.includes("1")).length
if (num>0){
msgFlag = false
message = teamName + "教练必须是运动员!"
break
}
}
//运动员 //运动员
const ydyNum = teamApplyData[i].filter((v) => v.identity.includes("1")).length const ydyNum = teamApplyData[i].filter((v) => v.identity.includes("1")).length
if (athletesMaxNum > 0 && (ydyNum > athletesMaxNum || ydyNum < athletesMaxNum)) { if (athletesMaxNum > 0 && (ydyNum > athletesMaxNum || ydyNum < athletesMaxNum)) {
@@ -38,7 +38,7 @@ layout("/layouts/platform.html"){
<search-item label=""> <search-item label="">
<el-radio-group @change="activityInfoData" v-model="pageForm.isActivity"> <el-radio-group @change="activityInfoData" v-model="pageForm.isActivity">
<el-radio-button :label="1">全部</el-radio-button> <el-radio-button :label="1">全部</el-radio-button>
<el-radio-button :label="2">报名中</el-radio-button> <el-radio-button :label="2">即将开始&报名中</el-radio-button>
<el-radio-button :label="3">已结束</el-radio-button> <el-radio-button :label="3">已结束</el-radio-button>
</el-radio-group> </el-radio-group>
</search-item> </search-item>
@@ -305,7 +305,7 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
<el-row :gutter="40"> <el-row :gutter="40">
<el-col :span="12"> <el-col :span="12">
<el-form-item prop="leanderNum" label="领队人数(可兼运动员)"> <el-form-item prop="leanderNum" label="领队人数(可兼运动员)">
<el-checkbox v-model="eventForm.leanderIsAthlete" v-if="eventForm.leanderNum>0">领队是否必须是运动员</el-checkbox>
<el-input-number style="width: 100%" v-model="eventForm.leanderNum" <el-input-number style="width: 100%" v-model="eventForm.leanderNum"
placeholder="请填写领队人数" controls-position="right" :precision="0" placeholder="请填写领队人数" controls-position="right" :precision="0"
:max="100000" :min="0"></el-input-number> :max="100000" :min="0"></el-input-number>
@@ -314,6 +314,7 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
<el-col :span="12"> <el-col :span="12">
<el-form-item prop="coachNum" label="教练人数(可兼运动员)"> <el-form-item prop="coachNum" label="教练人数(可兼运动员)">
<el-checkbox v-model="eventForm.coachIsAthlete" v-if="eventForm.coachNum>0">教练是否必须是运动员</el-checkbox>
<el-input-number style="width: 100%" v-model="eventForm.coachNum" <el-input-number style="width: 100%" v-model="eventForm.coachNum"
placeholder="请填写教练人数" controls-position="right" :precision="0" placeholder="请填写教练人数" controls-position="right" :precision="0"
:max="100000" :min="0"></el-input-number> :max="100000" :min="0"></el-input-number>
@@ -97,7 +97,7 @@ layout("/layouts/platform.html"){
</template> </template>
<template #edit_func> <template #edit_func>
<el-button @click="doSave" type="primary">保 存</el-button> <!-- <el-button @click="doSave" type="primary">保 存</el-button>-->
<el-button @click="doOperate" type="primary">提 交</el-button> <el-button @click="doOperate" type="primary">提 交</el-button>
</template> </template>
<template #edit> <template #edit>
@@ -501,7 +501,7 @@ layout("/layouts/platform.html"){
}) })
if (res.code !== 0) { if (res.code !== 0) {
this.$message.warning(res.msg) this.$message.warning(res.msg)
if (res.code !== 3) { if (res.code !== 99) {
return return
} }
} }
@@ -97,8 +97,8 @@ layout("/layouts/platform.html"){
registerUserTableColumns: [ registerUserTableColumns: [
{ label: "姓名", prop: "username" }, { label: "姓名", prop: "username" },
{ label: "一卡通号", prop: "loginname" }, { label: "一卡通号", prop: "loginname" },
{ label: "单位", prop: "unitName" }, { label: "单位", prop: "unitname" },
{ label: "分工会", prop: "unionName" }, { label: "分工会", prop: "unionname" },
{ label: "联系方式", prop: "mobile" }, { label: "联系方式", prop: "mobile" },
{ label: "报名时间", prop: "signUpTime" }, { label: "报名时间", prop: "signUpTime" },
{ label: "报名状态", prop: "state" } { label: "报名状态", prop: "state" }
@@ -31,7 +31,7 @@ const REGISTER_INFO_COMPONENT = {
<div class="text-left" v-html="viewData.introduce"></div> <div class="text-left" v-html="viewData.introduce"></div>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :span="4"> <el-descriptions-item :span="4">
<template slot="label">活动形式</template> <template slot="label">协会宗旨</template>
<div class="text-left" v-html="viewData.purpose"></div> <div class="text-left" v-html="viewData.purpose"></div>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :span="2"> <el-descriptions-item :span="2">
@@ -39,7 +39,7 @@ const REGISTER_INFO_COMPONENT = {
<file-preview :files="viewData.establishReport" complete_result></file-preview> <file-preview :files="viewData.establishReport" complete_result></file-preview>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :span="2"> <el-descriptions-item :span="2">
<template slot="label">章程草案</template> <template slot="label">章程</template>
<file-preview :files="viewData.rulesFile" complete_result></file-preview> <file-preview :files="viewData.rulesFile" complete_result></file-preview>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :span="2"> <el-descriptions-item :span="2">
@@ -78,11 +78,11 @@ const CLUB_FORM_TEMPLATE = {
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="协会介绍及宗旨" prop="introduce"> <el-form-item label="协会介绍" prop="introduce">
<text-editor v-model="formData.introduce"></text-editor> <text-editor v-model="formData.introduce"></text-editor>
</el-form-item> </el-form-item>
<el-form-item label="活动形式" prop="purpose"> <el-form-item label="协会宗旨" prop="purpose">
<text-editor v-model="formData.purpose"></text-editor> <text-editor v-model="formData.purpose"></text-editor>
</el-form-item> </el-form-item>
@@ -100,7 +100,7 @@ const CLUB_FORM_TEMPLATE = {
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="章程草案" prop="rulesFile"> <el-form-item label="章程" prop="rulesFile">
<file-upload <file-upload
:value.sync="formData.rulesFile" :value.sync="formData.rulesFile"
:upload_number="5" :upload_number="5"
@@ -162,9 +162,10 @@ const CLUB_FORM_TEMPLATE = {
clubCode: [{ required: false, message: "请填写协会编码", trigger: ["blur", "change"] }], clubCode: [{ required: false, message: "请填写协会编码", trigger: ["blur", "change"] }],
clubType: [{ required: true, message: "请选择协会类型", trigger: ["blur", "change"] }], clubType: [{ required: true, message: "请选择协会类型", trigger: ["blur", "change"] }],
concatPerson: [{ required: true, message: "请选择协会联系人", trigger: ["blur", "change"] }], concatPerson: [{ required: true, message: "请选择协会联系人", trigger: ["blur", "change"] }],
foundTime: [{ required: true, message: "请选择成立时间", trigger: ["blur", "change"] }] foundTime: [{ required: true, message: "请选择成立时间", trigger: ["blur", "change"] }],
due: [{ required: true, message: "请输入会费标准", trigger: ["blur", "change"] }],
// establishReport: [{ required: true, message: "请上传申请成立报告", trigger: ["blur", "change"] }] // establishReport: [{ required: true, message: "请上传申请成立报告", trigger: ["blur", "change"] }]
//rulesFile: [{ required: true, message: "请上传章程草案", trigger: ["blur", "change"] }], rulesFile: [{ required: true, message: "请上传章程", trigger: ["blur", "change"] }],
//manageFile: [{ required: true, message: "请上传经费来源及管理办法", trigger: ["blur", "change"] }], //manageFile: [{ required: true, message: "请上传经费来源及管理办法", trigger: ["blur", "change"] }],
//yearPlanFile: [{ required: true, message: "请上传年度活动计划", trigger: ["blur", "change"] }] //yearPlanFile: [{ required: true, message: "请上传年度活动计划", trigger: ["blur", "change"] }]
} }
@@ -106,8 +106,8 @@ layout("/layouts/platform.html"){
</guava> </guava>
</div> </div>
<script> <script>
<!--#include("../../member/common/audit/memberAuditChangeInfo.js"){}#--> <!--#include("../../member/change/common/memberAllChangeInfo.js"){}#-->
<!--#include("../../member/common/change/memberChangeInfo.js"){}#--> <!--#include("../../member/change/common/memberChange.js"){}#-->
<!--#include("../../member/common/info/memberInfo.js"){}#--> <!--#include("../../member/common/info/memberInfo.js"){}#-->
new Vue({ new Vue({
el: "#app", el: "#app",
@@ -175,8 +175,8 @@ layout("/layouts/platform.html"){
} }
}, },
components: { components: {
'member-audit-change-info': MEMBER_AUDIT_CHANGE_INFO, 'member-audit-change-info': MEMBER_ALL_CHANGE_INFO,
'member-change-info': MEMBER_CHANGE_INFO, 'member-change-info': MEMBER_CHANGE,
'member-info': MEMBER_INFO 'member-info': MEMBER_INFO
}, },
methods: { methods: {
@@ -105,7 +105,7 @@ layout("/layouts/platform_h5.html"){
], ],
stateList: [ stateList: [
{value: 1, text: "全部"}, {value: 1, text: "全部"},
{value: 2, text: "报名中"}, {value: 2, text: "即将开始&报名中"},
{value: 3, text: "报名已结束"} {value: 3, text: "报名已结束"}
], ],
subLoading: false, subLoading: false,
@@ -49,7 +49,7 @@ layout("/layouts/platform_h5.html"){
<div id="app" v-cloak> <div id="app" v-cloak>
<van-nav-bar title="活动详情" @click-left="historyBack" left-arrow left-text="返回" placeholder fixed></van-nav-bar> <van-nav-bar title="活动详情" @click-left="historyBack" left-arrow left-text="返回" placeholder fixed></van-nav-bar>
<van-image height="186" src="/assets/mobile/img/trainSignUp/3quhtakfd4heeqsk6irqhft60p.png"></van-image> <van-image height="186" :src="activity.cover"></van-image>
<div class="title">{{activity.activityName}}</div> <div class="title">{{activity.activityName}}</div>
<van-tabs v-model:active="tabActive" shrink> <van-tabs v-model:active="tabActive" shrink>
@@ -147,16 +147,19 @@ layout("/layouts/platform_h5.html"){
} }
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<van-nav-bar :title="trainType + '列表'" @click-left="historyBack" left-arrow left-text="返回" placeholder fixed></van-nav-bar> <van-nav-bar :title="trainType + '列表'" @click-left="historyBack" left-arrow left-text="返回" placeholder
fixed></van-nav-bar>
<van-sticky> <van-sticky>
<van-dropdown-menu> <van-dropdown-menu>
<van-dropdown-item @change="tabChange" v-model="activityStatus" :options="activityOptions"></van-dropdown-item> <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-item @change="courseChange" v-model="courseType" :options="courseOptions"></van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</van-sticky> </van-sticky>
<van-tabs v-if="activityStatus != '1' && assortList.length > 0" v-model="assort" type="card" style="margin-top: 10px" @click="tabClick"> <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-tab v-for="item in assortList" :key="item" :name="item" :title="item"></van-tab>
</van-tabs> </van-tabs>
@@ -187,49 +190,52 @@ layout("/layouts/platform_h5.html"){
</div> </div>
<div> <div>
<span class="train-title">活动时间:</span> <span class="train-title">活动时间:</span>
<span v-if="o.courseTimeList && o.courseTimeList.length > 1" @click="trainClick(o)" style="color: #1867b0">点我查看</span> <span v-if="o.courseTimeList && o.courseTimeList.length > 1" @click="trainClick(o)"
<span @click="trainClick(o)" v-if="o.courseTimeList && o.courseTimeList.length === 1" style="color: #1867b0"> 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)}} {{o.courseTimeList[0].courseStartTime.substring(11, 19) + ' ~ ' + o.courseTimeList[0].courseEndTime.substring(11, 19)}}
</span> </span>
</div> </div>
<div> <div>
<span @click.stop="showPic(tableData.wechat)" v-if="o.isSign === true && tableData.wechat" style="color: #dd6363"> <span @click.stop="showPic(tableData.wechat)" v-if="o.isSign === true && tableData.wechat"
style="color: #dd6363">
点我查看微信群二维码 点我查看微信群二维码
</span> </span>
</div> </div>
<van-button <van-button
type="primary" type="primary"
round round
size="mini" size="mini"
v-if="activityStatus !== '1' && o.isSign === false" v-if="activityStatus !== '1' && o.isSign === false"
style="position: absolute; left: 74%; bottom: 10%; width: 74px; height: 28px" style="position: absolute; left: 74%; bottom: 10%; width: 74px; height: 28px"
@click.stop="signUp(o)" @click.stop="signUp(o)"
> >
我要报名 我要报名
</van-button> </van-button>
<van-button <van-button
type="primary" type="primary"
color="#dd6363" color="#dd6363"
round round
size="mini" size="mini"
v-if="o.isSign === true && $moment().valueOf() < $moment(activity.activitySignUpEndTime).valueOf()" v-if="o.isSign === true && $moment().valueOf() < $moment(activity.activitySignUpEndTime).valueOf()"
style="position: absolute; left: 74%; bottom: 10%; width: 74px; height: 28px" style="position: absolute; left: 74%; bottom: 10%; width: 74px; height: 28px"
@click.stop="cancel(o)" @click.stop="cancel(o)"
> >
取消报名 取消报名
</van-button> </van-button>
<image <image
v-if="activityStatus !== '1' && o.isSign === true && $moment().valueOf() >= $moment(activity.activitySignUpEndTime).valueOf()" v-if="activityStatus !== '1' && o.isSign === true && $moment().valueOf() >= $moment(activity.activitySignUpEndTime).valueOf()"
style="position: absolute; left: 77%; top: 58%" style="position: absolute; left: 77%; top: 58%"
src="/assets/mobile/svg/trainSignUp/sign_up.svg" src="/assets/mobile/svg/trainSignUp/sign_up.svg"
></image> ></image>
<div <div
@click="trainClick(o)" @click="trainClick(o)"
v-if="activityStatus === '1'" v-if="activityStatus === '1'"
style=" style="
text-align: center; text-align: center;
line-height: 40px; line-height: 40px;
width: 40px; width: 40px;
@@ -249,65 +255,69 @@ layout("/layouts/platform_h5.html"){
</div> </div>
</template> </template>
</div> </div>
<van-empty v-else image="/assets/platform/plugins/vant-green/images/nodata/nodata.png" description="暂无数据"></van-empty> <van-empty v-else image="/assets/platform/plugins/vant-green/images/nodata/nodata.png"
description="暂无数据"></van-empty>
</template> </template>
<van-popup v-model:show="popupShow" class="popup"> <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> <div id="map" v-if="course.isMobileSign === true && course.signType === 3"
style="width: 100%; height: 250px"></div>
<van-card <van-card
:title="item.courseStartTime.substring(0, 10) + '' + :title="item.courseStartTime.substring(0, 10) + '' +
getWeek(item.courseStartTime.substring(0, 10)) + ''" getWeek(item.courseStartTime.substring(0, 10)) + ''"
v-for="(item,index) in qdArray" v-for="(item,index) in qdArray"
:key="index" :key="index"
thumb="/assets/mobile/svg/trainSignUp/qd1.svg" thumb="/assets/mobile/svg/trainSignUp/qd1.svg"
> >
<template #desc> <template #desc>
<div style="margin-top: 7px">{{item.courseStartTime.substring(11, 19) + ' ~ ' + item.courseEndTime.substring(11, 19)}}</div> <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'"> <div v-if="item.courseLocationCoordinates && item.isMobileSign === true && activityStatus === '1'">
<van-button <van-button
type="primary" type="primary"
color="#1867b0" color="#1867b0"
round round
size="mini" size="mini"
@click.stop="showQRCode(item, 2)" @click.stop="showQRCode(item, 2)"
v-if="(item.isAttend === true && course.giftType === 1 && item.state === 1) 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)" || ($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" style="position: absolute; right: 65px; top: 25%; width: 60px; height: 25px"
> >
礼品码 礼品码
</van-button> </van-button>
<van-button <van-button
type="primary" type="primary"
color="#e1e1e1" color="#e1e1e1"
round round
size="mini" size="mini"
v-if="(item.isAttend === false && findTime(item) === false && item.state === 1) v-if="(item.isAttend === false && findTime(item) === false && item.state === 1)
|| ($moment().unix() > $moment(item.courseEndTime).unix() && item.state === 3 && item.isAttend === false)" || ($moment().unix() > $moment(item.courseEndTime).unix() && item.state === 3 && item.isAttend === false)"
style="position: absolute; right: 0; top: 25%; width: 60px; height: 25px" style="position: absolute; right: 0; top: 25%; width: 60px; height: 25px"
> >
未签到 未签到
</van-button> </van-button>
<van-button <van-button
type="primary" type="primary"
color="#1867b0" color="#1867b0"
round round
size="mini" size="mini"
v-if="(item.isAttend === false && findTime(item) === true && item.state === 1) v-if="(item.isAttend === false && findTime(item) === true && item.state === 1)
|| ($moment().unix() > $moment(item.courseEndTime).unix() && item.state === 3 && item.isAttend === false)" || ($moment().unix() > $moment(item.courseEndTime).unix() && item.state === 3 && item.isAttend === false)"
style="position: absolute; right: 0; top: 25%; width: 60px; height: 25px" style="position: absolute; right: 0; top: 25%; width: 60px; height: 25px"
@click.stop="signIn(item)" @click.stop="signIn(item)"
> >
签 到 签 到
</van-button> </van-button>
<van-button <van-button
type="primary" type="primary"
color="#61ce98" color="#61ce98"
round round
size="mini" size="mini"
v-if="(item.isAttend === true && item.state === 1) v-if="(item.isAttend === true && item.state === 1)
|| ($moment().unix() > $moment(item.courseEndTime).unix() && item.state === 3 && item.isAttend === true)" || ($moment().unix() > $moment(item.courseEndTime).unix() && item.state === 3 && item.isAttend === true)"
style="position: absolute; right: 0; top: 25%; width: 60px; height: 25px" style="position: absolute; right: 0; top: 25%; width: 60px; height: 25px"
> >
已签到 已签到
</van-button> </van-button>
@@ -317,7 +327,8 @@ layout("/layouts/platform_h5.html"){
</van-popup> </van-popup>
<van-popup class="joinPopup" position="right" v-model:show="joinPopup"> <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> <van-nav-bar @click-left="joinPopup = false" left-text="返回" fixed left-arrow placeholder
title="活动报名"></van-nav-bar>
<div class="join_content"> <div class="join_content">
<van-form @submit="joinSubmit" :show-error-message="false"> <van-form @submit="joinSubmit" :show-error-message="false">
<div class="van-doc-card-two" style="margin: 0 0 16px 0"> <div class="van-doc-card-two" style="margin: 0 0 16px 0">
@@ -330,12 +341,12 @@ layout("/layouts/platform_h5.html"){
<van-field name="unionName" label="所属工会" readonly v-model="formData.unionName"></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 name="sex" label="性别" readonly v-model="formData.sex"></van-field>
<van-field <van-field
label="联系方式" label="联系方式"
required required
name="mobile" name="mobile"
:rules="[{ required: true, message: '请填写联系方式' }]" :rules="[{ required: true, message: '请填写联系方式' }]"
placeholder="请填写联系方式" placeholder="请填写联系方式"
v-model="formData.mobile" v-model="formData.mobile"
></van-field> ></van-field>
<train-dynamic-form v-model="dynamicColumnsData" ref="trainDynamicForm"></train-dynamic-form> <train-dynamic-form v-model="dynamicColumnsData" ref="trainDynamicForm"></train-dynamic-form>
</div> </div>
@@ -378,8 +389,8 @@ layout("/layouts/platform_h5.html"){
course: [], course: [],
qdArray: [], qdArray: [],
activityOptions: [ activityOptions: [
{ text: "全部", value: "0" }, {text: "全部", value: "0"},
{ text: "我报名的", value: "1" } {text: "我报名的", value: "1"}
], ],
courseOptions: [], courseOptions: [],
courseType: "0", courseType: "0",
@@ -474,7 +485,7 @@ layout("/layouts/platform_h5.html"){
}, },
async signIn(o) { async signIn(o) {
if (o.signType === 1) { if (o.signType === 1) {
vant.Dialog.alert({ message: "功能马上推出,敬请期待!" }) vant.Dialog.alert({message: "功能马上推出,敬请期待!"})
return return
} }
if (o.signType === 2) { if (o.signType === 2) {
@@ -554,42 +565,46 @@ layout("/layouts/platform_h5.html"){
await this.pageData() await this.pageData()
} }
}) })
.catch(() => {}) .catch(() => {
})
}, },
async signUp(o) { async signUp(o) {
this.choose = o this.choose = o
const res = await this.$axios.post("/platform/mobile/trainSignUpActivity/validateSignUp", { this.$axios.post("/platform/mobile/trainSignUpActivity/validateSignUp", {
courseId: o.id courseId: o.id
}) }).then(async res => {
if (res.code !== 0) {
vant.Dialog.alert({ if (res.code !== 0) {
title: "提示", await vant.Dialog.alert({
message: res.msg title: "提示",
}) message: res.msg
if (res.code !== 3) { })
return if (res.code !== 99) {
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)
this.formData = { const column = this.allColumnsData.find((x) => x.id === o.courseType)
userName: this.$store.state.user.username, this.dynamicColumnsData = column ? column.trainMobileSignColumnList : []
loginName: this.$store.state.user.loginname, this.dynamicColumnsData.forEach((item) => {
mobile: this.$store.state.user.mobile, item.columnValue = ""
sex: this.$store.state.user.sex, })
birthday: this.$store.state.user.birthday, this.joinPopup = true
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() { async joinSubmit() {
let valid = false let valid = false
@@ -647,7 +662,8 @@ layout("/layouts/platform_h5.html"){
} }
toast.clear() toast.clear()
}) })
.catch(() => {}) .catch(() => {
})
}, },
trainClick(o) { trainClick(o) {
this.timeList = o.courseTimeList this.timeList = o.courseTimeList
@@ -656,8 +672,8 @@ layout("/layouts/platform_h5.html"){
this.activityStatus === "0" this.activityStatus === "0"
? o.courseTimeList ? o.courseTimeList
: this.qdInfoList.filter((item) => { : this.qdInfoList.filter((item) => {
return item.courseId === o.id return item.courseId === o.id
}) })
if (o.signType === 3) { if (o.signType === 3) {
this.initMap(o) this.initMap(o)
} }
@@ -768,12 +784,12 @@ layout("/layouts/platform_h5.html"){
async getCourseText() { async getCourseText() {
const courseArray = await this.getAllType() const courseArray = await this.getAllType()
this.courseOptions = [] this.courseOptions = []
this.courseOptions.push({ text: "全部类型", value: "0" }) this.courseOptions.push({text: "全部类型", value: "0"})
for (const item of courseArray) { for (const item of courseArray) {
if (item.personMaxRegisterNum > 0) { if (item.personMaxRegisterNum > 0) {
this.courseText += item.value + "报名最多选" + item.personMaxRegisterNum + "项," this.courseText += item.value + "报名最多选" + item.personMaxRegisterNum + "项,"
} }
this.courseOptions.push({ text: item.lxname, value: item.id }) this.courseOptions.push({text: item.lxname, value: item.id})
} }
this.courseText = this.courseText.substr(0, this.courseText.length - 1) this.courseText = this.courseText.substr(0, this.courseText.length - 1)
}, },
@@ -812,17 +828,17 @@ layout("/layouts/platform_h5.html"){
this.isMySign = Number(GetQueryString("isMySign")) this.isMySign = Number(GetQueryString("isMySign"))
const time = GetQueryString("endTime") const time = GetQueryString("endTime")
if (this.isMySign === 1) { if (this.isMySign === 1) {
this.activityOptions = [{ text: "我报名的", value: "1" }] this.activityOptions = [{text: "我报名的", value: "1"}]
this.activityStatus = "1" this.activityStatus = "1"
} else { } else {
this.activityOptions = [ this.activityOptions = [
{ text: "全部", value: "0" }, {text: "全部", value: "0"},
{ text: "我报名的", value: "1" } {text: "我报名的", value: "1"}
] ]
this.activityStatus = new Date().getTime() > new Date(time).getTime() ? "1" : "0" this.activityStatus = new Date().getTime() > new Date(time).getTime() ? "1" : "0"
} }
this.activitySignUpStartTime = GetQueryString("activitySignUpStartTime") this.activitySignUpStartTime = GetQueryString("activitySignUpStartTime")
vant.Toast.setDefaultOptions({ duration: 2000 }) vant.Toast.setDefaultOptions({duration: 2000})
this.pageData() this.pageData()
await this.getCourseText() await this.getCourseText()
await this.getActivity() await this.getActivity()
@@ -0,0 +1,56 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<div id="app">
{{ 登录成功,正在跳转小程序界面 }}
</div>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script>
new Vue({
el: '#app',
store,
data() {
return {}
},
methods: {
async handleLogin() {
try {
const res = await this.$axios.post('/platform/login/getWeAppToken');
if (res.code === 0) {
console.log("token获取成功,下一步关闭当前web-view")
if (window.wx?.miniProgram) {
console.log("小程序界面,正在关闭web-view")
// 发送登录成功 + 关闭指令
window.wx.miniProgram.postMessage({
data: {
type: 'login_success',
loginname: this.$store.state.user.loginname,
...res.data
}
});
setTimeout(() => {
wx.miniProgram.navigateTo({ url: '/pages/activity/index' });
}, 3000);
} else {
// 非小程序环境,跳转首页等
window.location.href = 'platform/home'
}
} else {
console.error('获取 token 失败');
}
} catch (err) {
console.error('请求异常', err);
}
}
},
created() {
this.handleLogin()
}
})
</script>
<!--#
}
#-->