Authored by ccbikai(👎🏻🍜)

Merge branch 'feature/channelIndex' into release/5.1

... ... @@ -134,11 +134,6 @@ const _getChannelResource = (params) => {
cache: true
}).then(result => {
if (result && result.code === 200) {
for (let item of result.data.list) {
item.template_name === 'single_image' &&
item.data.length === 1 &&
(item.singleOne = true);
}
return resourcesProcess(result.data.list);
} else {
logger.error('index resouce is not 200');
... ... @@ -183,17 +178,27 @@ const _getChannelList = () => {
result.data.list = camelCase(result.data.list || []);
_.forEach(result.data.list, function(item) {
const channel = channelList[item.yhChannel - 1];
let id = _.toNumber(item.id);
const channel = channelList[id - 1];
if (channel) {
list.channelList.push(channel);
}
if (_.toNumber(item.yhChannel) === 5) {
if (id === 5) {
list.yohood.showYohood = true;
list.yohood.yohoodHref = 'http://www.yohood.cn';
}
if (id === 6) {
list.channelList.push({
href: item.url,
title: item.title || '双 11',
entitle: item.title
});
}
});
return Object.keys(list).length ? list : channelList;
} else {
logger.error('channel select code is not 200');
... ...
... ... @@ -43,7 +43,7 @@ const editor = (req, res, next) => {
articleListData = datas[1];
let build = [];
if (articleListData.data.list.artList) {
if (articleListData.data && articleListData.data.list && articleListData.data.list.artList) {
articleListData.data.list.artList.forEach(articleData => {
build.push(guangProcess.formatArticle(articleData, true, isApp, false, uid));
});
... ...
... ... @@ -72,7 +72,7 @@ const _pageArticleContent = (articleContent, isApp, gender) => {
// 通过SKN获取商品信息
productDetailModel.productInfoBySkns(skns).then((product) => {
if (product.data.product_list) {
if (product.data && product.data.product_list) {
let d = [];
for (let o = 0; o < product.data.product_list.length; o++) {
... ...
... ... @@ -32,6 +32,7 @@ exports.order = (req, res, next) => {
navTitle: '我的订单'
}),
title: 'Yoho!Buy 有货',
pageFooter: true,
order: result
});
}).catch(next);
... ...
... ... @@ -110,6 +110,9 @@ const favProduct = (uid, page, limit) => {
return resu;
} else {
logger.error('收藏商品 cood 不是 200');
return {
total: 0,
};
}
});
};
... ... @@ -190,6 +193,9 @@ const favfavBrand = (uid, page, limit) => {
return resu;
} else {
logger.error('收藏品牌 cood 不是 200');
return {
total: 0,
};
}
});
};
... ...
... ... @@ -134,7 +134,11 @@ const index = (params) => {
if (result[2] && result[2].data) {
Object.assign(finalResult, {
productFavoriteTotal: result[2].data.product_favorite_total
productFavoriteTotal: result[2].data.product_favorite_total || '0'
});
} else {
Object.assign(finalResult, {
productFavoriteTotal: '0'
});
}
... ... @@ -146,8 +150,13 @@ const index = (params) => {
yohoCoinNum: result[3].data.yoho_coin_num,
inboxTotal: result[3].data.inbox_total,
couponNum: result[3].data.coupon_num,
brandFavoriteTotal: result[3].data.brand_favorite_total,
productBrowse: result[3].data.product_browse
brandFavoriteTotal: result[3].data.brand_favorite_total || '0',
productBrowse: result[3].data.product_browse || '0'
});
} else {
Object.assign(finalResult, {
brandFavoriteTotal: '0',
productBrowse: '0'
});
}
... ...
... ... @@ -43,8 +43,6 @@ const _assignExpressInfo = (showLogistics, order, result) => {
const _getOrderStatus = (order, showLogistics) => {
let result = {};
// let order.status = 3;
if (order.isCancel === 'Y') {
return {
canceled: true
... ... @@ -54,7 +52,7 @@ const _getOrderStatus = (order, showLogistics) => {
// 先判断订单付款方式,根据不同的付款方式计算订单状态。(注:货到付款没有待付款状态)
// 支付方式为非货到付款时,计算订单状态。
if (parseInt(order.paymentType, 10) !== 2) {
switch (order.status) {
switch (parseInt(order.status, 10)) {
case 0:
/* 待付款 */
... ...
... ... @@ -48,8 +48,10 @@
</a>
{{/notice}}
</div>
<div class="my-order">
{{^}}
<div class="my-order my-order-top">
{{/if}}
<div class="my-order">
<a class="order-title" href="/home/orders">
我的订单
<span class="iconfont">
... ...
'use strict';
exports.index = (req, res) => {
res.render('app-update', {
width750: true,
});
};
... ...
... ... @@ -64,7 +64,7 @@ class Auth {
return Auth.profile(uid).then((userInfo) => {
let token = sign.makeToken(uid);
let data = userInfo.data;
let encryptionUid = aes.encryptionUid(data.uid);
let encryptionUid = aes.encryptionUid(uid);
if (data) {
let uidCookie = `${data.profile_name}::${encryptionUid}::${data.vip_info.title}::${token}`;
... ...
... ... @@ -13,6 +13,7 @@ const back = require(cRoot + '/back');
const bind = require(cRoot + '/bind');
const reg = require(cRoot + '/reg');
const smsLogin = require(cRoot + '/sms');
const update = require(cRoot + '/update');
const router = express.Router(); // eslint-disable-line
... ... @@ -107,4 +108,9 @@ router.get('/passport/back/backcode', back.setNewPasswordByMobilePage);// 设置
router.post('/passport/back/passwordbyemail', back.setNewPasswordByEmailAPI);// 依据邮箱验证码修改密码
router.post('/passport/back/passwordbymobile', back.setNewPasswordByMobileAPI);// 依据手机验证码修改密码
/**
* 提示升级app
*/
router.get('/passport/update', update.index);
module.exports = router;
... ...
<section class='app_update'>
<button>立即升级</button>
</section>
\ No newline at end of file
... ...
... ... @@ -172,7 +172,7 @@ const shopFav = (req, res) => {
listModel.getShopFav(req, shopId, uid, isApp).then(result => {
res.json({
code: 200,
collect: result.is_favorite === 'Y',
collect: _.get(result, 'is_favorite', '') === 'Y'
});
});
};
... ...
... ... @@ -69,8 +69,6 @@ const mayLike = (uid, page, limit, gender, udid, recPos, channel) => {
} else {
return false;
}
} else {
return false;
}
} else {
... ...
... ... @@ -16,11 +16,15 @@ module.exports = {
siteUrl: '//m.yohobuy.com',
assetUrl: '//localhost:5001',
domains: {
// service: 'http://devservice.yoho.cn:58077/'
// api: 'http://dev-api.yohops.com:9999/',
api: 'http://api.yoho.cn/',
service: 'http://dev-service.yohops.com:9999/',
liveApi: 'http://testapi.live.yohops.com:9999/'
// api: 'http://api.yoho.cn/',
// service: 'http://service.yoho.cn/',
// liveApi: 'http://api.live.yoho.cn/',
// singleApi: 'http://single.yoho.cn/'
api: 'http://api-test1.yohops.com:9999/',
service: 'http://service-test1.yohops.com:9999/',
liveApi: 'http://testapi.live.yohops.com:9999/',
singleApi: 'http://api-test1.yohops.com:9999/'
},
subDomains: {
host: '.m.yohobuy.com',
... ...
... ... @@ -12,8 +12,4 @@
立即下载
</a>
</div>
{{/showDownloadApp}}
\ No newline at end of file
{{/showDownloadApp}}
\ No newline at end of file
... ...
{
"name": "m-yohobuy-node",
"version": "5.0.2",
"version": "5.0.4",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -171,7 +171,7 @@ gulp.task('font', () => {
// postcss compile in pro
gulp.task('postcss', ['assets'], () => {
return gulp.src(['scss/index.css', 'scss/shop.css'])
return gulp.src(['scss/shop.css', 'scss/index.css'])
.pipe(postcss(postcssPlugin(env.pro)))
.pipe(cssnano({
safe: true
... ...
... ... @@ -131,6 +131,8 @@ module.exports = function(specificGender) {
searching = false;
loading.hideLoadingMask();
$('.maybe-like').hide();
// 有货币页面不加载底部
if (gender && !specificGender) {
gender = gender.substr(0, 3);
... ...
... ... @@ -23,7 +23,7 @@ $.get('/product/recommend-for-you/userCenter').then(function(html) {
PRDID.push($(this).data('id'));
});
let $recommendSonLen = $recommendForYou.find('.good-info').length;
var $recommendSonLen = $recommendForYou.find('.good-info').length;
if ($recommendSonLen === 0) {
$recommendForYou.hide();
... ...
... ... @@ -54,7 +54,7 @@ $('#upload-img').upload({
}));
},
onUploadComplete: function(file, data) {
data = saveImage(data);
data = saveImage.saveImage(data);
$uploadImgList.html('');
imgStr = data.imgList[0].imgRelUrl;
... ...
... ... @@ -10,19 +10,28 @@ var qrCheck = {
},
init: function() {
var ifr,
var // ifr,
u = navigator.userAgent.toLowerCase(),
isiOS = u.indexOf('os') > -1 || u.indexOf('iphone') > -1 || u.indexOf('mac') > -1 || u.indexOf('ipad') > -1,
qr = this.getQuery('qr');
qr = this.getQuery('qr'),
isApp = this.getQuery('app_version');
if (qr) {
if (qr && isApp) {
location.href = '//m.yohobuy.com/passport/update';
}
if (qr && !isApp) {
if (isiOS) {
window.location = 'yohobuy://http://m.yohobuy.com/signin.html?qr=' + qr;
} else {
ifr = document.createElement('iframe');
ifr.src = 'yohobuy://http://m.yohobuy.com/signin.html?qr=' + qr;
ifr.style.display = 'none';
document.body.appendChild(ifr);
// 安卓跳下载
location.href = '//m.yohobuy.com/passport/update';
// 安卓暂时不处理
// ifr = document.createElement('iframe');
// ifr.src = 'yohobuy://http://m.yohobuy.com/signin.html?qr=' + qr;
// ifr.style.display = 'none';
// document.body.appendChild(ifr);
}
// time = Date.now();
... ...
var $ = require('yoho-jquery');
// $('body').height($(window).height());
// $('.app_update').height($(window).height()).width($(window).width());
$('button').on('click', function() {
window.location = 'http://www.yohoshow.com/about/index/yohobuyqr';
});
... ...
... ... @@ -160,4 +160,14 @@
&:actived {
color: #000;
}
}
.circle-rightbottom {
position: absolute;
width: 25PX;
height: 0PX;
border:0 solid #323232;
border-bottom:25PX solid #323232;
border-radius:0 0 25PX 0;
}
\ No newline at end of file
... ...
... ... @@ -130,7 +130,7 @@
content: "";
position: absolute;
right: 0;
top: 24px;
top: 12px;
width: 0;
height: 44px;
border-right: 4px solid #fff;
... ... @@ -145,9 +145,15 @@
padding: 0;
height: 88px;
.link-item p {
font-size: 32px;
line-height: 88px;
.link-item {
p {
font-size: 32px;
line-height: 88px;
}
&:after {
top: 24px;
}
}
}
}
... ... @@ -241,6 +247,10 @@
}
}
.my-order-top {
margin-top: 30px;
}
.group-list {
margin-bottom: 30px;
border-top: 1px solid #e0e0e0;
... ...
... ... @@ -271,7 +271,7 @@
height: 60px;
position: absolute;
left: 50%;
top: 50%;
top: 47%;
margin-top: -18px;
margin-left: -250px;
z-index: 8;
... ...
... ... @@ -42,7 +42,7 @@
height: 60px;
position: absolute;
left: 50%;
top: 50%;
top: 47%;
margin-top: -18px;
margin-left: -250px;
z-index: 8;
... ...
.app_update {
background: resolve("./app-update.png");
background-size: 100% 100%;
width: 100%;
height: height("./app-update.png");
button {
position: absolute;
left: 50%;
bottom: 220px;
height: 90px;
width: 470px;
margin-left: -235px;
padding: 0;
background: #444;
color: #fff;
font-size: 30px;
border-radius: 10px;
}
}
... ...
... ... @@ -6,3 +6,4 @@
@import "code";
@import "bind";
@import "success";
@import "app-update";
... ...
... ... @@ -3,9 +3,11 @@
position: relative;
padding: 14px 22px;
background: #f8f8f8;
form {
width: 100%;
}
.search-icon {
position: absolute;
font-size: 24px;
... ... @@ -16,7 +18,7 @@
input {
height: 56px;
width: 378px;
width: 480px;
border-radius: 28px;
padding: 0 52px;
font-size: 24px;
... ... @@ -149,7 +151,6 @@
margin-top: 38px;
}
}
}
.search-associate {
... ... @@ -194,9 +195,11 @@
position: relative;
padding: 14px 22px;
background: #f8f8f8;
form {
width: 100%;
}
.search-icon {
position: absolute;
font-size: 24px;
... ...
... ... @@ -91,7 +91,7 @@ exports.processProductList = (list, options) => {
_.forEach(list, (product) => {
// 商品信息有问题,则不显示
if (!product.productId || !product.goodsList || product.goodsList.length === 0) {
if (!product || !product.productId || !product.goodsList || product.goodsList.length === 0) {
return;
}
... ...
... ... @@ -70,6 +70,11 @@ module.exports = (list) => {
floor.data.data = floor.data.image;
}
// 单张轮播图
floor.singleImage &&
floor.data.length === 1 &&
(floor.singleOne = true);
formatData.push(floor);
});
... ...