-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnew.html
executable file
·121 lines (116 loc) · 2.25 KB
/
new.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
<!DOCTYPE html>
<html>
<head>
<title>重邮问答</title>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0,maximum-scale=1.0"/>
<link rel="stylesheet" type="text/css" href="css/index.css">
<script type="text/javascript" src="js/zepto.min.js"></script>
</head>
<body>
</body>
<script type="text/javascript">
//onloadpage
$(function(){
$('#share').css({'width':$(window).width()+'px','height':$(window).height()+'px'});
$('#outer').css({'width':$(window).width()+'px','height':$(window).height()+'px'});
});
//
function Player(){
this.ask: {
type = "",
key = "",
id = ""
},
this.ans: {
type = "";
key = "";
num = "";
content = [];
},
this.rank: {
type = "";
key = "";
id = "";
},
this.que: {
type = "";
key = "";
num = "";
content = [];
}
}
//获取题目
Player.prototype.getQue = function(this.ask){
$.ajax({
type: "post",
url: "",
data: {
type: que.type,
name: que.key,
id: que.id
},
dataType: 'json',
success: function(data){
this.view();
}
})
}
//发送答案并获取成绩
Player.prototype.pushAns = function(this.ans){
$.ajax({
type: "post",
url: "",
data: {
type: ans.type,
name: ans.key,
content: JSON.stringify(ans.content)
},
dataType: 'json',
success: function(data){
}
})
}
//获取排行榜及个人信息
Player.prototype.getRank = function(this.rank){
$.ajax({
type: "post",
url: "",
data: {
type: rank.type,
name: rank.key,
id: rank.id
},
dataType: 'json',
success: function(data){
}
})
}
//渲染
Player.prototype.view = function(que){
$.each(que,function(index,val){
var Que = "";
Que += '';
$('.cell').eq(index).find('.que').html(val[index].question);
$('.cell').eq(index).find('.que').attr('queId',val[index].qid);
var select = val[index].ans;
$.each($('.cell').eq(index).find('.ans'),function(index,element){
element.eq(index).attr('ansId',(index+1));
element.eq(index).html(select[index]);
});
});
}
//滑动
Player.prototype.slideRight = function(){
$('#inner').css();
}
var player = new Player();
//开始游戏
$('.start').on('touchend',function(){
});
//分享朋友圈
$('.share').on('touchend',function(){
$('#share').css('display','block');
});
</script>
</html>