|
@@ -52,10 +52,12 @@
|
|
|
mapGetters,
|
|
|
mapMutations
|
|
|
} from 'vuex'
|
|
|
- import QRCode from 'qrcodejs2'
|
|
|
import {
|
|
|
wxPayJs
|
|
|
} from '$project/utils/wxpay'
|
|
|
+ import {
|
|
|
+ aliPayJs
|
|
|
+ } from '$project/utils/alipay'
|
|
|
export default {
|
|
|
name: 'CarPay',
|
|
|
components: {
|
|
@@ -118,30 +120,14 @@
|
|
|
openId: this.ali_openid
|
|
|
}).then(url => {
|
|
|
this.isLoading = false;
|
|
|
- let qrcode = new QRCode('qrcode', {
|
|
|
- width: 200,
|
|
|
- height: 200,
|
|
|
- text: url,
|
|
|
- correctLevel: QRCode.CorrectLevel.M,
|
|
|
- })
|
|
|
- var canvas = document.getElementsByTagName('canvas')[0];
|
|
|
- this.qrCodeImg = convertCanvasToImage(canvas);
|
|
|
-
|
|
|
- var btnArray = ['关闭', "支付成功?"];
|
|
|
- var _this = this
|
|
|
- mui.confirm('<img src="' + this.qrCodeImg + '" >',
|
|
|
-
|
|
|
- '请使用支付宝扫码', btnArray,
|
|
|
- function(e) {
|
|
|
- if (e.index == 1) {
|
|
|
- _this.$router.push({
|
|
|
- name: 'CarPayResult',
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
+ let opthions = {
|
|
|
+ tradeNo: response.tradeOrder.tradeNo,
|
|
|
+ succUrl: window.location.href.split("#")[0] + "/#/car/payResult",
|
|
|
+ cancelUrl: window.location.href.split("#")[0] + "/#/car/search?companyId=" + this
|
|
|
+ .parking_company_id,
|
|
|
+ }
|
|
|
+ console.log(opthions);
|
|
|
+ aliPayJs(opthions);
|
|
|
}).catch(error => {
|
|
|
this.isLoading = false;
|
|
|
mui.toast(error);
|
|
@@ -159,6 +145,7 @@
|
|
|
...mapGetters({
|
|
|
wx_openId: 'wx_openid',
|
|
|
ali_openid: 'ali_openid',
|
|
|
+ parking_company_id: 'parking_company_id'
|
|
|
})
|
|
|
}
|
|
|
}
|