...
|
...
|
@@ -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');
|
|
|
|
...
|
...
|
@@ -143,8 +147,8 @@ export default function() { |
|
|
},
|
|
|
|
|
|
async fetchUserStatus() {
|
|
|
const alipayStatus = await this.$api.get('/api/order/alipay/status');
|
|
|
const userStatus = await this.$api.get('/api/order/user/status');
|
|
|
// const alipayStatus = await this.$api.get('/api/order/alipay/status');
|
|
|
// const userStatus = await this.$api.get('/api/order/user/status');
|
|
|
},
|
|
|
|
|
|
async submitOrder({ commit }, payload) {
|
...
|
...
|
@@ -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 }) {
|
...
|
...
|
@@ -193,6 +199,19 @@ export default function() { |
|
|
});
|
|
|
|
|
|
return order;
|
|
|
},
|
|
|
|
|
|
async payAction(ctx, { orderCode }) {
|
|
|
const payResult = await this.$api.post('/api/order/pay', {
|
|
|
orderCode,
|
|
|
payment: 2
|
|
|
});
|
|
|
|
|
|
if (payResult.code !== 200) {
|
|
|
return Promise.reject(payResult);
|
|
|
}
|
|
|
|
|
|
return payResult;
|
|
|
}
|
|
|
},
|
|
|
getters: {},
|
...
|
...
|
|