Commit d68fc74830826be4027e529853e6fb7927e50c69
1 parent
13c28b0d
多笔缴纳费用
Showing
16 changed files
with
2156 additions
and
377 deletions
css/list.css
0 → 100644
1 | +.all_told, .platen_number { | ||
2 | + text-align: center; | ||
3 | +} | ||
4 | +.all_told { | ||
5 | + padding: 30px 0 10px 0; | ||
6 | +} | ||
7 | +.all_told span { | ||
8 | + margin-right: 5px; | ||
9 | + font-size: 22px; | ||
10 | +} | ||
11 | +.discount_money { | ||
12 | + color: #fc3817; | ||
13 | +} | ||
14 | +.discount { | ||
15 | + padding: 4px 7px; | ||
16 | + background: #fc3817; | ||
17 | + border-radius: 2px; | ||
18 | + position: relative; | ||
19 | + margin-left: 10px; | ||
20 | + color: #fff; | ||
21 | +} | ||
22 | +.discount:before { | ||
23 | + position: absolute; | ||
24 | + content: ''; | ||
25 | + width: 0; | ||
26 | + height: 0; | ||
27 | + left: -6px; | ||
28 | + top: 8px; | ||
29 | + border-top: 6px solid transparent; | ||
30 | + border-bottom: 6px solid transparent; | ||
31 | + border-right: 6px solid #fc3817; | ||
32 | +} | ||
33 | +.youhuid{ | ||
34 | + background: #f00; | ||
35 | + color: #fff; | ||
36 | + font-size: 13px; | ||
37 | + padding:2px 5px; | ||
38 | + border-radius: 3px; | ||
39 | + margin-left: 2px; | ||
40 | + display: none; | ||
41 | +} | ||
42 | +.showTooltips{ | ||
43 | + display: none; | ||
44 | + /*针对苹果新增手势*/ | ||
45 | + cursor: pointer; | ||
46 | +} | ||
47 | +.weui-cells{ | ||
48 | + /*针对苹果新增手势*/ | ||
49 | + cursor: pointer; | ||
50 | +} | ||
51 | +.dialog-out{ | ||
52 | + position: absolute; | ||
53 | + width: 100%; | ||
54 | + height: 100%; | ||
55 | + top:0; | ||
56 | + right: 0; | ||
57 | + left: 0; | ||
58 | + bottom: 0; | ||
59 | + z-index: 1000; | ||
60 | + background: rgba(0,0,0,.3); | ||
61 | + display: none; | ||
62 | +} | ||
63 | +.dia-con{ | ||
64 | + width: 305px; | ||
65 | + height: 138px; | ||
66 | + padding: 10px ; | ||
67 | + background:rgba(255,255,255,1); | ||
68 | + border-radius:8px; | ||
69 | + position: absolute; | ||
70 | + left: 50%; | ||
71 | + top:50%; | ||
72 | + transform: translate(-50%,-50%); | ||
73 | +} | ||
74 | +.close-btn{ | ||
75 | + float: right; | ||
76 | + width: 16px; | ||
77 | + height: 16px; | ||
78 | + background: url("../img/close.png") no-repeat; | ||
79 | + background-size: 100% 100%; | ||
80 | + cursor: pointer; | ||
81 | + overflow: hidden; | ||
82 | +} | ||
83 | +.dia-main{ | ||
84 | + margin-left: 30px; | ||
85 | + margin-top: 30px; | ||
86 | + height: 52px; | ||
87 | + padding-left: 90px; | ||
88 | + background: url("../img/out.png") no-repeat; | ||
89 | + background-size: 52px 52px; | ||
90 | +} | ||
91 | +.dia-text{ | ||
92 | + padding-top: 20px; | ||
93 | + text-align: center; | ||
94 | + font-size: 12px; | ||
95 | + color: #999; | ||
96 | +} | ||
97 | +.arrears-btn{ | ||
98 | + width: 70px; | ||
99 | + height: 25px; | ||
100 | + margin-top: 20px; | ||
101 | + color: #FFF; | ||
102 | + font-size: 12px; | ||
103 | + text-align: center; | ||
104 | + line-height: 25px; | ||
105 | + background: url("../img/arrears-bg.png") no-repeat; | ||
106 | + background-size:70px 25px ; | ||
107 | +} | ||
108 | + | ||
109 | +.strTip{ | ||
110 | + width: 100%; | ||
111 | + height: 100%; | ||
112 | + text-align: center; | ||
113 | + font-size: 20px; | ||
114 | + background: rgba(9,9,9,.5); | ||
115 | + position: fixed; | ||
116 | + top:0; | ||
117 | + left: 0; | ||
118 | +} | ||
119 | +.strWrap{ | ||
120 | + margin: 20px auto 0; | ||
121 | + width: 330px; | ||
122 | + height: 431px; | ||
123 | + background: #FFFFFF; | ||
124 | + border-radius: 8px; | ||
125 | + overflow: hidden; | ||
126 | +} | ||
127 | +.strCon{ | ||
128 | + text-align: center; | ||
129 | + font-size: 20px; | ||
130 | + color: #333; | ||
131 | + text-align: center; | ||
132 | +} | ||
133 | +.header-title{ | ||
134 | + padding: 15px 0; | ||
135 | + font-size: 14px; | ||
136 | + font-weight: 600; | ||
137 | + border-bottom:1px solid #ccc ; | ||
138 | + color: #333; | ||
139 | +} | ||
140 | +.payCarNum{ | ||
141 | + font-size: 16px; | ||
142 | + color: #D40202; | ||
143 | +} | ||
144 | +.btn{ | ||
145 | + color: #fff; | ||
146 | + font-size: 20px; | ||
147 | + | ||
148 | + height: 40px; | ||
149 | + line-height: 40px; | ||
150 | + border-radius: 8px; | ||
151 | + cursor: pointer; | ||
152 | +} | ||
153 | +.hiddenBtn{ | ||
154 | + background: #79cbbf; | ||
155 | +} | ||
156 | +/*.outBtn{*/ | ||
157 | +/*background: #509f93;*/ | ||
158 | +/*}*/ | ||
159 | +.tipTitle{ | ||
160 | + /*background: url("img/tipTitle.png") no-repeat 0 center;*/ | ||
161 | + margin-top: 20px; | ||
162 | + font-size: 14px; | ||
163 | + text-align: center; | ||
164 | + font-weight: 500; | ||
165 | + color: #333333; | ||
166 | + line-height: 20px; | ||
167 | +} | ||
168 | +.carNum{ | ||
169 | + width: 270px; | ||
170 | + height: 80px; | ||
171 | + margin: 20px auto; | ||
172 | + font-size: 24px; | ||
173 | + font-family: PingFang-SC-Medium, PingFang-SC; | ||
174 | + font-weight: 500; | ||
175 | + color: #FFFFFF; | ||
176 | + text-align: center; | ||
177 | + line-height: 80px; | ||
178 | + background: url("../img/carNum.png") no-repeat; | ||
179 | +} | ||
180 | +.carNumYellow{ | ||
181 | + background: url("../img/carNumYellow.png") no-repeat; | ||
182 | +} | ||
183 | + | ||
184 | +.toPay{ | ||
185 | + width: 270px; | ||
186 | + height: 45px; | ||
187 | + line-height: 45px; | ||
188 | + text-align: center; | ||
189 | + margin: 0 auto; | ||
190 | + font-size: 16px; | ||
191 | + font-family: PingFang-SC-Medium, PingFang-SC; | ||
192 | + font-weight: 500; | ||
193 | + color: #333333; | ||
194 | + background: url("../img/topay.png") no-repeat; | ||
195 | + cursor: pointer; | ||
196 | +} | ||
197 | +.toSelect{ | ||
198 | + width: 270px; | ||
199 | + margin: 20px auto 0; | ||
200 | + text-align: right; | ||
201 | + font-size: 12px; | ||
202 | + font-family: PingFang-SC-Medium, PingFang-SC; | ||
203 | + font-weight: 500; | ||
204 | + color: #333333; | ||
205 | + cursor: pointer; | ||
206 | +} | ||
207 | +.swiper-container { | ||
208 | + width: 100%; | ||
209 | + height: 165px; | ||
210 | + | ||
211 | +} |
css/monPay.css
0 → 100644
1 | +html,body { | ||
2 | + margin: 0; | ||
3 | + padding: 0; | ||
4 | + background:#f0f4f5; | ||
5 | + font-size:62.5%; /*1rem=10px*/ | ||
6 | + font-family:'Microsoft YaHei'; | ||
7 | +} | ||
8 | +body { | ||
9 | + color:#2a2a2c; | ||
10 | +} | ||
11 | +#header ,#section,#footer{ | ||
12 | + | ||
13 | +} | ||
14 | +#header { | ||
15 | + width:100%; | ||
16 | +} | ||
17 | +.panelBgColor { | ||
18 | + background:#ffffff; | ||
19 | +} | ||
20 | +.headerBox { | ||
21 | + background:#75cbbe;width:100%; | ||
22 | + padding:5px 0px 5px 0px; | ||
23 | + border-radius:8px; | ||
24 | + margin: 10px; | ||
25 | + text-align: center; | ||
26 | +} | ||
27 | +.flexBox { | ||
28 | + display: flex; | ||
29 | + justify-content: center; | ||
30 | + flex-direction:column; | ||
31 | + align-items:center; | ||
32 | + width:100%; | ||
33 | +} | ||
34 | +.flexBoxRow { | ||
35 | + display: flex; | ||
36 | + display: -webkit-flex; | ||
37 | + justify-content: left; | ||
38 | + flex-direction:row; | ||
39 | + align-items:center; | ||
40 | + width:100%; | ||
41 | +} | ||
42 | +.flexBoxRow_column { | ||
43 | + display: flex; | ||
44 | + display: -webkit-flex; | ||
45 | + justify-content: left; | ||
46 | + flex-direction:column; | ||
47 | + align-items:center; | ||
48 | + width:100%; | ||
49 | +} | ||
50 | +.carNumBox { | ||
51 | + font-size:1.4rem; | ||
52 | + font-weight:bold; | ||
53 | +} | ||
54 | +.moneyBox { | ||
55 | + color:#ff6f16; | ||
56 | + font-size:3rem; | ||
57 | +} | ||
58 | +.colorGray { | ||
59 | + color:#8a8a8a; | ||
60 | +} | ||
61 | +.payWayTitle { | ||
62 | + font-size:16px; | ||
63 | +} | ||
64 | +.orderTime { | ||
65 | + right:1rem;position:absolute; | ||
66 | +} | ||
67 | + | ||
68 | + | ||
69 | +.payIcon { | ||
70 | + width:32px;height:32px; | ||
71 | +} | ||
72 | + | ||
73 | +.row { | ||
74 | + /*background:#ffffff;*/ | ||
75 | + padding:10px; | ||
76 | + position:relative; | ||
77 | +} | ||
78 | +.marginTop { | ||
79 | + margin-top:1rem; | ||
80 | +} | ||
81 | +.splitLine { | ||
82 | + width:100%; | ||
83 | + border: 0; | ||
84 | + height: 1px; | ||
85 | + border-top: 1px solid #f0f4f5; | ||
86 | +} | ||
87 | + | ||
88 | +.marginLeft { | ||
89 | + margin-left:1rem; | ||
90 | + font-size:14px; | ||
91 | +} | ||
92 | + | ||
93 | +.btnOK { | ||
94 | + background:#75cbbe; | ||
95 | + width: 15rem; | ||
96 | + height: 40px; | ||
97 | + line-height: 40px; | ||
98 | + text-align: center; | ||
99 | + border-radius: 5px; | ||
100 | + color: #ffffff; | ||
101 | + font-size: 20px; | ||
102 | + cursor: pointer; | ||
103 | +} | ||
104 | +#footer { | ||
105 | + justify-content:center !important; | ||
106 | +} | ||
107 | + | ||
108 | +/*收费明细*/ | ||
109 | +#payDetail { | ||
110 | + padding:5px 10px 5px 10px;font-size: 1.4rem; | ||
111 | + /*height:55px;*/ | ||
112 | + transition:height .5s; | ||
113 | + -moz-transition:height .5s; /* Firefox 4 */ | ||
114 | + -webkit-transition:height .5s; /* Safari and Chrome */ | ||
115 | + -o-transition:height .5s; /* Opera */ | ||
116 | + overflow-y:auto; | ||
117 | +} | ||
118 | +#payDetail > div { | ||
119 | + padding: 5px 0px 2px 0px; | ||
120 | +} | ||
121 | +#payDetail >div > span:last-child { | ||
122 | + margin-left:5px; | ||
123 | +} | ||
124 | + | ||
125 | +/*折扣描述*/ | ||
126 | +/*#discountDesc {*/ | ||
127 | +/*color: #ffffff; background-color: red; border-radius: 2px; margin-left: 5px; padding: 0 3px 0 3px;*/ | ||
128 | +/*}*/ | ||
129 | + | ||
130 | +#linkPayDetail { | ||
131 | + color:#4395ff;text-decoration:none; | ||
132 | + float: right; | ||
133 | +} | ||
134 | + | ||
135 | + | ||
136 | + | ||
137 | + | ||
138 | +/*********************************************/ | ||
139 | +.radio{ | ||
140 | + display: inline-block; | ||
141 | + position: relative; | ||
142 | + line-height: 18px; | ||
143 | + margin-right: 10px; | ||
144 | + cursor: pointer; | ||
145 | + position:absolute; | ||
146 | + right:1rem; | ||
147 | +} | ||
148 | +.radio input{ | ||
149 | + display: none; | ||
150 | +} | ||
151 | +.radio .radio-bg{ | ||
152 | + display: inline-block; | ||
153 | + height: 18px; | ||
154 | + width: 18px; | ||
155 | + margin-right: 5px; | ||
156 | + padding: 0; | ||
157 | + background-color: #45bcb8; | ||
158 | + border-radius: 100%; | ||
159 | + vertical-align: top; | ||
160 | + box-shadow: 0 1px 15px rgba(0, 0, 0, 0.1) inset, 0 1px 4px rgba(0, 0, 0, 0.1) inset, 1px -1px 2px rgba(0, 0, 0, 0.1); | ||
161 | + cursor: pointer; | ||
162 | + transition: all 0.2s ease; | ||
163 | +} | ||
164 | +.radio .radio-on{ | ||
165 | + display: none; | ||
166 | +} | ||
167 | +.radio input:checked + span.radio-on{ | ||
168 | + width: 10px; | ||
169 | + height: 10px; | ||
170 | + position: absolute; | ||
171 | + border-radius: 100%; | ||
172 | + background: #FFFFFF; | ||
173 | + top: 4px; | ||
174 | + left: 4px; | ||
175 | + box-shadow: 0 2px 5px 1px rgba(0, 0, 0, 0.3), 0 0 1px rgba(255, 255, 255, 0.4) inset; | ||
176 | + background-image: linear-gradient(#ffffff 0, #e7e7e7 100%); | ||
177 | + transform: scale(0, 0); | ||
178 | + transition: all 0.2s ease; | ||
179 | + transform: scale(1, 1); | ||
180 | + display: inline-block; | ||
181 | +} | ||
182 | + | ||
183 | +.headTip { | ||
184 | + display:none;text-align: center; | ||
185 | + background-color:rgba(253, 201, 11, 0.95); | ||
186 | + width: 100%; | ||
187 | + line-height:25px; | ||
188 | +} | ||
189 | +.headTip > span:first-child { | ||
190 | + | ||
191 | +} | ||
192 | +.headTip > span:last-child { | ||
193 | + color:red;font-size: 1.6rem; | ||
194 | +} | ||
195 | + | ||
196 | + | ||
197 | + | ||
198 | + | ||
199 | +.discountBox{ | ||
200 | + border: 0; | ||
201 | + outline: 0; | ||
202 | + width: calc(100% - 120px); | ||
203 | + height:28px; | ||
204 | + line-height: 28px; | ||
205 | + padding-left: 10px; | ||
206 | + background:rgba(240,244,245,1); | ||
207 | + border-radius:4px; | ||
208 | + display: inline-block; | ||
209 | + float: left; | ||
210 | + color: #8a8a8a; | ||
211 | + font-size: 14px; | ||
212 | +} | ||
213 | +.discountBox:focus{ | ||
214 | + border: 0; | ||
215 | + outline: 0; | ||
216 | +} | ||
217 | +.discountBtn{ | ||
218 | + display: inline-block; | ||
219 | + float: right; | ||
220 | + border: none; | ||
221 | + outline: none; | ||
222 | + -webkit-appearance: none; | ||
223 | + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); | ||
224 | + border: 1px solid #75CBBE; | ||
225 | + border-radius:25px ; | ||
226 | + padding: 4px 20px; | ||
227 | + font-size: 14px; | ||
228 | + color: #75CBBE; | ||
229 | + background: #fff; | ||
230 | +} | ||
231 | +.discount-tip{ | ||
232 | + padding-top: 10px; | ||
233 | + font-size: 14px; | ||
234 | + color: #EB453B; | ||
235 | +} | ||
236 | +.paySuccess{ | ||
237 | + width: 100%; | ||
238 | + height: 100%; | ||
239 | + text-align: center; | ||
240 | + line-height: 100px; | ||
241 | + font-size: 20px; | ||
242 | + color: #fff; | ||
243 | + background: rgba(0,0,0,.7); | ||
244 | + position: fixed; | ||
245 | + top:0; | ||
246 | + left: 0; | ||
247 | + display: none; | ||
248 | +} |
css/paybacknew.css
0 → 100644
1 | +.tab-wrap{ | ||
2 | + display: flex; | ||
3 | + margin-bottom: 4px; | ||
4 | + height: 30px; | ||
5 | + line-height: 30px; | ||
6 | + background: #fff; | ||
7 | + text-align: center; | ||
8 | +} | ||
9 | +.tab-wrap >li{ | ||
10 | + flex: 1; | ||
11 | +} | ||
12 | +.tab-wrap >li span{ | ||
13 | + height: 30px; | ||
14 | + display: inline-block; | ||
15 | + padding: 0 15px; | ||
16 | +} | ||
17 | +.tab-wrap >li.active span{ | ||
18 | + color: #0474D7; | ||
19 | + position: relative; | ||
20 | + border-bottom: 4px solid #0474D7; | ||
21 | +} | ||
22 | + | ||
23 | +.tab-main{ | ||
24 | + margin-bottom: 67px; | ||
25 | + overflow-y: auto; | ||
26 | +} | ||
27 | + | ||
28 | +.pay-wrap{ | ||
29 | + background: #fff; | ||
30 | + padding-left: 15px; | ||
31 | + border-top:1px solid #e1e1e1; | ||
32 | + cursor: pointer; | ||
33 | +} | ||
34 | +.pay-header{ | ||
35 | + height: 30px; | ||
36 | + line-height: 30px; | ||
37 | + border-bottom: 1px solid #e1e1e1; | ||
38 | + display: flex; | ||
39 | + justify-content: space-between; | ||
40 | +} | ||
41 | +.pay-header span:last-child { | ||
42 | + color: #D40202; | ||
43 | + margin-right: 15px; | ||
44 | +} | ||
45 | +.pay-body{ | ||
46 | + padding: 10px 0; | ||
47 | + position: relative; | ||
48 | +} | ||
49 | +.pay-money{ | ||
50 | + position: absolute; | ||
51 | + top:50%; | ||
52 | + right: 15px; | ||
53 | + transform: translateY(-50%); | ||
54 | + color: #333; | ||
55 | +} | ||
56 | +.arrears-wrap{ | ||
57 | + display: none; | ||
58 | + | ||
59 | +} | ||
60 | + | ||
61 | +.allMoneyWrap{ | ||
62 | + padding-left: 15px; | ||
63 | + height: 27px; | ||
64 | + background: #FAF6EA; | ||
65 | + color: #333; | ||
66 | +} | ||
67 | +.allMoneyWrap span{ | ||
68 | + /*margin-left: 15px;*/ | ||
69 | + color: #D40202; | ||
70 | +} | ||
71 | + | ||
72 | +.arrears-list{ | ||
73 | + position: fixed; | ||
74 | + top: 60px; | ||
75 | + left: 0; | ||
76 | + bottom: 67px; /*距离底部的距离为底部盒子的高度,自己也可以设置*/ | ||
77 | + overflow-y: scroll; | ||
78 | + width: 100%; | ||
79 | + height: auto; | ||
80 | + -webkit-overflow-scrolling: touch; /*这句是为了滑动更顺畅*/ | ||
81 | +} | ||
82 | +.arrears-list>li{ | ||
83 | + padding-left: 40px; | ||
84 | + margin-bottom: 11px; | ||
85 | + border-top:1px solid #e1e1e1; | ||
86 | + background: #fff url("../img/arrearsCheck.png") no-repeat 9px center; | ||
87 | + cursor: pointer; | ||
88 | +} | ||
89 | +.arrears-list>li.active{ | ||
90 | + padding-left: 40px; | ||
91 | + margin-bottom: 11px; | ||
92 | + border-top:1px solid #e1e1e1; | ||
93 | + background: #fff url("../img/arrearsChecked.png") no-repeat 9px center; | ||
94 | + cursor: pointer; | ||
95 | +} | ||
96 | +.arrears-header{ | ||
97 | + height: 30px; | ||
98 | + line-height: 30px; | ||
99 | + border-bottom:1px solid #e1e1e1; | ||
100 | + display: flex; | ||
101 | + justify-content: space-between; | ||
102 | +} | ||
103 | +.arrears-header span:last-child{ | ||
104 | + color: #D40202; | ||
105 | + margin-right: 15px; | ||
106 | +} | ||
107 | +.arrears-body{ | ||
108 | + padding: 10px 0; | ||
109 | + position: relative; | ||
110 | +} | ||
111 | +.arrears-money{ | ||
112 | + position: absolute; | ||
113 | + top:50%; | ||
114 | + right: 15px; | ||
115 | + transform: translateY(-50%); | ||
116 | + color: #333; | ||
117 | +} | ||
118 | +.arrears-statistics{ | ||
119 | + height: 67px; | ||
120 | + position: fixed; | ||
121 | + left: 0; | ||
122 | + bottom: 0; | ||
123 | + width: 100%; | ||
124 | + background: #efeff4; | ||
125 | +} | ||
126 | +.statistics-title{ | ||
127 | + height: 32px; | ||
128 | + line-height: 32px; | ||
129 | + padding-left: 15px; | ||
130 | + background: #E6FAFA; | ||
131 | + color: #333; | ||
132 | +} | ||
133 | + | ||
134 | +.statistics-title span{ | ||
135 | + color:#D20000 ; | ||
136 | +} | ||
137 | +.statistics-opr{ | ||
138 | + height: 35px; | ||
139 | + line-height: 35px; | ||
140 | + display: flex; | ||
141 | + justify-content: space-between; | ||
142 | +} | ||
143 | +.opr-btn{ | ||
144 | + padding: 0 10px; | ||
145 | + color: #fff; | ||
146 | + background: #0260B8; | ||
147 | + cursor: pointer; | ||
148 | +} | ||
149 | +.check-btn{ | ||
150 | + padding-left: 40px; | ||
151 | + background: url("../img/arrearsCheck.png") no-repeat 9px center; | ||
152 | + cursor: pointer; | ||
153 | +} | ||
154 | +.check-btn.checkedActive{ | ||
155 | + background: url("../img/arrearsChecked.png") no-repeat 9px center; | ||
156 | +} | ||
157 | + | ||
158 | + |
img/arrearsCheck.png
0 → 100644
524 Bytes
img/arrearsChecked.png
0 → 100644
554 Bytes
js/config.js
@@ -11,7 +11,7 @@ window.webAppH5 = {}; | @@ -11,7 +11,7 @@ window.webAppH5 = {}; | ||
11 | 11 | ||
12 | var webAppRoot = 'http://pay.service.renniting.cn/'; //赤峰 | 12 | var webAppRoot = 'http://pay.service.renniting.cn/'; //赤峰 |
13 | //test 测试环境 | 13 | //test 测试环境 |
14 | -// var webAppRoot = "http://39.98.54.240:8090"; | 14 | +// var webAppRoot = "http://39.98.58.92:8090"; |
15 | //微信支付结果回调地址 | 15 | //微信支付结果回调地址 |
16 | var webAppPayResult = "http://wxgzh.renniting.cn/wechatwuxi/DEV/Threewf/codepay/page/wxpayResult.html"; | 16 | var webAppPayResult = "http://wxgzh.renniting.cn/wechatwuxi/DEV/Threewf/codepay/page/wxpayResult.html"; |
17 | 17 |
js/list.js
@@ -31,6 +31,9 @@ var _carNumber = getQueryString(window.location).carNumber | @@ -31,6 +31,9 @@ var _carNumber = getQueryString(window.location).carNumber | ||
31 | console.log(_carNumber) | 31 | console.log(_carNumber) |
32 | $('.carNum').text(_carNumber) | 32 | $('.carNum').text(_carNumber) |
33 | 33 | ||
34 | + | ||
35 | + | ||
36 | + | ||
34 | /** | 37 | /** |
35 | * @param {} second | 38 | * @param {} second |
36 | * @return {} | 39 | * @return {} |
@@ -74,152 +77,14 @@ jsajax.defaultReq( | @@ -74,152 +77,14 @@ jsajax.defaultReq( | ||
74 | if (data.length == 0) { | 77 | if (data.length == 0) { |
75 | $('#tip-title').text('您的停车费用为0元,无须缴费,谢谢!') | 78 | $('#tip-title').text('您的停车费用为0元,无须缴费,谢谢!') |
76 | return | 79 | return |
77 | - } | ||
78 | - var htmls = ''; | ||
79 | - for (var i = 0; i < data.length; i++) { | ||
80 | - var orderFreeDuration = Number((data[i].orderFreeDuration)) | ||
81 | - var parkDuration = Number((data[i].parkDuration)) | ||
82 | - var num = ((data[i].unPayFee) / 100).toFixed(2); | ||
83 | - var outflag = data[i].orderStateRemark; | ||
84 | - | ||
85 | - if (outflag == '出场缴费') { | ||
86 | - if (orderFreeDuration > parkDuration) { | ||
87 | - htmls += '<div class="weui-cells" data-flag="0">' + | ||
88 | - ' <div class="weui-cell">' + | ||
89 | - ' <div class="weui-cell__bd">' + | ||
90 | - ' <p class="carNumber">' + data[i].carNumber + '</p>' + | ||
91 | - ' <p class="parkCode" style="display: none">' + data[i].parkCode + '</p>' + | ||
92 | - // ' <p class="orderId" style="display: none">' + data[i].orderId + '</p>' + | ||
93 | - | ||
94 | - ' </div>' + | ||
95 | - ' <div class="weui-cell__ft paySrcType" style="color: #f00"></div>' + | ||
96 | - ' </div>' + | ||
97 | - ' <div class="weui-cell">' + | ||
98 | - ' <div class="weui-cell__bd">' + | ||
99 | - ' <p>停车场名称:' + data[i].parkName + '</p>' + | ||
100 | - ' <p>进场时间:' + data[i].parkInTime + '</p>' + | ||
101 | - ' <p>出场时间:' + data[i].parkOutTime + '</p>' + | ||
102 | - ' <p>停车时长:' + dateFormat(data[i].parkDuration) + '</p>' + | ||
103 | - ' </div>' + | ||
104 | - ' <div class="weui-cell__ft ">' + | ||
105 | - '<p><span class="paymoney">' + num + '</span>元</p>' + | ||
106 | - '<p class="out-btn arrears-btn">申请离场' + | ||
107 | - ' <span class="orderId" style="display: none">' + data[i].orderId + '</span>' + | ||
108 | - '</p>' + | ||
109 | - '</div>' + | ||
110 | - ' </div>' + | ||
111 | - ' </div>'; | ||
112 | - } else { | ||
113 | - htmls += '<div class="weui-cells" data-flag="1">' + | ||
114 | - ' <div class="weui-cell">' + | ||
115 | - ' <div class="weui-cell__bd">' + | ||
116 | - ' <p class="carNumber">' + data[i].carNumber + '</p>' + | ||
117 | - ' <p class="parkCode" style="display: none">' + data[i].parkCode + '</p>' + | ||
118 | - // ' <p class="orderId" style="display: none">' + data[i].orderId + '</p>' + | ||
119 | - | ||
120 | - ' </div>' + | ||
121 | - ' <div class="weui-cell__ft paySrcType" style="color: #f00"></div>' + | ||
122 | - ' </div>' + | ||
123 | - ' <div class="weui-cell">' + | ||
124 | - ' <div class="weui-cell__bd">' + | ||
125 | - ' <p>停车场名称:' + data[i].parkName + '</p>' + | ||
126 | - ' <p>进场时间:' + data[i].parkInTime + '</p>' + | ||
127 | - ' <p>出场时间:' + data[i].parkOutTime + '</p>' + | ||
128 | - ' <p>停车时长:' + dateFormat(data[i].parkDuration) + '</p>' + | ||
129 | - ' </div>' + | ||
130 | - ' <div class="weui-cell__ft "><p><span class="paymoney">' + num + '</span>元</p>' + | ||
131 | - '<p class="arrears-btn">出场缴费' + | ||
132 | - ' <span class="orderId" style="display: none">' + data[i].orderId + '</span>' + | ||
133 | - '</p>' + | ||
134 | - '</div>' + | ||
135 | - ' </div>' + | ||
136 | - ' </div>'; | ||
137 | - } | ||
138 | - | ||
139 | - } else { | ||
140 | - htmls += '<div class="weui-cells" data-flag="1">' + | ||
141 | - ' <div class="weui-cell">' + | ||
142 | - ' <div class="weui-cell__bd">' + | ||
143 | - ' <p class="carNumber">' + data[i].carNumber + '</p>' + | ||
144 | - ' <p class="parkCode" style="display: none">' + data[i].parkCode + '</p>' + | ||
145 | - // ' <p class="orderId" style="display: none">' + data[i].orderId + '</p>' + | ||
146 | - | ||
147 | - ' </div>' + | ||
148 | - ' <div class="weui-cell__ft paySrcType" style="color: #f00">' + outflag + '</div>' + | ||
149 | - ' </div>' + | ||
150 | - ' <div class="weui-cell">' + | ||
151 | - ' <div class="weui-cell__bd">' + | ||
152 | - ' <p>停车场名称:' + data[i].parkName + '</p>' + | ||
153 | - ' <p>进场时间:' + data[i].parkInTime + '</p>' + | ||
154 | - ' <p>出场时间:' + data[i].parkOutTime + '</p>' + | ||
155 | - ' <p>停车时长:' + dateFormat(data[i].parkDuration) + '</p>' + | ||
156 | - ' </div>' + | ||
157 | - ' <div class="weui-cell__ft "><p><span class="paymoney">' + num + '</span>元</p>' + | ||
158 | - '<p class="arrears-btn">清缴欠费' + | ||
159 | - ' <span class="orderId" style="display: none">' + data[i].orderId + '</span>' + | ||
160 | - '</p>' + | ||
161 | - '</div>' + | ||
162 | - ' </div>' + | ||
163 | - ' </div>'; | ||
164 | - } | ||
165 | - // if(outflag=='出场缴费'){ | ||
166 | - // outflag = '' | ||
167 | - // } | 80 | + }else{ |
168 | 81 | ||
169 | } | 82 | } |
170 | - $('#pay_listcont').append(htmls); | ||
171 | 83 | ||
172 | - // alert(data.message) | ||
173 | 84 | ||
174 | }) | 85 | }) |
175 | 86 | ||
176 | -var dateFormat = function (msd) { | ||
177 | - var time = msd | ||
178 | - | ||
179 | - if (null != time && "" != time) { | ||
180 | - | ||
181 | - if (time > 60 && time < 60 * 60) { | ||
182 | - | ||
183 | - time = parseInt(time / 60.0) + "分钟" + parseInt((parseFloat(time / 60.0) - | ||
184 | - | ||
185 | - parseInt(time / 60.0)) * 60) + "秒"; | ||
186 | - | ||
187 | - } | ||
188 | - | ||
189 | - else if (time >= 60 * 60 && time < 60 * 60 * 24) { | ||
190 | - | ||
191 | - time = parseInt(time / 3600.0) + "小时" + parseInt((parseFloat(time / 3600.0) - | ||
192 | - | ||
193 | - parseInt(time / 3600.0)) * 60) + "分钟" + | ||
194 | - | ||
195 | - parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) - | ||
196 | 87 | ||
197 | - parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒"; | ||
198 | - | ||
199 | - } else if (time >= 60 * 60 * 24) { | ||
200 | - | ||
201 | - time = parseInt(time / 3600.0 / 24) + "天" + parseInt((parseFloat(time / 3600.0 / 24) - | ||
202 | - | ||
203 | - parseInt(time / 3600.0 / 24)) * 24) + "小时" + parseInt((parseFloat(time / 3600.0) - | ||
204 | - | ||
205 | - parseInt(time / 3600.0)) * 60) + "分钟" + | ||
206 | - | ||
207 | - parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) - | ||
208 | - | ||
209 | - parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒"; | ||
210 | - | ||
211 | - } | ||
212 | - | ||
213 | - else { | ||
214 | - | ||
215 | - time = parseInt(time) + "秒"; | ||
216 | - | ||
217 | - } | ||
218 | - | ||
219 | - } | ||
220 | - | ||
221 | - return time; | ||
222 | -}; | ||
223 | 88 | ||
224 | $(document).on('click', '.weui-cells', function () { | 89 | $(document).on('click', '.weui-cells', function () { |
225 | console.log($(this).attr('data-flag')) | 90 | console.log($(this).attr('data-flag')) |
@@ -442,7 +307,8 @@ $('.outBtn').on('click', function () { | @@ -442,7 +307,8 @@ $('.outBtn').on('click', function () { | ||
442 | 307 | ||
443 | }) | 308 | }) |
444 | $('.hiddenBtn').on('click', function () { | 309 | $('.hiddenBtn').on('click', function () { |
445 | - $('#strTip').hide() | 310 | + // $('#strTip').hide() |
311 | + window.location.href = 'paybacknew.html?carNumber='+_carNumber | ||
446 | }) | 312 | }) |
447 | 313 | ||
448 | 314 |
js/monPay.js
0 → 100644
1 | +/* | ||
2 | +@songcxa | ||
3 | +@2018-12-14 | ||
4 | +@移动支付 | ||
5 | +*/ | ||
6 | +var webAppParams = null; | ||
7 | +var $btnObj = null; | ||
8 | +var $btnLoad = null; | ||
9 | +var flag = 0; | ||
10 | +var appWxID = 'wxff4cebaedbf4f886'; | ||
11 | +// var appWxID = 'wx945eccc8163fd75b' | ||
12 | +var webAppCode = null;//如果是微信,先获取微信code | ||
13 | +//var $btnLoad = document.getElementById("loading"); | ||
14 | +window.onload = function () { | ||
15 | + //var root = document.getElementById("root"); | ||
16 | + $btnObj = document.getElementById("btnPayOK"); | ||
17 | + $btnLoad = document.getElementById("loading"); | ||
18 | + | ||
19 | + $discountBtn = document.getElementById("discountBtn"); | ||
20 | + var webRoot = window.location.href; | ||
21 | + //设置当前客户端浏览器模式[微信、支付宝、其他] | ||
22 | + webAppClass.clientBrowser(); | ||
23 | + //绑定事件 | ||
24 | + var ali = document.getElementById("rowAliPay"); | ||
25 | + var wx = document.getElementById("rowWxPay"); | ||
26 | + ali.onclick = webAppClass.aliClick; | ||
27 | + wx.onclick = webAppClass.wxClick; | ||
28 | + //$btnObj.onclick = webAppClass.okClick; | ||
29 | + | ||
30 | + $btnObj.onclick = webAppClass.okPay; | ||
31 | + | ||
32 | + document.getElementById("payTip").innerHTML = ""; | ||
33 | + //参数 | ||
34 | + webAppParams = getQueryString(window.location); | ||
35 | + if (webAppParams != null) { | ||
36 | + console.log(webAppParams.carNumber) | ||
37 | + | ||
38 | + | ||
39 | + //设置UI参数 | ||
40 | + webAppClass.setUI(webAppParams); | ||
41 | + } else { | ||
42 | + alertMsg("暂无订单信息"); | ||
43 | + } | ||
44 | + | ||
45 | + //获取微信code | ||
46 | + //webAppClass.getCode(); | ||
47 | + var state = clientBrowserEx(); | ||
48 | + if (state == "wxPay") { | ||
49 | + webAppCode = webAppClass.getCode(); | ||
50 | + } | ||
51 | + // $discountBtn.onclick = webAppClass.discountClick; | ||
52 | +} | ||
53 | +/**/ | ||
54 | +var webAppClass = { | ||
55 | + //优惠券兑换 | ||
56 | + codediscountClick: function (tmpObj) { | ||
57 | + discountVal = document.getElementById("discountBox").value; | ||
58 | + // console.log(discountVal) | ||
59 | + // console.log(discountVal.length) | ||
60 | + if (discountVal.length > 0) { | ||
61 | + $btnObj.style.display = "none"; | ||
62 | + $btnLoad.style.display = "block"; | ||
63 | + $discountBtn.disabled = true | ||
64 | + console.log(webAppParams.orderId) | ||
65 | + var url = webAppRoot + window.webAppH5.discountServer; | ||
66 | + var discountParams = { | ||
67 | + app_id: '1', | ||
68 | + salt: '1', | ||
69 | + deviceInfo: '1', | ||
70 | + sign_type: '1', | ||
71 | + sign: '1', | ||
72 | + token: '1', | ||
73 | + terminalSource: 7, | ||
74 | + orderId: webAppParams.orderId, | ||
75 | + cardNo: discountVal, | ||
76 | + codeType: 0 | ||
77 | + } | ||
78 | + postRequest(url, discountParams, function (res) { | ||
79 | + console.log(res) | ||
80 | + if (res.code == 0) { | ||
81 | + | ||
82 | + document.getElementById("sumMoney").innerHTML = (res.data.orderFee / 100) | ||
83 | + document.getElementById("discountTip").innerHTML = res.data.couponDescribe | ||
84 | + document.getElementById("discountFee").innerHTML = (res.data.discountFee / 100) | ||
85 | + document.getElementById("discountDesc").style.display = "none" | ||
86 | + $btnLoad.style.display = "none"; | ||
87 | + $btnObj.style.display = "block"; | ||
88 | + flag = 1; | ||
89 | + webAppClass.okPay(tmpObj);//唤醒支付 | ||
90 | + } else { | ||
91 | + $btnLoad.style.display = "none"; | ||
92 | + $btnObj.style.display = "block"; | ||
93 | + $discountBtn.disabled = false; | ||
94 | + document.getElementById("discountTip").innerHTML = res.message | ||
95 | + } | ||
96 | + }) | ||
97 | + | ||
98 | + } else { | ||
99 | + return | ||
100 | + } | ||
101 | + }, | ||
102 | + discountClick: function () { | ||
103 | + discountVal = document.getElementById("discountBox").value; | ||
104 | + // console.log(discountVal) | ||
105 | + // console.log(discountVal.length) | ||
106 | + if (discountVal.length > 0) { | ||
107 | + $btnObj.style.display = "none"; | ||
108 | + $btnLoad.style.display = "block"; | ||
109 | + $discountBtn.disabled = true | ||
110 | + // console.log(webAppParams.orderId); | ||
111 | + if (webAppParams === null || webAppParams === 'null' || webAppParams === undefined) { | ||
112 | + document.getElementById("discountTip").innerHTML = '缺少参数'; | ||
113 | + $btnLoad.style.display = "none"; | ||
114 | + $btnObj.style.display = "block"; | ||
115 | + return false; | ||
116 | + } | ||
117 | + var url = webAppRoot + window.webAppH5.discountServer; | ||
118 | + var discountParams = { | ||
119 | + app_id: '1', | ||
120 | + salt: '1', | ||
121 | + deviceInfo: '1', | ||
122 | + sign_type: '1', | ||
123 | + sign: '1', | ||
124 | + token: '1', | ||
125 | + terminalSource: 7, | ||
126 | + orderId: webAppParams.orderId, | ||
127 | + cardNo: discountVal, | ||
128 | + codeType: 0 | ||
129 | + } | ||
130 | + postRequest(url, discountParams, function (res) { | ||
131 | + console.log(res) | ||
132 | + if (res.code == 0) { | ||
133 | + | ||
134 | + document.getElementById("sumMoney").innerHTML = (res.data.orderFee / 100) | ||
135 | + document.getElementById("discountTip").innerHTML = res.data.couponDescribe | ||
136 | + document.getElementById("discountFee").innerHTML = (res.data.discountFee / 100) | ||
137 | + document.getElementById("discountDesc").style.display = "none" | ||
138 | + $btnLoad.style.display = "none"; | ||
139 | + $btnObj.style.display = "block"; | ||
140 | + document.getElementById("discountBox").setAttribute('readonly', 'readonly'); | ||
141 | + flag = 1 | ||
142 | + } else { | ||
143 | + $btnLoad.style.display = "none"; | ||
144 | + $btnObj.style.display = "block"; | ||
145 | + $discountBtn.disabled = false; | ||
146 | + document.getElementById("discountTip").innerHTML = res.message | ||
147 | + } | ||
148 | + }) | ||
149 | + | ||
150 | + } else { | ||
151 | + $btnLoad.style.display = "none"; | ||
152 | + $btnObj.style.display = "block"; | ||
153 | + return false; | ||
154 | + } | ||
155 | + }, | ||
156 | + //OK | ||
157 | + okClick: function (ev) { | ||
158 | + document.getElementById("payTip").innerHTML = ""; | ||
159 | + if (webAppParams == null) { | ||
160 | + alertMsg("暂无订单信息"); | ||
161 | + return; | ||
162 | + } | ||
163 | + //先校验停车费用后缴费提交 | ||
164 | + webAppClass.checkParkCost(); | ||
165 | + }, | ||
166 | + //校验该订单当前支付时的费用(排除扫描订单后不支付时长) | ||
167 | + checkParkCost: function () { | ||
168 | + $btnObj.style.display = "none"; | ||
169 | + $btnLoad.style.display = "block"; | ||
170 | + if (typeof (webAppParams.queryOrderInfo) == "undefined") {//没有queryOrderInfo返回第一页 | ||
171 | + window.history.back(-1); | ||
172 | + } | ||
173 | + var tmpParams = JSON.parse(webAppParams.queryOrderInfo); | ||
174 | + var url = webAppRoot + window.webAppH5.comServer; | ||
175 | + postRequest(url, tmpParams, function (res) { | ||
176 | + //btnObj.style.display = "block"; //$btnLoad.style.display = "none"; | ||
177 | + //$btnObj.style.display = "block"; | ||
178 | + if (res.code == 0) {//进场 | ||
179 | + var tmpObj = res.data; | ||
180 | + if (tmpObj) { | ||
181 | + if (flag == 1) { | ||
182 | + webAppClass.codediscountClick(tmpObj); | ||
183 | + } else { | ||
184 | + webAppClass.setUI(tmpObj); | ||
185 | + webAppParams = tmpObj;//重新赋值 | ||
186 | + webAppClass.okPay(tmpObj);//唤醒支付 | ||
187 | + } | ||
188 | + | ||
189 | + console.log(tmpObj) | ||
190 | + // webAppClass.okPay(tmpObj);//唤醒支付 | ||
191 | + } else { | ||
192 | + alertMsg("没有找到相应订单"); | ||
193 | + } | ||
194 | + } else {//其他情况如【该卡号场内已存在】 | ||
195 | + $btnLoad.style.display = "none"; | ||
196 | + $btnObj.style.display = "block"; | ||
197 | + console.log(res.message); | ||
198 | + alertMsg(res.message); | ||
199 | + } | ||
200 | + }, function (err) { | ||
201 | + console.log("网络服务超时..." + url); | ||
202 | + alertMsg("网络服务超时"); | ||
203 | + $btnLoad.style.display = "none"; | ||
204 | + $btnObj.style.display = "block"; | ||
205 | + //$btnLoad.style.display = "none"; | ||
206 | + }); | ||
207 | + }, | ||
208 | + | ||
209 | + //确定支付 | ||
210 | + okPay: function (params) { | ||
211 | + var _paySrcType = getQueryVariable("paySrcType") | ||
212 | + var orderID = webAppParams.orderId;//订单号 | ||
213 | + // alert(_paySrcType) | ||
214 | + if(_paySrcType==103){ | ||
215 | + var code = orderID.slice(0,orderID.length) | ||
216 | + var codes = code.split(',') | ||
217 | + orderID = [] | ||
218 | + console.log(code) | ||
219 | + console.log(codes) | ||
220 | + for(var i=0;i<codes.length;i++){ | ||
221 | + console.log(codes[i]) | ||
222 | + orderID.push({ | ||
223 | + orderId:codes[i] | ||
224 | + } | ||
225 | + ) | ||
226 | + } | ||
227 | + console.log(orderID) | ||
228 | + }else{ | ||
229 | + orderID = webAppParams.orderId;//订单号 | ||
230 | + } | ||
231 | + | ||
232 | + // alert(orderID) | ||
233 | + // alert(orderID) | ||
234 | + //var moneyID = document.getElementById("sumMoney").innerHTML = webAppParams.orderId;//订单号 | ||
235 | + var val = document.getElementById("unpaid").innerText; | ||
236 | + //var couponPersonId = document.getElementById("discountBox").value; | ||
237 | + var url = webAppRoot + window.webAppH5.zeroPayServer; | ||
238 | + // var _paySrcType = getQueryString(window.location)._paySrcType | ||
239 | + var _mon = document.getElementById("unpaid").innerText | ||
240 | + | ||
241 | + var discountParams = { | ||
242 | + payOrderType: _paySrcType, | ||
243 | + recordArreaInfos: JSON.stringify( | ||
244 | + orderID | ||
245 | + ), | ||
246 | + terminalSource: 7, | ||
247 | + orderId: orderID, | ||
248 | + //couponPersonId:couponPersonId, | ||
249 | + app_id: '123', | ||
250 | + sign_type: '123', | ||
251 | + salt: '123', | ||
252 | + deviceInfo: '123', | ||
253 | + sign: '123', | ||
254 | + } | ||
255 | + if (val == '0.00' || val == '0') { | ||
256 | + postRequest(url, discountParams, function (res) { | ||
257 | + console.log(res) | ||
258 | + if (res.code == 0) { | ||
259 | + document.getElementById("paySuccess").style.display = 'block' | ||
260 | + | ||
261 | + } else { | ||
262 | + alert(res.message) | ||
263 | + // $discountBtn.disabled = false | ||
264 | + // document.getElementById("discountTip").innerHTML = res.message | ||
265 | + } | ||
266 | + }) | ||
267 | + } else { | ||
268 | + var root = webAppRoot; | ||
269 | + //第一首先判断当前哪种浏览器方式[微信内置、支付宝内置、第三方浏览器] | ||
270 | + var clientType = clientBrowserEx(); | ||
271 | + //alert(clientType); | ||
272 | + switch (clientType) { | ||
273 | + case "wxPay"://微信[内置浏览器] | ||
274 | + | ||
275 | + webAppClass.payAjaxJDK(orderID); | ||
276 | + console.log("wxPay");//微信支付 | ||
277 | + break; | ||
278 | + case "aliPay"://支付宝 | ||
279 | + console.log("aliPay"); | ||
280 | + //订单号 | ||
281 | + var obj = {}; | ||
282 | + //this.payAjax(url, { orderId: "11111", price: 0.01 }); | ||
283 | + var aliPay = webAppH5.aliPayServer; | ||
284 | + var aliParams = webAppH5.comParams; | ||
285 | + aliParams.orderId = orderID; | ||
286 | + aliParams.carNumber = getQueryString(window.location).carnum; | ||
287 | + aliParams.payType = 1;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号 | ||
288 | + aliParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付 | ||
289 | + aliParams.paySrcType = _paySrcType;//101停车支付 | ||
290 | + aliParams.orgId = '10003', | ||
291 | + aliParams.backType=2, | ||
292 | + // aliParams.recordArreaInfos = JSON.stringify([{ | ||
293 | + // "orderId": webAppParams.orderId, | ||
294 | + // "orderNotPayFee": _mon * 100, | ||
295 | + // "parkId": getQueryString(window.location).parkCode | ||
296 | + // }]); | ||
297 | + | ||
298 | + aliParams.recordArreaInfos = JSON.stringify(orderID); | ||
299 | + webAppClass.payAliAjax(root + aliPay, aliParams); | ||
300 | + break; | ||
301 | + default://第三方浏览器other | ||
302 | + //默认支付宝 | ||
303 | + // alert('2') | ||
304 | + if (document.getElementById("aliPay").checked) { | ||
305 | + console.log("aliPay"); | ||
306 | + //订单号 | ||
307 | + var obj = {}; | ||
308 | + //this.payAjax(url, { orderId: "11111", price: 0.01 }); | ||
309 | + var aliPay = webAppH5.aliPayServer; | ||
310 | + var aliParams = webAppH5.comParams; | ||
311 | + aliParams.orderId = orderID; | ||
312 | + aliParams.carNumber = getQueryString(window.location).carnum; | ||
313 | + aliParams.payType = 1;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号 | ||
314 | + aliParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付 | ||
315 | + aliParams.paySrcType = _paySrcType;//101停车支付 | ||
316 | + aliParams.orgId = '10003', | ||
317 | + aliParams.backType=2, | ||
318 | + | ||
319 | + // aliParams.recordArreaInfos = JSON.stringify([{ | ||
320 | + // "orderId": webAppParams.orderId, | ||
321 | + // "orderNotPayFee": _mon * 100, | ||
322 | + // "parkId": getQueryString(window.location).parkCode | ||
323 | + // }]); | ||
324 | + aliParams.recordArreaInfos = JSON.stringify(orderID); | ||
325 | + | ||
326 | + webAppClass.payAliAjax(root + aliPay, aliParams); | ||
327 | + } else {//微信页面支付 | ||
328 | + // var url = " https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx20161110163838f231619da20804912345&package=1037687096"; | ||
329 | + // //window.location.href = url; | ||
330 | + // var wxPay = webAppH5.wxPayServer; | ||
331 | + // var wxParams = webAppH5.comParams; | ||
332 | + // wxParams.carNumber = getQueryString(window.location).carnum; | ||
333 | + // wxParams.orderId = orderID; | ||
334 | + // wxParams.payType = 4;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号 | ||
335 | + // wxParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付 | ||
336 | + // wxParams.orgId = '10003', | ||
337 | + // wxParams.paySrcType = _paySrcType;//101停车支付 | ||
338 | + // wxParams.backType=2, | ||
339 | + // wxParams.openId = _openId | ||
340 | + // // wxParams.recordArreaInfos = JSON.stringify([{ | ||
341 | + // // "orderId": webAppParams.orderId, | ||
342 | + // // "orderNotPayFee": _mon * 100, | ||
343 | + // // "parkId": getQueryString(window.location).parkCode | ||
344 | + // // }]); | ||
345 | + // wxParams.recordArreaInfos = JSON.stringify(orderID); | ||
346 | + // webAppClass.payAjax(root + wxPay, wxParams); | ||
347 | + // console.log("wxPay"); | ||
348 | + | ||
349 | + | ||
350 | + | ||
351 | + webAppClass.payAjaxJDK(orderID); | ||
352 | + console.log("wxPay");//微信支付 | ||
353 | + | ||
354 | + } | ||
355 | + break; | ||
356 | + } | ||
357 | + } | ||
358 | + | ||
359 | + }, | ||
360 | + | ||
361 | + getCode: function () { | ||
362 | + var appID = appWxID; | ||
363 | + var code = getUrlParam('code'); | ||
364 | + var local = window.location.href; | ||
365 | + //alert("local:" + local); | ||
366 | + if (code == null || code === '') { | ||
367 | + //alert(code); | ||
368 | + window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appID + '&redirect_uri=' + encodeURIComponent(local) + '&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect' | ||
369 | + //window.event.returnValue = false; | ||
370 | + //window.open('https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appID + '&redirect_uri=' + encodeURIComponent(local) + '&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect'); | ||
371 | + //alert("22"); | ||
372 | + } else { | ||
373 | + //getOpenId(code); //把code传给后台获取用户信息 | ||
374 | + //alert(code); | ||
375 | + //webAppCode = code; | ||
376 | + return code; | ||
377 | + } | ||
378 | + | ||
379 | + function getUrlParam(name) { | ||
380 | + var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)'); | ||
381 | + var r = window.location.search.substr(1).match(reg) | ||
382 | + if (r != null) return unescape(r[2]) | ||
383 | + return null | ||
384 | + } | ||
385 | + }, | ||
386 | + //Ali | ||
387 | + aliClick: function (ev) { | ||
388 | + console.log("AliClick"); | ||
389 | + document.getElementById("aliPay").checked = true; | ||
390 | + ev.preventDefault(); | ||
391 | + }, | ||
392 | + //Wx | ||
393 | + wxClick: function (ev) { | ||
394 | + console.log("wxClick"); | ||
395 | + document.getElementById("wxPay").checked = true; | ||
396 | + ev.preventDefault(); | ||
397 | + }, | ||
398 | + //浏览器 | ||
399 | + clientBrowser: function () { | ||
400 | + if (/MicroMessenger/.test(window.navigator.userAgent)) { | ||
401 | + console.log("微信客户端"); | ||
402 | + this.switchShow("wxPay"); | ||
403 | + } else if (/AlipayClient/.test(window.navigator.userAgent)) { | ||
404 | + console.log("支付宝客户端"); | ||
405 | + this.switchShow("aliPay"); | ||
406 | + } else { | ||
407 | + console.log("其他浏览器"); | ||
408 | + this.switchShow("other"); | ||
409 | + } | ||
410 | + }, | ||
411 | + //根据浏览器显示内容[aliPay、wxPay、other] | ||
412 | + switchShow: function (type) { | ||
413 | + var aliObj = document.getElementById("rowAliPay"); | ||
414 | + var wxObj = document.getElementById("rowWxPay"); | ||
415 | + var lineObj = document.getElementById("splitLine"); | ||
416 | + switch (type) { | ||
417 | + case "aliPay": | ||
418 | + lineObj.style.display = "none"; | ||
419 | + wxObj.style.display = "none"; | ||
420 | + document.getElementById("aliPay").checked = true; | ||
421 | + break; | ||
422 | + case "wxPay": | ||
423 | + lineObj.style.display = "none"; | ||
424 | + aliObj.style.display = "none"; | ||
425 | + document.getElementById("wxPay").checked = true; | ||
426 | + break; | ||
427 | + default://其他浏览器[浏览器暂时屏蔽微信] | ||
428 | + lineObj.style.display = "none"; | ||
429 | + wxObj.style.display = "none"; | ||
430 | + document.getElementById("aliPay").checked = true; | ||
431 | + break; | ||
432 | + } | ||
433 | + }, | ||
434 | + | ||
435 | + //异步请求-微信H5页面 | ||
436 | + payAjax: function (url, params) { | ||
437 | + var btnOBj = $btnObj; | ||
438 | + postRequest(url, params, function (res) { | ||
439 | + btnOBj.style.display = "block"; | ||
440 | + $btnLoad.style.display = "none"; | ||
441 | + //debugger; | ||
442 | + if (res.code == 0) {//进场 | ||
443 | + //alertMsg("出场成功"); | ||
444 | + if (res.data) { | ||
445 | + var tmpObj = res.data; | ||
446 | + if (typeof (tmpObj.mwebUrl) != "undefined") { | ||
447 | + window.location.href = tmpObj.mwebUrl + "&redirect_url=" + webAppPayResult; | ||
448 | + } else { | ||
449 | + alertMsg("没有返回支付地址mwebUrl"); | ||
450 | + } | ||
451 | + console.log(JSON.stringify(tmpObj)); | ||
452 | + } else { | ||
453 | + alertMsg("没有找到返回值"); | ||
454 | + } | ||
455 | + } else {//其他情况如【该卡号场内已存在】 | ||
456 | + console.log(res.message); | ||
457 | + alertMsg(res.message); | ||
458 | + } | ||
459 | + }, function (err) { | ||
460 | + console.log("网络地址出错..."); | ||
461 | + alertMsg("网络地址出错..."); | ||
462 | + $btnLoad.style.display = "none"; | ||
463 | + btnOBj.style.display = "block"; | ||
464 | + }); | ||
465 | + }, | ||
466 | + //异步请求-微信JDK调用 | ||
467 | + payAjaxJDK: function (orderID) { | ||
468 | + var btnOBj = $btnObj; | ||
469 | + //0:页面初始化获取code[webAppCode] | ||
470 | + var codeParams = {code: webAppCode, appId: appWxID}; | ||
471 | + var openIdUrl = webAppRoot + window.webAppH5.wxGetOpenIdServer; | ||
472 | + | ||
473 | + //1:有code获取OpenId | ||
474 | + postRequest(openIdUrl, codeParams, function (res) { | ||
475 | + //alert(JSON.stringify(res)); | ||
476 | + if (res.code == 0) { | ||
477 | + //alert(res.data); | ||
478 | + webAppClass.getPayParams(res.data, orderID); | ||
479 | + } else if (res.code == 40163) {//code been used, hints[重复code问题] | ||
480 | + | ||
481 | + alertMsg(appState.codeNullTip); | ||
482 | + console.log(res.message); | ||
483 | + $btnObj.style.display = "block"; | ||
484 | + $btnLoad.style.display = "none"; | ||
485 | + } else { | ||
486 | + alertMsg(res.message); | ||
487 | + $btnObj.style.display = "block"; | ||
488 | + $btnLoad.style.display = "none"; | ||
489 | + } | ||
490 | + }, function (err) { | ||
491 | + console.log("网络地址出错..." + openIdUrl); | ||
492 | + $btnObj.style.display = "block"; | ||
493 | + $btnLoad.style.display = "none"; | ||
494 | + }); | ||
495 | + //2:获取支付参数 | ||
496 | + //function getPayParams(openId) { | ||
497 | + | ||
498 | + //} | ||
499 | + }, | ||
500 | + getPayParams: function (openId, orderID) { | ||
501 | + var wxPay = window.webAppH5.wxPayServer; | ||
502 | + var wxParams = window.webAppH5.comParams; | ||
503 | + var _mon = Number($('#unpaid').text)*100 | ||
504 | + wxParams.orderId = orderID; | ||
505 | + wxParams.backType=2, | ||
506 | + wxParams.orgId = '10003', | ||
507 | + wxParams.payType = 4;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号 | ||
508 | + wxParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付 | ||
509 | + //webAppClass.payAjax(root + wxPay, wxParams); | ||
510 | + | ||
511 | + | ||
512 | + //新增start | ||
513 | + | ||
514 | + | ||
515 | + wxParams.carNumber = getQueryVariable("carnum"); | ||
516 | + | ||
517 | + wxParams.paySrcType = getQueryVariable("paySrcType");//101停车支付 | ||
518 | + | ||
519 | + | ||
520 | + | ||
521 | + | ||
522 | + | ||
523 | + // var orderID = orderID;//订单号 | ||
524 | + // alert(_paySrcType) | ||
525 | + // if(getQueryVariable("paySrcType")==103){ | ||
526 | + // var code = orderID.slice(0,orderID.length) | ||
527 | + // var codes = code.split(',') | ||
528 | + // orderID = [] | ||
529 | + // console.log(code) | ||
530 | + // console.log(codes) | ||
531 | + // for(var i=0;i<codes.length;i++){ | ||
532 | + // console.log(codes[i]) | ||
533 | + // orderID.push({ | ||
534 | + // orderId:codes[i] | ||
535 | + // } | ||
536 | + // ) | ||
537 | + // } | ||
538 | + // console.log(orderID) | ||
539 | + // }else{ | ||
540 | + // orderID = orderID;//订单号 | ||
541 | + // } | ||
542 | + | ||
543 | + | ||
544 | + wxParams.recordArreaInfos = JSON.stringify(orderID); | ||
545 | + | ||
546 | + //新增end | ||
547 | + | ||
548 | + | ||
549 | + wxParams.openId = openId; | ||
550 | + _openId = openId | ||
551 | + wxParams.appId = appWxID; | ||
552 | + var payParamsUrl = webAppRoot + window.webAppH5.wxPayServer; | ||
553 | + //alert(payParamsUrl);alert(orderID); | ||
554 | + postRequest(payParamsUrl, wxParams, function (res) { | ||
555 | + $btnObj.style.display = "block"; | ||
556 | + $btnLoad.style.display = "none"; | ||
557 | + //debugger; | ||
558 | + if (res.code == 0) {//进场 | ||
559 | + //alertMsg("出场成功"); | ||
560 | + if (res.data) { | ||
561 | + var tmpObj = res.data; | ||
562 | + webAppClass.weixinJSBridge(res.data); | ||
563 | + console.log(JSON.stringify(tmpObj)); | ||
564 | + //alert(JSON.stringify(tmpObj)); | ||
565 | + } else { | ||
566 | + alertMsg("没有找到返回值"); | ||
567 | + } | ||
568 | + } else { | ||
569 | + $btnLoad.style.display = "none"; | ||
570 | + $btnObj.style.display = "block"; | ||
571 | + console.log(res.message); | ||
572 | + alertMsg(res.message); | ||
573 | + } | ||
574 | + }, function (err) { | ||
575 | + console.log("网络地址出错..."); | ||
576 | + alertMsg("网络地址出错..." + payParamsUrl); | ||
577 | + $btnLoad.style.display = "none"; | ||
578 | + $btnObj.style.display = "block"; | ||
579 | + }); | ||
580 | + }, | ||
581 | + | ||
582 | + //调用微信内置WeixinJSBridge对象发起支付 | ||
583 | + weixinJSBridge: function (params) { | ||
584 | + function onBridgeReady() { | ||
585 | + WeixinJSBridge.invoke( | ||
586 | + 'getBrandWCPayRequest', params, | ||
587 | + //'getBrandWCPayRequest', { | ||
588 | + // "appId": appWxID, //公众号名称,由商户传入 | ||
589 | + // "timeStamp": "1395712654", //时间戳,自1970年以来的秒数 | ||
590 | + // "nonceStr": "e61463f8efa94090b1f366cccfbbb444", //随机串 | ||
591 | + // "package": "prepay_id=u802345jgfjsdfgsdg888", | ||
592 | + // "signType": "MD5", //微信签名方式: | ||
593 | + // "paySign": "70EA570631E4BB79628FBCA90534C63FF7FADD89" //微信签名 | ||
594 | + //}, | ||
595 | + function (res) { | ||
596 | + //alert(res.err_msg); | ||
597 | + if (res.err_msg == "get_brand_wcpay_request:ok") { | ||
598 | + // 使用以上方式判断前端返回,微信团队郑重提示: | ||
599 | + //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。 | ||
600 | + | ||
601 | + | ||
602 | + | ||
603 | + //window.location.href = webAppPayResult + "?trade_no=" + "success"; | ||
604 | + window.history.go(-2); | ||
605 | + setTimeout(function(){ | ||
606 | + window.history.go(-2); | ||
607 | + //var src = mUrl.Uri+'/WEB-INF/pages/select.html?openid='+func.openid+'&token='+func.token+"&";//mUrl.myParkCardView; | ||
608 | + //window.location.href = src; | ||
609 | + },3000); | ||
610 | + | ||
611 | + | ||
612 | + } else if (res.err_msg == 'get_brand_wcpay_request:cancel') { | ||
613 | + window.location.href = webAppPayResult + "?trade_no=" + "fail"; | ||
614 | + } else { | ||
615 | + alertMsg(JSON.stringify(res)); | ||
616 | + //alert(res.err_msg); | ||
617 | + } | ||
618 | + }); | ||
619 | + } | ||
620 | + | ||
621 | + if (typeof WeixinJSBridge == "undefined") { | ||
622 | + if (document.addEventListener) { | ||
623 | + document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false); | ||
624 | + } else if (document.attachEvent) { | ||
625 | + document.attachEvent('WeixinJSBridgeReady', onBridgeReady); | ||
626 | + document.attachEvent('onWeixinJSBridgeReady', onBridgeReady); | ||
627 | + } | ||
628 | + } else { | ||
629 | + onBridgeReady(); | ||
630 | + } | ||
631 | + }, | ||
632 | + | ||
633 | + //异步请求-支付宝 | ||
634 | + payAliAjax: function (url, params) { | ||
635 | + console.log(url) | ||
636 | + console.log(params) | ||
637 | + var btnOBj = $btnObj; | ||
638 | + postRequest(url, params, function (res) { | ||
639 | + btnOBj.style.display = "block"; | ||
640 | + $btnLoad.style.display = "none"; | ||
641 | + console.log(res) | ||
642 | + if (res.code == 0) {//进场 | ||
643 | + document.write(res.data);//打开支付表单 | ||
644 | + } else {//其他情况如【该卡号场内已存在】 | ||
645 | + console.log(res.message); | ||
646 | + alertMsg(res.message); | ||
647 | + } | ||
648 | + }, function (err) { | ||
649 | + console.log("网络地址出错..."); | ||
650 | + alertMsg("网络地址出错..."); | ||
651 | + $btnLoad.style.display = "none"; | ||
652 | + btnOBj.style.display = "block"; | ||
653 | + }); | ||
654 | + }, | ||
655 | + | ||
656 | + //设置UI | ||
657 | + setUI: function (params) { | ||
658 | + console.log('ui') | ||
659 | + | ||
660 | + if (params != null && params != "") { | ||
661 | + var carnum = getQueryVariable("carnum") // 车牌号 | ||
662 | + var unpaid = (getQueryVariable("unpaid") / 100).toFixed(2) // 应付 | ||
663 | + var _num = getQueryVariable("num") // 笔数 | ||
664 | + var monNum = (getQueryVariable("due") / 100).toFixed(2) // 总费用 | ||
665 | + var paySrcType = getQueryVariable("paySrcType") // 支付单来源 101:停车付款单 103:停车补缴单 | ||
666 | + var disfee = getQueryVariable("disfee")// 优惠金额 | ||
667 | + if(paySrcType==103){ | ||
668 | + $('#wenan').hide() | ||
669 | + disfee = (getQueryVariable("disfee") / 100).toFixed(2) | ||
670 | + }else{ | ||
671 | + disfee = disfee.slice(1,disfee.length-1) | ||
672 | + } | ||
673 | + | ||
674 | + var orderID = getQueryVariable("orderId") // 订单 | ||
675 | + var parkCode = getQueryVariable("parkCode") // 订单 | ||
676 | + | ||
677 | + $("#carnum").text(carnum); | ||
678 | + $("#unpaid").text(unpaid); | ||
679 | + $("#monNum").text(_num + '笔'); | ||
680 | + $("#allMon").text(monNum); | ||
681 | + $("#disfee").text(disfee); | ||
682 | + // $discountDesc.innerHTML = params.discountDesc; | ||
683 | + } else { | ||
684 | + console.log("没有接受到参数"); | ||
685 | + } | ||
686 | + }, | ||
687 | + | ||
688 | + | ||
689 | +} | ||
690 | + | ||
691 | +function getQueryVariable(variable) { | ||
692 | + var query = window.location.search.substring(1); | ||
693 | + var vars = query.split("&"); | ||
694 | + for (var i = 0; i < vars.length; i++) { | ||
695 | + var pair = vars[i].split("="); | ||
696 | + if (pair[0] == variable) { | ||
697 | + return decodeURI(pair[1]); | ||
698 | + } | ||
699 | + } | ||
700 | + return (false); | ||
701 | +} | ||
702 | + |
js/paybacknew.js
0 → 100644
1 | +var fun = { | ||
2 | + dateFormat: function (msd) { | ||
3 | + var time = msd | ||
4 | + | ||
5 | + if (null != time && "" != time) { | ||
6 | + | ||
7 | + if (time > 60 && time < 60 * 60) { | ||
8 | + | ||
9 | + time = parseInt(time / 60.0) + "分钟" + parseInt((parseFloat(time / 60.0) - | ||
10 | + | ||
11 | + parseInt(time / 60.0)) * 60) + "秒"; | ||
12 | + | ||
13 | + } | ||
14 | + | ||
15 | + else if (time >= 60 * 60 && time < 60 * 60 * 24) { | ||
16 | + | ||
17 | + time = parseInt(time / 3600.0) + "小时" + parseInt((parseFloat(time / 3600.0) - | ||
18 | + | ||
19 | + parseInt(time / 3600.0)) * 60) + "分钟" + | ||
20 | + | ||
21 | + parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) - | ||
22 | + | ||
23 | + parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒"; | ||
24 | + | ||
25 | + } else if (time >= 60 * 60 * 24) { | ||
26 | + | ||
27 | + time = parseInt(time / 3600.0 / 24) + "天" + parseInt((parseFloat(time / 3600.0 / 24) - | ||
28 | + | ||
29 | + parseInt(time / 3600.0 / 24)) * 24) + "小时" + parseInt((parseFloat(time / 3600.0) - | ||
30 | + | ||
31 | + parseInt(time / 3600.0)) * 60) + "分钟" + | ||
32 | + | ||
33 | + parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) - | ||
34 | + | ||
35 | + parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒"; | ||
36 | + | ||
37 | + } | ||
38 | + | ||
39 | + else { | ||
40 | + | ||
41 | + time = parseInt(time) + "秒"; | ||
42 | + | ||
43 | + } | ||
44 | + | ||
45 | + } | ||
46 | + | ||
47 | + return time; | ||
48 | + }, | ||
49 | + checkIN: function (i) { | ||
50 | + return i.parkState == 10 | ||
51 | + }, | ||
52 | + checkOUT: function (i) { | ||
53 | + return i.parkState == 20 | ||
54 | + }, | ||
55 | + //查询单个待支付单费用 | ||
56 | + getOneorder: function (carNumber, parkCode, orderId, parkCode) { | ||
57 | + // var salt = jsajax.salt(32); | ||
58 | + // var token = mUrl.GetToken(); | ||
59 | + | ||
60 | + var salt = jsajax.salt(32); | ||
61 | + var token = mUrl.GetToken(); | ||
62 | + if (token == null) { | ||
63 | + token = ''; | ||
64 | + } | ||
65 | + var jsondata = { | ||
66 | + app_id: "0eca8f5373ca4866aec2f8e9d9367104", | ||
67 | + deviceInfo: "BC0703A4-AFB0-4B51-9089-9B7487C0CC6E", | ||
68 | + salt: salt, | ||
69 | + sign: fun.getMd5sign(), | ||
70 | + sign_type: "md5", | ||
71 | + token: token, | ||
72 | + | ||
73 | + appId: jsajax.appID, | ||
74 | + orderId: orderId, | ||
75 | + terminalSource: '7', | ||
76 | + parkCode: parkCode, | ||
77 | + carNumber: carNumber, | ||
78 | + | ||
79 | + } | ||
80 | + // console.log('查询单个的入参 ' + JSON.stringify(jsondata) + " 请求的接口" + mUrl.oneCardorder); | ||
81 | + jsajax.defaultReq( | ||
82 | + mUrl.oneCardorder, | ||
83 | + JSON.stringify(jsondata), | ||
84 | + function (data) { | ||
85 | + console.log(data) | ||
86 | + if (data.code == '0') { | ||
87 | + //setdiv(); | ||
88 | + setTimeout(function () { | ||
89 | + var datas = data.data | ||
90 | + console.log(datas) | ||
91 | + // var discountFee = datas.discountFee;//已优惠 | ||
92 | + // var discountDesc = datas.discountDesc;//已优惠 | ||
93 | + // var parkCode = datas.parkCode; | ||
94 | + // var no = datas.orderId;//.no;//订单id | ||
95 | + // var inparktime = datas.inparktime;//.inparktime;//进场时间 | ||
96 | + // var plateno = datas.plateno;//车牌号 | ||
97 | + // var parkName = datas.parkName;//停车场名称 | ||
98 | + // var staytime = datas.staytime;//停车时长 | ||
99 | + var due = datas.due;//总计费用 | ||
100 | + var unpaid = datas.unpaid;//待支付 | ||
101 | + // var paid = datas.paid;//实付 | ||
102 | + // var discountType = datas.discountType; | ||
103 | + // | ||
104 | + var discountFee; | ||
105 | + var discountDesc; | ||
106 | + if (datas.discountFee && datas.discountFee != '' && datas.discountFee != undefined) { | ||
107 | + discountFee = datas.discountFee;//已优惠 | ||
108 | + if (datas.discountDesc && datas.discountDesc != '' && datas.discountDesc != undefined) { | ||
109 | + discountDesc = datas.discountDesc;//已优惠 | ||
110 | + } | ||
111 | + } | ||
112 | + var _num = 1 | ||
113 | + var _paySrcType = 101 | ||
114 | + //console.log('-------------------------------'+discountType); | ||
115 | + //查询到车牌号订单信息 | ||
116 | + var src = 'monPay.html?carnum=' + carNumber | ||
117 | + // + "&inparktime=" + inparktime | ||
118 | + // + "&parkName=" + parkName | ||
119 | + // + "&staytime=" + staytime | ||
120 | + + "&due=" + due | ||
121 | + + "&unpaid=" + unpaid | ||
122 | + + "&num=" + _num | ||
123 | + // + "&paid=" + paid | ||
124 | + // + "&no=" + no | ||
125 | + + "&disfee=" + discountFee | ||
126 | + + "&disdesc=" + discountDesc | ||
127 | + + "&orderId=" + orderId | ||
128 | + + "&parkCode=" + parkCode | ||
129 | + + "&paySrcType=" + _paySrcType | ||
130 | + | ||
131 | + // + '&discountType=' + discountType | ||
132 | + // + '&parkCode=' + parkCode | ||
133 | + // + "&"; | ||
134 | + console.log(src) | ||
135 | + window.location.assign(encodeURI(src)) | ||
136 | + }, 100); | ||
137 | + } | ||
138 | + } | ||
139 | + ) | ||
140 | + }, | ||
141 | + queryArrearageSta: function () { | ||
142 | + // var salt = jsajax.salt(32); | ||
143 | + // var token = mUrl.GetToken(); | ||
144 | + | ||
145 | + var salt = jsajax.salt(32); | ||
146 | + var token = mUrl.GetToken(); | ||
147 | + if (token == null) { | ||
148 | + token = ''; | ||
149 | + } | ||
150 | + var list = "[" + fun.orderIds + "]" | ||
151 | + var orderlist = fun.orderIds | ||
152 | + var codes = "[" + fun.parkCodes + "]" | ||
153 | + var jsondata = { | ||
154 | + app_id: "0eca8f5373ca4866aec2f8e9d9367104", | ||
155 | + deviceInfo: "BC0703A4-AFB0-4B51-9089-9B7487C0CC6E", | ||
156 | + salt: salt, | ||
157 | + sign: fun.getMd5sign(), | ||
158 | + sign_type: "md5", | ||
159 | + token: token, | ||
160 | + appId: jsajax.appID, | ||
161 | + orderIds: list, | ||
162 | + terminalSource: '7', | ||
163 | + payType: 4, | ||
164 | + orgId: '10003', | ||
165 | + | ||
166 | + } | ||
167 | + console.log('查询单个的入参 ' + JSON.stringify(jsondata) + " 请求的接口" + mUrl.oneCardorder); | ||
168 | + jsajax.defaultReq( | ||
169 | + mUrl.queryArrearageSta, | ||
170 | + JSON.stringify(jsondata), | ||
171 | + function (data) { | ||
172 | + console.log('获取单个待支付订单 ' + JSON.stringify(data)); | ||
173 | + var datas = data.data.carArrearages[0] | ||
174 | + console.log(datas) | ||
175 | + | ||
176 | + setTimeout(function () { | ||
177 | + var discountFee = datas.arrearageDiscFee;//已优惠 | ||
178 | + var discountDesc = datas.discDesc;//已优惠 | ||
179 | + var carNumber = datas.carNumber; | ||
180 | + // var no = datas.orderId;//.no;//订单id | ||
181 | + // var inparktime = datas.inparktime;//.inparktime;//进场时间 | ||
182 | + // var plateno = datas.carNumber;//车牌号 | ||
183 | + // var parkName = datas.parkName;//停车场名称 | ||
184 | + // var staytime = datas.staytime;//停车时长 | ||
185 | + var due = datas.arrearageTotalFee;//总计费用 | ||
186 | + var unpaid = datas.arrearageActFee;//待支付 | ||
187 | + var paid = datas.arrearageActFee;//实付 | ||
188 | + var discountType = datas.discountType; | ||
189 | + | ||
190 | + if (datas.discountFee && datas.discountFee != '' && datas.discountFee != undefined) { | ||
191 | + discountFee = datas.discountFee;//已优惠 | ||
192 | + if (datas.discountDesc && datas.discountDesc != '' && datas.discountDesc != undefined) { | ||
193 | + discountDesc = datas.discountDesc;//已优惠 | ||
194 | + } | ||
195 | + } | ||
196 | + | ||
197 | + //console.log('-------------------------------'+discountType); | ||
198 | + | ||
199 | + var _num = datas.arrearageNum | ||
200 | + var _paySrcType = 103 | ||
201 | + | ||
202 | + //查询到车牌号订单信息 | ||
203 | + var src = 'monPay.html?carnum=' + carNumber | ||
204 | + // + "&inparktime=" + inparktime | ||
205 | + // + "&parkName=" + parkName | ||
206 | + // + "&staytime=" + staytime | ||
207 | + + "&due=" + due | ||
208 | + + "&unpaid=" + unpaid | ||
209 | + + "&paid=" + paid | ||
210 | + + "&num=" + _num | ||
211 | + // + "&no=" + no | ||
212 | + + "&disfee=" + discountFee | ||
213 | + + "&disdesc=" + discountDesc | ||
214 | + + "&orderId=" + orderlist | ||
215 | + // + '&discountType=' + discountType | ||
216 | + + '&parkCode=' + codes | ||
217 | + + "&paySrcType=" + _paySrcType | ||
218 | + console.log(src) | ||
219 | + window.location.assign(encodeURI(src)) | ||
220 | + }, 100); | ||
221 | + | ||
222 | + } | ||
223 | + ) | ||
224 | + }, | ||
225 | + getMd5sign: function () { | ||
226 | + var salt = jsajax.salt(32); | ||
227 | + var token = mUrl.GetToken(); | ||
228 | + if (token == null) { | ||
229 | + token = ''; | ||
230 | + } | ||
231 | + var sortd = [ | ||
232 | + { keyname: 'app_id', value: '0eca8f5373ca4866aec2f8e9d9367104' }, | ||
233 | + { keyname: 'deviceInfo', value: 'BC0703A4-AFB0-4B51-9089-9B7487C0CC6E' }, | ||
234 | + { keyname: 'salt', value: salt }, | ||
235 | + { keyname: 'sign_type', value: 'md5' }, | ||
236 | + { keyname: 'token', value: token } | ||
237 | + ]; | ||
238 | + var md5sign = jsajax.getsign(sortd); | ||
239 | + return md5sign; | ||
240 | + | ||
241 | + }, | ||
242 | + allMoney: 0, | ||
243 | + inData: [], //在场 | ||
244 | + outData: [], //离场 | ||
245 | + listData: [], | ||
246 | + selectLen: 0, | ||
247 | + orderIds: [], // 选中订单号数组 | ||
248 | + orderArr: [], | ||
249 | + parkCodes: [], | ||
250 | + parkCodeArr: [], | ||
251 | + selectedMon: 0,//选中了总金额 | ||
252 | + getQueryVariable: function (variable) { | ||
253 | + var query = window.location.search.substring(1); | ||
254 | + var vars = query.split("&"); | ||
255 | + for (var i = 0; i < vars.length; i++) { | ||
256 | + var pair = vars[i].split("="); | ||
257 | + if (pair[0] == variable) { | ||
258 | + return decodeURI(pair[1]); | ||
259 | + } | ||
260 | + } | ||
261 | + return (false); | ||
262 | + }, | ||
263 | + | ||
264 | + init: function () { | ||
265 | + console.log(fun.listData) | ||
266 | + fun.inData = fun.listData.filter(fun.checkIN) | ||
267 | + fun.outData = fun.listData.filter(fun.checkOUT) | ||
268 | + console.log(fun.inData) | ||
269 | + console.log(fun.outData) | ||
270 | + if (fun.inData.length > 0) { | ||
271 | + $('#pay-wrap').html('') | ||
272 | + // carNumber,parkCode,orderId | ||
273 | + $('#pay-wrap').attr('carNumber', fun.inData[0].carNumber) | ||
274 | + $('#pay-wrap').attr('parkCode', fun.inData[0].parkCode) | ||
275 | + $('#pay-wrap').attr('orderId', fun.inData[0].orderId) | ||
276 | + $('#pay-wrap').append('<div class="pay-header">\n' + | ||
277 | + ' <span>' + fun.inData[0].carNumber + '</span>\n' + | ||
278 | + ' <span>本次费用</span>\n' + | ||
279 | + ' </div>\n' + | ||
280 | + ' <div class="pay-body">\n' + | ||
281 | + ' <p>停车场名称:' + fun.inData[0].parkName + '</p>\n' + | ||
282 | + ' <p>进场时间:' + fun.inData[0].parkInTime + '</p>\n' + | ||
283 | + ' <p>出场时间:' + fun.inData[0].parkOutTime + '</p>\n' + | ||
284 | + ' <p>停车时长:' + fun.dateFormat(fun.inData[0].parkDuration) + '</p>\n' + | ||
285 | + ' <span class="pay-money">' + ((fun.inData[0].unPayFee) / 100).toFixed(2) + '元</span>\n' + | ||
286 | + ' </div>') | ||
287 | + } else { | ||
288 | + $('#pay-wrap').html('') | ||
289 | + $('#pay-wrap').append('<p style="height: 50px;line-height: 50px;text-align: center">无本次订单费用</p>') | ||
290 | + } | ||
291 | + | ||
292 | + if (fun.outData.length > 0) { | ||
293 | + $('#arrears-list').html('') | ||
294 | + for (var i = 0; i < fun.outData.length; i++) { | ||
295 | + var num = ((fun.outData[i].unPayFee) / 100).toFixed(2); | ||
296 | + console.log(fun.outData[i].unPayFee) | ||
297 | + fun.allMoney += Number(fun.outData[i].unPayFee) | ||
298 | + fun.orderArr.push(fun.outData[i].orderId) | ||
299 | + fun.parkCodeArr.push(fun.outData[i].parkcode) | ||
300 | + // console.log(fun.allMoney) | ||
301 | + $('#arrears-list').append('<li data-parkCode="' + fun.outData[i].parkCode + '" data-orderId="' + fun.outData[i].orderId + '" data-unPayFee="' + fun.outData[i].unPayFee + '">\n' + | ||
302 | + ' <div class="arrears-header">\n' + | ||
303 | + ' <span>' + fun.outData[i].carNumber + '</span>\n' + | ||
304 | + ' <span>欠费</span>\n' + | ||
305 | + ' </div>\n' + | ||
306 | + ' <div class="arrears-body">\n' + | ||
307 | + ' <p>停车场名称:' + fun.outData[i].parkName + '</p>\n' + | ||
308 | + ' <p>进场时间:' + fun.outData[i].parkInTime + '</p>\n' + | ||
309 | + ' <p>出场时间:' + fun.outData[i].parkOutTime + '</p>\n' + | ||
310 | + ' <p>停车时长:' + fun.dateFormat(fun.outData[i].parkDuration) + '</p>\n' + | ||
311 | + ' <span class="arrears-money">' + num + '元</span>\n' + | ||
312 | + ' </div>\n' + | ||
313 | + ' </li>') | ||
314 | + } | ||
315 | + $('#allMoneyWrap').text(((fun.allMoney) / 100).toFixed(2)) | ||
316 | + } else { | ||
317 | + $('#arrears-wrap').html('') | ||
318 | + $('#arrears-wrap').append('<p style="height: 50px;line-height: 50px;text-align: center">无历史欠费费用</p>') | ||
319 | + } | ||
320 | + }, | ||
321 | + _initData: function () { | ||
322 | + | ||
323 | + var _carNumber = fun.getQueryVariable('carNumber') | ||
324 | + console.log(_carNumber) | ||
325 | + | ||
326 | + /** | ||
327 | + * @param {} second | ||
328 | + * @return {} | ||
329 | + * @desc 秒转化成dd hh:mm:ss | ||
330 | + */ | ||
331 | + var salt = jsajax.salt(32); | ||
332 | + var sortd = [ | ||
333 | + { keyname: 'app_id', value: '0eca8f5373ca4866aec2f8e9d9367104' }, | ||
334 | + { keyname: 'deviceInfo', value: 'BC0703A4-AFB0-4B51-9089-9B7487C0CC6E' }, | ||
335 | + { keyname: 'salt', value: salt }, | ||
336 | + { keyname: 'sign_type', value: 'md5' }, | ||
337 | + { keyname: 'token', value: '8957e613280b46f7ae8aaea71ed17353' }, | ||
338 | + { keyname: 'pageNum', value: 1 }, | ||
339 | + { keyname: 'pageSize', value: 10 }, | ||
340 | + { keyname: 'parkState', value: 10 }, | ||
341 | + { keyname: 'terminalSource', value: 7 }, | ||
342 | + { keyname: 'carNumber', value: _carNumber } | ||
343 | + ]; | ||
344 | + var md5sign = jsajax.getsign(sortd); | ||
345 | + var jsondata = { | ||
346 | + app_id: "0eca8f5373ca4866aec2f8e9d9367104", | ||
347 | + deviceInfo: "BC0703A4-AFB0-4B51-9089-9B7487C0CC6E", | ||
348 | + salt: salt, | ||
349 | + sign_type: "md5", | ||
350 | + token: '8957e613280b46f7ae8aaea71ed17353', | ||
351 | + pageNum: 1, | ||
352 | + pageSize: 10, | ||
353 | + parkState: 10, | ||
354 | + terminalSource: 7, | ||
355 | + carNumber: _carNumber, | ||
356 | + sign: md5sign | ||
357 | + } | ||
358 | + console.log('停车记录传参 ' + JSON.stringify(jsondata)); | ||
359 | + jsajax.defaultReq( | ||
360 | + mUrl.listServer, | ||
361 | + JSON.stringify(jsondata), | ||
362 | + function (data) { | ||
363 | + console.log(data.data.dataList) | ||
364 | + | ||
365 | + var data = data.data.dataList; | ||
366 | + if (data.length == 0) { | ||
367 | + $('#tip-title').text('您的停车费用为0元,无须缴费,谢谢!') | ||
368 | + return | ||
369 | + } else { | ||
370 | + fun.listData = data | ||
371 | + fun.init()// 初始化 | ||
372 | + } | ||
373 | + | ||
374 | + }) | ||
375 | + | ||
376 | + } | ||
377 | +} | ||
378 | +fun._initData() | ||
379 | + | ||
380 | +//......................... Tab 切换 | ||
381 | +$('#tab-wrap li').on('click', function () { | ||
382 | + var _index = $(this).index() | ||
383 | + $(this).addClass('active').siblings().removeClass('active') | ||
384 | + $('#tab-main>div').eq(_index).show().siblings().hide() | ||
385 | +}) | ||
386 | + | ||
387 | +//......................... 全选 | ||
388 | +$('#check-btn').on('click', function () { | ||
389 | + if ($(this).hasClass('checkedActive')) { | ||
390 | + $('#listLen').text('0') | ||
391 | + $('#listMon').text('¥ 0.00') | ||
392 | + $('#arrears-list li').removeClass('active') | ||
393 | + fun.selectLen = 0 | ||
394 | + fun.selectedMon = 0 | ||
395 | + fun.orderIds = [] | ||
396 | + fun.parkCodes = [] | ||
397 | + } else { | ||
398 | + $('#listLen').text(fun.outData.length) | ||
399 | + $('#listMon').text('¥ ' + ((fun.allMoney) / 100).toFixed(2)) | ||
400 | + $('#arrears-list li').addClass('active') | ||
401 | + fun.selectLen = fun.outData.length | ||
402 | + fun.selectedMon = fun.allMoney | ||
403 | + fun.orderIds = fun.orderArr | ||
404 | + fun.parkCodes = fun.parkCodeArr | ||
405 | + } | ||
406 | + $(this).toggleClass('checkedActive') | ||
407 | +}) | ||
408 | + | ||
409 | +//......................... 单个选择操作 | ||
410 | +$('#arrears-list').delegate('li','click', function () { | ||
411 | + var mon = $(this).attr('data-unpayfee') | ||
412 | + var orderid = $(this).attr('data-orderid') | ||
413 | + var parkcode = $(this).attr('data-parkcode') | ||
414 | + if ($(this).hasClass('active')) { | ||
415 | + $('#check-btn').removeClass('checkedActive') //去掉全选 | ||
416 | + // 总结现在已经选中了那些 | ||
417 | + var _index = fun.orderIds.indexOf(orderid) | ||
418 | + fun.orderIds = fun.orderIds.filter(function (i) { | ||
419 | + return i !== orderid | ||
420 | + }) | ||
421 | + | ||
422 | + var _index = fun.parkCodes.indexOf(parkcode) | ||
423 | + fun.parkCodes = fun.parkCodes.filter(function (i) { | ||
424 | + return i !== orderid | ||
425 | + }) | ||
426 | + fun.selectLen-- | ||
427 | + fun.selectedMon = fun.selectedMon - mon | ||
428 | + $('#listLen').text(fun.selectLen) | ||
429 | + $('#listMon').text('¥ ' + ((fun.selectedMon) / 100).toFixed(2)) | ||
430 | + } else { | ||
431 | + fun.orderIds.push(orderid) | ||
432 | + fun.parkCodes.push(parkcode) | ||
433 | + fun.selectLen++ | ||
434 | + if (fun.selectLen == fun.outData.length) { | ||
435 | + $('#check-btn').addClass('checkedActive') //全选了 | ||
436 | + } | ||
437 | + fun.selectedMon = Number(fun.selectedMon) + Number(mon) | ||
438 | + $('#listLen').text(fun.selectLen) | ||
439 | + $('#listMon').text('¥ ' + ((fun.selectedMon) / 100).toFixed(2)) | ||
440 | + //总结选择了那些 | ||
441 | + | ||
442 | + } | ||
443 | + $(this).toggleClass('active') | ||
444 | +}) | ||
445 | + | ||
446 | +//......................... 本次费用 | ||
447 | +$('#pay-wrap').on('click', function () { | ||
448 | + var carNumber = $(this).attr('carNumber') | ||
449 | + var parkCode = $(this).attr('parkCode') | ||
450 | + var orderId = $(this).attr('orderId') | ||
451 | + fun.getOneorder(carNumber, parkCode, orderId, parkCode) | ||
452 | +}) | ||
453 | + | ||
454 | +//......................... 历史欠费 | ||
455 | + | ||
456 | +$('#opr-btn').on('click', function () { | ||
457 | + | ||
458 | + if (fun.orderIds.length == 0) { | ||
459 | + return | ||
460 | + } else { | ||
461 | + fun.queryArrearageSta() | ||
462 | + } | ||
463 | + | ||
464 | +}) | ||
465 | + | ||
466 | + | ||
467 | + |
js/url.js
@@ -111,6 +111,9 @@ mUrl.tcwxpay = cepath+ '/weixinpay/publicUnifiedOrder';//修改 添加字段 | @@ -111,6 +111,9 @@ mUrl.tcwxpay = cepath+ '/weixinpay/publicUnifiedOrder';//修改 添加字段 | ||
111 | mUrl.SelectCar = cepath +'/user/queryUserCars';//车辆信息查询(查看是否绑定车牌号)无用 | 111 | mUrl.SelectCar = cepath +'/user/queryUserCars';//车辆信息查询(查看是否绑定车牌号)无用 |
112 | mUrl.SelectOrder = cepath +'/query/queryOrderByCarNumbers';//查询订单 (查询待支付订单)//无用 | 112 | mUrl.SelectOrder = cepath +'/query/queryOrderByCarNumbers';//查询订单 (查询待支付订单)//无用 |
113 | 113 | ||
114 | + | ||
115 | +mUrl.queryArrearageSta = cepath + '/queryParkOrder/queryArrearageStaForWXPublc';// | ||
116 | + | ||
114 | /*----------------------支付页面所需接口 end*/ | 117 | /*----------------------支付页面所需接口 end*/ |
115 | 118 | ||
116 | /*----------------------停车场接口 start*/ | 119 | /*----------------------停车场接口 start*/ |
js/wxpayResult.js
0 → 100644
1 | + | ||
2 | +window.onload = function () { | ||
3 | + var tmpParams = getQueryString(window.location); | ||
4 | + if (tmpParams != null) { | ||
5 | + console.log(JSON.stringify(tmpParams)); | ||
6 | + if (tmpParams.trade_no == "success") { | ||
7 | + getResponse("success"); | ||
8 | + } else { | ||
9 | + getResponse("fail"); | ||
10 | + } | ||
11 | + //alertMsg("支付返回参数:" + JSON.stringify(tmpParams)); | ||
12 | + } else { | ||
13 | + console.log("支付返回参数" + tmpParams); | ||
14 | + } | ||
15 | +} | ||
16 | + | ||
17 | +//type[fail、sucesss] | ||
18 | +function getResponse(type) { | ||
19 | + var img = document.getElementById("stateImg"); | ||
20 | + var label = document.getElementById("stateLable"); | ||
21 | + if (type == "fail") { | ||
22 | + img.src = "img/no.png"; | ||
23 | + label.innerHTML = "支付失败,尝试重新扫码"; | ||
24 | + setTimeout(function () { | ||
25 | + alert('1') | ||
26 | + | ||
27 | + if (navigator.userAgent.indexOf("MSIE") > 0) { | ||
28 | + if (navigator.userAgent.indexOf("MSIE 6.0") > 0) { | ||
29 | + window.opener = null; | ||
30 | + window.close(); | ||
31 | + } | ||
32 | + else { | ||
33 | + window.open('', '_top'); | ||
34 | + window.top.close(); | ||
35 | + } | ||
36 | + } | ||
37 | + else if (navigator.userAgent.indexOf("Firefox") > 0) { | ||
38 | + window.location.href = 'about:blank '; //火狐默认状态非window.open的页面window.close是无效的 | ||
39 | + //window.history.go(-2); | ||
40 | + } | ||
41 | + else { | ||
42 | + window.opener = null; | ||
43 | + window.open('', '_self', ''); | ||
44 | + window.close(); | ||
45 | + } | ||
46 | + }, 2000) | ||
47 | + } else { | ||
48 | + img.src = "img/ok.png"; | ||
49 | + label.innerHTML = "订单支付成功"; | ||
50 | + setTimeout(function () { | ||
51 | + if (navigator.userAgent.indexOf("MSIE") > 0) { | ||
52 | + if (navigator.userAgent.indexOf("MSIE 6.0") > 0) { | ||
53 | + window.opener = null; | ||
54 | + window.close(); | ||
55 | + } | ||
56 | + else { | ||
57 | + window.open('', '_top'); | ||
58 | + window.top.close(); | ||
59 | + } | ||
60 | + } | ||
61 | + else if (navigator.userAgent.indexOf("Firefox") > 0) { | ||
62 | + window.location.href = 'about:blank '; //火狐默认状态非window.open的页面window.close是无效的 | ||
63 | + //window.history.go(-2); | ||
64 | + } | ||
65 | + else { | ||
66 | + window.opener = null; | ||
67 | + window.open('', '_self', ''); | ||
68 | + window.close(); | ||
69 | + } | ||
70 | + }, 2000) | ||
71 | + } | ||
72 | +} |
list.html
@@ -20,6 +20,7 @@ | @@ -20,6 +20,7 @@ | ||
20 | <link rel="stylesheet" href="//cdn.bootcss.com/weui/1.1.1/style/weui.min.css"> | 20 | <link rel="stylesheet" href="//cdn.bootcss.com/weui/1.1.1/style/weui.min.css"> |
21 | <link rel="stylesheet" href="//cdn.bootcss.com/jquery-weui/1.0.1/css/jquery-weui.min.css"> | 21 | <link rel="stylesheet" href="//cdn.bootcss.com/jquery-weui/1.0.1/css/jquery-weui.min.css"> |
22 | <link rel="stylesheet" href="css/reset.css"> | 22 | <link rel="stylesheet" href="css/reset.css"> |
23 | + <link rel="stylesheet" href="css/list.css"> | ||
23 | 24 | ||
24 | <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/Swiper/5.4.5/css/swiper.css"> | 25 | <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/Swiper/5.4.5/css/swiper.css"> |
25 | <!-- <link rel="stylesheet" href="https://unpkg.com/swiper/css/swiper.min.css"> --> | 26 | <!-- <link rel="stylesheet" href="https://unpkg.com/swiper/css/swiper.min.css"> --> |
@@ -27,217 +28,7 @@ | @@ -27,217 +28,7 @@ | ||
27 | <script src="https://cdn.bootcdn.net/ajax/libs/Swiper/5.4.5/js/swiper.js"></script> | 28 | <script src="https://cdn.bootcdn.net/ajax/libs/Swiper/5.4.5/js/swiper.js"></script> |
28 | 29 | ||
29 | <style> | 30 | <style> |
30 | - .all_told, .platen_number { | ||
31 | - text-align: center; | ||
32 | - } | ||
33 | - .all_told { | ||
34 | - padding: 30px 0 10px 0; | ||
35 | - } | ||
36 | - .all_told span { | ||
37 | - margin-right: 5px; | ||
38 | - font-size: 22px; | ||
39 | - } | ||
40 | - .discount_money { | ||
41 | - color: #fc3817; | ||
42 | - } | ||
43 | - .discount { | ||
44 | - padding: 4px 7px; | ||
45 | - background: #fc3817; | ||
46 | - border-radius: 2px; | ||
47 | - position: relative; | ||
48 | - margin-left: 10px; | ||
49 | - color: #fff; | ||
50 | - } | ||
51 | - .discount:before { | ||
52 | - position: absolute; | ||
53 | - content: ''; | ||
54 | - width: 0; | ||
55 | - height: 0; | ||
56 | - left: -6px; | ||
57 | - top: 8px; | ||
58 | - border-top: 6px solid transparent; | ||
59 | - border-bottom: 6px solid transparent; | ||
60 | - border-right: 6px solid #fc3817; | ||
61 | - } | ||
62 | - .youhuid{ | ||
63 | - background: #f00; | ||
64 | - color: #fff; | ||
65 | - font-size: 13px; | ||
66 | - padding:2px 5px; | ||
67 | - border-radius: 3px; | ||
68 | - margin-left: 2px; | ||
69 | - display: none; | ||
70 | - } | ||
71 | - .showTooltips{ | ||
72 | - display: none; | ||
73 | - /*针对苹果新增手势*/ | ||
74 | - cursor: pointer; | ||
75 | - } | ||
76 | - .weui-cells{ | ||
77 | - /*针对苹果新增手势*/ | ||
78 | - cursor: pointer; | ||
79 | - } | ||
80 | - .dialog-out{ | ||
81 | - position: absolute; | ||
82 | - width: 100%; | ||
83 | - height: 100%; | ||
84 | - top:0; | ||
85 | - right: 0; | ||
86 | - left: 0; | ||
87 | - bottom: 0; | ||
88 | - z-index: 1000; | ||
89 | - background: rgba(0,0,0,.3); | ||
90 | - display: none; | ||
91 | - } | ||
92 | - .dia-con{ | ||
93 | - width: 305px; | ||
94 | - height: 138px; | ||
95 | - padding: 10px ; | ||
96 | - background:rgba(255,255,255,1); | ||
97 | - border-radius:8px; | ||
98 | - position: absolute; | ||
99 | - left: 50%; | ||
100 | - top:50%; | ||
101 | - transform: translate(-50%,-50%); | ||
102 | - } | ||
103 | - .close-btn{ | ||
104 | - float: right; | ||
105 | - width: 16px; | ||
106 | - height: 16px; | ||
107 | - background: url("img/close.png") no-repeat; | ||
108 | - background-size: 100% 100%; | ||
109 | - cursor: pointer; | ||
110 | - overflow: hidden; | ||
111 | - } | ||
112 | - .dia-main{ | ||
113 | - margin-left: 30px; | ||
114 | - margin-top: 30px; | ||
115 | - height: 52px; | ||
116 | - padding-left: 90px; | ||
117 | - background: url("img/out.png") no-repeat; | ||
118 | - background-size: 52px 52px; | ||
119 | - } | ||
120 | - .dia-text{ | ||
121 | - padding-top: 20px; | ||
122 | - text-align: center; | ||
123 | - font-size: 12px; | ||
124 | - color: #999; | ||
125 | - } | ||
126 | - .arrears-btn{ | ||
127 | - width: 70px; | ||
128 | - height: 25px; | ||
129 | - margin-top: 20px; | ||
130 | - color: #FFF; | ||
131 | - font-size: 12px; | ||
132 | - text-align: center; | ||
133 | - line-height: 25px; | ||
134 | - background: url("img/arrears-bg.png") no-repeat; | ||
135 | - background-size:70px 25px ; | ||
136 | - } | ||
137 | 31 | ||
138 | - .strTip{ | ||
139 | - width: 100%; | ||
140 | - height: 100%; | ||
141 | - text-align: center; | ||
142 | - font-size: 20px; | ||
143 | - background: rgba(9,9,9,.5); | ||
144 | - position: fixed; | ||
145 | - top:0; | ||
146 | - left: 0; | ||
147 | - } | ||
148 | - .strWrap{ | ||
149 | - margin: 20px auto 0; | ||
150 | - width: 330px; | ||
151 | - height: 431px; | ||
152 | - background: #FFFFFF; | ||
153 | - border-radius: 8px; | ||
154 | - overflow: hidden; | ||
155 | - } | ||
156 | - .strCon{ | ||
157 | - text-align: center; | ||
158 | - font-size: 20px; | ||
159 | - color: #333; | ||
160 | - text-align: center; | ||
161 | - } | ||
162 | - .header-title{ | ||
163 | - padding: 15px 0; | ||
164 | - font-size: 14px; | ||
165 | - font-weight: 600; | ||
166 | - border-bottom:1px solid #ccc ; | ||
167 | - color: #333; | ||
168 | - } | ||
169 | - .payCarNum{ | ||
170 | - font-size: 16px; | ||
171 | - color: #D40202; | ||
172 | - } | ||
173 | - .btn{ | ||
174 | - color: #fff; | ||
175 | - font-size: 20px; | ||
176 | - | ||
177 | - height: 40px; | ||
178 | - line-height: 40px; | ||
179 | - border-radius: 8px; | ||
180 | - cursor: pointer; | ||
181 | - } | ||
182 | - .hiddenBtn{ | ||
183 | - background: #79cbbf; | ||
184 | - } | ||
185 | - /*.outBtn{*/ | ||
186 | - /*background: #509f93;*/ | ||
187 | - /*}*/ | ||
188 | - .tipTitle{ | ||
189 | - /*background: url("img/tipTitle.png") no-repeat 0 center;*/ | ||
190 | - margin-top: 20px; | ||
191 | - font-size: 14px; | ||
192 | - text-align: center; | ||
193 | - font-weight: 500; | ||
194 | - color: #333333; | ||
195 | - line-height: 20px; | ||
196 | - } | ||
197 | - .carNum{ | ||
198 | - width: 270px; | ||
199 | - height: 80px; | ||
200 | - margin: 20px auto; | ||
201 | - font-size: 24px; | ||
202 | - font-family: PingFang-SC-Medium, PingFang-SC; | ||
203 | - font-weight: 500; | ||
204 | - color: #FFFFFF; | ||
205 | - text-align: center; | ||
206 | - line-height: 80px; | ||
207 | - background: url("img/carNum.png") no-repeat; | ||
208 | - } | ||
209 | - .carNumYellow{ | ||
210 | - background: url("img/carNumYellow.png") no-repeat; | ||
211 | - } | ||
212 | - | ||
213 | - .toPay{ | ||
214 | - width: 270px; | ||
215 | - height: 45px; | ||
216 | - line-height: 45px; | ||
217 | - text-align: center; | ||
218 | - margin: 0 auto; | ||
219 | - font-size: 16px; | ||
220 | - font-family: PingFang-SC-Medium, PingFang-SC; | ||
221 | - font-weight: 500; | ||
222 | - color: #333333; | ||
223 | - background: url("img/topay.png") no-repeat; | ||
224 | - cursor: pointer; | ||
225 | - } | ||
226 | - .toSelect{ | ||
227 | - width: 270px; | ||
228 | - margin: 20px auto 0; | ||
229 | - text-align: right; | ||
230 | - font-size: 12px; | ||
231 | - font-family: PingFang-SC-Medium, PingFang-SC; | ||
232 | - font-weight: 500; | ||
233 | - color: #333333; | ||
234 | - cursor: pointer; | ||
235 | - } | ||
236 | - .swiper-container { | ||
237 | - width: 100%; | ||
238 | - height: 165px; | ||
239 | - | ||
240 | - } | ||
241 | 32 | ||
242 | </style> | 33 | </style> |
243 | </head> | 34 | </head> |
@@ -311,8 +102,8 @@ | @@ -311,8 +102,8 @@ | ||
311 | 102 | ||
312 | <script src="js/md5.min.js"></script> | 103 | <script src="js/md5.min.js"></script> |
313 | 104 | ||
314 | -<script src="js/url.js?u=2.1111"></script> | ||
315 | -<script src="js/ajax.js"></script> | 105 | +<script src="js/url.js?a=123"></script> |
106 | +<script src="js/ajax.js?a=123"></script> | ||
316 | <script type="text/javascript"> | 107 | <script type="text/javascript"> |
317 | //微信浏览器中,aler弹框不显示域名 | 108 | //微信浏览器中,aler弹框不显示域名 |
318 | (function(){ | 109 | (function(){ |
monPay.html
0 → 100644
1 | +<!doctype html> | ||
2 | +<html lang="en"> | ||
3 | +<head> | ||
4 | + <meta charset="utf-8"> | ||
5 | + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
6 | + <meta name="theme-color" content="#000000"> | ||
7 | + <meta name="google" value="notranslate"> | ||
8 | + <meta name="format-detection" content="telephone=no"> | ||
9 | + <meta name="format-detection" content="email=no"> | ||
10 | + <meta name="apple-mobile-web-app-capable" content="yes"> | ||
11 | + <meta name="apple-mobile-web-app-status-bar-style" content="black"> | ||
12 | + <meta http-equiv="Pragma" content="no-cache"> | ||
13 | + <meta http-equiv="Cache-control" content="no-cache"> | ||
14 | + <meta http-equiv="Cache" content="no-cache"> | ||
15 | + <meta http-equiv="Expires" content="0"> | ||
16 | + <link rel="stylesheet" href="//cdn.bootcss.com/weui/1.1.1/style/weui.min.css"> | ||
17 | + <link rel="stylesheet" href="//cdn.bootcss.com/jquery-weui/1.0.1/css/jquery-weui.min.css"> | ||
18 | + <link rel="stylesheet" href="css/reset.css?v=0.1"> | ||
19 | + <link rel="stylesheet" href="css/monPay.css"> | ||
20 | + <title>订单支付</title> | ||
21 | + | ||
22 | +</head> | ||
23 | +<body> | ||
24 | +<!--<noscript>--> | ||
25 | +<!--You need to enable JavaScript to run this app.--> | ||
26 | +<!--</noscript>--> | ||
27 | + | ||
28 | +<!--<div class="row marginTop">--> | ||
29 | +<!--<div style="overflow: hidden">--> | ||
30 | +<!--<input class="discountBox" id="discountBox" type="text" placeholder="请输入优惠券编号" maxlength="20">--> | ||
31 | +<!--<button class="discountBtn" id="discountBtn">兑换</button>--> | ||
32 | +<!--</div>--> | ||
33 | +<!--<div class="discount-tip" id="discountTip"></div>--> | ||
34 | +<!--</div>--> | ||
35 | + | ||
36 | + | ||
37 | +<div class="weui-cells"> | ||
38 | + <div class="weui-cell"> | ||
39 | + <div class="weui-cell__bd"> | ||
40 | + <p>车牌号码</p> | ||
41 | + </div> | ||
42 | + <div class="weui-cell__ft" id="carnum"></div> | ||
43 | + </div> | ||
44 | + | ||
45 | + <div class="weui-cell"> | ||
46 | + <div class="weui-cell__bd"> | ||
47 | + <p>待缴笔数</p> | ||
48 | + </div> | ||
49 | + <div class="weui-cell__ft" id="monNum"></div> | ||
50 | + </div> | ||
51 | + | ||
52 | + <div class="weui-cell"> | ||
53 | + <div class="weui-cell__bd"> | ||
54 | + <p>待缴费用</p> | ||
55 | + </div> | ||
56 | + <div class="weui-cell__ft" id="allMon"></div> | ||
57 | + </div> | ||
58 | + | ||
59 | + <div class="weui-cell"> | ||
60 | + <div class="weui-cell__bd"> | ||
61 | + <p>优惠金额</p> | ||
62 | + </div> | ||
63 | + <div class="weui-cell__ft" id="disfee"></div> | ||
64 | + </div> | ||
65 | + | ||
66 | + | ||
67 | + <div class="weui-cell"> | ||
68 | + <div class="weui-cell__bd"> | ||
69 | + <p>应付金额</p> | ||
70 | + </div> | ||
71 | + <div class="weui-cell__ft" id="unpaid"></div> | ||
72 | + </div> | ||
73 | +</div> | ||
74 | + | ||
75 | + | ||
76 | +<section id="section" class="marginTop"> | ||
77 | + <div class="flexBoxRow" > | ||
78 | + <span class="payWayTitle" style="padding-left: 10px;">选择支付方式</span> | ||
79 | + </div> | ||
80 | + <div class="row marginTop"> | ||
81 | + <!--AliPay--> | ||
82 | + <div class="flexBoxRow" id="rowAliPay"> | ||
83 | + <img class="payIcon" src="img/aliPay.png" /> | ||
84 | + <span class="marginLeft">支付宝支付</span> | ||
85 | + <label for="aliPay" class="radio"> | ||
86 | + <span class="radio-bg"></span> | ||
87 | + <input type="radio" name="radioPayWay" id="aliPay" value="支付宝" checked="checked" /> | ||
88 | + <span class="radio-on"></span> | ||
89 | + </label> | ||
90 | + </div> | ||
91 | + <hr class="splitLine marginTop" id="splitLine" /> | ||
92 | + <!--WxPay--> | ||
93 | + <div class="flexBoxRow marginTop" id="rowWxPay"> | ||
94 | + <img class="payIcon" src="img/wxPay.png" /> | ||
95 | + <span class="marginLeft">微信支付</span> | ||
96 | + <label for="wxPay" class="radio"> | ||
97 | + <span class="radio-bg"></span> | ||
98 | + <input type="radio" name="radioPayWay" id="wxPay" value="微信" /> | ||
99 | + <span class="radio-on"></span> | ||
100 | + </label> | ||
101 | + </div> | ||
102 | + </div> | ||
103 | +</section> | ||
104 | +<footer id="footer" class="flexBoxRow marginTop"> | ||
105 | + <div class="btnOK" id="btnPayOK">确定支付</div> | ||
106 | + <img src="img/loading.gif" id="loading" style="display: none;" /> | ||
107 | +</footer> | ||
108 | +<section id="payTip" style="padding: 10px;margin-top:5px; color: #3385ff; font-size: 14px; "></section> | ||
109 | +<div class="paySuccess" id="paySuccess" >支付成功,请立即离场</div> | ||
110 | + | ||
111 | + | ||
112 | + | ||
113 | +<script src="js/jquery-3.2.1.min.js"></script> | ||
114 | +<script src="//cdn.bootcss.com/jquery-weui/1.0.1/js/jquery-weui.min.js"></script> | ||
115 | +<script src="js/config.js?a=123"></script> | ||
116 | +<script src="js/common.js?f=3.51"></script> | ||
117 | +<!--<script src="js/jweixin-1.0.0.js?v=0.1"></script>--> | ||
118 | +<script src="js/monPay.js?b=551.5120"></script> | ||
119 | +</body> | ||
120 | + | ||
121 | +</html> |
out.html
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | <meta http-equiv="Expires" content="0"> | 15 | <meta http-equiv="Expires" content="0"> |
16 | <link rel="stylesheet" href="css/reset.css?v=0.1"> | 16 | <link rel="stylesheet" href="css/reset.css?v=0.1"> |
17 | <link rel="stylesheet" href="css/provinceKey.css?v=0.1"> | 17 | <link rel="stylesheet" href="css/provinceKey.css?v=0.1"> |
18 | - <script src="js/config.js?b=111"></script> | 18 | + <script src="js/config.js?a=123"></script> |
19 | <script src="js/common.js?i=1.01"></script> | 19 | <script src="js/common.js?i=1.01"></script> |
20 | <!-- | 20 | <!-- |
21 | Notice the use of %PUBLIC_URL% in the tags above. | 21 | Notice the use of %PUBLIC_URL% in the tags above. |
@@ -215,7 +215,7 @@ function init() { | @@ -215,7 +215,7 @@ function init() { | ||
215 | } | 215 | } |
216 | //点击查询订单 | 216 | //点击查询订单 |
217 | function btnOkClick() { | 217 | function btnOkClick() { |
218 | - window.location.href = "listnew.html?carNumber=" + getCarNumber(); | 218 | + window.location.href = "paybacknew.html?carNumber=" + getCarNumber(); |
219 | 219 | ||
220 | // //var phoneNum = document.getElementById("inputPhoneNum").value.replace(/\s*/g, "");//去除空格 | 220 | // //var phoneNum = document.getElementById("inputPhoneNum").value.replace(/\s*/g, "");//去除空格 |
221 | // if (queryParams == null) { | 221 | // if (queryParams == null) { |
@@ -251,7 +251,7 @@ function getRequest(url, params, init) { | @@ -251,7 +251,7 @@ function getRequest(url, params, init) { | ||
251 | if (tmpObj.needPay) { | 251 | if (tmpObj.needPay) { |
252 | var queryParams = parseParams(tmpObj); | 252 | var queryParams = parseParams(tmpObj); |
253 | console.log(tmpObj) | 253 | console.log(tmpObj) |
254 | - window.location.href = "../listnew.html?carNumber" + queryParams; | 254 | + window.location.href = "paybacknew.html?carNumber" + queryParams; |
255 | } else { | 255 | } else { |
256 | var tipStr = "无需缴费,欢迎下次光临"; | 256 | var tipStr = "无需缴费,欢迎下次光临"; |
257 | sucessTip(tipStr); alertMsg(tipStr); | 257 | sucessTip(tipStr); alertMsg(tipStr); |
paybacknew.html
0 → 100644
1 | +<!DOCTYPE html> | ||
2 | +<html lang="en"> | ||
3 | +<head> | ||
4 | + <meta charset="UTF-8"> | ||
5 | + <title>列表详情</title> | ||
6 | + <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> | ||
7 | + <meta name="format-detection" content="telephone=no"/> | ||
8 | + <meta name="format-detection" content="email=no"/> | ||
9 | + <meta name="apple-mobile-web-app-status-bar-style" content="black"/> | ||
10 | + <meta name="apple-mobile-web-app-capable" content="yes"/> | ||
11 | + <meta name="apple-mobile-web-app-title" content=""> | ||
12 | + <meta name="google" value="notranslate"><!-- 禁止Chrome 浏览器中自动提示翻译 --> | ||
13 | + <link rel="apple-touch-icon-precomposed" href="favicon.ico"> | ||
14 | + <link rel="shortcut icon" href="favicon.ico"> | ||
15 | + <link rel="Bookmark" href="favicon.ico"> | ||
16 | + <meta http-equiv="Pragma" content="no-cache" /> | ||
17 | + | ||
18 | + <meta http-equiv="Expires" content="0" /> | ||
19 | + | ||
20 | + <link rel="stylesheet" href="//cdn.bootcss.com/weui/1.1.1/style/weui.min.css"> | ||
21 | + <link rel="stylesheet" href="//cdn.bootcss.com/jquery-weui/1.0.1/css/jquery-weui.min.css"> | ||
22 | + <link rel="stylesheet" href="css/reset.css"> | ||
23 | + <link rel="stylesheet" href="css/paybacknew.css"> | ||
24 | + | ||
25 | + | ||
26 | +</head> | ||
27 | +<body ontouchstart=""> | ||
28 | + | ||
29 | +<ul class="tab-wrap" id="tab-wrap"> | ||
30 | + <li class="active"> | ||
31 | + <span >在停缴费</span> | ||
32 | + </li> | ||
33 | + <li> | ||
34 | + <span>离场待缴</span> | ||
35 | + </li> | ||
36 | +</ul> | ||
37 | + | ||
38 | +<div class="tab-main" id="tab-main"> | ||
39 | + | ||
40 | + <div class="pay-wrap" id="pay-wrap"> | ||
41 | + <!--<div class="pay-header">--> | ||
42 | + <!--<span>蒙D1231</span>--> | ||
43 | + <!--<span>本次费用</span>--> | ||
44 | + <!--</div>--> | ||
45 | + <!--<div class="pay-body">--> | ||
46 | + <!--<p>停车场名称:金方酒店</p>--> | ||
47 | + <!--<p>进场时间:2020-10-13 10:31:58</p>--> | ||
48 | + <!--<p>出场时间:2020-10-13 10:31:58</p>--> | ||
49 | + <!--<p>停车时长:29分钟41秒</p>--> | ||
50 | + <!--<span class="pay-money">3.00元</span>--> | ||
51 | + <!--</div>--> | ||
52 | + </div> | ||
53 | + | ||
54 | + <div class="arrears-wrap" id="arrears-wrap"> | ||
55 | + <div class="allMoneyWrap"> | ||
56 | + 总欠费金额:<span>¥</span><span id="allMoneyWrap">0</span> | ||
57 | + </div> | ||
58 | + | ||
59 | + <ul class="arrears-list" id="arrears-list"> | ||
60 | + <!--<li>--> | ||
61 | + <!--<div class="arrears-header">--> | ||
62 | + <!--<span>蒙D1231</span>--> | ||
63 | + <!--<span>欠费</span>--> | ||
64 | + <!--</div>--> | ||
65 | + <!--<div class="arrears-body">--> | ||
66 | + <!--<p>停车场名称:金方酒店</p>--> | ||
67 | + <!--<p>进场时间:2020-10-13 10:31:58</p>--> | ||
68 | + <!--<p>出场时间:2020-10-13 10:31:58</p>--> | ||
69 | + <!--<p>停车时长:29分钟41秒</p>--> | ||
70 | + <!--<span class="arrears-money">3.00元</span>--> | ||
71 | + <!--</div>--> | ||
72 | + <!--</li>--> | ||
73 | + | ||
74 | + </ul> | ||
75 | + | ||
76 | + <div class="arrears-statistics"> | ||
77 | + <div class="statistics-title"> | ||
78 | + 您已选中<span id="listLen">0</span>笔待缴订单 | ||
79 | + 合计: <span id="listMon">¥ 0.00</span> | ||
80 | + </div> | ||
81 | + | ||
82 | + <div class="statistics-opr"> | ||
83 | + <span class="check-btn" id="check-btn">全选</span> | ||
84 | + <span class="opr-btn" id="opr-btn">清缴所选欠费</span> | ||
85 | + </div> | ||
86 | + </div> | ||
87 | + </div> | ||
88 | + | ||
89 | +</div> | ||
90 | + | ||
91 | + | ||
92 | + | ||
93 | + | ||
94 | + | ||
95 | +<script src="js/jquery-3.2.1.min.js"></script> | ||
96 | +<script src="//cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script> | ||
97 | +<script src="//cdn.bootcss.com/jquery-weui/1.0.1/js/jquery-weui.min.js"></script> | ||
98 | + | ||
99 | +<script src="js/md5.min.js"></script> | ||
100 | + | ||
101 | +<script src="js/url.js?a=123"></script> | ||
102 | +<script src="js/ajax.js?a=123"></script> | ||
103 | +<script type="text/javascript"> | ||
104 | +//微信浏览器中,aler弹框不显示域名 | ||
105 | +(function(){ | ||
106 | + //先判断是否为微信浏览器 | ||
107 | + var ua = window.navigator.userAgent.toLowerCase(); | ||
108 | + if (ua.match(/MicroMessenger/i) == 'micromessenger') { | ||
109 | + //重写alert方法,alert()方法重写,不能传多余参数 | ||
110 | + window.alert = function(name){ | ||
111 | + var iframe = document.createElement("IFRAME"); | ||
112 | + iframe.style.display="none"; | ||
113 | + iframe.setAttribute("src", 'data:text/plain'); | ||
114 | + document.documentElement.appendChild(iframe); | ||
115 | + window.frames[0].window.alert(name); | ||
116 | + iframe.parentNode.removeChild(iframe); | ||
117 | + } | ||
118 | + } | ||
119 | +})(); | ||
120 | +</script> | ||
121 | +<script src="js/paybacknew.js?a=4.01"></script> | ||
122 | +</body> | ||
123 | +</html> |
wxpayResult.html
@@ -29,8 +29,9 @@ | @@ -29,8 +29,9 @@ | ||
29 | <!--<noscript>--> | 29 | <!--<noscript>--> |
30 | <!--You need to enable JavaScript to run this app.--> | 30 | <!--You need to enable JavaScript to run this app.--> |
31 | <!--</noscript>--> | 31 | <!--</noscript>--> |
32 | -<header id="header" style="margin-top:25%; display: flex; justify-content: center; align-items: center; flex-direction: column; "> | ||
33 | - <img id="stateImg" src="img/default.png" style="width: 64px; height: 64px; " /> | 32 | +<header id="header" |
33 | + style="margin-top:25%; display: flex; justify-content: center; align-items: center; flex-direction: column; "> | ||
34 | + <img id="stateImg" src="img/default.png" style="width: 64px; height: 64px; "/> | ||
34 | <div id="stateLable" style="font-size: 18px; color: #777; margin-top: 20px;">状态</div> | 35 | <div id="stateLable" style="font-size: 18px; color: #777; margin-top: 20px;">状态</div> |
35 | </header> | 36 | </header> |
36 | 37 | ||
@@ -46,30 +47,46 @@ | @@ -46,30 +47,46 @@ | ||
46 | --> | 47 | --> |
47 | <script type="text/javascript"> | 48 | <script type="text/javascript"> |
48 | window.onload = function () { | 49 | window.onload = function () { |
49 | - var tmpParams = getQueryString(window.location); | ||
50 | - if (tmpParams != null) { | ||
51 | - console.log(JSON.stringify(tmpParams)); | ||
52 | - if (tmpParams.trade_no == "success") { | ||
53 | - getResponse("success"); | 50 | + var tmpParams = getQueryString(window.location); |
51 | + if (tmpParams != null) { | ||
52 | + console.log(JSON.stringify(tmpParams)); | ||
53 | + if (tmpParams.trade_no == "success") { | ||
54 | + getResponse("success"); | ||
55 | + } else { | ||
56 | + getResponse("fail"); | ||
57 | + } | ||
58 | + //alertMsg("支付返回参数:" + JSON.stringify(tmpParams)); | ||
54 | } else { | 59 | } else { |
55 | - getResponse("fail"); | 60 | + console.log("支付返回参数" + tmpParams); |
56 | } | 61 | } |
57 | - //alertMsg("支付返回参数:" + JSON.stringify(tmpParams)); | ||
58 | - } else { | ||
59 | - console.log("支付返回参数" + tmpParams); | ||
60 | - } | ||
61 | } | 62 | } |
63 | + | ||
62 | //type[fail、sucesss] | 64 | //type[fail、sucesss] |
63 | function getResponse(type) { | 65 | function getResponse(type) { |
64 | - var img = document.getElementById("stateImg"); | ||
65 | - var label = document.getElementById("stateLable"); | ||
66 | - if (type == "fail") { | ||
67 | - img.src = "img/no.png"; | ||
68 | - label.innerHTML = "支付失败,尝试重新扫码"; | ||
69 | - } else { | ||
70 | - img.src = "img/ok.png"; | ||
71 | - label.innerHTML = "订单支付成功"; | ||
72 | - } | 66 | + var img = document.getElementById("stateImg"); |
67 | + var label = document.getElementById("stateLable"); | ||
68 | + if (type == "fail") { | ||
69 | + img.src = "img/no.png"; | ||
70 | + label.innerHTML = "支付失败,尝试重新扫码"; | ||
71 | + setTimeout(function () { | ||
72 | + window.opener=null; | ||
73 | + window.open('','_self'); | ||
74 | + window.location.href="about:blank"; | ||
75 | + window.close(); //当断点执行到这里时会显示“Scripts may close only the windows that were opened by it.”所以要加上面“about:blank”页面才可以成功关闭 | ||
76 | + | ||
77 | + }, 2000) | ||
78 | + | ||
79 | + } else { | ||
80 | + img.src = "img/ok.png"; | ||
81 | + label.innerHTML = "订单支付成功"; | ||
82 | + setTimeout(function () { | ||
83 | + window.opener=null; | ||
84 | + window.open('','_self'); | ||
85 | + window.location.href="about:blank"; | ||
86 | + window.close(); //当断点执行到这里时会显示“Scripts may close only the windows that were opened by it.”所以要加上面“about:blank”页面才可以成功关闭 | ||
87 | + | ||
88 | + }, 2000) | ||
89 | + } | ||
73 | } | 90 | } |
74 | </script> | 91 | </script> |
75 | </body> | 92 | </body> |