strict_pay.html
13.8 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
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<script src="../../assets/js/fontsize.js"></script>
<link rel="stylesheet" href="../../assets/css/api.css"/>
<link rel="stylesheet" href="../../assets/css/style.css">
<link rel="stylesheet" href="../../assets/css/index.css">
<link rel="stylesheet" href="../../assets/icon/iconfont.css">
<title></title>
<style>
.hr {
height: 0.11rem;
background-color: #f2f2f2;
}
.strict_label {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.32rem 0.42rem;
font-size: 14px;
color: #424242;
}
.strict_label_item {
color: #C2C1C3;
font-size: 12px;
display: flex;
align-items: center;
}
.strict_label_item .iconfont {
color: #C2C1C3;
margin-left: 0.1rem;
}
.strict_label_pay {
font-size: 12px;
color: #7E7E7E;
}
.strict_label_item input {
text-align: center;
width: 0.58rem;
font-size: 16px;
color: #424242;
}
.strict_input {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 0.39rem;
font-size: 14px;
border-top: 1px solid #f2f2f2;
}
.strict_input .iconfont {
color: #D8B25F;
margin-right: 0.17rem;
}
.strict_input .icon-credentials_icon {
margin: 0;
}
.strict_input input {
padding: 0.25rem 0;
text-align: right;
}
.strict_input input::-webkit-input-placeholder {
color: #C2C1C3;
font-size: 12px;
}
.sure_tips {
display: flex;
align-items: center;
padding: 0.25rem 0 0.25rem 0.44rem;
font-size: 12px;
color: #A4A4A4;
}
.sure_tips .iconfont {
color: #D8B25F;
margin-right: 0.17rem;
}
.strict_agree {
font-size: 12px;
display: flex;
padding: 0.42rem 0.49rem 0 0.46rem;
color: #A4A4A4;
}
.strict_agree .iconfont {
margin-right: 0.1rem;
}
.strict_agree .icon-yigouxuan {
color: #dbb25f;
}
.strict_agree_content {
padding: 0.22rem 0.19rem 0.29rem 0.08rem;
border-radius: 0.16rem;
border: 1px solid #B7B7B7;
}
.agree_btn {
color: #D8B25F;
}
.strict_btn_box {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 20px;
color: #E87139;
width: 100%;
position: fixed;
bottom: 0;
left: 0;
padding: 0 0 0 0.36rem;
box-shadow: 0 -0.1rem 0.1rem #f2f2f2;
background-color: #fff;
}
.strict_btn_box .rmb {
font-size: 15px;
}
.strict_btn {
padding: 0.28rem 0.8rem;
color: #fff;
background-color: #D8B25F;
font-size: 17px;
}
</style>
</head>
<body>
<div id="loadStart"></div>
<div id="app" v-cloak>
<div class="hr"></div>
<div class="strict_label" @click="popupVisible=true">
<div><span>VIP权益方案</span></div>
<div class="strict_label_item"><span>{{type_vip?type_vip:price_data[0].name}}</span><span
class="iconfont icon-xiangyou"></span></div>
</div>
<div class="hr"></div>
<div class="strict_label">
<div><span>选择金额</span><span class="strict_label_pay">(单位:万元)</span></div>
<div class="strict_label_item"><span class="iconfont icon-jian" @click="reduce"></span>
<input type="number" v-model="strict_num" @input="change_value">
<span
class="iconfont icon-jikediancanicon09" @click="plus"></span></div>
</div>
<div class="hr"></div>
<div class="strict_label">
<div><span>权益信息</span></div>
</div>
<form action="">
<div class="strict_input">
<div><span class="iconfont icon-yonghu"></span><span>姓名</span></div>
<div><input type="text" placeholder="请输入姓名" v-model="name"></div>
</div>
<div class="strict_input">
<div><span class="iconfont icon-credentials_icon"></span><span>身份证号</span></div>
<div><input type="text" placeholder="请输入身份证号码" v-model="idcard"></div>
</div>
<div class="strict_input">
<div><span class="iconfont icon-dianhua-1"></span><span>联系电话</span></div>
<div><input type="number" placeholder="请输入联系电话" v-model="tel"></div>
</div>
<div class="strict_input">
<div><span class="iconfont icon-dizhi"></span><span>地址</span></div>
<div><input type="text" placeholder="请填写接收文件地址" v-model="address"></div>
</div>
<div class="sure_tips">
<span class="iconfont icon-lababofang"></span><span>请正确填写权益人信息,以便给您发送相关协议等文件</span>
</div>
</form>
<div class="hr"></div>
<div class="strict_agree">
<div :class="['iconfont',agreement?'icon-weigouxuan':'icon-yigouxuan']" @click="agreement=!agreement"></div>
<div class="strict_agree_content">
我已阅读并同意<span class="agree_btn" @click="openAgree">《认购协议》</span>及其他相关条款协议,本人已充分
知晓认购后不可随意退出,愿意为投资存在的失败风险自行承担法律后果。
</div>
</div>
<div class="strict_btn_box" @click="pay_vip" :style="{position: pos}">
<div><span class="rmb">¥</span><span>{{strict_num}}万</span></div>
<div class="strict_btn">认购</div>
</div>
<mt-popup v-model="popupVisible" position="bottom" style="width: 100%">
<ul class="moreoul">
<li v-for="(item,index) in price_data" @click="power(index,item.name)">{{item.name}}</li>
<li @click="popupVisible=false" style="border-top: 2px solid #f0f0f0">取消</li>
</ul>
</mt-popup>
</div>
</body>
</html>
<script type="text/javascript" src="../../assets/js/api.js"></script>
<script type="text/javascript" src="../../assets/js/vue.min.js"></script>
<script type="text/javascript" src="../../assets/js/index.js"></script>
<script type="text/javascript" src="../../assets/js/public.js"></script>
<script type="text/javascript" src="../../assets/js/fastclick.js"></script>
<script>
new FastClick(document.body);
</script>
<script type="text/javascript" src="../../assets/js/axios.min.js"></script>
<script type="text/javascript" src="../../assets/icon/iconfont.js"></script>
<script>
var app = new Vue({
el: '#app',
data: {
strict_num: 2,
agreement: false,
popupVisible: false,
type_vip: '',
price_data: [],
plan_id: '',
name: '',
tel: '',
idcard: '',
address: '',
pos: 'fixed'
},
created: function () {
apiready = function () {
app.crowdPrice();
var client_h = window.innerHeight;
window.addEventListener('resize', function () {
if (window.innerHeight < client_h) {
app.pos = 'relative'
} else {
app.pos = 'fixed'
}
}, false);
}
},
methods: {
// 认购协议
openAgree: function () {
openView('agree_content', 'common/agree_content', '认购协议', 'agree_content', false, {
title_name: '认购协议',
id: 4
}, false)
},
// 选择权益
power: function (index, type) {
app.type_vip = type;
app.popupVisible = false;
app.strict_num = app.price_data[index].mix_price;
app.plan_id = app.price_data[index].id
},
// 减少数量
reduce: function () {
if (app.strict_num > 1) {
app.strict_num--;
for (var i in app.price_data) {
if (app.strict_num > parseInt(app.price_data[app.price_data.length - 1].max_price)) {
app.type_vip = app.price_data[app.price_data.length - 1].name;
app.plan_id = app.price_data[app.price_data.length - 1].id
}
else if (app.strict_num >= parseInt(app.price_data[i].mix_price) && app.strict_num <= parseInt(app.price_data[i].max_price)) {
app.type_vip = app.price_data[i].name;
app.plan_id = app.price_data[i].id
}
else {
}
}
}
},
// 增加数量
plus: function () {
app.strict_num++;
for (var i in app.price_data) {
if (app.strict_num > parseInt(app.price_data[app.price_data.length - 1].max_price)) {
app.type_vip = app.price_data[app.price_data.length - 1].name;
app.plan_id = app.price_data[app.price_data.length - 1].id
}
else if (app.strict_num >= parseInt(app.price_data[i].mix_price) && app.strict_num <= parseInt(app.price_data[i].max_price)) {
app.type_vip = app.price_data[i].name;
app.plan_id = app.price_data[i].id
}
else {
}
}
},
// 改变数量 输入框
change_value: function () {
if (!/^[2-9]+\d*$/.test(app.strict_num)) {
toastMsg('请输入大于等于2的整数');
app.strict_num = 1;
} else {
for (var i in app.price_data) {
if (app.strict_num > parseInt(app.price_data[app.price_data.length - 1].max_price)) {
app.type_vip = app.price_data[app.price_data.length - 1].name;
app.plan_id = app.price_data[app.price_data.length - 1].id
}
else if (app.strict_num >= parseInt(app.price_data[i].mix_price) && app.strict_num <= parseInt(app.price_data[i].max_price)) {
app.type_vip = app.price_data[i].name;
app.plan_id = app.price_data[i].id
}
else {
}
}
}
},
// 获取方案信息
crowdPrice: function () {
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
};
getRequest('post', 'portal/Goods/crowdPrice', null, header).then(function (res) {
if (res.data.code == 1) {
app.price_data = res.data.data;
app.plan_id = app.price_data[0].id;
loadEnd()
} else {
toastMsg(res.data.msg)
}
})
},
// 提交认购
pay_vip: function () {
if (app.strict_num < 1 && app.plan_id == '') {
toastMsg('请选择权益方案')
} else if (app.name == '') {
toastMsg('请输入姓名')
} else if (!id_card.test(app.idcard)) {
toastMsg('身份证号不正确')
} else if (!mobileReg.test(app.tel)) {
toastMsg('手机号不正确')
} else if (app.address == '') {
toastMsg('地址不能为空')
} else if (app.agreement == true) {
toastMsg('请同意协议')
}
else {
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
};
var post = {
price: app.strict_num,
plan_id: app.plan_id,
name: app.name,
idcard: app.idcard,
tel: app.tel,
address: app.address
};
getRequest('post', 'portal/Goods/crowdOrder', post, header).then(function (res) {
// alert(JSON.stringify(res));
if (res.data.code == 1) {
var order_id = res.data.data.oid;
openView('my_pay', 'my/my_pay', '支付', 'my_pay', false, {order_id: order_id});
} else {
toastMsg(res.data.msg)
}
});
}
}
}
})
</script>