Commit 16b4c5c8d2adaf8432e5882b8a1515ff724b8c32
1 parent
fd467c34
Exists in
master
chore: 支付
Showing
1 changed file
with
8 additions
and
12 deletions
Show diff stats
src/views/Service/CheckOrder.vue
... | ... | @@ -194,6 +194,7 @@ export default { |
194 | 194 | const Jupiter = sUserAgent.indexOf("Jupiter") > -1 |
195 | 195 | if (Jupiter) { |
196 | 196 | alert('App') |
197 | + console.log('App') | |
197 | 198 | this.mgop({ |
198 | 199 | api: 'mgop.sz.hswsy.appPay', // 必须 |
199 | 200 | host: 'https://mapi.zjzwfw.gov.cn/', |
... | ... | @@ -214,7 +215,7 @@ export default { |
214 | 215 | "productId": "11", |
215 | 216 | "quit_url": "https://puser.zjzwfw.gov.cn/sso/mobile.do?action=oauth&scope=1&servicecode=hswsy&goto=", |
216 | 217 | "subject": "string", |
217 | - "totalFee": "0.01", | |
218 | + "totalFee": "0.01", | |
218 | 219 | }, |
219 | 220 | onSuccess: res => { |
220 | 221 | console.log(res) |
... | ... | @@ -226,6 +227,7 @@ export default { |
226 | 227 | }); |
227 | 228 | } else { |
228 | 229 | alert('H5') |
230 | + console.log('h5') | |
229 | 231 | this.mgop({ |
230 | 232 | api: 'mgop.sz.hswsy.mobilePay', // 必须 |
231 | 233 | host: 'https://mapi.zjzwfw.gov.cn/', |
... | ... | @@ -250,7 +252,11 @@ export default { |
250 | 252 | }, |
251 | 253 | onSuccess: res => { |
252 | 254 | console.log(res) |
253 | - this.BridgePay(res.data.message) | |
255 | + // res.data.data默认是我们拿到的form代码 | |
256 | + const div = document.createElement('div') | |
257 | + div.innerHTML = res.data.message | |
258 | + document.body.appendChild(div) | |
259 | + document.forms[0].submit() //重要,这个才是点击跳页面的核心 | |
254 | 260 | }, |
255 | 261 | onFail: err => { |
256 | 262 | console.log('err', err) |
... | ... | @@ -267,16 +273,6 @@ export default { |
267 | 273 | "inSandBox": false |
268 | 274 | } |
269 | 275 | }; |
270 | - ZWJSBridge.pay(payMsg).then((result) => { | |
271 | - | |
272 | - alert('支付成功!'); | |
273 | - console.log('#### ZWJSBridge.pay() result:' + result); | |
274 | - | |
275 | - }).catch((error) => { | |
276 | - var errorMsg = JSON.stringify(error); | |
277 | - alert('支付失败:' + errorMsg); | |
278 | - console.log('#### ZWJSBridge.pay() error:' + error); | |
279 | - }); | |
280 | 276 | } |
281 | 277 | } |
282 | 278 | } | ... | ... |