...
|
...
|
@@ -7,6 +7,7 @@ let productSkn = $('#productSkn').val(); |
|
|
let brandId = $('#brand-id').val();
|
|
|
let shopId = $('#shopId').val();
|
|
|
let bundleType = $('#bundleType').val();
|
|
|
let yoho = require('yoho-app');
|
|
|
|
|
|
require('common');
|
|
|
|
...
|
...
|
@@ -21,6 +22,26 @@ require('./detail/recommend-for-you-product-desc'); |
|
|
|
|
|
let detailFuns = require('./detail/functions');
|
|
|
|
|
|
let productName = $('.goods-name .name').text();
|
|
|
let productPic = $('.banner-container').find('img:first').attr('src');
|
|
|
|
|
|
if (productPic && productPic.indexOf('http:') < 0) {
|
|
|
productPic = `http:${productPic}`;
|
|
|
}
|
|
|
let shareData = {
|
|
|
title: `推荐这本城市指南给你:${productName}`,
|
|
|
link: location.href,
|
|
|
desc: '最近很多 KOL 在推!据说是探索城市必备神器',
|
|
|
desCircle: `最近被刷屏的这本城市指南终于可以买到了!${productName}`,
|
|
|
imgUrl: productPic
|
|
|
};
|
|
|
|
|
|
if (yoho.isMarsApp) {
|
|
|
yoho.ready(function() {
|
|
|
yoho.invokeMethod('set.shareInfo', shareData);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
window.rePosFooter && window.rePosFooter();
|
|
|
|
|
|
setTimeout(() => {
|
...
|
...
|
@@ -87,7 +108,7 @@ setTimeout(() => { |
|
|
|
|
|
setTimeout(function() {
|
|
|
$('#isDepositAdvance').on('touchstart', function() {
|
|
|
tip.show('定金预售商品只能在APP端购买');
|
|
|
tip.show('定金预售商品只能在有货App购买');
|
|
|
return false;
|
|
|
});
|
|
|
}, 200);
|
...
|
...
|
@@ -155,6 +176,16 @@ setTimeout(() => { |
|
|
|
|
|
let chosePanel = require('common/chose-panel-new');
|
|
|
|
|
|
if (window.cookie('tmp-cart-info') && yoho.isLogin()) {
|
|
|
let preInfo = window.cookie('tmp-cart-info').split('_');
|
|
|
|
|
|
if (preInfo[1] === $('#productSkn').val()) {
|
|
|
detailFuns.addToCart(preInfo[0], preInfo[1], preInfo[2]);
|
|
|
} else {
|
|
|
window.setCookie('tmp-cart-info', '');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$('#addtoCart, #ticketsToCart').on('touchstart', function() {
|
|
|
let productCode = $('#limitProductCode').val();
|
|
|
let seckill = $('.seckill-time').length;
|
...
|
...
|
@@ -180,8 +211,14 @@ setTimeout(() => { |
|
|
return;
|
|
|
}
|
|
|
if (result.buyNow) { // 立即购买
|
|
|
location.href = '/cart/index/buynow/orderensure?product_sku=' +
|
|
|
let nextUrl = location.origin + '/cart/index/buynow/orderensure?product_sku=' +
|
|
|
result.sku.skuId + '&buy_number=' + result.buyNum;
|
|
|
|
|
|
if (yoho.isMarsApp && !yoho.isLogin()) {
|
|
|
yoho.goLogin(nextUrl);
|
|
|
} else {
|
|
|
location.href = nextUrl;
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
detailFuns.addToCart(result.sku.skuId, productSkn, result.buyNum);
|
...
|
...
|
@@ -368,7 +405,8 @@ setTimeout(() => { |
|
|
// 加载详情页的返回顶部按钮并注册事件
|
|
|
|
|
|
$(document).scroll(function() {
|
|
|
if ($(document).scrollTop() >= $(document).height() - $(window).height() - 120) {
|
|
|
if (($(document).scrollTop() >= $(document).height() - $(window).height() - 120) &&
|
|
|
$('.back-to-top').length > 0) {
|
|
|
let top = $('.back-to-top').offset().top - $('.float-top').offset().top +
|
|
|
($('.back-to-top').height() - $('.float-top').height()) / 2;
|
|
|
let left = $('.back-to-top').offset().left - $('.float-top').offset().left;
|
...
|
...
|
|