13 changed files with 581 additions and 267 deletions
@ -0,0 +1,44 @@ |
|||
package com.wmeimob.bjyy.controller; |
|||
|
|||
import com.wmeimob.bjyy.model.User; |
|||
import com.wmeimob.bjyy.service.TrainService; |
|||
import com.wmeimob.bjyy.util.RedisUtil; |
|||
import com.wmeimob.bjyy.util.SessionUtil; |
|||
import com.wmeimob.bjyy.vo.ResultVO; |
|||
import com.wmeimob.bjyy.vo.TrainVo; |
|||
import lombok.extern.log4j.Log4j; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.ResponseBody; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @description: 康复训练 |
|||
* @author: whj |
|||
* @time: 2021/2/6 16:05 |
|||
*/ |
|||
@Log4j |
|||
@ResponseBody |
|||
@RequestMapping("/wx/practice") |
|||
public class PracticeController { |
|||
|
|||
@Resource |
|||
private TrainService trainService; |
|||
|
|||
/** |
|||
* 根据用户ID查看最新的训练内容 |
|||
* @return 康复训练 |
|||
*/ |
|||
@RequestMapping("/last") |
|||
public ResultVO queryLastPractice(){ |
|||
ResultVO result=new ResultVO(); |
|||
String openId = SessionUtil.getValue(SessionUtil.SESSION_WX_OPENID); |
|||
User user = RedisUtil.getObject(RedisUtil.PREFIX_USER_INFO + openId); |
|||
log.info("查询训练计划:" + user.getId()); |
|||
List<TrainVo.TrainQueryVo> list = trainService.queryLastPractice(user.getId()); |
|||
result.setCode(0); |
|||
result.setData(list); |
|||
return result; |
|||
} |
|||
} |
@ -0,0 +1,261 @@ |
|||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> |
|||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> |
|||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %> |
|||
<c:set var="contextPath" value="${pageContext.request.contextPath}" /> |
|||
<!DOCTYPE html> |
|||
<html> |
|||
<head> |
|||
<meta charset="utf-8"><meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /><meta http-equiv="Pragma" content="no-cache" /><meta http-equiv="Expires" content="0" /> |
|||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
|||
<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, width=device-width"> |
|||
<meta name="apple-mobile-web-app-capable" content="yes"> |
|||
<meta content="black" name="apple-mobile-web-app-status-bar-style"> |
|||
<meta name="format-detection" content="telephone=no"> |
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
|||
<title>北京燕园</title> |
|||
<script src="${contextPath}/static/js/flexible.js"></script> |
|||
<script src="${contextPath}/static/js/jquery.js"></script> |
|||
<script src="${contextPath}/static/js/swiper.min.js"></script> |
|||
<link rel="stylesheet" href="${contextPath}/static/css/swiper.min.css"> |
|||
<link rel="stylesheet" type="text/css" href="${contextPath}/static/css/style.css"/> |
|||
</head> |
|||
<body> |
|||
<div class="iphone4 swiper-container" id="indexSwiper"> |
|||
<div class="swiper-wrapper"> |
|||
<div class="swiper-slide"> |
|||
<section class="sectionBox"> |
|||
<div class="wrapper" id="wrapperIndex"> |
|||
<div class="scroller center"> |
|||
<!-- 头部 --> |
|||
|
|||
<div class="header mt"> |
|||
<div class="return"><img src="${contextPath}/static/images/return.png" width="100%"></div> |
|||
<div class="title">训练跟踪</div> |
|||
</div> |
|||
<div class="follow mt"> |
|||
<h2>训练周期<span id="wholePeriod"><f:formatDate pattern="yyyy/MM/dd" value="${firstDay}"/> |
|||
-<f:formatDate pattern="yyyy/MM/dd" value="${endDay}"/></span></h2> |
|||
<p>每周训练完成后,在训练点击完成次数;点击下一周可进入下一周。</p> |
|||
</div> |
|||
<div class="center"> |
|||
|
|||
<form name="firstBasicForm" onsubmit="return false;"> |
|||
<div class="follow mt" id="uldiv"> |
|||
<c:if test="${practice==null}"> |
|||
<h2><em name="time"><f:formatDate pattern="yyyy/MM/dd" value="${firstDay}"/>- |
|||
<f:formatDate pattern="yyyy/MM/dd" value="${sevDay}"/></em> |
|||
<span>第<em name="period">1</em>周</span></h2> |
|||
</c:if> |
|||
<c:if test="${practice!=null }"> |
|||
<h2><em name="time"><f:formatDate pattern="yyyy/MM/dd" value="${practice.startAt}"/>- |
|||
<f:formatDate pattern="yyyy/MM/dd" value="${practice.endAt}"/></em> |
|||
<span>第<em name="period">${practice.practicePeriod }</em>周</span></h2> |
|||
</c:if> |
|||
|
|||
<ul> |
|||
<li> |
|||
<div class="left">数字方格</div> |
|||
<div class="right"> |
|||
<div class="add-minus"> |
|||
<img src="${contextPath}/static/images/minus.png" width="100%" class="minus"> |
|||
<input type="text" value="0" name="firstPractice" class="num"> |
|||
<img src="${contextPath}/static/images/add.png" width="100%" class="add"> |
|||
</div> |
|||
</div> |
|||
</li> |
|||
<li> |
|||
<div class="left">正方体拼图</div> |
|||
<div class="right"> |
|||
<div class="add-minus"> |
|||
<img src="${contextPath}/static/images/minus.png" width="100%" class="minus"> |
|||
<input type="text" value="0" name="thirdPractice" class="num"> |
|||
<img src="${contextPath}/static/images/add.png" width="100%" class="add"> |
|||
</div> |
|||
</div> |
|||
</li> |
|||
<li> |
|||
<div class="left">图片</div> |
|||
<div class="right"> |
|||
<div class="add-minus"> |
|||
<img src="${contextPath}/static/images/minus.png" width="100%" class="minus"> |
|||
<input type="text" value="0" name="fifthPractice" class="num"> |
|||
<img src="${contextPath}/static/images/add.png" width="100%" class="add"> |
|||
</div> |
|||
</div> |
|||
</li> |
|||
<li> |
|||
<div class="left">迷宫</div> |
|||
<div class="right"> |
|||
<div class="add-minus"> |
|||
<img src="${contextPath}/static/images/minus.png" width="100%" class="minus"> |
|||
<input type="text" value="0" name="eighthPractice" class="num"> |
|||
<img src="${contextPath}/static/images/add.png" width="100%" class="add"> |
|||
</div> |
|||
</div> |
|||
</li> |
|||
<li> |
|||
<div class="left">找不同</div> |
|||
<div class="right"> |
|||
<div class="add-minus"> |
|||
<img src="${contextPath}/static/images/minus.png" width="100%" class="minus"> |
|||
<input type="text" value="0" name="tenthPractice" class="num"> |
|||
<img src="${contextPath}/static/images/add.png" width="100%" class="add"> |
|||
</div> |
|||
</div> |
|||
</li> |
|||
<li> |
|||
<div class="left">数独</div> |
|||
<div class="right"> |
|||
<div class="add-minus"> |
|||
<img src="${contextPath}/static/images/minus.png" width="100%" class="minus"> |
|||
<input type="text" value="0" name="twelfthPractice" class="num"> |
|||
<img src="${contextPath}/static/images/add.png" width="100%" class="add"> |
|||
</div> |
|||
</div> |
|||
</li> |
|||
<li> |
|||
<div class="left">串珠</div> |
|||
<div class="right"> |
|||
<div class="add-minus"> |
|||
<img src="${contextPath}/static/images/minus.png" width="100%" class="minus"> |
|||
<input type="text" value="0" name="sixthPractice" class="num"> |
|||
<img src="${contextPath}/static/images/add.png" width="100%" class="add"> |
|||
</div> |
|||
</div> |
|||
</li> |
|||
<li> |
|||
<div class="left">颜色旗</div> |
|||
<div class="right"> |
|||
<div class="add-minus"> |
|||
<img src="${contextPath}/static/images/minus.png" width="100%" class="minus"> |
|||
<input type="text" value="0" name="ninthPractice" class="num"> |
|||
<img src="${contextPath}/static/images/add.png" width="100%" class="add"> |
|||
</div> |
|||
</div> |
|||
</li> |
|||
<li> |
|||
<div class="left">木条</div> |
|||
<div class="right"> |
|||
<div class="add-minus"> |
|||
<img src="${contextPath}/static/images/minus.png" width="100%" class="minus"> |
|||
<input type="text" value="0" name="eleventhPractice" class="num"> |
|||
<img src="${contextPath}/static/images/add.png" width="100%" class="add"> |
|||
</div> |
|||
</div> |
|||
</li> |
|||
<li> |
|||
<div class="left">扑克</div> |
|||
<div class="right"> |
|||
<div class="add-minus"> |
|||
<img src="${contextPath}/static/images/minus.png" width="100%" class="minus"> |
|||
<input type="text" value="0" name="forthPractice" class="num"> |
|||
<img src="${contextPath}/static/images/add.png" width="100%" class="add"> |
|||
</div> |
|||
</div> |
|||
</li> |
|||
<li> |
|||
<div class="left">钟表</div> |
|||
<div class="right"> |
|||
<div class="add-minus"> |
|||
<img src="${contextPath}/static/images/minus.png" width="100%" class="minus"> |
|||
<input type="text" value="0" name="secondPractice" class="num"> |
|||
<img src="${contextPath}/static/images/add.png" width="100%" class="add"> |
|||
</div> |
|||
</div> |
|||
</li> |
|||
<li> |
|||
<div class="left">空间记忆</div> |
|||
<div class="right"> |
|||
<div class="add-minus"> |
|||
<img src="${contextPath}/static/images/minus.png" width="100%" class="minus"> |
|||
<input type="text" value="0" name="seventhPractice" class="num"> |
|||
<img src="${contextPath}/static/images/add.png" width="100%" class="add"> |
|||
</div> |
|||
</div> |
|||
</li> |
|||
</ul> |
|||
|
|||
<div class="nextweek"><a>下一周</a></div> |
|||
</div> |
|||
|
|||
</form> |
|||
|
|||
<c:if test="${mentalTest.gradeResult==1 }"> |
|||
<%@include file="/static/train_aid/first_grade.jsp"%> |
|||
</c:if> |
|||
<c:if test="${mentalTest.gradeResult==2 }"> |
|||
<%@include file="/static/train_aid/second_grade.jsp"%> |
|||
</c:if> |
|||
<c:if test="${mentalTest.gradeResult==3 }"> |
|||
<%@include file="/static/train_aid/third_grade.jsp"%> |
|||
</c:if> |
|||
<c:if test="${mentalTest.gradeResult==4 }"> |
|||
<%@include file="/static/train_aid/forth_grade.jsp"%> |
|||
</c:if> |
|||
</div> |
|||
|
|||
<%-- <jsp:include page="/WEB-INF/train_aid/first_grade.jsp"></jsp:include> --%> |
|||
<!-- <div class="highbg"></div> --> |
|||
|
|||
</div> |
|||
</div> |
|||
</section> |
|||
</div> |
|||
<div class="deletebox"> |
|||
<div class="deleteboxcon Vcenter"> |
|||
<p>确定提交吗?</p> |
|||
<div class="btn"><a class="cancel">取消</a><a class="confirm">确认</a></div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<script src="${contextPath}/static/js/swiper.animate.min.js"></script> |
|||
<%--//<script src="${contextPath}/static/js/iscroll.js"></script>--%> |
|||
<script src="${contextPath}/static/js/main.js"></script> |
|||
|
|||
|
|||
<!-- 配置滚动条 --> |
|||
<script type="text/javascript"> |
|||
$(function(){ |
|||
// setTimeout(function(){ |
|||
// loadedScroll("#wrapperIndex",false,true); |
|||
// },2000); |
|||
// iScroll.refresh(); |
|||
// $('body').click(function(){$('input').blur();}) |
|||
}); |
|||
|
|||
$(".nextweek").click(function(){ |
|||
$(".deletebox").show(); |
|||
}); |
|||
|
|||
$(".confirm").click(function(){ |
|||
$(".deletebox").hide(); |
|||
$.ajax({ |
|||
url:"${contextPath}/wx/mental/nextweek", |
|||
type:'post', |
|||
data:$("form[name='firstBasicForm']").serialize(), |
|||
success:function(result){ |
|||
if (result.code==0) { |
|||
$("#uldiv ul").find("input").each(function(){ |
|||
$(this).val(0); |
|||
}); |
|||
$("#uldiv h2").find("em[name='time']").html(""); |
|||
$("#uldiv h2").find("em[name='time']").html(result.data.startTime+"-"+result.data.endTime); |
|||
$("#uldiv h2").find("em[name='period']").html(result.data.practicePeriod); |
|||
}else if(result.code==2){ |
|||
alert(result.message); |
|||
window.location.href="${contextPath}/wx/mental/nextweekLast"; |
|||
}else{ |
|||
alert(result.message); |
|||
} |
|||
}, |
|||
error:function(){ |
|||
alert("系统异常"); |
|||
} |
|||
}); |
|||
}); |
|||
|
|||
</script> |
|||
</body> |
|||
</html> |
Loading…
Reference in new issue