baibx 8 months ago
parent
commit
929696f5ed

+ 2 - 1
com.sharemao.web.appserver/src/main/java/com/sharemao/app/service/impl/PackageServiceImpl.java

@@ -1699,7 +1699,8 @@ public class PackageServiceImpl extends AppBaseService implements PackageService
1699 1699
         }
1700 1700
 
1701 1701
         // 查询设备是否有有效的套餐
1702
-        String sql = "SELECT COUNT(*) as count FROM usersuit WHERE packid!=1 and devid = '" + devid + "' AND invalid > " + DateTimeUtil.longtime();
1702
+        String tm = DateTimeUtil.longtime();
1703
+        String sql = "SELECT COUNT(*) as count FROM usersuit WHERE packid not IN (1,235,316,569,635,904) and devid = '" + devid + "' AND invalid > " + tm + " and effect < " + tm;
1703 1704
         logger.info(sql);
1704 1705
         List<Map<String, Object>> result = baseDao.getMapList(sql);
1705 1706
 

+ 13 - 14
com.sharemao.web.manager/src/main/java/test/SMD.java

@@ -24,9 +24,9 @@ public class SMD
24 24
 {
25 25
 	public static void main(String[] args) throws Exception 
26 26
 	{
27
-        changesmd();
27
+//        changesmd();
28 28
 //        updrv();
29
-//        show();
29
+        show();
30 30
 
31 31
 
32 32
     }
@@ -121,14 +121,13 @@ public class SMD
121 121
 			public void execute(String line)
122 122
 			{
123 123
 //				String sqli="update devinit set showdialog=1 where devid ='"+line+"';";
124
-//                writer.println(sqli);
125
-//                writer.flush();
124
+//                RCPService.getBaseService().execSql(sqli);
126 125
 
127
-//                String sql="select * from device where sn='"+line+"'";
128
-//                List<Map<String, Object>> devices = DAOHelper.find("fcs", sql);
129
-//                if (devices!=null&&devices.size()>0){
130
-//                    System.out.println(line);
131
-//                }
126
+                String sql="select * from device where sn='"+line+"'";
127
+                List<Map<String, Object>> devices = DAOHelper.find("fcs", sql);
128
+                if (devices!=null&&devices.size()>0){
129
+                    System.out.println(line);
130
+                }
132 131
 
133 132
 //                String[] lines = line.split("\t");
134 133
 //                String iccid = lines[0];
@@ -139,11 +138,11 @@ public class SMD
139 138
 //                String sqli2="update device"+(Long.parseLong(line)%32)+" set devstat=0 where devid='"+line+"';";
140 139
 //                RCPService.getMifiService().execSql(sqli2);
141 140
 
142
-                String sql="select * from device"+(Long.parseLong(line)%32)+" where devid='"+line+"'";
143
-                List<Map<String, Object>> devices =RCPService.getMifiService().getMapList(sql);
144
-                if (devices == null) {
145
-                    System.out.println(line);
146
-                }
141
+//                String sql="select * from device"+(Long.parseLong(line)%32)+" where devid='"+line+"'";
142
+//                List<Map<String, Object>> devices =RCPService.getMifiService().getMapList(sql);
143
+//                if (devices == null) {
144
+//                    System.out.println(line);
145
+//                }
147 146
             }
148 147
 		});
149 148
 	}

+ 6 - 13
com.sharemao.web.xw3/src/main/java/com/sharemao/web/wx/ctrl/PayCtrl.java

@@ -272,9 +272,7 @@ public class PayCtrl
272 272
 			JSONArray dataJson = resJson.getJSONArray("data");
273 273
 			context.getRequest().setAttribute("cons", dataJson);
274 274
 		}
275
-		return new TextView("/pkgorderali.jsp");
276
-//		return new TextView("/pkgordersyb.jsp");
277
-//		return new TextView("/pkgorder.jsp");
275
+		return new TextView("/pkgorder.jsp");
278 276
 	}
279 277
 
280 278
 	/**
@@ -436,9 +434,7 @@ public class PayCtrl
436 434
 		}
437 435
 		context.getRequest().setAttribute("pkgInfo", pkgInfo);
438 436
 		context.getRequest().setAttribute("devid", devid);
439
-		return new TextView("/pkgorderali.jsp");
440
-//		return new TextView("/pkgordersyb.jsp");
441
-//		return new TextView("/pkgorder.jsp");
437
+		return new TextView("/pkgorder.jsp");
442 438
 	}
443 439
 	
444 440
 	/**
@@ -1629,9 +1625,7 @@ public class PayCtrl
1629 1625
 			context.getRequest().setAttribute("balance", "0.00");
1630 1626
 		}
1631 1627
 		para.forEach((k,v)->context.getRequest().setAttribute(k, v));
1632
-		return new TextView("/benefitSubmitAli.jsp");
1633
-//		return new TextView("/benefitSubmitSyb.jsp");
1634
-//		return new TextView("/benefitSubmit.jsp");
1628
+		return new TextView("/benefitSubmit.jsp");
1635 1629
 	}
1636 1630
 
1637 1631
     @Path(value="/submitorder.do")
@@ -2291,8 +2285,7 @@ public class PayCtrl
2291 2285
     //        String transactionId = paramMap.get("transaction_id").toString();
2292 2286
             log.info("处理订单:orderno:"+orderid);
2293 2287
             para.put("orderid", orderid);
2294
-            para.put("transaction_id", "");
2295
-    //        para.put("transaction_id", transactionId);
2288
+            para.put("transaction_id", paramMap.get("chnltrxid")[0]);
2296 2289
             GzhUtil.toM3Sign(para);
2297 2290
             String result = GzhUtil.sendPost(Constants.m3IntAddr+"/payment/gzhRecharge.do", para);
2298 2291
             log.info("下单购买后回调结果:"+result);
@@ -2323,7 +2316,7 @@ public class PayCtrl
2323 2316
             String orderid = paramMap.get("outtrxid")[0];
2324 2317
             log.info("处理订单:orderno:"+orderid);
2325 2318
             para.put("orderid", orderid);
2326
-            para.put("transaction_id", "");
2319
+            para.put("transaction_id", paramMap.get("chnltrxid")[0]);
2327 2320
             GzhUtil.toM3Sign(para);
2328 2321
             String result = GzhUtil.sendPost(Constants.m3IntAddr+"/payment/memRecharge.do", para);
2329 2322
             log.info("下单购买后回调结果:"+result);
@@ -2354,7 +2347,7 @@ public class PayCtrl
2354 2347
             String orderid = paramMap.get("outtrxid")[0];
2355 2348
             log.info("处理加速包购买订单:orderno:"+orderid);
2356 2349
             para.put("orderid", orderid);
2357
-            para.put("transaction_id", "");
2350
+            para.put("transaction_id", paramMap.get("chnltrxid")[0]);
2358 2351
             GzhUtil.toM3Sign(para);
2359 2352
             String result = GzhUtil.sendPost(Constants.m3IntAddr+"/payment/speedPackRecharge.do", para);
2360 2353
             log.info("加速包购买后回调结果:"+result);

File diff suppressed because it is too large
+ 4 - 4
com.sharemao.web.xw3/src/main/java/com/sharemao/web/wx/syb/SybConstants.java


+ 39 - 24
com.sharemao.web.xw3/src/main/webapp/benefitSubmit.jsp

@@ -22,6 +22,7 @@
22 22
     <script language="javascript" type="text/javascript" src="/static/js/animate.min.js"></script>
23 23
     <script language="javascript" type="text/javascript" src="/static/js/main.js"></script>
24 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>
25 26
 </head>
26 27
 
27 28
 <body class="topbg">
@@ -44,13 +45,22 @@
44 45
             <input type="radio" name="pay" value="balance" class="redcheck" id="WalletPay">
45 46
         </div>
46 47
     </div>
48
+    <div class="form-item">
49
+        <div class="form-text">
50
+            <img src="/static/img/icon-pay-alipay.png" class="icon">
51
+            <span>支付宝支付支付</span>
52
+        </div>
53
+        <div class="select">
54
+            <input type="radio" name="pay" value="alipay" class="redcheck" checked="">
55
+        </div>
56
+    </div>
47 57
     <div class="form-item">
48 58
         <div class="form-text">
49 59
             <img src="/static/img/icon-pay-weixin.png" class="icon">
50 60
             <span>微信支付</span>
51 61
         </div>
52 62
         <div class="select">
53
-            <input type="radio" name="pay" value="wx" class="redcheck" id="pay" checked="">
63
+            <input type="radio" name="pay" value="wx" class="redcheck">
54 64
         </div>
55 65
     </div>
56 66
 </div>
@@ -86,12 +96,15 @@
86 96
         <div class="icon-close" onclick="CloseBox('PopCoupons')"></div>
87 97
     </div>
88 98
 </div>
89
-<form class="form_wrap">
99
+<form class="form_wrap" method="post" action="/mifi/tosybpay.do" accept-charset="utf-8">
90 100
 	<input  type="hidden" name="amount" id="trxamt" value="${amount }"/>
91 101
 	<input  type="hidden" name="devid" id="devid"  value="${devid}"/>
92 102
 	<input  type="hidden" name="type" id="type"  value="3"/>
93 103
 	<input 	type="hidden" name="paytype" id="paytype" value="0" />
94 104
 	<input  type="hidden" name="speedpackid" id="speedpackid"  value="${speedpackid }"/>
105
+
106
+	<input  type="hidden" id="notify" name="notify" value=""/>
107
+    <input  type="hidden" id="outTradeNo" name="outTradeNo" value=""/>
95 108
 </form>
96 109
 
97 110
 <div class="mask"></div>
@@ -111,7 +124,7 @@
111 124
         	if (isRequesting) return;
112 125
 			isRequesting = true;
113 126
 			$(".mask").show();
114
-			
127
+
115 128
         	var ubalance=parseFloat($("#ubalance").val());
116 129
         	var pkgprice=parseFloat($("#trxamt").val());
117 130
 			var input = $('.form_wrap').find('input,select'), param = {};
@@ -122,38 +135,40 @@
122 135
 				//alert(item);
123 136
             });
124 137
             var paytype = $(".redcheck:checked").val();
125
-    		if(paytype == "wx") {
126
-				$.post('/mifi/buyYLPdts.do',param,function(res){
138
+    		if(paytype == "alipay") {
139
+				$.post('/mifi/toalipay.do',param,function(res){
127 140
 	                $('.mask').hide();
128 141
 	                if(typeof(res) === 'string'){
129 142
 	                    res = JSON.parse(res);
130 143
 						//alert(res.pay_info);
131 144
 	                }
132
-					
145
+
133 146
 	                if(res.status !== "200"){
134 147
 	                    alert(res.msg);
135 148
 	                }else{
136
-	                    var payInfo = JSON.parse(res.pay_info);
137
-						WeixinJSBridge.invoke(
138
-								'getBrandWCPayRequest',{
139
-									"appId" : payInfo.appId, //公众号名称,由商户传入
140
-									"timeStamp": payInfo.timeStamp, //戳,自1970 年以来的秒数
141
-									"nonceStr" : payInfo.nonceStr, //随机串
142
-									"package" : payInfo.package,
143
-									"signType" : payInfo.signType, //微信签名方式:
144
-									"paySign" : payInfo.paySign  //微信签名,
145
-									
146
-								},function(res){
147
-									if(res.err_msg == "get_brand_wcpay_request:ok" ) {
148
-										// 此处可以使用此方式判断前端返回,微信团队郑重提示:res.err_msg 将在用户支付成功后返回ok,但并不保证它绝对可靠。
149
-										location.href = "/result.html";
150
-									}
151
-								}
152
-							);
149
+                   //     location.href = res.pay_info;
150
+                      _AP.pay(res.pay_info);
151
+                      return false;
153 152
 	                }
154 153
 					isRequesting = false;
155 154
 	            });
156
-    		} else {
155
+    		} else if(paytype == "wx") {
156
+                $.post('/mifi/submitorder.do',param,function(res){
157
+                       $('.mask').hide();
158
+                       if(typeof(res) === 'string'){
159
+                           res = JSON.parse(res);
160
+                       }
161
+
162
+                       if(res.status !== "200"){
163
+                           alert(res.msg);
164
+                       }else{
165
+                           $("#notify").val(res.notify);
166
+                           $("#outTradeNo").val(res.outTradeNo);
167
+                           $('.form_wrap').submit();
168
+                       }
169
+                       isRequesting = false;
170
+                   });
171
+            } else {
157 172
     			if(ubalance>=pkgprice) {
158 173
 					param['amount']=pkgprice;
159 174
 					$.post('/mifi/memPackRechargeToSpeedPack.do',param,function(res){

+ 0 - 175
com.sharemao.web.xw3/src/main/webapp/benefitSubmitAli.jsp

@@ -1,175 +0,0 @@
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?v=1" 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
-</head>
26
-
27
-<body class="topbg">
28
-<div class="box">
29
-    <div class="form-item">
30
-        <label>权益卡价格</label>
31
-        <div class="form-text">¥${amount }</div>
32
-    </div>
33
-<!--     <div class="form-item">
34
-        <label>优惠券选择</label>
35
-        <div class="form-text" onclick="ShowBox('PopCoupons')" id="coupons">暂无可用优惠券</div>
36
-    </div> -->
37
-    <div class="form-item">
38
-        <div class="form-text">
39
-            <img src="/static/img/icon-wallet.png" class="icon">
40
-            <span>钱包特惠支付(余额:¥${balance })</span>
41
-			<input id="ubalance" value="${balance }" type="hidden">
42
-        </div>
43
-        <div class="select">
44
-            <input type="radio" name="pay" value="balance" class="redcheck" id="WalletPay">
45
-        </div>
46
-    </div>
47
-    <div class="form-item">
48
-        <div class="form-text">
49
-            <img src="/static/img/icon-pay-alipay.png" class="icon">
50
-            <span>支付宝支付支付</span>
51
-        </div>
52
-        <div class="select">
53
-            <input type="radio" name="pay" value="alipay" class="redcheck" checked="">
54
-        </div>
55
-    </div>
56
-    <div class="form-item">
57
-        <div class="form-text">
58
-            <img src="/static/img/icon-pay-weixin.png" class="icon">
59
-            <span>微信支付,请联系在线客服充值</span>
60
-        </div>
61
-        <div class="select">
62
-
63
-        </div>
64
-    </div>
65
-</div>
66
-<div class="apply-btn">
67
-    <button class="btn" id="pay-btn">立即支付 ¥${amount }</button>
68
-</div>
69
-<!--弹层-优惠券-->
70
-<div class='menu-mask' id="PopCoupons">
71
-    <div class="popbox animated fadeInUp">
72
-        <h2 class="tcenter">选择优惠券</h2>
73
-        <div class="popbox-con">
74
-            <div class="lite-card-select btn-coupons">
75
-                <div class="list">
76
-                    <div class="item">
77
-                        <div class="name" data="满1500减100" data-getprice="1500" data-price="100">满1500减100</div>
78
-                        <div class="allow"></div>
79
-                    </div>
80
-                    <div class="item">
81
-                        <div class="name" data="满500减50" data-getprice="500" data-price="50">满500减50</div>
82
-                        <div class="allow"></div>
83
-                    </div>
84
-                    <div class="item">
85
-                        <div class="name" data="满200减30" data-getprice="200" data-price="30">满200减30</div>
86
-                        <div class="allow"></div>
87
-                    </div>
88
-                    <div class="item">
89
-                        <div class="name" data="满100减10" data-getprice="100" data-price="10">满100减10</div>
90
-                        <div class="allow"></div>
91
-                    </div>
92
-                </div>
93
-            </div>
94
-        </div>
95
-        <div class="icon-close" onclick="CloseBox('PopCoupons')"></div>
96
-    </div>
97
-</div>
98
-<form class="form_wrap">
99
-	<input  type="hidden" name="amount" id="trxamt" value="${amount }"/>
100
-	<input  type="hidden" name="devid" id="devid"  value="${devid}"/>
101
-	<input  type="hidden" name="type" id="type"  value="3"/>
102
-	<input 	type="hidden" name="paytype" id="paytype" value="0" />
103
-	<input  type="hidden" name="speedpackid" id="speedpackid"  value="${speedpackid }"/>
104
-</form>
105
-
106
-<div class="mask"></div>
107
-<script>
108
-	var thumbSwiper = new Swiper(".benefit-list", {
109
-	    spaceBetween: 10,
110
-	    slidesPerView: "auto",
111
-	    freeMode: true,
112
-	    watchSlidesProgress: true,
113
-	});
114
-    document.addEventListener('DOMContentLoaded', function() {
115
-        const payButton = document.getElementById('pay-btn');
116
-
117
-        // 提交订单按钮事件
118
-        var isRequesting = false;
119
-        payButton.addEventListener('click', function(e) {
120
-        	if (isRequesting) return;
121
-			isRequesting = true;
122
-			$(".mask").show();
123
-			
124
-        	var ubalance=parseFloat($("#ubalance").val());
125
-        	var pkgprice=parseFloat($("#trxamt").val());
126
-			var input = $('.form_wrap').find('input,select'), param = {};
127
-            input.each(function(i,item){
128
-                item = $(item);
129
-                var vType = item.attr('vtype'), ind = 0;
130
-                param[item.attr('name')] = item.val();
131
-				//alert(item);
132
-            });
133
-            var paytype = $(".redcheck:checked").val();
134
-    		if(paytype == "alipay") {
135
-				$.post('/mifi/toalipay.do',param,function(res){
136
-	                $('.mask').hide();
137
-	                if(typeof(res) === 'string'){
138
-	                    res = JSON.parse(res);
139
-						//alert(res.pay_info);
140
-	                }
141
-					
142
-	                if(res.status !== "200"){
143
-	                    alert(res.msg);
144
-	                }else{
145
-                        location.href = res.pay_info;
146
-	                }
147
-					isRequesting = false;
148
-	            });
149
-    		} else {
150
-    			if(ubalance>=pkgprice) {
151
-					param['amount']=pkgprice;
152
-					$.post('/mifi/memPackRechargeToSpeedPack.do',param,function(res){
153
-					    $('.mask').hide();
154
-					    if(res == 'OK'){
155
-							alert("支付成功");
156
-							location.href = "/device/getDevInfo.do?sn="+$("#devid").val();
157
-					    } else {
158
-							alert(res);
159
-							if(res == '用户余额不足!'){
160
-								location.href = "/mifi/getMember.do";
161
-							}
162
-						}
163
-						isRequesting = false;
164
-					},'json');
165
-				} else {
166
-					alert("您的余额不足,请使用微信支付");
167
-					$('.mask').hide();
168
-					isRequesting = false;
169
-				}
170
-    		}
171
-        });
172
-    });
173
-</script>
174
-</body>
175
-</html>

+ 0 - 171
com.sharemao.web.xw3/src/main/webapp/benefitSubmitSyb.jsp

@@ -1,171 +0,0 @@
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?v=1" 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
-</head>
26
-
27
-<body class="topbg">
28
-<div class="box">
29
-    <div class="form-item">
30
-        <label>权益卡价格</label>
31
-        <div class="form-text">¥${amount }</div>
32
-    </div>
33
-<!--     <div class="form-item">
34
-        <label>优惠券选择</label>
35
-        <div class="form-text" onclick="ShowBox('PopCoupons')" id="coupons">暂无可用优惠券</div>
36
-    </div> -->
37
-    <div class="form-item">
38
-        <div class="form-text">
39
-            <img src="/static/img/icon-wallet.png" class="icon">
40
-            <span>钱包特惠支付(余额:¥${balance })</span>
41
-			<input id="ubalance" value="${balance }" type="hidden">
42
-        </div>
43
-        <div class="select">
44
-            <input type="radio" name="pay" value="balance" class="redcheck" id="WalletPay">
45
-        </div>
46
-    </div>
47
-    <div class="form-item">
48
-        <div class="form-text">
49
-            <img src="/static/img/icon-pay-weixin.png" class="icon">
50
-            <span>微信支付</span>
51
-        </div>
52
-        <div class="select">
53
-            <input type="radio" name="pay" value="wx" class="redcheck" id="pay" checked="">
54
-        </div>
55
-    </div>
56
-</div>
57
-<div class="apply-btn">
58
-    <button class="btn" id="pay-btn">立即支付 ¥${amount }</button>
59
-</div>
60
-<!--弹层-优惠券-->
61
-<div class='menu-mask' id="PopCoupons">
62
-    <div class="popbox animated fadeInUp">
63
-        <h2 class="tcenter">选择优惠券</h2>
64
-        <div class="popbox-con">
65
-            <div class="lite-card-select btn-coupons">
66
-                <div class="list">
67
-                    <div class="item">
68
-                        <div class="name" data="满1500减100" data-getprice="1500" data-price="100">满1500减100</div>
69
-                        <div class="allow"></div>
70
-                    </div>
71
-                    <div class="item">
72
-                        <div class="name" data="满500减50" data-getprice="500" data-price="50">满500减50</div>
73
-                        <div class="allow"></div>
74
-                    </div>
75
-                    <div class="item">
76
-                        <div class="name" data="满200减30" data-getprice="200" data-price="30">满200减30</div>
77
-                        <div class="allow"></div>
78
-                    </div>
79
-                    <div class="item">
80
-                        <div class="name" data="满100减10" data-getprice="100" data-price="10">满100减10</div>
81
-                        <div class="allow"></div>
82
-                    </div>
83
-                </div>
84
-            </div>
85
-        </div>
86
-        <div class="icon-close" onclick="CloseBox('PopCoupons')"></div>
87
-    </div>
88
-</div>
89
-<form class="form_wrap" method="post" action="/mifi/tosybpay.do" accept-charset="utf-8">
90
-	<input  type="hidden" name="amount" id="trxamt" value="${amount }"/>
91
-	<input  type="hidden" name="devid" id="devid"  value="${devid}"/>
92
-	<input  type="hidden" name="type" id="type"  value="3"/>
93
-	<input 	type="hidden" name="paytype" id="paytype" value="0" />
94
-	<input  type="hidden" name="speedpackid" id="speedpackid"  value="${speedpackid }"/>
95
-
96
-	<input  type="hidden" id="notify" name="notify" value=""/>
97
-    <input  type="hidden" id="outTradeNo" name="outTradeNo" value=""/>
98
-
99
-</form>
100
-
101
-<div class="mask"></div>
102
-<script>
103
-	var thumbSwiper = new Swiper(".benefit-list", {
104
-	    spaceBetween: 10,
105
-	    slidesPerView: "auto",
106
-	    freeMode: true,
107
-	    watchSlidesProgress: true,
108
-	});
109
-    document.addEventListener('DOMContentLoaded', function() {
110
-        const payButton = document.getElementById('pay-btn');
111
-
112
-        // 提交订单按钮事件
113
-        var isRequesting = false;
114
-        payButton.addEventListener('click', function(e) {
115
-        	if (isRequesting) return;
116
-			isRequesting = true;
117
-			$(".mask").show();
118
-			
119
-        	var ubalance=parseFloat($("#ubalance").val());
120
-        	var pkgprice=parseFloat($("#trxamt").val());
121
-			var input = $('.form_wrap').find('input,select'), param = {};
122
-            input.each(function(i,item){
123
-                item = $(item);
124
-                var vType = item.attr('vtype'), ind = 0;
125
-                param[item.attr('name')] = item.val();
126
-				//alert(item);
127
-            });
128
-            var paytype = $(".redcheck:checked").val();
129
-    		if(paytype == "wx") {
130
-				$.post('/mifi/submitorder.do',param,function(res){
131
-                    $('.mask').hide();
132
-                    if(typeof(res) === 'string'){
133
-                        res = JSON.parse(res);
134
-                    }
135
-
136
-                    if(res.status !== "200"){
137
-                        alert(res.msg);
138
-                    }else{
139
-                        $("#notify").val(res.notify);
140
-                        $("#outTradeNo").val(res.outTradeNo);
141
-                        $('.form_wrap').submit();
142
-                    }
143
-                    isRequesting = false;
144
-                });
145
-    		} else {
146
-    			if(ubalance>=pkgprice) {
147
-					param['amount']=pkgprice;
148
-					$.post('/mifi/memPackRechargeToSpeedPack.do',param,function(res){
149
-					    $('.mask').hide();
150
-					    if(res == 'OK'){
151
-							alert("支付成功");
152
-							location.href = "/device/getDevInfo.do?sn="+$("#devid").val();
153
-					    } else {
154
-							alert(res);
155
-							if(res == '用户余额不足!'){
156
-								location.href = "/mifi/getMember.do";
157
-							}
158
-						}
159
-						isRequesting = false;
160
-					},'json');
161
-				} else {
162
-					alert("您的余额不足,请使用微信支付");
163
-					$('.mask').hide();
164
-					isRequesting = false;
165
-				}
166
-    		}
167
-        });
168
-    });
169
-</script>
170
-</body>
171
-</html>

+ 4 - 1
com.sharemao.web.xw3/src/main/webapp/memberali.jsp

@@ -22,6 +22,7 @@
22 22
     <script language="javascript" type="text/javascript" src="/static/js/animate.min.js"></script>
23 23
     <script language="javascript" type="text/javascript" src="/static/js/main.js"></script>
24 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>
25 26
 </head>
26 27
 
27 28
 <body class="topbg">
@@ -244,7 +245,9 @@
244 245
                 if(res.status !== "200"){
245 246
                     alert(res.msg);
246 247
                 }else{
247
-                   location.href = res.pay_info;
248
+//                   location.href = res.pay_info;
249
+                   _AP.pay(res.pay_info);
250
+                   return false;
248 251
                 }
249 252
 
250 253
                 

File diff suppressed because it is too large
+ 150 - 0
com.sharemao.web.xw3/src/main/webapp/pay.htm


+ 252 - 143
com.sharemao.web.xw3/src/main/webapp/pkgorder.jsp

@@ -22,6 +22,7 @@
22 22
     <script language="javascript" type="text/javascript" src="/static/js/animate.min.js"></script>
23 23
     <script language="javascript" type="text/javascript" src="/static/js/main.js"></script>
24 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>
25 26
 	<style>
26 27
 	.form-wallet{
27 28
         border-bottom: 1px solid #f0f0f0;
@@ -121,6 +122,54 @@
121 122
     }
122 123
     .swiper-button-next:hover:after,.swiper-button-prev:hover:after{
123 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;
124 173
     }
125 174
 	</style>
126 175
 </head>
@@ -173,7 +222,7 @@
173 222
 		                <div class="select"><i></i></div>
174 223
 		            </div>
175 224
 		        </div>
176
-		      </c:forEach> 
225
+		      </c:forEach>
177 226
 		  </div>
178 227
     </div>
179 228
 </div>
@@ -228,7 +277,7 @@
228 277
 	            <span>钱包特惠支付(余额:¥${balance})</span>
229 278
 	        </div>
230 279
 	        <div class="select">
231
-	            <input type="radio" name="pay" value="balance" class="redcheck" id="pay">
280
+	            <input type="radio" name="pay" value="balance" class="redcheck" checked="checked">
232 281
 	        </div>
233 282
 	    </div>
234 283
 		<div class="wallet-money show">
@@ -241,30 +290,49 @@
241 290
                                 <span>${item.jine}</span>
242 291
                             </div>
243 292
 	                    </div>
244
-				    </c:forEach> 
293
+				    </c:forEach>
245 294
                 </div>
246 295
             </div>
247 296
             <div class="swiper-button-next"></div>
248 297
             <div class="swiper-button-prev"></div>
298
+            <div style=" color: red;font-family: bold;display: none;" id="tips">当前余额不足支付购买,推荐勾选当前储值金额购买!</div>
249 299
         </div>
300
+	    <div class="form-item">
301
+	        <div class="form-text">
302
+	            <img src="/static/img/icon-pay-alipay.png" class="icon">
303
+	            <span>支付宝支付</span>
304
+	        </div>
305
+	        <div class="select">
306
+	            <input type="radio" name="pay" value="alipay" class="redcheck">
307
+	        </div>
308
+	    </div>
250 309
 	    <div class="form-item">
251 310
 	        <div class="form-text">
252 311
 	            <img src="/static/img/icon-pay-weixin.png" class="icon">
253 312
 	            <span>微信支付</span>
254 313
 	        </div>
255 314
 	        <div class="select">
256
-	            <input type="radio" name="pay" value="wx" class="redcheck" id="pay">
315
+                <input type="radio" name="pay" value="wx" class="redcheck">
257 316
 	        </div>
258 317
 	    </div>
259 318
 	</c:if>
260 319
 	<c:if test="${pkgInfo.paytype == 2}">
320
+	    <div class="form-item">
321
+	        <div class="form-text">
322
+	            <img src="/static/img/icon-pay-alipay.png" class="icon">
323
+	            <span>支付宝支付</span>
324
+	        </div>
325
+	        <div class="select">
326
+	            <input type="radio" name="pay" value="alipay" class="redcheck" checked>
327
+	        </div>
328
+	    </div>
261 329
 	    <div class="form-item">
262 330
 	        <div class="form-text">
263 331
 	            <img src="/static/img/icon-pay-weixin.png" class="icon">
264 332
 	            <span>微信支付</span>
265 333
 	        </div>
266 334
 	        <div class="select">
267
-	            <input type="radio" name="pay" value="wx" class="redcheck" id="pay">
335
+                <input type="radio" name="pay" value="wx" class="redcheck">
268 336
 	        </div>
269 337
 	    </div>
270 338
 	</c:if>
@@ -275,7 +343,7 @@
275 343
 	            <span>钱包特惠支付(余额:¥${balance})</span>
276 344
 	        </div>
277 345
 	        <div class="select">
278
-	            <input type="radio" name="pay" value="balance" class="redcheck" id="pay">
346
+	            <input type="radio" name="pay" value="balance" class="redcheck" checked="checked">
279 347
 	        </div>
280 348
 	    </div>
281 349
 		<div class="wallet-money show">
@@ -288,7 +356,7 @@
288 356
                                 <span>${item.jine}</span>
289 357
                             </div>
290 358
 		                </div>
291
-				    </c:forEach> 
359
+				    </c:forEach>
292 360
 		        </div>
293 361
 		    </div>
294 362
 		    <div class="swiper-button-next"></div>
@@ -299,7 +367,7 @@
299 367
 
300 368
 <input  type="hidden" id="usertotalbalance"  value="${balance}"/>
301 369
 
302
-<form class="form_wrap" method="post" accept-charset="utf-8">
370
+<form class="form_wrap" method="post" accept-charset="utf-8" action="/mifi/tosybpay.do">
303 371
 <div class="bottom-paybox">
304 372
     <div class="price">¥<strong id="total-price">${pkgInfo.price}</strong></div>
305 373
     <input  type="hidden" name="pkgid" id="pkgid" value="${pkgInfo.pkgid}"/>
@@ -308,10 +376,13 @@
308 376
 	<input  type="hidden" name="type" id="type"  value="1"/>
309 377
 	<input type="hidden" name="paytype" id="paytype" value="0" />
310 378
 	<input  type="hidden" name="speedpackid" id="speedpackid"  value="${!empty spkgs?spkgs[0].id:''}"/>
311
-	
379
+
312 380
 	<input  type="hidden" id="pkgprice" name="pkgprice" value=""/>
313 381
 	<input  type="hidden" id="memberid" name="memberid" value=""/>
314 382
 	<input  type="hidden" id="opt" name="opt" value="${opt }"/>
383
+
384
+    <input  type="hidden" id="notify" name="notify" value=""/>
385
+    <input  type="hidden" id="outTradeNo" name="outTradeNo" value=""/>
315 386
     <div class="pay-btn">
316 387
         <input type="button" class="btn" value="支付" />
317 388
     </div>
@@ -337,12 +408,29 @@
337 408
     </div>
338 409
 </div>
339 410
 <div class="mask"></div>
411
+<!--当前卡未实名认证 弹层-->
412
+<div class='menu-mask' id="PopCertification" style="display: none;">
413
+    <div class="popbox animated fadeInUp">
414
+        <div class="popbox-con cert-con">
415
+            <div class="cert-title">当前卡未实名认证</div>
416
+            <div class="cert-desc">
417
+                根据工信部《入网用户真实身份信息登记规定》,您当前使用的流量卡或设备<em>需实名认证才可正常使用。</em><br>
418
+                <span>实名认证开放时间:每日7:30-22:00<br>温馨提醒:实名认证需年满18周岁。请寻求监护人帮助或成年后再来哦!如已实名,可能会存在同步延时,请稍后再查看。</span><br>
419
+                <strong>点击继续购买进入套餐充值页面,返回首页点击更多套餐,即可查看已购套餐。</strong>
420
+            </div>
421
+            <div class="cert-btn">
422
+                <a href="javascript:" onclick="CloseBox('PopCertification');pay()">继续购买</a>
423
+                <a href="/user/checksm.do">立即认证</a>
424
+            </div>
425
+        </div>
426
+    </div>
427
+</div>
340 428
 <script>
341 429
 
342 430
 	var mprice=888;
343 431
 	var pkgprice=888;
344 432
 	var ubalance;
345
-	
433
+
346 434
 	var thumbSwiper = new Swiper(".benefit-list", {
347 435
 	    spaceBetween: 10,
348 436
 	    slidesPerView: "auto",
@@ -376,7 +464,7 @@
376 464
 			mprice=0;
377 465
 			$("#total-price").html(pkgprice);
378 466
 	   }
379
-	   
467
+
380 468
     });
381 469
     $(".benefit-list .item").click(function() {
382 470
         var obj = $(this);
@@ -386,7 +474,7 @@
386 474
         calculateTotal(); // 统一调用计算总价函数
387 475
 		$("#speedpackid").val(obj.hasClass("cur")?obj.data("speedpackid"):'');
388 476
     });
389
-    
477
+
390 478
     $(".btn-coupons .item").click(function() {
391 479
         var obj = $(this);
392 480
         var isClicked = obj.hasClass("active") ? true : false;
@@ -405,10 +493,10 @@
405 493
         }, 500);
406 494
         calculateTotal(); // 统一调用计算总价函数
407 495
     });
408
-	    
496
+
409 497
     $(".redcheck").click(function() {
410 498
         var ptype = $(this).val();
411
-		if(ptype == 'wx'){
499
+		if(ptype == 'wx' || ptype == 'alipay'){
412 500
 			$("#total-price").html(pkgprice);
413 501
 			$(".wallet-money").hide();
414 502
 		} else if(ptype == 'balance') {
@@ -416,39 +504,39 @@
416 504
 			$(".wallet-money").show();
417 505
 		}
418 506
     });
419
-	
420
-    
507
+
508
+
421 509
     // 统一的总价计算函数
422 510
     function calculateTotal() {
423 511
         var productPrice = parseFloat($("#price").text()); // 商品价格
424 512
         var speedPackagePrice = 0; // 加速套餐价格
425 513
         var couponPrice = 0; // 优惠券金额
426 514
         var getPrice = 0; // 优惠券使用门槛
427
-        
515
+
428 516
         // 获取选中的加速套餐价格
429 517
         if ($(".benefit-list .item.cur").length > 0) {
430 518
             speedPackagePrice = parseFloat($(".benefit-list .item.cur").attr("data-price"))||0;
431 519
         }
432
-        
520
+
433 521
         // 获取选中的优惠券金额
434 522
         if ($("#PopCoupons .item.active").length > 0) {
435 523
             getPrice = parseFloat($("#PopCoupons .item.active .name").attr("data-getprice"))||0;
436 524
             couponPrice = parseFloat($("#PopCoupons .item.active .name").attr("data-price"))||0;
437
-            
525
+
438 526
             // 检查是否满足优惠券使用条件
439 527
             var totalPriceBeforeCoupon = productPrice + speedPackagePrice;
440 528
             if (getPrice > totalPriceBeforeCoupon) {
441 529
                 couponPrice = 0;
442 530
             }
443 531
         }
444
-        
532
+
445 533
         // 计算总价:商品价格 + 加速套餐价格 - 优惠券金额
446 534
         var totalPrice = productPrice + speedPackagePrice - couponPrice;
447 535
 		pkgprice=totalPrice;
448 536
 		mprice=totalPrice;
449 537
         $("#total-price").html(totalPrice.toFixed(2));
450 538
         $("#trxamt").val(totalPrice.toFixed(2));
451
-		
539
+
452 540
 		if($(".redcheck:checked").val() == 'balance') {
453 541
 			var usertotalbalance = parseFloat($("#usertotalbalance").val());
454 542
 			ubalance=usertotalbalance;
@@ -462,31 +550,86 @@
462 550
 					if(fmjine>=pkgprice) {
463 551
 						$(this).trigger("click");
464 552
 						swiper.slideTo(i);
553
+						$("#tips").show();
465 554
 					}
466 555
 				});
467 556
 			}
468 557
 		}
469 558
     }
470
-    
559
+
471 560
     // 页面加载完成后初始化计算一次总价
472 561
     $(document).ready(function() {
473 562
         calculateTotal();
474
-		
563
+
475 564
 		var isRequesting = false;
476 565
 		$(".pay-btn").click(function(e){
477 566
 			if (isRequesting) return;
478 567
 			isRequesting = true;
479 568
 			$(".mask").show();
480
-			
481
-			var input = $('.form_wrap').find('input,select'), param = {};
482
-            input.each(function(i,item){
483
-                item = $(item);
484
-                var vType = item.attr('vtype'), ind = 0;
485
-                param[item.attr('name')] = item.val();
486
-				//alert(item);
569
+
570
+			var param = {};
571
+            param['devid'] = $('#devid').val();
572
+
573
+		    $.post('/device/getDevSMInfo.do',param,function(res){
574
+                $('.mask').hide();
575
+
576
+		        if(typeof(res) === 'string'){
577
+                    res = JSON.parse(res);
578
+                }
579
+		        var isrealname = false;
580
+		        for (var key in res) {
581
+                    if (res[key] === "已实名") {
582
+                        isrealname = true;
583
+                    }
584
+                }
585
+
586
+                if(!isrealname){
587
+                    ShowBox('PopCertification');
588
+                } else {
589
+                    pay(param);
590
+                }
487 591
             });
488
-			var paytype = $(".redcheck:checked").val();
489
-			if(paytype == "wx") {
592
+		});
593
+    });
594
+
595
+    function pay() {
596
+        if (isRequesting) return;
597
+		var isRequesting = true;
598
+		$(".mask").show();
599
+
600
+		var input = $('.form_wrap').find('input,select'), param = {};
601
+        input.each(function(i,item){
602
+            item = $(item);
603
+            var vType = item.attr('vtype'), ind = 0;
604
+            param[item.attr('name')] = item.val();
605
+            //alert(item);
606
+        });
607
+
608
+        var paytype = $(".redcheck:checked").val();
609
+        if(paytype == "alipay") {
610
+            if (!navigator.userAgent.match(/MicroMessenger/i)) {
611
+                alert("请使用微信访问!");
612
+                $('.mask').hide();
613
+                isRequesting = false;
614
+                return;
615
+            }
616
+            param['amount']=pkgprice;
617
+            $.post('/mifi/toalipay.do',param,function(res){
618
+                $('.mask').hide();
619
+                if(typeof(res) === 'string'){
620
+                    res = JSON.parse(res);
621
+                }
622
+
623
+                if(res.status !== "200"){
624
+                    alert(res.msg);
625
+                }else{
626
+ //                   location.href = res.pay_info;
627
+                    _AP.pay(res.pay_info);
628
+                    return false;
629
+                }
630
+                isRequesting = false;
631
+            });
632
+        } else if(paytype == "wx") {
490 633
 				if (!navigator.userAgent.match(/MicroMessenger/i)) {
491 634
 					alert("请使用微信访问!");
492 635
 					$('.mask').hide();
@@ -494,127 +637,93 @@
494 637
 					return;
495 638
 				}
496 639
 				param['amount']=pkgprice;
497
-				$.post('/mifi/buyYLPdts.do',param,function(res){
640
+				$("#trxamt").val(pkgprice);
641
+                $("#type").val("1");
642
+			//	$('.form_wrap').submit();
643
+
644
+                param['amount']=pkgprice;
645
+                param['type']="1";
646
+				$.post('/mifi/submitorder.do',param,function(res){
498 647
 				    $('.mask').hide();
499 648
 				    if(typeof(res) === 'string'){
500 649
 				        res = JSON.parse(res);
501
-						if(res.pay_info !== undefined) {
502
-							var payInfo = JSON.parse(res.pay_info);
503
-						}
504
-						
505
-						//alert(res.pay_info);
506 650
 				    }
507
-					
651
+
508 652
 				    if(res.status !== "200"){
509 653
 				        alert(res.msg);
510 654
 				    }else{
511
-				        var payInfo = JSON.parse(res.pay_info);
512
-						WeixinJSBridge.invoke(
513
-								'getBrandWCPayRequest',{
514
-									"appId" : payInfo.appId, //公众号名称,由商户传入
515
-									"timeStamp": payInfo.timeStamp, //戳,自1970 年以来的秒数
516
-									"nonceStr" : payInfo.nonceStr, //随机串
517
-									"package" : payInfo.package,
518
-									"signType" : payInfo.signType, //微信签名方式:
519
-									"paySign" : payInfo.paySign  //微信签名,
520
-									
521
-								},function(res){
522
-									if(res.err_msg == "get_brand_wcpay_request:ok" ) {
523
-										// 此处可以使用此方式判断前端返回,微信团队郑重提示:res.err_msg 将在用户支付成功后返回ok,但并不保证它绝对可靠。
524
-										location.href = "/result.html";
525
-									}
526
-								}
527
-							);
655
+                        $("#notify").val(res.notify);
656
+                        $("#outTradeNo").val(res.outTradeNo);
657
+				        $('.form_wrap').submit();
528 658
 				    }
529
-					isRequesting = false;			    
659
+					isRequesting = false;
530 660
 				});
531
-			} else if(paytype == "balance") {
532
-				if(ubalance>=pkgprice) {
533
-					param['amount']=pkgprice;
534
-					$.post('/mifi/buyBalance.do',param,function(res){
535
-					    $('.mask').hide();
536
-					    if(res == 'OK'){
537
-							alert("支付成功");
538
-							location.href = "/device/getDevInfo.do?sn="+$("#devid").val();
539
-					    } else {
540
-							alert(res);
541
-							if(res == '用户余额不足!'){
542
-								location.href = "/mifi/getMember.do";
543
-							}
544
-						}
545
-						isRequesting = false;
546
-					},'json');
547
-				} else {
548
-					if (!navigator.userAgent.match(/MicroMessenger/i)) {
549
-						alert("请使用微信访问!");
550
-						$('.mask').hide();
551
-						isRequesting = false;
552
-						return;
553
-					}
554
-					param['amount']=mprice;
555
-					param['pkgprice']=pkgprice;
556
-					if(isNaN(pkgprice)){
557
-						location.reload();
558
-					}
559
-					param['type']=2;
560
-					var memberid = $("#memberid").val();
561
-					if(memberid==''||mprice==0){
562
-						alert("请选择金额!");
563
-						$('.mask').hide();
564
-						isRequesting = false;
565
-						return;
566
-					} else if(mprice<pkgprice){
567
-						alert("金额不足,请重新选择金额!");
568
-						$('.mask').hide();
569
-						isRequesting = false;
570
-						return;
571
-					} else {
572
-						$.post('/mifi/buyYLPdts.do',param,function(res){
573
-						    $('.mask').hide();
574
-						    if(typeof(res) === 'string'){
575
-						        res = JSON.parse(res);
576
-								if(res.pay_info !== undefined) {
577
-									var payInfo = JSON.parse(res.pay_info);
578
-								}
579
-								
580
-								//alert(res.pay_info);
581
-						    }
582
-							
583
-						    if(res.status !== "200"){
584
-						        alert(res.msg);
585
-						    }else{
586
-						        var payInfo = JSON.parse(res.pay_info);
587
-								WeixinJSBridge.invoke(
588
-										'getBrandWCPayRequest',{
589
-											"appId" : payInfo.appId, //公众号名称,由商户传入
590
-											"timeStamp": payInfo.timeStamp, //戳,自1970 年以来的秒数
591
-											"nonceStr" : payInfo.nonceStr, //随机串
592
-											"package" : payInfo.package,
593
-											"signType" : payInfo.signType, //微信签名方式:
594
-											"paySign" : payInfo.paySign  //微信签名,
595
-											
596
-										},function(res){
597
-											if(res.err_msg == "get_brand_wcpay_request:ok" ) {
598
-												// 此处可以使用此方式判断前端返回,微信团队郑重提示:res.err_msg 将在用户支付成功后返回ok,但并不保证它绝对可靠。
599
-												location.href = "/result.html";
600
-											}
601
-										}
602
-									);
603
-						    }
604
-							isRequesting = false;			    
605
-						});
606
-					}
607
-				}
608
-			} else {
609
-                alert("请选择支付方式!");
610
-                $('.mask').hide();
611
-                isRequesting = false;
612
-                return;
613
-            }
614 661
 
615
-			
616
-		});
617
-    });
662
+		} else if(paytype == "balance") {
663
+            if(ubalance>=pkgprice) {
664
+                param['amount']=pkgprice;
665
+                $.post('/mifi/buyBalance.do',param,function(res){
666
+                    $('.mask').hide();
667
+                    if(res == 'OK'){
668
+                        alert("支付成功");
669
+                        location.href = "/device/getDevInfo.do?sn="+$("#devid").val();
670
+                    } else {
671
+                        alert(res);
672
+                        if(res == '用户余额不足!'){
673
+                            location.href = "/mifi/getMember.do";
674
+                        }
675
+                    }
676
+                    isRequesting = false;
677
+                },'json');
678
+            } else {
679
+                if (!navigator.userAgent.match(/MicroMessenger/i)) {
680
+                    alert("请使用微信访问!");
681
+                    $('.mask').hide();
682
+                    isRequesting = false;
683
+                    return;
684
+                }
685
+                param['amount']=mprice;
686
+                param['pkgprice']=pkgprice;
687
+                if(isNaN(pkgprice)){
688
+                    location.reload();
689
+                }
690
+                param['type']=2;
691
+                var memberid = $("#memberid").val();
692
+                if(memberid==''||mprice==0){
693
+                    alert("请选择金额!");
694
+                    $('.mask').hide();
695
+                    isRequesting = false;
696
+                    return;
697
+                } else if(mprice<pkgprice){
698
+                    alert("金额不足,请重新选择金额!");
699
+                    $('.mask').hide();
700
+                    isRequesting = false;
701
+                    return;
702
+                } else {
703
+                    $.post('/mifi/toalipay.do',param,function(res){
704
+                        $('.mask').hide();
705
+                        if(typeof(res) === 'string'){
706
+                            res = JSON.parse(res);
707
+                        }
708
+
709
+                        if(res.status !== "200"){
710
+                            alert(res.msg);
711
+                        }else{
712
+                        //    location.href = res.pay_info;
713
+                            _AP.pay(res.pay_info);
714
+                            return false;
715
+                        }
716
+                        isRequesting = false;
717
+                    });
718
+                }
719
+            }
720
+        } else {
721
+            alert("请选择支付方式!");
722
+            $('.mask').hide();
723
+            isRequesting = false;
724
+            return;
725
+        }
726
+    }
618 727
 </script>
619 728
 
620 729
 </body>

+ 0 - 633
com.sharemao.web.xw3/src/main/webapp/pkgorderali.jsp

@@ -1,633 +0,0 @@
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
-	<style>
26
-	.form-wallet{
27
-        border-bottom: 1px solid #f0f0f0;
28
-    }
29
-    .form-wallet .form-item{
30
-        border-bottom: none;
31
-    }
32
-    .wallet-money{
33
-        display: none;
34
-        width: 100%;
35
-        padding: 2px 25px;
36
-        height:65px;
37
-        position: relative;
38
-    }
39
-    .wallet-money.show{
40
-        display: block;
41
-    }
42
-    .wallet-container{
43
-        display: block;
44
-        width: 100%;
45
-        min-height:45px;
46
-        position: relative;
47
-        list-style: none;
48
-        overflow: hidden;
49
-        z-index: 1;
50
-    }
51
-    .wallet-container .swiper-slide{
52
-        display: block;
53
-        width: 33.33%;
54
-        height: 45px;
55
-        position: relative;
56
-        border-radius: 8px;
57
-        overflow: hidden;
58
-        background-color: #FFFFFF;
59
-        border: 1px solid #e8e8e8;
60
-    }
61
-    .wallet-container .swiper-slide.cur{
62
-        border: 1px solid #cb5f1f;
63
-    }
64
-    .wallet-container .swiper-slide img{
65
-        display: block;
66
-        width: 100%;
67
-        max-height: auto;
68
-    }
69
-    .wallet-container .swiper-slide .sum{
70
-        position: relative;
71
-        display: block;
72
-        justify-content: center;
73
-        align-items: center;
74
-        width: 100%;
75
-        height: 100%;
76
-        font-size: 14px;
77
-        line-height: 2;
78
-        font-family: Arial;
79
-        font-weight: bold;
80
-        text-align: center;
81
-        padding-top: 0;
82
-    }
83
-    .wallet-container .swiper-slide .sum i{
84
-        display: block;
85
-        width: 100%;
86
-        font-size: 9px;
87
-        height: 15px;
88
-        line-height: 16px;
89
-        color: #FFF;
90
-        background-color: #dd170e;
91
-    }
92
-    .wallet-container .swiper-slide .sum::after{
93
-        content: '';
94
-        position: absolute;
95
-        top: 0;
96
-        left: 0;
97
-        display: none;
98
-        width: 100%;
99
-        height: 10px;
100
-        background-color: #dd170e;
101
-    }
102
-    .swiper-button-prev{
103
-        left: 0;
104
-    }
105
-    .swiper-button-next{
106
-        right: 0;
107
-    }
108
-    .swiper-button-prev,.swiper-button-next{
109
-        top: 17px;
110
-        margin-top: 0;
111
-        width: 15px;
112
-        height: 15px;
113
-        opacity: 0.6;
114
-    }
115
-    .swiper-button-disabled{
116
-        opacity: 0.2;
117
-    }
118
-    .swiper-button-next:after,.swiper-button-prev:after{
119
-        color: #929292;
120
-        font-size: 18px;
121
-    }
122
-    .swiper-button-next:hover:after,.swiper-button-prev:hover:after{
123
-        color: #FF6600;
124
-    }
125
-	</style>
126
-</head>
127
-
128
-<body>
129
-<div class="box">
130
-    <div class="recharge-top">
131
-        <div class="pic">
132
-            <img src="/static/img/img-recharge.png" alt="">
133
-        </div>
134
-        <div class="text">
135
-            <div class="title">${pkgInfo.pkgName}</div>
136
-            <div class="desc"></div>
137
-            <div class="price">¥<strong id="price">${pkgInfo.price}</strong></div>
138
-        </div>
139
-    </div>
140
-</div>
141
-<div class="box benefit-box">
142
-    <div class="benefit-list swiper">
143
-		<div class="swiper-wrapper">
144
-			<c:forEach var="item" items="${spkgs}" varStatus="loop">
145
-		        <div class="item swiper-slide ${loop.index==0?' cur':''}" data-price="${item.price}" data-speedpackid="${item.id}">
146
-		            <div class="wrap">
147
-		                <i class="icon"><img src="/static/img/icon-diamond${item.id%2+1}.png"></i>
148
-		                <div class="title">${item.name}</div>
149
-		                <div class="desc">${item.desc}</div>
150
-		                <div class="price">¥<strong>${item.price}</strong></div>
151
-		                <div class="valid">有效期:
152
-							<c:choose>
153
-				                <c:when test="${item.expiryDay == 0 }">1天</c:when>
154
-				                <c:when test="${item.expiryDay == 1 }">30天</c:when>
155
-				                <c:when test="${item.expiryDay == 2 }">90天</c:when>
156
-				                <c:when test="${item.expiryDay == 3 }">半年</c:when>
157
-				                <c:when test="${item.expiryDay == 4 }">1年</c:when>
158
-				                <c:when test="${item.expiryDay == 5 }">两年</c:when>
159
-				                <c:when test="${item.expiryDay == 6 }">7天</c:when>
160
-				                <c:when test="${item.expiryDay == 7 }">3年</c:when>
161
-				                <c:when test="${item.expiryDay == 8 }">3天</c:when>
162
-				                <c:when test="${item.expiryDay == 9 }">两天</c:when>
163
-				                <c:when test="${item.expiryDay == 11 }">7个月</c:when>
164
-				                <c:when test="${item.expiryDay == 12 }">14个月</c:when>
165
-				                <c:when test="${item.expiryDay == 18 }">15个月</c:when>
166
-				                <c:when test="${item.expiryDay == 13 }">两年半</c:when>
167
-				                <c:when test="${item.expiryDay == 14 }">3年8个月</c:when>
168
-				                <c:when test="${item.expiryDay == 15 }">4年 </c:when>
169
-				                <c:when test="${item.expiryDay == 16 }">5年</c:when>
170
-				                <c:when test="${item.expiryDay == 17 }">6年</c:when>
171
-				            </c:choose>
172
-						</div>
173
-		                <div class="select"><i></i></div>
174
-		            </div>
175
-		        </div>
176
-		      </c:forEach>
177
-		  </div>
178
-    </div>
179
-</div>
180
-<div class="box">
181
-    <div class="form-item">
182
-        <label>充值设备号</label>
183
-        <div class="form-text">${devid}</div>
184
-    </div>
185
-    <div class="form-item">
186
-        <label>套餐有效期</label>
187
-        <div class="form-text">
188
-            <c:choose>
189
-                <c:when test="${pkgInfo.expiryDay == 0 }">1天</c:when>
190
-                <c:when test="${pkgInfo.expiryDay == 1 }">30天</c:when>
191
-                <c:when test="${pkgInfo.expiryDay == 2 }">90天</c:when>
192
-                <c:when test="${pkgInfo.expiryDay == 3 }">半年</c:when>
193
-                <c:when test="${pkgInfo.expiryDay == 4 }">1年</c:when>
194
-                <c:when test="${pkgInfo.expiryDay == 5 }">两年</c:when>
195
-                <c:when test="${pkgInfo.expiryDay == 6 }">7天</c:when>
196
-                <c:when test="${pkgInfo.expiryDay == 7 }">3年</c:when>
197
-                <c:when test="${pkgInfo.expiryDay == 8 }">3天</c:when>
198
-                <c:when test="${pkgInfo.expiryDay == 9 }">两天</c:when>
199
-                <c:when test="${pkgInfo.expiryDay == 11 }">7个月</c:when>
200
-                <c:when test="${pkgInfo.expiryDay == 12 }">14个月</c:when>
201
-                <c:when test="${pkgInfo.expiryDay == 18 }">15个月</c:when>
202
-                <c:when test="${pkgInfo.expiryDay == 13 }">两年半</c:when>
203
-                <c:when test="${pkgInfo.expiryDay == 14 }">3年8个月</c:when>
204
-                <c:when test="${pkgInfo.expiryDay == 15 }">4年 </c:when>
205
-                <c:when test="${pkgInfo.expiryDay == 16 }">5年</c:when>
206
-                <c:when test="${pkgInfo.expiryDay == 17 }">6年</c:when>
207
-            </c:choose>
208
-        </div>
209
-    </div>
210
-    <div class="form-item">
211
-        <label>全国通用</label>
212
-        <div class="form-text">移动、联通、电信三网合一自由切换</div>
213
-    </div>
214
-    <div class="form-item">
215
-        <label>套餐价格</label>
216
-        <div class="form-text">¥${pkgInfo.price}</div>
217
-    </div>
218
-    <div class="form-item" onclick="ShowBox('PopCoupons')">
219
-        <label>优惠券</label>
220
-        <div class="form-text" id="coupons">选择优惠券</div>
221
-    </div>
222
-</div>
223
-<div class="box mb70">
224
-	<c:if test="${pkgInfo.paytype == 1}">
225
-	    <div class="form-item">
226
-	        <div class="form-text">
227
-	            <img src="/static/img/icon-wallet.png" class="icon">
228
-	            <span>钱包特惠支付(余额:¥${balance})</span>
229
-	        </div>
230
-	        <div class="select">
231
-	            <input type="radio" name="pay" value="balance" class="redcheck">
232
-	        </div>
233
-	    </div>
234
-		<div class="wallet-money show">
235
-            <div class="swiper-container wallet-container">
236
-                <div class="swiper-wrapper">
237
-					<c:forEach var="item" items="${cons}">
238
-						<div class="swiper-slide" data-id="${item.id}" data-jine="${item.jine}">
239
-                            <div class="sum">
240
-                                <i class="bar">赠送${item.zsong}元</i>
241
-                                <span>${item.jine}</span>
242
-                            </div>
243
-	                    </div>
244
-				    </c:forEach>
245
-                </div>
246
-            </div>
247
-            <div class="swiper-button-next"></div>
248
-            <div class="swiper-button-prev"></div>
249
-        </div>
250
-	    <div class="form-item">
251
-	        <div class="form-text">
252
-	            <img src="/static/img/icon-pay-alipay.png" class="icon">
253
-	            <span>支付宝支付</span>
254
-	        </div>
255
-	        <div class="select">
256
-	            <input type="radio" name="pay" value="alipay" class="redcheck" checked>
257
-	        </div>
258
-	    </div>
259
-	    <div class="form-item">
260
-	        <div class="form-text">
261
-	            <img src="/static/img/icon-pay-weixin.png" class="icon">
262
-	            <span>微信支付,请联系在线客服充值</span>
263
-	        </div>
264
-	        <div class="select">
265
-
266
-	        </div>
267
-	    </div>
268
-	</c:if>
269
-	<c:if test="${pkgInfo.paytype == 2}">
270
-	    <div class="form-item">
271
-	        <div class="form-text">
272
-	            <img src="/static/img/icon-pay-alipay.png" class="icon">
273
-	            <span>支付宝支付</span>
274
-	        </div>
275
-	        <div class="select">
276
-	            <input type="radio" name="pay" value="alipay" class="redcheck" checked>
277
-	        </div>
278
-	    </div>
279
-	    <div class="form-item">
280
-	        <div class="form-text">
281
-	            <img src="/static/img/icon-pay-weixin.png" class="icon">
282
-	            <span>微信支付,请联系在线客服充值</span>
283
-	        </div>
284
-	        <div class="select">
285
-
286
-	        </div>
287
-	    </div>
288
-	</c:if>
289
-	<c:if test="${pkgInfo.paytype == 3}">
290
-	    <div class="form-item">
291
-	        <div class="form-text">
292
-	            <img src="/static/img/icon-wallet.png" class="icon">
293
-	            <span>钱包特惠支付(余额:¥${balance})</span>
294
-	        </div>
295
-	        <div class="select">
296
-	            <input type="radio" name="pay" value="balance" class="redcheck">
297
-	        </div>
298
-	    </div>
299
-		<div class="wallet-money show">
300
-		    <div class="swiper-container wallet-container">
301
-		        <div class="swiper-wrapper">
302
-					<c:forEach var="item" items="${cons}">
303
-						<div class="swiper-slide" data-id="${item.id}" data-jine="${item.jine}">
304
-                            <div class="sum">
305
-                                <i class="bar">赠送${item.zsong}元</i>
306
-                                <span>${item.jine}</span>
307
-                            </div>
308
-		                </div>
309
-				    </c:forEach>
310
-		        </div>
311
-		    </div>
312
-		    <div class="swiper-button-next"></div>
313
-		    <div class="swiper-button-prev"></div>
314
-		</div>
315
-	</c:if>
316
-</div>
317
-
318
-<input  type="hidden" id="usertotalbalance"  value="${balance}"/>
319
-
320
-<form class="form_wrap" method="post" accept-charset="utf-8">
321
-<div class="bottom-paybox">
322
-    <div class="price">¥<strong id="total-price">${pkgInfo.price}</strong></div>
323
-    <input  type="hidden" name="pkgid" id="pkgid" value="${pkgInfo.pkgid}"/>
324
-    <input  type="hidden" name="amount" id="trxamt" value="${pkgInfo.price}"/>
325
-    <input  type="hidden" name="devid" id="devid"  value="${devid}"/>
326
-	<input  type="hidden" name="type" id="type"  value="1"/>
327
-	<input type="hidden" name="paytype" id="paytype" value="0" />
328
-	<input  type="hidden" name="speedpackid" id="speedpackid"  value="${!empty spkgs?spkgs[0].id:''}"/>
329
-
330
-	<input  type="hidden" id="pkgprice" name="pkgprice" value=""/>
331
-	<input  type="hidden" id="memberid" name="memberid" value=""/>
332
-	<input  type="hidden" id="opt" name="opt" value="${opt }"/>
333
-    <div class="pay-btn">
334
-        <input type="button" class="btn" value="支付" />
335
-    </div>
336
-</div>
337
-</form>
338
-<!--弹层-优惠券-->
339
-<div class='menu-mask' id="PopCoupons">
340
-    <div class="popbox animated fadeInUp">
341
-        <h2 class="tcenter">选择优惠券</h2>
342
-        <div class="popbox-con">
343
-            <div class="lite-card-select btn-coupons">
344
-                <div class="list">
345
-                <c:forEach var="item" items="${cons}">
346
-                    <div class="item">
347
-                        <div class="name" data="满${item.coupon}减${item.discount}" data-getprice="${item.coupon}" data-price="${item.discount}">满${item.coupon}减${item.discount}</div>
348
-                        <div class="allow"></div>
349
-                    </div>
350
-				</c:forEach>
351
-                </div>
352
-            </div>
353
-        </div>
354
-        <div class="icon-close" onclick="CloseBox('PopCoupons')"></div>
355
-    </div>
356
-</div>
357
-<div class="mask"></div>
358
-<script>
359
-
360
-	var mprice=888;
361
-	var pkgprice=888;
362
-	var ubalance;
363
-
364
-	var thumbSwiper = new Swiper(".benefit-list", {
365
-	    spaceBetween: 10,
366
-	    slidesPerView: "auto",
367
-	    freeMode: true,
368
-	    watchSlidesProgress: true,
369
-	});
370
-	//钱包滑动
371
-    var swiper = new Swiper(".wallet-container", {
372
-       slidesPerGroup: 1,
373
-       slidesPerView: 3,
374
-       spaceBetween: 12,
375
-       navigation: {
376
-           nextEl: ".swiper-button-next",
377
-           prevEl: ".swiper-button-prev",
378
-       },
379
-    });
380
-    //选中
381
-    $(".wallet-container .swiper-slide").click(function() {
382
-       var obj = $(this);
383
-       var isClicked = obj.hasClass("cur") ? true : false;
384
-           $('.wallet-container .swiper-slide').removeClass('cur');
385
-       isClicked ? null : obj.addClass("cur");
386
-	   if(obj.hasClass("cur")) {
387
-			var mid = $(this).data("id");
388
-			var mjine = $(this).data("jine");
389
-			$("#memberid").val(mid);
390
-			mprice=parseFloat(mjine).toFixed(2)||0;
391
-			$("#total-price").html(mprice);
392
-	   } else {
393
-			$("#memberid").val('');
394
-			mprice=0;
395
-			$("#total-price").html(pkgprice);
396
-	   }
397
-
398
-    });
399
-    $(".benefit-list .item").click(function() {
400
-        var obj = $(this);
401
-        var isClicked = obj.hasClass("cur") ? true : false;
402
-        $(".benefit-list .item").removeClass("cur");
403
-        isClicked ? null : obj.addClass("cur");
404
-        calculateTotal(); // 统一调用计算总价函数
405
-		$("#speedpackid").val(obj.hasClass("cur")?obj.data("speedpackid"):'');
406
-    });
407
-
408
-    $(".btn-coupons .item").click(function() {
409
-        var obj = $(this);
410
-        var isClicked = obj.hasClass("active") ? true : false;
411
-        $(".btn-coupons .item").removeClass("active");
412
-        isClicked ? null : obj.addClass("active");
413
-        if (isClicked) {
414
-            $("#coupons").text('选择优惠券');
415
-        } else {
416
-            $("#coupons").text($(this).find(".name").attr("data"));
417
-        }
418
-        var popCouponsElement = document.getElementById('PopCoupons');
419
-        setTimeout(function() {
420
-            if (popCouponsElement) {
421
-              popCouponsElement.style.display = "none";
422
-            }
423
-        }, 500);
424
-        calculateTotal(); // 统一调用计算总价函数
425
-    });
426
-
427
-    $(".redcheck").click(function() {
428
-        var ptype = $(this).val();
429
-		if(ptype == 'wx'){
430
-			$("#total-price").html(pkgprice);
431
-			$(".wallet-money").hide();
432
-		} else if(ptype == 'balance') {
433
-			$("#total-price").html(mprice);
434
-			$(".wallet-money").show();
435
-		}
436
-    });
437
-
438
-
439
-    // 统一的总价计算函数
440
-    function calculateTotal() {
441
-        var productPrice = parseFloat($("#price").text()); // 商品价格
442
-        var speedPackagePrice = 0; // 加速套餐价格
443
-        var couponPrice = 0; // 优惠券金额
444
-        var getPrice = 0; // 优惠券使用门槛
445
-
446
-        // 获取选中的加速套餐价格
447
-        if ($(".benefit-list .item.cur").length > 0) {
448
-            speedPackagePrice = parseFloat($(".benefit-list .item.cur").attr("data-price"))||0;
449
-        }
450
-
451
-        // 获取选中的优惠券金额
452
-        if ($("#PopCoupons .item.active").length > 0) {
453
-            getPrice = parseFloat($("#PopCoupons .item.active .name").attr("data-getprice"))||0;
454
-            couponPrice = parseFloat($("#PopCoupons .item.active .name").attr("data-price"))||0;
455
-
456
-            // 检查是否满足优惠券使用条件
457
-            var totalPriceBeforeCoupon = productPrice + speedPackagePrice;
458
-            if (getPrice > totalPriceBeforeCoupon) {
459
-                couponPrice = 0;
460
-            }
461
-        }
462
-
463
-        // 计算总价:商品价格 + 加速套餐价格 - 优惠券金额
464
-        var totalPrice = productPrice + speedPackagePrice - couponPrice;
465
-		pkgprice=totalPrice;
466
-		mprice=totalPrice;
467
-        $("#total-price").html(totalPrice.toFixed(2));
468
-        $("#trxamt").val(totalPrice.toFixed(2));
469
-
470
-		if($(".redcheck:checked").val() == 'balance') {
471
-			var usertotalbalance = parseFloat($("#usertotalbalance").val());
472
-			ubalance=usertotalbalance;
473
-			if(usertotalbalance >= pkgprice) {
474
-				$(".wallet-money").hide();
475
-			} else {
476
-				$(".wallet-money").show();
477
-				$(".wallet-container .swiper-slide").each(function(i) {
478
-					var mjine = $(this).data("jine");
479
-					var fmjine = parseFloat(mjine);
480
-					if(fmjine>=pkgprice) {
481
-						$(this).trigger("click");
482
-						swiper.slideTo(i);
483
-					}
484
-				});
485
-			}
486
-		}
487
-    }
488
-
489
-    // 页面加载完成后初始化计算一次总价
490
-    $(document).ready(function() {
491
-        calculateTotal();
492
-
493
-		var isRequesting = false;
494
-		$(".pay-btn").click(function(e){
495
-			if (isRequesting) return;
496
-			isRequesting = true;
497
-			$(".mask").show();
498
-
499
-			var input = $('.form_wrap').find('input,select'), param = {};
500
-            input.each(function(i,item){
501
-                item = $(item);
502
-                var vType = item.attr('vtype'), ind = 0;
503
-                param[item.attr('name')] = item.val();
504
-				//alert(item);
505
-            });
506
-
507
-
508
-		    $.post('/device/getDevSMInfo.do',param,function(res){
509
-                $('.mask').hide();
510
-
511
-		        if(typeof(res) === 'string'){
512
-                    res = JSON.parse(res);
513
-                }
514
-		        var isrealname = false;
515
-		        for (var key in res) {
516
-                    if (res[key] === "已实名") {
517
-                        isrealname = true;
518
-                    }
519
-                }
520
-
521
-                if(!isrealname){
522
-                  if(confirm("您目前还未实名认证,为保障您的权益,实名后才可使用,确认先购买套餐吗?")){
523
-                        pay(param);
524
-                  } else {
525
-                    isRequesting = false;
526
-                    return;
527
-                }
528
-                } else {
529
-                    pay(param);
530
-                }
531
-            });
532
-		});
533
-    });
534
-
535
-    function pay(param) {
536
-        if (isRequesting) return;
537
-		var isRequesting = true;
538
-		$(".mask").show();
539
-
540
-        var paytype = $(".redcheck:checked").val();
541
-        if(paytype == "alipay") {
542
-            if (!navigator.userAgent.match(/MicroMessenger/i)) {
543
-                alert("请使用微信访问!");
544
-                $('.mask').hide();
545
-                isRequesting = false;
546
-                return;
547
-            }
548
-            param['amount']=pkgprice;
549
-            $.post('/mifi/toalipay.do',param,function(res){
550
-                $('.mask').hide();
551
-                if(typeof(res) === 'string'){
552
-                    res = JSON.parse(res);
553
-                }
554
-
555
-                if(res.status !== "200"){
556
-                    alert(res.msg);
557
-                }else{
558
-                    location.href = res.pay_info;
559
-                }
560
-                isRequesting = false;
561
-            });
562
-        } else if(paytype == "balance") {
563
-            if(ubalance>=pkgprice) {
564
-                param['amount']=pkgprice;
565
-                $.post('/mifi/buyBalance.do',param,function(res){
566
-                    $('.mask').hide();
567
-                    if(res == 'OK'){
568
-                        alert("支付成功");
569
-                        location.href = "/device/getDevInfo.do?sn="+$("#devid").val();
570
-                    } else {
571
-                        alert(res);
572
-                        if(res == '用户余额不足!'){
573
-                            location.href = "/mifi/getMember.do";
574
-                        }
575
-                    }
576
-                    isRequesting = false;
577
-                },'json');
578
-            } else {
579
-                if (!navigator.userAgent.match(/MicroMessenger/i)) {
580
-                    alert("请使用微信访问!");
581
-                    $('.mask').hide();
582
-                    isRequesting = false;
583
-                    return;
584
-                }
585
-                param['amount']=mprice;
586
-                param['pkgprice']=pkgprice;
587
-                if(isNaN(pkgprice)){
588
-                    location.reload();
589
-                }
590
-                param['type']=2;
591
-                var memberid = $("#memberid").val();
592
-                if(memberid==''||mprice==0){
593
-                    alert("请选择金额!");
594
-                    $('.mask').hide();
595
-                    isRequesting = false;
596
-                    return;
597
-                } else if(mprice<pkgprice){
598
-                    alert("金额不足,请重新选择金额!");
599
-                    $('.mask').hide();
600
-                    isRequesting = false;
601
-                    return;
602
-                } else {
603
-                    $.post('/mifi/toalipay.do',param,function(res){
604
-                        $('.mask').hide();
605
-                        if(typeof(res) === 'string'){
606
-                            res = JSON.parse(res);
607
-                        }
608
-
609
-                        if(res.status !== "200"){
610
-                            alert(res.msg);
611
-                        }else{
612
-                            location.href = res.pay_info;
613
-                        }
614
-                        isRequesting = false;
615
-                    });
616
-                }
617
-            }
618
-        } else if(paytype == "wx"){
619
-            alert("请联系在线客服充值!");
620
-            $('.mask').hide();
621
-            isRequesting = false;
622
-            return;
623
-        } else {
624
-            alert("请选择支付方式!");
625
-            $('.mask').hide();
626
-            isRequesting = false;
627
-            return;
628
-        }
629
-    }
630
-</script>
631
-
632
-</body>
633
-</html>

+ 0 - 603
com.sharemao.web.xw3/src/main/webapp/pkgordersyb.jsp

@@ -1,603 +0,0 @@
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
-	<style>
26
-	.form-wallet{
27
-        border-bottom: 1px solid #f0f0f0;
28
-    }
29
-    .form-wallet .form-item{
30
-        border-bottom: none;
31
-    }
32
-    .wallet-money{
33
-        display: none;
34
-        width: 100%;
35
-        padding: 2px 25px;
36
-        height:65px;
37
-        position: relative;
38
-    }
39
-    .wallet-money.show{
40
-        display: block;
41
-    }
42
-    .wallet-container{
43
-        display: block;
44
-        width: 100%;
45
-        min-height:45px;
46
-        position: relative;
47
-        list-style: none;
48
-        overflow: hidden;
49
-        z-index: 1;
50
-    }
51
-    .wallet-container .swiper-slide{
52
-        display: block;
53
-        width: 33.33%;
54
-        height: 45px;
55
-        position: relative;
56
-        border-radius: 8px;
57
-        overflow: hidden;
58
-        background-color: #FFFFFF;
59
-        border: 1px solid #e8e8e8;
60
-    }
61
-    .wallet-container .swiper-slide.cur{
62
-        border: 1px solid #cb5f1f;
63
-    }
64
-    .wallet-container .swiper-slide img{
65
-        display: block;
66
-        width: 100%;
67
-        max-height: auto;
68
-    }
69
-    .wallet-container .swiper-slide .sum{
70
-        position: relative;
71
-        display: block;
72
-        justify-content: center;
73
-        align-items: center;
74
-        width: 100%;
75
-        height: 100%;
76
-        font-size: 14px;
77
-        line-height: 2;
78
-        font-family: Arial;
79
-        font-weight: bold;
80
-        text-align: center;
81
-        padding-top: 0;
82
-    }
83
-    .wallet-container .swiper-slide .sum i{
84
-        display: block;
85
-        width: 100%;
86
-        font-size: 9px;
87
-        height: 15px;
88
-        line-height: 16px;
89
-        color: #FFF;
90
-        background-color: #dd170e;
91
-    }
92
-    .wallet-container .swiper-slide .sum::after{
93
-        content: '';
94
-        position: absolute;
95
-        top: 0;
96
-        left: 0;
97
-        display: none;
98
-        width: 100%;
99
-        height: 10px;
100
-        background-color: #dd170e;
101
-    }
102
-    .swiper-button-prev{
103
-        left: 0;
104
-    }
105
-    .swiper-button-next{
106
-        right: 0;
107
-    }
108
-    .swiper-button-prev,.swiper-button-next{
109
-        top: 17px;
110
-        margin-top: 0;
111
-        width: 15px;
112
-        height: 15px;
113
-        opacity: 0.6;
114
-    }
115
-    .swiper-button-disabled{
116
-        opacity: 0.2;
117
-    }
118
-    .swiper-button-next:after,.swiper-button-prev:after{
119
-        color: #929292;
120
-        font-size: 18px;
121
-    }
122
-    .swiper-button-next:hover:after,.swiper-button-prev:hover:after{
123
-        color: #FF6600;
124
-    }
125
-	</style>
126
-</head>
127
-
128
-<body>
129
-<div class="box">
130
-    <div class="recharge-top">
131
-        <div class="pic">
132
-            <img src="/static/img/img-recharge.png" alt="">
133
-        </div>
134
-        <div class="text">
135
-            <div class="title">${pkgInfo.pkgName}</div>
136
-            <div class="desc"></div>
137
-            <div class="price">¥<strong id="price">${pkgInfo.price}</strong></div>
138
-        </div>
139
-    </div>
140
-</div>
141
-<div class="box benefit-box">
142
-    <div class="benefit-list swiper">
143
-		<div class="swiper-wrapper">
144
-			<c:forEach var="item" items="${spkgs}" varStatus="loop">
145
-		        <div class="item swiper-slide ${loop.index==0?' cur':''}" data-price="${item.price}" data-speedpackid="${item.id}">
146
-		            <div class="wrap">
147
-		                <i class="icon"><img src="/static/img/icon-diamond${item.id%2+1}.png"></i>
148
-		                <div class="title">${item.name}</div>
149
-		                <div class="desc">${item.desc}</div>
150
-		                <div class="price">¥<strong>${item.price}</strong></div>
151
-		                <div class="valid">有效期:
152
-							<c:choose>
153
-				                <c:when test="${item.expiryDay == 0 }">1天</c:when>
154
-				                <c:when test="${item.expiryDay == 1 }">30天</c:when>
155
-				                <c:when test="${item.expiryDay == 2 }">90天</c:when>
156
-				                <c:when test="${item.expiryDay == 3 }">半年</c:when>
157
-				                <c:when test="${item.expiryDay == 4 }">1年</c:when>
158
-				                <c:when test="${item.expiryDay == 5 }">两年</c:when>
159
-				                <c:when test="${item.expiryDay == 6 }">7天</c:when>
160
-				                <c:when test="${item.expiryDay == 7 }">3年</c:when>
161
-				                <c:when test="${item.expiryDay == 8 }">3天</c:when>
162
-				                <c:when test="${item.expiryDay == 9 }">两天</c:when>
163
-				                <c:when test="${item.expiryDay == 11 }">7个月</c:when>
164
-				                <c:when test="${item.expiryDay == 12 }">14个月</c:when>
165
-				                <c:when test="${item.expiryDay == 18 }">15个月</c:when>
166
-				                <c:when test="${item.expiryDay == 13 }">两年半</c:when>
167
-				                <c:when test="${item.expiryDay == 14 }">3年8个月</c:when>
168
-				                <c:when test="${item.expiryDay == 15 }">4年 </c:when>
169
-				                <c:when test="${item.expiryDay == 16 }">5年</c:when>
170
-				                <c:when test="${item.expiryDay == 17 }">6年</c:when>
171
-				            </c:choose>
172
-						</div>
173
-		                <div class="select"><i></i></div>
174
-		            </div>
175
-		        </div>
176
-		      </c:forEach> 
177
-		  </div>
178
-    </div>
179
-</div>
180
-<div class="box">
181
-    <div class="form-item">
182
-        <label>充值设备号</label>
183
-        <div class="form-text">${devid}</div>
184
-    </div>
185
-    <div class="form-item">
186
-        <label>套餐有效期</label>
187
-        <div class="form-text">
188
-            <c:choose>
189
-                <c:when test="${pkgInfo.expiryDay == 0 }">1天</c:when>
190
-                <c:when test="${pkgInfo.expiryDay == 1 }">30天</c:when>
191
-                <c:when test="${pkgInfo.expiryDay == 2 }">90天</c:when>
192
-                <c:when test="${pkgInfo.expiryDay == 3 }">半年</c:when>
193
-                <c:when test="${pkgInfo.expiryDay == 4 }">1年</c:when>
194
-                <c:when test="${pkgInfo.expiryDay == 5 }">两年</c:when>
195
-                <c:when test="${pkgInfo.expiryDay == 6 }">7天</c:when>
196
-                <c:when test="${pkgInfo.expiryDay == 7 }">3年</c:when>
197
-                <c:when test="${pkgInfo.expiryDay == 8 }">3天</c:when>
198
-                <c:when test="${pkgInfo.expiryDay == 9 }">两天</c:when>
199
-                <c:when test="${pkgInfo.expiryDay == 11 }">7个月</c:when>
200
-                <c:when test="${pkgInfo.expiryDay == 12 }">14个月</c:when>
201
-                <c:when test="${pkgInfo.expiryDay == 18 }">15个月</c:when>
202
-                <c:when test="${pkgInfo.expiryDay == 13 }">两年半</c:when>
203
-                <c:when test="${pkgInfo.expiryDay == 14 }">3年8个月</c:when>
204
-                <c:when test="${pkgInfo.expiryDay == 15 }">4年 </c:when>
205
-                <c:when test="${pkgInfo.expiryDay == 16 }">5年</c:when>
206
-                <c:when test="${pkgInfo.expiryDay == 17 }">6年</c:when>
207
-            </c:choose>
208
-        </div>
209
-    </div>
210
-    <div class="form-item">
211
-        <label>全国通用</label>
212
-        <div class="form-text">移动、联通、电信三网合一自由切换</div>
213
-    </div>
214
-    <div class="form-item">
215
-        <label>套餐价格</label>
216
-        <div class="form-text">¥${pkgInfo.price}</div>
217
-    </div>
218
-    <div class="form-item" onclick="ShowBox('PopCoupons')">
219
-        <label>优惠券</label>
220
-        <div class="form-text" id="coupons">选择优惠券</div>
221
-    </div>
222
-</div>
223
-<div class="box mb70">
224
-	<c:if test="${pkgInfo.paytype == 1}">
225
-	    <div class="form-item">
226
-	        <div class="form-text">
227
-	            <img src="/static/img/icon-wallet.png" class="icon">
228
-	            <span>钱包特惠支付(余额:¥${balance})</span>
229
-	        </div>
230
-	        <div class="select">
231
-	            <input type="radio" name="pay" value="balance" class="redcheck" id="pay">
232
-	        </div>
233
-	    </div>
234
-		<div class="wallet-money show">
235
-            <div class="swiper-container wallet-container">
236
-                <div class="swiper-wrapper">
237
-					<c:forEach var="item" items="${cons}">
238
-						<div class="swiper-slide" data-id="${item.id}" data-jine="${item.jine}">
239
-	                        <div class="sum">
240
-                                <i class="bar">赠送${item.zsong}元</i>
241
-	                            <span>${item.jine}</span>
242
-	                        </div>
243
-	                    </div>
244
-				    </c:forEach> 
245
-                </div>
246
-            </div>
247
-            <div class="swiper-button-next"></div>
248
-            <div class="swiper-button-prev"></div>
249
-        </div>
250
-	    <div class="form-item">
251
-	        <div class="form-text">
252
-	            <img src="/static/img/icon-pay-weixin.png" class="icon">
253
-	            <span>微信支付</span>
254
-	        </div>
255
-	        <div class="select">
256
-	            <input type="radio" name="pay" value="wx" class="redcheck" id="pay">
257
-	        </div>
258
-	    </div>
259
-	</c:if>
260
-	<c:if test="${pkgInfo.paytype == 2}">
261
-	    <div class="form-item">
262
-	        <div class="form-text">
263
-	            <img src="/static/img/icon-pay-weixin.png" class="icon">
264
-	            <span>微信支付</span>
265
-	        </div>
266
-	        <div class="select">
267
-	            <input type="radio" name="pay" value="wx" class="redcheck" id="pay">
268
-	        </div>
269
-	    </div>
270
-	</c:if>
271
-	<c:if test="${pkgInfo.paytype == 3}">
272
-	    <div class="form-item">
273
-	        <div class="form-text">
274
-	            <img src="/static/img/icon-wallet.png" class="icon">
275
-	            <span>钱包特惠支付(余额:¥${balance})</span>
276
-	        </div>
277
-	        <div class="select">
278
-	            <input type="radio" name="pay" value="balance" class="redcheck" id="pay">
279
-	        </div>
280
-	    </div>
281
-		<div class="wallet-money show">
282
-		    <div class="swiper-container wallet-container">
283
-		        <div class="swiper-wrapper">
284
-					<c:forEach var="item" items="${cons}">
285
-						<div class="swiper-slide" data-id="${item.id}" data-jine="${item.jine}">
286
-                            <div class="sum">
287
-                                <i class="bar">赠送${item.zsong}元</i>
288
-                                <span>${item.jine}</span>
289
-                            </div>
290
-		                </div>
291
-				    </c:forEach> 
292
-		        </div>
293
-		    </div>
294
-		    <div class="swiper-button-next"></div>
295
-		    <div class="swiper-button-prev"></div>
296
-		</div>
297
-	</c:if>
298
-</div>
299
-
300
-<input  type="hidden" id="usertotalbalance"  value="${balance}"/>
301
-
302
-<form class="form_wrap" method="post" accept-charset="utf-8" action="/mifi/tosybpay.do">
303
-<div class="bottom-paybox">
304
-    <div class="price">¥<strong id="total-price">${pkgInfo.price}</strong></div>
305
-    <input  type="hidden" name="pkgid" id="pkgid" value="${pkgInfo.pkgid}"/>
306
-    <input  type="hidden" name="amount" id="trxamt" value="${pkgInfo.price}"/>
307
-    <input  type="hidden" name="devid" id="devid"  value="${devid}"/>
308
-	<input  type="hidden" name="type" id="type"  value="1"/>
309
-	<input type="hidden" name="paytype" id="paytype" value="0" />
310
-	<input  type="hidden" name="speedpackid" id="speedpackid"  value="${!empty spkgs?spkgs[0].id:''}"/>
311
-
312
-	<input  type="hidden" id="pkgprice" name="pkgprice" value=""/>
313
-	<input  type="hidden" id="memberid" name="memberid" value=""/>
314
-	<input  type="hidden" id="opt" name="opt" value="${opt }"/>
315
-
316
-	<input  type="hidden" id="notify" name="notify" value=""/>
317
-	<input  type="hidden" id="outTradeNo" name="outTradeNo" value=""/>
318
-
319
-    <div class="pay-btn">
320
-        <input type="button" class="btn" value="支付" />
321
-    </div>
322
-</div>
323
-</form>
324
-<!--弹层-优惠券-->
325
-<div class='menu-mask' id="PopCoupons">
326
-    <div class="popbox animated fadeInUp">
327
-        <h2 class="tcenter">选择优惠券</h2>
328
-        <div class="popbox-con">
329
-            <div class="lite-card-select btn-coupons">
330
-                <div class="list">
331
-                <c:forEach var="item" items="${cons}">
332
-                    <div class="item">
333
-                        <div class="name" data="满${item.coupon}减${item.discount}" data-getprice="${item.coupon}" data-price="${item.discount}">满${item.coupon}减${item.discount}</div>
334
-                        <div class="allow"></div>
335
-                    </div>
336
-				</c:forEach>
337
-                </div>
338
-            </div>
339
-        </div>
340
-        <div class="icon-close" onclick="CloseBox('PopCoupons')"></div>
341
-    </div>
342
-</div>
343
-<div class="mask"></div>
344
-<script>
345
-
346
-	var mprice=888;
347
-	var pkgprice=888;
348
-	var ubalance;
349
-
350
-	var thumbSwiper = new Swiper(".benefit-list", {
351
-	    spaceBetween: 10,
352
-	    slidesPerView: "auto",
353
-	    freeMode: true,
354
-	    watchSlidesProgress: true,
355
-	});
356
-	//钱包滑动
357
-    var swiper = new Swiper(".wallet-container", {
358
-       slidesPerGroup: 1,
359
-       slidesPerView: 3,
360
-       spaceBetween: 12,
361
-       navigation: {
362
-           nextEl: ".swiper-button-next",
363
-           prevEl: ".swiper-button-prev",
364
-       },
365
-    });
366
-    //选中
367
-    $(".wallet-container .swiper-slide").click(function() {
368
-       var obj = $(this);
369
-       var isClicked = obj.hasClass("cur") ? true : false;
370
-           $('.wallet-container .swiper-slide').removeClass('cur');
371
-       isClicked ? null : obj.addClass("cur");
372
-	   if(obj.hasClass("cur")) {
373
-			var mid = $(this).data("id");
374
-			var mjine = $(this).data("jine");
375
-			$("#memberid").val(mid);
376
-			mprice=parseFloat(mjine).toFixed(2)||0;
377
-			$("#total-price").html(mprice);
378
-	   } else {
379
-			$("#memberid").val('');
380
-			mprice=0;
381
-			$("#total-price").html(pkgprice);
382
-	   }
383
-
384
-    });
385
-    $(".benefit-list .item").click(function() {
386
-        var obj = $(this);
387
-        var isClicked = obj.hasClass("cur") ? true : false;
388
-        $(".benefit-list .item").removeClass("cur");
389
-        isClicked ? null : obj.addClass("cur");
390
-        calculateTotal(); // 统一调用计算总价函数
391
-		$("#speedpackid").val(obj.hasClass("cur")?obj.data("speedpackid"):'');
392
-    });
393
-
394
-    $(".btn-coupons .item").click(function() {
395
-        var obj = $(this);
396
-        var isClicked = obj.hasClass("active") ? true : false;
397
-        $(".btn-coupons .item").removeClass("active");
398
-        isClicked ? null : obj.addClass("active");
399
-        if (isClicked) {
400
-            $("#coupons").text('选择优惠券');
401
-        } else {
402
-            $("#coupons").text($(this).find(".name").attr("data"));
403
-        }
404
-        var popCouponsElement = document.getElementById('PopCoupons');
405
-        setTimeout(function() {
406
-            if (popCouponsElement) {
407
-              popCouponsElement.style.display = "none";
408
-            }
409
-        }, 500);
410
-        calculateTotal(); // 统一调用计算总价函数
411
-    });
412
-
413
-    $(".redcheck").click(function() {
414
-        var ptype = $(this).val();
415
-		if(ptype == 'wx'){
416
-			$("#total-price").html(pkgprice);
417
-			$(".wallet-money").hide();
418
-		} else if(ptype == 'balance') {
419
-			$("#total-price").html(mprice);
420
-			$(".wallet-money").show();
421
-		}
422
-    });
423
-
424
-
425
-    // 统一的总价计算函数
426
-    function calculateTotal() {
427
-        var productPrice = parseFloat($("#price").text()); // 商品价格
428
-        var speedPackagePrice = 0; // 加速套餐价格
429
-        var couponPrice = 0; // 优惠券金额
430
-        var getPrice = 0; // 优惠券使用门槛
431
-
432
-        // 获取选中的加速套餐价格
433
-        if ($(".benefit-list .item.cur").length > 0) {
434
-            speedPackagePrice = parseFloat($(".benefit-list .item.cur").attr("data-price"))||0;
435
-        }
436
-
437
-        // 获取选中的优惠券金额
438
-        if ($("#PopCoupons .item.active").length > 0) {
439
-            getPrice = parseFloat($("#PopCoupons .item.active .name").attr("data-getprice"))||0;
440
-            couponPrice = parseFloat($("#PopCoupons .item.active .name").attr("data-price"))||0;
441
-
442
-            // 检查是否满足优惠券使用条件
443
-            var totalPriceBeforeCoupon = productPrice + speedPackagePrice;
444
-            if (getPrice > totalPriceBeforeCoupon) {
445
-                couponPrice = 0;
446
-            }
447
-        }
448
-
449
-        // 计算总价:商品价格 + 加速套餐价格 - 优惠券金额
450
-        var totalPrice = productPrice + speedPackagePrice - couponPrice;
451
-		pkgprice=totalPrice;
452
-		mprice=totalPrice;
453
-        $("#total-price").html(totalPrice.toFixed(2));
454
-        $("#trxamt").val(totalPrice.toFixed(2));
455
-
456
-		if($(".redcheck:checked").val() == 'balance') {
457
-			var usertotalbalance = parseFloat($("#usertotalbalance").val());
458
-			ubalance=usertotalbalance;
459
-			if(usertotalbalance >= pkgprice) {
460
-				$(".wallet-money").hide();
461
-			} else {
462
-				$(".wallet-money").show();
463
-				$(".wallet-container .swiper-slide").each(function(i) {
464
-					var mjine = $(this).data("jine");
465
-					var fmjine = parseFloat(mjine);
466
-					if(fmjine>=pkgprice) {
467
-						$(this).trigger("click");
468
-						swiper.slideTo(i);
469
-					}
470
-				});
471
-			}
472
-		}
473
-    }
474
-
475
-    // 页面加载完成后初始化计算一次总价
476
-    $(document).ready(function() {
477
-        calculateTotal();
478
-
479
-		var isRequesting = false;
480
-		$(".pay-btn").click(function(e){
481
-			if (isRequesting) return;
482
-			isRequesting = true;
483
-			$(".mask").show();
484
-
485
-			var input = $('.form_wrap').find('input,select'), param = {};
486
-            input.each(function(i,item){
487
-                item = $(item);
488
-                var vType = item.attr('vtype'), ind = 0;
489
-                param[item.attr('name')] = item.val();
490
-				//alert(item);
491
-            });
492
-			var paytype = $(".redcheck:checked").val();
493
-			if(paytype == "wx") {
494
-				if (!navigator.userAgent.match(/MicroMessenger/i)) {
495
-					alert("请使用微信访问!");
496
-					$('.mask').hide();
497
-					isRequesting = false;
498
-					return;
499
-				}
500
-				param['amount']=pkgprice;
501
-				$("#trxamt").val(pkgprice);
502
-                $("#type").val("1");
503
-			//	$('.form_wrap').submit();
504
-
505
-                param['amount']=pkgprice;
506
-                param['type']="1";
507
-				$.post('/mifi/submitorder.do',param,function(res){
508
-				    $('.mask').hide();
509
-				    if(typeof(res) === 'string'){
510
-				        res = JSON.parse(res);
511
-				    }
512
-
513
-				    if(res.status !== "200"){
514
-				        alert(res.msg);
515
-				    }else{
516
-                        $("#notify").val(res.notify);
517
-                        $("#outTradeNo").val(res.outTradeNo);
518
-				        $('.form_wrap').submit();
519
-				    }
520
-					isRequesting = false;
521
-				});
522
-
523
-			} else if(paytype == "balance") {
524
-				if(ubalance>=pkgprice) {
525
-					param['amount']=pkgprice;
526
-					$.post('/mifi/buyBalance.do',param,function(res){
527
-					    $('.mask').hide();
528
-					    if(res == 'OK'){
529
-							alert("支付成功");
530
-							location.href = "/device/getDevInfo.do?sn="+$("#devid").val();
531
-					    } else {
532
-							alert(res);
533
-							if(res == '用户余额不足!'){
534
-								location.href = "/mifi/getMember.do";
535
-							}
536
-						}
537
-						isRequesting = false;
538
-					},'json');
539
-				} else {
540
-					if (!navigator.userAgent.match(/MicroMessenger/i)) {
541
-						alert("请使用微信访问!");
542
-						$('.mask').hide();
543
-						isRequesting = false;
544
-						return;
545
-					}
546
-					param['amount']=mprice;
547
-					param['pkgprice']=pkgprice;
548
-					if(isNaN(pkgprice)){
549
-						location.reload();
550
-					}
551
-					param['type']=2;
552
-					var memberid = $("#memberid").val();
553
-					if(memberid==''||mprice==0){
554
-						alert("请选择金额!");
555
-						$('.mask').hide();
556
-						isRequesting = false;
557
-						return;
558
-					} else if(mprice<pkgprice){
559
-						alert("金额不足,请重新选择金额!");
560
-						$('.mask').hide();
561
-						isRequesting = false;
562
-						return;
563
-					} else {
564
-                        $("#type").val("2");
565
-                        $("#trxamt").val(mprice);
566
-                        $("#pkgprice").val(pkgprice);
567
-
568
-
569
-                        $.post('/mifi/submitorder.do',param,function(res){
570
-                            $('.mask').hide();
571
-                            if(typeof(res) === 'string'){
572
-                                res = JSON.parse(res);
573
-                                if(res.pay_info !== undefined) {
574
-                                    var payInfo = JSON.parse(res.pay_info);
575
-                                }
576
-
577
-                                //alert(res.pay_info);
578
-                            }
579
-
580
-                            if(res.status !== "200"){
581
-                                alert(res.msg);
582
-                            }else{
583
-                                $("#notify").val(res.notify);
584
-                                $("#outTradeNo").val(res.outTradeNo);
585
-                                $('.form_wrap').submit();
586
-                            }
587
-                            isRequesting = false;
588
-                        });
589
-
590
-					}
591
-				}
592
-			} else {
593
-                alert("请选择支付方式!");
594
-                $('.mask').hide();
595
-                isRequesting = false;
596
-                return;
597
-            }
598
-		});
599
-    });
600
-</script>
601
-
602
-</body>
603
-</html>

File diff suppressed because it is too large
+ 1 - 0
com.sharemao.web.xw3/src/main/webapp/static/js/ap.js


+ 26 - 2
com.shuhaiwifi.task/src/main/java/com/shuhaiwifi/task/HN.java

@@ -8,6 +8,7 @@ import java.util.Map;
8 8
 import javax.crypto.spec.IvParameterSpec;
9 9
 import javax.crypto.spec.SecretKeySpec;
10 10
 
11
+import com.nianzai.util.DateTimeUtil;
11 12
 import org.apache.commons.logging.Log;
12 13
 import org.apache.commons.logging.LogFactory;
13 14
 
@@ -58,7 +59,7 @@ public class HN
58 59
 				i++;
59 60
 				String smdsql = "SELECT sn FROM smd where iccid='"+iccid+"'";
60 61
 				List<Map<String,Object>> smdlist=RCPService.getBaseService().getMapList(smdsql);
61
-				if (smdlist!=null&smdlist.size()>0) {
62
+				if (smdlist!=null&&smdlist.size()>0) {
62 63
 					Long sn=Long.parseLong(String.valueOf(smdlist.get(0).get("sn")));
63 64
 					String updevicesql="update device"+(sn%32)+" set devstat=1,devgrpid=3 where devid='"+sn+"'";
64 65
 					logger.info(updevicesql);
@@ -80,7 +81,30 @@ public class HN
80 81
 //				c=Utils.getContentByPost(url,para, tenantId, getAuthorization());
81 82
 //				logger.info(url+"===>"+para);
82 83
 //				logger.info(c);
83
-			}
84
+			} else {
85
+                String smdsql = "SELECT sn FROM smd where iccid='"+iccid+"'";
86
+                List<Map<String,Object>> smdlist=RCPService.getBaseService().getMapList(smdsql);
87
+                if (smdlist!=null&&!smdlist.isEmpty()) {
88
+                    String snstr = String.valueOf(smdlist.get(0).get("sn"));
89
+                    Long sn=Long.parseLong(snstr);
90
+                    String devsql = "SELECT * from device"+(sn%32)+" where devid="+snstr;
91
+                    List<Map<String, Object>> devList = RCPService.getMifiService().getMapList(devsql);
92
+                    if (devList!=null&&!devList.isEmpty()) {
93
+                        Map<String, Object> m = devList.get(0);
94
+                        String devstat = String.valueOf(m.get("devstat"));
95
+                        String devgrpid = String.valueOf(m.get("devgrpid"));
96
+                        if (!"4".equals(devstat)&&"1".equals(devgrpid)) {
97
+                            logger.info(devsql+"============"+devstat);
98
+                            String updevicesql = "update device" + (sn % 32) + " set devstat=4 where devid='" + sn + "' and devgrpid=1";
99
+                            logger.info(updevicesql);
100
+                            RCPService.getMifiService().execSql(updevicesql);
101
+                            String insdevcr = "INSERT INTO `devcrond` (`devid`, `operate`, `assist`, `state`, `crttm`) VALUES ('" + sn + "', 1, '', 0, '" + DateTimeUtil.longtime() + "');";
102
+                            logger.info(insdevcr);
103
+                            RCPService.getBaseService().execSql(insdevcr);
104
+                        }
105
+                    }
106
+                }
107
+            }
84 108
 		}
85 109
 		logger.info(i);
86 110
 	}