Authored by Jian Shi

Merge branch 'release/wap-optim' of http://git.yoho.cn/fe/yohobuywap-node into release/wap-optim

'use strict';
const api = global.yoho.API;
let _getProduct = function(o) {
... ...
... ... @@ -103,6 +103,8 @@ exports.record = (req, res, next) => {
if (result.browseRecord && result.browseRecord.length > 0) {
responseData.browseRecord = result.browseRecord;
} else {
responseData.noRecord = true;
}
res.render('browse-record', responseData);
... ...
... ... @@ -17,6 +17,8 @@ const myCurrency = (req, res, next) => {
myCurrencyModel.myCurrency(uid, contentCode).then(result => {
res.render('currency-new', {
module: 'home',
page: 'mycurrency',
pageHeader: _.assign(headerModel.setNav({
navTitle: '有货币'
}), {
... ... @@ -38,8 +40,9 @@ const currencyDetail = (req, res, next) => {
let limit = 10;
myCurrencyModel.currencyDetailIndex(uid, page, limit).then(result => {
res.render('currency-detail', {
module: 'home',
page: 'currencyDetail',
pageHeader: _.assign(headerModel.setNav({
navTitle: '有货币明细'
}), {
... ...
... ... @@ -26,8 +26,8 @@ exports.order = (req, res, next) => {
// 获取第一页数据做服务端渲染
let initialData = {
type: 1,
page: 1,
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
... ... @@ -44,8 +44,10 @@ exports.order = (req, res, next) => {
navTitle: '我的订单'
}),
title: 'Yoho!Buy 有货',
localCss: true,
pageFooter: true,
order: result[0] || [],
walkwayUrl: result[1] && result[1].length ? '' : '//m.yohobuy.com/product/new',
firstPageOrdersList: result[1] || []
});
}).catch(next);
... ...
... ... @@ -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);
... ...
... ... @@ -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 {};
... ...
... ... @@ -7,7 +7,7 @@
<div class="no-record">
<div class="icon"></div>
<span>暂无浏览记录</span>
<a class="walk-way" href="{{walkwayUrl}}">随便逛逛</a>
<a class="walk-way" href="/product/new">随便逛逛</a>
</div>
{{/if}}
</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>
... ...
... ... @@ -9,11 +9,11 @@
</ul>
<div id="order-container" class="order-container">
{{#if walkwayUrl}}
{{#if @root.walkwayUrl}}
<div class="no-order">
<div class="icon"></div>
<span>你还没有订单!</span>
<a class="walk-way" href="{{walkwayUrl}}">随便逛逛</a>
<a class="walk-way" href="{{@root.walkwayUrl}}">随便逛逛</a>
</div>
{{^}}
<div class="firstscreen-orders">
... ...
... ... @@ -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);
}
}
};
... ...
... ... @@ -106,7 +106,7 @@ 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) {
method = 'app.search.brand';
... ...
... ... @@ -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.3.15",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -6,7 +6,7 @@
"instances": "3",
"exec_mode": "cluster",
"merge_logs": true,
"log_date_format": "YYYY-MM-DD HH:mm Z",
"log_date_format": "YYYY-MM-DD HH:mm:ss Z",
"error_file": "/Data/logs/node/yohobuywap-node-err.log",
"out_file": "/Data/logs/node/yohobuywap-node-out.log",
"env": {
... ...
... ... @@ -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) {
... ...
... ... @@ -31,6 +31,10 @@ load.init();
function moreRecord(cb) {
var count = $page.children('.browse-record-good').length;
if (count === 0) {
return;
}
if (loading) {
return;
}
... ...
... ... @@ -39,6 +39,7 @@ var couponAJAX = function(statu, page) {
if ($(data).find('.null').html()) {
if (page === 1) {
employDom.append($(data).find('.null'));
window.rePosFooter();
}
AjaxFlag = 1;
return;
... ...
... ... @@ -39,6 +39,8 @@ var firstScreen = $('.firstscreen-orders').children().size() > 0;
require('../common');
require('../../scss/home/order-list.page.css');
// 减少计时
function downCount(item) {
var hoursItem = item.find('.hours');
... ...
... ... @@ -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);
... ...
... ... @@ -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});
}
}
});
... ...
... ... @@ -76,7 +76,6 @@
}
.no-record {
position: absolute;
background: #fff;
text-align: center;
top: 50%;
... ...
@import "../layout/swiper";
@import "order";
@import "order-detail";
... ...
@import 'order';
@import '../layout/swiper';
... ...
... ... @@ -29,6 +29,7 @@
width: 100%;
background-color: #fff;
font-size: 24px;
display: none;
.op-row {
padding: 0 30px;
... ...
... ... @@ -26,19 +26,19 @@ module.exports = {
if (query.indexOf('imageView2') === 0) {
if (params.q && query.indexOf('/q/') > 0) {
query = query.replace(/\/q\/\d+/g, '/q/' + params.q);
} else {
} else if (params.q) {
query += '/q/' + params.q;
}
} else if (query.indexOf('imageMogr2') === 0) {
if (params.q && query.indexOf('/quality/') > 0) {
query = query.replace(/\/quality\/\d+/g, '/quality/' + params.q);
} else {
} else if (params.q) {
query += '/quality/' + params.q;
}
} else if (query.indexOf('imageView/') === 0){
if (params.q && query.indexOf('/q/') > 0) {
query = query.replace(/\/q\/\d+/g, '/q/' + params.q);
} else {
} else if (params.q) {
query += '/q/' + params.q;
}
... ...