guang-cart.js
779 Bytes
/*
* @Author: Targaryen
* @Date: 2017-05-08 09:43:20
* @Last Modified by: Targaryen
* @Last Modified time: 2017-06-20 09:40:29
*/
const $ = require('yoho-jquery');
const chosePanel = require('js/common/chose-panel-new');
const detailFuns = require('js/product/detail/functions');
let $addToCart = $('.add-to-cart');
$addToCart.on('click', function(e) {
let $this = $(e.currentTarget);
let productSkn = $this.data('skn');
$.get(location.protocol + '//m.yohobuy.com/product/detail/newinfo', {
productSkn: productSkn
}, function(data) {
chosePanel.show({data}).then(result => {
detailFuns.addToCart(result.sku.skuId, productSkn, result.buyNum);
}).catch(error => {
console.log(error);
});
});
});