Authored by TaoHuang

add alipay url

... ... @@ -53,10 +53,12 @@ export default {
default: ''
},
extra: {
type: Object,
default() {
return {};
}
type: String,
default: '{}'
},
replace: {
type: Boolean,
default: false
}
},
components: {
... ... @@ -125,11 +127,12 @@ export default {
this.hide();
this.$emit('paySuccess');
this.$router.push({
this.$router.replace({
name: 'OrderPay',
query: {
orderCode: this.orderCode,
payParams: result.data.payParams
payParams: result.data.payParams,
extra: this.extra
}
});
}
... ...
... ... @@ -3,11 +3,13 @@ const config = {
axiosBaseUrl: '/xianyu',
axiosResponseType: 'json',
reportUrl: '//badjs.yoho.cn/apm/yas2.gif',
alipayUrl: 'https://openapi.alipaydev.com/gateway.do',
},
production: {
axiosBaseUrl: '/xianyu',
axiosResponseType: 'json',
reportUrl: '//badjs.yoho.cn/apm/yas2.gif',
alipayUrl: 'https://openapi.alipay.com/gateway.do'
},
};
... ...
... ... @@ -19,6 +19,7 @@ export default [
props: route => ({
orderCode: route.query.orderCode,
payParams: route.query.payParams,
extra: route.query.extra
}),
},
{
... ...
<template>
<div>
{{orderCode}} <====>
{{payParams}}
</div>
<LayoutApp :show-back="true">
<div>{{count}} 秒</div>
<div>支付成功跳转成功页</div>
<div>支付失败返回上一层</div>
</LayoutApp>
</template>
<script>
const ALIPAY_DOMAIN = 'https://openapi.alipay.com/gateway.do';
import config from 'config';
export default {
name: 'PayPage',
props: ['orderCode', 'payParams', 'extra'],
data() {
return {
count: 60
};
},
mounted() {
if (this.payParams) {
const url = ALIPAY_DOMAIN + '?' + this.payParams;
const url = config.alipayUrl + '?' + this.payParams;
window.location.href = url;
}
this.setCount();
},
methods: {}
methods: {
setCount() {
if (this.count > 0) {
setTimeout(() => {
this.count = this.count - 1;
this.setCount();
}, 1000);
}
}
}
};
</script>
... ...
... ... @@ -145,6 +145,21 @@ export default {
price: this.fee.earnestMoneyStr,
desc: '保证金',
orderCode: orderResult.data.orderCode,
extra: JSON.stringify({
type: UserType.sell,
back: {
name: 'ProductDetail',
params: {
productId: this.productId
}
},
forward: {
name: 'SellPayOk',
query: {
orderCode: orderResult.data.orderCode
}
}
}),
onCloseAction() {
vm.onClose(orderResult.data.orderCode);
}
... ...