Authored by yyq

Merge branch 'release/1.0' of git.yoho.cn:fe/yoho-blk into release/1.0

Showing 44 changed files with 276 additions and 135 deletions
... ... @@ -21,15 +21,15 @@ const index = (req, res, next) => {
if (channel === 'women') {
contentCode = '527079e6c46d0f125eb46b835968971b';
name = 'WOMEN首页';
link = 'http://www.yohoblk.com';
link = 'http://www.yohoblk.com/women';
} else if (channel === 'lifestyle') {
contentCode = '94b5ed607b6d565ffc29c2c04be121dc';
name = 'LIFT STYLE首页';
link = 'http://www.yohoblk.com/women';
link = 'http://www.yohoblk.com/lifestyle';
} else {
contentCode = '81886aaa5e82e3741bc1ba1e04ec7706';
name = 'MEN首页';
link = 'http://www.yohoblk.com/lifestyle';
link = 'http://www.yohoblk.com';
}
let appType = 1;
... ...
<div class="ad-banner">
{{#adBanner}}
<a href="{{url}}" target="_blank">
<img class="lazy-img" data-original="{{image src 1150 160}}" title="{{title}}" alt="{{alt}}">
<img class="lazy-img" data-original="{{image src 1150 163}}" title="{{title}}" alt="{{alt}}">
</a>
{{/adBanner}}
</div>
... ...
... ... @@ -2,9 +2,8 @@
<div class="slide-wrapper">
<ul>
{{# slider}}
<li style="{{#if bgColor}}background:{{bgColor}}{{/if}}">
<a href="{{url}}" target= "_blank">
<img class="lazy" data-original="{{image src 1150 570}}" alt="">
<li class="banner-item" style="{{#if bgColor}}background-color:{{bgColor}}{{/if}}; background-image:url('{{image src 1150 570}}')">
</a>
{{# tips}}
<div class="slide-tips">
... ...
... ... @@ -124,7 +124,7 @@ const list = (req, res) => {
},
{
pathTitle: '资讯',
name: req.query.query
name: req.query.query || result.authorName
}
],
pathTitle: req.query.query || result.authorName,
... ...
... ... @@ -36,6 +36,7 @@ const _processListData = (list) => {
});
_.forEach(list.list.artList, (data) => {
// console.log(data)
if (data.author) {
listData = _.assign(listData, {
... ... @@ -151,7 +152,6 @@ const _processHeadData = (list) => {
_.forEach(list, function(data, index) {
if (index === 0) {
data.isPraise = data.isPraise === 'Y';
data.isFavor = data.isFavor === 'Y';
... ... @@ -340,13 +340,19 @@ const _processContentData = (list) => {
* @param id
* @returns {*}
*/
const _getHeadData = (id, uid, udid, appType) => {
return serviceAPI.get('/guang/api/*/article/getArticleBaseInfo', {
let par = {
id: id,
uid: uid,
udid: udid,
app_type: appType
}).then((result) => {
};
if (uid) {
par.uid = uid;
}
return serviceAPI.get('/guang/api/*/article/getArticleBaseInfo', par).then((result) => {
if (result && result.code === 200) {
return result.data;
} else {
... ...
/**
* [个人中心]收货地址
* @author: jiangmin
* @date: 2016/07/05
*/
... ... @@ -23,10 +22,11 @@ const _setDefault = (id, uid) => {
const index = (req, res, next) => {
let uid = req.user.uid;
addressModel.getAddressDataAsync(uid, 20).then(result => {
let resultData = result.data ? result.data : result;
let length = resultData.length ? (resultData.length > 7 ? 7 : resultData.length) : 0;
Promise.all([addressModel.getAddressDataAsync(uid, 20), mcHandler.getMeThumb()]).then(result => {
let resultData = result[0].data ? result[0].data : [];
let length = resultData.length > 7 ? 7 : resultData.length;
let reg = /(\d{3})\d{4}(\d{4})/;
let thumb = result[1];
for (let i = 0; i < length; i++) {
resultData[i].default = resultData[i].is_default === 'Y';
... ... @@ -34,6 +34,7 @@ const index = (req, res, next) => {
}
resultData.leftLength = 7 - length;
resultData.length = length;
res.display('index', {
module: 'me',
page: 'address',
... ... @@ -41,7 +42,7 @@ const index = (req, res, next) => {
content: {
nav: mcHandler.getMeCrumb('收货地址'),
navigation: mcHandler.getSideMenu('收货地址'),
banner: 'http://placehold.it/150x120',
banner: thumb,
address: true,
title: '收货地址',
data: resultData
... ...
... ... @@ -47,14 +47,16 @@ const index = (req, res, next) => {
let date2 = getDate(beginTime);
let selectIndex = parseInt((date1 - date2) / (90 * 3600 * 24), 10);
currencyModel.getIndexData(uid, page, queryType, beginTime).then(result=> {
result.list.tabs[queryType].isActive = true;
result.list.coinList.forEach(function(x) {
Promise.all([currencyModel.getIndexData(uid, page, queryType, beginTime), mcHandler.getMeThumb()]).then(result => {
const thumb = result[1];
result[0].list.tabs[queryType].isActive = true;
result[0].list.coinList.forEach(function(x) {
x.date = x.date.replace(/\-/g, '.');
});
result.list.selects[selectIndex > 2 ? 2 : selectIndex].isSelected = 'selected';
if (result.list.paginationOpts) {
result.list.paginationOpts.queryParams = {
result[0].list.selects[selectIndex > 2 ? 2 : selectIndex].isSelected = 'selected';
if (result[0].list.paginationOpts) {
result[0].list.paginationOpts.queryParams = {
queryType: queryType,
beginTime: beginTime
};
... ... @@ -67,16 +69,16 @@ const index = (req, res, next) => {
content: {
nav: mcHandler.getMeCrumb('我的YOHO币'),
navigation: mcHandler.getSideMenu('我的YOHO币'),
banner: 'http://placehold.it/150x120',
banner: thumb,
currency: true,
tabs: result.list.tabs,
tabs: result[0].list.tabs,
title: '我的YOHO币',
currentYear: new Date().getFullYear(),
data: result.list.coinList,
paginationOpts: result.list.paginationOpts,
num: result.num.data,
selects: result.list.selects,
total: result.list.total ? result.list.total : 0
data: result[0].list.coinList,
paginationOpts: result[0].list.paginationOpts,
num: result[0].num.data,
selects: result[0].list.selects,
total: result[0].list.total ? result[0].list.total : 0
}
});
}).catch(next);
... ...
... ... @@ -36,13 +36,15 @@ const favorite = {
}
};
FavoriteData.getFavoriteProduct({
Promise.all([FavoriteData.getFavoriteProduct({
page: 1,
limit: 500,
uid: uid
}).then(result => {
if (result && result.code === 200 && result.data) {
let data = camelCase(result.data);
}), mcHandler.getMeThumb()]).then(result => {
let thumb = result[1];
if (result[0] && result[0].code === 200 && result[0].data) {
let data = camelCase(result[0].data);
let retData = {
siteUrl: config.siteUrl
};
... ... @@ -80,16 +82,15 @@ 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;
ret.content.banner = thumb;
}
res.display('index', ret);
}).catch(next);
},
// 品牌收藏页
... ... @@ -115,13 +116,15 @@ const favorite = {
}
};
FavoriteData.getFavoriteBrand({
Promise.all([FavoriteData.getFavoriteBrand({
page: page,
limit: limit,
uid: uid
}).then(result => {
if (result && result.code === 200 && result.data) {
let data = camelCase(result.data);
}), mcHandler.getMeThumb()]).then(result => {
let thumb = result[1];
if (result[0] && result[0].code === 200 && result[0].data) {
let data = camelCase(result[0].data);
let retData = {
siteUrl: config.siteUrl
};
... ... @@ -148,6 +151,7 @@ const favorite = {
});
}
ret.content.favorite.data = retData;
ret.content.banner = thumb;
}
res.display('index', ret);
... ... @@ -177,13 +181,15 @@ const favorite = {
}
};
FavoriteData.getFavoriteEditoreial({
Promise.all([FavoriteData.getFavoriteEditoreial({
uid: uid,
page: page,
limit: limit
}).then(result => {
if (result && result.code === 200 && result.data) {
let data = camelCase(result.data);
}), mcHandler.getMeThumb()]).then(result => {
let thumb = result[1];
if (result[0] && result[0].code === 200 && result[0].data) {
let data = camelCase(result[0].data);
let retData = {
siteUrl: config.siteUrl,
editorialList: data.data
... ... @@ -199,6 +205,7 @@ const favorite = {
};
ret.content.favorite.data = retData;
ret.content.banner = thumb;
}
res.display('index', ret);
}).catch(next);
... ...
... ... @@ -43,10 +43,24 @@ const refund = (req, res, next) => {
return next();
}
returns.getRefundGoodsData(code, uid).then(result => {
// returns.getRefundGoodsData(code, uid).then(result => {
// res.display('index', {
// page: 'refund',
// content: result
// });
// }).catch(next);
Promise.all([returns.getRefundGoodsData(code, uid), mcHandler.getMeThumb()]).then(result => {
let refundGoods = result[0];
let thumb = result[1];
res.display('index', {
page: 'refund',
content: result
content: Object.assign({
nav: mcHandler.getMeCrumb('我的退/换货'),
navigation: mcHandler.getSideMenu('我的退/换货'),
banner: thumb
}, refundGoods)
});
}).catch(next);
};
... ... @@ -85,10 +99,17 @@ const refundDetail = (req, res, next) => {
return next();
}
returns.getRefundDetailData(applyId, uid).then(result => {
Promise.all([returns.getRefundDetailData(applyId, uid), mcHandler.getMeThumb()]).then(result => {
let refundDetailData = result[0];
let thumb = result[1];
res.display('index', {
page: 'refund-detail',
content: result
content: Object.assign({
nav: mcHandler.getMeCrumb('我的退/换货'),
navigation: mcHandler.getSideMenu('我的退/换货'),
banner: thumb
}, refundDetailData)
});
}).catch(next);
};
... ... @@ -100,15 +121,18 @@ const exchange = (req, res, next) => {
const code = parseInt(req.query.orderCode, 10);
const uid = req.user.uid;
returns.getChangeGoodsList(code, uid).then(result => {
Promise.all([returns.getChangeGoodsList(code, uid), mcHandler.getMeThumb()]).then(result => {
let exchangeData = result[0];
let thumb = result[1];
res.display('index', {
page: 'exchange',
isMe: true,
content: Object.assign({
nav: mcHandler.getMeCrumb('我的退/换货'),
navigation: mcHandler.getSideMenu('我的退/换货'),
banner: 'http://placehold.it/{width}x{height}'
}, result)
banner: thumb
}, exchangeData)
});
}).catch(next);
};
... ... @@ -136,7 +160,8 @@ const exchangeDeatail = (req, res) => {
let id = parseInt(req.query.orderCode, 10),
uid = req.user.uid;
returns.getExchangeDetailData(id, uid).then(result => {
Promise.all([returns.getExchangeDetailData(id, uid), mcHandler.getMeThumb()]).then(result => {
let thumb = result[1];
res.display('index', {
page: 'exchange-detail',
... ... @@ -144,14 +169,13 @@ const exchangeDeatail = (req, res) => {
content: {
nav: mcHandler.getMeCrumb('我的退/换货'),
navigation: mcHandler.getSideMenu('我的退/换货'),
banner: 'http://placehold.it/{width}x{height}',
banner: thumb,
returns: {
title: '换货申请',
exchange: result.exchangeDetail
exchange: result[0].exchangeDetail
}
}
});
});
};
... ...
... ... @@ -79,26 +79,28 @@ const _getTitle = (type)=> {
const index = (req, res, next) => {
let uid = req.user.uid;
settingModel.getUserInfo(uid).then(result=> {
result.info.gender ? result.genders[result.info.gender - 1].checked = true :
result.genders[2].checked = true;
result.info.head_ico = result.info.head_ico ? helpers.image(result.info.head_ico, 400, 300, 2) : '';
result.info.mobile = result.info.mobile ? result.info.mobile.replace(regMobile, '$1****$2') : '';
result.stepUrl = '/me/setting/step1';
if (result.info.birthday) {
let a = result.info.birthday.split('-');
_.forEach(result.date.selectYear, function(x) {
Promise.all([settingModel.getUserInfo(uid), mcHandler.getMeThumb()]).then(result => {
const thumb = result[1];
result[0].info.gender ? result[0].genders[result[0].info.gender - 1].checked = true :
result[0].genders[2].checked = true;
result[0].info.head_ico = result[0].info.head_ico ? helpers.image(result[0].info.head_ico, 400, 300, 2) : '';
result[0].info.mobile = result[0].info.mobile ? result[0].info.mobile.replace(regMobile, '$1****$2') : '';
result[0].stepUrl = '/me/setting/step1';
if (result[0].info.birthday) {
let a = result[0].info.birthday.split('-');
_.forEach(result[0].date.selectYear, function(x) {
if (x.value === a[0]) {
x.isSelected = 'selected';
}
});
_.forEach(result.date.selectMonth, function(x) {
_.forEach(result[0].date.selectMonth, function(x) {
if (parseInt(x.value, 10) === parseInt(a[1], 10)) {
x.isSelected = 'selected';
}
});
_.forEach(result.date.selectDay, function(x) {
_.forEach(result[0].date.selectDay, function(x) {
if (parseInt(x.value, 10) === parseInt(a[2], 10)) {
x.isSelected = 'selected';
}
... ... @@ -112,10 +114,10 @@ const index = (req, res, next) => {
content: {
nav: mcHandler.getMeCrumb('个人设置'),
navigation: mcHandler.getSideMenu('个人设置'),
banner: 'http://placehold.it/150x120',
banner: thumb,
setting: true,
title: '个人设置',
userInfo: result
userInfo: result[0]
}
});
}).catch(next);
... ...
... ... @@ -62,7 +62,7 @@ const navigation = [
const getMeCrumb = name => {
return [
{
link: blk.config.sitUrl,
link: blk.config.siteUrl,
name: 'YOHO!BLK首页'
},
{
... ...
... ... @@ -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/'
}
};
... ...
... ... @@ -7,7 +7,7 @@
<a href="/me/collection"><span class="badge"></span>商品收藏</a>
</li>
<li class="{{#if brand}}active{{/if}}">
<a href="/me/collection/brand"><span class="badge"></span>店铺收藏</a>
<a href="/me/collection/brand"><span class="badge"></span>品牌收藏</a>
</li>
<li class="{{#if editorial}}active{{/if}}">
<a href="/me/collection/editorial"><span class="badge"></span>资讯收藏</a>
... ...
{{# data}}
{{#if total}}
<div class="favorite-brands">
<span class="num">您共收藏了{{total}}个品牌</span>
<div class="brands-list clearfix">
{{#each brandList}}
<div class="brand-raw clearfix">
... ...
... ... @@ -2,6 +2,7 @@
{{#if total}}
<div class="favorite-editorials">
<span class="num">您共收藏了{{total}}篇文章</span>
<div class="editorial-list clearfix">
{{#each editorialList}}
<div class="editorial-raw clearfix" data-id="{{id}}">
... ...
... ... @@ -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}}
... ...
... ... @@ -22,8 +22,8 @@ module.exports = {
},
cookieDomain: 'yohoblk.com',
domains: {
api: 'http://dev-api.yohops.com:9999/', // devapi.yoho.cn:58078 testapi.yoho.cn:28078 devapi.yoho.cn:58078
service: 'http://dev-service.yohops.com:9999/', // testservice.yoho.cn:28077 devservice.yoho.cn:58077
api: 'http://testapi.yoho.cn:28078/', // devapi.yoho.cn:58078 testapi.yoho.cn:28078 devapi.yoho.cn:58078
service: 'http://testservice.yoho.cn:28077/', // testservice.yoho.cn:28077 devservice.yoho.cn:58077
search: 'http://192.168.102.216:8080/yohosearch/'
},
useOneapm: false,
... ...
var $ = require('yoho-jquery'),
Confirm = require('../plugins/dialog').Confirm;
Confirm = require('../plugins/dialog').Confirm,
lazyLoad = require('yoho-jquery-lazyload');
var id = $('.exchange-detail-page').data('id');
... ... @@ -14,6 +15,8 @@ var $expressCompany = $('.express-company'),
var expressList = $editExpress.data(),
remark = $('.reason-info').find('span').text().length;
lazyLoad($('.banner-img'));
function cancelExchangeApply() {
$.ajax({
type: 'POST',
... ...
var colorTpl = require('../../tpl/me/color-list.hbs');
var sizeTpl = require('../../tpl/me/size-list.hbs');
var lazyLoad = require('yoho-jquery-lazyload');
var dialog = require('../plugins/dialog');
var _alert = dialog.Alert;
... ... @@ -9,7 +10,7 @@ var addr;
var addressReg = /^[\s\S]{2,100}$/;
var phoneReg = /^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/;
var phoneReg = /^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])(\*{4}[0-9]{4}|[0-9]{8})$/;
var validate = require('./order/validation');
... ... @@ -42,9 +43,14 @@ var validateMap = {
}
};
lazyLoad($('.banner-img'));
// 添加.check方法
require('../plugins/check');
// 个人中心共用代码加载
require('./me');
function setActive($item) {
var color = $item.find('.color-text').data('color');
var size = $item.find('.size-text').data('size');
... ... @@ -266,6 +272,7 @@ function bindConfirmEvent() {
var $specialReason = $changeGood.find('.special-reason');
var $imgs;
var imgs = [];
var mobile = $('#mob').val();
if ($(this).hasClass('disable')) {
return false;
... ... @@ -312,9 +319,12 @@ function bindConfirmEvent() {
changeData.order_code = $('.returns-wrap>.order').data('code');
changeData.consignee_name = $('#user').val();
changeData.address = $('#addr').val();
changeData.mobile = $('#mob').val();
changeData.delivery_tpye = $('.change-type .type.active').data('type');
if (!/\*/.test(mobile)) {
changeData.mobile = $('#mob').val();
}
submitChange(changeData);
});
}
... ...
... ... @@ -5,6 +5,9 @@ var countDown = require('./order/countdown');
var lazyLoad = require('yoho-jquery-lazyload');
// 个人中心共用代码加载
require('./me');
lazyLoad($('img.lazy'));
function reload() {
... ... @@ -54,6 +57,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');
... ...
... ... @@ -18,21 +18,22 @@ module.exports = {
var leftTime = $item.data('left');
var i = that.intervalValue / 1000;
$item.text(that.convertLeftTime(leftTime - that.count * i));
$item.text(that.convertLeftTime(leftTime - that.count * i, $item));
});
this.count += 1;
},
convertLeftTime: function(src) {
convertLeftTime: function(src, $el) {
var sec = parseInt(src, 10) % 60;
var min = parseInt(src / 60, 10) % 60;
var hour = parseInt(src / 3600, 10);
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');
$el.closest('.order').find('.hide-when-invalid').hide();
$el.css('margin-left', '0');
return timeStr;
}
... ... @@ -44,8 +45,6 @@ module.exports = {
timeStr = hour + '时' + timeStr;
}
timeStr = '剩余' + timeStr;
if (this.addtionalMsg.length > 0) {
timeStr += this.addtionalMsg;
}
... ...
... ... @@ -7,7 +7,7 @@ var addr;
var validate = require('./validation');
var addressReg = /^[\s\S]{2,100}$/;
var phoneReg = /^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/;
var phoneReg = /^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])(\*{4}[0-9]{4}|[0-9]{8})$/;
var validateMap = {
name: {
... ... @@ -142,16 +142,28 @@ function editOrder(onEdit) {
var mobile = $('#user-mobile').val();
var phone = $('#user-phone').val();
$.ajax({
url: '/me/editOrder',
data: {
var d = {
orderCode: code,
areaCode: areaCode,
userName: userName,
address: address,
mobile: mobile,
phone: phone
}
if (/\*/.test(mobile)) {
d = {
orderCode: code,
areaCode: areaCode,
userName: userName,
address: address,
mobile: mobile,
phone: phone
}
}
$.ajax({
url: '/me/editOrder',
data: d
}).done(function(result) {
if (result.code === 200) {
showSuccessMsg(onEdit);
... ...
... ... @@ -25,6 +25,8 @@ require('yoho-jquery-dotdotdot');
require('../common/header'); // header
require('../common/return-top'); // return-top
lazyload($('.banner-img'));
// dot
$('.goods-item .title').dotdotdot({
wrap: 'letter'
... ...
... ... @@ -26,6 +26,8 @@ var imgBoxTpl = require('../../tpl/me/thumbnail.hbs');
var checked;
lazyload($('.banner-img'));
$('.blk-footer .return-top').remove(); // 移除通用的返回顶部组件
require('yoho-jquery-dotdotdot');
... ...
... ... @@ -3,6 +3,9 @@ var lazyLoad = require('yoho-jquery-lazyload');
lazyLoad($('img.banner-img'));
// 个人中心共用代码加载
require('./me');
$('.cancel-apply').on('click', function() {
var id = $(this).data('applyId');
var type = $(this).data('type');
... ...
... ... @@ -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();
... ...
.ad-banner {
height: 160px;
height: 163px;
margin-top: 15px;
img {
... ...
.editorial-container {
$bigImgWidth: 390px;
$smallImgWidth: 358px;
$smallImgHeight: 243px;
$smallImgWidth: 360px;
$smallImgHeight: 240px;
$space: 10px;
@extend .resource-container;
... ... @@ -19,7 +19,7 @@
position: relative;
&.bottom-space {
margin-bottom: 14px;
margin-bottom: 15px;
}
&.right-space {
... ...
.home-page {
$sliderHeight: 600px;
margin: 10px auto 0;
.top-slider-container {
height: $sliderHeight;
}
... ... @@ -12,6 +10,11 @@
left: 0;
right: 0;
height: $sliderHeight;
.banner-item {
background-position: center;
background-repeat: no-repeat;
}
}
.slide-pagination {
... ...
... ... @@ -5,7 +5,7 @@
@extend .resource-container;
height: calc($textHeight+$imgHeight+60px);/* 60px is the height of the floor header */
height: calc($textHeight+$imgHeight+90px);/* 60px is the height of the floor header */
.arrival-item-box {
box-sizing: border-box;
... ...
... ... @@ -21,6 +21,8 @@
img {
width: 100%;
height: 100%;
margin-top: -1px;
margin-left: 0.1px;
}
}
... ...
... ... @@ -202,7 +202,7 @@
}
.brands {
width: 950px;
width: 960px;
padding: 30px 0 30px 30px;
overflow: hidden;
... ... @@ -242,6 +242,10 @@
}
}
.brand:nth-child(7n) {
margin-right: 0;
}
.user-handle {
float: right;
ul {
... ...
... ... @@ -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 {
... ...
.favorite-brands {
position: relative;
.num {
position: absolute;
top: -30px;
left: 600px;
font-size: 16px;
color: #666;
}
.brand-raw > div {
float: left;
... ...
.favorite-editorials {
position: relative;
.num {
position: absolute;
top: -30px;
left: 600px;
font-size: 16px;
color: #666;
}
.editorial-raw > div {
float: left;
... ...
... ... @@ -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>
... ...