Authored by 李奇

选择验证添加

... ... @@ -508,6 +508,34 @@ class BuyNowController {
}
/**
* 拼团预提交验证
* @param {*} req
* @param {*} res
* @param {*} next
*/
groupOrderPreSub(req, res, next) {
let uid = req.user.uid;
let productSku = req.body.productSku;
let activityId = req.body.activityId;
let groupNo = req.body.groupNo || '';
let params = {
uid: uid,
product_sku: productSku,
group_no: groupNo,
activity_id: activityId,
buy_number: 10
};
co(function * () {
let result = yield req.ctx(BuyNowModel).groupBuyPayment(params);
return res.json(result);
})().catch(next);
}
/**
* 选择地址
* @param {*} req
* @param {*} res
... ...
... ... @@ -71,6 +71,7 @@ router.get('/index/buynow/orderensure', authMW, disableBFCache, BuyNowController
router.post('/index/buynow/ordercompute', authMW, BuyNowController.orderCompute); // 立即购买订单重新计算
router.post('/index/buynow/ordersub', authMW, BuyNowController.orderSub); // 立即购买订单提交
router.post('/index/buynow/groupordersub', authMW, BuyNowController.groupOrderSub); // 立即拼团订单提交
router.post('/index/buynow/grouporderPreSub', authMW, BuyNowController.groupOrderPreSub); // 立即拼团选择确定
router.get('/index/buynow/selectAddress', authMW, csrf, BuyNowController.selectAddress); // 选择地址
router.get('/index/buynow/selectInvoice', authMW, BuyNowController.selectInvoice); // 发票信息
router.get('/index/buynow/selectCoupon', authMW, BuyNowController.selectCoupon); // 选择优惠券页面
... ...
... ... @@ -292,6 +292,8 @@ class GroupProgress extends Page {
}
this.pickData._fullData = data.data;
this.pickData.groupNo = this.data.groupNo;
this.pickData.activityId = this.data.activityId;
this.pickData.buyNumber = 1;
this.pickData.buy_limit_number = 1;
this.pickData.goodsList = data.data.goods_list;
... ...
... ... @@ -193,13 +193,28 @@ class ChosePanel {
* 点击确定
*/
_choseBtnSureClick() {
let self = this;
let skuId = this._checkSku();
if (skuId) {
this._resolve && this._resolve({
sku: {skuId},
buyNum: 1, // 拼团只支持一件
buyNow: true
$.ajax({
method: 'post',
url: '/cart/index/buynow/grouporderPreSub',
data: {
productSku: skuId,
activityId: self.data.activityId,
groupNo: self.data.groupNo,
}
}).then(data => {
if (data && data.code === 200) {
this._resolve && this._resolve({
sku: {skuId},
buyNum: 1, // 拼团只支持一件
buyNow: true
});
} else {
data.message && tip.show(data.message);
}
});
}
}
... ...