offer.ejs
3.9 KB
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
<!DOCTYPE html>
<html>
<head>
<title> 企飞</title>
<meta http-equiv="X-UA-Compatible" content="IE=10">
<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no,minimal-ui">
<link rel="stylesheet" type="text/css" href="/css/core.css" />
<style>
.container{
margin: 50px auto;
width:90%;
border:1px solid #eee;
border-radius:6px;
}
.container>div{
margin:0px;
}
.row>div{
padding:0px;
}
#content{
font-size: 14px;
color:#999;
padding: 20px 30px 20px 30px;
border-bottom: 1px solid #eee;
}
#content span{
color:#333;
}
#buttonGroup{
padding:30px 0px;
text-align: center;
}
#buttonGroup a{
width:80%;
height:50px;
line-height: 35px;
font-size: 20px;
}
</style>
<script type="text/javascript" src="/js/zepto.min.js"></script>
</head>
<body>
<div class="container" style="padding:0px;">
<div class="row" id="content">
<div class="col-xs-12 col-sm-12 col-md-2 col-lg-2"><img src=""></div>
<div class="col-xs-12 col-sm-12 col-md-10 col-lg-10">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12" style="line-height:25px;">
<%- content %>
</div>
</div>
</div>
</div>
<div class="row" id="buttonGroup">
<% if (status!='rejected'&& status!='accepted') { %>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<a id="rejectBtn" class="btn btn-danger">拒绝Offer</a>
</div>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<a id="acceptBtn" class="btn btn-success">接受Offer</a>
</div>
<% } %>
<% if (status=='rejected') { %>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<a style="width:60%" type="button" disabled="disabled" class="btn btn-danger">
已拒绝Offer
</a>
</div>
<% } %>
<% if (status=='accepted') { %>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<a style="width:60%" type="button" disabled="disabled" class="btn btn-success">
已接受Offer
</a>
</div>
<% } %>
</div>
</div>
<script>
(function($){
var rejectedUrl='<%= reject_url %>';
var acceptUrl='<%= accept_url %>';
var offerId='<%= offerId %>';
var tenantId='<%= tenantId %>'
function sendRejectOffer(){
$.ajax({
type: "POST",
url: "/hr/sendRejectOffer",
contentType: 'application/json',
data: JSON.stringify({"url":rejectedUrl}),
success: function(msg){
console.log(msg);
if(msg&&msg.action=='ok'){
document.location.href='/offer/'+offerId+'?tenant_id='+tenantId;
}
}
});
}
function sendAcceptOffer(){
$.ajax({
type: "POST",
url: "/hr/acceptOffer",
contentType: 'application/json',
data: JSON.stringify({"url":acceptUrl}),
success: function(msg){
console.log(msg);
if(msg&&msg.action=='ok'){
document.location.href='/offer/'+offerId+'?tenant_id='+tenantId;
}
}
});
}
$('#rejectBtn').bind("touchstart",function(event){
sendRejectOffer();
});
$('#acceptBtn').bind("touchstart",function(event){
sendAcceptOffer();
});
$('#rejectBtn').bind("click",function(){
sendRejectOffer();
});
$('#acceptBtn').bind("click",function(){
sendAcceptOffer();
});
})(Zepto);
</script>
</body>
</html>