Authored by TaoHuang

fix npm.rc

phantomjs_cdnurl=http://npm.taobao.org/mirrors/phantomjs
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
registry=http://npm.yohops.com
package-lock=false
... ...
... ... @@ -65,21 +65,15 @@ export default {
},
data() {
return {
data: {}
data: {
pay_list: [{
payment_id: 1,
pay_name: '支付宝'
}]
}
};
},
async mounted() {
if (!this.orderCode) {
return;
}
const payListResult = await this.fetchPayList({
order_code: this.orderCode
});
if (payListResult.code === 200) {
this.data = payListResult.data;
}
},
methods: {
...mapOrderAction(['fetchPayList']),
... ...
... ... @@ -84,7 +84,7 @@ export default {
},
},
methods: {
...mapOrderAction(['fetchOrderAddress', 'fetchUserStatus', 'fetchPayList', 'fetchPayment', 'computeOrder']),
...mapOrderAction(['fetchOrderAddress', 'fetchUserStatus', 'fetchPayList', 'fetchPayment', 'computeOrder', 'buyPayAction']),
...mapOrderMutations([Types.CHANGE_SELECT_COUPON_LIST, Types.CHANGE_SELECT_PROMOTION]),
replaceBr(str) {
return str ? str.replace(/\n/g, '<br />') : '';
... ... @@ -150,17 +150,57 @@ export default {
});
},
async onPayAction() {
const vm = this;
await this.compute();
const { data: { orderCode, message } } = await this.buyPayAction({
skup: this.productDetail.skup,
addressId: this.address.address_id,
couponCode: get(this.orderDetail, 'recommendedCouponInfo.coupon_code', ''),
promotionId: get(this.orderDetail, 'promotionTips.promotionIds', '')
});
if (!orderCode) {
this.$createToast({
time: 1500,
txt: message,
type: 'txt'
}).show();
return;
}
this.$createOrderPayType({
orderCode,
price: this.orderDetail.amount,
desc: '金额'
desc: '金额',
onCloseAction() {
vm.onClose(orderCode);
},
onPayAction() {
vm.onPay();
}
}).show();
},
onPay() {
console.log('ok');
},
onClose(orderCode) {
this.$router.push({
name: 'orderDetail',
params: {
owner: UserType.buy,
code: orderCode
}
});
}
}
};
</script>
<style lang="scss" scoped>
@import '~statics/scss/variable.scss';
.footer {
position: absolute;
bottom: 0;
... ...
... ... @@ -130,12 +130,7 @@ export default {
const { orderCode } = orderResult.data;
const payListResult = await this.fetchPayList({
order_code: orderCode
});
this.orderPay = this.$createOrderPayType({
data: payListResult.data,
price: this.fee.earnestMoneyStr,
desc: '保证金',
orderCode,
... ...
$xianyu-theme-red: #d0021b;
... ...
... ... @@ -181,6 +181,18 @@ export default function() {
commit(Types.UPDATE_ORDER, orderInfo.data);
return orderInfo;
},
async buyPayAction(ctx, { skup, couponCode, addressId, promotionId }) {
const order = await this.$api.post('/api/order/submit', {
skup,
addressId,
coupon_code: couponCode,
promotionId,
depositRequirement: 'N'
});
return order;
}
},
getters: {},
... ...
... ... @@ -280,9 +280,7 @@ module.exports = {
auth: true,
path: 'shopping',
api: 'ufo.order.compute',
params: {
skup: { type: Number, require: true },
},
params: {},
},
// 买家预定单订单价格
... ... @@ -291,9 +289,7 @@ module.exports = {
auth: true,
path: 'shopping',
api: 'ufo.order.payment',
params: {
skup: { type: Number, require: true },
},
params: {},
},
// 买家获得优惠券
... ... @@ -307,6 +303,15 @@ module.exports = {
},
},
// 买家下单
'/api/order/submit': {
ufo: true,
auth: true,
path: 'shopping',
api: 'ufo.order.submit',
params: {}
},
// 订单物流信息
'/api/order/express': {
ufo: true,
... ...