Commit 092148e6f69877bb4a638e9c0ae585e036c7b9c1
1 parent
d29bf602
赤峰测试环境 农行支付
Showing
2 changed files
with
42 additions
and
7 deletions
src/components/orderPay.vue
| ... | ... | @@ -164,7 +164,7 @@ export default { |
| 164 | 164 | tokenId:_token, //商户传过来的tokenId |
| 165 | 165 | paySystem:"", //商户传过来的paySystem, 没有则传空字符串 |
| 166 | 166 | payType:"1111", //商户传过来的payType,没有则传'1111' |
| 167 | - webviewURL:"", //商户传过来的回跳地址 | |
| 167 | + webviewURL:"https://wxgzh.renniting.cn/wechatwuxi/Chifeng/TEST/sweeping_payment/codepay/index.html#/payResult", //商户传过来的回跳地址 | |
| 168 | 168 | remark:"其他参数", //扩展备用 |
| 169 | 169 | showProgress:'NO', |
| 170 | 170 | backBehavior:'back' |
| ... | ... | @@ -179,7 +179,7 @@ export default { |
| 179 | 179 | |
| 180 | 180 | } |
| 181 | 181 | }else{ |
| 182 | - alert('请重新扫码') | |
| 182 | + alert('支付失败') | |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | |
| ... | ... | @@ -211,10 +211,10 @@ export default { |
| 211 | 211 | if (res.code == 0) { |
| 212 | 212 | me.vxPay(res.data, this.orderId) |
| 213 | 213 | } else if (res.code == 40163) { //code been used, hints[重复code问题] |
| 214 | - alert(res.message) | |
| 214 | + alert('请重新扫码') | |
| 215 | 215 | console.log(res.message); |
| 216 | 216 | } else { |
| 217 | - alert(res.message) | |
| 217 | + alert('请重新扫码') | |
| 218 | 218 | } |
| 219 | 219 | }) |
| 220 | 220 | |
| ... | ... | @@ -260,6 +260,7 @@ export default { |
| 260 | 260 | }) |
| 261 | 261 | }, |
| 262 | 262 | onBridgeReady(params) { |
| 263 | + let me = this | |
| 263 | 264 | console.log('调用微信支付WeixinJSBridge') |
| 264 | 265 | WeixinJSBridge.invoke( |
| 265 | 266 | 'getBrandWCPayRequest', params, |
| ... | ... | @@ -280,6 +281,7 @@ export default { |
| 280 | 281 | } else { |
| 281 | 282 | console.log('失败') |
| 282 | 283 | alert('支付失败') |
| 284 | + me.$router.go(-2); | |
| 283 | 285 | } |
| 284 | 286 | } |
| 285 | 287 | ) | ... | ... |
src/components/payResult.vue
| ... | ... | @@ -4,6 +4,8 @@ |
| 4 | 4 | <div :style="{'background-image': 'url('+resultBG+')'}" class="result-bg"></div> |
| 5 | 5 | <div>{{payMsg}}</div> |
| 6 | 6 | </div> |
| 7 | + | |
| 8 | + <div class="close" @click="closePage" v-show="isShow">关闭</div> | |
| 7 | 9 | </div> |
| 8 | 10 | </template> |
| 9 | 11 | |
| ... | ... | @@ -19,15 +21,25 @@ export default { |
| 19 | 21 | return { |
| 20 | 22 | resultBG: '', |
| 21 | 23 | payMsg: '支付成功', |
| 22 | - orderId:'' | |
| 24 | + orderId:'', | |
| 25 | + isShow:false | |
| 23 | 26 | } |
| 24 | 27 | }, |
| 25 | 28 | created(){ |
| 26 | 29 | // console.log(this.$route.query.ID) |
| 27 | 30 | |
| 28 | 31 | this.resultBG = oKBg |
| 29 | - this.orderId = localStorage.getItem("OrderNum") | |
| 30 | - this.queryBankOrderState() | |
| 32 | + | |
| 33 | + if(window.navigator.userAgent.indexOf('Bankabc/Portal') > -1) { | |
| 34 | + // alert('当前页面在新容器'); | |
| 35 | + this.isShow = true | |
| 36 | + } else { | |
| 37 | + // alert('当前页面在旧容器'); | |
| 38 | + | |
| 39 | + } | |
| 40 | + | |
| 41 | + // this.orderId = localStorage.getItem("OrderNum") | |
| 42 | + // this.queryBankOrderState() | |
| 31 | 43 | // alert(window.location.href) |
| 32 | 44 | // alert(this.$router.query.ID) |
| 33 | 45 | }, |
| ... | ... | @@ -51,6 +63,16 @@ export default { |
| 51 | 63 | } |
| 52 | 64 | |
| 53 | 65 | }) |
| 66 | + }, | |
| 67 | + closePage:function () { | |
| 68 | + if(window.navigator.userAgent.indexOf('Bankabc/Portal') > -1) { | |
| 69 | + // alert('当前页面在新容器'); | |
| 70 | + AlipayJSBridge.call('abcExitWebAndBackToHome'); | |
| 71 | + } else { | |
| 72 | + // alert('当前页面在旧容器'); | |
| 73 | + // 旧支付方式 | |
| 74 | + | |
| 75 | + } | |
| 54 | 76 | } |
| 55 | 77 | } |
| 56 | 78 | |
| ... | ... | @@ -70,6 +92,17 @@ export default { |
| 70 | 92 | background-position: center 0; |
| 71 | 93 | background-size: 100% 100%; |
| 72 | 94 | } |
| 95 | + .close{ | |
| 96 | + width: 80%; | |
| 97 | + margin: 20px auto; | |
| 98 | + height: 40px; | |
| 99 | + line-height: 40px; | |
| 100 | + color: #fff; | |
| 101 | + text-align: center; | |
| 102 | + background: #0564cc; | |
| 103 | + border-radius: 5px; | |
| 104 | + cursor: pointer; | |
| 105 | + } | |
| 73 | 106 | |
| 74 | 107 | |
| 75 | 108 | </style> | ... | ... |