Authored by 姜枫

handle merge

{{# classicBrands}}
<div class="brand-img-box {{#if right}}right{{/if}} {{#if bottomSpace}}mb10{{/if}}">
<a href="{{url}}">
<a href="{{url}}" target="_blank">
{{# big}}
<img class="big-img lazy-img" data-original="{{image src 565 340}}" alt="big-img">
{{/ big}}
... ...
... ... @@ -69,14 +69,16 @@
</div>
</div>
</div>
<div class="related-goods goods">
{{# relatedGroup}}
{{> related-goods}}
{{/ relatedGroup}}
<span class="left iconfont">&#xe62c;</span>
<span class="right iconfont">&#xe629;</span>
<div class="related-groups">
<div class="related-goods goods">
{{# relatedGroup}}
{{> related-goods}}
{{/ relatedGroup}}
</div>
</div>
<span class="left iconfont hide">&#xe62c;</span>
<span class="right iconfont">&#xe629;</span>
</div>
{{/ related}}
{{/ content}}
... ... @@ -107,22 +109,22 @@
</div>
{{# userInfo}}
<div class="user-handle">
<ul class="clearfix">
<li id="prise-btn" class="like-status{{# isLike}} liked{{/ isLike}}">
<a href="javascript:;">
<i class="iconfont">&#xe60e;</i>
<span class="like-num">{{likeNum}}</span>
</a>
</li>
<li id="collect-btn" class="sort-collect{{# isCollected}} collected{{/ isCollected}}">
<a href="javascript:;">
<i class="iconfont">&#xe619;</i>
<span>收藏</span>
</a>
</li>
</ul>
</div>
<div class="user-handle">
<ul class="clearfix">
<li id="prise-btn" class="like-status{{# isLike}} liked{{/ isLike}}">
<a href="javascript:;">
<i class="iconfont">&#xe60e;</i>
<span class="like-num">{{likeNum}}</span>
</a>
</li>
<li id="collect-btn" class="sort-collect{{# isCollected}} collected{{/ isCollected}}">
<a href="javascript:;">
<i class="iconfont">&#xe619;</i>
<span>收藏</span>
</a>
</li>
</ul>
</div>
{{/ userInfo}}
{{> share}}
... ...
... ... @@ -43,6 +43,7 @@ const btnMap = {
classStr: 'btn white cancel-btn mr'
},
{
isEditBtn: true,
name: '修改订单',
classStr: 'btn white edit-btn'
}
... ... @@ -518,6 +519,12 @@ const getOrderDetail = (uid, code) => {
}
});
if (detail.canUpdateDeliveryAddress === 'N') {
_.remove(detail.btns, btn => {
return btn.isEditBtn;
});
}
if (parseInt(detail.paymentType, 10) === 2 &&
(statusMap[st].valueStr === '备货中' ||
detail.statusStr === '备货中')) {
... ...
... ... @@ -34,7 +34,10 @@ const _doPassportCallback = (req, res, user) => {
if (user.openId && user.nickname) {
let signinByOpenID = LoginService.signinByOpenIDAsync(
user.nickname, user.openId, user.sourceType, shoppingKey, user.unionId);
_.trim(user.nickname), _.trim(user.openId),
_.trim(user.sourceType), _.trim(shoppingKey),
_.trim(user.unionId)
);
return signinByOpenID.then((result) => {
if (result.code !== 200) {
... ...
... ... @@ -140,11 +140,11 @@ const getProductItemData = (params, url, uid) => {
* 获取商品尺寸,颜色,和缩略图
* @function getProductInfo
* @param { Number } productId 商品ID
* @param { String } uid 用户ID
* @param { Number } skn 商品skn
* @param { String } uid 用户ID
* @return { Object } 接口返回单个商品的基本信息
*/
const getProductInfo = (productId, uid, skn) => {
const getProductInfo = (productId, skn, uid) => {
return itemApi.getProductBaseAsync(productId, uid, skn).then(result => {
return itemFun.setProductData(result);
});
... ...
... ... @@ -44,11 +44,11 @@ exports.lte = (num1, num2, options) => {
* @return {[boolen]}
*/
exports.showStorage = (leftNumber) => {
leftNumber = typeof num1 === 'number' ? leftNumber : parseFloat(leftNumber, 10);
leftNumber = +leftNumber;
if (leftNumber <= 3 && leftNumber >= 0) {
if (leftNumber <= 3 && leftNumber > 0) {
return `仅剩${leftNumber}件`;
} else if (leftNumber < 0) {
} else if (leftNumber <= 0) {
return '库存不足';
}
};
... ...
... ... @@ -22,7 +22,7 @@ exports.notFound = () => {
});
}
return res.display('error/404', {
return res.status(404).display('error/404', {
module: 'common',
page: 'error',
title: '页面不存在 | Yoho!BLK | 潮流购物逛不停'
... ... @@ -50,7 +50,7 @@ exports.serverError = () => {
}
renderErrPage = (result) => {
res.display('error/500', {
res.status(500).display('error/500', {
module: 'common',
page: 'error',
err: err,
... ...
... ... @@ -4,11 +4,11 @@
* @return {[boolen]}
*/
module.exports = function(leftNumber) {
leftNumber = typeof num1 === 'number' ? leftNumber : parseFloat(leftNumber, 10);
leftNumber = +leftNumber;
if (leftNumber <= 3 && leftNumber >= 0) {
if (leftNumber <= 3 && leftNumber > 0) {
return '仅剩' + leftNumber + '件';
} else if (leftNumber < 0) {
} else if (leftNumber <= 0) {
return '库存不足';
}
};
... ...
/* eslint-disable */
/**
* Created by TaoHuang on 2016/7/29.
*/
... ...
... ... @@ -17,6 +17,19 @@ function showOrNot() {
}
}
function reposReturnTop() {
var $top = $returnTop.parent();
if (!$top.hasClass('service-top')) {
$top = $returnTop;
}
if ($(window).width() < 1380) {
$top.addClass('for-min');
} else {
$top.removeClass('for-min');
}
}
$returnTop.click(function() {
$('html,body').animate({
scrollTop: 0
... ... @@ -36,4 +49,10 @@ if ($returnTop.hasClass('hide')) {
$('img').load(showOrNot);
}
reposReturnTop();
if ($returnTop.length) {
$(window).resize(reposReturnTop);
}
exports.returnTopShowOrNot = showOrNot;
... ...
... ... @@ -17,10 +17,14 @@ var $commentList = $commentArea.find('.comments-wrap'),
MAX_COMMENTS_WORDS = 100,
$wordCountTip = $('#word-count-tip'),
_alert = dialog.Alert,
tag = $('#tags').find('li').length;
tag = $('#tags').find('li').length,
leng = $('.goods').find('.good-info').length / 4,
pag = 0;
require('../plugins/share');
// require('yoho-unslider');
$('#prise-btn').click(function() {
var prising = false,
url,
... ... @@ -192,10 +196,37 @@ if ($('.collocation').find('.good-info').length === 0) {
if ($('.goods').find('.good-info').length === 0) {
$('.related-group').hide();
} else if ($('.goods').find('.good-info').length < 5) {
$('.left').hide();
$('.right').hide();
}
// $('.left').click(function {
// $('.goods').animate({ left: '+50px' }, "slow");
// })
$('.right').click(function() {
pag = pag + 1;
if (pag === leng - 1) {
$('.right').addClass('hide');
}
if (pag !== 0) {
$('.left').removeClass('hide');
}
$('.goods').animate({left: '+=-930px'});
});
$('.left').click(function() {
var $goods = $('.goods');
pag = pag - 1;
if (pag === 0) {
$('.left').addClass('hide');
}
// console.log($('.goods').offsetWidth()
if (pag !== leng - 1) {
$('.right').removeClass('hide');
}
$goods.animate({left: '+=930px'});
});
... ...
... ... @@ -253,14 +253,15 @@ $('#keep-shopping').click(function() {
$('#brand-fav').click(function() {
var $this = $(this),
info = $this.data(),
param = {};
param = {
brandId: $this.data('id'),
type: 'add'
};
if (!info.id) {
if (!param.brandId) {
return;
}
param.brandId = info.id;
if ($this.hasClass('coll')) {
param.type = 'cancel';
}
... ...
... ... @@ -72,8 +72,8 @@ $(function() {
// 编辑商品颜色和属性
Cart.editColorOrSize(
$this.attr('data-productId'),
$this.attr('data-productSkn'),
$this.attr('data-productid'),
$this.attr('data-productskn'),
$this.find('.default-color').text(),
$this.find('.default-size').text(), function() {
editable = true;
... ...
... ... @@ -124,7 +124,6 @@ Cart = {
Util.refreshCart(res, function() {
Stepper.init();
dotName();
if (callback) {
return callback();
}
... ... @@ -148,7 +147,6 @@ Cart = {
if (res.code === 200) {
Util.refreshCart(res, function() {
Stepper.init();
dotName();
});
} else {
new _alert(res.message).show();
... ... @@ -219,7 +217,6 @@ Cart = {
success: function(res) {
Util.refreshCart(res, function() {
Stepper.init();
dotName();
// 显示或者更新删除商品模块
Cart.showRemovedProducts(products, extraInfos);
... ... @@ -314,7 +311,6 @@ Cart = {
success: function(res) {
Util.refreshCart(res, function() {
Stepper.init();
dotName();
if (callback) {
return callback();
... ... @@ -334,7 +330,6 @@ Cart = {
success: function(res) {
Util.refreshCart(res, function() {
Stepper.init();
dotName();
});
}
});
... ...
... ... @@ -11,8 +11,15 @@
position: relative;
h4 {
height: 18px;
line-height: 18px;
padding-right: 10px;
display: -webkit-box;
font-size: 16px;
font-weight: bold;
overflow: hidden;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
p {
... ...
... ... @@ -53,7 +53,7 @@
img {
width: 1150px;
height: auto;
height: $sliderHeight;
}
}
}
... ...
... ... @@ -79,10 +79,9 @@
border: 1px solid #404040;
border-left: none;
* {
p,
h4 {
display: block;
}
p {
display: -webkit-box;
}
}
... ...
... ... @@ -63,7 +63,7 @@
.dist-name {
font-size: 12px;
display: inline-block;
width: 75px;
width: 66px;
padding: 3px;
text-overflow: ellipsis;
white-space: nowrap;
... ...
... ... @@ -42,8 +42,10 @@
color: #fff;
}
&.min {
margin-left: 505px;
&.for-min {
right: 20px;
left: auto;
margin-left: auto;
}
}
}
... ...
... ... @@ -98,6 +98,10 @@
overflow: hidden;
position: relative;
.collocation {
margin-left: 30px;
}
.btn {
position: relative;
}
... ... @@ -137,8 +141,21 @@
}
}
.related-group {
position: relative;
height: 450px;
}
.related-groups {
width: 930px;
overflow: hidden;
position: relative;
height: 420px;
margin-left: 30px;
}
.related-goods {
padding: 60px 0 0 30px;
padding-top: 60px;
.good-info {
width: 219px;
... ... @@ -173,6 +190,11 @@
.goods {
height: 420px;
overflow: hidden;
position: absolute;
.good-info:nth-child(4n) {
margin-right: 0;
}
}
.related-brand {
... ... @@ -500,4 +522,8 @@
padding-left: 30px;
width: 330px;
}
.hide {
display: none;
}
}
... ...
... ... @@ -34,11 +34,14 @@
-webkit-box-orient: vertical;
}
.good-name-text:hover,
.check-detail:hover {
.good-name-text:hover {
text-decoration: underline;
}
.check-detail:hover {
@extend .blue;
}
.change-tag {
margin: 10px auto 0;
color: #1b1b1b;
... ...