Commit 943f9186db5ca323058f941b06e5a358c5df3120
1 parent
6802f002
支持支付宝
Showing
2 changed files
with
43 additions
and
1 deletions
index.html
| @@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
| 8 | <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> | 8 | <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> |
| 9 | <meta http-equiv="Pragma" content="no-cache" /> | 9 | <meta http-equiv="Pragma" content="no-cache" /> |
| 10 | <meta http-equiv="Expires" content="0" /> | 10 | <meta http-equiv="Expires" content="0" /> |
| 11 | - <title>微信公众号</title> | 11 | + <title>停车支付</title> |
| 12 | </head> | 12 | </head> |
| 13 | <body> | 13 | <body> |
| 14 | <div id="app"></div> | 14 | <div id="app"></div> |
src/views/parkPay/orderPay.vue
| @@ -124,6 +124,48 @@ export default { | @@ -124,6 +124,48 @@ export default { | ||
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | 126 | ||
| 127 | + if (this.clientBrowser == '支付宝') { // 支付宝支付 | ||
| 128 | + let me = this | ||
| 129 | + var aliParams = {}; | ||
| 130 | + aliParams.orderId = this.orderId; | ||
| 131 | + aliParams.carNumber = this.carNumber; | ||
| 132 | + aliParams.payType = 1;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号 | ||
| 133 | + aliParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付 | ||
| 134 | + aliParams.paySrcType = this.paySrcType;//101停车支付 | ||
| 135 | + aliParams.orgId = this.$utils.myOrgId | ||
| 136 | + aliParams.backType = 2 | ||
| 137 | + aliParams.backDeveloperCode = this.tollNumber | ||
| 138 | + aliParams.recordArreaInfos = JSON.stringify(this.orderId); | ||
| 139 | + console.log(aliParams) | ||
| 140 | + aliPay(aliParams).then(response => { | ||
| 141 | + console.log(response) | ||
| 142 | + if (response.code == 0) {//进场 | ||
| 143 | + document.write(response.data);//打开支付表单 | ||
| 144 | + } else if(response.code == 1002){//其他情况如【该卡号场内已存在】 | ||
| 145 | + console.log(response.message); | ||
| 146 | + MessageBox.confirm('', { | ||
| 147 | + message: response.message, | ||
| 148 | + title: '温馨提示', | ||
| 149 | + showCancelButton:false, | ||
| 150 | + confirmButtonText: '确定', | ||
| 151 | + }).then(action => { | ||
| 152 | + if (action == 'confirm') { //确认的回调 | ||
| 153 | + console.log('确定'); | ||
| 154 | + this.$router.go(-1) | ||
| 155 | + } | ||
| 156 | + }).catch(err => { | ||
| 157 | + if (err == 'cancel') { //取消的回调 | ||
| 158 | + console.log('取消'); | ||
| 159 | + } | ||
| 160 | + }); | ||
| 161 | + }else{ | ||
| 162 | + alert(response.message) | ||
| 163 | + } | ||
| 164 | + | ||
| 165 | + }) | ||
| 166 | + } | ||
| 167 | + | ||
| 168 | + | ||
| 127 | if (this.clientBrowser == '微信') { // 微信支付 | 169 | if (this.clientBrowser == '微信') { // 微信支付 |
| 128 | let _openId = sessionStorage.getItem('openIdData') | 170 | let _openId = sessionStorage.getItem('openIdData') |
| 129 | if(_openId){ | 171 | if(_openId){ |