e80df919
atao
init
|
1
2
3
|
<!DOCTYPE html>
<html lang="en">
<head>
|
693a38d0
atao
提交代码
|
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
<meta charset="UTF-8">
<title>月续费</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta name="format-detection" content="telephone=no"/>
<meta name="format-detection" content="email=no"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-title" content="">
<meta name="google" value="notranslate"><!-- 禁止Chrome 浏览器中自动提示翻译 -->
<link rel="apple-touch-icon-precomposed" href="favicon.ico">
<link rel="shortcut icon" href="favicon.ico">
<link rel="Bookmark" href="favicon.ico">
<link rel="stylesheet" href="//cdn.bootcss.com/weui/1.1.1/style/weui.min.css">
<link rel="stylesheet" href="//cdn.bootcss.com/jquery-weui/1.0.1/css/jquery-weui.min.css">
<link rel="stylesheet" href="${staticHost}/css/reset.css">
|
e80df919
atao
init
|
19
20
21
|
</head>
<body ontouchstart>
<div class="weui-cells weui-cells_form">
|
693a38d0
atao
提交代码
|
22
23
24
25
26
|
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">车牌号</label></div>
<div class="weui-cell__bd">
<input class="weui-input" type="text" maxlength="7" value="${carNo!''}" readonly>
</div>
|
e80df919
atao
init
|
27
|
</div>
|
693a38d0
atao
提交代码
|
28
29
30
31
32
|
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">卡类别</label></div>
<div class="weui-cell__bd">
${cardTypeStr!''}
</div>
|
e80df919
atao
init
|
33
|
</div>
|
e80df919
atao
init
|
34
35
36
|
</div>
<div class="weui-cells weui-cells_form">
|
693a38d0
atao
提交代码
|
37
38
39
|
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">停车场</label></div>
<div class="weui-cell__bd">${parkName!''}</div>
|
e80df919
atao
init
|
40
|
</div>
|
d24e0b2b
王富生
提交修改
|
41
|
|
693a38d0
atao
提交代码
|
42
43
44
45
46
|
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">当前有效期</label></div>
<div class="weui-cell__bd" id="expiryDate">
${expDateStr!''}
</div>
|
e80df919
atao
init
|
47
|
|
e80df919
atao
init
|
48
|
</div>
|
693a38d0
atao
提交代码
|
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
<!-- <div class="weui-cell">
<div class="weui-cell__hd"><label for="date" class="weui-label">开始时间</label></div>
<div class="weui-cell__bd">
<input class="weui-input" id="date" type="text" placeholder="请选择开始时间">
</div>
<div class="weui-cell__ft">
</div>
</div>-->
<div class="weui-cell">
<div class="weui-cell__hd"><label for="date1" class="weui-label">有效期至</label></div>
<div class="weui-cell__bd">
<input class="weui-input" id="date1" type="text" readonly placeholder="请先选择开始时间">
</div>
</div>
|
d24e0b2b
王富生
提交修改
|
63
64
65
66
67
68
69
70
|
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">购买数量</label></div>
<div class="weui-cell__bd">
<span id="reduce_btn" class="reduce_btn">-</span>
<input class="weui-input inpt-num" id="numder" type="text" readonly="" value="1">
<span id="add_btn" class="add_btn">+</span>
</div>
</div>
|
693a38d0
atao
提交代码
|
71
72
73
74
75
|
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">合计</label></div>
<div class="weui-cell__bd pay-total">
¥<span id="totle_money">${cardPrice!'null'}</span>
</div>
|
e80df919
atao
init
|
76
|
</div>
|
e80df919
atao
init
|
77
78
|
</div>
<div class="pay-content-padded">
|
693a38d0
atao
提交代码
|
79
|
<a href="javascript:;" class="weui-btn weui-btn_primary" id="pay_btn">提交订单</a>
|
e80df919
atao
init
|
80
81
82
83
84
85
86
|
</div>
<script src="//cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
<script src="//cdn.bootcss.com/jquery-weui/1.0.1/js/jquery-weui.min.js"></script>
<script src="${staticHost}/js/jsutil.js"></script>
<script src="${staticHost}/js/url.js"></script>
<script>
|
693a38d0
atao
提交代码
|
87
88
89
90
91
92
93
94
95
|
//单价
var price = ${cardPrice!null};
var startDateStr = '${expDateStr!""}';
var id = ${id};
//添加数量
$("#add_btn").click(function () {
var num = $("#numder").val();
num++;
|
d24e0b2b
王富生
提交修改
|
96
|
if (num > 1 && num < 12) {
|
693a38d0
atao
提交代码
|
97
98
|
initEndDateStr(num);
} else {
|
d24e0b2b
王富生
提交修改
|
99
|
$.toptip('最多续期11个月', 2000, 'warning');
|
693a38d0
atao
提交代码
|
100
|
}
|
e80df919
atao
init
|
101
|
|
693a38d0
atao
提交代码
|
102
103
104
105
106
107
108
109
110
111
|
});
//减去数量
$("#reduce_btn").click(function () {
var num = $("#numder").val();
num--;
if (num > 0) {
initEndDateStr(num);
} else {
$.toptip('最少续期一个月', 2000, 'warning');
}
|
e80df919
atao
init
|
112
|
|
e80df919
atao
init
|
113
|
|
e80df919
atao
init
|
114
|
});
|
693a38d0
atao
提交代码
|
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
//立即支付
$('#pay_btn').on('click', function () {
var num = $("#numder").val();
if (num > 5 || num < 1) {
$.toptip('订购数量不合法', 2000, 'error')
}
var req = {
custCardId:${id},
num: num
}
$.ajax({
url: mUrl.renewSubmitOrder,
data: req,
type: 'Post',
success: function (res) {
if (res.code == '8888') {
var parkOrderId = res.data;
window.location.href = mUrl.orderPayView + '&parkOrderId=' + parkOrderId;
} else {
$.toptip('系统异常', 2000, 'error')
}
}
});
|
e80df919
atao
init
|
139
140
|
|
693a38d0
atao
提交代码
|
141
|
});
|
e80df919
atao
init
|
142
143
|
|
693a38d0
atao
提交代码
|
144
145
146
147
148
149
|
//计算结束时间
function initEndDateStr(num) {
num = parseInt(num);
//设置数量
$("#numder").val(num);
|
96d2824b
atao
提交代码
|
150
151
|
if(null == startDateStr|| startDateStr.length<4){
$.toptip('无法获取开始时间', 2000, 'warning');
|
693a38d0
atao
提交代码
|
152
|
}
|
96d2824b
atao
提交代码
|
153
154
155
156
157
158
159
160
|
var startDate = new Date(startDateStr);
var endDate = new Date(startDate.format('yyyy-MM-dd'));
var days = 0;
var temp = startDate.getMonth();
for (var i = 1; i <= num; i++) {
startDate.setMonth(temp + i);
startDate.setDate(0);
days += startDate.getDate();
|
693a38d0
atao
提交代码
|
161
|
}
|
96d2824b
atao
提交代码
|
162
163
|
days--;
endDate.setDate(endDate.getDate() + days);
|
693a38d0
atao
提交代码
|
164
|
//设置失效日期
|
96d2824b
atao
提交代码
|
165
166
167
|
$('#date1').val(endDate.format('yyyy-MM-dd'));
//设置总价
var price = $("#cardAmount").val();
|
693a38d0
atao
提交代码
|
168
|
$("#totle_money").html(num * price);
|
e80df919
atao
init
|
169
170
|
}
|
693a38d0
atao
提交代码
|
171
172
|
//第一次初始化为数量1
initEndDateStr(1);
|
e80df919
atao
init
|
173
174
175
176
177
|
</script>
</body>
</html>
|