|
|
/**
|
|
|
* Created by targaryen on 2016/11/28.
|
|
|
*/
|
|
|
var $ = require('yoho-jquery'),
|
|
|
tip = require('../plugin/tip');
|
|
|
let $ = require('yoho-jquery'),
|
|
|
tip = require('plugin/tip');
|
|
|
|
|
|
require('../common');
|
|
|
require('common');
|
|
|
let share = require('common/share');
|
|
|
|
|
|
var chosePanelRender = require('../common/chose-panel'),
|
|
|
chosePanel = require('./bundle/chose-pannel');
|
|
|
let chosePanelRender = require('common/chose-panel'),
|
|
|
chosePanel = require('cart/chose-panel');
|
|
|
|
|
|
var $selectBtn = $('.select-btn'),
|
|
|
let $selectBtn = $('.select-btn'),
|
|
|
$buyNowBtn = $('#bundle-buy-now');
|
|
|
|
|
|
// cookie 参数
|
|
|
var actCkOpthn = {
|
|
|
let actCkOpthn = {
|
|
|
path: '/cart/index'
|
|
|
};
|
|
|
|
|
|
$(function() {
|
|
|
window.setCookie('activity-info', '', actCkOpthn);
|
|
|
share({
|
|
|
imgUrl: 'https://feature.yoho.cn/300x300.png',
|
|
|
title: '会搭是成为潮流ICON的第一步,搭配购买还有优惠折扣!',
|
|
|
link: window.location.href,
|
|
|
desc: '超高性价比,开启省钱大作战!'
|
|
|
});
|
|
|
});
|
|
|
|
|
|
/**
|
|
|
* 选择商品颜色等
|
|
|
*/
|
|
|
$selectBtn.on('touchend', function() {
|
|
|
var self = $(this);
|
|
|
let self = $(this);
|
|
|
|
|
|
$.post('/product/detail/info', {
|
|
|
id: self.data('id'),
|
|
|
productSkn: self.data('skn')
|
|
|
}, function(data) {
|
|
|
chosePanelRender(data);
|
|
|
chosePanel.init(self.data('skn'));
|
|
|
chosePanel.show();
|
|
|
chosePanel.init();
|
|
|
chosePanel.setBundleModeWithSknId(self.data('skn'));
|
|
|
chosePanel.show('', (productData) => {
|
|
|
var product = $('#gskn-' + productData.skn);
|
|
|
|
|
|
product.data('sku', productData.sku);
|
|
|
product.html('颜色:' + productData.color + ' 尺码:' + productData.size);
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
|
|
|
$('.goods-img').on('touchend', function() {
|
|
|
var packGood = $(this).parent().find('.select-btn');
|
|
|
let packGood = $(this).parent().find('.select-btn');
|
|
|
|
|
|
if (window._yas && window._yas.sendCustomInfo) {
|
|
|
window._yas.sendCustomInfo({
|
...
|
...
|
@@ -58,7 +71,7 @@ $('.goods-img').on('touchend', function() { |
|
|
* 立即购买
|
|
|
*/
|
|
|
$buyNowBtn.on('click', function() {
|
|
|
var bundleGoods = [],
|
|
|
let bundleGoods = [],
|
|
|
bundleId = $('#activityId').val(),
|
|
|
gskn = $('span[id^="gskn"]'),
|
|
|
gsknSelected = false,
|
...
|
...
|
|