Merge branch 'main' of https://dd3skj.picp.vip/zhaoxinyu/hmc_gbhd
# Conflicts: # backend/src/main/resources/views/platform/activity/user/index.html
This commit is contained in:
@@ -1,158 +0,0 @@
|
|||||||
nutz:
|
|
||||||
application:
|
|
||||||
name: budwk-v5-mini-plus
|
|
||||||
mvc:
|
|
||||||
ignore: ^(.+[.])(jsp|png|gif|jpg|js|css|jspx|jpeg|html|mp3|mp4|ico|svg|vue)$
|
|
||||||
exclusions: /favicon/*,/assets/*,/druid/*,/upload/*
|
|
||||||
server:
|
|
||||||
port: 9090
|
|
||||||
host: 0.0.0.0
|
|
||||||
|
|
||||||
jetty:
|
|
||||||
contextPath: /
|
|
||||||
threadpool:
|
|
||||||
idleTimeout: 60000
|
|
||||||
minThreads: 10
|
|
||||||
maxThreads: 200
|
|
||||||
gzip:
|
|
||||||
enable: true
|
|
||||||
page:
|
|
||||||
403: /error/403.html
|
|
||||||
404: /error/404.html
|
|
||||||
500: /error/500.html
|
|
||||||
#结合ftp使用,或用nginx代理ftp路径
|
|
||||||
#staticPath: E:/project/NutzWk/upload
|
|
||||||
#开发模式静态资源
|
|
||||||
staticPathLocal: E:/project/company/hmc_gbhd/src/main/resources/static
|
|
||||||
|
|
||||||
security:
|
|
||||||
tokenName: token
|
|
||||||
timeout: 36000
|
|
||||||
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
|
|
||||||
# 允许同一账号并发登录,则系统参数 SessionOnlyOne 有效,亦可踢人下线并多了弹框提示功能
|
|
||||||
isConcurrent: true
|
|
||||||
# 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
|
|
||||||
isShare: true
|
|
||||||
|
|
||||||
redis:
|
|
||||||
host: 192.168.21.207
|
|
||||||
port: 6379
|
|
||||||
timeout: 2000
|
|
||||||
max_redir: 10
|
|
||||||
database: 10
|
|
||||||
maxTotal: 150
|
|
||||||
pool:
|
|
||||||
maxTotal: 150
|
|
||||||
maxIdle: 50
|
|
||||||
minIdle: 10
|
|
||||||
#password: test123
|
|
||||||
mode:
|
|
||||||
normal
|
|
||||||
#cluster
|
|
||||||
#nodes=192.168.6.31:6377,192.168.6.31:6378,192.168.6.28:6377,192.168.6.28:6378,192.168.6.34:6377,192.168.6.34:6378
|
|
||||||
|
|
||||||
jdbc:
|
|
||||||
url: jdbc:mysql://192.168.21.207:3306/hmc_gbhd?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
|
||||||
username: root
|
|
||||||
password: root
|
|
||||||
validationQuery: select 1
|
|
||||||
maxActive: 150
|
|
||||||
testWhileIdle: true
|
|
||||||
connectionProperties: druid.stat.slowSqlMillis=2000
|
|
||||||
defaultAutoCommit: true
|
|
||||||
|
|
||||||
|
|
||||||
xsssql:
|
|
||||||
ignore:
|
|
||||||
urls: /platform/cms/content/article/addDo,/platform/sys/app/conf/addDo,/platform/sys/app/conf/editDo
|
|
||||||
|
|
||||||
beetl:
|
|
||||||
RESOURCE:
|
|
||||||
#本地路径,开发时设置本地路径,便于调试
|
|
||||||
rootLocal: E:/project/company/hmc_gbhd/src/main/resources/views/
|
|
||||||
root: views/
|
|
||||||
DELIMITER_STATEMENT_START: '<!--#'
|
|
||||||
DELIMITER_STATEMENT_END: '#-->'
|
|
||||||
FT:
|
|
||||||
#用法: ${"wizzer",escape}
|
|
||||||
escape: com.budwk.app.web.commons.ext.beetl.HtmlEscapeFormat
|
|
||||||
#用法: ${10241024,filesize}
|
|
||||||
filesize: com.budwk.app.web.commons.ext.beetl.FileSizeFormat
|
|
||||||
#用法: ${"",html2txt="100"} 截取100字符
|
|
||||||
html2txt: com.budwk.app.web.commons.ext.beetl.Html2TxtFormat
|
|
||||||
#用法: ${"",strlen="100"} 截取100字符
|
|
||||||
strlen: com.budwk.app.web.commons.ext.beetl.StrlenFormat
|
|
||||||
|
|
||||||
#==============================================================
|
|
||||||
#Configure Main Scheduler Properties
|
|
||||||
#==============================================================
|
|
||||||
#quartz延迟启动秒数
|
|
||||||
quartz:
|
|
||||||
startupDelay: 10
|
|
||||||
scheduler:
|
|
||||||
instanceName: defaultScheduler
|
|
||||||
instanceId: AUTO
|
|
||||||
#==============================================================
|
|
||||||
#Skip Check Update
|
|
||||||
#update:true
|
|
||||||
#not update:false
|
|
||||||
#==============================================================
|
|
||||||
skipUpdateCheck: true
|
|
||||||
#==============================================================
|
|
||||||
#Configure JobStore isClustered=启用集群模式
|
|
||||||
#==============================================================
|
|
||||||
jobStore:
|
|
||||||
class: org.quartz.impl.jdbcjobstore.JobStoreTX
|
|
||||||
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
|
|
||||||
#driverDelegateClass: org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
|
|
||||||
#driverDelegateClass: org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
|
|
||||||
#Other delegates can see: http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/tutorial-lesson-09.html
|
|
||||||
dataSource: myDS
|
|
||||||
tablePrefix: SYS_QRTZ_
|
|
||||||
isClustered: false
|
|
||||||
clusterCheckinInterval: 20000
|
|
||||||
maxMisfiresToHandleAtATime: 120
|
|
||||||
misfireThreshold: 120000
|
|
||||||
txIsolationLevelSerializable: false
|
|
||||||
|
|
||||||
#==============================================================
|
|
||||||
#Configure ThreadPool
|
|
||||||
#==============================================================
|
|
||||||
threadPool:
|
|
||||||
class: org.quartz.simpl.SimpleThreadPool
|
|
||||||
threadCount: 2
|
|
||||||
threadPriority: 5
|
|
||||||
threadsInheritContextClassLoaderOfInitializingThread: true
|
|
||||||
|
|
||||||
#============================================================================
|
|
||||||
# Configure Plugins
|
|
||||||
#============================================================================
|
|
||||||
plugin:
|
|
||||||
triggHistory:
|
|
||||||
class: org.quartz.plugins.history.LoggingJobHistoryPlugin
|
|
||||||
shutdownhook:
|
|
||||||
class: org.quartz.plugins.management.ShutdownHookPlugin
|
|
||||||
cleanShutdown: true
|
|
||||||
#============================================================================
|
|
||||||
# NutDao dataSource
|
|
||||||
#============================================================================
|
|
||||||
dataSource:
|
|
||||||
myDS:
|
|
||||||
connectionProvider:
|
|
||||||
class: com.budwk.app.task.conn.NutConnectionProvider
|
|
||||||
|
|
||||||
|
|
||||||
sms:
|
|
||||||
enabled: false
|
|
||||||
#腾讯云短信配置
|
|
||||||
tencent:
|
|
||||||
secret-id: 1
|
|
||||||
secret-key: 2
|
|
||||||
appid: 1 #应用ID
|
|
||||||
sign: '萌发开源' #短信签名
|
|
||||||
tpl:
|
|
||||||
#验证码模板ID
|
|
||||||
code: 1
|
|
||||||
#短信通知模板ID
|
|
||||||
msg: 2
|
|
||||||
|
|
||||||
+1
-1
@@ -85,7 +85,7 @@ public class ClientAuthController {
|
|||||||
@ApiOperation(value = "短信登录", nickname = "/sms-login", httpMethod = "POST")
|
@ApiOperation(value = "短信登录", nickname = "/sms-login", httpMethod = "POST")
|
||||||
public Object doSmsLogin(ClientLoginBody loginBody, HttpServletRequest req) {
|
public Object doSmsLogin(ClientLoginBody loginBody, HttpServletRequest req) {
|
||||||
try {
|
try {
|
||||||
String token = clientAuthService.doSmsLogin(loginBody);
|
String token = clientAuthService.doLogin(loginBody);
|
||||||
return Result.success().addData(token);
|
return Result.success().addData(token);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
|
|||||||
@@ -48,6 +48,16 @@ public class Client_user extends BaseModel implements Serializable {
|
|||||||
@Comment("单位ID")
|
@Comment("单位ID")
|
||||||
private String unitId;
|
private String unitId;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||||
|
@Comment("密码")
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||||
|
@Comment("盐")
|
||||||
|
private String salt;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||||
@Comment("openId")
|
@Comment("openId")
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ public interface ClientAuthService {
|
|||||||
* @param loginBody 登录信息
|
* @param loginBody 登录信息
|
||||||
* @return token
|
* @return token
|
||||||
*/
|
*/
|
||||||
String doSmsLogin(ClientLoginBody loginBody);
|
String doLogin(ClientLoginBody loginBody);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 注册
|
* 注册
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package com.budwk.app.client.auth.service;
|
package com.budwk.app.client.auth.service;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.budwk.app.base.exception.BaseException;
|
import com.budwk.app.base.exception.BaseException;
|
||||||
|
import com.budwk.app.base.utils.PwdUtil;
|
||||||
import com.budwk.app.client.auth.vo.ClientLoginBody;
|
import com.budwk.app.client.auth.vo.ClientLoginBody;
|
||||||
import com.budwk.app.client.auth.models.Client_user;
|
import com.budwk.app.client.auth.models.Client_user;
|
||||||
import com.budwk.app.client.auth.vo.ClientRegisterBody;
|
import com.budwk.app.client.auth.vo.ClientRegisterBody;
|
||||||
@@ -11,6 +13,9 @@ import org.nutz.dao.Cnd;
|
|||||||
import org.nutz.dao.Dao;
|
import org.nutz.dao.Dao;
|
||||||
import org.nutz.ioc.loader.annotation.Inject;
|
import org.nutz.ioc.loader.annotation.Inject;
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
|
import org.nutz.lang.Strings;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@IocBean
|
@IocBean
|
||||||
public class ClientAuthServiceImpl implements ClientAuthService {
|
public class ClientAuthServiceImpl implements ClientAuthService {
|
||||||
@@ -21,23 +26,34 @@ public class ClientAuthServiceImpl implements ClientAuthService {
|
|||||||
private ValidateService validateService;
|
private ValidateService validateService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String doSmsLogin(ClientLoginBody loginBody) {
|
public String doLogin(ClientLoginBody loginBody) {
|
||||||
Client_user user = null;
|
Client_user user = null;
|
||||||
int count = dao.count(Client_user.class, Cnd.where(Client_user::getPhone, "=", loginBody.getPhone()));
|
int count = dao.count(Client_user.class, Cnd.where(Client_user::getPhone, "=", loginBody.getPhone()));
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
// // 自动注册
|
|
||||||
// user = new Client_user();
|
|
||||||
// user.setPhone(loginBody.getPhone());
|
|
||||||
// user.setUserName("用户" + loginBody.getPhone());
|
|
||||||
// dao.insert(user);
|
|
||||||
throw new BaseException("手机号码不存在");
|
throw new BaseException("手机号码不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
validateService.checkSMSCode(loginBody.getPhone(), loginBody.getSmsCode());
|
|
||||||
user = dao.fetch(Client_user.class, Cnd.where(Client_user::getPhone, "=", loginBody.getPhone()));
|
user = dao.fetch(Client_user.class, Cnd.where(Client_user::getPhone, "=", loginBody.getPhone()));
|
||||||
|
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
throw new BaseException("用户登录失败");
|
throw new BaseException("用户不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (StrUtil.isBlank(loginBody.getLoginMethod()) || !List.of("sms", "password").contains(loginBody.getLoginMethod())) {
|
||||||
|
throw new BaseException("登录方式不正确");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (loginBody.getLoginMethod().equals("sms")) {
|
||||||
|
validateService.checkSMSCode(loginBody.getPhone(), loginBody.getSmsCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (loginBody.getLoginMethod().equals("password")) {
|
||||||
|
String hashedPassword = PwdUtil.getPassword(loginBody.getPassword(), user.getSalt());
|
||||||
|
if (!Strings.sNull(hashedPassword).equalsIgnoreCase(user.getPassword())) {
|
||||||
|
throw new BaseException("密码不正确");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StpClientUtil.STP.login(user.getId());
|
StpClientUtil.STP.login(user.getId());
|
||||||
StpClientUtil.STP.checkLogin();
|
StpClientUtil.STP.checkLogin();
|
||||||
return StpClientUtil.STP.getTokenValue();
|
return StpClientUtil.STP.getTokenValue();
|
||||||
|
|||||||
@@ -9,4 +9,8 @@ public class ClientLoginBody {
|
|||||||
|
|
||||||
private String smsCode;
|
private String smsCode;
|
||||||
|
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
private String loginMethod;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -14,6 +14,8 @@ public class ClientActivitySignVO {
|
|||||||
private Long activityId;
|
private Long activityId;
|
||||||
private Long itemId;
|
private Long itemId;
|
||||||
|
|
||||||
|
private String unitId;
|
||||||
|
|
||||||
private String unitName;
|
private String unitName;
|
||||||
|
|
||||||
private String contactName;
|
private String contactName;
|
||||||
|
|||||||
+6
-3
@@ -105,6 +105,7 @@ public class ActUserController {
|
|||||||
user.setId(actUser.getId());
|
user.setId(actUser.getId());
|
||||||
}
|
}
|
||||||
user.setUserId(user.getUserId());
|
user.setUserId(user.getUserId());
|
||||||
|
user.setUnitId(vo.getUnitId());
|
||||||
user.setSignUpTime(localDateTime);
|
user.setSignUpTime(localDateTime);
|
||||||
user.setSignUpContacts(vo.getContactName());
|
user.setSignUpContacts(vo.getContactName());
|
||||||
user.setSignUpMobile(vo.getContactPhone());
|
user.setSignUpMobile(vo.getContactPhone());
|
||||||
@@ -115,6 +116,7 @@ public class ActUserController {
|
|||||||
} else {
|
} else {
|
||||||
for (ActUser user : doSignUserList) {
|
for (ActUser user : doSignUserList) {
|
||||||
user.setUserId(user.getUserId());
|
user.setUserId(user.getUserId());
|
||||||
|
user.setUnitId(vo.getUnitId());
|
||||||
user.setSignUpTime(localDateTime);
|
user.setSignUpTime(localDateTime);
|
||||||
user.setSignUpContacts(vo.getContactName());
|
user.setSignUpContacts(vo.getContactName());
|
||||||
user.setSignUpMobile(vo.getContactPhone());
|
user.setSignUpMobile(vo.getContactPhone());
|
||||||
@@ -134,6 +136,7 @@ public class ActUserController {
|
|||||||
dao.insert(clientUser);
|
dao.insert(clientUser);
|
||||||
|
|
||||||
user.setUserId(clientUser.getId());
|
user.setUserId(clientUser.getId());
|
||||||
|
user.setUnitId(vo.getUnitId());
|
||||||
user.setSignUpTime(localDateTime);
|
user.setSignUpTime(localDateTime);
|
||||||
user.setSignUpContacts(vo.getContactName());
|
user.setSignUpContacts(vo.getContactName());
|
||||||
user.setSignUpMobile(vo.getContactPhone());
|
user.setSignUpMobile(vo.getContactPhone());
|
||||||
@@ -171,8 +174,8 @@ public class ActUserController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@SaCheckPermission("activity.user")
|
@SaCheckPermission("activity.user")
|
||||||
public Result findSignUserInfo(String userId){
|
public Result findSignUserInfo(String id){
|
||||||
return Result.success(dao.fetch(ActUser.class, Cnd.where(ActUser::getUserId, "=", userId)));
|
return Result.success(dao.fetch(ActUser.class, Cnd.where(ActUser::getId, "=", id)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -182,7 +185,7 @@ public class ActUserController {
|
|||||||
@At
|
@At
|
||||||
@SaCheckPermission("activity.user")
|
@SaCheckPermission("activity.user")
|
||||||
public Result getActivityList(String year){
|
public Result getActivityList(String year){
|
||||||
List<Activity> activityList = dao.query(Activity.class, Cnd.where("YEAR(startTime)", "=", year).and(Activity::getDelFlag, "=", false));
|
List<Activity> activityList = dao.query(Activity.class, Cnd.NEW().andEX("YEAR(startTime)", "=", year).and(Activity::getDelFlag, "=", false));
|
||||||
return Result.success(activityList);
|
return Result.success(activityList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+123
@@ -0,0 +1,123 @@
|
|||||||
|
package com.budwk.app.module.activity.controller;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.budwk.app.base.page.PageForm;
|
||||||
|
import com.budwk.app.base.page.Pagination;
|
||||||
|
import com.budwk.app.base.result.Result;
|
||||||
|
import com.budwk.app.module.activity.models.ActWonderfulMoment;
|
||||||
|
import com.budwk.app.module.activity.models.Activity;
|
||||||
|
import com.budwk.app.module.activity.service.ActWonderfulMomentService;
|
||||||
|
import com.budwk.app.web.commons.auth.satoken.StpClientUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||||
|
import org.nutz.dao.Cnd;
|
||||||
|
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.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.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName ActWonderfulMomentController
|
||||||
|
* @Author JyuHsin
|
||||||
|
* @Date 2025/5/6 15:30
|
||||||
|
* @Version 1.0
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@IocBean
|
||||||
|
@Ok("json:full")
|
||||||
|
@At("/platform/activity/wonderfulMoment")
|
||||||
|
public class ActWonderfulMomentController {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private ActWonderfulMomentService wonderfulMomentService;
|
||||||
|
|
||||||
|
@At("")
|
||||||
|
@SaCheckPermission("activity.wonderfulMoment")
|
||||||
|
@Ok("beetl:/platform/activity/wonderfulMoment/index.html")
|
||||||
|
public void index() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@SaCheckPermission("activity.wonderfulMoment")
|
||||||
|
public Result pageData(PageForm pageForm, String startTime, String endTime){
|
||||||
|
Cnd cnd = Cnd.NEW();
|
||||||
|
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||||
|
cnd.and("title", "like", "%" + pageForm.getSearchKeyword() + "%");
|
||||||
|
}
|
||||||
|
cnd.andEX("publishTime", ">=", startTime);
|
||||||
|
cnd.andEX("publishTime", "<=", endTime);
|
||||||
|
cnd.desc("publishTime");
|
||||||
|
Pagination pagination = wonderfulMomentService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||||
|
return Result.success(pagination);
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
|
@SaCheckPermission("activity.wonderfulMoment")
|
||||||
|
public Result onHandle(@Param("wonderfulMoment") ActWonderfulMoment wonderfulMoment) {
|
||||||
|
if(wonderfulMoment.getId() == null) {
|
||||||
|
wonderfulMoment.setPublishTime(DateUtil.now());
|
||||||
|
}
|
||||||
|
wonderfulMomentService.insertOrUpdate(wonderfulMoment);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
|
@SaCheckPermission("activity.wonderfulMoment")
|
||||||
|
public Result onDelete(Long id) {
|
||||||
|
wonderfulMomentService.delete(id);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@SaCheckLogin(type = StpClientUtil.TYPE)
|
||||||
|
public Result getWonderfulMoment(@Param("id") Long id) {
|
||||||
|
Cnd cnd = Cnd.where("published", "=", true).andEX("id", "=", id);
|
||||||
|
cnd.desc("publishTime");
|
||||||
|
List<ActWonderfulMoment> momentList = wonderfulMomentService.query(cnd);
|
||||||
|
List<NutMap> result = new ArrayList<>();
|
||||||
|
for (ActWonderfulMoment wonderfulMoment : momentList) {
|
||||||
|
NutMap nutMap = Lang.obj2map(wonderfulMoment, NutMap.class);
|
||||||
|
DateTime dateTime = DateUtil.parse(wonderfulMoment.getPublishTime());
|
||||||
|
//如果是今天
|
||||||
|
if(DateUtil.isSameDay(dateTime, new Date())) {
|
||||||
|
nutMap.put("time", "今天" + DateUtil.format(dateTime, "HH:mm"));
|
||||||
|
} else {
|
||||||
|
nutMap.put("time", DateUtil.betweenDay(dateTime, new Date(), false) + "天前");
|
||||||
|
}
|
||||||
|
result.add(nutMap);
|
||||||
|
}
|
||||||
|
return Result.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@At("/getWonderfulMomentById/?")
|
||||||
|
@SaCheckLogin(type = StpClientUtil.TYPE)
|
||||||
|
public Result getWonderfulMomentById(Long id) {
|
||||||
|
ActWonderfulMoment moment = wonderfulMomentService.fetch(id);
|
||||||
|
return Result.success(moment);
|
||||||
|
}
|
||||||
|
|
||||||
|
@At("/handleWonderfulMoment/?")
|
||||||
|
@SaCheckLogin(type = StpClientUtil.TYPE)
|
||||||
|
public Result handleWonderfulMoment(Long id) {
|
||||||
|
ActWonderfulMoment moment = wonderfulMomentService.fetch(id);
|
||||||
|
moment.setReadCount(moment.getReadCount() + 1);
|
||||||
|
wonderfulMomentService.update(moment);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
}
|
||||||
+9
@@ -1,5 +1,6 @@
|
|||||||
package com.budwk.app.module.activity.controller;
|
package com.budwk.app.module.activity.controller;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.budwk.app.base.page.PageForm;
|
import com.budwk.app.base.page.PageForm;
|
||||||
@@ -8,6 +9,7 @@ import com.budwk.app.base.result.Result;
|
|||||||
import com.budwk.app.module.activity.models.Activity;
|
import com.budwk.app.module.activity.models.Activity;
|
||||||
import com.budwk.app.module.activity.models.ActivityItem;
|
import com.budwk.app.module.activity.models.ActivityItem;
|
||||||
import com.budwk.app.module.activity.service.ActivityManageService;
|
import com.budwk.app.module.activity.service.ActivityManageService;
|
||||||
|
import com.budwk.app.web.commons.auth.satoken.StpClientUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||||
import org.nutz.dao.Cnd;
|
import org.nutz.dao.Cnd;
|
||||||
@@ -163,4 +165,11 @@ public class ActivityManageController {
|
|||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
|
@SaCheckLogin(type = StpClientUtil.TYPE)
|
||||||
|
public Result getActivity() {
|
||||||
|
List<Activity> activityList = activityService.query(Cnd.NEW());
|
||||||
|
return Result.success(activityList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+12
@@ -15,6 +15,7 @@ import com.budwk.app.module.activity.service.ActivitySignInQueryService;
|
|||||||
import com.budwk.app.module.activity.vo.page.ActSignInUserPageForm;
|
import com.budwk.app.module.activity.vo.page.ActSignInUserPageForm;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.poi.ss.usermodel.Workbook;
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
|
import org.nutz.dao.Chain;
|
||||||
import org.nutz.dao.Cnd;
|
import org.nutz.dao.Cnd;
|
||||||
import org.nutz.dao.Sqls;
|
import org.nutz.dao.Sqls;
|
||||||
import org.nutz.dao.sql.Sql;
|
import org.nutz.dao.sql.Sql;
|
||||||
@@ -87,6 +88,17 @@ public class ActivitySignInQueryController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@At
|
||||||
|
@SaCheckPermission("activity.signInUserQuery")
|
||||||
|
public Result doGrant(String id, Boolean isGrant) {
|
||||||
|
if (StrUtil.isBlank(id)) {
|
||||||
|
return Result.error("参数错误");
|
||||||
|
}
|
||||||
|
activitySignInQueryService.update(Chain.make("isGrant", isGrant), Cnd.where("id", "=", id));
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@Ok("void")
|
@Ok("void")
|
||||||
@SaCheckPermission("activity.signInUserQuery")
|
@SaCheckPermission("activity.signInUserQuery")
|
||||||
|
|||||||
@@ -70,6 +70,11 @@ public class ActUser extends BaseModel {
|
|||||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@Comment("参加单位Id")
|
||||||
|
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||||
|
private String unitId;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@Comment("参加单位名称")
|
@Comment("参加单位名称")
|
||||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||||
@@ -95,6 +100,12 @@ public class ActUser extends BaseModel {
|
|||||||
@ColDefine(type = ColType.BOOLEAN)
|
@ColDefine(type = ColType.BOOLEAN)
|
||||||
private Boolean isStay;
|
private Boolean isStay;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@Comment("是否联系人")
|
||||||
|
@ColDefine(type = ColType.BOOLEAN)
|
||||||
|
@Default("0")
|
||||||
|
private Boolean isContacts;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@Comment("是否签到")
|
@Comment("是否签到")
|
||||||
@ColDefine(type = ColType.BOOLEAN)
|
@ColDefine(type = ColType.BOOLEAN)
|
||||||
@@ -105,4 +116,10 @@ public class ActUser extends BaseModel {
|
|||||||
@Comment("签到时间")
|
@Comment("签到时间")
|
||||||
@ColDefine(type = ColType.DATETIME)
|
@ColDefine(type = ColType.DATETIME)
|
||||||
private LocalDateTime signInTime;
|
private LocalDateTime signInTime;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@Comment("是否发放物资")
|
||||||
|
@ColDefine(type = ColType.BOOLEAN)
|
||||||
|
@Default("0")
|
||||||
|
private Boolean isGrant;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.budwk.app.module.activity.models;
|
||||||
|
|
||||||
|
import com.budwk.app.base.model.BaseModel;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.nutz.dao.entity.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName ActWonderfulMoment
|
||||||
|
* @Author JyuHsin
|
||||||
|
* @Date 2025/5/6 15:28
|
||||||
|
* @Version 1.0
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Comment("活动项目队伍得分表")
|
||||||
|
@Table("act_wonderful_moment")
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||||
|
public class ActWonderfulMoment extends BaseModel {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Comment("ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@Comment("标题")
|
||||||
|
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@Comment("发布内容")
|
||||||
|
@ColDefine(type = ColType.TEXT)
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@Comment("发布时间")
|
||||||
|
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||||
|
private String publishTime;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@Comment("封面图")
|
||||||
|
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||||
|
private String cover;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@Comment("是否发布")
|
||||||
|
@ColDefine(type = ColType.BOOLEAN)
|
||||||
|
private Boolean published;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@Comment("阅读次数")
|
||||||
|
@Default(value = "0")
|
||||||
|
@ColDefine(type = ColType.INT)
|
||||||
|
private Integer readCount;
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
package com.budwk.app.module.activity.service;
|
||||||
|
|
||||||
|
import com.budwk.app.base.service.BaseService;
|
||||||
|
import com.budwk.app.module.activity.models.ActWonderfulMoment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName ActWonderfulMomentService
|
||||||
|
* @Author JyuHsin
|
||||||
|
* @Date 2025/5/6 15:30
|
||||||
|
* @Version 1.0
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public interface ActWonderfulMomentService extends BaseService<ActWonderfulMoment> {
|
||||||
|
}
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
package com.budwk.app.module.activity.service.impl;
|
||||||
|
|
||||||
|
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||||
|
import com.budwk.app.module.activity.models.ActWonderfulMoment;
|
||||||
|
import com.budwk.app.module.activity.service.ActWonderfulMomentService;
|
||||||
|
import org.nutz.dao.Dao;
|
||||||
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName ActWonderfulMomentServiceImpl
|
||||||
|
* @Author JyuHsin
|
||||||
|
* @Date 2025/5/6 15:31
|
||||||
|
* @Version 1.0
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
@IocBean(args = {"refer:dao"})
|
||||||
|
public class ActWonderfulMomentServiceImpl extends BaseServiceImpl<ActWonderfulMoment> implements ActWonderfulMomentService {
|
||||||
|
public ActWonderfulMomentServiceImpl(Dao dao) {
|
||||||
|
super(dao);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.budwk.app.web.commons.ext.sms;
|
package com.budwk.app.web.commons.ext.sms;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.budwk.app.base.exception.BaseException;
|
import com.budwk.app.base.exception.BaseException;
|
||||||
import com.tencentcloudapi.common.Credential;
|
import com.tencentcloudapi.common.Credential;
|
||||||
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
|
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
|
||||||
@@ -48,20 +49,21 @@ public class SmsService {
|
|||||||
ClientProfile clientProfile = new ClientProfile();
|
ClientProfile clientProfile = new ClientProfile();
|
||||||
clientProfile.setHttpProfile(httpProfile);
|
clientProfile.setHttpProfile(httpProfile);
|
||||||
|
|
||||||
SmsClient client = new SmsClient(cred, "", clientProfile);
|
SmsClient client = new SmsClient(cred, "ap-guangzhou", clientProfile);
|
||||||
|
|
||||||
SendSmsRequest req = new SendSmsRequest();
|
SendSmsRequest req = new SendSmsRequest();
|
||||||
String[] phoneNumberSet1 = {"+86" + mobile};
|
|
||||||
req.setPhoneNumberSet(phoneNumberSet1);
|
|
||||||
String[] templateParamSet1 = {text, "5"};
|
|
||||||
req.setTemplateParamSet(templateParamSet1);
|
|
||||||
req.setTemplateID(conf.get("sms.tencent.tpl.login_code"));
|
|
||||||
req.setSmsSdkAppid(conf.get("sms.tencent.appid"));
|
req.setSmsSdkAppid(conf.get("sms.tencent.appid"));
|
||||||
req.setSign(conf.get("sms.tencent.sign"));
|
req.setSign(conf.get("sms.tencent.sign"));
|
||||||
|
req.setTemplateID(conf.get("sms.tencent.tpl.login_code"));
|
||||||
|
String[] phoneNumberSet1 = {"+86" + mobile};
|
||||||
|
req.setPhoneNumberSet(phoneNumberSet1);
|
||||||
|
String[] templateParamSet1 = {text};
|
||||||
|
req.setTemplateParamSet(templateParamSet1);
|
||||||
SendSmsResponse resp = client.SendSms(req);
|
SendSmsResponse resp = client.SendSms(req);
|
||||||
log.debug(SendSmsResponse.toJsonString(resp));
|
log.debug(SendSmsResponse.toJsonString(resp));
|
||||||
return true;
|
return true;
|
||||||
} catch (TencentCloudSDKException tencentCloudSDKException) {
|
} catch (TencentCloudSDKException tencentCloudSDKException) {
|
||||||
|
log.error(String.valueOf(tencentCloudSDKException));
|
||||||
throw new BaseException(tencentCloudSDKException.getMessage());
|
throw new BaseException(tencentCloudSDKException.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,12 +88,12 @@ public class SmsService {
|
|||||||
ClientProfile clientProfile = new ClientProfile();
|
ClientProfile clientProfile = new ClientProfile();
|
||||||
clientProfile.setHttpProfile(httpProfile);
|
clientProfile.setHttpProfile(httpProfile);
|
||||||
|
|
||||||
SmsClient client = new SmsClient(cred, "", clientProfile);
|
SmsClient client = new SmsClient(cred, "ap-guangzhou", clientProfile);
|
||||||
|
|
||||||
SendSmsRequest req = new SendSmsRequest();
|
SendSmsRequest req = new SendSmsRequest();
|
||||||
String[] phoneNumberSet1 = {"+86" + mobile};
|
String[] phoneNumberSet1 = {"+86" + mobile};
|
||||||
req.setPhoneNumberSet(phoneNumberSet1);
|
req.setPhoneNumberSet(phoneNumberSet1);
|
||||||
String[] templateParamSet1 = {text, "5"};
|
String[] templateParamSet1 = {text};
|
||||||
req.setTemplateParamSet(templateParamSet1);
|
req.setTemplateParamSet(templateParamSet1);
|
||||||
req.setTemplateID(conf.get("sms.tencent.tpl.reg_code"));
|
req.setTemplateID(conf.get("sms.tencent.tpl.reg_code"));
|
||||||
req.setSmsSdkAppid(conf.get("sms.tencent.appid"));
|
req.setSmsSdkAppid(conf.get("sms.tencent.appid"));
|
||||||
@@ -126,7 +128,7 @@ public class SmsService {
|
|||||||
ClientProfile clientProfile = new ClientProfile();
|
ClientProfile clientProfile = new ClientProfile();
|
||||||
clientProfile.setHttpProfile(httpProfile);
|
clientProfile.setHttpProfile(httpProfile);
|
||||||
|
|
||||||
SmsClient client = new SmsClient(cred, "", clientProfile);
|
SmsClient client = new SmsClient(cred, "ap-guangzhou", clientProfile);
|
||||||
|
|
||||||
SendSmsRequest req = new SendSmsRequest();
|
SendSmsRequest req = new SendSmsRequest();
|
||||||
req.setPhoneNumberSet(mobile);
|
req.setPhoneNumberSet(mobile);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ jetty:
|
|||||||
#结合ftp使用,或用nginx代理ftp路径
|
#结合ftp使用,或用nginx代理ftp路径
|
||||||
#staticPath: E:/project/NutzWk/upload
|
#staticPath: E:/project/NutzWk/upload
|
||||||
#开发模式静态资源
|
#开发模式静态资源
|
||||||
staticPathLocal: E:/projects/hmc_gbhd/src/main/resources/static
|
staticPathLocal: G:/project/hmc_gbhd/src/main/resources/static
|
||||||
|
|
||||||
security:
|
security:
|
||||||
tokenName: token
|
tokenName: token
|
||||||
@@ -69,7 +69,7 @@ xsssql:
|
|||||||
beetl:
|
beetl:
|
||||||
RESOURCE:
|
RESOURCE:
|
||||||
#本地路径,开发时设置本地路径,便于调试
|
#本地路径,开发时设置本地路径,便于调试
|
||||||
rootLocal: E:/projects/hmc_gbhd/src/main/resources/views/
|
rootLocal: G:/projects/hmc_gbhd/src/main/resources/views/
|
||||||
root: views/
|
root: views/
|
||||||
DELIMITER_STATEMENT_START: '<!--#'
|
DELIMITER_STATEMENT_START: '<!--#'
|
||||||
DELIMITER_STATEMENT_END: '#-->'
|
DELIMITER_STATEMENT_END: '#-->'
|
||||||
@@ -147,11 +147,11 @@ swagger:
|
|||||||
description: 趣味运动会系统
|
description: 趣味运动会系统
|
||||||
|
|
||||||
sms:
|
sms:
|
||||||
enabled: false
|
enabled: true
|
||||||
#腾讯云短信配置
|
#腾讯云短信配置
|
||||||
tencent:
|
tencent:
|
||||||
secret-id: 1301383032
|
secret-id: AKID3vYx5xYu0pVwDIAm9F4ey74mEPJwJQGp
|
||||||
secret-key: AKIDMZWDepjNnxqSotiHZeU6SYOyIMAj24rO
|
secret-key: LPDl5AyV4NQM3TdW9VaOvCE0VkjSu5zc
|
||||||
appid: 1400934413 #应用ID
|
appid: 1400934413 #应用ID
|
||||||
sign: '武汉地大三思科技' #短信签名
|
sign: '武汉地大三思科技' #短信签名
|
||||||
tpl:
|
tpl:
|
||||||
|
|||||||
@@ -12,10 +12,22 @@
|
|||||||
:on-exceed="handleExceed"
|
:on-exceed="handleExceed"
|
||||||
:file-list="fileList"
|
:file-list="fileList"
|
||||||
>
|
>
|
||||||
<i class="el-icon-plus"></i>
|
<i slot="default" class="el-icon-plus"></i>
|
||||||
|
<div slot="file" slot-scope="{file}">
|
||||||
|
<img class="el-upload-list__item-thumbnail" :src="'/open/file/upload/download?filepath=' + file.url" alt=""
|
||||||
|
style="var(--box-width, '100px') !important;height: var(--box-height, '100px') !important">
|
||||||
|
<span class="el-upload-list__item-actions">
|
||||||
|
<span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
|
||||||
|
<i class="el-icon-zoom-in"></i>
|
||||||
|
</span>
|
||||||
|
<span class="el-upload-list__item-delete" @click="handleRemove(file)">
|
||||||
|
<i class="el-icon-delete"></i>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<el-dialog :visible.sync="dialogVisible" append-to-body>
|
<el-dialog :visible.sync="dialogVisible" append-to-body>
|
||||||
<img width="100%" :src="dialogImageUrl" alt="">
|
<img width="100%" :src="'/open/file/upload/download?filepath=' + dialogImageUrl" alt="">
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -78,6 +78,9 @@ const addOrUpdate = {
|
|||||||
{{form.files}}
|
{{form.files}}
|
||||||
<file-upload v-model="form.files" accept=".pdf"></file-upload>
|
<file-upload v-model="form.files" accept=".pdf"></file-upload>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="封面图" prop="cover">
|
||||||
|
<image-upload v-model="form.cover" :max-count="1"></image-upload>
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="visible = false">取消</el-button>
|
<el-button @click="visible = false">取消</el-button>
|
||||||
|
|||||||
@@ -62,6 +62,18 @@ layout("/layouts/platform_1.html"){
|
|||||||
<el-table-column label="联系方式" prop="mobile"></el-table-column>
|
<el-table-column label="联系方式" prop="mobile"></el-table-column>
|
||||||
<el-table-column label="参加单位名称" prop="unitName"></el-table-column>
|
<el-table-column label="参加单位名称" prop="unitName"></el-table-column>
|
||||||
<el-table-column label="签到时间" prop="signInTime"></el-table-column>
|
<el-table-column label="签到时间" prop="signInTime"></el-table-column>
|
||||||
|
<el-table-column label="物资发放" prop="isGrant">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.isGrant" type="success">已发放</el-tag>
|
||||||
|
<el-tag v-else type="danger">未发放</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" fixed="right" width="200">
|
||||||
|
<template #default="{row}">
|
||||||
|
<el-button v-if="!row.isGrant || row.isGrant === 0" type="primary" size="mini" @click="doGrant(row, true)">设为已发放物资</el-button>
|
||||||
|
<el-button v-else type="danger" size="mini" @click="doGrant(row, false)">设为未发放物资</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<!--#include("/layouts/pagination.html"){}#-->
|
<!--#include("/layouts/pagination.html"){}#-->
|
||||||
</el-card>
|
</el-card>
|
||||||
@@ -82,6 +94,24 @@ layout("/layouts/platform_1.html"){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async doGrant(row, isGrant) {
|
||||||
|
this.$confirm('您确定要设置成' + (isGrant ? '已发放' : '未发放') + '状态吗?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(async () => {
|
||||||
|
const resp = await $.post("/platform/activity/signInUserQuery/doGrant", {
|
||||||
|
id: row.id,
|
||||||
|
isGrant: isGrant
|
||||||
|
})
|
||||||
|
if (resp.code === 0) {
|
||||||
|
this.doSearch()
|
||||||
|
this.$message.success(resp.msg)
|
||||||
|
} else {
|
||||||
|
this.$message.error(resp.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
doExport() {
|
doExport() {
|
||||||
window.open("/platform/activity/signInUserQuery/doExport?activityId=" + this.pageForm.activityId + "&searchKeyword=" + this.pageForm.searchKeyword)
|
window.open("/platform/activity/signInUserQuery/doExport?activityId=" + this.pageForm.activityId + "&searchKeyword=" + this.pageForm.searchKeyword)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,412 +2,411 @@
|
|||||||
layout("/layouts/platform_1.html"){
|
layout("/layouts/platform_1.html"){
|
||||||
#-->
|
#-->
|
||||||
<div id="app">
|
<div id="app">
|
||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<div class="search">
|
<div class="search">
|
||||||
<div class="search-item">
|
<div class="search-item">
|
||||||
<div class="search-item-label">年度</div>
|
<div class="search-item-label">年度</div>
|
||||||
<div class="search-item-option">
|
<div class="search-item-option">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
:clearable="false"
|
:clearable="false"
|
||||||
placeholder="选择年"
|
placeholder="选择年"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
type="year"
|
type="year"
|
||||||
@change="getActivityList"
|
@change="getActivityList"
|
||||||
v-model="pageForm.year"
|
v-model="pageForm.year"
|
||||||
value-format="yyyy"
|
value-format="yyyy"
|
||||||
></el-date-picker>
|
></el-date-picker>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="search-item">
|
<div class="search-item">
|
||||||
<div class="search-item-label">所属活动</div>
|
<div class="search-item-label">所属活动</div>
|
||||||
<div class="search-item-option">
|
<div class="search-item-option">
|
||||||
<el-select @change="doSearch"
|
<el-select @change="doSearch"
|
||||||
placeholder="请选择活动查询"
|
placeholder="请选择活动查询"
|
||||||
style="width: 100%;"
|
style="width: 100%;"
|
||||||
v-model="pageForm.activityId">
|
v-model="pageForm.activityId">
|
||||||
<el-option :label="item.title" :value="item.id"
|
<el-option :label="item.title" :value="item.id"
|
||||||
v-for="item in activityList"></el-option>
|
v-for="item in activityList"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="search-item">
|
<div class="search-item">
|
||||||
<div class="search-item-label">姓名/电话</div>
|
<div class="search-item-label">姓名/电话</div>
|
||||||
<div class="search-item-option">
|
<div class="search-item-option">
|
||||||
<el-input v-model="pageForm.searchKeyword" placeholder="请输入姓名"
|
<el-input v-model="pageForm.searchKeyword" placeholder="请输入姓名"
|
||||||
clearable @keyup.enter.native="doSearch"></el-input>
|
clearable @keyup.enter.native="doSearch"></el-input>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="search-query">
|
<div class="search-query">
|
||||||
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card shadow="never" class="mt-3">
|
<el-card shadow="never" class="mt-3">
|
||||||
<el-row type="flex" style="justify-content: flex-end" class="mb-3">
|
<el-row type="flex" style="justify-content: flex-end" class="mb-3">
|
||||||
<el-button icon="el-icon-plus" type="primary" size="small" @click="openAddUser">添加报名人员</el-button>
|
<el-button icon="el-icon-plus" type="primary" size="small" @click="openAddUser">添加报名人员</el-button>
|
||||||
<el-button icon="el-icon-plus" type="primary" size="small" @click="doExport">导出</el-button>
|
<el-button icon="el-icon-plus" type="primary" size="small" @click="doExport">导出</el-button>
|
||||||
<el-radio-group v-model="pageForm.isSignIn" type="primary" class="ml-3"@change="doSearch">
|
<el-radio-group v-model="pageForm.isSignIn" type="primary" class="ml-3"@change="doSearch">
|
||||||
<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>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-table v-loading="tableLoading" show-overflow-tooltip :data="tableData">
|
<el-table v-loading="tableLoading" show-overflow-tooltip :data="tableData">
|
||||||
<el-table-column label="序号" type="index" header-align="center" align="center"
|
<el-table-column label="序号" type="index" header-align="center" align="center"
|
||||||
width="50"></el-table-column>
|
width="50"></el-table-column>
|
||||||
<el-table-column label="姓名" prop="userName"></el-table-column>
|
<el-table-column label="姓名" prop="userName"></el-table-column>
|
||||||
<el-table-column label="性别" prop="sex"></el-table-column>
|
<el-table-column label="性别" prop="sex"></el-table-column>
|
||||||
<el-table-column label="联系方式" prop="phone"></el-table-column>
|
<el-table-column label="联系方式" prop="phone"></el-table-column>
|
||||||
<el-table-column label="身份证件号" prop="idCard"></el-table-column>
|
<el-table-column label="身份证件号" prop="idCard"></el-table-column>
|
||||||
<el-table-column label="职务" prop="position"></el-table-column>
|
<el-table-column label="职务" prop="position"></el-table-column>
|
||||||
<el-table-column label="所属单位" prop="unitName"></el-table-column>
|
<el-table-column label="所属单位" prop="unitName"></el-table-column>
|
||||||
<el-table-column label="报名时间" prop="signUpTime"></el-table-column>
|
<el-table-column label="报名时间" prop="signUpTime"></el-table-column>
|
||||||
<el-table-column label="是否签到" prop="isSignIn">
|
<el-table-column label="是否签到" prop="isSignIn">
|
||||||
<template slot-scope="{row}">
|
<template slot-scope="{row}">
|
||||||
{{row.isSignIn?'已签到':'未签到'}}
|
{{row.isSignIn?'已签到':'未签到'}}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" fixed="right" width="250">
|
<el-table-column label="操作" fixed="right" width="250">
|
||||||
<template slot-scope="scope">
|
<template #default="scope">
|
||||||
<el-button type="text" @click="openModify">修改</el-button>
|
<el-button type="text" @click="openModify">修改</el-button>
|
||||||
<el-button type="text" class="text-danger" @click="onTableRowDelete(scope.row.id)">删除</el-button>
|
<el-button type="text" class="text-danger" @click="onTableRowDelete(scope.row.id)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<!--#include("/layouts/pagination.html"){}#-->
|
<!--#include("/layouts/pagination.html"){}#-->
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-dialog title="添加报名人员" :visible.sync="addDialog" width="60%">
|
<el-dialog title="添加报名人员" :visible.sync="addDialog" width="60%">
|
||||||
<el-form :model="formData" :rules="formRules" ref="formRef" label-width="100px">
|
<el-form :model="formData" :rules="formRules" ref="formRef" label-width="100px">
|
||||||
<el-form-item label="活动名称" prop="activityName">
|
<el-form-item label="活动名称" prop="activityName">
|
||||||
<el-input v-model="formData.activityName" readonly></el-input>
|
<el-input v-model="formData.activityName" readonly></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="参加单位" prop="unitName">
|
<el-form-item label="参加单位" prop="unitName">
|
||||||
<el-input v-model="formData.unitName" placeholder="请输入参加单位"></el-input>
|
<el-input v-model="formData.unitName" placeholder="请输入参加单位"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="联系人" prop="contactName">
|
<el-form-item label="联系人" prop="contactName">
|
||||||
<el-input v-model="formData.contactName" placeholder="请输入联系人"></el-input>
|
<el-input v-model="formData.contactName" placeholder="请输入联系人"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="联系方式" prop="contactPhone">
|
<el-form-item label="联系方式" prop="contactPhone">
|
||||||
<el-input v-model="formData.contactPhone" placeholder="请输入联系方式" maxlength="11" type="text"
|
<el-input v-model="formData.contactPhone" placeholder="请输入联系方式" maxlength="11" type="text" show-word-limit></el-input>
|
||||||
show-word-limit></el-input>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item label="报名人员" prop="userList">
|
||||||
<el-form-item label="报名人员" prop="userList">
|
<el-table :data="formData.userList" border size="small" width="100%">
|
||||||
<el-table :data="formData.userList" border size="small" width="100%">
|
<el-table-column label="姓名" prop="userName" fixed width="200">
|
||||||
<el-table-column label="姓名" prop="userName" fixed width="200">
|
<template slot-scope="{row}">
|
||||||
<template slot-scope="{row}">
|
<el-autocomplete style="width: 100%"
|
||||||
<el-autocomplete style="width: 100%"
|
v-model="row.userName"
|
||||||
v-model="row.userName"
|
:fetch-suggestions="queryUserAsync"
|
||||||
:fetch-suggestions="queryUserAsync"
|
placeholder="请输入内容"
|
||||||
placeholder="请输入内容"
|
@select="handleSelect($event, row)"
|
||||||
@select="handleSelect($event, row)"
|
></el-autocomplete>
|
||||||
></el-autocomplete>
|
<!-- <el-input v-model="row.userName" maxlength="50"-->
|
||||||
<!-- <el-input v-model="row.userName" maxlength="50"-->
|
<!-- placeholder="请输入姓名"></el-input>-->
|
||||||
<!-- placeholder="请输入姓名"></el-input>-->
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="性别" prop="sex" width="200">
|
||||||
<el-table-column label="性别" prop="sex" width="200">
|
<template slot-scope="{row}">
|
||||||
<template slot-scope="{row}">
|
<el-radio-group v-model="row.sex">
|
||||||
<el-radio-group v-model="row.sex">
|
<el-radio label="男"></el-radio>
|
||||||
<el-radio label="男"></el-radio>
|
<el-radio label="女"></el-radio>
|
||||||
<el-radio label="女"></el-radio>
|
</el-radio-group>
|
||||||
</el-radio-group>
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="联系方式" prop="phone" width="200">
|
||||||
<el-table-column label="联系方式" prop="phone" width="200">
|
<template slot-scope="{row}">
|
||||||
<template slot-scope="{row}">
|
<el-input v-model="row.phone" maxlength="11" type="text"
|
||||||
<el-input v-model="row.phone" maxlength="11" type="text"
|
show-word-limit placeholder="请输入联系方式"></el-input>
|
||||||
show-word-limit placeholder="请输入联系方式"></el-input>
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="身份证件号" prop="idCard" width="250">
|
||||||
<el-table-column label="身份证件号" prop="idCard" width="250">
|
<template slot-scope="{row}">
|
||||||
<template slot-scope="{row}">
|
<el-input v-model="row.idCard" maxlength="18" type="text"
|
||||||
<el-input v-model="row.idCard" maxlength="18" type="text"
|
show-word-limit placeholder="请输入身份证件号"></el-input>
|
||||||
show-word-limit placeholder="请输入身份证件号"></el-input>
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="职务" prop="position" width="200">
|
||||||
<el-table-column label="职务" prop="position" width="200">
|
<template slot-scope="{row}">
|
||||||
<template slot-scope="{row}">
|
<el-input v-model="row.position" maxlength="100"
|
||||||
<el-input v-model="row.position" maxlength="100"
|
placeholder="请输入职务"></el-input>
|
||||||
placeholder="请输入职务"></el-input>
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<!--<el-table-column label="所属单位" prop="unitName" width="250">
|
||||||
<!--<el-table-column label="所属单位" prop="unitName" width="250">
|
<template slot-scope="{row}">
|
||||||
<template slot-scope="{row}">
|
<el-input v-model="row.unitName" maxlength="100" placeholder="请输所属单位"></el-input>
|
||||||
<el-input v-model="row.unitName" maxlength="100" placeholder="请输所属单位"></el-input>
|
</template>
|
||||||
</template>
|
</el-table-column>-->
|
||||||
</el-table-column>-->
|
<el-table-column width="100px" fixed="right">
|
||||||
<el-table-column width="100px" fixed="right">
|
<template slot="header" slot-scope="scope">
|
||||||
<template slot="header" slot-scope="scope">
|
<el-button type="primary" size="mini"
|
||||||
<el-button type="primary" size="mini"
|
@click="formData.userList.push({})">添加
|
||||||
@click="formData.userList.push({})">添加
|
</el-button>
|
||||||
</el-button>
|
</template>
|
||||||
</template>
|
<template slot-scope="scope">
|
||||||
<template slot-scope="scope">
|
<el-button
|
||||||
<el-button
|
type="danger"
|
||||||
type="danger"
|
icon="el-icon-delete"
|
||||||
icon="el-icon-delete"
|
size="mini"
|
||||||
size="mini"
|
:disabled="formData.userList.length===0"
|
||||||
:disabled="formData.userList.length===0"
|
@click="formData.userList.splice(scope.$index,1)"
|
||||||
@click="formData.userList.splice(scope.$index,1)"
|
></el-button>
|
||||||
></el-button>
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
</el-table>
|
||||||
</el-table>
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-form>
|
||||||
</el-form>
|
<div slot="footer" class="dialog-footer">
|
||||||
<div slot="footer" class="dialog-footer">
|
<el-button @click="addDialog = false">取 消</el-button>
|
||||||
<el-button @click="addDialog = false">取 消</el-button>
|
<el-button type="primary" @click="onAddUserSubmit">确 定</el-button>
|
||||||
<el-button type="primary" @click="onAddUserSubmit">确 定</el-button>
|
</div>
|
||||||
</div>
|
</el-dialog>
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
<el-dialog title="修改报名信息" :visible.sync="modifyDialog" width="40%">
|
<el-dialog title="修改报名信息" :visible.sync="modifyDialog" width="40%">
|
||||||
<el-form :model="modifyForm" :rules="modifyRules" ref="modifyFormRef" label-width="100px">
|
<el-form :model="modifyForm" :rules="modifyRules" ref="modifyFormRef" label-width="100px">
|
||||||
<el-form-item label="姓名" prop="userName">
|
<el-form-item label="姓名" prop="userName">
|
||||||
<el-input v-model="modifyForm.userName"></el-input>
|
<el-input v-model="modifyForm.userName"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="性别" prop="sex">
|
<el-form-item label="性别" prop="sex">
|
||||||
<el-radio-group v-model="modifyForm.sex">
|
<el-radio-group v-model="modifyForm.sex">
|
||||||
<el-radio label="男"></el-radio>
|
<el-radio label="男"></el-radio>
|
||||||
<el-radio label="女"></el-radio>
|
<el-radio label="女"></el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="联系方式" prop="phone">
|
<el-form-item label="联系方式" prop="phone">
|
||||||
<el-input v-model="modifyForm.phone"></el-input>
|
<el-input v-model="modifyForm.phone"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="身份证件号" prop="idCard">
|
<el-form-item label="身份证件号" prop="idCard">
|
||||||
<el-input v-model="modifyForm.idCard"></el-input>
|
<el-input v-model="modifyForm.idCard"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="职务" prop="position">
|
<el-form-item label="职务" prop="position">
|
||||||
<el-input v-model="modifyForm.position"></el-input>
|
<el-input v-model="modifyForm.position"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="所属单位" prop="unitName">
|
<el-form-item label="所属单位" prop="unitName">
|
||||||
<el-input v-model="modifyForm.unitName"></el-input>
|
<el-input v-model="modifyForm.unitName"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="modifyDialog = false">取消</el-button>
|
<el-button @click="modifyDialog = false">取消</el-button>
|
||||||
<el-button type="primary" @click="onModifySubmit">提交</el-button>
|
<el-button type="primary" @click="onModifySubmit">提交</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const vue = new Vue({
|
const vue = new Vue({
|
||||||
el: "#app",
|
el: "#app",
|
||||||
mixins: [initTableMixins],
|
mixins: [initTableMixins],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
pageForm: {
|
pageForm: {
|
||||||
isSignIn: 1,
|
isSignIn: 1,
|
||||||
year: new Date().getFullYear() + '',
|
year: new Date().getFullYear() + '',
|
||||||
},
|
},
|
||||||
activityList: [],
|
activityList: [],
|
||||||
// 修改表单
|
// 修改表单
|
||||||
modifyDialog: false,
|
modifyDialog: false,
|
||||||
modifyForm: {},
|
modifyForm: {},
|
||||||
modifyRules: {
|
modifyRules: {
|
||||||
userName: [{required: true, message: '请输入姓名', trigger: ['blur', 'change']}],
|
userName: [{required: true, message: '请输入姓名', trigger: ['blur', 'change']}],
|
||||||
sex: [{required: true, message: '请选择性别', trigger: ['blur', 'change']}],
|
sex: [{required: true, message: '请选择性别', trigger: ['blur', 'change']}],
|
||||||
phone: [{
|
phone: [{
|
||||||
required: true,
|
required: true,
|
||||||
validator: (rule, value, callback) => {
|
validator: (rule, value, callback) => {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
// 如果值为空,直接通过校验
|
// 如果值为空,直接通过校验
|
||||||
callback();
|
callback();
|
||||||
} else if (/^[1][345789][0-9]{9}$/.test(value)) {
|
} else if (/^[1][345789][0-9]{9}$/.test(value)) {
|
||||||
// 手机号格式正确
|
// 手机号格式正确
|
||||||
callback();
|
callback();
|
||||||
} else if (/^\d+-\d+$/.test(value) && value.length <= 16) {
|
} else if (/^\d+-\d+$/.test(value) && value.length <= 16) {
|
||||||
// 座机号格式正确
|
// 座机号格式正确
|
||||||
callback();
|
callback();
|
||||||
} else {
|
} else {
|
||||||
// 格式错误,返回错误信息
|
// 格式错误,返回错误信息
|
||||||
callback(new Error(value.includes('-') ? '座机号码格式错误' : '手机号码格式错误'));
|
callback(new Error(value.includes('-') ? '座机号码格式错误' : '手机号码格式错误'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
trigger: ["change", "blur"]
|
trigger: ["change", "blur"]
|
||||||
}],
|
}],
|
||||||
idCard: [
|
idCard: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
validator: (rule, value, callback) => {
|
validator: (rule, value, callback) => {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
// 如果值为空,直接通过校验
|
// 如果值为空,直接通过校验
|
||||||
callback();
|
callback();
|
||||||
} else if (/^[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])$/.test(value)) {
|
} else if (/^[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])$/.test(value)) {
|
||||||
// 18位身份证号码格式正确
|
// 18位身份证号码格式正确
|
||||||
callback();
|
callback();
|
||||||
} else if (/^[1-9]\d{7}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/.test(value)) {
|
} else if (/^[1-9]\d{7}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/.test(value)) {
|
||||||
// 15位身份证号码格式正确
|
// 15位身份证号码格式正确
|
||||||
callback();
|
callback();
|
||||||
} else if (/^[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}$/.test(value)) {
|
} else if (/^[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}$/.test(value)) {
|
||||||
// 外国人身份证号码格式正确(18位)
|
// 外国人身份证号码格式正确(18位)
|
||||||
callback();
|
callback();
|
||||||
} else if (/^[1-9]\d{7}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/.test(value)) {
|
} else if (/^[1-9]\d{7}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/.test(value)) {
|
||||||
// 外国人身份证号码格式正确(15位)
|
// 外国人身份证号码格式正确(15位)
|
||||||
callback();
|
callback();
|
||||||
} else {
|
} else {
|
||||||
// 格式错误,返回错误信息
|
// 格式错误,返回错误信息
|
||||||
callback(new Error("身份证号码格式错误"));
|
callback(new Error("身份证号码格式错误"));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
trigger: ["change", "blur"]
|
trigger: ["change", "blur"]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
position: [{required: true, message: '请输入职务', trigger: ['blur', 'change']}],
|
position: [{required: true, message: '请输入职务', trigger: ['blur', 'change']}],
|
||||||
unitName: [{required: true, message: '请输入所属单位', trigger: ['blur', 'change']}],
|
unitName: [{required: true, message: '请输入所属单位', trigger: ['blur', 'change']}],
|
||||||
},
|
},
|
||||||
|
|
||||||
// 添加报名人员相关
|
// 添加报名人员相关
|
||||||
addDialog: false,
|
addDialog: false,
|
||||||
formData: {
|
formData: {
|
||||||
activityId: '',
|
activityId: '',
|
||||||
userList: []
|
userList: []
|
||||||
},
|
},
|
||||||
formRules: {
|
formRules: {
|
||||||
activityId: [{required: true, message: '请选择活动', trigger: ['blur', 'change']}],
|
activityId: [{required: true, message: '请选择活动', trigger: ['blur', 'change']}],
|
||||||
unitName: [{required: true, message: '请填写参加单位', trigger: ['blur', 'change']}],
|
unitName: [{required: true, message: '请填写参加单位', trigger: ['blur', 'change']}],
|
||||||
contactName: [{required: true, message: '请填写联系人', trigger: ['blur', 'change']}],
|
contactName: [{required: true, message: '请填写联系人', trigger: ['blur', 'change']}],
|
||||||
contactPhone: [{required: true, message: '请填写联系电话', trigger: ['blur', 'change']}],
|
contactPhone: [{required: true, message: '请填写联系电话', trigger: ['blur', 'change']}],
|
||||||
userList: [{required: true, message: '请添加报名人员', trigger: ['blur', 'change']}]
|
userList: [{required: true, message: '请添加报名人员', trigger: ['blur', 'change']}]
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
doExport() {
|
doExport() {
|
||||||
window.open("/platform/activity/user/doExport?activityId=" + this.pageForm.activityId + "&searchKeyword=" + this.pageForm.searchKeyword)
|
window.open("/platform/activity/user/doExport?activityId=" + this.pageForm.activityId + "&searchKeyword=" + this.pageForm.searchKeyword)
|
||||||
},
|
},
|
||||||
openAddUser() {
|
openAddUser(){
|
||||||
if (!this.pageForm.activityId) {
|
if (!this.pageForm.activityId) {
|
||||||
this.$message.warning('请先选择活动')
|
this.$message.warning('请先选择活动')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.formData.userList = []
|
this.formData.userList = []
|
||||||
this.addDialog = true
|
this.addDialog = true
|
||||||
this.formData.activityId = this.pageForm.activityId
|
this.formData.activityId = this.pageForm.activityId
|
||||||
this.formData.activityName = this.activityList.find(item => item.id === this.formData.activityId).title
|
this.formData.activityName = this.activityList.find(item => item.id === this.formData.activityId).title
|
||||||
},
|
},
|
||||||
async queryUserAsync(query, cb) {
|
async queryUserAsync(query, cb){
|
||||||
const resp = await $.post('/platform/activity/user/queryUser', {
|
const resp = await $.post('/platform/activity/user/queryUser', {
|
||||||
query,
|
query,
|
||||||
activityId: this.formData.activityId
|
activityId: this.formData.activityId
|
||||||
})
|
})
|
||||||
if (resp.code === 0) {
|
if (resp.code === 0) {
|
||||||
if (resp.data.list && resp.data.list.length > 0) {
|
if (resp.data.list && resp.data.list.length > 0) {
|
||||||
cb(resp.data.list.map(v => {
|
cb(resp.data.list.map(v => {
|
||||||
return {value: v.username + '(' + (v.phone ? v.phone : '未填写联系方式') + ')', ...v}
|
return {value: v.username + '(' + (v.phone ? v.phone : '未填写联系方式') + ')', ...v}
|
||||||
}))
|
}))
|
||||||
} else {
|
} else {
|
||||||
cb([])
|
cb([])
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cb([])
|
cb([])
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleSelect(item, row) {
|
handleSelect(item, row){
|
||||||
this.$set(row, 'userId', item.id)
|
this.$set(row, 'userId', item.id)
|
||||||
this.$set(row, 'userName', item.username)
|
this.$set(row, 'userName', item.username)
|
||||||
this.$set(row, 'sex', item.sex)
|
this.$set(row, 'sex', item.sex)
|
||||||
this.$set(row, 'phone', item.phone ? item.phone : '')
|
this.$set(row, 'phone', item.phone ? item.phone : '')
|
||||||
},
|
},
|
||||||
async onAddUserSubmit() {
|
async onAddUserSubmit(){
|
||||||
const userList = this.formData.userList;
|
const userList = this.formData.userList;
|
||||||
if (!userList || userList === []) {
|
if (!userList || userList === []) {
|
||||||
this.$message.warning("请添加报名人员")
|
this.$message.warning("请添加报名人员")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let errorMessages = [];
|
let errorMessages = [];
|
||||||
const requiredFields = [
|
const requiredFields = [
|
||||||
{key: 'userName', message: '姓名不能为空'},
|
{ key: 'userName', message: '姓名不能为空' },
|
||||||
{key: 'sex', message: '性别不能为空'},
|
{ key: 'sex', message: '性别不能为空' },
|
||||||
{key: 'phone', message: '联系方式不能为空'},
|
{ key: 'phone', message: '联系方式不能为空' },
|
||||||
{key: 'idCard', message: '身份证件号不能为空'},
|
{ key: 'idCard', message: '身份证件号不能为空' },
|
||||||
{key: 'position', message: '职务不能为空'}
|
{ key: 'position', message: '职务不能为空' }
|
||||||
];
|
];
|
||||||
|
|
||||||
userList.forEach((user, index) => {
|
userList.forEach((user, index) => {
|
||||||
requiredFields.forEach(field => {
|
requiredFields.forEach(field => {
|
||||||
if (user[field.key] == null || user[field.key] === "") {
|
if (user[field.key] == null || user[field.key] === "") {
|
||||||
errorMessages.push('第' + (index + 1) + '行:' + field.message);
|
errorMessages.push('第' + (index + 1) + '行:' + field.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
if (errorMessages.length > 0) {
|
if (errorMessages.length > 0) {
|
||||||
// 将错误信息转换为 HTML 格式,使用 <br> 实现换行
|
// 将错误信息转换为 HTML 格式,使用 <br> 实现换行
|
||||||
const errorSummary = errorMessages.join("<br>");
|
const errorSummary = errorMessages.join("<br>");
|
||||||
this.$message.warning({
|
this.$message.warning({
|
||||||
message: errorSummary,
|
message: errorSummary,
|
||||||
dangerouslyUseHTMLString: true
|
dangerouslyUseHTMLString: true
|
||||||
});
|
});
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const formData = JSON.parse(JSON.stringify(this.formData));
|
const formData = JSON.parse(JSON.stringify(this.formData));
|
||||||
formData.userList = JSON.stringify(this.formData.userList)
|
formData.userList = JSON.stringify(this.formData.userList)
|
||||||
const resp = await $.post('/platform/activity/user/doAddActUser', formData)
|
const resp = await $.post('/platform/activity/user/doAddActUser', formData)
|
||||||
if (resp.code === 0) {
|
if (resp.code === 0) {
|
||||||
this.$message.success(resp.msg)
|
this.$message.success(resp.msg)
|
||||||
this.addDialog = false
|
this.addDialog = false
|
||||||
this.formData = {
|
this.formData = {
|
||||||
activityId: '',
|
activityId: '',
|
||||||
userList: []
|
userList: []
|
||||||
}
|
}
|
||||||
this.doSearch()
|
this.doSearch()
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning('操作失败')
|
this.$message.warning('操作失败')
|
||||||
console.log(resp.msg)
|
console.log(resp.msg)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async openModify(row) {
|
async openModify(row) {
|
||||||
const resp = await $.post('/platform/activity/user/findSignUserInfo', {id: row.id})
|
const resp = await $.post('/platform/activity/user/findSignUserInfo', {id: row.id})
|
||||||
if (resp.code === 0) {
|
if (resp.code === 0) {
|
||||||
this.modifyForm = resp.data
|
this.modifyForm = resp.data
|
||||||
this.modifyDialog = true
|
this.modifyDialog = true
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning('查询异常')
|
this.$message.warning('查询异常')
|
||||||
console.log(resp.msg)
|
console.log(resp.msg)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onModifySubmit() {
|
onModifySubmit() {
|
||||||
this.$refs.modifyFormRef.validate(async valid => {
|
this.$refs.modifyFormRef.validate(async valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const resp = await $.post('/platform/activity/user/doModifyActUser', this.modifyForm)
|
const resp = await $.post('/platform/activity/user/doModifyActUser', this.modifyForm)
|
||||||
if (resp.code === 0) {
|
if (resp.code === 0) {
|
||||||
this.$message.success(resp.msg)
|
this.$message.success(resp.msg)
|
||||||
this.modifyDialog = false
|
this.modifyDialog = false
|
||||||
this.$refs.modifyFormRef.resetFields()
|
this.$refs.modifyFormRef.resetFields()
|
||||||
this.doSearch()
|
this.doSearch()
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning('操作失败')
|
this.$message.warning('操作失败')
|
||||||
console.log(resp.msg)
|
console.log(resp.msg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async getActivityList() {
|
async getActivityList(){
|
||||||
const resp = await $.post('/platform/activity/user/getActivityList', {
|
const resp = await $.post('/platform/activity/user/getActivityList', {
|
||||||
year: this.pageForm.year
|
year: this.pageForm.year
|
||||||
})
|
})
|
||||||
if (resp.code === 0 && resp.data && resp.data.length > 0) {
|
if (resp.code === 0 && resp.data && resp.data.length > 0) {
|
||||||
this.activityList = resp.data
|
this.activityList = resp.data
|
||||||
this.$set(this.pageForm, 'activityId', this.activityList[0].id)
|
this.$set(this.pageForm, 'activityId', this.activityList[0].id)
|
||||||
} else {
|
} else {
|
||||||
this.$set(this.pageForm, 'activityId', '')
|
this.$set(this.pageForm, 'activityId', '')
|
||||||
}
|
}
|
||||||
this.pageData()
|
this.pageData()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getActivityList()
|
this.getActivityList()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<!--#
|
<!--#
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,78 @@
|
|||||||
|
const addOrUpdate = {
|
||||||
|
template: /*language=HTML*/ `
|
||||||
|
<el-dialog :title="form.id ? '修改' : '新增'" :visible.sync="visible" width="70%">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="标题" prop="title">
|
||||||
|
<el-input v-model="form.title" placeholder="请输入标题"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="内容" prop="content">
|
||||||
|
<text-editor v-model="form.content" :height="300"></text-editor>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否发布" prop="published">
|
||||||
|
<el-switch
|
||||||
|
v-model="form.published"
|
||||||
|
active-color="#13ce66"
|
||||||
|
inactive-color="#ff4949">
|
||||||
|
</el-switch>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="封面图" prop="cover">
|
||||||
|
<image-upload v-model="form.cover" :max-count="1"></image-upload>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="visible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="onSubmit">确定</el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
`,
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: '',
|
||||||
|
visible: false,
|
||||||
|
form: {
|
||||||
|
published: true,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
title: [{required: true, message: '请输入标题', trigger: ['blur', 'change']}],
|
||||||
|
content: [{required: true, message: '请输入内容', trigger: ['blur', 'change']}],
|
||||||
|
cover: [{required: true, message: '请上传封面图', trigger: ['blur', 'change']}],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onOpen(row) {
|
||||||
|
this.visible = true
|
||||||
|
if (row?.id) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form = JSON.parse(JSON.stringify(row))
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.form = {published: true}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onSubmit() {
|
||||||
|
this.$refs.form.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.$confirm('您确定要提交吗?', '提示', {
|
||||||
|
type: 'warning',
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消'
|
||||||
|
}).then(() => {
|
||||||
|
$.post('/platform/activity/wonderfulMoment/onHandle', {"wonderfulMoment": JSON.stringify(this.form)}).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.$message.success(this.form.id ? '修改成功' : '新增成功')
|
||||||
|
this.$emit('refresh')
|
||||||
|
this.visible = false
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,139 @@
|
|||||||
|
<!--#
|
||||||
|
layout("/layouts/platform_1.html"){
|
||||||
|
#-->
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
<div id="app">
|
||||||
|
<el-card shadow="never">
|
||||||
|
<div class="search">
|
||||||
|
<div class="search-item">
|
||||||
|
<div class="search-item-label">标题</div>
|
||||||
|
<div class="search-item-option">
|
||||||
|
<el-input v-model="pageForm.searchKeyword" clearable placeholder="请输入标题"></el-input>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="search-item">
|
||||||
|
<div class="search-item-label">开始时间</div>
|
||||||
|
<div class="search-item-option">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="pageForm.startTime"
|
||||||
|
type="date"
|
||||||
|
placeholder="请选择发布开始时间"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="search-item">
|
||||||
|
<div class="search-item-label">结束时间</div>
|
||||||
|
<div class="search-item-option">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="pageForm.endTime"
|
||||||
|
type="date"
|
||||||
|
placeholder="请选择发布结束时间"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="search-query">
|
||||||
|
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card shadow="never" class="mt-3">
|
||||||
|
<el-row type="flex" style="justify-content: flex-end" class="mb-3">
|
||||||
|
<el-button icon="el-icon-plus" type="primary" size="small" @click="$refs.addOrUpdateRef.onOpen()">新增精彩瞬间</el-button>
|
||||||
|
</el-row>
|
||||||
|
<el-table v-loading="tableLoading" show-overflow-tooltip :data="tableData">
|
||||||
|
<el-table-column label="序号" type="index" header-align="center" align="center" width="50"></el-table-column>
|
||||||
|
<el-table-column label="标题" prop="title"></el-table-column>
|
||||||
|
<el-table-column label="发布时间" prop="publishTime"></el-table-column>
|
||||||
|
<el-table-column label="阅读次数" prop="readCount"></el-table-column>
|
||||||
|
<el-table-column label="发布状态" prop="published">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-switch
|
||||||
|
@change="(val) => {publishedChange(val, row)}"
|
||||||
|
v-model="row.published"
|
||||||
|
active-color="#13ce66"
|
||||||
|
inactive-color="#ff4949">
|
||||||
|
</el-switch>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" fixed="right" width="250">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-button type="text" @click="$refs.addOrUpdateRef.onOpen(row)">修改</el-button>
|
||||||
|
<el-button type="text" class="text-danger" @click="onTableRowDelete(row.id)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!--#include("/layouts/pagination.html"){}#-->
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<add-or-update ref="addOrUpdateRef" @refresh="doSearch"></add-or-update>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
<!--#include('addOrUpdate.js'){}#-->
|
||||||
|
new Vue({
|
||||||
|
el: "#app",
|
||||||
|
mixins: [initTableMixins],
|
||||||
|
components: {
|
||||||
|
"add-or-update": addOrUpdate,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
pageForm: {
|
||||||
|
activityId: '',
|
||||||
|
},
|
||||||
|
activityList: [],
|
||||||
|
tableDeleteUrl: "/platform/activity/wonderfulMoment/onDelete"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onTableRowDelete(id) {
|
||||||
|
if (!id) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$confirm('确定删除该数据吗?', '提示', {
|
||||||
|
type: 'warning',
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消'
|
||||||
|
}).then(() => {
|
||||||
|
$.post(this.tableDeleteUrl, {id}).then((res) => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.$message.success("删除成功")
|
||||||
|
this.pageData()
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}).catch(() => {})
|
||||||
|
},
|
||||||
|
publishedChange(val, row) {
|
||||||
|
const params = JSON.parse(JSON.stringify(row))
|
||||||
|
this.$set(params, 'published', val)
|
||||||
|
$.post('/platform/activity/wonderfulMoment/onHandle', {"wonderfulMoment": JSON.stringify(params)}).then((res) => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.$message.success("修改成功")
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async getActivityList(){
|
||||||
|
const resp = await $.post('/platform/activity/user/getActivityList')
|
||||||
|
this.activityList = resp.data
|
||||||
|
},
|
||||||
|
},
|
||||||
|
async created() {
|
||||||
|
this.getActivityList()
|
||||||
|
await this.pageData()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<!--#
|
||||||
|
}
|
||||||
|
#-->
|
||||||
@@ -91,6 +91,12 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "精彩瞬间"
|
"navigationBarTitleText": "精彩瞬间"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/activity/wonderfulMoment/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "精彩瞬间"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
<template>
|
||||||
|
<view class="container">
|
||||||
|
<h3 class="container-title">{{ viewData?.title }}</h3>
|
||||||
|
<view class="container-sub-title">
|
||||||
|
<span>阅读 {{ viewData?.readCount }}</span>
|
||||||
|
<span style="margin-left: 30px">{{ moment(viewData?.publishTime).format('YYYY年MM月DD日 HH:mm') }}</span>
|
||||||
|
</view>
|
||||||
|
<view v-html="viewData?.content"></view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {ref, reactive, onMounted, computed, h} from 'vue';
|
||||||
|
import {onLoad} from "@dcloudio/uni-app";
|
||||||
|
import {Toast} from "tdesign-mobile-vue";
|
||||||
|
import {useRequest} from "@/utils/request";
|
||||||
|
import moment from "moment";
|
||||||
|
|
||||||
|
const request = useRequest()
|
||||||
|
const momentId = ref(null);
|
||||||
|
const viewData = ref(null);
|
||||||
|
|
||||||
|
function getWonderfulMoment() {
|
||||||
|
request.post('/platform/activity/wonderfulMoment/getWonderfulMomentById/' + momentId.value).then(res=>{
|
||||||
|
if(res.code === 0){
|
||||||
|
viewData.value = res.data
|
||||||
|
}else{
|
||||||
|
Toast({message: res.msg, theme: 'error'});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
onLoad((option) => {
|
||||||
|
if (option.id) {
|
||||||
|
momentId.value = Number(option.id);
|
||||||
|
getWonderfulMoment()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
onMounted(() => {
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
.container {
|
||||||
|
padding: 10px;
|
||||||
|
background-color: white !important;
|
||||||
|
min-height: 100%;
|
||||||
|
}
|
||||||
|
.container-sub-title {
|
||||||
|
margin-top: 20px;
|
||||||
|
color: #C9C9C9;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -32,41 +32,90 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="menu-text">项目报名</view>
|
<view class="menu-text">项目报名</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="menu-item" @click="navigateTo('/pages/activity/dynamic/index')">
|
<!-- <view class="menu-item" @click="navigateTo('/pages/activity/dynamic/index')">-->
|
||||||
<view class="menu-icon-wrapper blue-bg">
|
<!-- <view class="menu-icon-wrapper blue-bg">-->
|
||||||
<view class="menu-icon star-icon"></view>
|
<!-- <view class="menu-icon star-icon"></view>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
<view class="menu-text">精彩瞬间</view>
|
<!-- <view class="menu-text">精彩瞬间</view>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 精选内容区 -->
|
<!-- 精选内容区 -->
|
||||||
<view class="content-section">
|
<view class="content-section">
|
||||||
<view class="section-header">
|
<view class="section-header">
|
||||||
<view class="section-title">精选活动</view>
|
<view class="section-title">近期活动</view>
|
||||||
<view class="section-more" @click="navigateTo('/pages/activity/index')">更多</view>
|
<view class="section-more" @click="navigateTo('/pages/activity/list/index')">更多</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="activity-list">
|
<t-swiper
|
||||||
<view class="activity-item" @click="navigateTo('/pages/process/index')">
|
v-if="actList.length > 0"
|
||||||
<image class="activity-image"
|
:autoplay="actList.length > 1"
|
||||||
src="https://erp-bucket.pek3b.qingstor.com/assistant/746c37d6-018d-4c64-8a98-ea9ec8b0b3b5.png"
|
:navigation="{ type: 'fraction', paginationPosition: 'bottom-right', showControls: true }"
|
||||||
|
>
|
||||||
|
<t-swiper-item v-for="(item, index) in actList" :key="index" style="height: 192px">
|
||||||
|
<view class="activity-list" @click="navigateTo('/pages/activity/detail/index?id=' + item.id)">
|
||||||
|
<view class="activity-item">
|
||||||
|
<image class="activity-image"
|
||||||
|
:src="item.cover"
|
||||||
|
mode="widthFix"></image>
|
||||||
|
<view class="activity-info">
|
||||||
|
<view class="activity-title">{{ item.title }}</view>
|
||||||
|
<view class="activity-meta">
|
||||||
|
<text class="activity-time">{{ moment(item.startTime).format('M月DD日') + '-' + moment(item.endTime).format('DD日') }}</text>
|
||||||
|
<text class="activity-location">{{ item.address }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</t-swiper-item>
|
||||||
|
</t-swiper>
|
||||||
|
<t-empty
|
||||||
|
v-if="actList.length === 0"
|
||||||
|
description="暂无精彩瞬间"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="content-section">
|
||||||
|
<view class="section-header">
|
||||||
|
<view class="section-title">精彩瞬间</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="activity-list" v-if="wonderfulMomentList.length > 0">
|
||||||
|
<view class="moment-item" v-for="item in wonderfulMomentList" :key="item.id"
|
||||||
|
@click="handleWonderfulMoment(item)">
|
||||||
|
<image class="moment-image"
|
||||||
|
:src="item.cover"
|
||||||
mode="widthFix"></image>
|
mode="widthFix"></image>
|
||||||
<view class="activity-info">
|
<view class="moment-content">
|
||||||
<view class="activity-title">一分钟了解运动会流程</view>
|
<view class="moment-title">{{ item.title }}</view>
|
||||||
<view class="activity-meta">
|
<view class="moment-sub-content">
|
||||||
<text class="activity-time">6月15日-20日</text>
|
<view style="float: right;">{{ item.time }}</view>
|
||||||
<text class="activity-location">江苏省体育中心</text>
|
<view>阅读 {{ item.readCount }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<t-empty
|
||||||
|
v-if="wonderfulMomentList.length === 0"
|
||||||
|
description="暂无精彩瞬间"
|
||||||
|
/>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {onMounted} from "vue";
|
import {onMounted, ref} from "vue";
|
||||||
|
import {Toast} from "tdesign-mobile-vue";
|
||||||
|
import {useRequest} from "@/utils/request";
|
||||||
|
import moment from "moment";
|
||||||
|
|
||||||
|
const request = useRequest()
|
||||||
|
|
||||||
|
const actList = ref([])
|
||||||
|
const wonderfulMomentList = ref([])
|
||||||
|
|
||||||
function navigateTo(url) {
|
function navigateTo(url) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@@ -74,8 +123,39 @@ function navigateTo(url) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getActivity() {
|
||||||
|
request.post('/platform/activity/manage/getActivity').then(res=>{
|
||||||
|
if(res.code === 0){
|
||||||
|
actList.value = res.data
|
||||||
|
}else{
|
||||||
|
Toast({message: res.msg, theme: 'error'});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function getWonderfulMoment() {
|
||||||
|
request.post('/platform/activity/wonderfulMoment/getWonderfulMoment').then(res=>{
|
||||||
|
if(res.code === 0){
|
||||||
|
wonderfulMomentList.value = res.data
|
||||||
|
}else{
|
||||||
|
Toast({message: res.msg, theme: 'error'});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
function handleWonderfulMoment(row) {
|
||||||
|
request.post('/platform/activity/wonderfulMoment/handleWonderfulMoment/' + row.id).then(res=>{
|
||||||
|
if(res.code === 0){
|
||||||
|
getWonderfulMoment()
|
||||||
|
navigateTo('/pages/activity/wonderfulMoment/index?id=' + row.id)
|
||||||
|
}else{
|
||||||
|
Toast({message: res.msg, theme: 'error'});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
console.log('...........')
|
getActivity()
|
||||||
|
getWonderfulMoment()
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '欢迎使用',
|
title: '欢迎使用',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
@@ -87,6 +167,9 @@ onMounted(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
uni-page-body {
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
// 头部区域样式
|
// 头部区域样式
|
||||||
.header {
|
.header {
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -272,4 +355,27 @@ onMounted(() => {
|
|||||||
.activity-time {
|
.activity-time {
|
||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
}
|
}
|
||||||
|
.moment-image {
|
||||||
|
width: 180px;
|
||||||
|
height: 90px;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
.moment-item {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
.moment-title {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.moment-content {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
.moment-sub-content {
|
||||||
|
font-size: 12px;
|
||||||
|
color: grey;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -62,16 +62,16 @@
|
|||||||
<view class="login-card">
|
<view class="login-card">
|
||||||
<view class="login-tabs">
|
<view class="login-tabs">
|
||||||
<view
|
<view
|
||||||
:class="['tab', activeMethod === 'phone' ? 'active' : '']"
|
:class="['tab', loginForm.loginMethod === 'sms' ? 'active' : '']"
|
||||||
@click="setActiveMethod('phone')"
|
@click="loginForm.loginMethod = 'sms'"
|
||||||
>
|
>
|
||||||
手机快速登录
|
验证码登录
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
:class="['tab', activeMethod === 'password' ? 'active' : '']"
|
:class="['tab', loginForm.loginMethod === 'password' ? 'active' : '']"
|
||||||
@click="setActiveMethod('password')"
|
@click="loginForm.loginMethod = 'password'"
|
||||||
>
|
>
|
||||||
账号密码登录
|
密码登录
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 验证码输入框 -->
|
<!-- 验证码输入框 -->
|
||||||
<view class="input-box">
|
<view class="input-box" v-if="loginForm.loginMethod==='sms'">
|
||||||
<t-icon name="shield-error" size="20px" class="input-icon"/>
|
<t-icon name="shield-error" size="20px" class="input-icon"/>
|
||||||
<input
|
<input
|
||||||
class="input"
|
class="input"
|
||||||
@@ -104,6 +104,18 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 密码输入框 -->
|
||||||
|
<view class="input-box" v-else>
|
||||||
|
<t-icon name="user-password" size="20px" class="input-icon"/>
|
||||||
|
<input
|
||||||
|
class="input"
|
||||||
|
type="password"
|
||||||
|
v-model="loginForm.password"
|
||||||
|
placeholder="请输入密码"
|
||||||
|
maxlength="20"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 登录按钮 -->
|
<!-- 登录按钮 -->
|
||||||
<view class="submit-btn" @click="handleLogin">
|
<view class="submit-btn" @click="handleLogin">
|
||||||
立即登录
|
立即登录
|
||||||
@@ -127,17 +139,14 @@ import {useUserStore} from "@/store";
|
|||||||
|
|
||||||
const request = useRequest()
|
const request = useRequest()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const activeMethod = ref('phone')
|
|
||||||
|
|
||||||
const loginForm = reactive({
|
const loginForm = reactive({
|
||||||
phone: '',
|
phone: '',
|
||||||
smsCode: ''
|
smsCode: '',
|
||||||
|
password: '',
|
||||||
|
loginMethod: 'sms'
|
||||||
})
|
})
|
||||||
|
|
||||||
const setActiveMethod = (method) => {
|
|
||||||
activeMethod.value = method
|
|
||||||
}
|
|
||||||
|
|
||||||
// 倒计时相关
|
// 倒计时相关
|
||||||
const countdown = ref(0)
|
const countdown = ref(0)
|
||||||
const timer = ref(null)
|
const timer = ref(null)
|
||||||
@@ -265,10 +274,14 @@ async function handleLogin() {
|
|||||||
Toast('请输入手机号码');
|
Toast('请输入手机号码');
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!loginForm.smsCode) {
|
if (!loginForm.smsCode && loginForm.loginMethod === 'sms') {
|
||||||
Toast('请输入验证码');
|
Toast('请输入验证码');
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (!loginForm.password && loginForm.loginMethod === 'password') {
|
||||||
|
Toast('请输入密码');
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
userStore.smsLogin(loginForm).then(() => {
|
userStore.smsLogin(loginForm).then(() => {
|
||||||
@@ -318,7 +331,7 @@ async function handleLogin() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function navigateToRegister(){
|
function navigateToRegister() {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pages/login/register'
|
url: '/pages/login/register'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,8 +1,57 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="register-container">
|
<view class="register-container">
|
||||||
<view class="title-area">
|
<!-- 上半部分:图片区域 -->
|
||||||
<image class="bg-image" src="/static/login-bg.jpg" mode="aspectFill"></image>
|
<view class="image-area">
|
||||||
<view class="overlay"></view>
|
<div class="tech-animation">
|
||||||
|
<svg preserveAspectRatio="xMidYMid slice" viewBox="0 0 300 100">
|
||||||
|
<pattern id="pattern-hex" x="0" y="0" width="10" height="10" patternUnits="userSpaceOnUse"
|
||||||
|
patternTransform="scale(0.8)">
|
||||||
|
<rect x="0" y="0" width="10" height="10" fill="none"/>
|
||||||
|
<path d="M0,5 L2.5,0 L7.5,0 L10,5 L7.5,10 L2.5,10 Z" stroke-width="0.5" stroke="rgba(244, 90, 90, 0.2)"
|
||||||
|
fill="rgba(244, 90, 90, 0.1)">
|
||||||
|
<animate attributeName="stroke-opacity" values="0.1;0.3;0.1" dur="3s" repeatCount="indefinite"/>
|
||||||
|
</path>
|
||||||
|
</pattern>
|
||||||
|
<rect x="0" y="0" width="100%" height="100%" fill="url(#pattern-hex)"/>
|
||||||
|
|
||||||
|
<g fill="none" stroke-width="0.5">
|
||||||
|
<path d="M20,50 Q60,20 100,50 T180,50 T260,50" stroke="rgba(244, 90, 90, 0.6)">
|
||||||
|
<animate attributeName="d"
|
||||||
|
values="M20,50 Q60,20 100,50 T180,50 T260,50;
|
||||||
|
M20,50 Q60,80 100,50 T180,50 T260,50;
|
||||||
|
M20,50 Q60,20 100,50 T180,50 T260,50"
|
||||||
|
dur="10s" repeatCount="indefinite"/>
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path d="M20,70 Q60,40 100,70 T180,70 T260,70" stroke="rgba(244, 90, 90, 0.4)">
|
||||||
|
<animate attributeName="d"
|
||||||
|
values="M20,70 Q60,40 100,70 T180,70 T260,70;
|
||||||
|
M20,70 Q60,100 100,70 T180,70 T260,70;
|
||||||
|
M20,70 Q60,40 100,70 T180,70 T260,70"
|
||||||
|
dur="12s" repeatCount="indefinite"/>
|
||||||
|
</path>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<circle cx="50" cy="50" r="1" fill="rgba(244, 90, 90, 0.8)">
|
||||||
|
<animate attributeName="cx" values="50;250;50" dur="20s" repeatCount="indefinite"/>
|
||||||
|
<animate attributeName="cy" values="50;30;80;50" dur="16s" repeatCount="indefinite"/>
|
||||||
|
<animate attributeName="r" values="1;1.5;1" dur="5s" repeatCount="indefinite"/>
|
||||||
|
</circle>
|
||||||
|
|
||||||
|
<circle cx="150" cy="30" r="1" fill="rgba(244, 90, 90, 0.8)">
|
||||||
|
<animate attributeName="cx" values="150;100;200;150" dur="25s" repeatCount="indefinite"/>
|
||||||
|
<animate attributeName="cy" values="30;60;20;30" dur="18s" repeatCount="indefinite"/>
|
||||||
|
<animate attributeName="r" values="1;1.8;1" dur="6s" repeatCount="indefinite"/>
|
||||||
|
</circle>
|
||||||
|
|
||||||
|
<circle cx="250" cy="70" r="1" fill="rgba(244, 90, 90, 0.8)">
|
||||||
|
<animate attributeName="cx" values="250;150;250" dur="22s" repeatCount="indefinite"/>
|
||||||
|
<animate attributeName="cy" values="70;40;70" dur="15s" repeatCount="indefinite"/>
|
||||||
|
<animate attributeName="r" values="1;1.2;1" dur="4s" repeatCount="indefinite"/>
|
||||||
|
</circle>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
|
||||||
<view class="title-content">
|
<view class="title-content">
|
||||||
<text class="main-title">JOIN US</text>
|
<text class="main-title">JOIN US</text>
|
||||||
<view class="sub-title-container">
|
<view class="sub-title-container">
|
||||||
@@ -11,91 +60,77 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="form-wrapper">
|
<!-- 下半部分:表单区域 -->
|
||||||
<!-- 注册表单区域 -->
|
<view class="form-area">
|
||||||
<view class="form-container">
|
<!-- 姓名输入框 -->
|
||||||
<view class="form-title">填写信息</view>
|
<view class="input-box">
|
||||||
|
<t-icon name="user" size="20px" class="input-icon"/>
|
||||||
|
<input
|
||||||
|
class="input"
|
||||||
|
type="text"
|
||||||
|
v-model="formData.name"
|
||||||
|
placeholder="请输入姓名"
|
||||||
|
maxlength="20"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 姓名输入框 -->
|
<!-- 手机号码输入框 -->
|
||||||
<view class="input-box">
|
<view class="input-box">
|
||||||
<view class="input-icon-container">
|
<t-icon name="mobile" size="20px" class="input-icon"/>
|
||||||
<t-icon name="user" size="22px" class="input-icon"/>
|
<input
|
||||||
</view>
|
class="input"
|
||||||
<input
|
type="tel"
|
||||||
class="input"
|
v-model="formData.phone"
|
||||||
type="text"
|
placeholder="请输入手机号"
|
||||||
v-model="formData.name"
|
maxlength="11"
|
||||||
placeholder="请输入姓名"
|
/>
|
||||||
maxlength="20"
|
</view>
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 手机号码输入框 -->
|
<!-- 单位输入框 -->
|
||||||
<view class="input-box">
|
<view class="input-box" @click="showUnitPicker = true">
|
||||||
<view class="input-icon-container">
|
<t-icon name="home" size="20px" class="input-icon"/>
|
||||||
<t-icon name="mobile" size="22px" class="input-icon"/>
|
<view class="unit-selector" :class="{'has-value': formData.unitName}">
|
||||||
</view>
|
{{ formData.unitName || '请选择单位' }}
|
||||||
<input
|
|
||||||
class="input"
|
|
||||||
type="tel"
|
|
||||||
v-model="formData.phone"
|
|
||||||
placeholder="请输入手机号"
|
|
||||||
maxlength="11"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
|
<t-icon name="chevron-right" size="20px" class="arrow-icon"/>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 单位输入框 -->
|
<!-- 身份证输入框 -->
|
||||||
<view class="input-box" @click="showUnitPicker = true">
|
<view class="input-box">
|
||||||
<view class="input-icon-container">
|
<t-icon name="creditcard" size="20px" class="input-icon"/>
|
||||||
<t-icon name="home" size="22px" class="input-icon"/>
|
<input
|
||||||
</view>
|
class="input"
|
||||||
<view class="input placeholder" :class="{'has-value': formData.unitName}">
|
type="text"
|
||||||
{{ formData.unitName || '请选择单位' }}
|
v-model="formData.idCard"
|
||||||
</view>
|
placeholder="请输入身份证号码"
|
||||||
<t-icon name="chevron-right" size="20px" class="arrow-icon"/>
|
maxlength="18"
|
||||||
</view>
|
/>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 身份证输入框 -->
|
<!-- 验证码输入框 -->
|
||||||
<view class="input-box">
|
<view class="input-box">
|
||||||
<view class="input-icon-container">
|
<t-icon name="shield-error" size="20px" class="input-icon"/>
|
||||||
<t-icon name="id-card" size="22px" class="input-icon"/>
|
<input
|
||||||
</view>
|
class="input"
|
||||||
<input
|
type="number"
|
||||||
class="input"
|
v-model="formData.verificationCode"
|
||||||
type="text"
|
placeholder="请输入验证码"
|
||||||
v-model="formData.idCard"
|
maxlength="6"
|
||||||
placeholder="请输入身份证号码"
|
/>
|
||||||
maxlength="18"
|
<view class="verify-code-btn" @click="sendVerificationCode" :class="{ disabled: countdown > 0 }">
|
||||||
/>
|
{{ countdown > 0 ? `${countdown}秒` : '获取验证码' }}
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 验证码输入框 -->
|
<!-- 注册按钮 -->
|
||||||
<view class="input-box">
|
<view class="submit-btn" @click="handleRegister">
|
||||||
<view class="input-icon-container">
|
{{ registering ? '注册中...' : '立即注册' }}
|
||||||
<t-icon name="shield-check" size="22px" class="input-icon"/>
|
</view>
|
||||||
</view>
|
|
||||||
<input
|
|
||||||
class="input"
|
|
||||||
type="number"
|
|
||||||
v-model="formData.verificationCode"
|
|
||||||
placeholder="请输入验证码"
|
|
||||||
maxlength="6"
|
|
||||||
/>
|
|
||||||
<view class="verify-code-btn" @click="sendVerificationCode" :class="{ disabled: countdown > 0 }">
|
|
||||||
{{ countdown > 0 ? `${countdown}秒` : '获取验证码' }}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 注册按钮 -->
|
<!-- 登录链接 -->
|
||||||
<view class="submit-btn" :class="{ disabled: !isFormValid }" @click="handleRegister">
|
<view class="login-link-box">
|
||||||
{{ registering ? '注册中...' : '立即注册' }}
|
<text>已有账号?</text>
|
||||||
</view>
|
<text class="link-text" @click="goToLogin">立即登录</text>
|
||||||
|
|
||||||
<!-- 登录链接 -->
|
|
||||||
<view class="login-link-box">
|
|
||||||
<text>已有账号?</text>
|
|
||||||
<text class="link-text" @click="goToLogin">立即登录</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -368,184 +403,173 @@ onMounted(() => {
|
|||||||
|
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
.register-container {
|
.register-container {
|
||||||
|
height: 100vh;
|
||||||
|
background: #f4f2f2;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
min-height: 100vh;
|
|
||||||
background-color: #ffffff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.title-area {
|
.image-area {
|
||||||
|
padding: 0;
|
||||||
|
height: 30vh;
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 380rpx;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
background: linear-gradient(135deg, #7a1818 0%, #d03e3e 50%, #f45a5a 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tech-animation {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tech-animation svg {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bg-image {
|
.bg-image {
|
||||||
position: absolute;
|
display: none; /* 隐藏背景图片,使用动画背景 */
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.overlay {
|
.overlay {
|
||||||
position: absolute;
|
display: none; /* 不需要叠加层 */
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
background: linear-gradient(to bottom, rgba(244, 90, 90, 0.8), rgba(244, 90, 90, 0.5));
|
|
||||||
z-index: 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.title-content {
|
.title-content {
|
||||||
|
padding: 0 30px;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 3;
|
z-index: 1;
|
||||||
padding: 80rpx 40rpx;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-title {
|
.main-title {
|
||||||
font-size: 68rpx;
|
font-size: 36px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #fff;
|
margin-bottom: 8px;
|
||||||
margin-bottom: 20rpx;
|
display: block;
|
||||||
letter-spacing: 2rpx;
|
position: relative;
|
||||||
text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
|
z-index: 1;
|
||||||
|
color: #ffffff;
|
||||||
|
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.sub-title-container {
|
.sub-title-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sub-title {
|
.sub-title {
|
||||||
font-size: 38rpx;
|
font-size: 18px;
|
||||||
color: #fff;
|
color: #ffffff;
|
||||||
font-weight: 500;
|
|
||||||
text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-wrapper {
|
|
||||||
position: relative;
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-area {
|
||||||
|
flex: 1;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
padding: 0 40rpx;
|
border-radius: 30px 30px 0 0;
|
||||||
margin-top: -60rpx;
|
margin-top: -30px;
|
||||||
z-index: 10;
|
padding: 30px 30px 0;
|
||||||
border-radius: 50rpx 50rpx 0 0;
|
position: relative;
|
||||||
}
|
z-index: 2;
|
||||||
|
box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
|
||||||
.form-container {
|
|
||||||
padding: 60rpx 0 50rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-title {
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #333;
|
|
||||||
margin-bottom: 40rpx;
|
|
||||||
text-align: center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-box {
|
.input-box {
|
||||||
|
height: 50px;
|
||||||
|
background-color: #eceaea;
|
||||||
|
border-radius: 25px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 20rpx 0;
|
padding: 0 15px;
|
||||||
margin-bottom: 30rpx;
|
margin-bottom: 16px;
|
||||||
position: relative;
|
border-bottom: none;
|
||||||
border-bottom: 1px solid #f0f0f0;
|
|
||||||
transition: border-color 0.3s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input-box:focus-within {
|
|
||||||
border-bottom-color: #f45a5a;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input-icon-container {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
width: 70rpx;
|
|
||||||
height: 70rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
background: rgba(244, 90, 90, 0.1);
|
|
||||||
margin-right: 20rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-icon {
|
.input-icon {
|
||||||
color: #f45a5a;
|
|
||||||
}
|
|
||||||
|
|
||||||
.arrow-icon {
|
|
||||||
color: #ccc;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input {
|
|
||||||
flex: 1;
|
|
||||||
font-size: 28rpx;
|
|
||||||
height: 40rpx;
|
|
||||||
line-height: 40rpx;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.placeholder {
|
|
||||||
color: #999;
|
color: #999;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-icon-container {
|
||||||
|
display: none; /* 不使用图标容器 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.input, .unit-selector {
|
||||||
|
flex: 1;
|
||||||
|
height: 100%;
|
||||||
|
border: none;
|
||||||
|
font-size: 15px;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.unit-selector {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
color: gray;
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-value {
|
.has-value {
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.verify-code-btn {
|
.arrow-icon {
|
||||||
padding: 10rpx 20rpx;
|
color: #999;
|
||||||
background-color: #f45a5a;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 26rpx;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
text-align: center;
|
|
||||||
min-width: 180rpx;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.disabled {
|
.verify-code-btn {
|
||||||
background-color: #f8a8a8;
|
color: #f45a5a;
|
||||||
color: #fff;
|
font-size: 14px;
|
||||||
pointer-events: none;
|
white-space: nowrap;
|
||||||
|
background: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
min-width: auto;
|
||||||
|
|
||||||
|
&.disabled {
|
||||||
|
color: #999;
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.submit-btn {
|
.submit-btn {
|
||||||
background: linear-gradient(135deg, #f45a5a, #f78484);
|
margin-top: 32px;
|
||||||
height: 90rpx;
|
height: 50px;
|
||||||
border-radius: 45rpx;
|
background-color: #f45a5a;
|
||||||
color: #fff;
|
border-radius: 25px;
|
||||||
font-size: 32rpx;
|
color: white;
|
||||||
|
font-size: 16px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin: 50rpx 0 30rpx;
|
|
||||||
transition: transform 0.2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.submit-btn:active {
|
&.disabled {
|
||||||
transform: scale(0.98);
|
opacity: 0.6;
|
||||||
}
|
background-color: #f45a5a;
|
||||||
|
}
|
||||||
.submit-btn.disabled {
|
|
||||||
opacity: 0.7;
|
|
||||||
background: #ccc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-link-box {
|
.login-link-box {
|
||||||
|
margin-top: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
margin: 20rpx 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.link-text {
|
.link-text {
|
||||||
color: #f45a5a;
|
color: #f45a5a;
|
||||||
|
margin-left: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-picker {
|
.custom-picker {
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export default defineConfig({
|
|||||||
},*/
|
},*/
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': {
|
'/api': {
|
||||||
target: 'http://192.168.41.126:9090',
|
target: 'http://localhost:9090',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (path) => path.replace(/^\/api/, '')
|
rewrite: (path) => path.replace(/^\/api/, '')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user