-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
170 lines (141 loc) · 3.39 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>叁级分销佣金计算器</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
ul {
list-style-type: none;
padding-left: 20px;
}
li {
margin: 10px 0;
padding: 5px;
border-radius: 4px;
background-color: #f5f5f5;
}
.node {
font-weight: bold;
}
.input-node {
display: inline-block;
width: 150px;
margin-right: 10px;
}
.commission {
margin-left: 10px;
color: green;
}
.level1 {
padding-left: 0;
margin-bottom: 20px;
}
.level2 {
padding-left: 20px;
margin: 10px 0;
}
.level3 {
padding-left: 40px;
margin: 10px 0;
}
.distributor-info {
margin: 10px 0;
padding: 10px;
background-color: #fff;
border-radius: 4px;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
input {
padding: 5px;
border: 1px solid #ddd;
border-radius: 4px;
margin: 0 5px;
}
input[type="text"] {
width: 150px;
}
input[type="number"] {
width: 80px;
}
label {
display: inline-block;
min-width: 200px;
}
h1 {
color: #333;
text-align: center;
margin-bottom: 30px;
}
h3 {
color: #666;
margin-top: 30px;
}
#treeDisplay {
margin-top: 20px;
padding: 20px;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
#treeDisplay li {
transition: all 0.3s ease;
}
#treeDisplay li:hover {
background-color: #e9e9e9;
}
.control-panel {
text-align: right;
margin-bottom: 20px;
}
.reset-button {
background-color: #ff4d4d;
color: white;
border: none;
padding: 10px 20px;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
transition: background-color 0.3s ease;
}
.reset-button:hover {
background-color: #ff3333;
}
</style>
</head>
<body>
<h1>叁级分销佣金计算器</h1>
<!-- 添加清零按钮 -->
<div class="control-panel">
<button id="resetButton" onclick="resetAll()" class="reset-button">一键清零</button>
</div>
<!-- 提成比例设置 -->
<div>
<label>请输入壹级分销商佣金比例(例如 0.1 表示 10%):</label>
<input type="number" id="level1CommissionRate" step="0.01" min="0" value="0.1" onchange="updateCommissions()">
</div>
<div>
<label>请输入贰级分销商佣金比例(例如 0.05 表示 5%):</label>
<input type="number" id="level2CommissionRate" step="0.01" min="0" value="0.05" onchange="updateCommissions()">
</div>
<div>
<label>请输入叁级分销商佣金比例(例如 0.03 表示 3%):</label>
<input type="number" id="level3CommissionRate" step="0.01" min="0" value="0.03" onchange="updateCommissions()">
</div>
<!-- 壹级分销商输入框 -->
<div>
<label>请输入壹级分销商数量:</label>
<input type="number" id="level1Count" min="1" oninput="addLevel1()">
</div>
<div id="level1Section"></div>
<h3>树状结构:</h3>
<div id="treeDisplay"></div>
<script src="app.js"></script>
</body>
</html>