-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patht_voteinfo.html
171 lines (168 loc) · 5.43 KB
/
t_voteinfo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>投票信息</title>
<link href="css/mui.min.css" rel="stylesheet" />
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="css/mui.min.css">
<!--App自定义的css-->
<link rel="stylesheet" type="text/css" href="css/app.css"/>
<link href="css/iconfont.css" rel="stylesheet"/>
<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
<style>
.blank{
height: 60px;
}
.mui-content{
margin-top: 20px;
background: #ffffff;
width: 100%;
height: 400px;
}
.info{
text-align:center;
margin-top: 20px;
height: 35px;
}
.delete{
text-align:center;
margin-top: 10px;
height: 35px;
}
#result{
margin-bottom: 3%;
background-color: #29C4B5;
color: #ffffff;
width:80%;
height:100%;
border-radius: 5px;
}
#del{
background-color: red;
color: #ffffff;
width:80%;
height:100%;
border-radius: 5px;
margin-bottom: 5%;
}
.testtitle{
margin-left: 20px;
font-size: 25px;
color:#29C4B5;
}
.testtime{
margin-left: 20px;
margin-top: 40px;
font-size: 30px;
color:#29C4B5;
}
.testday{
color: #7b7b7b;
margin-left: 20px;
margin-top: 40px;
font-size: 15px;
}
.testclass{
color: #7b7b7b;
margin-left: 20px;
margin-top: 40px;
font-size: 15px;
}
</style>
</head>
<body>
<header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" href="test_done.html"></a>
<h1 class="mui-title">投票信息</h1>
</header>
<div class="blank"></div>
<div class="mui-content">
<div class="testtitle" id="title">123</div>
<div class="testtime" id="time">19:00~20:00</div>
<div class="testday" id="day">日期:2016-10-1</div>
<div class="testclass"><span>学生:</span><span id="studentname">计科132班</span></div>
</div>
<div class="info">
<button id="result"></button>
</div>
<div class="delete" >
<button id="del">删除投票</button>
</div>
<script src="js/mui.min.js"></script>
<script src="js/tool.js"></script>
<script>
var userid = GetUseridCookie().get("userid");
if(userid==undefined){
alert("登录过期,请重新登录!");
javascript:window.location.href="login.html"
}
var start_time = UrlParm.parm("start_time");
var studentnames=UrlParm.parm("studentname");
var end_time = UrlParm.parm("end_time");
var title = UrlParm.parm("title");
// var classname = UrlParm.parm("classname");
var voteid = UrlParm.parm("voteid");
// alert(voteid);
var d=new Date();
//去掉最后一个逗号
studentnames = studentnames.substring(0,studentnames.length -1);
var start_timed=new Date(parseInt(start_time));
if(start_timed.getMinutes()<10){
var starttime=start_timed.getHours() + ":0" + start_timed.getMinutes() ;
}
else{
var starttime=start_timed.getHours() + ":" + start_timed.getMinutes() ;
}
var end_timed=new Date(parseInt(end_time));
if(end_timed.getMinutes()<10)
{
var endtime=end_timed.getHours() + ":0" + end_timed.getMinutes() ;
}
else{
var endtime=end_timed.getHours() + ":" + end_timed.getMinutes() ;
}
var test_day=new Date(parseInt(start_time));
var testday=test_day.getFullYear()+"-"+(test_day.getMonth()+1)+"-"+test_day.getDate();
document.getElementById("title").innerHTML = title;
document.getElementById("time").innerHTML = starttime+"~"+endtime;
document.getElementById("day").innerHTML = "开始日期:"+testday;
document.getElementById("studentname").innerHTML = studentnames;
if(d<end_time)
{
document.getElementById('result').innerHTML='投票未结束';
}
else{
document.getElementById('result').innerHTML='查看投票结果';
document.getElementById("result").onclick= function(){
window.location.href="voteResult.html?voteid="+voteid+'&title='+title;
}
}
document.getElementById("del").onclick = function(){
mui.ajax('http://'+url+'/jizhibackend/servlet/DeleteVoteTest',{
data:{
votetestid:voteid,
},
xhrFields: {
withCredentials: true
},
crossDomain: true,
dataType: 'json', //服务器返回json格式数据
type: 'post', //HTTP请求类型
timeout: 10000000, //超时时间设置为10秒;
headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' },
success: function(data) {
if(data.errcode==0){
alert("删除投票成功!");
window.location.href="t_vote.html";
}else{
alert("系统错误,请重新尝试!");
}
}
});
}
</script>
</body>
</html>