baibx 2 月之前
父节点
当前提交
7759a602b3

+ 1 - 1
com.sharemao.web.manager/src/main/webapp/index.jsp

@@ -34,7 +34,7 @@
34 34
               <input value="登录" style="width:100%;" type="submit">
35 35
           </form>
36 36
       </div>
37
-      <div class="copyright" onclick="location.href='https://beian.miit.gov.cn'" style="cursor: pointer;">粤ICP备2023131131号</div>
37
+      <div class="copyright" onclick="location.href='https://beian.miit.gov.cn'" style="cursor: pointer;">粤ICP备2023131131号-5</div>
38 38
       <div class="copyright">Copyright © 2018 - 2026 广州小橙信息技术有限公司</div>
39 39
 </div>
40 40
 </body>

+ 5 - 1
com.sharemao.web.xw3/src/main/java/com/sharemao/web/wx/ctrl/PayCtrl.java

@@ -470,7 +470,7 @@ public class PayCtrl
470 470
         }*/
471 471
         para.put("devid", devid);
472 472
         String devTypeResult = GzhUtil.sendPost(Constants.m3IntAddr + "/device/getDevType.do", para);
473
-        int showmemspkg=1;
473
+        int showmemspkg=1,typeid=0;
474 474
         try {
475 475
             if(!Tools.isEmpty(devTypeResult))
476 476
             {
@@ -480,6 +480,7 @@ public class PayCtrl
480 480
                     JSONObject devTypeDataJson = devTypeJson.getJSONObject("data");
481 481
                     JSONObject devtypeJo = devTypeDataJson.getJSONObject("devtype");
482 482
                     showmemspkg = devtypeJo.getIntValue("showmemspkg");
483
+                    typeid = devtypeJo.getIntValue("id");
483 484
                 }
484 485
             }
485 486
         } catch (Exception e) {
@@ -489,6 +490,9 @@ public class PayCtrl
489 490
 		context.getRequest().setAttribute("pkgInfo", pkgInfo);
490 491
 		context.getRequest().setAttribute("devid", devid);
491 492
 		context.getRequest().setAttribute("openid", yfpayopenid);
493
+        if (typeid==17){
494
+            return new TextView("/pkgorder_pdd.jsp");
495
+        }
492 496
 		return new TextView("/pkgorder.jsp");
493 497
 	}
494 498
 	

+ 788 - 0
com.sharemao.web.xw3/src/main/webapp/pkgorder_pdd.jsp

@@ -0,0 +1,788 @@
1
+<%@ page language="java" pageEncoding="UTF-8"%>
2
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
3
+<!DOCTYPE html>
4
+<html>
5
+
6
+<head>
7
+    <meta charset="UTF-8" />
8
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
9
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes" />
10
+    <meta name="renderer" content="webkit">
11
+    <meta http-equiv="Cache-Control" content="no-siteapp" />
12
+    <meta name="applicable-device" content="mobile">
13
+    <meta name="format-detection" content="telephone=no" />
14
+    <meta http-equiv="title" content="" />
15
+    <title>购买套餐</title>
16
+    <meta name="description" content="" />
17
+    <meta name="keywords" content="" />
18
+    <link rel="stylesheet" href="/static/css/animate.min.css" type="text/css" media="all" />
19
+    <link rel="stylesheet" href="/static/css/style.css" type="text/css" media="all" />
20
+	<link rel="stylesheet" href="/static/css/swiper-bundle.min.css" type="text/css" media="all" />
21
+    <script language="javascript" type="text/javascript" src="/static/js/jquery-3.6.0.min.js"></script>
22
+    <script language="javascript" type="text/javascript" src="/static/js/animate.min.js"></script>
23
+    <script language="javascript" type="text/javascript" src="/static/js/main.js"></script>
24
+	<script language="javascript" type="text/javascript" src="/static/js/swiper-bundle.min.js"></script>
25
+    <script type="text/javascript" src="/static/js/ap.js"></script>
26
+	<style>
27
+	.form-wallet{
28
+        border-bottom: 1px solid #f0f0f0;
29
+    }
30
+    .form-wallet .form-item{
31
+        border-bottom: none;
32
+    }
33
+    .wallet-money{
34
+        display: none;
35
+        width: 100%;
36
+        padding: 2px 25px;
37
+        height:65px;
38
+        position: relative;
39
+    }
40
+    .wallet-money.show{
41
+        display: block;
42
+    }
43
+    .wallet-container{
44
+        display: block;
45
+        width: 100%;
46
+        min-height:45px;
47
+        position: relative;
48
+        list-style: none;
49
+        overflow: hidden;
50
+        z-index: 1;
51
+    }
52
+    .wallet-container .swiper-slide{
53
+        display: block;
54
+        width: 33.33%;
55
+        height: 45px;
56
+        position: relative;
57
+        border-radius: 8px;
58
+        overflow: hidden;
59
+        background-color: #FFFFFF;
60
+        border: 1px solid #e8e8e8;
61
+    }
62
+    .wallet-container .swiper-slide.cur{
63
+        border: 1px solid #cb5f1f;
64
+    }
65
+    .wallet-container .swiper-slide img{
66
+        display: block;
67
+        width: 100%;
68
+        max-height: auto;
69
+    }
70
+    .wallet-container .swiper-slide .sum{
71
+        position: relative;
72
+        display: block;
73
+        justify-content: center;
74
+        align-items: center;
75
+        width: 100%;
76
+        height: 100%;
77
+        font-size: 14px;
78
+        line-height: 2;
79
+        font-family: Arial;
80
+        font-weight: bold;
81
+        text-align: center;
82
+        padding-top: 0;
83
+    }
84
+    .wallet-container .swiper-slide .sum i{
85
+        display: block;
86
+        width: 100%;
87
+        font-size: 9px;
88
+        height: 15px;
89
+        line-height: 16px;
90
+        color: #FFF;
91
+        background-color: #dd170e;
92
+    }
93
+    .wallet-container .swiper-slide .sum::after{
94
+        content: '';
95
+        position: absolute;
96
+        top: 0;
97
+        left: 0;
98
+        display: none;
99
+        width: 100%;
100
+        height: 10px;
101
+        background-color: #dd170e;
102
+    }
103
+    .swiper-button-prev{
104
+        left: 0;
105
+    }
106
+    .swiper-button-next{
107
+        right: 0;
108
+    }
109
+    .swiper-button-prev,.swiper-button-next{
110
+        top: 17px;
111
+        margin-top: 0;
112
+        width: 15px;
113
+        height: 15px;
114
+        opacity: 0.6;
115
+    }
116
+    .swiper-button-disabled{
117
+        opacity: 0.2;
118
+    }
119
+    .swiper-button-next:after,.swiper-button-prev:after{
120
+        color: #929292;
121
+        font-size: 18px;
122
+    }
123
+    .swiper-button-next:hover:after,.swiper-button-prev:hover:after{
124
+        color: #FF6600;
125
+    }
126
+    .cert-con{
127
+        padding-bottom: 45px;
128
+        margin-top: -5px;
129
+    }
130
+    .cert-title{
131
+        width: 100%;
132
+        text-align: center;
133
+        font-size: 16px;
134
+        color: #6160d7;
135
+        font-weight: bold;
136
+        padding-bottom: 20px;
137
+    }
138
+    .cert-desc{
139
+        font-size: 12px;
140
+        line-height: 2;
141
+        padding-bottom: 10px;
142
+    }
143
+    .cert-desc em{
144
+        color: #519fea;
145
+    }
146
+    .cert-desc span{
147
+        color: #ffc801;
148
+    }
149
+    .cert-desc strong{
150
+        font-size: 14px;
151
+        color: #db0a05;
152
+    }
153
+    .cert-btn{
154
+        position: absolute;
155
+        left: 0;
156
+        bottom: 0;
157
+        display: flex;
158
+        width: 100%;
159
+        justify-content: space-between;
160
+    }
161
+    .cert-btn a{
162
+        width: 50%;
163
+        height: 45px;
164
+        font-size: 14px;
165
+        line-height: 45px;
166
+        text-align: center;
167
+        border-right: 1px solid #e5e5e5;
168
+        border-top: 1px solid #e5e5e5;
169
+    }
170
+    .cert-btn a:last-child{
171
+        border-right: none;
172
+        color: #1987e8;
173
+    }
174
+	</style>
175
+</head>
176
+
177
+<body>
178
+<div class="box">
179
+    <div class="recharge-top">
180
+        <div class="pic">
181
+            <img src="/static/img/img-recharge.png" alt="">
182
+        </div>
183
+        <div class="text">
184
+            <div class="title">${pkgInfo.pkgName}</div>
185
+            <div class="desc"></div>
186
+            <div class="price">¥<strong id="price">${pkgInfo.price}</strong></div>
187
+        </div>
188
+    </div>
189
+</div>
190
+      <c:if test="${showmemspkg==1}">
191
+<div class="box benefit-box">
192
+    <div class="benefit-list swiper">
193
+		<div class="swiper-wrapper">
194
+			<c:forEach var="item" items="${spkgs}" varStatus="loop">
195
+		        <div class="item swiper-slide ${loop.index==0?' cur':''}" data-price="${item.price}" data-speedpackid="${item.id}">
196
+		            <div class="wrap">
197
+		                <i class="icon"><img src="/static/img/icon-diamond${item.id%2+1}.png"></i>
198
+		                <div class="title">${item.name}</div>
199
+		                <div class="desc">${item.desc}</div>
200
+		                <div class="price">¥<strong>${item.price}</strong></div>
201
+		                <div class="valid">有效期:
202
+							<c:choose>
203
+				                <c:when test="${item.expiryDay == 0 }">1天</c:when>
204
+				                <c:when test="${item.expiryDay == 1 }">30天</c:when>
205
+				                <c:when test="${item.expiryDay == 2 }">90天</c:when>
206
+				                <c:when test="${item.expiryDay == 3 }">半年</c:when>
207
+				                <c:when test="${item.expiryDay == 4 }">1年</c:when>
208
+				                <c:when test="${item.expiryDay == 5 }">两年</c:when>
209
+				                <c:when test="${item.expiryDay == 6 }">7天</c:when>
210
+				                <c:when test="${item.expiryDay == 7 }">3年</c:when>
211
+				                <c:when test="${item.expiryDay == 8 }">3天</c:when>
212
+				                <c:when test="${item.expiryDay == 9 }">两天</c:when>
213
+				                <c:when test="${item.expiryDay == 11 }">7个月</c:when>
214
+				                <c:when test="${item.expiryDay == 12 }">14个月</c:when>
215
+				                <c:when test="${item.expiryDay == 18 }">15个月</c:when>
216
+				                <c:when test="${item.expiryDay == 19 }">18个月</c:when>
217
+				                <c:when test="${item.expiryDay == 13 }">两年半</c:when>
218
+				                <c:when test="${item.expiryDay == 14 }">3年8个月</c:when>
219
+				                <c:when test="${item.expiryDay == 15 }">4年 </c:when>
220
+				                <c:when test="${item.expiryDay == 16 }">5年</c:when>
221
+				                <c:when test="${item.expiryDay == 17 }">6年</c:when>
222
+				            </c:choose>
223
+						</div>
224
+		                <div class="select"><i></i></div>
225
+		            </div>
226
+		        </div>
227
+		      </c:forEach>
228
+		  </div>
229
+    </div>
230
+</div>
231
+      </c:if>
232
+<div class="box">
233
+    <div class="form-item">
234
+        <label>充值设备号</label>
235
+        <div class="form-text">${devid}</div>
236
+    </div>
237
+    <div class="form-item">
238
+        <label>套餐有效期</label>
239
+        <div class="form-text">
240
+            <c:choose>
241
+                <c:when test="${pkgInfo.expiryDay == 0 }">1天</c:when>
242
+                <c:when test="${pkgInfo.expiryDay == 1 }">30天</c:when>
243
+                <c:when test="${pkgInfo.expiryDay == 2 }">90天</c:when>
244
+                <c:when test="${pkgInfo.expiryDay == 3 }">半年</c:when>
245
+                <c:when test="${pkgInfo.expiryDay == 4 }">1年</c:when>
246
+                <c:when test="${pkgInfo.expiryDay == 5 }">两年</c:when>
247
+                <c:when test="${pkgInfo.expiryDay == 6 }">7天</c:when>
248
+                <c:when test="${pkgInfo.expiryDay == 7 }">3年</c:when>
249
+                <c:when test="${pkgInfo.expiryDay == 8 }">3天</c:when>
250
+                <c:when test="${pkgInfo.expiryDay == 9 }">两天</c:when>
251
+                <c:when test="${pkgInfo.expiryDay == 11 }">7个月</c:when>
252
+                <c:when test="${pkgInfo.expiryDay == 12 }">14个月</c:when>
253
+                <c:when test="${pkgInfo.expiryDay == 18 }">15个月</c:when>
254
+                <c:when test="${pkgInfo.expiryDay == 19 }">18个月</c:when>
255
+                <c:when test="${pkgInfo.expiryDay == 13 }">两年半</c:when>
256
+                <c:when test="${pkgInfo.expiryDay == 14 }">3年8个月</c:when>
257
+                <c:when test="${pkgInfo.expiryDay == 15 }">4年 </c:when>
258
+                <c:when test="${pkgInfo.expiryDay == 16 }">5年</c:when>
259
+                <c:when test="${pkgInfo.expiryDay == 17 }">6年</c:when>
260
+            </c:choose>
261
+        </div>
262
+    </div>
263
+    <div class="form-item">
264
+        <label>全国通用</label>
265
+        <div class="form-text">移动、联通、电信三网合一自由切换</div>
266
+    </div>
267
+    <div class="form-item">
268
+        <label>套餐价格</label>
269
+        <div class="form-text">¥${pkgInfo.price}</div>
270
+    </div>
271
+    <div class="form-item" onclick="ShowBox('PopCoupons')">
272
+        <label>优惠券</label>
273
+        <div class="form-text" id="coupons">选择优惠券</div>
274
+    </div>
275
+</div>
276
+<div class="box mb70">
277
+	<c:if test="${pkgInfo.paytype == 1}">
278
+	    <c:if test="${noSupportWechatPay == 1}">
279
+	        <div class="form-item">
280
+                <div class="form-text">
281
+                    <img src="/static/img/icon-pay-weixin.png" class="icon">
282
+                    <span>微信支付,请联系客服充值(08:00-23:00)</span>
283
+                </div>
284
+                <div class="select">
285
+    <%--                <input type="radio" name="pay" value="wx" class="redcheck">--%>
286
+                </div>
287
+            </div>
288
+	    </c:if>
289
+	    <c:if test="${empty noSupportWechatPay or noSupportWechatPay != 1}">
290
+	        <div class="form-item">
291
+                <div class="form-text">
292
+                    <img src="/static/img/icon-pay-weixin.png" class="icon">
293
+                    <span>微信支付</span>
294
+                </div>
295
+                <div class="select">
296
+                    <input type="radio" name="pay" value="wx" class="redcheck" checked="checked">
297
+                </div>
298
+            </div>
299
+	    </c:if>
300
+      <c:if test="${showmemspkg==1}">
301
+	    <div class="form-item">
302
+	        <div class="form-text">
303
+	            <img src="/static/img/icon-wallet.png" class="icon">
304
+	            <span>钱包特惠支付(余额:¥${balance})</span>
305
+	        </div>
306
+	        <div class="select">
307
+	            <input type="radio" name="pay" value="balance" class="redcheck">
308
+	        </div>
309
+	    </div>
310
+		<div class="wallet-money show">
311
+            <div class="swiper-container wallet-container">
312
+                <div class="swiper-wrapper">
313
+					<c:forEach var="item" items="${cons}">
314
+						<div class="swiper-slide" data-id="${item.id}" data-jine="${item.jine}">
315
+                            <div class="sum">
316
+                                <i class="bar">赠送${item.zsong}元</i>
317
+                                <span>${item.jine}</span>
318
+                            </div>
319
+	                    </div>
320
+				    </c:forEach>
321
+                </div>
322
+            </div>
323
+            <div class="swiper-button-next"></div>
324
+            <div class="swiper-button-prev"></div>
325
+            <div style=" color: red;font-family: bold;display: none;" id="tips">当前余额不足支付购买,推荐勾选当前储值金额购买!</div>
326
+        </div>
327
+      </c:if>
328
+	    <div class="form-item">
329
+	        <div class="form-text">
330
+	            <img src="/static/img/icon-pay-alipay.png" class="icon">
331
+	            <span>支付宝支付</span>
332
+	        </div>
333
+	        <div class="select">
334
+	            <input type="radio" name="pay" value="alipay" class="redcheck">
335
+	        </div>
336
+	    </div>
337
+
338
+	</c:if>
339
+	<c:if test="${pkgInfo.paytype == 2}">
340
+	    <c:if test="${noSupportWechatPay == 1}">
341
+            <div class="form-item">
342
+                <div class="form-text">
343
+                    <img src="/static/img/icon-pay-weixin.png" class="icon">
344
+                    <span>微信支付,请联系客服充值(08:00-23:00)</span>
345
+                </div>
346
+                <div class="select">
347
+    <%--                <input type="radio" name="pay" value="wx" class="redcheck">--%>
348
+                </div>
349
+            </div>
350
+	    </c:if>
351
+	    <c:if test="${empty noSupportWechatPay or noSupportWechatPay != 1}">
352
+            <div class="form-item">
353
+                <div class="form-text">
354
+                    <img src="/static/img/icon-pay-weixin.png" class="icon">
355
+                    <span>微信支付</span>
356
+                </div>
357
+                <div class="select">
358
+                    <input type="radio" name="pay" value="wx" class="redcheck" checked>
359
+                </div>
360
+            </div>
361
+	    </c:if>
362
+	    <div class="form-item">
363
+	        <div class="form-text">
364
+	            <img src="/static/img/icon-pay-alipay.png" class="icon">
365
+	            <span>支付宝支付</span>
366
+	        </div>
367
+	        <div class="select">
368
+	            <input type="radio" name="pay" value="alipay" class="redcheck">
369
+	        </div>
370
+	    </div>
371
+	</c:if>
372
+	<c:if test="${pkgInfo.paytype == 3}">
373
+      <c:if test="${showmemspkg==1}">
374
+	    <div class="form-item">
375
+	        <div class="form-text">
376
+	            <img src="/static/img/icon-wallet.png" class="icon">
377
+	            <span>钱包特惠支付(余额:¥${balance})</span>
378
+	        </div>
379
+	        <div class="select">
380
+	            <input type="radio" name="pay" value="balance" class="redcheck" checked="checked">
381
+	        </div>
382
+	    </div>
383
+		<div class="wallet-money show">
384
+		    <div class="swiper-container wallet-container">
385
+		        <div class="swiper-wrapper">
386
+					<c:forEach var="item" items="${cons}">
387
+						<div class="swiper-slide" data-id="${item.id}" data-jine="${item.jine}">
388
+                            <div class="sum">
389
+                                <i class="bar">赠送${item.zsong}元</i>
390
+                                <span>${item.jine}</span>
391
+                            </div>
392
+		                </div>
393
+				    </c:forEach>
394
+		        </div>
395
+		    </div>
396
+		    <div class="swiper-button-next"></div>
397
+		    <div class="swiper-button-prev"></div>
398
+		</div>
399
+      </c:if>
400
+	</c:if>
401
+</div>
402
+
403
+<input  type="hidden" id="usertotalbalance"  value="${balance}"/>
404
+
405
+<form class="form_wrap" method="post" accept-charset="utf-8" action="/mifi/tosybpay.do">
406
+<div class="bottom-paybox">
407
+    <div class="price">¥<strong id="total-price">${pkgInfo.price}</strong></div>
408
+    <input  type="hidden" name="pkgid" id="pkgid" value="${pkgInfo.pkgid}"/>
409
+    <input  type="hidden" name="amount" id="trxamt" value="${pkgInfo.price}"/>
410
+    <input  type="hidden" name="devid" id="devid"  value="${devid}"/>
411
+	<input  type="hidden" name="type" id="type"  value="1"/>
412
+	<input type="hidden" name="paytype" id="paytype" value="0" />
413
+
414
+      <c:if test="${showmemspkg==1}">
415
+	<input  type="hidden" name="speedpackid" id="speedpackid"  value="${!empty spkgs?spkgs[0].id:''}"/>
416
+      </c:if>
417
+
418
+	<input  type="hidden" id="pkgprice" name="pkgprice" value=""/>
419
+	<input  type="hidden" id="memberid" name="memberid" value=""/>
420
+	<input  type="hidden" id="opt" name="opt" value="${opt }"/>
421
+
422
+    <input  type="hidden" id="notify" name="notify" value=""/>
423
+    <input  type="hidden" id="outTradeNo" name="outTradeNo" value=""/>
424
+    <input  type="hidden" id="openid" name="openid" value="${openid}"/>
425
+    <div class="pay-btn">
426
+        <input type="button" class="btn" value="支付" />
427
+    </div>
428
+</div>
429
+</form>
430
+<!--弹层-优惠券-->
431
+<div class='menu-mask' id="PopCoupons">
432
+    <div class="popbox animated fadeInUp">
433
+        <h2 class="tcenter">选择优惠券</h2>
434
+        <div class="popbox-con">
435
+            <div class="lite-card-select btn-coupons">
436
+                <div class="list">
437
+                <c:forEach var="item" items="${cons}">
438
+                    <div class="item">
439
+                        <div class="name" data="满${item.coupon}减${item.discount}" data-getprice="${item.coupon}" data-price="${item.discount}">满${item.coupon}减${item.discount}</div>
440
+                        <div class="allow"></div>
441
+                    </div>
442
+				</c:forEach>
443
+                </div>
444
+            </div>
445
+        </div>
446
+        <div class="icon-close" onclick="CloseBox('PopCoupons')"></div>
447
+    </div>
448
+</div>
449
+<div class="mask"></div>
450
+<!--当前卡未实名认证 弹层-->
451
+<div class='menu-mask' id="PopCertification" style="display: none;">
452
+    <div class="popbox animated fadeInUp">
453
+        <div class="popbox-con cert-con">
454
+            <div class="cert-title">当前卡未实名认证</div>
455
+            <div class="cert-desc">
456
+                根据工信部《入网用户真实身份信息登记规定》,您当前使用的流量卡或设备<em>需实名认证才可正常使用。</em><br>
457
+                <span>实名认证开放时间:每日7:30-22:00<br>温馨提醒:实名认证需年满18周岁。请寻求监护人帮助或成年后再来哦!如已实名,可能会存在同步延时,请稍后再查看。</span><br>
458
+                <strong>点击继续购买进入套餐充值页面,返回首页点击更多套餐,即可查看已购套餐。</strong>
459
+            </div>
460
+            <div class="cert-btn">
461
+                <a href="javascript:" onclick="CloseBox('PopCertification');pay()">继续购买</a>
462
+                <a href="/user/checksm.do">立即认证</a>
463
+            </div>
464
+        </div>
465
+    </div>
466
+</div>
467
+<script>
468
+
469
+	var mprice=888;
470
+	var pkgprice=888;
471
+	var ubalance;
472
+
473
+	var thumbSwiper = new Swiper(".benefit-list", {
474
+	    spaceBetween: 10,
475
+	    slidesPerView: "auto",
476
+	    freeMode: true,
477
+	    watchSlidesProgress: true,
478
+	});
479
+	//钱包滑动
480
+    var swiper = new Swiper(".wallet-container", {
481
+       slidesPerGroup: 1,
482
+       slidesPerView: 3,
483
+       spaceBetween: 12,
484
+       navigation: {
485
+           nextEl: ".swiper-button-next",
486
+           prevEl: ".swiper-button-prev",
487
+       },
488
+    });
489
+    //选中
490
+    $(".wallet-container .swiper-slide").click(function() {
491
+       var obj = $(this);
492
+       var isClicked = obj.hasClass("cur") ? true : false;
493
+           $('.wallet-container .swiper-slide').removeClass('cur');
494
+       isClicked ? null : obj.addClass("cur");
495
+	   if(obj.hasClass("cur")) {
496
+			var mid = $(this).data("id");
497
+			var mjine = $(this).data("jine");
498
+			$("#memberid").val(mid);
499
+			mprice=parseFloat(mjine).toFixed(2)||0;
500
+			$("#total-price").html(mprice);
501
+	   } else {
502
+			$("#memberid").val('');
503
+			mprice=0;
504
+			$("#total-price").html(pkgprice);
505
+	   }
506
+
507
+    });
508
+    $(".benefit-list .item").click(function() {
509
+        var obj = $(this);
510
+        var isClicked = obj.hasClass("cur") ? true : false;
511
+        $(".benefit-list .item").removeClass("cur");
512
+        isClicked ? null : obj.addClass("cur");
513
+        calculateTotal(); // 统一调用计算总价函数
514
+		$("#speedpackid").val(obj.hasClass("cur")?obj.data("speedpackid"):'');
515
+    });
516
+
517
+    $(".btn-coupons .item").click(function() {
518
+        var obj = $(this);
519
+        var isClicked = obj.hasClass("active") ? true : false;
520
+        $(".btn-coupons .item").removeClass("active");
521
+        isClicked ? null : obj.addClass("active");
522
+        if (isClicked) {
523
+            $("#coupons").text('选择优惠券');
524
+        } else {
525
+            $("#coupons").text($(this).find(".name").attr("data"));
526
+        }
527
+        var popCouponsElement = document.getElementById('PopCoupons');
528
+        setTimeout(function() {
529
+            if (popCouponsElement) {
530
+              popCouponsElement.style.display = "none";
531
+            }
532
+        }, 500);
533
+        calculateTotal(); // 统一调用计算总价函数
534
+    });
535
+
536
+    $(".redcheck").click(function() {
537
+        var ptype = $(this).val();
538
+		if(ptype == 'wx' || ptype == 'alipay'){
539
+			$("#total-price").html(pkgprice);
540
+			$(".wallet-money").hide();
541
+		} else if(ptype == 'balance') {
542
+			$("#total-price").html(mprice);
543
+			$(".wallet-money").show();
544
+		}
545
+    });
546
+
547
+
548
+    // 统一的总价计算函数
549
+    function calculateTotal() {
550
+        var productPrice = parseFloat($("#price").text()); // 商品价格
551
+        var speedPackagePrice = 0; // 加速套餐价格
552
+        var couponPrice = 0; // 优惠券金额
553
+        var getPrice = 0; // 优惠券使用门槛
554
+
555
+        // 获取选中的加速套餐价格
556
+        if ($(".benefit-list .item.cur").length > 0) {
557
+            speedPackagePrice = parseFloat($(".benefit-list .item.cur").attr("data-price"))||0;
558
+        }
559
+
560
+        // 获取选中的优惠券金额
561
+        if ($("#PopCoupons .item.active").length > 0) {
562
+            getPrice = parseFloat($("#PopCoupons .item.active .name").attr("data-getprice"))||0;
563
+            couponPrice = parseFloat($("#PopCoupons .item.active .name").attr("data-price"))||0;
564
+
565
+            // 检查是否满足优惠券使用条件
566
+            var totalPriceBeforeCoupon = productPrice + speedPackagePrice;
567
+            if (getPrice > totalPriceBeforeCoupon) {
568
+                couponPrice = 0;
569
+            }
570
+        }
571
+
572
+        // 计算总价:商品价格 + 加速套餐价格 - 优惠券金额
573
+        var totalPrice = productPrice + speedPackagePrice - couponPrice;
574
+		pkgprice=totalPrice;
575
+		mprice=totalPrice;
576
+        $("#total-price").html(totalPrice.toFixed(2));
577
+        $("#trxamt").val(totalPrice.toFixed(2));
578
+
579
+		if($(".redcheck:checked").val() == 'balance') {
580
+			var usertotalbalance = parseFloat($("#usertotalbalance").val());
581
+			ubalance=usertotalbalance;
582
+			if(usertotalbalance >= pkgprice) {
583
+				$(".wallet-money").hide();
584
+			} else {
585
+				$(".wallet-money").show();
586
+				$(".wallet-container .swiper-slide").each(function(i) {
587
+					var mjine = $(this).data("jine");
588
+					var fmjine = parseFloat(mjine);
589
+					if(fmjine>=pkgprice) {
590
+						$(this).trigger("click");
591
+						swiper.slideTo(i);
592
+						$("#tips").show();
593
+					}
594
+				});
595
+			}
596
+		}
597
+    }
598
+
599
+    // 页面加载完成后初始化计算一次总价
600
+    $(document).ready(function() {
601
+        calculateTotal();
602
+
603
+//		var isRequesting = false;
604
+		$(".pay-btn").click(function(e){
605
+//			if (isRequesting) return;
606
+//			isRequesting = true;
607
+			$(".mask").show();
608
+
609
+			var param = {};
610
+            param['devid'] = $('#devid').val();
611
+
612
+		    $.post('/device/getDevSMInfo.do',param,function(res){
613
+                $('.mask').hide();
614
+
615
+		        if(typeof(res) === 'string'){
616
+                    res = JSON.parse(res);
617
+                }
618
+		        var isrealname = false;
619
+		        for (var key in res) {
620
+                    if (res[key] === "已实名") {
621
+                        isrealname = true;
622
+                    }
623
+                }
624
+
625
+                if(!isrealname){
626
+                    ShowBox('PopCertification');
627
+                } else {
628
+                    pay();
629
+                }
630
+            });
631
+		});
632
+    });
633
+
634
+    function pay() {
635
+//        if (isRequesting) return;
636
+//		var isRequesting = true;
637
+		$(".mask").show();
638
+
639
+		var input = $('.form_wrap').find('input,select'), param = {};
640
+        input.each(function(i,item){
641
+            item = $(item);
642
+            var vType = item.attr('vtype'), ind = 0;
643
+            param[item.attr('name')] = item.val();
644
+            //alert(item);
645
+        });
646
+
647
+        var paytype = $(".redcheck:checked").val();
648
+        if(paytype == "alipay") {
649
+            if (!navigator.userAgent.match(/MicroMessenger/i)) {
650
+                alert("请使用微信访问!");
651
+                $('.mask').hide();
652
+//                isRequesting = false;
653
+                return;
654
+            }
655
+            param['amount']=pkgprice;
656
+            $.post('/mifi/toalipay.do',param,function(res){
657
+                $('.mask').hide();
658
+                if(typeof(res) === 'string'){
659
+                    res = JSON.parse(res);
660
+                }
661
+
662
+                if(res.status !== "200"){
663
+                    alert(res.msg);
664
+                }else{
665
+ //                   location.href = res.pay_info;
666
+                    _AP.pay(res.pay_info);
667
+                    return false;
668
+                }
669
+//                isRequesting = false;
670
+            });
671
+        } else if(paytype == "wx") {
672
+				if (!navigator.userAgent.match(/MicroMessenger/i)) {
673
+					alert("请使用微信访问!");
674
+					$('.mask').hide();
675
+//					isRequesting = false;
676
+					return;
677
+				}
678
+				param['amount']=pkgprice;
679
+				$("#trxamt").val(pkgprice);
680
+                $("#type").val("1");
681
+			//	$('.form_wrap').submit();
682
+
683
+                param['amount']=pkgprice;
684
+                param['type']="1";
685
+				$.post('/mifi/buyYLPdts.do',param,function(res){
686
+				    $('.mask').hide();
687
+				    if(typeof(res) === 'string'){
688
+				        res = JSON.parse(res);
689
+						if(res.pay_info !== undefined) {
690
+							var payInfo = JSON.parse(res.pay_info);
691
+						}
692
+
693
+						//alert(res.pay_info);
694
+				    }
695
+
696
+				    if(res.status !== "200"){
697
+				        alert(res.msg);
698
+				    }else{
699
+				        var payInfo = JSON.parse(res.pay_info);
700
+						WeixinJSBridge.invoke(
701
+								'getBrandWCPayRequest',{
702
+									"appId" : payInfo.appId, //公众号名称,由商户传入
703
+									"timeStamp": payInfo.timeStamp, //戳,自1970 年以来的秒数
704
+									"nonceStr" : payInfo.nonceStr, //随机串
705
+									"package" : payInfo.package,
706
+									"signType" : payInfo.signType, //微信签名方式:
707
+									"paySign" : payInfo.paySign  //微信签名,
708
+
709
+								},function(res){
710
+									if(res.err_msg == "get_brand_wcpay_request:ok" ) {
711
+										// 此处可以使用此方式判断前端返回,微信团队郑重提示:res.err_msg 将在用户支付成功后返回ok,但并不保证它绝对可靠。
712
+										location.href = "/result.html";
713
+									}
714
+								}
715
+							);
716
+				    }
717
+//					isRequesting = false;
718
+				});
719
+
720
+		} else if(paytype == "balance") {
721
+            if(ubalance>=pkgprice) {
722
+                param['amount']=pkgprice;
723
+                $.post('/mifi/buyBalance.do',param,function(res){
724
+                    $('.mask').hide();
725
+                    if(res == 'OK'){
726
+                        alert("支付成功");
727
+                        location.href = "/device/getDevInfo.do?sn="+$("#devid").val();
728
+                    } else {
729
+                        alert(res);
730
+                        if(res == '用户余额不足!'){
731
+                            location.href = "/mifi/getMember.do";
732
+                        }
733
+                    }
734
+//                    isRequesting = false;
735
+                },'json');
736
+            } else {
737
+                if (!navigator.userAgent.match(/MicroMessenger/i)) {
738
+                    alert("请使用微信访问!");
739
+                    $('.mask').hide();
740
+//                    isRequesting = false;
741
+                    return;
742
+                }
743
+                param['amount']=mprice;
744
+                param['pkgprice']=pkgprice;
745
+                if(isNaN(pkgprice)){
746
+                    location.reload();
747
+                }
748
+                param['type']=2;
749
+                var memberid = $("#memberid").val();
750
+                if(memberid==''||mprice==0){
751
+                    alert("请选择金额!");
752
+                    $('.mask').hide();
753
+//                    isRequesting = false;
754
+                    return;
755
+                } else if(mprice<pkgprice){
756
+                    alert("金额不足,请重新选择金额!");
757
+                    $('.mask').hide();
758
+//                    isRequesting = false;
759
+                    return;
760
+                } else {
761
+                    $.post('/mifi/toalipay.do',param,function(res){
762
+                        $('.mask').hide();
763
+                        if(typeof(res) === 'string'){
764
+                            res = JSON.parse(res);
765
+                        }
766
+
767
+                        if(res.status !== "200"){
768
+                            alert(res.msg);
769
+                        }else{
770
+                        //    location.href = res.pay_info;
771
+                            _AP.pay(res.pay_info);
772
+                            return false;
773
+                        }
774
+//                        isRequesting = false;
775
+                    });
776
+                }
777
+            }
778
+        } else {
779
+            alert("请选择支付方式!");
780
+            $('.mask').hide();
781
+//            isRequesting = false;
782
+            return;
783
+        }
784
+    }
785
+</script>
786
+
787
+</body>
788
+</html>