Authored by zhangxiaoru

editorial

... ... @@ -82,7 +82,7 @@ const favorite = {
p.stateText = '已售罄';
}
p.url = `/product/pro_${p.productId}_${p.goodsId}/${p.cnAlphabet}.html`;
p.imageUrl = p.image;
p.imageUrl = p.image.replace('imageMogr2', 'imageMogr1');
});
ret.content.favorite.data = retData;
... ...
... ... @@ -178,6 +178,8 @@ const _convertAddress = (addressList, createTime) => {
// 增加一个默认初始状态
addrList.push({
time: createTime,
city: '默认 ',
hide: true,
action: '您的订单已提交,等待付款'
});
... ... @@ -228,7 +230,7 @@ const _getDetail = (uid, code) => {
uid: uid,
order_code: code
}, {
cache: true
cache: 100
});
};
... ... @@ -248,7 +250,7 @@ const _getUserOrder = (uid, type, page) => {
page: page,
limit: pageSize
}, {
cache: true
cache: 100
}).then(result => {
let orderList = [];
let total = false;
... ... @@ -436,11 +438,13 @@ const getOrderData = (uid, type, page) => {
2: {
emptyMsg: '没有待付款的订单哦~',
btnText: '查看全部订单',
showEmptyEn: true,
url: '/me/'
},
3: {
emptyMsg: '没有待收货的订单哦~',
btnText: '查看全部订单',
showEmptyEn: true,
url: '/me/'
}
};
... ...
... ... @@ -22,7 +22,7 @@
</ul>
<ul class="column city">
{{# addressList}}
<li class="text">{{city}}</li>
<li class="text {{#if hide}}vhide{{/if}}">{{city}}</li>
{{/ addressList}}
</ul>
<ul class="column action">
... ...
... ... @@ -2,7 +2,6 @@
<div class="order">
{{# returnsList}}
{{> common/subtitle}}
{{#if list}}
<div class="table">
<ul class="header">
<li class="info">商品信息</li>
... ... @@ -10,6 +9,7 @@
<li class="op">操作</li>
</ul>
</div>
{{#if list}}
{{#list}}
<div class="table">
{{> order/order-header}}
... ...
... ... @@ -127,16 +127,18 @@ const ShopService = {
brandId: domainInfo.id,
shopId: ''
};
let brandId = domainInfo.id;
if (domainInfo.shopId) {
let shopId = domainInfo.shopId;
let shopIntro = yield ShopService.getShopIntro(shopId, uid);
let brandInfo = yield BrandService.getBrandInfo(brandId, uid);
info.shopId = shopId;
info.name = shopIntro.shopName;
info.info = shopIntro.shopIntro;
info.btnName = '品牌介绍';
info.isFavorite = shopIntro.isFavorite === 'Y';
info.isFavorite = brandInfo.isFavorite === 'Y';
let shopData = yield Promise.all([ShopService.getShopDecorator(shopId),
ShopService.getShopSecondSorts(domainInfo.id, shopId)]);
... ... @@ -152,7 +154,6 @@ const ShopService = {
info.resources = resources;
info.menus = shopMenu(domain, resources.navigationBar);
} else {
let brandId = domainInfo.id;
let brandInfo = yield BrandService.getBrandInfo(brandId, uid);
info.name = brandInfo.brandName;
... ...
... ... @@ -79,7 +79,7 @@
</a>
</li>
<li class="pro-info">
<a class="brand-name" href="/product/shop/{{brand_domain}}">{{brand_name}}</a>
<a class="brand-name" href="/product/shop/{{brand_domain}}" target="_blank">{{brand_name}}</a>
<div class="pro-name"><a href="/product/pro_{{product_id}}_{{goods_id}}/{{cn_alphabet}}.html" target="_blank">{{product_name}}</a></div>
<div class="color-size editable" data-productId="{{product_id}}" id="edit_{{product_id}}" data-productSkn="{{product_skn}}">
{{#if color_name}}
... ... @@ -124,7 +124,7 @@
</a>
</li>
<li class="pro-info">
<a class="brand-name" href="/product/shop/{{brand_domain}}">{{brand_name}}</a>
<a class="brand-name" href="/product/shop/{{brand_domain}}" target="_blank">{{brand_name}}</a>
<div class="pro-name"><a href="javascript:void(0)">{{product_name}}</a></div>
<div>
{{#if color_name}}
... ...
... ... @@ -54,6 +54,17 @@ if ($('.left-time').length) {
countDown.start();
}
$('body').on('click', function(e) {
if ($(e.target).hasClass('show-package')) {
return false;
}
e.preventDefault();
if (!$('.package-list').hasClass('hide')) {
$('.package-list').addClass('hide');
}
});
$('.show-package').on('click', function() {
$(this).next('.package-list').toggleClass('hide');
... ...
... ... @@ -29,7 +29,7 @@ module.exports = {
var timeStr = min + '分';
if (src <= 0) {
if (parseInt(src, 10) <= 0) {
timeStr = '已失效';
$('.hide-when-invalid').hide();
$('.user-order .table .common-column .pay-operation .left-time').css('margin-left', '0');
... ... @@ -44,8 +44,6 @@ module.exports = {
timeStr = hour + '时' + timeStr;
}
timeStr = '剩余' + timeStr;
if (this.addtionalMsg.length > 0) {
timeStr += this.addtionalMsg;
}
... ...
... ... @@ -12,11 +12,11 @@ function _favBack(data) {
}
}
function _favShop(shopId, isAdd) {
$.post('/product/shop/togglecollect', {shopId: shopId, type: isAdd ? '' : 'add'}, function(data) {
_favBack(data);
});
}
// function _favShop(shopId, isAdd) {
// $.post('/product/shop/togglecollect', {shopId: shopId, type: isAdd ? '' : 'add'}, function(data) {
// _favBack(data);
// });
// }
function _favBrand(brandId, isAdd) {
$.post('/product/brand/togglecollect', {brandId: brandId, type: isAdd ? '' : 'add'}, function(data) {
... ... @@ -26,13 +26,8 @@ function _favBrand(brandId, isAdd) {
$('#brand-fav').click(function() {
var $banner = $(this).parents('.brand-banner');
var shopId = $banner.data('shop');
var brandId = $banner.data('brand');
var isAdd = $(this).hasClass('coled');
if (shopId) {
_favShop(shopId, isAdd);
} else if (brandId) {
_favBrand(brandId, isAdd);
}
_favBrand(brandId, isAdd);
});
... ...
... ... @@ -474,7 +474,7 @@ Cart = {
return false;
});
editTarget.find('.current-sizes .size-item').click(function() {
editTarget.find('.size-item').click(function() {
var $this = $(this);
if ($this.hasClass('current')) {
... ... @@ -484,6 +484,13 @@ Cart = {
$(this).addClass('current').siblings('.current').removeClass('current');
newProductSku = $(this).attr('data-sku');
});
// 初始化size list选中项(其他颜色中第一个尺码)
editTarget.find('.sizes-list.mb10').each(function() {
if ($(this).find('.current').length === 0) {
$(this).find('.size-item').first().addClass('current');
}
});
},
fail: function() {
new _alert('此商品无法编辑颜色和尺寸').show();
... ...
... ... @@ -50,7 +50,7 @@ addressDialogTpl = require('../../../tpl/shopping/address-dialog.hbs');
addressTpl = require('../../../tpl/shopping/address-list.hbs');
// address dialog 数据验证
function validateAddress($el) {
function validateAddress($el, isUpdate) {
var field = {
name: [
{
... ... @@ -72,10 +72,6 @@ function validateAddress($el) {
{
noEmpty: true,
err: '手机号码不能为空'
},
{
regx: /^\d{3}(\d|\*){4}\d{4}$/, // 验证正常数字或者****
err: '手机号码格式不正确'
}
],
phone: [
... ... @@ -95,6 +91,19 @@ function validateAddress($el) {
var pass = true;
// 新增情况下须验证正确的手机号;编辑情况下可通过****的验证
if (isUpdate) {
field.mobile.push({
regx: /^\d{3}(\d|\*){4}\d{4}$/, // 验证正常数字或者****
err: '手机号码格式不正确'
});
} else {
field.mobile.push({
regx: /^\d{11}$/,
err: '手机号码格式不正确'
});
}
for (key in field) {
if (field.hasOwnProperty(key)) {
$cur = $el.find('.address-' + key);
... ... @@ -160,7 +169,7 @@ function addressDialogFactory(opt, $the) {
areaCode;
// 验证输入
if (validateAddress(address.$el)) {
if (validateAddress(address.$el, opt && opt.id)) {
// form value
consignee = $el.find('.address-name').val();
... ...
... ... @@ -22,6 +22,7 @@
width: 100%;
height: 100%;
margin-top: -1px;
margin-left: 0.1px;
}
}
... ...
... ... @@ -110,7 +110,7 @@
}
.error-msg {
color: #c71814;
@extend .blue;
}
.correct-msg {
... ... @@ -119,7 +119,7 @@
.error-msg,
.correct-msg {
font-size: 14px;
font-size: 12px;
padding-left: 5px;
.iconfont {
... ...
... ... @@ -69,4 +69,8 @@
left: 3px;
}
}
.check-all:hover {
@extend .blue;
}
}
... ...
... ... @@ -26,9 +26,19 @@
margin-right: 20px;
}
span {
span:hover {
cursor: pointer;
color: #379ed6;
}
a {
display: block;
width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
&:hover {
cursor: pointer;
color: #379ed6;
}
}
... ...
... ... @@ -14,7 +14,7 @@
{{# sub_express_deatil}}
{{#if @first}}
<div class="tip">
<p>以上为最新跟踪信息<a href='/me/order/detail?orderCode={{order_code}}' target="_blank">查看全部</a></p>
<p>以上为最新跟踪信息<a class="check-all" href='/me/order/detail?orderCode={{order_code}}' target="_blank">查看全部</a></p>
</div>
{{/if}}
{{/ sub_express_deatil}}
... ...
... ... @@ -12,7 +12,7 @@
style="background: {{rgb}}"
data-imageurl="{{image pic 100 134}}"
data-target="{{proId}}-color-{{@index}}"
data-title="{{color}}">
data-title="{{color}}" title="{{color}}">
<span class="inner"></span>
</span>
{{/each}}
... ... @@ -26,13 +26,8 @@
<div class="sizes-list mb10">
{{#each sizes}}
{{#isEqual ../../defaultSize name}}
<span class="size-item mr10 mb10 current {{#isEqual num 0}}disabled{{/isEqual}}"
data-sku="{{sku}}">{{name}}</span>
{{^}}
<span class="size-item mr10 mb10 {{#isEqual num 0}}disabled{{/isEqual}}"
data-sku="{{sku}}">{{name}}</span>
{{/isEqual}}
<span class="size-item mr10 mb10{{#isEqual ../../defaultSize name}} current{{/isEqual}}{{#isEqual num 0}} disabled{{/isEqual}}"
data-sku="{{sku}}">{{name}}</span>
{{/each}}
</div>
</div>
... ...