Authored by QC-L

Merge branch 'feature/group-buy' of git.yoho.cn:fe/yohobuywap-node into feature/group-buy

... ... @@ -74,7 +74,6 @@ function filter(req, res, next) {
function searchList(req, res, next) {
let params = Object.assign({}, req.query);
console.log(params);
req.ctx(GroupService).filterGroupList(params)
.then(result => {
return res.render('group/search-list', {
... ... @@ -106,6 +105,7 @@ function progress(req, res, next) {
localCss: true,
nodownload: true,
width750: true,
wechatShare: true,
data: renderData
});
}).catch(next);
... ... @@ -126,7 +126,8 @@ function goodsDetail(req, res, next) {
}
let finalResult = detailProcess.prodessDetailData(result);
console.log(result);
finalResult.activityGroupDetailList = result.activityGroupDetailList;
finalResult.activityIdDetail = result.activityIdDetail;
return res.render('group/goodsDetail', {
page: 'group-goodsDetail',
nodownload: true,
... ... @@ -140,7 +141,7 @@ function goodsDetail(req, res, next) {
canonical: {
currentHref: result.canonical
},
result: finalResult
result: finalResult,
});
}).catch(next);
}
... ...
... ... @@ -246,7 +246,7 @@ class GroupApi extends global.yoho.BaseModel {
activityId: obj.activityId
};
this.get({data: param})
return this.get({data: param})
.then(data => {
return data.data;
})
... ... @@ -263,12 +263,11 @@ class GroupApi extends global.yoho.BaseModel {
productSkn: obj.productSkn
};
this.get({data: param})
return this.get({data: param})
.then(function(data) {
if (!data || !data.data) {
return;
}
return data.data;
}).catch(function(error) {
console.log(error);
});
}
}
... ...
... ... @@ -116,13 +116,15 @@ class GroupService extends global.yoho.BaseModel {
async filterGroupList(params) {
const initParams = {
page: 1,
limit: 20,
limit: 15,
joinLimit: 1
};
let newParams = {
...initParams,
...params
};
console.log(newParams);
const result = await this.api._getPromoteList(newParams);
let finalResult = {};
... ... @@ -180,10 +182,16 @@ class GroupService extends global.yoho.BaseModel {
async goodsDetail(params) {
let result = await this.api.getProductData(params);
result.activityIdDetail = await this.api.getCollageProductInfo(params);
result.activityGroupDetailList = await this.api.fetchActivityGroups(params);
result.introUrl = '/product/detail/intro/' + params.productSkn;
return result;
}
getJoinList(params) {
return this.api.fetchActivityGroups(params);
}
async order({
type,
page,
... ...
... ... @@ -372,7 +372,7 @@ router.get('/group/goods-list', group.groupList); // 拼团列表
router.get('/group/filter', group.filter); // 首页筛选结果页
router.get('/group/search', group.searchList); // 首页筛选列表
router.get('/group/progress', auth, group.progress); // 拼团状态详情页
router.get('/group/goodsDetail', group.goodsDetail);
router.get('/group/detail', group.goodsDetail);
router.get('/group/order', auth, group.order); // 我的拼团
module.exports = router;
... ...
... ... @@ -34,18 +34,37 @@
<h2 class="goods-name"><span>{{.}}</span></h2>
{{/ goodsName}}
{{# goodsSubtitle}}
<h1 class="goods-subtitle"><span>{{.}}</span></h1>
{{/ goodsSubtitle}}
<div class="price-date">
<div class="goods-price data-bind">
<h1 class="current-price"></h1>
<h1 class="previous-price"></h1>
<div class="goods-price">
<h1 class="current-price">{{activityIdDetail.formatCollagePrice}}</h1>
<h1 class="previous-price">{{goodsPrice.previousPrice}}</h1>
{{#if activityIdDetail.joinPeopleNum}}
<div class="join-num">已有{{activityIdDetail.joinPeopleNum}}人拼团</div>
{{/if}}
</div>
<button class="limit-sale data-can-get-limit-code data-bind" id='limit-sale'>获取限购码</button>
<button class="got-limit-sale data-code-empty data-bind">限购码已被抢光</button>
<button class="got-limit-sale data-got-code data-bind">已获取限购码</button>
</div>
<div class="goods-join">
<div class="title">选择下面小伙伴,快速加入</div>
{{#each activityGroupDetailList}}
<div class="content">
<img class="avatar" src="{{founderHeadUrl}}"/>
<span class="nick-name">{{founderNickName}}</span>
<div class="middle">
<div class="top" >
<span class="text">还差</span>
<span class="text" style='color:red'>{{lackNum}}</span>
<span class="text">人成功</span>
</div>
<span class="text">剩余{{formatLeftTime}}</span>
</div>
<div class='ibutton'>
立即参团
</div>
</div>
{{/each}}
</div>
{{#if periodOfMarket}}
<div class="period-of-market">
... ...
... ... @@ -37,14 +37,15 @@
{{> group/resources/filter-tab}}
</div>
{{#if filterList.length}}
<div class="group-list">
{{#each filterList}}
{{> group/resources/filter-list-item}}
{{/each}}
<div id="goodsContainer">
{{#if filterList.length}}
<div class="goods-list">
{{#each filterList}}
{{> group/resources/filter-list-item}}
{{/each}}
</div>
{{/if}}
</div>
{{/if}}
{{!-- {{> group/resources/filter-page}} --}}
</div>
<a class="bottom" href="/activity/group/order">我的拼团</a>
... ...
{{#data}}
<div class="group-progress" data-page-go="{{pageGo}}" data-left-time="{{leftTime}}">
<div class="group-progress yoho-page" data-page-go="{{pageGo}}"
data-activity-id="{{activityId}}"
data-left-time="{{leftTime}}"
data-lack-num="{{lackNum}}"
data-group-no="{{groupNo}}"
data-product-name="{{yourJoinItem.productName}}"
data-group-price="{{yourJoinItem.productGroupPrice}}"
data-share-img="{{image2 yourJoinItem.productIcon w=200 h=282}}">
<div class="card">
<div class="inner-card go-join" data-product-skn="{{yourJoinItem.productSkn}}"
data-activity-id="{{activityId}}" data-group-no="{{groupNo}}" data-page-go="{{pageGo}}">
... ...
<div class="group-product-cell-bg" data-group-product="{{group_product}}" data-item-idx="{{itemIdx}}">
<div class="group-product-cell" data-group-product="{{group_product}}" data-item-idx="{{itemIdx}}">
<div class="group-product-header">
<div class="group-product-left-icon">
<span class="group-product-left-icon-number">{{people_num}}人团</span>
... ...
<div class="chose-panel" data-skn="{{productSkn}}">
<div class="main">
<div class="close iconfont">&#xe626;</div>
<div class="infos {{#if @root.tickets}} tickets-info {{/if}}">
<div class="basic-info">
<div class="thumb-img">
<img class="thumb" src="{{defaultThumb}}">
</div>
<div class="text-info">
<p class="price">
{{#if price}}
<span class="sale-price">{{salePrice}}</span>
<span class="market-price">{{price}}</span> {{else}} {{# isY isSecKill}}
<span class="sale-price">{{salePrice}}</span>
<span class="market-price">{{salePrice}}</span> {{else}}
<span class="sale-price no-price">{{salePrice}}</span> {{/ isY}} {{/if}}
</p>
<p class="not-choose">{{@root.noChoseText}}</p>
<p class="choosed-info hide"></p>
<p class="size-info hide"></p>
<p class="size-rec hide"></p>
</div>
</div>
<div class="chose-items">
{{#each props}}
<div class="block-list">
<span class="name">{{name}}</span>
<ul class="size-row clearfix">
{{#each values}}
<li class="block{{#if chosed}} chosed{{/if}}" data-prop-id="{{../type}}" data-value-id="{{id}}">{{name}}</li>
{{/each}}
</ul>
</div>
{{/each}}
<div class="num">
<span class="name">数量</span>
<div class="clearfix">
<a class="btn btn-minus {{#if @root.discountBuy}}discount-gray{{/if}}" href="javascript:void(0);">
<span class="iconfont {{#if @root.disableNum}}disabled{{/if}}">&#xe625;</span>
{{!--TODO promotionId => disabled--}}
</a>
<input id="good-num" class="good-num disabled" type="text" value="{{@root.buyNum}}" disabled="true">
<a class="btn btn-plus" href="javascript:void(0);">
<span class="iconfont {{#if @root.disableNum}}disabled{{/if}}">&#xe624;</span>
</a>
</div>
{{#if @root.discountBuy}}
<input id="mnum" type="hidden" value="{{@root.discountBuy.num}}">
{{#if @root.discountBuy.discount}}
<span class="left-num-discount">{{@root.discountBuy.num}}件起购享{{@root.discountBuy.discount}}</span>
{{^}}
<span class="left-num-discount">{{@root.discountBuy.num}}件起购</span>
{{/if}}
{{^}}
<span class="left-num"></span>
{{/if}}
<input id="left-num" type="hidden" value="0">
<input id="limitNum" type="hidden" value="{{limit}}">
</div>
</div>
</div>
<div class="btn-wrap">
<button id="chose-btn-buynow" class="btn btn-sure-buynow">确定</button>
</div>
</div>
</div>
... ...
... ... @@ -5,6 +5,25 @@ import Page from 'js/yoho-page';
import lazyLoad from 'yoho-jquery-lazyload';
import tip from 'js/plugin/tip';
function hiddenTips($ele) {
let offsetContainer,
offsetLastColumn;
if ($ele.length > 0) {
offsetContainer = $ele[0].getBoundingClientRect().right;
if ($ele.find('.swiper-slide:last-child')[0]) {
offsetLastColumn = $ele.find('.swiper-slide:last-child')[0].getBoundingClientRect().right;
}
if (offsetLastColumn - offsetContainer < 0) {
$ele.next('.tips').css('display', 'none');
} else {
$ele.next('.tips').css('display', 'block');
}
}
}
class Detail extends Page {
constructor() {
super();
... ... @@ -15,6 +34,7 @@ class Detail extends Page {
};
this.getIntro();
}
getIntro() {
let introUrl = this.selector.introUrl.val();
let $productDesc = this.selector.productDesc;
... ... @@ -50,8 +70,8 @@ class Detail extends Page {
slidesPerView: 'auto'
});
this.hiddenTips($('#size-swiper-container'));
this.hiddenTips($('#reference-swiper-container'));
hiddenTips($('#size-swiper-container'));
hiddenTips($('#reference-swiper-container'));
window.rePosFooter && window.rePosFooter();
},
... ... @@ -62,24 +82,7 @@ class Detail extends Page {
}
});
}
hiddenTips($ele) {
let offsetContainer,
offsetLastColumn;
if ($ele.length > 0) {
offsetContainer = $ele[0].getBoundingClientRect().right;
if ($ele.find('.swiper-slide:last-child')[0]) {
offsetLastColumn = $ele.find('.swiper-slide:last-child')[0].getBoundingClientRect().right;
}
if (offsetLastColumn - offsetContainer < 0) {
$ele.next('.tips').css('display', 'none');
} else {
$ele.next('.tips').css('display', 'block');
}
}
}
}
$(() => {
new Detail();
... ...
... ... @@ -22,16 +22,40 @@ class GroupProgress extends Page {
$countdown: $('.count-down')
};
this.timer = '';
this.data = {
groupNo: '',
lackNum: '',
productName: '',
groupPrice: '',
shareImgUrl: ''
};
this.init();
}
init() {
lazyLoad(this.selector.$page.find('img.lazy'));
this.initData();
this.bindEvents();
this.shareInfo();
this.countdown();
}
initData() {
let activityId = this.selector.$page.data('activity-id');
let groupNo = this.selector.$page.data('group-no');
let lackNum = this.selector.$page.data('lack-num');
let productName = this.selector.$page.data('product-name');
let groupPrice = this.selector.$page.data('group-price');
let shareImgUrl = this.selector.$page.data('share-img');
this.data.groupNo = groupNo;
this.data.lackNum = lackNum;
this.data.productName = productName;
this.data.groupPrice = groupPrice;
this.data.activityId = activityId;
this.data.shareImgUrl = shareImgUrl;
}
bindEvents() {
this.selector.$productItem.on('click', this.goDetail.bind(this));
this.selector.$goJoin.on('click', this.goJoin.bind(this));
... ... @@ -40,17 +64,23 @@ class GroupProgress extends Page {
}
shareInfo() {
let _this = this;
let link = '';
let [domain] = location.href.split('?');
link = `${domain}?activityId=${this.data.activityId}&groupNo=${this.data.groupNo}`;
_this.data.shareImgUrl = _this.data.shareImgUrl.replace(/(http:)?\/\//, 'https://');
sharePlugin({
title: '有货福利团xx元包邮xxx商品',
imgUrl: '',
link: '',
desc: 'x人团更优惠,正品保证,全场包邮',
copyDeac: '【有货福利团 】x人团,xx元包邮xxx商品>>'
title: `【还差${_this.data.lackNum}人】${_this.data.groupPrice}金额 ${_this.data.productName}`,
imgUrl: _this.data.shareImgUrl,
link: link
});
let clipboardShare = new Clipboard('.h5-share-clipboard', {
text: function() {
return '【有货福利团 】x人团,xx元包邮xxx商品>>';
return `【还差${_this.data.lackNum}人】${_this.data.groupPrice}金额 ${_this.data.productName}>>${link}`;
}
});
... ... @@ -159,11 +189,43 @@ class GroupProgress extends Page {
}
joinGroup() {
dialog.showDialog({
dialogText: 'TODO 弹出商品信息选择等',
hasFooter: {
centerBtnText: '确认'
}
let chosePanel = require('js/activity/group/chose-panel');
chosePanel.show({
data: {},
disableNum: ''
}).then(() => {
$('.cart-bar').show();
// if (result && result.sku) {
// if (result.modes.tickets) { // 门票
// detailFuns.addTickets(result.sku.skuId, result.buyNum);
// return;
// }
// if (result.modes.limitCode) { // 限购
// detailFuns.addLimitCode(productCode, result.sku.skuId, productSkn, result.buyNum);
// return;
// }
// if (result.modes.seckill) { // 秒杀
// window.location.href = '/cart/index/seckill?skn=' + productSkn +
// '&sku=' + result.sku.skuId;
// return;
// }
// if (result.buyNow) { // 立即购买
// 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);
// }
}, () => {
$('.cart-bar').show();
});
}
... ...
... ... @@ -6,9 +6,10 @@ import filter from 'js/plugin/filter';
let innerScroll = require('js/plugin/inner-scroll');
// import lazyLoad from 'yoho-jquery-lazyload';
import tip from 'js/plugin/tip';
// import tip from 'js/plugin/tip';
import loading from 'js/plugin/loading';
class Group extends Page {
constructor() {
super();
... ... @@ -18,32 +19,33 @@ class Group extends Page {
floorsContentHeight: $('.floors').height(),
groupTab: $('.group-tab'),
filterTab: $('.filter-nav'),
groupListContent: $('.group-list')
groupListContent: $('.goods-list')
};
this.navInfo = {
new: {
order: 's_t_desc',
reload: true,
page: 1,
end: false
reload: true, // 是否重新加载
isScrollLoad: false, // 是否是滚动加载
page: 0,
end: false // 是否继续请求数据
},
popularity: {
order: 'h_v_desc',
reload: true,
isScrollLoad: false,
page: 0,
end: false
},
price: {
order: 's_p_asc',
reload: true,
isScrollLoad: false,
page: 0,
end: false
}
};
this.noResult = '<p class="no-result">未找到相关搜索结果</p>';
this.defaultLimit = 15;
this.selectedChannel = 'newGroup';
this.filterTab = {
newGroup: {
... ... @@ -64,10 +66,22 @@ class Group extends Page {
this.bindEvents();
this.swiperTop();
this.filterInit();
$(window).scroll(() => {
window.requestAnimationFrame(this.scrollHandler.bind(this));
let self = this;
$(window).scroll(function() {
window.requestAnimationFrame(() => {
self.scrollHandler();
});
setTimeout(function() {
window.requestAnimationFrame(() => {
self.scrollListHandler();
});
}, 5);
});
}
scrollHandler() {
// 滚动固定tab
let floorsContentHeight = this.selector.floorsContentHeight + 5;
... ... @@ -80,6 +94,22 @@ class Group extends Page {
this.selector.groupListContent.removeClass('mrt');
}
}
scrollListHandler() {
// 当scroll到1/2$goodsContainer高度后继续请求下一页数据
let floorsContentHeight = this.selector.floorsContentHeight + 5;
let goodsContainerHeight = this.selector.groupListContent.height();
let navType = this.judgeType(this.filterTab[this.selectedChannel].$pre);
let nav = this.navInfo[navType];
if (($(window).scrollTop() - floorsContentHeight) > goodsContainerHeight * 0.6) {
nav.reload = false;
nav.isScrollLoad = true;
console.log('load');
if (!nav.end) {
this.search();
}
}
}
bindEvents() {
this.selector.tabSection.on('click', this.fixedTab.bind(this));
this.selector.groupTab.on('click', this.groupTabChange.bind(this));
... ... @@ -126,6 +156,9 @@ class Group extends Page {
return;
}
nav.reload = true;
nav.end = false;
nav.isScrollLoad = false;
nav.page = 0;
nav.order = $this.data('order');
this.filterTab[currentChannel].order = nav.order;
}
... ... @@ -134,6 +167,9 @@ class Group extends Page {
if ($this.hasClass('price')) {
$this.find('.icon > .iconfont').toggleClass('cur');
nav.reload = true;
nav.end = false;
nav.isScrollLoad = false;
nav.page = 0;
nav.order = nav.order === 's_p_asc' ? 's_p_desc' : 's_p_asc'; // 切换排序
this.filterTab[currentChannel].order = nav.order;
}
... ... @@ -167,8 +203,9 @@ class Group extends Page {
for (let i in navInfo) {
if (navInfo.hasOwnProperty(i)) {
navInfo[i].reload = true;
navInfo[i].isScrollLoad = false;
navInfo[i].end = false;
navInfo[i].page = 0;
if (i === 'price') {
navInfo[i].order = 's_p_asc';
}
... ... @@ -214,6 +251,23 @@ class Group extends Page {
}
}
// 判断导航类型
judgeType(dom) {
let navType;
if (dom.hasClass('new')) {
navType = 'new';
} else if (dom.hasClass('popularity')) {
navType = 'popularity';
} else if (dom.hasClass('price')) {
navType = 'price';
} else {
navType = 'other';
}
return navType;
}
//
/**
* 筛选注册的回调,筛选子项点击后逻辑
... ... @@ -221,17 +275,35 @@ class Group extends Page {
* @param opt
*/
search() {
let groupListContent = this.selector.groupListContent;
let params = {
...this.filterTab[this.selectedChannel]
};
let pageParams = this.filterPage[this.selectedChannel];
let groupListContent = this.selector.groupListContent;
let nav;
let navType;
let page;
let that = this;
delete params.$pre;
console.log('searchParam', params);
console.log('pageParams', this.filterPage[this.selectedChannel]);
// 导航类别
navType = this.judgeType(this.filterTab[this.selectedChannel].$pre);
nav = this.navInfo[navType];
page = nav.page + 1;
if (nav.reload) {
page = 1;
}
nav.page = page;
console.log('nav', nav);
if (nav.end) {
// 不需要重新加载并且数据请求结束
return false;
}
loading.showLoadingMask();
$.ajax({
... ... @@ -239,19 +311,62 @@ class Group extends Page {
url: '/activity/group/search',
data: {
...params,
...pageParams
...pageParams,
page
},
success: function(data) {
console.log(data);
groupListContent.html(data);
loading.hideLoadingMask();
beforeSend: () => {
if ($('.search-divide').length > 0) {
$('.search-divide').remove();
}
groupListContent.after(() => {
return '<div class="search-divide">正在加载...</div>';
});
},
error: function() {
tip.show('网络断开连接了~');
loading.hideLoadingMask();
success: (data) => {
that.dataRender(data, nav);
},
error: () => {
let $divide = $('.search-divide');
$divide.text('加载失败,点击重试');
$divide.one('click', () => {
$divide.text('正在加载...');
this.search();
});
}
});
}
dataRender(result, curNav) {
// 去掉正在加载
$('.search-divide').remove();
let isResult = !result || !result.length ||
result.length < 1 ||
(result.list && result.list.length < 1);
let groupListContent = this.selector.groupListContent;
// 没有结果输出没有结果页面
if (isResult) {
if (curNav.isScrollLoad && !curNav.reload) {
groupListContent.after(() => {
return '<div class="search-divide">没有更多内容了...</div>';
});
} else {
groupListContent.html('<div>未查询到数据!</div>');
}
curNav.end = true;
console.log('curNav', curNav);
return false;
} else {
if (curNav.isScrollLoad && !curNav.reload) {
groupListContent.append(result);
} else {
groupListContent.html(result);
}
}
}
// 筛选初始化
... ...
/**
* 购物车选择尺寸、颜色和数量面板
* @author: feng.chen<feng.chen@yoho.cn>
* @date: 2017/3/2
* 示例:
* let chosePanel = require('chose-panel');
* chosePanel.show({
* data: {}, // 商品数据
* buttonText: '加入购物车', // 自定义底部按钮文字
* disableNum: true // 禁用编辑数量
* }).then((sku) => {
* //点击确认按钮回调,返回sku对象,各自业务在此处实现,该组件不做选择后的处理
* //...
* }, () => {
* //关闭选择框回调
* });
* choselPanel.close(); //关闭选择框
*/
let $ = require('yoho-jquery'),
tip = require('js/plugin/tip'),
innerScroll = require('js/plugin/inner-scroll');
let panelT = require('hbs/activity/group/chose-panel.hbs');
let $yohoPage = $('.yoho-page'),
$chosePanel = $('.chose-panel'),
$choseArea,
$goodNum,
$btnMinus,
$thumbImg,
$choseBtnSure,
$noChoose,
$chooseInfo;
class ChosePanel {
constructor() {
if (!window.cookie) {
require('js/common');
}
this._regEvents();
}
show(opt) {
if (!opt) {
$('.chose-panel').show();
return new Promise((resolve, reject) => {
this._resolve = resolve;
this._reject = reject;
});
}
Object.assign(this, opt);
if (!this.data) {
throw new Error('未赋值');
}
// if (this.data) {
// this._setModes();
// this.maxBuyNum = this.data.cartInfo.limit || 0; // 0表示不限制购买
// this.setting = {
// disableNum: this.disableNum,
// noChoseText: `请选择${this.props.map(prop => prop.name).join('、')}`,
// buttonText: this.buttonText || this._getButtonText(),
// buyNum: this.buyNum
// };
// }
this._render();
return new Promise((resolve, reject) => {
this._resolve = resolve;
this._reject = reject;
});
}
close() {
innerScroll.enableScroll($choseArea);
$('.chose-panel').hide();
}
/**
* 设置商品模式
*/
_setModes() {
this.modes = { // 商品特性
// disableNum: this.disableNum, // 禁用编辑
// showBuyNow: this.data.showBuyNow // 是否显示双按钮
// isSoldOutSoon: false, //是否展示即将售罄
// goodsList: [],
// sizeList: [],
// image: '',
// goodPrice: '',
// price: '',
// buyNumber: 1,
// minusButtonEnable: false,
// plusButtonEnable: true,
// buyButtonEnable: true,
// buy_limit_number: 1
};
}
_render() {
let html;
html = panelT(Object.assign(this.data, this.setting));
if ($chosePanel.length) {
$chosePanel.replaceWith(html);
} else {
$yohoPage.append(html);
}
this._setVariable();
innerScroll.disableScroll($choseArea);
}
_getButtonText() {
if (this.modes.showBuyNow) {
return {
double: true,
text: '加入购物车'
};
}
if (this.modes.tickets || this.modes.limitCode || this.modes.seckill) {
return {
double: false,
text: '立即购买'
};
}
return {
double: false,
text: '加入购物车'
};
}
_defaultBuyNum() {
return (this.modes.discount && this.data.discountBuy.num) ||
(this.data.cartInfo && this.data.cartInfo.num) || 1;
}
_setVariable() {
$chosePanel = $('.chose-panel');
$choseArea = $('.chose-panel .main .chose-items');
$goodNum = $('#good-num');
$btnMinus = $('.btn-minus');
$thumbImg = $('.thumb-img');
$choseBtnSure = $('#chose-btn-sure');
$noChoose = $('.not-choose');
$chooseInfo = $('.choosed-info');
}
_regEvents() {
$yohoPage.on('touchstart', '.chose-panel', (e) => {
return this._closeClick(e);
});
$yohoPage.on('touchstart', '.block', (e) => {
this._blockClick(e);
});
$yohoPage.on('touchstart', '.btn-plus,.btn-minus', (e) => {
this._numClick(e);
});
$yohoPage.on('touchstart', '.thumb-img .thumb', (e) => {
this._thumbClick(e);
});
$yohoPage.on('touchstart', '#chose-btn-sure', (e) => {
return this._choseBtnSureClick(e, false);
});
$yohoPage.on('touchstart', '#chose-btn-buynow', (e) => {
// let sku = this._checkSku(this.buyNum);
// if (window._yas && window._yas.sendCustomInfo) {
// window._yas.sendCustomInfo({
// op: 'YB_GDS_BUYNOW_BTN',
// param: JSON.stringify({
// C_ID: this.C_ID,
// PRD_ID: this.data.cartInfo.productId,
// PRD_NUM: this.buyNum,
// PRD_SKN: this.data.cartInfo.productSkn,
// PRD_SKU: sku && sku.skuId
// })
// }, true);
// }
return this._choseBtnSureClick(e, true);
});
}
/**
* 点击关闭按钮
*/
_closeClick(e) {
let $cur = $(e.target);
if ($cur.closest('.main').length > 0 && !$cur.hasClass('close')) {
return;
}
this.close();
this._reject && this._reject();
return false;
}
/**
* 点击属性
*/
_blockClick(e) {
let $block = $(e.currentTarget);
if ($block.hasClass('chosed')) {
$block.removeClass('chosed');
} else {
$block.addClass('chosed').siblings().removeClass('chosed');
}
this._selectBlock($block);
}
/**
* 点击数量加减
*/
_numClick(e) {
let buyNum;
if (this.modes.disableNum) {
return;
}
buyNum = $(e.currentTarget).hasClass('btn-minus') ? this.buyNum - 1 : this.buyNum + 1;
if (this._checkSku(buyNum)) {
this.buyNum = buyNum;
$goodNum.val(this.buyNum);
if (this.modes.discount) {
if (buyNum <= this.minBuyNum) {
$('.btn-minus').addClass('discount-gray');
} else {
$('.btn-minus').removeClass('discount-gray');
}
}
}
}
/**
* 点击缩略图
*/
_thumbClick() {
if ($thumbImg.hasClass('hover')) {
$thumbImg.removeClass('hover');
} else {
$thumbImg.addClass('hover');
}
}
/**
* 点击确定或者立即购买按钮
*/
_choseBtnSureClick(e, buyNow) {
let selectSku = this._checkSku(this.buyNum);
if (selectSku) {
this.close();
this._resolve && this._resolve({
sku: selectSku,
skn: this.data.cartInfo.productSkn,
productId: this.data.cartInfo.productId,
buyNum: this.buyNum,
modes: this.modes,
buyNow: buyNow
});
return false;
}
}
/**
* 验证选择sku的购买数量是否通过
*/
_checkSku(buyNum) {
if ($('.block.chosed.zero-stock').length) {
return false;
}
let validSelects = this.props
.filter(prop => !$(`.block[data-prop-id="${prop.type}"]`).hasClass('chosed'))
.map(prop => {
return prop.name;
});
if (validSelects.length) {
tip.show(`请选择${validSelects.join('和')}~`);
return false;
}
let selectSku = this._getSelectSku();
if (!selectSku) {
tip.show('无法选择该属性的商品');
return false;
}
if (buyNum < this.minBuyNum) {
if (this.modes.discount) {
tip.show(`量贩商品,${this.minBuyNum}件起购`);
return false;
} else {
tip.show('您选择的数量不能为零~');
return false;
}
}
if (this.modes.tickets && buyNum > selectSku.limitNum) {
if (selectSku.limitNum) {
tip.show(`每人只可购买${selectSku.limitNum}张此门票`);
return false;
}
}
if (this.modes.limit && buyNum > this.maxBuyNum) {
tip.show('您选择数量大于限购数量~');
return false;
}
if (buyNum > selectSku.storage) {
tip.show('您选择的数量超过了最大库存量~');
return false;
}
return selectSku;
}
/**
* 选择属性
*/
_selectBlock($selectBlock) {
let that = this;
let propId = $selectBlock.data('prop-id'),
valueId = $selectBlock.data('value-id');
let chosed = $($selectBlock).hasClass('chosed');
if ($('.block.chosed').length === 0) {
this._initBlockStatus();
} else {
// 根据选择的属性值筛选出符合条件的sku列表,然后遍历其他属性如果在sku列表中不存在该属性值,则灰色
let filterSkus = this.skus.filter(sku => (!chosed || sku.prop[propId].valId === valueId) &&
sku.storage >= this.minBuyNum);
let filterProps = this.props.filter(prop => prop.type !== propId);
filterProps.forEach(prop => {
$(`.block[data-prop-id="${prop.type}"]`).each((i, ele) => {
let $block = $(ele);
let valId = $block.data('value-id');
let existsSku = filterSkus.some(sku => sku.prop[prop.type].valId === valId);
let fsku = that.skus.filter(sku => sku.prop[propId].valId === valueId &&
sku.prop[prop.type].valId === valId);
let limitTip = '';
if (!existsSku) {
$block.addClass('zero-stock');
if (fsku.length && fsku[0].limitBuyTip) {
limitTip = fsku[0].limitBuyTip;
}
} else {
$block.removeClass('zero-stock');
}
$block.data('limittip', limitTip);
});
});
}
if (window._yas && window._yas.sendCustomInfo && chosed) {
if (propId === 'color') {
window._yas.sendCustomInfo({
op: 'YB_GDS_COLOR_C',
param: JSON.stringify({
C_ID: this.C_ID,
PRD_ID: this.data.cartInfo.productId,
COLOR: $selectBlock.text()
})
}, true);
} else if (propId === 'size') {
window._yas.sendCustomInfo({
op: 'YB_GDS_SIZE_C',
param: JSON.stringify({
C_ID: this.C_ID,
PRD_ID: this.data.cartInfo.productId,
SIZE: $selectBlock.text()
})
}, true);
}
}
this._refreshBlockStatus();
}
/**
* 选择属性后刷新其他属性的状态
*/
_refreshBlockStatus() {
let selectSku = this._getSelectSku();
let $zeroChose = $('.block.chosed.zero-stock');
// 设置底部按钮文字
if ($zeroChose.length) {
let tipText = '已售罄';
if ($zeroChose.data('limittip')) {
tipText = $zeroChose.data('limittip');
}
$choseBtnSure.css('background-color', '#c0c0c0').text(tipText);
} else {
$choseBtnSure.css('background-color', '#eb0313').text(this.setting.buttonText.text);
}
// 设置默认购买数量
this.buyNum = this._defaultBuyNum();
$goodNum.val(this.buyNum);
if (this.modes.discount) {
$btnMinus.addClass('discount-gray');
}
// 根据颜色属性设置缩略图
let $colorBlock = $('.block.chosed[data-prop-id="color"]');
if ($colorBlock.length) {
let colorSkus = this.skus.filter(sku => sku.prop.color &&
sku.prop.color.valId === $colorBlock.data('value-id'));
if (colorSkus.length) {
let thumb = colorSkus[0].thumb;
if (!thumb) {
thumb = this.data.cartInfo.defaultThumb;
}
$chosePanel.find('.thumb').attr('src', thumb);
}
}
// 设置选择属性提示
let valueList = Array.from($('.block.chosed').map((index, ele) => {
return $(ele).text();
}));
if (valueList.length) {
$noChoose.addClass('hide');
$chooseInfo.removeClass('hide');
$chooseInfo.text(`已选:${valueList.join('、')}`);
} else {
$noChoose.removeClass('hide');
$chooseInfo.addClass('hide');
}
if (selectSku) {
let numText;
if (selectSku.limitNum) {
if (selectSku.limitNum) {
numText = `限购${selectSku.limitNum}件`;
} else {
numText = '';
}
} else if (this.modes.soonSoldOut) {
numText = '即将售罄';
} else if (selectSku.storage < 4 && selectSku.storage > 0) {
numText = `剩余${selectSku.storage}件`;
} else {
numText = '';
}
$chosePanel.find('.left-num').text(numText);
$chosePanel.find('.size-info').text(selectSku.sizeInfo).removeClass('hide');
$chosePanel.find('.size-rec').text(selectSku.sizeRec || '').removeClass('hide');
} else {
$chosePanel.find('.left-num').text('');
$chosePanel.find('.size-info').text('').addClass('hide');
$chosePanel.find('.size-rec').text('').addClass('hide');
}
}
/**
* 根据已选择的属性值获得符合条件的sku
*/
_getSelectSku() {
let selectValues,
selectSku;
if ($('.block.chosed').length !== this.props.length) {
return;
}
selectValues = Array.from($('.block.chosed').map((index, ele) => {
let $block = $(ele);
return {
propId: $block.data('prop-id'),
valueId: $block.data('value-id')
};
}));
selectSku = this.skus.filter(sku => {
return selectValues
.map(value => {
return sku.prop[value.propId].valId === value.valueId;
})
.filter(match => match).length === this.props.length;
});
if (selectSku.length >= 1) {
return selectSku[0];
}
return;
}
}
module.exports = new ChosePanel();
... ...
... ... @@ -101,6 +101,7 @@ class ProductListLoader {
}
let catchKey = this.url + '?' + $.param(this.defaultOpt);
console.log(this.defaultOpt);
if (!this.isLoadMore) {
return false;
}
... ...
.group-list {
.goods-list {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
margin-left: 20px;
margin-right: 20px;
margin-bottom: 100px;
}
.group-product-image {
... ... @@ -13,7 +12,7 @@
height: 430px;
}
.group-product-cell-bg {
.group-product-cell {
margin-top: 20px;
}
... ...
.good-detail-page {
.goods-price {
float: none;
h1 {
display: inline-block;
line-height: 2.2rem;
}
.join-num {
line-height: 2.2rem;
float: right;
font-size: 14px;
}
}
.goods-join {
background: #fff;
margin-top: 14px;
.title {
color: #b0b0b0;
height: 76px;
line-height: 76px;
padding-left: 30px;
}
.content {
width: 100%;
height: 100px;
display: flex;
flex-direction: row;
align-items: center;
.ibutton {
width: 160px;
height: 60px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 30px;
font-size: 24px;
color: white;
text-align: center;
background: #000;
line-height: 60px;
border-radius: 35px;
}
.avatar {
width: 60px;
height: 60px;
border-radius: 30px;
margin-left: 30px;
border: 1px solid #e0e0e0;
margin-right: 0;
}
.nick-name {
font-size: 24px;
width: 280px;
color: #444;
margin-left: 20px;
}
.middle {
width: 150px;
height: 100px;
display: flex;
align-items: flex-start;
flex-direction: column;
justify-content: center;
margin-right: 20px;
.top {
display: flex;
flex-direction: row;
align-items: center;
}
.text {
font-size: 20px;
color: #b0b0b0;
}
}
}
}
}
... ...
$pageBgC: #f0f0f0;
$mainFontC: #444;
$subFontC: #b0b0b0;
$borderC: #e0e0e0;
$tableCellC: #eee;
$basicBtnC: #eb0313;
@import "../../../scss/product/detail/detail";
@import "../../../scss/layout/swiper";
@import "../../../scss/product/detail/product-description";
.good-detail-page {
overflow: hidden;
background-color: #f0f0f0;
&.hide-discount {
.goods-discount {
display: none;
}
}
.page-block {
box-sizing: border-box;
margin-bottom: 20px;
padding: 0 28px;
width: 100%;
border-top: 1px solid $borderC;
border-bottom: 1px solid $borderC;
background-color: #fff;
> .title {
border-bottom: 1px solid $borderC;
color: $mainFontC;
font-size: 28px;
line-height: 88px;
span {
color: #a0a0a0;
font-size: 18px;
}
}
.pro-detail {
margin-top: 20px;
margin-bottom: 20px;
}
.pro-detail * {
font-size: 28px !important;
color: #444;
line-height: 40px !important;
margin-bottom: 40px;
letter-spacing: 1px;
word-break: break-all;
}
video {
width: 100%;
height: auto;
}
.detail {
margin-top: 20px;
margin-bottom: 20px;
font-size: 24px;
line-height: 36px;
b {
font-weight: bold;
}
i {
font-style: italic;
}
&.table {
width: 100%;
overflow: hidden;
.column {
box-sizing: border-box;
padding: 6px 3%;
width: 50%;
border: 1px solid #fff;
background-color: $tableCellC;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
font-size: 24px;
float: left;
}
.merge-column {
width: 100% !important;
}
.oldbox {
float: left;
overflow: hidden;
box-sizing: border-box;
padding: 6px 3%;
width: 49.9%;
height: 100%;
border: 1px solid #fff;
background-color: $tableCellC;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
}
.remind-tips {
padding-left: 18px;
font-size: 22px;
color: #e9221a;
margin-bottom: 30px;
img {
width: 28px;
float: left;
}
.wash-tags {
line-height: 30px;
height: 30px;
margin-left: 10px;
}
}
.model {
width: 100%;
height: auto;
border-bottom: 1px solid #e0e0e0;
overflow: hidden;
margin-bottom: 30px;
.portrait {
width: 175px;
float: left;
margin-bottom: 15px;
}
.portrait span {
text-align: center;
font-size: 24px;
display: block;
height: 62px;
line-height: 68px;
color: #444;
}
.portrait img {
display: block;
/* margin: 84px auto; */
max-width: 100%;
border: 0;
width: 124px;
height: 124px;
border-radius: 110px;
margin-top: 84px;
margin-left: 22px;
}
.info-list {
margin-left: 190px;
}
.info-list .list-title {
display: block;
width: 250px;
height: 40px;
background: #eee;
line-height: 40px;
text-align: center;
margin: 10px 0 30px;
}
.detail-info {
width: 48%;
height: 50px;
line-height: 50px;
display: inline-block;
.info-name {
color: #b0b0b0;
font-size: 24px;
}
&:nth-child(2) {
width: 100%;
}
}
}
.my-swiper-button-prev,
.my-swiper-button-next {
position: absolute;
top: 50%;
margin-top: -44px;
width: 48px;
height: 48px;
color: #666;
font-size: 48px;
cursor: pointer;
&.swiper-button-disabled {
opacity: 0.3;
}
}
.next-grey {
right: 30px;
left: auto;
}
.prev-grey {
right: auto;
left: 30px;
}
.tag-container {
position: absolute;
top: 40px;
left: 108px;
z-index: 2;
height: 35px;
color: #fff;
font-size: 20px;
line-height: 35px;
.good-tag {
display: inline-block;
box-sizing: border-box;
margin-left: 0.5px;
padding: 0 5px;
text-align: center;
font-size: 18px;
height: 35px;
line-height: 35px;
vertical-align: top;
}
.new-tag {
background-color: #78dc7e;
color: #fff;
}
.hot-tag {
width: 60px;
background-color: #ff575c;
color: #fff;
}
.renew-tag {
background-color: #78dc7e;
color: #fff;
}
.sale-tag {
background-color: #ff575c;
color: #fff;
}
.new-festival-tag {
color: #000;
width: 120px;
background-image: url("../../../img/product/new-festival.png");
background-repeat: no-repeat;
background-color: #fff;
background-size: 120px 38px;
}
.yohood-tag {
background-color: #000;
color: #fff;
}
.limit-tag {
border: 1px solid #000;
background-color: #fff;
color: #000;
line-height: 33px;
}
.soon-sold-out-tag {
background-color: #ffac5b;
color: #fff;
}
.is-presell {
background-color: #000;
color: #fff;
width: 60px;
}
}
.banner-container {
position: relative;
background-color: #fff;
min-height: 660px;
}
.banner-top-single {
overflow: hidden;
margin: 0 auto;
img {
margin-top: 30px;
margin-bottom: 30px;
width: 448px;
}
&.hover {
position: fixed;
width: 100%;
background-color: black;
height: 100%;
top: 0;
left: 0;
right: 0;
border: 0;
z-index: 999;
display: -webkit-flex;
display: -moz-flex;
display: -ms-flex;
display: -o-flex;
display: flex;
-ms-align-items: center;
align-items: center;
img {
margin-top: initial;
margin-bottom: initial;
width: 100%;
}
}
}
.banner-top {
position: relative;
overflow: hidden;
min-height: 660px;
display: flex;
align-items: center;
&.hover {
position: fixed;
width: 100%;
background-color: black;
height: 100%;
top: 0;
left: 0;
right: 0;
border: 0;
z-index: 999;
.banner-swiper {
width: 100%;
height: auto;
margin: 0 !important;
overflow: initial !important;
max-height: initial !important;
ul {
max-height: initial !important;
}
}
.swiper-pagination-bullet-active {
background-color: #fff !important;
}
}
.swiper-pagination {
position: absolute;
bottom: 40px;
z-index: 2;
.pagination-inner {
span {
background-color: #b0b0b0;
}
.swiper-pagination-bullet {
margin-right: 2PX;
}
.swiper-pagination-bullet-active {
background-color: #000;
}
}
}
}
.banner-swiper {
overflow: hidden;
margin: 30px 96px;
width: 448px;
min-height: 600px;
ul {
position: relative;
height: auto;
li {
float: left;
img {
height: auto;
}
}
}
}
.goods-name {
box-sizing: border-box;
padding: 20px 28px;
width: 100%;
background-color: #515150;
color: #fff;
.name {
font-size: 28px;
line-height: 48px;
}
.activity-phrase {
display: table-cell;
height: 40px;
background: #d0021b;
padding: 0 10px;
border-radius: 6px;
font-size: 24px;
line-height: 40px;
margin-right: 10px;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-top: 3px;
float: left;
}
}
.goods-subtitle {
display: flex;
align-items: center;
padding-right: 28px;
padding-left: 28px;
height: 88px;
border-bottom: 1px solid $borderC;
background-color: $pageBgC;
color: $subFontC;
font-size: 24px;
span {
display: -webkit-box;
overflow: hidden;
margin: 0;
text-overflow: ellipsis;
line-height: 36px;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
.phrase {
color: #000;
}
.price-date,
.brand-coupon {
position: relative;
padding-right: 30px;
padding-left: 30px;
width: 100%;
height: 88px;
border-bottom: 1px solid $borderC;
background-color: #fff;
color: $subFontC;
}
.brand-coupon {
font-size: 28px;
line-height: 88px;
.promotion-icon {
line-height: 36px;
background-color: #d0021b;
color: #fff;
padding: 0 4px;
border-radius: 4px;
margin-right: 10px;
font-size: 22px;
float: left;
margin-top: 26px;
}
span {
color: $mainFontC;
}
.iconfont {
font-size: inherit;
}
.font-right {
color: $subFontC;
}
.font-quan {
color: $basicBtnC;
margin-right: 15px;
}
}
.limit-sale {
position: absolute;
top: 50%;
right: 24px;
margin-top: -24px;
padding: 4px 20px;
height: 48px;
border: 2PX solid #d0021b;
border-radius: 40px;
background-color: #fff;
color: #d0021b;
font-weight: bold;
font-size: 24px;
}
.limit-sale:active {
background-color: #f0f0f0;
}
.got-limit-sale {
position: absolute;
top: 24px;
right: 84px;
padding: 4px 20px;
border: 2px solid #d0021b;
border-color: #ccc;
border-radius: 40px;
background-color: #fff;
color: #d0021b;
color: #ccc;
font-weight: bold;
font-size: 24px;
}
.goods-price {
float: left;
font-size: 34.59px;
h2 {
display: inline-block;
line-height: 88px;
}
.seckill-price,
.current-price {
margin-right: 10px;
color: #d0021b;
}
.previous-price {
text-decoration: line-through;
}
}
.student-price {
float: left;
height: 88px;
line-height: 88px;
.student-name {
background-color: #d0021b;
font-size: 20px;
padding: 5px 10px;
color: #fff;
border-radius: 8px;
margin-right: 15px;
}
.red {
color: #d0021b;
}
}
.period-of-market {
padding: 0 30px;
background-color: #fff;
line-height: 54px;
color: #b0b0b0;
font-size: 24px;
border-bottom: 1px solid #e0e0e0;
h2 {
display: inline-block;
line-height: 88px;
}
}
.seckill-time {
float: right;
color: #d0021b;
font-size: 24px;
span {
display: inline-block;
line-height: 88px;
}
.seckill-time-pic {
background-color: #d0021b;
color: #fff;
line-height: 35px;
font-size: 18px;
padding: 0 10px;
border-radius: 5px;
margin-right: 5px;
vertical-align: middle;
}
}
.seckill-chose {
position: absolute;
bottom: 0;
right: 0;
}
.limit-num-text {
color: #d0021b;
font-size: 30px;
line-height: 80px;
position: absolute;
left: 380px;
bottom: 0;
background: #fff;
z-index: 1;
}
.seckill-time-border {
border: solid 1px #d0021b;
margin-top: 26px;
border-radius: 19px;
padding: 0 10px;
span {
line-height: 34px;
}
}
.vip-level {
box-sizing: border-box;
padding-right: 28px;
padding-left: 28px;
min-height: 88px;
border-bottom: 1px solid $borderC;
background-color: #fff;
color: #999;
font-size: 22px;
.icons-item {
float: left;
margin: 0;
width: 33.3%;
height: 88px;
&.current-level {
.vip-price {
color: #d0021b;
}
}
span {
display: inline-block;
padding-left: 8px;
padding-top: 5px;
vertical-align: middle;
line-height: 88px;
}
.vip-img {
width: 53px;
height: 32px;
}
&:nth-child(1) {
text-align: left;
.vip-img {
background: url("../../../img/product/silver.png") no-repeat;
background-size: contain;
}
}
&:nth-child(2) {
.vip-img {
background: url("../../../img/product/golden.png") no-repeat;
background-size: contain;
}
}
&:nth-child(3) {
text-align: right;
.vip-img {
background: url("../../../img/product/platinum.png") no-repeat;
background-size: contain;
}
}
}
}
.goods-discount {
padding-top: 0;
display: block;
width: 100%;
height: auto;
border-bottom: 1px solid $borderC;
background-color: #fff;
color: $mainFontC;
font-size: 28px;
h2 {
position: relative;
padding: 30px 60px 30px 30px;
line-height: 36px;
}
.coin-item > .promotion-icon,
.first-item > .promotion-icon,
.folder-item > .promotion-icon {
background-color: #d0021b;
color: #fff;
padding: 0 4px;
border-radius: 4px;
margin-right: 10px;
font-size: 22px;
float: left;
}
.short-text {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.iconfont {
position: absolute;
top: 30px;
right: 36px;
width: 35px;
color: #e0e0e0;
font-size: 45px;
}
.discount-folder {
display: none;
.folder-item {
border-top: 1px solid $borderC;
}
}
}
.enter-store {
position: relative;
overflow: hidden;
padding: 0 180px 0 114px;
background-color: #fff;
text-overflow: ellipsis;
white-space: nowrap;
line-height: 84px;
.store-logo {
position: absolute;
top: 1px;
left: 0;
margin-left: 30px;
width: 68px;
height: 84px;
text-align: center;
font-size: 0;
img {
display: inline-block;
width: auto;
height: 68px;
vertical-align: middle;
}
}
.store-name {
color: $mainFontC;
font-size: 34px;
}
.store-link {
position: absolute;
top: 1px;
right: 0;
padding-right: 30px;
color: $subFontC;
text-align: right;
font-size: 28px;
span {
font-size: inherit;
}
}
}
.feedback-list {
margin-top: 20px;
margin-bottom: 20px;
background-color: #f0f0f0;
.nav-tab {
width: 100%;
padding: 10px 0;
background-color: #fff;
border-top: 1px solid $borderC;
border-bottom: 1px solid $borderC;
}
.comment-nav,
.consult-nav {
box-sizing: border-box;
float: left;
width: 50%;
height: 60px;
line-height: 60px;
font-size: 28px;
text-align: center;
color: $subFontC;
&.focus {
color: #000;
}
}
.comment-nav {
border-right: 1px solid #ccc;
}
.content-main {
background-color: #fff;
border-bottom: 1px solid $borderC;
}
.content-main.comment-content-main {
.user-name {
font-size: 24px;
line-height: 62px;
height: 62px;
color: $mainFontC;
padding-left: 28px;
float: left;
}
.pd-right {
padding-right: 18px;
}
.user-info {
max-width: 100%;
}
.goods-spec {
max-width: 45%;
display: inline-block;
overflow: hidden;
height: 62px;
float: left;
white-space: nowrap;
text-overflow: ellipsis;
}
.goods-size {
float: left;
line-height: 62px;
}
.goods-spec,
.comment-time {
font-size: 24px;
line-height: 62px;
}
.comment-reply {
margin: 15px 28px 0 28px;
padding: 28px;
background: #f0f0f0;
box-sizing: border-box;
line-height: 32px;
color: #999;
font-size: 26px;
}
.detail-content {
color: $mainFontC;
font-size: 28px;
line-height: 36px;
padding-left: 28px;
padding-right: 28px;
}
.goods-spec,
.detail-content {
color: $mainFontC;
}
.detail-content,
.comment-time {
padding-left: 28px;
}
.comment-time {
color: #c1c1c1;
}
}
.content-main.consult-content-main {
padding: 20px 28px;
.question {
font-size: 24px;
color: $mainFontC;
span {
display: block;
float: left;
font-size: inherit;
padding-right: 15px;
}
p {
overflow: hidden;
}
}
.time {
font-size: 22px;
color: $subFontC;
}
.answer {
font-size: 24px;
line-height: 36px;
color: $subFontC;
margin-top: 14px;
span {
display: block;
float: left;
font-size: inherit;
color: $mainFontC;
padding-right: 15px;
}
p {
overflow: hidden;
}
}
}
.content-main.no-item {
height: 200px;
line-height: 200px;
color: #e0e0e0;
font-size: 16PX;
text-align: center;
span {
display: inline-block;
font-size: 16PX;
padding-right: 5PX;
}
}
.comment-content-footer,
.consult-content-footer {
display: block;
min-height: 88px;
text-align: center;
background-color: #fff;
border-bottom: 1px solid $borderC;
line-height: 88px;
font-size: 28px;
color: #b0b0b0;
.iconfont {
font-size: inherit;
}
}
.content.hide {
display: none;
}
.nodata {
height: 88px;
font-size: 28px;
line-height: 88px;
background-color: #fff;
padding: 0 28px;
border-top: 1px solid $borderC;
border-bottom: 1px solid $borderC;
.go-consult {
float: right;
color: $subFontC;
span {
font-size: 28px;
}
}
}
}
/*
秒杀倒计时栏
*/
.seckill-count {
position: relative;
position: fixed;
bottom: 120px;
left: 50%;
margin-left: -320px;
z-index: 2;
box-sizing: border-box;
width: 640px;
height: 70px;
text-align: left;
.seckill-count-bg {
background-color: #000;
opacity: 0.7;
width: 640px;
height: 70px;
}
.seckill-count-num {
position: absolute;
top: 0;
left: 0;
padding: 0 30px;
color: white;
width: 640px;
height: 70px;
line-height: 70px;
box-sizing: border-box;
font-size: 28px;
}
}
/*
底部固定栏
*/
.cart-bar {
position: relative;
position: fixed;
bottom: 0;
left: 50%;
margin-left: -320px;
z-index: 2;
box-sizing: border-box;
padding: 20px 28px;
width: 640px;
height: 120px;
border-top: 1px solid $borderC;
background-color: #fff;
a {
display: inline-block;
}
.num-incart {
position: relative;
color: #444;
font-size: 47px;
}
.new-foot-ico {
width: 100px;
text-align: center;
vertical-align: middle;
.iconfont {
color: #444;
font-size: 40px;
line-height: 40px;
}
.tip {
color: #444;
font-size: 15px;
}
&.fav {
.favorite {
color: #ccc;
}
}
&.store {
.iconfont {
width: 42px;
height: 40px;
margin: 0 auto;
}
}
}
.opa {
opacity: 0.4;
}
.favorite {
color: #ccc;
font-size: 34px;
background-color: transparent;
}
.favorite.liked {
color: $basicBtnC !important;
}
.addto-cart,
.sold-out {
width: 260px;
height: 80px;
background-color: $basicBtnC;
color: #fff;
text-align: center;
font-size: 32px;
line-height: 80px;
}
.can-not-buy {
background-color: #ccc;
}
.sold-out {
background-color: #ccc;
}
.num-tag {
position: absolute;
top: -10px;
right: 5px;
display: block;
width: 30px;
height: 30px;
border-radius: 50%;
background: $basicBtnC;
color: #fff;
text-align: center;
font-size: 20px;
line-height: 30px;
&.hide {
display: none;
}
}
.seckill-download-app {
width: 260px;
height: 80px;
line-height: 80px;
font-size: 30px;
text-align: center;
vertical-align: middle;
background-color: #eb0313;
color: #fff;
}
}
.store-good {
.btn-c {
display: none;
}
.fav {
width: 322px;
height: 80px;
line-height: 80px;
background-color: #eb0313;
color: #fff;
border-radius: 4px;
.tip {
color: #fff;
display: inline;
font-size: 24px;
}
.favorite {
color: #eb0313 !important;
}
.iconfont {
display: inline;
vertical-align: middle;
-webkit-text-stroke: 3px #fff;
margin-right: 5px;
font-size: 25px;
}
.liked {
color: #fff !important;
}
.opa {
opacity: 1;
}
}
.new-foot-ico {
margin-right: 20px;
}
.like-btn-c {
margin-right: 0;
}
}
.rec-word {
padding-top: 16px;
padding-left: 30px;
background-color: #fff;
.unfurled {
width: 140px;
height: 50px;
border-radius: 6px;
background: #eee;
line-height: 50px;
text-align: center;
margin: 0 auto;
color: #444;
}
.word-list {
display: none;
> * {
display: inline-block;
font-size: 24px;
border-radius: 6px;
padding: 6px 14px;
margin-right: 24px;
margin-bottom: 16px;
background: #eee;
color: #444;
}
}
}
.recommend-for-you {
border-bottom: none;
padding-left: 15px;
.tag-container {
overflow: hidden;
width: 100%;
height: 0.7rem;
position: static;
}
}
.yoho-tip {
top: 40%;
z-index: 100;
}
.product-desc {
min-height: 200px;
}
}
iframe {
display: none;
}
.is-mars-app {
.good-detail-page {
margin-bottom: 140px;
.addto-cart,
.sold-out {
margin-left: 100px;
}
.addto-cart {
background-color: #000;
}
.cart-bar {
.num-tag {
background-color: #89b374;
}
.new-foot-ico.fav {
display: none;
}
}
.suspend-home {
display: none;
}
}
}
.is-now-app {
.cart-bar {
.fav {
visibility: hidden;
}
}
}
@import "./group-detail";
... ...
... ... @@ -306,3 +306,452 @@
display: none !important;
}
}
.width750 {
.chose-panel {
.main {
padding-bottom: 117px;
}
.close {
width: 35px;
height: 35px;
margin: 19px 19px 0 0;
font-size: 28px;
}
.infos {
padding: 0 35px;
}
.basic-info {
padding-bottom: 35px;
min-height: 222px;
}
.thumb-img {
width: 192px;
min-height: 234px;
top: -70px;
.hover {
position: fixed;
width: 100%;
background-color: black;
height: 100%;
top: 0;
left: 0;
right: 0;
border: 0;
z-index: 999;
align-items: center;
display: flex;
img {
width: 100%;
}
}
}
.text-info {
margin-left: 228px;
margin-top: 35px;
.name {
height: 70px;
font-size: 33px;
}
.price {
font-size: 28px;
}
.sale-price {
margin-right: 18px;
font-size: 33px;
}
.size-info {
font-size: 28px;
margin-top: 6px;
}
}
.color-list,
.size-list,
.num {
padding-left: 94px;
font-size: 33px;
> span {
top: 12px;
}
> span.left-num {
top: 23px;
left: 445px;
}
.left-num-discount {
top: 24px;
left: 444px;
width: 244px;
}
}
.color-list,
.size-list {
margin: 35px 0;
}
.block {
margin-right: 35px;
margin-bottom: 35px;
padding: 0 23px;
min-width: 94px;
max-width: 562px;
height: 70px;
line-height: 70px;
}
.num {
margin-bottom: 23px;
}
.num .btn {
width: 94px;
height: 94px;
line-height: 94px;
}
.good-num {
width: 124px;
height: 94px;
line-height: 94px;
}
.btn-wrap {
.btn-sure {
height: 94px;
font-size: 37px;
}
}
}
}
.chose-panel {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 5;
height: 100%;
background: rgba(0, 0, 0, 0.3);
.main {
position: absolute;
right: 0;
bottom: 0;
left: 0;
height: 70%;
background: #fff;
padding-bottom: 100px;
}
.close {
float: right;
width: 60px;
height: 60px;
text-align: center;
line-height: 60px;
color: #b1b1b1;
position: relative;
z-index: 2;
}
.infos {
padding: 0 30px;
height: 100%;
}
.chose-items {
overflow: auto;
height: 60%;
}
.basic-info {
position: relative;
padding-bottom: 30px;
min-height: 190px;
border-bottom: 1PX solid #e6e6e6;
}
.thumb-img {
width: 164px;
min-height: 200px;
position: absolute;
top: -60px;
border: 1PX solid #e6e6e6;
border-radius: 5PX;
}
.text-info {
margin-left: 195px;
height: auto;
margin-top: 30px;
.seckill-time {
position: absolute;
bottom: 30px;
right: 0;
float: none;
}
.choosed-info {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.name {
display: -webkit-box;
overflow: hidden;
height: 60px;
font-size: 28px;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.price {
display: inline;
font-size: 24px;
}
.sale-price {
margin-right: 15px;
color: #d0021b;
font-size: 28px;
&.no-price {
color: #000;
}
}
.market-price {
color: #b0b0b0;
text-decoration: line-through;
}
.size-info {
font-size: 24px;
display: block;
margin-top: 5px;
color: #444;
}
.hide {
display: none;
}
}
.block-list,
.num {
position: relative;
padding-left: 80px;
font-size: 28px;
overflow: hidden;
input.disabled {
border-radius: 0;
background-color: #fff;
color: #000;
opacity: 1;
-webkit-appearance: none;
}
> span {
position: absolute;
top: 10px;
left: 0;
}
> span.left-num {
position: absolute;
top: 20px;
left: 380px;
color: #b0b0b0;
overflow: hidden;
white-space: nowrap;
}
span.disabled {
color: #e6e6e6;
}
.left-num-discount {
color: #e10;
position: absolute;
top: 20px;
left: 380px;
overflow: hidden;
white-space: nowrap;
width: 208px;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
}
}
.block-list {
border-bottom: 1PX solid #e6e6e6;
margin: 30px 0;
}
.block {
display: block;
float: left;
box-sizing: border-box;
margin-right: 30px;
margin-bottom: 30px;
padding: 0 20px;
min-width: 80px;
max-width: 480px;
height: 60px;
border: 1PX solid #444;
text-align: center;
line-height: 60px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
border-radius: 6PX;
&.chosed {
border-color: #e10;
background: #d0021b;
color: #fff;
}
&.zero-stock {
border-color: #e0e0e0;
color: #e0e0e0;
}
&.zero-stock.chosed {
border-color: #e0e0e0;
background: none;
background-color: #c0c0c0;
color: #e0e0e0;
}
}
.num {
margin-bottom: 20px;
}
.num .btn {
display: block;
float: left;
width: 80px;
height: 80px;
border: 1PX solid #e6e6e6;
text-align: center;
line-height: 80px;
&.disable {
color: #e6e6e6;
}
}
.good-num {
float: left;
margin-left: -1px;
padding: 0;
width: 106px;
height: 80px;
border: 1PX solid #e6e6e6;
text-align: center;
line-height: 80px;
}
.btn-plus {
margin-left: -1px;
}
.btn-wrap {
position: fixed;
bottom: 0;
width: 100%;
.btn-sure {
width: 100%;
height: 80px;
border: none;
background: #d0021b;
color: #fff;
font-size: 32px;
}
.btn-sure-buynow {
width: 50%;
height: 80px;
border: none;
background: #444;
color: #fff;
font-size: 32px;
float: left;
}
.btn-sure-addtocart {
width: 50%;
height: 80px;
border: none;
background: #d0021b;
color: #fff;
font-size: 32px;
float: left;
}
}
.discount-gray {
background-color: #e0e0e0;
}
.hover {
position: fixed !important;
width: 100% !important;
background-color: black;
height: 100%;
top: 0 !important;
left: 0;
right: 0;
border: 0;
z-index: 999;
align-items: center;
display: flex;
img {
width: 100%;
}
}
}
.is-mars-app {
.chose-panel {
.block {
&.chosed {
background-color: #89b374;
color: #fff;
border-color: #89b374;
}
}
.btn-wrap {
.btn-sure,
.btn-sure-addtocart {
background-color: #89b374 !important;
color: #fff;
}
}
}
}
... ...
... ... @@ -79,4 +79,12 @@
z-index: 998;
background-color: #fff;
}
.search-divide {
height: 50px;
width: 100%;
padding: 10px 0;
color: #ccc;
text-align: center;
}
}
... ...