Authored by 郭成尧

bundle-num-api

... ... @@ -449,6 +449,26 @@ const giftinfo = (req, res, next) => {
}).catch(next);
};
/**
* 增加套餐的数量
* @param {*} req
* @param {*} res
* @param {*} next
*/
const incrBundle = (req, res, next) => {
let uid = req.user.uid;
let shoppingKey = req.cookies._SPK || '';
return indexModel.incrBundle({
uid: uid,
shopping_key: shoppingKey,
activity_id: req.body.activity_id
}).then(result => {
res.json(result);
}).catch(next);
};
module.exports = {
index,
indexData,
... ... @@ -462,5 +482,6 @@ module.exports = {
gift,
giftinfo,
advanceBuy,
modifyPriceGift
modifyPriceGift,
incrBundle
};
... ...
... ... @@ -245,6 +245,20 @@ const getPriceGiftList = (promotionIds, promotionType) => {
});
};
/**
* 增加套餐数量
* @param {*} params
*/
const incrBundle = (params) => {
return api.post('', {
method: 'app.Shopping.incrBundle',
uid: params.uid,
shopping_key: params.shopping_key,
increase_number: params.increase_number || '1',
activity_id: params.activity_id
});
};
module.exports = {
indexData,
selectGood,
... ... @@ -258,5 +272,6 @@ module.exports = {
modifyCartProduct,
giftProductData,
getPriceGiftList,
modifyCartPriceGiftProduct
modifyCartPriceGiftProduct,
incrBundle
};
... ...
... ... @@ -58,6 +58,7 @@ router.post('/index/new/modifyPriceGift', indexController.modifyPriceGift); //
router.get('/index/new/gift', indexController.gift); // 获取购物车赠品
router.get('/index/new/advanceBuy', indexController.advanceBuy); // 获取购物车加价购
router.post('/index/new/giftinfo', indexController.giftinfo); // 获取购物车加价购商品数据,chosepanel
router.post('/index/new/incrbundle', indexController.incrBundle);
// 支付中心 URL,由于微信安全限制,在现有 URL 后追加 new ,通过 subDomain 中间件转发到此
... ...
<div class="good-item{{#if lowStocks}} low-stocks{{/if}}{{#if isStudents}} is-students{{/if}}{{#if isVipPrice}} is-vip-price{{/if}}{{#ifand checked showCheckbox}} is-checked{{/ifand}}{{#if noEdit}} no-edit{{/if}}{{#if inValid}} in-valid{{/if}}{{#if inValidLow}} in-valid-low{{/if}}{{#ifor isGift isAdvanceBuy}} is-gift{{/ifor}}" data-promotion="{{promotion_id}}" data-id="{{id}}" data-skn="{{skn}}" data-mnum="{{minNumber}}" data-link="{{link}}">
<div class="opt">
{{#unless parent.isBundle}}
{{#if showCheckbox}}
<i class="iconfont chk select{{#if checked}} checked{{/if}}"></i>
{{/if}}
{{/unless}}
{{#unless parent.isBundle}}
<i class="iconfont chk edit"></i>
{{/unless}}
{{#inValid}}
<span class="disable fill-text">失效</span>
{{/inValid}}
... ...