抽奖活动管理页面前端开发
This commit is contained in:
parent
3746c7d3de
commit
87ada3cbe7
2
pom.xml
2
pom.xml
|
|
@ -238,6 +238,8 @@
|
||||||
<module>ruoyi-generator</module>
|
<module>ruoyi-generator</module>
|
||||||
<module>sino-activity</module>
|
<module>sino-activity</module>
|
||||||
<module>ruoyi-common</module>
|
<module>ruoyi-common</module>
|
||||||
|
<module>sino-act-web</module>
|
||||||
|
|
||||||
</modules>
|
</modules>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,11 @@ package com.ruoyi.web.controller.draw;
|
||||||
import com.ruoyi.web.vo.Const;
|
import com.ruoyi.web.vo.Const;
|
||||||
import com.ruoyi.web.vo.Result;
|
import com.ruoyi.web.vo.Result;
|
||||||
import com.ruoyi.web.vo.draw.*;
|
import com.ruoyi.web.vo.draw.*;
|
||||||
import com.sinosoft.activity.domain.ActConfig;
|
import com.sinosoft.activity.domain.*;
|
||||||
import com.sinosoft.activity.domain.ActPageConfigGuide;
|
import com.sinosoft.activity.service.IActPageConfigUserinfoService;
|
||||||
import com.sinosoft.activity.domain.DrawConfig;
|
import com.sinosoft.activity.service.IDrawConfigService;
|
||||||
import com.sinosoft.activity.domain.DrawInfo;
|
import com.sinosoft.activity.service.IDrawInfoService;
|
||||||
|
import com.sinosoft.activity.service.IDrawTaskNotifyService;
|
||||||
import com.sinosoft.activity.service.*;
|
import com.sinosoft.activity.service.*;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
|
@ -53,6 +54,11 @@ public class DrawController {
|
||||||
private IActPageConfigGuideService actPageConfigGuideService;
|
private IActPageConfigGuideService actPageConfigGuideService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IActConfigService actConfigService;
|
private IActConfigService actConfigService;
|
||||||
|
@Autowired
|
||||||
|
private IActPageConfigSubscribeService iActPageConfigSubscribeService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IActPageConfigUserinfoService iActPageConfigUserinfoService;
|
||||||
|
|
||||||
private WxOAuth2UserInfo getUserInfo(HttpServletRequest request, String code) throws Exception {
|
private WxOAuth2UserInfo getUserInfo(HttpServletRequest request, String code) throws Exception {
|
||||||
// if (!this.wxService.switchover(appid)) {
|
// if (!this.wxService.switchover(appid)) {
|
||||||
|
|
@ -204,6 +210,23 @@ public class DrawController {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value="/info.action", method = RequestMethod.POST)
|
||||||
|
@ResponseBody
|
||||||
|
public ActPageConfigUserinfoResult info(HttpServletRequest request, String drawCode) {
|
||||||
|
ActPageConfigUserinfoResult result = new ActPageConfigUserinfoResult();
|
||||||
|
logger.info("活动编码"+drawCode);
|
||||||
|
try{
|
||||||
|
List<ActPageConfigUserinfo> prizes = new ArrayList<ActPageConfigUserinfo>();
|
||||||
|
ActPageConfigUserinfo actPageConfigUserinfo = iActPageConfigUserinfoService.selectActPageConfigUserinfoByCode(drawCode);
|
||||||
|
prizes.add(actPageConfigUserinfo);
|
||||||
|
result.setActPageConfigUserinfo(prizes);
|
||||||
|
}catch (Exception e){
|
||||||
|
result.setRespCode("-1");
|
||||||
|
result.setRespMsg("系统异常,请稍后再试");
|
||||||
|
logger.error("DrawController.prizes ex: ", e);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
@RequestMapping(value="/prizes.action", method = RequestMethod.POST)
|
@RequestMapping(value="/prizes.action", method = RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public PrizeResult prizes(HttpServletRequest request, String drawCode, String isAll) {
|
public PrizeResult prizes(HttpServletRequest request, String drawCode, String isAll) {
|
||||||
|
|
@ -383,5 +406,32 @@ public class DrawController {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取活动配置展示信息,根据活动编码
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param actCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取二维码信息")
|
||||||
|
@ApiImplicitParam(name = "actCode", value = "活动编码", required = true, dataType = "string", paramType = "path")
|
||||||
|
@RequestMapping(value="/qrCode", method = RequestMethod.POST)
|
||||||
|
@ResponseBody
|
||||||
|
public ActPageConfigSubscribeResult qrcode(HttpServletRequest request, String actCode) {
|
||||||
|
ActPageConfigSubscribeResult result = new ActPageConfigSubscribeResult ();
|
||||||
|
try {
|
||||||
|
List<ActPageConfigSubscribe> list = new ArrayList<>();
|
||||||
|
|
||||||
|
ActPageConfigSubscribe subscribe = iActPageConfigSubscribeService.selectActPageConfigSubscribeByCode(actCode);
|
||||||
|
list.add(subscribe);
|
||||||
|
result.setActPageConfigSubscribe(list);
|
||||||
|
}catch (Exception e){
|
||||||
|
result.setRespCode("-1");
|
||||||
|
result.setRespMsg("系统异常,请稍后再试");
|
||||||
|
logger.error("DrawController.saveAddress ex: ", e);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.ruoyi.web.vo.draw;
|
||||||
|
|
||||||
|
import com.ruoyi.web.vo.Result;
|
||||||
|
import com.sinosoft.activity.domain.ActPageConfigSubscribe;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ActPageConfigSubscribeResult extends Result {
|
||||||
|
private List<ActPageConfigSubscribe> actPageConfigSubscribe;
|
||||||
|
|
||||||
|
public List<ActPageConfigSubscribe> getActPageConfigSubscribe() {
|
||||||
|
return actPageConfigSubscribe;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActPageConfigSubscribe(List<ActPageConfigSubscribe> actPageConfigSubscribe) {
|
||||||
|
this.actPageConfigSubscribe = actPageConfigSubscribe;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.ruoyi.web.vo.draw;
|
||||||
|
|
||||||
|
import com.ruoyi.web.vo.Result;
|
||||||
|
import com.sinosoft.activity.domain.ActPageConfigUserinfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
public class ActPageConfigUserinfoResult extends Result
|
||||||
|
{
|
||||||
|
|
||||||
|
private List<ActPageConfigUserinfo> actPageConfigUserinfo;
|
||||||
|
|
||||||
|
public List<ActPageConfigUserinfo> getActPageConfigUserinfo() {
|
||||||
|
return actPageConfigUserinfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActPageConfigUserinfo(List<ActPageConfigUserinfo> actPageConfigUserinfo) {
|
||||||
|
this.actPageConfigUserinfo = actPageConfigUserinfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,111 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh">
|
||||||
|
<head>
|
||||||
|
<meta name="viewport"
|
||||||
|
content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="format-detection" content="telephone=no"/>
|
||||||
|
<title>活动</title>
|
||||||
|
<link rel="stylesheet" href="css/reset.css">
|
||||||
|
<link rel="stylesheet" href="css/style.css">
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/popup.css"/>
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/myPrize.css"/>
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/register.css"/>
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/winPrize.css"/>
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/goods.css"/>
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/rule.css"/>
|
||||||
|
<script src="/js/config.js"></script>
|
||||||
|
<style type="text/css">
|
||||||
|
.button { /* 按钮美化 */
|
||||||
|
width: 200px; /* 宽度 */
|
||||||
|
height: 40px; /* 高度 */
|
||||||
|
border-width: 0px; /* 边框宽度 */
|
||||||
|
border-radius: 3px; /* 边框半径 */
|
||||||
|
background: #1E90FF; /* 背景颜色 */
|
||||||
|
cursor: pointer; /* 鼠标移入按钮范围时出现手势 */
|
||||||
|
outline: none; /* 不显示轮廓线 */
|
||||||
|
font-family: Microsoft YaHei; /* 设置字体 */
|
||||||
|
color: white; /* 字体颜色 */
|
||||||
|
font-size: 17px; /* 字体大小 */
|
||||||
|
}
|
||||||
|
.button:hover { /* 鼠标移入按钮范围时改变颜色 */
|
||||||
|
background: #5599FF;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
clear: both;
|
||||||
|
padding-bottom: 2em;
|
||||||
|
}
|
||||||
|
.drawCodeImgPic {
|
||||||
|
display: block;
|
||||||
|
margin:250px auto;
|
||||||
|
width: 200px;
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawQrCodePri {
|
||||||
|
text-align: center;
|
||||||
|
position: absolute;
|
||||||
|
top: 70%;
|
||||||
|
font-size: 25px;
|
||||||
|
left: 0%;
|
||||||
|
color: #F00;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<link rel="stylesheet" href="css/main.css">
|
||||||
|
<script src="js/jquery-1.9.1.min.js"></script>
|
||||||
|
<script src="js/awardRotate.js"></script>
|
||||||
|
<script src="js/util.js"></script>
|
||||||
|
<script src="js/draw.js"></script>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
async: false,
|
||||||
|
url: contextRootPath + "/draw/qrCode",
|
||||||
|
data: {actCode: drawCode},
|
||||||
|
dataType: "json",
|
||||||
|
success: function (data) {
|
||||||
|
//todo 根据风格改变css样式
|
||||||
|
$(".act_guide").attr("background",data.actPageConfigSubscribe[0].bgImg);
|
||||||
|
$("#qrCodeImgimg").attr("src",data.actPageConfigSubscribe[0].qrCode);
|
||||||
|
$("#qrCodePri").text(data.actPageConfigSubscribe[0].description);
|
||||||
|
},
|
||||||
|
error: function (XMLHttpRequest, textStatus, errorThrown) {
|
||||||
|
console.log('网络异常', textStatus, errorThrown);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body class="template_bg popupBox act_guide" style="background-color: #fbdaaf;
|
||||||
|
background-repeat:no-repeat;
|
||||||
|
background-attachment:fixed;
|
||||||
|
background-size:100% 100%;">
|
||||||
|
<div>
|
||||||
|
<p class="drawCodeImgPic">
|
||||||
|
<img id="qrCodeImgimg" src="" >
|
||||||
|
</p>
|
||||||
|
<h1 class="drawQrCodePri" id="qrCodePri"></h1>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="js/main.js"></script>
|
||||||
|
<script src="js/scroll.js"></script>
|
||||||
|
<script src="js/common.js"></script>
|
||||||
|
</body>
|
||||||
|
<script>
|
||||||
|
function jump(){
|
||||||
|
var flag = $("#flag").val;
|
||||||
|
//根据不同玩法跳转不同页面
|
||||||
|
if (flag == "0"){
|
||||||
|
window.location.href='turntable.html?drawCode='+drawCode;
|
||||||
|
}else{
|
||||||
|
window.location.href='scratchcard.html?drawCode='+drawCode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</html>
|
||||||
Loading…
Reference in New Issue