Authored by TaoHuang

add pay info

... ... @@ -118,15 +118,15 @@ export default {
type: 'txt'
}).show();
},
onSuccess() {
onSuccess(result) {
this.hide();
this.$emit('on-pay-success');
this.$router.push({
name: 'OrderPay',
query: {
order_code: this.orderCode,
payment: PAYMENTS.ALIPAY + '_platform'
orderCode: this.orderCode,
payParams: result.data.payParams
}
});
}
... ...
... ... @@ -61,7 +61,15 @@ export default {
storageId: this.storageId
});
await this.fetchPayment({ skup: this.productDetail.skup });
const payInfo = await this.fetchPayment({ skup: this.productDetail.skup });
if (payInfo?.code !== 200) {
this.$createToast({
time: 2000,
txt: payInfo.message,
type: 'txt'
}).show();
}
if (this.address.address_id) {
await this.compute();
... ...
... ... @@ -17,8 +17,8 @@ export default [
path: '/xianyu/order/pay.html',
component: () => import(/* webpackChunkName: "order" */ './pay'),
props: route => ({
orderCode: route.query.order_code,
payment: route.query.payment,
orderCode: route.query.orderCode,
payParams: route.query.payParams,
}),
},
{
... ...
<template>
<div>
{{orderCode}}
{{payment}}
{{orderCode}} <====>
{{payParams}}
</div>
</template>
<script>
const ALIPAY_DOMAIN = 'https://mapi.alipay.com/gateway.do';
export default {
name: 'PayPage',
props: ['orderCode', 'payment'],
props: ['orderCode', 'payParams'],
mounted() {
},
methods: {
if (this.payParams) {
const url = ALIPAY_DOMAIN + '?' + encodeURIComponent(this.payParams);
}
console.log(url);
}
},
methods: {}
};
</script>
... ...
... ... @@ -18,5 +18,8 @@ export default {
},
[Types.SET_USER_ADDRESS_INFO](state, addressInfo) {
state.addressInfo = addressInfo || {};
// 修改根状态
this.state.order.orderConfirm.address = addressInfo;
}
};
... ...
... ... @@ -117,9 +117,13 @@ export default function() {
}
},
actions: {
async fetchOrderAddress({ commit }, payload) {
async fetchOrderAddress({ commit, state }, payload) {
const orderCount = await this.$api.get('/api/order/confirm/count', payload);
if (state.address?.address_id) {
return;
}
if (get(orderCount, 'data.cnt', 0)) {
const addressInfo = await this.$api.get('/api/order/confirm/address');
... ... @@ -159,10 +163,12 @@ export default function() {
const orderInfo = await this.$api.post('/api/order/confirm/buypayment', { skup, api_version: 1 });
if (orderInfo.code !== 200) {
return;
return orderInfo;
}
commit(Types.FETCH_ORDER_BUY_ORDER, orderInfo.data);
return orderInfo;
},
async computeOrder({ commit }, { skup, couponCode, addressId, promotionId }) {
... ...
module.exports = {
'/api/ufo/invite/friendList': {
ufo: true,
api: 'ufo.invite.code',
params: {},
},
'/api/ufo/invite/recordDetailList': {
ufo: true,
api: 'ufo.invite.getInviteSettlementItemList',
params: {},
},
'/api/yoho/resource': {
service: true,
api: 'operations/api/v5/resource/get',
params: {
content_code: { type: String },
},
},
'/api/union/inviteList': {
api: 'app.union.shareOrder.queryInviteYohoList',
params: {
page: { type: Number },
size: { type: Number },
},
},
'/api/union/queryUnion': {
api: 'app.union.shareOrder.queryUnionTypeByUid',
params: {},
},
// 获取调价商品及尺码信息
'/api/ufo/seller/entryGoodsSizeList': {
auth: true,
... ... @@ -326,6 +297,7 @@ module.exports = {
'/api/order/pay': {
ufo: true,
auth: true,
path: 'payment',
api: 'ufo.order.pay',
params: {}
},
... ...