Authored by ccbikai(👎🏻🍜)

Merge branch 'master' into release/5.4

Showing 70 changed files with 737 additions and 586 deletions
... ... @@ -76,6 +76,13 @@ app.use(bodyParser.urlencoded({
app.use(cookieParser());
app.use(compression());
const sessionStore = new MemcachedStore({
hosts: config.memcache.session,
prefix: 'yohobuy_session:',
reconnect: 5000,
timeout: 1000,
retries: 0
});
app.use(memcachedSession({
proxy: true,
resave: false,
... ... @@ -87,20 +94,14 @@ app.use(memcachedSession({
domain: 'yohobuy.com',
httpOnly: false
},
store: new MemcachedStore({
hosts: config.memcache.session,
prefix: 'yohobuy_session:',
reconnect: 5000,
timeout: 1000,
retries: 0
})
store: sessionStore
}));
app.use(cookieSession({
requestKey: 'session2',
cookieName: 'yohobuy_session_cookie',
secret: '82dd7e724f2c6870472c89dfa43cf48d',
domain: config.cookieDomain
domain: 'yohobuy.com'
}));
app.use((req, res, next) => {
... ... @@ -118,6 +119,10 @@ app.use((req, res, next) => {
req.session2.sessionBack = req.session;
} else {
req.session = new memcachedSession.Session(req);
req.session.cookie = new memcachedSession.Cookie({
domain: 'yohobuy.com',
httpOnly: false
});
req.session = _.assign(req.session, req.session2.sessionBack);
}
... ... @@ -177,6 +182,6 @@ try {
}
// listener
app.listen(config.port, function() {
app.listen(config.port, function () {
logger.info('yohobuy start');
});
... ...
... ... @@ -2,28 +2,40 @@
const model = require('../models/individuation');
exports.productLst = function(req, res, next) {
let params = {
uid: req.query.uid,
udid: req.query.udid,
newPromotionId: req.query.pid
};
let keys = ['sort', 'misort', 'msort', 'gender', 'brand'],
enumParam = {},
params = {
uid: req.query.uid,
udid: req.query.udid,
promotion: req.query.pid,
specified_sort: req.query.enum,
p_d: req.query.pd,
limit: req.query.limit || 10
};
if (req.query.sort) {
params.sort = req.query.sort;
} else if (req.query.brand) {
params.brand = req.query.brand;
}
if (req.query.enum) {
params.specified_sort = req.query.enum;
}
if (req.query.pd) {
params.p_d = req.query.pd;
}
if (req.query.limit) {
params.limit = req.query.limit;
keys.forEach(function(k) {
if (req.query[k]) {
params[k] = req.query[k];
}
});
if (params.specified_sort) {
if (params.brand) {
enumParam.brands = params.brand.split(',');
params.limit = enumParam.brands.length;
} else if (params.sort) {
enumParam.sorts = params.sort.split(',');
params.limit = enumParam.sorts.length;
} else if (params.misort) {
enumParam.misorts = params.misort.split(',');
params.limit = enumParam.misorts.length;
} else if (params.msort) {
enumParam.msorts = params.msort.split(',');
params.limit = enumParam.msorts.length;
}
}
model.productLst(params).then((result) => {
model.productLst(params, enumParam).then((result) => {
res.jsonp(result);
}).catch(next);
};
\ No newline at end of file
... ...
'use strict';
const api = global.yoho.API;
let _getProduct = function(o) {
if (!o) {
return {};
}
return {
small_sort_id: o.small_sort_id,
middle_sort_id: o.middle_sort_id,
max_sort_id: o.max_sort_id,
brand_id: o.brand_id,
brand_domain: o.brand_domain,
brand_name: o.brand_name,
product_id: o.product_id,
product_name: o.product_name,
product_skn: o.product_skn,
market_price: o.market_price,
sales_price: o.sales_price,
cn_alphabet: o.cn_alphabet,
default_images: o.default_images,
goods_id: Array.isArray(o.goods_list) && o.goods_list.length ? o.goods_list[0].goods_id : ''
};
};
module.exports = {
productLst: function(params) {
productLst: function(params, enumParam) {
return api.get('', Object.assign({
method: 'app.search.newPromotion'
}, params)).then(res => {
var data = [],
var data = new Array(Number(params.limit)),
lst = (res.data && res.data.product_list) || [];
lst.forEach(function(o) {
data.push({
brand_domain: o.brand_domain,
brand_name: o.brand_name,
product_id: o.product_id,
product_name: o.product_name,
product_skn: o.product_skn,
market_price: o.market_price,
sales_price: o.sales_price,
cn_alphabet: o.cn_alphabet,
default_images: o.default_images,
goods_id: Array.isArray(o.goods_list) && o.goods_list.length ? o.goods_list[0].goods_id : ''
});
});
for (var i = 0; i < data.length; i++) {
var o = lst[i] || {};
if (params.specified_sort) {
// 枚举类型
if (enumParam.brands && Number(enumParam.brands[i]) === Number(o.brand_id)) {
data[i] = _getProduct(o);
} else if (enumParam.sorts && Number(enumParam.sorts[i]) === Number(o.small_sort_id)) {
data[i] = _getProduct(o);
} else if (enumParam.misorts && Number(enumParam.misorts[i]) === Number(o.middle_sort_id)) {
data[i] = _getProduct(o);
} else if (enumParam.msorts && Number(enumParam.msorts[i]) === Number(o.max_sort_id)) {
data[i] = _getProduct(o);
} else {
lst.splice(i, 0, {});
data[i] = {};
}
} else {
data[i] = _getProduct(o);
}
}
return data;
});
}
... ...
... ... @@ -21,7 +21,10 @@ const index = (req, res, next) => {
title: '优惠券',
pageFooter: true,
list: result,
used: req.body.status === '1' ? true : false,
localCss: true
};
req.body.page && (req.body.page !== '1' || req.body.status === '1') && (options.layout = false);
res.render('coupons', options);
}).catch(next);
... ...
... ... @@ -9,23 +9,29 @@
const favoriteModel = require('../models/favorite');
const headerModel = require('../../../doraemon/models/header'); // 头部model
const favorite = (req, res) => {
const favorite = (req, res, next) => {
let tab = req.query.tab || '';
let uid = req.user.uid;
let page = 1;
let limit = 10;
res.render('favorite', {
module: 'home',
page: 'favorite',
pageHeader: headerModel.setNav({
navTitle: '我的收藏'
}),
title: '我的收藏',
pageFooter: true,
favorite: {
productUrl: '//m.yohobuy.com/product/new',
brandUrl: '//m.yohobuy.com/product/new',
brandTab: tab === 'brand' ? true : false // 是否为品牌收藏页
}
});
favoriteModel.index(uid, page, limit, tab === 'brand').then((result)=>{
res.render('favorite', {
module: 'home',
page: 'favorite',
pageHeader: headerModel.setNav({
navTitle: '我的收藏'
}),
title: '我的收藏',
pageFooter: true,
localCss: true,
favorite: Object.assign(result, {
productUrl: '//m.yohobuy.com/product/new',
brandUrl: '//m.yohobuy.com/product/new',
brandTab: tab === 'brand' ? true : false // 是否为品牌收藏页
})
});
}).catch(next);
};
let favProduct = (req, res, next) => {
... ...
... ... @@ -34,7 +34,8 @@ exports.index = (req, res, next) => {
pageChannel: {
boys: true
},
showFooterTab: footerModel.getUrlData('mine')
showFooterTab: footerModel.getUrlData('mine'),
localCss: true
}));
}
}).catch(next);
... ... @@ -74,7 +75,14 @@ exports.myDetails = (req, res, next) => {
* @param next
*/
exports.record = (req, res) => {
exports.record = (req, res, next) => {
let uid = req.user.uid;
let udid = req.user.udid;
let page = req.query.page || 1;
let limit = 10;
let headerData = headerModel.setNav({
navTitle: '浏览记录'
... ... @@ -86,10 +94,22 @@ exports.record = (req, res) => {
page: 'browse-record',
title: '浏览记录',
browseRecordPage: true,
pageFooter: true
pageFooter: true,
_noLazy: true,
localCss: true
};
res.render('browse-record', responseData);
indexModel.recordContent(uid, udid, page, limit).then((result) => {
if (result.browseRecord && result.browseRecord.length > 0) {
responseData.browseRecord = result.browseRecord;
} else {
responseData.noRecord = true;
}
res.render('browse-record', responseData);
}).catch(next);
};
... ... @@ -106,7 +126,7 @@ exports.recordContent = (req, res, next) => {
let page = req.query.page || 1;
let limit = 30;
let limit = 10;
indexModel.recordContent(uid, udid, page, limit).then((result) => {
... ...
... ... @@ -18,7 +18,7 @@ const myCurrency = (req, res, next) => {
res.render('currency-new', {
module: 'home',
page: 'currency-new',
page: 'mycurrency',
pageHeader: _.assign(headerModel.setNav({
navTitle: '有货币'
}), {
... ... @@ -28,7 +28,8 @@ const myCurrency = (req, res, next) => {
title: '有货币',
pageFooter: true,
yohoCoin: result.yohoCoin,
banner: result.banner
banner: result.banner,
localCss: true
});
}).catch(next);
};
... ... @@ -38,11 +39,10 @@ const currencyDetail = (req, res, next) => {
let page = 1;
let limit = 10;
myCurrencyModel.currencyDetail(uid, page, limit).then(result => {
myCurrencyModel.currencyDetailIndex(uid, page, limit).then(result => {
res.render('currency-detail', {
module: 'home',
page: 'currency-detail',
page: 'currencyDetail',
pageHeader: _.assign(headerModel.setNav({
navTitle: '有货币明细'
}), {
... ... @@ -51,7 +51,9 @@ const currencyDetail = (req, res, next) => {
}),
title: '有货币明细',
pageFooter: true,
money: result.money
result: result,
money: (result.yohoCoin.yohocoin_num && result.yohoCoin.yohocoin_num > 0),
localCss: true
});
}).catch(next);
};
... ... @@ -62,11 +64,7 @@ let ajaxCurrencyDetail = (req, res, next) => {
let limit = 10;
myCurrencyModel.currencyDetail(uid, page, limit).then((result) => {
res.render('ajax-currency-detail', {
layout: false,
coinlist: _.get(result, 'coinlist', [])
});
res.json(result);
}).catch(next);
};
... ...
... ... @@ -8,6 +8,7 @@
const headerModel = require('../../../doraemon/models/header'); // 头部model
const orderModel = require('../models/order');
const helpers = global.yoho.helpers;
/**
* 订单页面
... ... @@ -24,18 +25,34 @@ exports.order = (req, res, next) => {
uid: req.user.uid
};
orderModel.order(params).then(result => {
// 获取第一页数据做服务端渲染
let initialData = {
type: req.query.type || 1,
page: req.query.page || 1,
gender: req.query.gender || '1,3',
yh_channel: req.query.channel || 1,
uid: req.user.uid
};
return Promise.all([
orderModel.order(params),
orderModel.getOrders(initialData)
]).then(result => {
res.render('order', {
module: 'home',
page: 'order',
pageHeader: headerModel.setNav({
navTitle: '我的订单'
navTitle: '我的订单',
backUrl: helpers.urlFormat('/home')
}),
title: 'Yoho!Buy 有货',
pageFooter: true,
order: result
order: result[0] || [],
walkwayUrl: result[1] && result[1].length ? '' : '//m.yohobuy.com/product/new',
firstPageOrdersList: result[1] || []
});
}).catch(next);
};
/**
... ... @@ -45,13 +62,20 @@ exports.order = (req, res, next) => {
* @param next
*/
exports.getOrders = (req, res, next) => {
orderModel.getOrders({
let start = req.query.start || 0;
let params = {
type: req.query.type || 1,
page: req.query.page || 1,
gender: req.query.gender || '1,3',
yh_channel: req.query.channel || 1,
uid: req.user.uid
}).then(result => {
};
orderModel.getOrders(params).then(result => {
if (result && parseInt(params.page, 10) === 1 && parseInt(start, 10) > 0) {
result = result.slice(start || 0);
}
res.render('order-content', {
layout: false,
orders: result
... ...
... ... @@ -22,14 +22,15 @@ const orderDetailData = (req, res, next) => {
result.serviceUrl = serviceUrl;
res.render('orderDetail', {
module: 'home',
page: 'order-detail',
page: 'orderdetail',
pageHeader: headerModel.setNav({
navTitle: '订单详情',
navBtn: false
}),
title: '订单详情',
pageFooter: true,
orderDetail: result
orderDetail: result,
localCss: true,
});
}).catch(next);
... ...
... ... @@ -6,12 +6,8 @@ const api = global.yoho.API;
const couponData = (params) => {
return api.get('', params).then(result => {
if (result && result.data && result.data.info) {
for (let item of result.data.info) {
item.used = ((params.status === '1') ? true : false);
}
return result.data.info;
}
else {
} else {
return 0;
}
});
... ...
... ... @@ -173,13 +173,14 @@ const favfavBrand = (uid, page, limit) => {
update: val.newProductNum
});
_.forEach(val.newProduct, function(data) {
_.forEach(val.newProduct, function(data, key) {
obj.productList.push({
link: '/product/pro_' + data.productId + '_' +
data.goods[0].id + '/' + data.cnAlphabet + '.html',
imgUrl: data.defaultImages,
price: '¥' + Number(data.marketPrice).toFixed(2),
discount: data.marketPrice > data.salesPrice ? '¥' + Number(data.salesPrice).toFixed(2) : false
discount: data.marketPrice > data.salesPrice ? '¥' + Number(data.salesPrice).toFixed(2) : false,
top3: key < 3 ? 1 : 0
});
});
... ... @@ -209,9 +210,27 @@ const favoriteDelete = (uid, type, favId) => {
fav_id: favId
});
};
const index = (uid, page, limit, isbrand) => {
if (isbrand) {
return favfavBrand(uid, page, limit).then(result=>{
if (result.total === 0) {
result = {nobrandData: 1 };
}
return result;
});
} else {
return favProduct(uid, page, limit).then(result=>{
if (result.total === 0) {
result = {noproductData: 1};
}
return result;
});
}
};
module.exports = {
favProduct,
favfavBrand,
favoriteDelete
favoriteDelete,
index
};
... ...
... ... @@ -10,12 +10,15 @@ const _yohoCoin = (uid) => {
method: 'app.yoho.yohocoin',
uid: uid
}).then((result) => {
let data = [];
if (result && result.code === 200) {
return result.data;
data = result.data;
} else {
logger.error('youhocoin code no 200');
}
return data;
});
};
... ... @@ -23,6 +26,8 @@ const bannerData = (contentCode) => {
return serviceAPI.get('operations/api/v5/resource/get', {
content_code: contentCode
}, {
cache: true
}).then((result) => {
if (result && result.code === 200) {
... ... @@ -54,44 +59,36 @@ const currencyDetail = (uid, page, limit) => {
page: page,
limit: limit
}).then((result) => {
let data = [];
if (result && result.code === 200) {
let total = parseInt(result.data.page_total, 10) + 1;
data = _.get(result, 'data.coinlist', []);
_.forEach(_.get(result, 'data.coinlist', []), perCoin => {
_.forEach(data, (perCoin, key) => {
if (perCoin.num > 0) {
perCoin.num = '+' + perCoin.num;
data[key].num = '+' + perCoin.num;
}
});
if (page && page <= total) {
return _yohoCoin(uid).then(list => {
if (list.yohocoin_num && list.yohocoin_num !== 0) {
result.data = _.assign(result.data, {
money: true
});
} else {
result.data = _.assign(result.data, {
money: false
});
}
return result.data;
});
} else {
return;
}
} else {
logger.error('youholist code no 200');
}
return data;
});
};
const currencyDetailIndex = (uid, page, limit) => {
return Promise.all(
[currencyDetail(uid, page, limit), _yohoCoin(uid)]
).then(result => {
return {
coinlist: result[0],
yohoCoin: result[1]
};
});
};
module.exports = {
myCurrency,
currencyDetailIndex,
currencyDetail,
bannerData
};
... ...
... ... @@ -199,10 +199,6 @@ const orderDetailData = (uid, orderCode) => {
// createTime: date('Y-m-d H:i:s', orderDetail.createTime)
});
// _.defer(function(orderDetail.createTime) {
// console.log(_.now() - orderDetail.createTime);
// }, _.now());
if (orderDetail.counterFlag && orderDetail.counterFlag === 'Y') {
orderDetail = _.assign(orderDetail, {
leftTime: parseInt(orderDetail.payLefttime, 10) * 1000
... ... @@ -216,7 +212,7 @@ const orderDetailData = (uid, orderCode) => {
obj = _.assign(obj, {
thumb: data.goodsImage,
name: data.productName,
color: data.factoryColorName? data.factoryColorName : data.colorName,
color: data.factoryColorName ? data.factoryColorName : data.colorName,
size: data.sizeName,
price: data.goodsPrice,
count: count
... ... @@ -313,12 +309,8 @@ const orderDetailData = (uid, orderCode) => {
cancelReason: resons
});
//console.log(orderDetail)
return orderDetail;
});
// return orderDetail;
} else {
logger.error('detail info return no 200');
return {};
... ...
{{# browseRecord}}
<a class="browse-record-good clearfix {{#if invalidGoods}}invalidGoods{{/if}}" data-skn="{{product_skn}}" href="{{link}}">
<img class="thumb lazy" data-original="{{image image 447 596}}">
<div class="deps clearfix">
<p class="name row">{{product_name}}</p>
<p class="price row">
<span class="sale-price{{#unless market_price}} original-price{{/unless}}">¥{{sales_price}}</span>
&nbsp;&nbsp;
{{#if market_price}}
<span class="market-price">¥{{market_price}}</span>
{{/if}}
</p>
<p class="sold-out row">
{{#unless storage}}
<span class="sold-out-tag">已售罄</span>
{{/unless}}
</p>
<span class="iconfont del-icon">&#xe621;</span>
</div>
</a>
{{> browse-record-info}}
{{/ browseRecord}}
{{#if noRecord}}
<div class="no-record">
<div class="icon"></div>
<span>暂无浏览记录</span>
<a class="walk-way" href="{{walkwayUrl}}">随便逛逛</a>
</div>
{{/if}}
\ No newline at end of file
... ...
<div class="browse-record-page yoho-page">
<div class="records">
{{# browseRecord}}
{{> browse-record-info}}
{{/ browseRecord}}
{{#if noRecord}}
<div class="no-record">
<div class="icon"></div>
<span>暂无浏览记录</span>
<a class="walk-way" href="/product/new">随便逛逛</a>
</div>
{{/if}}
</div>
<div class="load-more hide">
<span class="more">正在加载...</span>
<span class="no-more hide">没有更多了</span>
</div>
</div>
\ No newline at end of file
</div>
... ...
... ... @@ -10,7 +10,7 @@
<span>{{money}}</span>
<p class="coupon-name">{{coupon_name}}</p>
<p>有效期:{{couponValidity}}</p>
{{#if used}}
{{#if ../used}}
<i></i>
{{/if}}
</div>
... ... @@ -25,4 +25,5 @@
{{/if}}
</div>
<div id="employ2" class="coupon-list">
</div>
\ No newline at end of file
... ...
<div class="yoho-coin-detail-page yoho-page">
{{#unless money}}
<div class="money">你拥有的有货币:<span>0</span></div>
<div class="money">你拥有的有货币:<span>0</span></div>
{{/unless}}
<ul class="coin-detail"></ul>
<ul class="coin-detail">
{{# result.coinlist}}
<li>
<div class="detail-item">
<p class="title">{{message}}</p>
<p class="time">{{date}}</p>
<div class="count">
{{num}}
</div>
</div>
</li>
{{/ result.coinlist}}
</ul>
</div>
\ No newline at end of file
... ...
<div class="yoho-coin-page yoho-page">
{{# yohoCoin}}
<p class="coin-num">
<em>{{coin_num}}</em>
有货币
</p>
<section>
<p class="title">有货币</p>
<hr>
<p>
<span class="sub-title">有货币是什么,有什么用?</span>
有货币是有货商城的虚拟货币,与现金比例1:1,没有任何使用期限,有货币可直接用于有货线上购物使用,不可转让他人,不可兑换为现金。使用有货币支付的金额不可计入消费金额。
</p>
<p>
<span class="sub-title">如何查看自己的有货币?</span>
<span class="path">登录 > 个人中心 > 我的有货币</span>
</p>
<p>
<span class="sub-title">有货币如何购买支付?</span>
在购买支付页面输入您要使用的有货币金额即可完成支付
<div class="remark">
<span></span>
如果超过了我们约定的期限的非正常退货,我们将会于您的退款金额中直接扣除赠送有货币等值的金额。赠送给您的有货币还将保留在您的账户中,敬请谅解。
</div>
</p>
</section>
{{/ yohoCoin}}
</div>
\ No newline at end of file
<div class="yoho-favorite-page yoho-page">
{{# favorite}}
<ul id="fav-tab" class="fav-tab {{# brandTab}}brand-tab{{/ brandTab}}">
<li>收藏的商品</li>
<li>收藏的品牌</li>
<li class="{{#unless brandTab}}active{{/ unless}}">收藏的商品</li>
<li class="{{# brandTab}}active{{/ brandTab}}">收藏的品牌</li>
</ul>
<div class="fav-content" id="fav-content">
<div class="fav-type">
<ul class="fav-product-list"></ul>
<div class="fav-content-loading"></div>
<div class="fav-type {{#unless brandTab}}show{{/unless}}">
<ul class="fav-product-list">
{{>favorite/favorite-product}}
</ul>
<div class="fav-content-loading hide"></div>
<div class="fav-null-box hide">
<div class="fav-null-box {{#if noproductData}}show{{/if}}">
<span class="fav-null">您暂无收藏任何商品</span>
<a class="go-shopping" href="{{productUrl}}">随便逛逛</a>
</div>
<div class="fav-load-more fav-load-background hide"></div>
</div>
<div class="fav-type">
<div class="fav-brand-swiper-wrapper"></div>
<div class="fav-content-loading"></div>
<div class="fav-type {{# brandTab}}show{{/brandTab}}">
<div class="fav-brand-swiper-wrapper">
{{>favorite/favorite-brand}}
</div>
<div class="fav-content-loading hide"></div>
<div class="fav-null-box hide">
<div class="fav-null-box {{#if nobrandData}}show{{/if}}">
<span class="fav-null">您暂无收藏任何品牌</span>
<a class="go-shopping" href="{{brandUrl}}">随便逛逛</a>
</div>
... ... @@ -27,4 +31,4 @@
</div>
</div>
{{/ favorite}}
</div>
\ No newline at end of file
</div>
... ...
{{# hasFavBrand}}
<div class="fav-brand-swiper">
<a class="swiper-header" href="{{link}}">
<div class="swiper-logo">
{{#if brandImg}}
<img src="{{image brandImg 30 30}}" onerror="this.remove()" alt=""/>
{{/if}}
</div>
<div class="brand-info">
<span class="brand-name">{{brandName}}</span>
<div class="brand-update">
{{# update}}
<span class="brand-new">上新<b>{{.}}</b></span>
{{/ update}}
{{# discount}}
<span class="brand-discount">折扣<b>{{.}}</b></span>
{{/ discount}}
</div>
</div>
<span class="fav-more"></span>
</a>
{{#if productList}}
<div id="swiper-container-{{id}}" class="swiper-container" data-id="{{id}}">
<ul class="swiper-wrapper swiper-wrapper-{{id}}">
{{# productList}}
<li class="swiper-slide">
<a href="{{link}}">
<img class="swiper-lazy" data-src="{{image imgUrl 235 314}}" alt=""/>
</a>
<div class="brand-product">
<div class="{{# discount}}price-discount{{/ discount}}">
{{# discount}}<span>{{.}}<span>{{/ discount}}
<b>{{price}}</b>
</div>
</div>
</li>
{{/ productList}}
</ul>
</div>
{{/if}}
</div>
{{/ hasFavBrand}}
{{>favorite/favorite-brand}}
... ...
{{# hasFavProduct}}
<li data-id="{{favId}}" class="{{#if invalidGoods}}invalidGoods{{/if}}">
<a href="{{link}}">
<div class="fav-img-box">
<img src="{{imgUrl}}" alt=""/>
</div>
<div class="fav-info-list">
<h2>{{title}}</h2>
<div class="fav-price">
{{# discountPrice}}
<span class="new-price">{{.}}</span>
{{/ discountPrice}}
<span class="fav-price {{# discountPrice}}price-underline{{/ discountPrice}}">{{price}}</span>
</div>
{{# savePrice}}
<div class="save-price save-price-number">
比收藏时降价了<span>{{.}}</span>
<span class="del-fav iconfont">&#xe621;</span>
</div>
{{/ savePrice}}
{{^ savePrice}}
<div class="save-price">
{{# sellOut}}
<span class="sell-out">已售罄</span>
{{/ sellOut}}
<span class="del-fav iconfont">&#xe621;</span>
</div>
{{/ savePrice}}
</div>
</a>
</li>
{{/ hasFavProduct}}
{{>favorite/favorite-product}}
... ...
... ... @@ -9,6 +9,21 @@
</ul>
<div id="order-container" class="order-container">
{{#if @root.walkwayUrl}}
<div class="no-order">
<div class="icon"></div>
<span>你还没有订单!</span>
<a class="walk-way" href="{{@root.walkwayUrl}}">随便逛逛</a>
</div>
{{^}}
<div class="firstscreen-orders">
{{#each @root.firstPageOrdersList}}
{{> order/order}}
{{/each}}
</div>
{{/if}}
{{#each navs}}
<div class="orders{{#unless active}} hide{{/unless}}"></div>
{{/each}}
... ...
<a class="browse-record-good clearfix {{#if invalidGoods}}invalidGoods{{/if}}" data-skn="{{product_skn}}" href="{{link}}">
{{#if @root._noLazy}}
<img class="thumb" src="{{image2 image w=447 h=596}}">
{{^}}
<img class="thumb lazy" data-original="{{image2 image w=447 h=596}}">
{{/if}}
<div class="deps clearfix">
<p class="name row">{{product_name}}</p>
<p class="price row">
<span class="sale-price{{#unless market_price}} original-price{{/unless}}">¥{{sales_price}}</span> &nbsp;&nbsp;
{{#if market_price}}
<span class="market-price">¥{{market_price}}</span> {{/if}}
</p>
<p class="sold-out row">
{{#unless storage}}
<span class="sold-out-tag">已售罄</span> {{/unless}}
</p>
<span class="iconfont del-icon">&#xe621;</span>
</div>
</a>
... ...
{{# hasFavBrand}}
<div class="fav-brand-swiper">
<a class="swiper-header" href="{{link}}">
<div class="swiper-logo">
{{#if brandImg}}
<img src="{{image2 brandImg w=30 h=30 q=60}}" onerror="this.remove()" alt=""/>
{{/if}}
</div>
<div class="brand-info">
<span class="brand-name">{{brandName}}</span>
<div class="brand-update">
{{# update}}
<span class="brand-new">上新<b>{{.}}</b></span>
{{/ update}}
{{# discount}}
<span class="brand-discount">折扣<b>{{.}}</b></span>
{{/ discount}}
</div>
</div>
<span class="fav-more"></span>
</a>
{{#if productList}}
<div id="swiper-container-{{id}}" class="swiper-container" data-id="{{id}}">
<ul class="swiper-wrapper swiper-wrapper-{{id}}">
{{# productList}}
<li class="swiper-slide">
<a href="{{link}}">
<img class="swiper-lazy" {{#if top3}}src{{else}}data-src{{/if}}="{{image2 imgUrl w=235 h=314 q=60}}" alt=""/>
</a>
<div class="brand-product">
<div class="{{# discount}}price-discount{{/ discount}}">
{{# discount}}<span>{{.}}<span>{{/ discount}}
<b>{{price}}</b>
</div>
</div>
</li>
{{/ productList}}
</ul>
</div>
{{/if}}
</div>
{{/ hasFavBrand}}
... ...
{{# hasFavProduct}}
<li data-id="{{favId}}" class="{{#if invalidGoods}}invalidGoods{{/if}}">
<a href="{{link}}">
<div class="fav-img-box">
<img src="{{image2 imgUrl w=30 h=30 q=60}}" alt=""/>
</div>
<div class="fav-info-list">
<h2>{{title}}</h2>
<div class="fav-price">
{{# discountPrice}}
<span class="new-price">{{.}}</span>
{{/ discountPrice}}
<span class="fav-price {{# discountPrice}}price-underline{{/ discountPrice}}">{{price}}</span>
</div>
{{# savePrice}}
<div class="save-price save-price-number">
比收藏时降价了<span>{{.}}</span>
<span class="del-fav iconfont">&#xe621;</span>
</div>
{{/ savePrice}}
{{^ savePrice}}
<div class="save-price">
{{# sellOut}}
<span class="sell-out">已售罄</span>
{{/ sellOut}}
<span class="del-fav iconfont">&#xe621;</span>
</div>
{{/ savePrice}}
</div>
</a>
</li>
{{/ hasFavProduct}}
... ...
... ... @@ -285,7 +285,8 @@ const wechat = {
doPassportCallback(openId, nickname, 'wechat', req, res).catch(next);
})(req, res, next);
} else {
return next('Auth State Mismatch');
log.error('Auth State Mismatch:' + req.originalUrl);
return res.redirect(loginPage);
}
}
};
... ... @@ -310,7 +311,8 @@ const sina = {
doPassportCallback(openId, nickname, 'sina', req, res).catch(next);
})(req, res, next);
} else {
return next('Auth State Mismatch');
log.error('Auth State Mismatch:' + req.originalUrl);
return res.redirect(loginPage);
}
}
};
... ... @@ -336,7 +338,8 @@ const qq = {
doPassportCallback(openId, nickname, 'qq', req, res).catch(next);
})(req, res, next);
} else {
return next('Auth State Mismatch' + req.originalUrl);
log.error('Auth State Mismatch:' + req.originalUrl);
return res.redirect(loginPage);
}
}
};
... ... @@ -359,6 +362,20 @@ const alipay = {
}
};
exports.user = function(req, res, next) {
let result = {
code: 403,
message: '未登录',
data: ''
}
if (req.user.uid) {
result.code = 200;
result.message = '已登录';
result.data = req.user.uid;
}
res.jsonp(result);
}
exports.common = common;
exports.local = local;
exports.wechat = wechat;
... ...
... ... @@ -50,6 +50,9 @@ router.get('/passport/sms_login/check.json',
smsLogin.check); // only ajax
router.post('/passport/sms_login/password.json', smsLogin.password);
// jsonp获取用户uid
router.get('/passport/login/user', login.user);
// 微信登录
router.get('/passport/login/wechat', login.common.beforeLogin, login.wechat.login);
router.get('/passport/login/wechat/callback', login.wechat.callback);
... ...
... ... @@ -106,9 +106,9 @@ const _searchGoods = (params) => {
delete params.filter_poolId;
}
if (params.shop_id) {
if (params.shop_id && !params.productPool) {
method = 'app.search.li';
} else if (params.brand) {
} else if (params.brand && !params.productPool) {
method = 'app.search.brand';
}
... ...
... ... @@ -18,9 +18,9 @@ module.exports = {
testCode: 'yoho4946abcdef#$%&!@',
domains: {
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test2.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
liveApi: 'http://testapi.live.yohops.com:9999/',
singleApi: 'http://api-test2.yohops.com:9999/',
singleApi: 'http://api-test3.yohops.com:9999/',
imSocket: 'ws://im.yohobuy.com:10240',
imCs: 'http://im.yohobuy.com/api',
imServer: 'http://im.yohobuy.com/server'
... ... @@ -32,7 +32,6 @@ module.exports = {
// imSocket: 'wss://imsocket.yohobuy.com:443',
// imCs: 'https://imhttp.yohobuy.com/api',
// imServer: 'https://imhttp.yohobuy.com/server'
},
subDomains: {
host: '.m.yohobuy.com',
... ...
... ... @@ -12,7 +12,7 @@
a.async = 1;
a.src = j;
m.parentNode.insertBefore(a, m);
}(window, document, 'script', (document.location.protocol === 'https:' ? 'https:' : 'http:') + '//cdn.yoho.cn/yas-jssdk/2.1.1/yas.js', '_yas'));
}(window, document, 'script', (document.location.protocol === 'https:' ? 'https:' : 'http:') + '//cdn.yoho.cn/yas-jssdk/2.1.2/yas.js', '_yas'));
var _hmt = _hmt || [];
... ... @@ -56,7 +56,7 @@
uid = uid === 0 ? '' : uid;
window._ozuid = uid; // 暴露ozuid
if (window._yas) {
window._yas(1 * new Date(), '2.1.1', 'yohobuy_m', uid, '', '');
window._yas(1 * new Date(), '2.1.2', 'yohobuy_m', uid, '', '');
}
// 非登录状态,加载百度统计
... ...
<div class="order-good" data-id="{{id}}">
<div class="thumb-wrap">
{{#if link}}
<a href="{{link}}"><img class="thumb lazy" data-original="{{image thumb 90 120}}"></a>
<a href="{{link}}"><img class="thumb" src="{{image thumb 90 120}}"></a>
{{else}}
<img class="thumb lazy" data-original="{{image thumb 90 120}}">
<img class="thumb" src="{{image thumb 90 120}}">
{{/if}}
<p class="tag{{#if gift}} gift-tag{{/if}}{{#if advanceBuy}} advance-buy-tag{{/if}}"></p>
</div>
... ...
{
"name": "m-yohobuy-node",
"version": "5.3.13",
"version": "5.4.0",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ... @@ -44,7 +44,7 @@
"serve-favicon": "^2.3.2",
"uuid": "^2.0.3",
"yoho-express-session": "^2.0.0",
"yoho-node-lib": "^0.2.4",
"yoho-node-lib": "0.2.6",
"yoho-zookeeper": "^1.0.6"
},
"devDependencies": {
... ...
... ... @@ -8,7 +8,7 @@ require('channel/home.page.css');
var $ = require('yoho-jquery'),
Swiper = require('yoho-swiper'),
Swiper = require('yoho-swiper2'),
lazyLoad = require('yoho-jquery-lazyload'),
fastclick = require('yoho-fastclick'),
noticeScroll = require('../plugin/notice-scroll'),
... ...
... ... @@ -138,6 +138,7 @@ function rePosFooter() {
if ($('body').height() >= winH - parseInt($footer.css('height'), 0)) {
$footer.removeClass('bottom');
}
$footer.show();
}
/**
... ... @@ -184,7 +185,9 @@ $.extend({
var backToTopHammer;
var floatTopHammer;
rePosFooter(); // 计算底部位置
setTimeout(function() {
rePosFooter(); // 计算底部位置
}, 500);
if (user === 0) {
... ...
... ... @@ -17,18 +17,24 @@ var $loadMore = $('.load-more'),
$more = $loadMore.children('.more'),
$noMore = $loadMore.children('.no-more');
var page = 0;
var page = 1;
var end = false,
loading = false;
var winH = $(window).height();
require('home/record.page.css');
require('../common');
load.init();
function moreRecord(cb) {
var count = $page.children('.browse-record-good').length;
if (count === 0) {
return;
}
if (loading) {
return;
}
... ...
// 不要使用es6
'use strict';
require('home/_coupons.css');
var $ = require('yoho-jquery'),
Hammer = require('yoho-hammer'),
ellipsis = require('yoho-mlellipsis'),
loading = require('../plugin/loading');
fastclick = require('yoho-fastclick'),
ellipsis = require('yoho-mlellipsis');
var employ,
var $employ = $('#employ'),
$employ2 = $('#employ2'),
statu = 0,
page = 1,
dic = {},
AjaxFlag = 0; // 防止重复请求
require('../common');
ellipsis.init();
// 防止重复请求
AjaxFlag = 0;
dic[statu + '_' + page] = true;
fastclick.attach(document.body);
var couponAJAX = function(statu, page) {
if (AjaxFlag) {
if (AjaxFlag || dic[statu + '_' + page]) {
return;
}
var employDom = statu === 0 ? $employ : $employ2;
AjaxFlag = 1;
loading.showLoadingMask();
$.ajax({
type: 'POST',
url: '/home/coupons',
... ... @@ -28,55 +35,51 @@ var couponAJAX = function(statu, page) {
page: page
},
success: function(data) {
dic[statu + '_' + page] = true; // tab切换时,防止频繁请求
if ($(data).find('.null').html()) {
page === 1 && $('#employ').append($(data).find('.null'));
if (page === 1) {
employDom.append($(data).find('.null'));
window.rePosFooter();
}
AjaxFlag = 1;
window.rePosFooter();
loading.hideLoadingMask();
return;
}
if (!$(data).find('.employ-main').html()) {
AjaxFlag = 1;
window.rePosFooter();
loading.hideLoadingMask();
return;
}
$('#employ').append($(data).find('.employ-main'));
window.rePosFooter();
loading.hideLoadingMask();
employDom.append($(data).find('.employ-main'));
AjaxFlag = 0;
}
});
};
var scrollHandler = function() {
if ($(window).scrollTop() + $(window).height() > $('body').height() - 100) {
page++;
couponAJAX(statu, page);
return;
}
};
require('../common');
ellipsis.init();
$('.yoho-footer').css('border-top', '1px solid #e0e0e0');
$('.employ span').each(function(index) {
employ = new Hammer($('.employ span')[index]);
employ.on('tap', function(e) {
$('.employ span').each(function(index, el) {
$(el).on('click', function() {
$('.employ span').removeClass('active').eq(index).addClass('active');
$('#employ').html(' ');
if (index === 0) {
$employ.removeClass('hide');
$employ2.addClass('hide');
} else {
$employ.addClass('hide');
$employ2.removeClass('hide');
}
statu = index;
page = 1;
AjaxFlag = 0;
status === 1 && $('#employ').empty();
couponAJAX(statu, page);
window.rePosFooter();
});
});
var scrollHandler = function() {
if ($(window).scrollTop() + $(window).height() > $('body').height() - 100) {
page++;
couponAJAX(statu, page);
return;
}
};
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
... ...
require('../../scss/home/coin/_yoho-coin-detail.css');
var $ = require('yoho-jquery'),
loading = require('../plugin/loading');
var page = 1;
var flag = true;
loading = require('../plugin/loading'),
currencyDetailHbs = require('home/ajax-currency-detail.hbs');
require('../common');
var page = 1,
flag = true;
loading.showLoadingMask();
require('../common');
function ajaxCurrencyDetail(curPage) {
loading.showLoadingMask();
flag = false;
$.ajax({
type: 'post',
url: '/home/ajaxCurrencyDetail',
dataType: 'html',
dataType: 'json',
data: {
page: curPage
},
success: function(data) {
$('.coin-detail').append(data);
if (data.length <= 0) {
flag = false;
return false;
}
loading.hideLoadingMask();
$('.coin-detail').append(currencyDetailHbs({coinlist: data}));
flag = true;
}
});
... ... @@ -35,6 +44,3 @@ $(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
ajaxCurrencyDetail(page);
$(document).ready(loading.hideLoadingMask);
... ...
... ... @@ -3,6 +3,7 @@
* @author: zxr
* @date: 2016/8/16
*/
require('../../scss/home/_favorite.css');
var $ = require('yoho-jquery'),
Hammer = require('yoho-hammer'),
Swiper = require('yoho-swiper');
... ... @@ -131,15 +132,18 @@ function loadData($parent, url, page) {
// 如果从品牌收藏入口进入
if ($('#fav-tab').hasClass('brand-tab')) {
showFavTab(1);
loadData($favBrandList, 'favBrand', 1);
// showFavTab(1);
// loadData($favBrandList, 'favBrand', 1);
initSwiper($favBrandList.html());
brandTab = true;
window.rePosFooter();
brandLockId = false;// 请求成功后解锁品牌收藏page++
} else {
showFavTab(0);
loadData($favProductList, 'favProduct', 1);
// showFavTab(0);
// loadData($favProductList, 'favProduct', 1);
brandTab = false;
window.rePosFooter();
lockId = false;// 请求成功后解锁商品收藏page++
}
favTabHammer = new Hammer(document.getElementById('fav-tab'));
... ... @@ -156,13 +160,13 @@ favTabHammer.on('tap', function(e) {
if (index === 0) {
brandTab = false;
if ($favProductList.find('li').length === 0 &&
$favProductList.closest('.fav-type').find('.fav-null-box').hasClass('hide')) {
!$favProductList.closest('.fav-type').find('.fav-null-box').hasClass('show')) {
loadData($favProductList, 'favProduct', 1);
}
} else {
brandTab = true;
if ($favBrandList.find('div').length === 0 &&
$favBrandList.closest('.fav-type').find('.fav-null-box').hasClass('hide')) {
!$favBrandList.closest('.fav-type').find('.fav-null-box').hasClass('show')) {
loadData($favBrandList, 'favBrand', 1);
}
}
... ...
... ... @@ -12,6 +12,8 @@ var $userAvatar = $('.user-avatar'),
var myImage = new Image(),
avatar;
require('home/index.page.css');
require('../common');
if ($('.recommend-for-you').length) {
require('./recommend-for-you-user-center');
... ...
/**
* 新有货币界面
*/
var $ = require('yoho-jquery'),
lazyLoad = require('yoho-jquery-lazyload');
require('../common');
lazyLoad($('img.lazy'));
function getGender() {
return window.cookie('_Channel') || 'boys';
}
require('../channel/maybe-like')(getGender());
if ($('#goods-list').length === 0) {
$('.maybe-like').hide();
}
/**
* 新有货币界面
*/
require('../../scss/home/_currency-index.css');
var $ = require('yoho-jquery'),
lazyLoad = require('yoho-jquery-lazyload');
require('../common');
function getGender() {
return window.cookie('_Channel') || 'boys';
}
require('../channel/maybe-like')(getGender());
setTimeout(function() {
lazyLoad($('img.lazy'));
if ($('#goods-list').length === 0) {
$('.maybe-like').hide();
}
}, 30);
... ...
... ... @@ -20,7 +20,7 @@ var winH = $(window).height();
var activeType = $navLi.filter('.active').data('type'); // 当前active的项的index
var order = {
page: 0,
page: 1,
end: false
};
... ... @@ -34,6 +34,9 @@ var orderHammer,
$reaMask = $('.reason-mask'),
reasonSwiper;
// 首屏加载标志
var firstScreen = $('.firstscreen-orders').children().size() > 0;
require('../common');
// 减少计时
... ... @@ -58,8 +61,8 @@ function downCount(item) {
seconds;
// calculate dates
hours = Math.floor((difference % _day) / _hour),
minutes = Math.floor((difference % _hour) / _minute),
hours = Math.floor((difference % _day) / _hour);
minutes = Math.floor((difference % _hour) / _minute);
seconds = Math.floor((difference % _minute) / _second);
// fix dates so that it will show two digets
... ... @@ -106,6 +109,11 @@ function getOrders(option) {
page: order.page + 1
};
if (firstScreen) {
// 如果首屏加载了,则去掉10条记录
opt.start = 10;
}
var show = option && !option.noLoadingMask;
if (inAjax) {
... ... @@ -154,6 +162,9 @@ function getOrders(option) {
setTime();
}
});
// 还原参数
firstScreen = false;
}
lazyLoad({
... ... @@ -265,7 +276,7 @@ $(window).scroll(function() {
});
// 初始化请求第一页数据
getOrders();
//getOrders();
$(function() {
reasonSwiper = new Swiper('.box-main', {
... ... @@ -273,7 +284,7 @@ $(function() {
slidesPerView: 5,
centeredSlides: true,
initialSlide: 0,
onSlideChangeStart: function(reasonSwiper) {
onSlideChangeStart: function(reasonSwiper) {//eslint-disable-line
var activeIndex = reasonSwiper.activeIndex,
slides = reasonSwiper.slides,
i = 0;
... ... @@ -301,7 +312,7 @@ $(function() {
});
});
$reaMask.find('.box-cmp').on('touchend', function(e) {
$reaMask.find('.box-cmp').on('touchend', function() {
var selSolid = reasonSwiper.slides[reasonSwiper.activeIndex],
reason = $(selSolid).text(),
reasonId = $(selSolid).data('reasonId');
... ...
... ... @@ -4,6 +4,8 @@
* @date: 2015/11/16
*/
require('../../scss/home/_order-detail-index.css');
var $ = require('yoho-jquery'),
lazyLoad = require('yoho-jquery-lazyload'),
Hammer = require('yoho-hammer'),
... ... @@ -26,8 +28,6 @@ lazyLoad({
try_again_css: 'order-failure'
});
require('../common');
function downCount(options) {
var difference = options, // difference of dates
... ... @@ -214,10 +214,8 @@ $reaMask.on('touchend', function(event) {
event.stopPropagation();
});
function formatDate(objD) {
var str, colorhead, colorfoot,
var str,
yy = objD.getYear(),
MM = objD.getMonth() + 1,
dd = objD.getDate(),
... ... @@ -252,4 +250,5 @@ function formatDate(objD) {
str = yy + '-' + MM + '-' + dd + ' ' + hh + ':' + mm + ':' + ss;
$('.createTime').text(str);
}
formatDate($createTime);
... ...
... ... @@ -10,49 +10,51 @@ var $ = require('yoho-jquery'),
var $recommendForYou = $('.recommend-for-you');
$.get('/product/recommend-for-you/userCenter').then(function(html) {
var PRDID = [];
setTimeout(function () {
$.get('/product/recommend-for-you/userCenter').then(function (html) {
var PRDID = [];
$recommendForYou.html(html);
$recommendForYou.html(html);
lazyLoad($('img.lazy'));
lazyLoad($('img.lazy'));
// 为您优选埋点 http://redmine.yoho.cn/issues/10116
$recommendForYou.find('.good-info').each(function() {
PRDID.push($(this).data('id'));
});
var $recommendSonLen = $recommendForYou.find('.good-info').length;
// 为您优选埋点 http://redmine.yoho.cn/issues/10116
$recommendForYou.find('.good-info').each(function () {
PRDID.push($(this).data('id'));
});
if ($recommendSonLen === 0) {
$recommendForYou.hide();
} else {
$recommendForYou.show();
}
window.givePoint({
REC_POSE: 110004,
PRD_ID: PRDID.join(','),
PRD_NUM: $('.recommend-for-you .good-info').length,
ACTION_ID: 0,
PAGE_NUM: 1
});
var $recommendSonLen = $recommendForYou.find('.good-info').length;
$recommendForYou.find('.good-info').on('click', 'a', function() {
var index = $(this).closest('.good-info').index() + 1;
if ($recommendSonLen === 0) {
$recommendForYou.hide();
} else {
$recommendForYou.show();
}
window.givePoint({
REC_POSE: 110004,
PRD_ID: $(this).closest('.good-info').data('id'),
PRD_NUM: index,
ACTION_ID: 1,
PRD_ID: PRDID.join(','),
PRD_NUM: $('.recommend-for-you .good-info').length,
ACTION_ID: 0,
PAGE_NUM: 1
});
return true;
});
$recommendForYou.find('.good-info').on('click', 'a', function () {
var index = $(this).closest('.good-info').index() + 1;
}).fail(function() {
$recommendForYou.hide();
});
window.givePoint({
REC_POSE: 110004,
PRD_ID: $(this).closest('.good-info').data('id'),
PRD_NUM: index,
ACTION_ID: 1,
PAGE_NUM: 1
});
return true;
});
}).fail(function () {
$recommendForYou.hide();
});
}, 500);
... ...
... ... @@ -65,6 +65,7 @@ $('.pitch').on('click', function() {
});
function setPassword() {
$btnSure.addClass('disable');
return $.ajax({
type: 'POST',
url: '/passport/reg/setpassword',
... ... @@ -96,8 +97,12 @@ function setPassword() {
location.href = res.href;
}, 1500);
} else {
$btnSure.removeClass('disable');
showErrTip(data.message);
}
},
error: function() {
$btnSure.removeClass('disable');
}
});
}
... ... @@ -114,6 +119,7 @@ $btnSure.on('touchstart', function() {
} else {
if ($('.pitch').hasClass('select')) {
setPassword();
} else {
$('.prompt').show();
... ...
... ... @@ -1070,7 +1070,7 @@ $listNav.on('touchend touchcancel', function(e) {
}
if (nav.reload) {
$(document).trigger('shouldSendBpData', [bpIdData]);
search();
search({filtering: true});
}
}
});
... ...
... ... @@ -46,29 +46,29 @@
}
.banner-list {
height: 200px;
height: 100PX;
}
.banner-center-swiper {
background: #fff;
width: 100%;
height: 200px;
height: 100PX;
overflow: hidden;
.banner-list {
height: 200px;
height: 100PX;
li {
float: left;
width: 100%;
height: 200px;
height: 100PX;
a {
position: relative;
display: block;
width: 100%;
height: 100%;
line-height: 200px;
line-height: 100PX;
font-size: 0;
}
... ...
... ... @@ -5,7 +5,7 @@
@import "../layout/_swiper.css";
.brand-page {
.re-pos-search {
top: 80px !important;
top: 40PX !important;
}
.banner-top {
... ... @@ -48,8 +48,8 @@
.genderNav {
display: block;
width: 100%;
height: 80px;
line-height: 80px;
height: 40PX;
line-height: 40PX;
overflow: hidden;
color: #aeaeae;
z-index: 3;
... ... @@ -69,7 +69,7 @@
float: left;
text-align: center;
position: relative;
font-size: 28px;
i {
width: 100%;
... ... @@ -83,6 +83,7 @@
height: auto;
overflow: hidden;
display: block;
font-size: 14PX;
}
.split-border {
... ... @@ -131,7 +132,6 @@
float: left;
text-align: center;
position: relative;
font-size: 28px;
i {
width: 100%;
... ... @@ -145,6 +145,7 @@
height: auto;
overflow: hidden;
display: block;
font-size: 14PX;
}
.split-border {
... ... @@ -176,7 +177,7 @@
padding: 14px 3.125%;
background-color: #f8f8f8;
left: 0;
top: 90px;
top: 40PX;
position: fixed;
z-index: 2;
... ... @@ -207,7 +208,7 @@
.search-icon {
position: absolute;
font-size: 24px;
font-size: 12PX;
top: 0;
left: 24px;
line-height: 60px;
... ... @@ -218,7 +219,7 @@
border: none;
width: 95%;
height: 60px;
font-size: 1.2em;
font-size: 16PX;
padding: 0 10px;
}
... ... @@ -264,6 +265,11 @@
.floor-header {
padding: 0;
h2 {
font-size: 15PX;
color: #444;
}
}
.brands-swiper {
... ... @@ -311,7 +317,7 @@
padding: 0 20px;
height: 50px;
line-height: 50px;
font-size: 34px;
font-size: 17PX;
border-top: 1px solid #e6e6e6;
background-color: #f4f4f4;
}
... ... @@ -325,7 +331,7 @@
display: block;
height: 76px;
line-height: 76px;
font-size: 28px;
font-size: 14PX;
border-bottom: 1px solid #f3f3f3;
border-top: 1px solid #f9f9f9;
... ... @@ -336,7 +342,7 @@
height: 42px;
text-align: center;
vertical-align: middle;
font-size: 28px;
font-size: 14PX;
line-height: 44px;
color: #fff;
border-radius: 50px;
... ...
.divide-image {
height: 26px;
height: 14PX;
width: 100%;
background-size: 100% 100%;
}
\ No newline at end of file
}
... ...
... ... @@ -19,6 +19,11 @@
font-size: 32px;
color: #444;
h2 {
font-size: 15PX;
color: #000;
}
.more-btn {
position: absolute;
right: 30px;
... ...
... ... @@ -42,8 +42,9 @@
.tab-name {
margin-top: 10px;
font-size: 20px;
font-size: 12PX;
line-height: 1;
transform: scale(0.9);
}
}
... ...
.icons-wrapper {
box-sizing: border-box;
padding: 30px 0 16px;
padding: 15PX 0 2PX;
background: #fff;
background-size: 100% 100%;
border-bottom: 1px solid #e0e0e0;
... ... @@ -9,7 +9,7 @@
float: left;
margin-bottom: 10px;
width: 20%;
height: 146px;
height: 70PX;
text-align: center;
&.item-4 {
... ... @@ -25,9 +25,9 @@
display: block;
margin: 0 auto;
text-align: center;
width: 96px;
height: 96px;
line-height: 96px;
width: 40PX;
height: 40PX;
line-height: 40PX;
box-sizing: border-box;
overflow: hidden;
... ... @@ -39,9 +39,10 @@
.linkbar {
display: block;
line-height: 44px;
line-height: 22PX;
font-size: 12PX;
color: #444;
transform: scale(0.9);
&:visited,
&:link,
... ...
... ... @@ -16,7 +16,7 @@
margin-right: 4px;
height: 28px;
text-align: center;
font-size: 18px;
font-size: 12PX;
line-height: 28px;
&:last-child {
... ... @@ -107,7 +107,7 @@
background: #ffac5b;
color: #fff;
text-align: center;
font-size: 18px;
font-size: 12PX;
line-height: 28px;
}
... ... @@ -145,10 +145,11 @@
.good-detail-text {
.name a {
transform: scale(0.9);
margin: 15px 0 10px;
min-height: 50px;
color: #444;
font-size: 22px;
font-size: 12PX;
line-height: 30px;
padding: 5px 0; /* 商品标题限制行数的bug修复 增加元素的clientHeight */
display: -webkit-box;
... ... @@ -159,9 +160,10 @@
}
.price {
font-size: 22px;
font-size: 12PX;
line-height: 22px;
white-space: nowrap;
transform: scale(0.9);
.sale-price {
color: #d62927;
... ... @@ -172,6 +174,7 @@
}
.market-price {
font-size: 12PX;
margin: 0 0 0 5px;
color: #b0b0b0;
text-decoration: line-through;
... ...
... ... @@ -3,8 +3,8 @@
background: #fff;
border: 1px solid #e0e0e0;
border-bottom: none;
line-height: 72px;
font-size: 30px;
line-height: 36PX;
font-size: 15PX;
color: #b0b0b0;
text-align: center;
}
... ... @@ -55,7 +55,7 @@
.name {
float: left;
font-size: 28px;
font-size: 14PX;
color: #000;
padding: 30px 0;
margin-left: 30px;
... ... @@ -63,7 +63,7 @@
.intro {
float: left;
font-size: 28px;
font-size: 14PX;
color: #b0b0b0;
padding: 30px 0;
margin-left: 30px;
... ... @@ -75,8 +75,8 @@
background: #fff;
.title {
line-height: 60px;
font-size: 40px;
line-height: 30PX;
font-size: 20PX;
color: #000;
font-weight: bold;
}
... ... @@ -84,8 +84,8 @@
.text-block {
padding: 20px 30px;
line-height: 46px;
font-size: 28px;
line-height: 23PX;
font-size: 14PX;
background: #fff;
color: #444;
word-break: break-word;
... ... @@ -258,7 +258,7 @@
h2 {
margin-left: -15px;
line-height: 104px;
font-size: 30px;
font-size: 15PX;
color: #b0b0b0;
text-align: center;
}
... ... @@ -387,7 +387,7 @@
.brand-name {
margin: 10px 0 0 0;
line-height: 24px;
font-size: 18px;
font-size: 12PX;
color: #babac2;
text-align: center;
text-decoration: none;
... ... @@ -406,8 +406,8 @@
.tag-bg {
position: absolute;
height: 40px;
width: 40px;
height: 20PX;
width: 20PX;
background: resolve('guang/tag.png') no-repeat;
background-size: 100% 100%;
top: 35px;
... ... @@ -420,14 +420,14 @@
li {
float: left;
margin-top: 31px;
margin-left: 31px;
margin-top: 16PX;
margin-left: 16PX;
}
a {
height: 50px;
line-height: 50px;
font-size: 30px;
height: 20PX;
line-height: 25PX;
font-size: 15PX;
color: #000;
text-decoration: underline;
white-space: nowrap;
... ... @@ -471,9 +471,9 @@
float: left;
width: 360px;
margin-left: 30px;
line-height: 40px;
line-height: 20PX;
color: #444;
font-size: 28px;
font-size: 14PX;
}
.title {
... ... @@ -485,16 +485,16 @@
}
.publish-time {
font-size: 18px;
font-size: 12PX;
margin-top: 0;
color: #b0b0b0;
.iconfont {
font-size: 18px;
font-size: 12PX;
}
}
}
.down-bottom {
height: 44PX;
background: #fff;
... ...
.guang-list-page {
.editor-header {
margin-bottom: 30px;
padding-top: 36px;
padding-bottom: 40px;
margin-bottom: 15PX;
padding-top: 18PX;
padding-bottom: 20PX;
background: #fff;
border-bottom: 1px solid #e0e0e0;
}
... ... @@ -11,8 +11,8 @@
float: left;
margin-left: 30px;
img {
width: 100px;
height: 100px;
width: 50PX;
height: 50PX;
border-radius: 50%;
}
}
... ... @@ -22,14 +22,14 @@
margin-left: 32px;
width: 475px;
.name {
font-size: 32px;
line-height: 40px;
font-size: 16PX;
line-height: 20PX;
}
.info {
margin-top: 6px;
color: #bdbdbf;
font-size: 24px;
line-height: 32px;
font-size: 12PX;
line-height: 16PX;
}
}
... ...
... ... @@ -76,7 +76,6 @@
}
.no-record {
position: absolute;
background: #fff;
text-align: center;
top: 50%;
... ...
@import "../channel/maybe-like";
@import "../common/index";
@import "coin/yoho-coin-new";
... ...
@import "fav";
@import "../layout/swiper";
.yoho-favorite-page {
width: 100%;
height: auto;
... ... @@ -39,10 +42,10 @@
}
.fav-content {
.fav-type {
display: none;
}
.show {
display: block;
}
... ... @@ -77,6 +80,10 @@
font-size: 26px;
border-radius: 0.2rem;
}
.fav-null-box {
display: none;
}
}
.fav-product-list {
... ... @@ -178,13 +185,12 @@
background: url("/home/fav/save-price.png");
width: 32px;
height: 32px;
position: absolute;
top: 50%;
left: 0;
margin-top: -16px;
}
span {
margin-left: 15px;
}
... ... @@ -264,6 +270,7 @@
color: #86bf4a;
margin-right: 24px;
}
.brand-discount {
color: #d1021c;
}
... ... @@ -302,6 +309,7 @@
height: 300px;
overflow: hidden;
}
.brand-product {
height: 65px;
line-height: 65px;
... ... @@ -314,6 +322,7 @@
span {
color: #d1021c;
}
b {
color: #b0b0b0;
text-decoration: line-through;
... ... @@ -337,6 +346,7 @@
background-size: auto 40%;
}
}
.fav-content-loading {
width: 100%;
height: 2rem;
... ...
... ... @@ -54,7 +54,7 @@
width: 100%;
bottom: 0;
color: #000;
font-size: 22px;
font-size: 12PX;
}
}
}
... ...
... ... @@ -3,7 +3,6 @@
@import "order";
@import "order-detail";
@import "personal-details";
@import "yoho-coin";
@import "fav";
@import "suggest";
@import "address";
... ... @@ -13,8 +12,6 @@
@import "browse-record";
@import "logistic";
@import "pay";
@import "yoho-coin-new";
@import "yoho-coin-detail";
@import "installment/index";
@import "qrcode";
@import "myqrcode";
... ...
@import "order";
@import "order-detail";
... ...
.yoho-coin-page {
.coin-num {
font-size: 1.4em;
text-align: center;
em {
font-size: 4em;
color: #f00;
}
span {
width: 100%;
height: auto;
overflow: hidden;
display: block;
color: #b0b0b0;
margin-top: -0.6rem;
}
}
.check {
width: 100%;
height: auto;
overflow: hidden;
text-align: center;
margin-top: 0.6rem;
padding-bottom: 1rem;
border-bottom: 1px solid #b0b0b0;
a {
line-height: 1.2rem;
border: 1px solid #444;
width: 30%;
height: 100%;
font-size: 1.2em;
display: inline-block;
border-radius: 0.6rem;
}
}
section p {
line-height: 1.5em;
}
.title {
font-size: 16px;
line-height: 20px;
font-weight: bold;
}
.sub-title {
display: block;
font-size: 14px;
line-height: 28px;
font-weight: bold;
}
.path {
color: #f60;
}
.remark {
color: #666;
span {
color: #9c3;
}
}
}
... ... @@ -22,9 +22,9 @@
.dollar {
display: inline-block;
width: 24px;
height: 24px;
background: url("/home/yoho-coin/dollar.png") center center;
width: 22px;
height: 22px;
background: resolve("home/yoho-coin/dollar.png") no-repeat;
background-size: 100% 100%;
}
}
... ...
@import "./home";
@import "../product/detail/recommend-for-you";
@import "../common/_good.css";
@import "../channel/_footer-tab.css";
... ...
@import '../common/dialog';
@import './browse-record';
... ...
... ... @@ -29,6 +29,7 @@
width: 100%;
background-color: #fff;
font-size: 24px;
display: none;
.op-row {
padding: 0 30px;
... ... @@ -94,12 +95,13 @@
}
.copyright {
height: 120px;
height: 60PX;
border-top: 1px solid #ccc;
background-color: #eee;
color: #666;
text-align: center;
line-height: 120px;
line-height: 60PX;
font-size: 12PX;
}
&.bottom {
... ...
... ... @@ -111,6 +111,7 @@
width: 124px;
height: 48px;
line-height: 48px;
font-size: 12PX;
text-align: center;
border: 1px solid #fff;
color: #fff;
... ... @@ -126,7 +127,7 @@
right: 30px;
.iconfont {
font-size: 24px;
font-size: 12PX;
}
&.coled {
... ... @@ -202,10 +203,10 @@
> li {
float: left;
width: 25%;
height: 66px;
line-height: 66px;
height: 33PX;
line-height: 33PX;
text-align: center;
font-size: 28px;
font-size: 14PX;
}
.bytouch {
... ... @@ -241,10 +242,11 @@
.new .iconfont {
transform: scale(0.8);
font-weight: bold;
font-size: 12PX;
}
.filter .iconfont {
font-size: 24px;
font-size: 12PX;
transition: transform 0.1 ease-in;
}
... ... @@ -262,11 +264,11 @@
}
.up {
top: -22px;
top: -11PX;
}
.down {
top: -8px;
top: -4PX;
}
}
}
... ...
... ... @@ -46,7 +46,7 @@
border: none;
background: transparent;
color: #666;
font-size: 30px;
font-size: 15PX;
line-height: 56px;
}
}
... ...
... ... @@ -30,8 +30,10 @@
display: block;
width: 100%;
border-left: 1px solid #e0e0e0;
margin-top: 30px;
height: 28px;
margin-top: 15PX;
height: 14PX;
font-size: 14PX;
line-height: 14PX;
}
&:first-child {
.text {
... ... @@ -46,7 +48,7 @@
}
}
.nav-main {
margin-bottom: 30px;
}
... ... @@ -110,7 +112,7 @@
.nav {
width: 100%;
height: 88px;
height: 44PX;
margin: 0;
padding: 0;
border: 0;
... ... @@ -123,7 +125,7 @@
border-sizing: border-box;
border-bottom: 1px solid #e0e0e0;
z-index: 2;
li{
display: block;
height: 28px;
... ... @@ -147,7 +149,7 @@
.color {
color: #444;
}
}
}
.main {
... ... @@ -250,11 +252,15 @@
border-top: 1px solid #e0e0e0;
color: #444;
text-align: center;
height: 100px;
line-height: 100px;
font-size: 30px;
height: 50PX;
line-height: 50PX;
margin-top: 30px;
position: relative;
font-size: 15PX;
h2 {
font-size: 15PX;
}
}
.hot-category .floor-header {
... ... @@ -392,9 +398,9 @@
.list-nav li {
display: block;
height: 80px;
height: 40PX;
float: left;
line-height: 80px;
line-height: 40PX;
width: 24.8%;
text-align: center;
border-sizing: border-box;
... ... @@ -402,7 +408,7 @@
span {
padding-top: 0;
font-size: 28px;
font-size: 14PX;
}
&.default:after,
... ... @@ -424,11 +430,11 @@
}
.list-nav .icon .up {
top: -28px;
top: -14PX;
}
.list-nav .icon .down {
top: -14px;
top: -7PX;
}
.goods-container {
... ... @@ -450,9 +456,9 @@
bottom: 0;
display: table;
width: 100%;
height: 88px;
line-height: 88px;
font-size: 28px;
height: 44PX;
line-height: 44PX;
font-size: 14PX;
background: #fff;
border-top: 1px solid #e0e0e0;
z-index: 2;
... ... @@ -468,8 +474,8 @@
.wall {
width: 0;
height: 28px;
margin-top: 30px;
height: 14PX;
margin-top: 15PX;
float: right;
border-right: 1px solid #e0e0e0;
display: inline-block;
... ... @@ -549,15 +555,15 @@
li {
display: block;
height: 78px;
height: 40PX;
float: left;
line-height: 78px;
line-height: 40PX;
width: 24.8%;
text-align: center;
border-sizing: border-box;
span {
font-size: 28px;
font-size: 14PX;
}
a {
... ... @@ -590,7 +596,7 @@
}
.filter .iconfont {
font-size: 22px;
font-size: 12PX;
transition: transform 0.1 ease-in;
}
... ... @@ -600,17 +606,17 @@
}
.pos-list .icon .up {
top: -28px;
top: -14PX;
}
.pos-list .icon .down {
top: -14px;
top: -7PX;
}
.category-list-top-board {
border-top: 1px solid #e0e0e0;
}
.category-list-last-li {
border-right: 1px solid #e0e0e0;
}
... ... @@ -685,10 +691,10 @@
margin-top: initial;
position: fixed;
top: 46px;
&.call-by-fix {
top: 80px;
position: fixed;
left: 0;
}
}
\ No newline at end of file
}
... ...