-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzuijiacunkuan.html
65 lines (58 loc) · 2.02 KB
/
zuijiacunkuan.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Hello MUI</title>
<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">
</head>
<body>
<header class="mui-bar mui-bar-nav">
<h1 class="mui-title">存款计算</h1>
</header>
<div class="mui-content">
<form id='form' class="mui-input-group">
<div class="mui-input-row">
<label>首年存储(元)</label>
<input id="firstYear" type="text" value="10000" class="mui-input-clear mui-input" value="定期" >
</div>
<div class="mui-input-row">
<label>每年追加(元)</label>
<input id='perYearAmount' type="text" class="mui-input-clear mui-input" value="10000" placeholder="追加金额">
</div>
<div class="mui-input-row">
<label>年利率(%)</label>
<input type="text" id="perYear" value="4" class="mui-input-clear mui-input" placeholder="年利率">
</div>
<div class="mui-input-row">
<label>存储年限</label>
<input type="text" id="countYear" value="15" class="mui-input-clear mui-input" placeholder="总共存几年">
</div>
</form>
<div class="mui-content-padded">
<button onclick="countAmount()" class="mui-btn mui-btn-block mui-btn-primary">计算</button>
</div>
<br />
<br />
<br />
<div class="row mui-text-center ">
<span>存续满的总金额<font color="red" id="amount">0</font>元</span>
</div>
</div>
<script src="js/jquery.min.js"></script>
<script>
function countAmount(){
var amount = parseInt($("#firstYear").val());
var countYear = parseInt($("#countYear").val());
for (var i=0; i<countYear; i++) {
amount *= 1+parseFloat($("#perYear").val())/100;
amount += parseInt($("#perYearAmount").val());
}
$("#amount").text(Math.ceil(amount));
}
countAmount();
</script>
</body>
</html>