Authored by 石坚

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

... ... @@ -8,6 +8,9 @@
const mcHandler = require('../models/menu-crumb-handler');
const orderModel = require('../models/order');
const _ = require('lodash');
const crypto = global.yoho.crypto;
const config = global.yoho.config;
/**
* 我的订单
... ... @@ -41,6 +44,9 @@ const detail = (req, res, next) => {
const pageData = result[0];
const thumb = result[1];
if (_.has(pageData, 'orderDetail.orderCode')) {
pageData.orderDetail.orderCodeM = crypto.encryption(config.crypto.common, pageData.orderDetail.orderCode);
}
res.display('index', {
isMe: true,
... ... @@ -123,6 +129,7 @@ const editOrder = (req, res, next) => {
const query = req.query;
query.uid = uid;
query.orderCode = crypto.decrypt(config.crypto.common, query.orderCode);
orderModel.editOrder(query).then(result => {
res.json(result);
... ...
... ... @@ -344,7 +344,7 @@ const _setRefundDetailData = (data) => {
resData.refundSure = {
mode: data.return_amount_mode_name,
account: data.return_amount_mode_name,
amount: data.return_amount_total,
amount: data.return_amount,
coin: parseInt(data.return_yoho_coin * 100, 10)
};
break;
... ...
<div class="order-status order" data-code="{{orderCode}}">
<div class="order-status order" data-code="{{orderCode}}" data-codem="{{orderCodeM}}">
<div class="basic">
<p>订单号:{{orderCode}}</p>
<p>订单状态:{{statusStr}}</p>
... ...
... ... @@ -823,9 +823,7 @@ const setDetailData = sizeInfo => {
titleCn: '商品详情'
};
if (sizeInfo.productDescBo && sizeInfo.productDescBo.phrase) {
details.content = `${sizeInfo.productDescBo.phrase}<br/>`;
}
details.content = `${_.get(sizeInfo, 'productDescBo.phrase', '')}<br/>`;
// 图片换规则
const replacePairs = [
... ...
... ... @@ -18,7 +18,6 @@ exports.index = (req, res, next) => {
if (result.code === 200) {
res.header('Cache-Control', 'no-store');
res.display('cart', _.merge({
module: 'shopping',
page: 'cart',
... ... @@ -135,7 +134,7 @@ exports.addToCart = (req, res, next) => {
shoppingKey: req.cookies._SPK || null,
uid: req.user.uid
}).then((result) => {
res.cookie('_SPK', result.data.shopping_key, { maxAge: 1000 * 60 * 60 * 24 * 365, httpOnly: true, path: '/'});
res.cookie('_SPK', result.data.shopping_key, {maxAge: 1000 * 60 * 60 * 24 * 365, httpOnly: true, path: '/'});
res.json(result);
}).catch(next);
};
... ... @@ -147,9 +146,6 @@ exports.toggleSelectGoods = (req, res, next) => {
const shoppingKey = req.cookies._SPK;
// 商品sku列表
// skuList:
// [{"goods_type":"advance","buy_number":1,"selected":"Y","product_sku":"1006277","promotion_id":0}, {...}]
// [{"goods_type":"ordinary","buy_number":1,"selected":"Y","product_sku":"1006277","promotion_id":0}, {...}]
const productSkuList = req.body.skuList;
if (uid) {
... ...
... ... @@ -26,7 +26,7 @@ const Alipay = {
_input_charset: 'utf-8',
notify_url: config.pay.serviceNotify + 'payment/alipay_notify',
return_url: 'http:' + helpers.urlFormat('/shopping/pay/callback/alipay'),
subject: '有货订单号:' + order.orderCode,
subject: 'BLK订单号:' + order.orderCode,
out_trade_no: order.orderCode,
it_b_pay: common.getPayExpireMin(order.payExpire) + 'm',
total_fee: order.paymentAmount,
... ...
... ... @@ -295,6 +295,23 @@ const filterCartData = (result, uid) => {
});
}
let freeShippingTip = '';
if (_.has(result, 'data.ordinary_cart_data.promotion_info')) {
let promotions = result.data.ordinary_cart_data.promotion_info;
_.each(promotions, p => {
if (p.promotion_type === 'VipFreeShippingCost') {
freeShippingTip = p.promotion_title;
}
if (p.promotion_type === 'FreeShippingCost') {
freeShippingTip = p.promotion_title;
}
});
}
return _.merge(resData, {
hasGoods: advancedGoods.length || ordinaryGoods.length || invalidGoods.length,
preSalePros: (advancedSoldOutGoods.length || advancedGoods.length) ?
... ... @@ -304,6 +321,7 @@ const filterCartData = (result, uid) => {
selectedNum: selectedAdvanceNum + selectedOrdinaryNum,
checkAll: totalNum === (selectedAdvanceNum + selectedOrdinaryNum),
totalMoney: totalAdvanceMoney + totalOrdinaryMoney,
freeShippingTip: freeShippingTip,
noStorage
});
};
... ...
... ... @@ -17,7 +17,7 @@
</li>
<li>
<a href="/product/pro_{{product_id}}_{{goods_id}}/{{cn_alphabet}}.html" target="_blank">
<img src="{{image goods_images 100 134}}" alt="{{product_name}}">
<img src="{{image goods_images 100 134}}" alt="{{product_name}}" width="100" height="134">
</a>
</li>
<li class="pro-info">
... ... @@ -72,7 +72,7 @@
</li>
<li>
<a href="/product/pro_{{product_id}}_{{goods_id}}/{{cn_alphabet}}.html" target="_blank">
<img src="{{image goods_images 100 134}}" alt="{{product_name}}">
<img src="{{image goods_images 100 134}}" alt="{{product_name}}" width="100" height="134">
</a>
</li>
<li class="pro-info">
... ... @@ -116,7 +116,7 @@
</li>
<li>
<a href="javascript:void(0)">
<img src="{{image goods_images 100 134}}" alt="{{product_name}}">
<img src="{{image goods_images 100 134}}" alt="{{product_name}}" width="100" height="134">
</a>
</li>
<li class="pro-info">
... ...
{{#if freeShippingTip}}
<div class="fregit-remark">
<span>免运费</span>
满399免运费
{{freeShippingTip}}
</div>
{{/if}}
<div class="cart-statement">
<div class="actions">
<div class="action">
... ...
... ... @@ -23,8 +23,8 @@ module.exports = {
cookieDomain: 'yohoblk.com',
domains: {
singleApi: 'http://single.yoho.cn/',
api: 'http://api.yoho.yohoops.org/',
service: 'http://service.yoho.yohoops.org/',
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
search: 'http://search.yohoops.org/yohosearch/'
},
useOneapm: false,
... ... @@ -85,13 +85,16 @@ module.exports = {
partnerID: '2088421464239504',
appSecret: 'e3i54meghrac3qhryzhw1h5yzeijik7e'
},
sina: { // 还未申请
appID: '3739328910',
appSecret: '9d44cded26d048e23089e5e975c93df1'
sina: { // OK
appID: '1379621535',
appSecret: 'aa29bf39b5fd9f247c93e900d679ab6a'
}
},
pay: {
serviceNotify: 'http://devservice.yoho.cn:58077/'
},
crypto: {
common: 'yohoblk9646abcde'
}
};
... ...
... ... @@ -11,7 +11,9 @@ module.exports = () => {
let isMobile = /(nokia|iphone|android|ipad|motorola|^mot\-|softbank|foma|docomo|kddi|up\.browser|up\.link|htc|dopod|blazer|netfront|helio|hosin|huawei|novarra|CoolPad|webos|techfaith|palmsource|blackberry|alcatel|amoi|ktouch|nexian|samsung|^sam\-|s[cg]h|^lge|ericsson|philips|sagem|wellcom|bunjalloo|maui|symbian|smartphone|midp|wap|phone|windows ce|iemobile|^spice|^bird|^zte\-|longcos|pantech|gionee|^sie\-|portalmmm|jig\s browser|hiptop|^ucweb|^benq|haier|^lct|opera\s*mobi|opera\*mini|320x320|240x320|176x220)/i.test(req.get('user-agent')); // eslint-disable-line
if (isMobile) {
return res.redirect(`//m.yohobuy.com${req.url}`);
// return res.redirect(`//m.yohobuy.com${req.url}`);
// http://jira.yoho.cn:8888/browse/BLK-2051
return res.redirect('//www.yohoshow.com/about/index/blkqr');
}
next();
};
... ...
... ... @@ -14,12 +14,10 @@ var $searchWrap = $('.search-wrapper'),
$clearInput = $('.clear-input');
var goodsTpl = require('../../tpl/common/bag-goods.hbs');
var delayer;
require('yoho-jquery-nanoscroller');
var delayer;
function handelProduct(data) {
var goods = [],
list = ['commonPros', 'preSalePros', 'noStorage'];
... ... @@ -66,8 +64,7 @@ function refreshBag() {
$bagGoodsList.empty();
$miniBag.addClass('bag-empty');
}
$('.nano').nanoScroller({disableResize: true});
$('.mini-goods-list-wrap.nano').nanoScroller({disableResize: true});
}
}
});
... ...
... ... @@ -26,7 +26,7 @@ $('.order .cancel-btn').on('click', function() {
$('.order .edit-btn').on('click', function() {
var $this = $(this);
var $userInfo = $('.user-info.info-box');
var code = $this.closest('.order').data('code');
var code = $this.closest('.order').data('codem');
var areaCode = $userInfo.data('area');
var userName = $userInfo.find('.user-name-sel').data('name');
... ...
... ... @@ -238,7 +238,8 @@
.del-good-btn {
cursor: pointer;
color: #999;
&:hover{
&:hover {
color: #1b1b1b;
}
}
... ... @@ -282,7 +283,7 @@
left: 50%;
position: absolute;
margin-left: -132px;
margin-top: 20px;
margin-top: 30px;
background: resolve("layout/blk-logo.svg") no-repeat center center;
background-size: 100%;
... ... @@ -300,8 +301,9 @@
.sub-nav-list {
max-width: 94%;
line-height: 50px;
display: inline-block;
line-height: 55px;
height: 44px;
li {
float: left;
... ...
... ... @@ -23,7 +23,7 @@
margin-top: 9px;
text-align: center;
top: 15px;
left: 26px;
left: 10px;
z-index: 2;
h2 {
... ...
... ... @@ -2,6 +2,11 @@
padding-bottom: 30px;
background: #f5f5f5;
/* 个人中心布局下重置默认的底部样式 */
+ .blk-footer .center-content {
border-top: none;
}
.help-navigation {
width: 150px;
margin-right: 10px;
... ...
... ... @@ -220,10 +220,10 @@
}
}
.marginhack{
.marginhack {
margin-top: -4px;
.black{
.black {
margin-top: 0;
}
}
... ... @@ -259,7 +259,7 @@
width: 100%;
.bg {
height: 250px;
height: 160px;
background-image: resolve("me/no-order.png");
background-repeat: no-repeat;
background-position: center bottom;
... ...
... ... @@ -17,7 +17,6 @@
color: $blue;
font-weight: bold;
}
}
.country-code {
... ... @@ -36,7 +35,7 @@
@mixin input;
&.phone-num {
width: 150px;
width: 170px;
display: block;
float: left;
border: none !important;
... ... @@ -46,7 +45,6 @@
&.captcha {
width: $captcha;
float: left;
}
}
... ... @@ -93,7 +91,6 @@
.small {
@mixin small;
}
}
.other-opts {
... ... @@ -104,6 +101,7 @@
.third-party-login {
margin: 0 30px;
span {
float: left;
width: calc(($item-width - 60px) / 4);
... ...
... ... @@ -397,11 +397,15 @@
display: inline-block;
vertical-align: top;
width: 60px;
margin-right: 10px;
margin-right: 11px;
}
.goods-img-col:last-child {
margin-right: 0;
}
img {
margin: 8px 0;
margin-top: 11px;
cursor: pointer;
}
}
... ...
... ... @@ -23,7 +23,7 @@
display: block;
position: absolute;
right: 20px;
bottom: 30px;
bottom: 20px;
font-size: 14px;
a,
... ... @@ -33,6 +33,9 @@
padding: 10px;
margin-left: 10px;
cursor: pointer;
display: inline-block;
line-height: 12px;
height: 32px;
.iconfont {
font-size: 14px;
... ...
... ... @@ -33,7 +33,7 @@
</li>
<li>
<a href="/product/pro_{{product_id}}_{{goods_id}}/{{cn_alphabet}}.html" target="_blank">
<img src="{{image goods_images 100 134}}" alt="{{product_name}}">
<img src="{{image goods_images 100 134}}" alt="{{product_name}}" width="100" height="134">
</a>
</li>
<li class="pro-info">
... ... @@ -101,7 +101,7 @@
</li>
<li>
<a href="/product/pro_{{product_id}}_{{goods_id}}/{{cn_alphabet}}.html" target="_blank">
<img src="{{image goods_images 100 134}}" alt="{{product_name}}">
<img src="{{image goods_images 100 134}}" alt="{{product_name}}" width="100" height="134">
</a>
</li>
<li class="pro-info">
... ... @@ -158,7 +158,7 @@
</li>
<li>
<a href="javascript:void(0)">
<img src="{{image goods_images 100 134}}" alt="{{product_name}}">
<img src="{{image goods_images 100 134}}" alt="{{product_name}}" width="100" height="134">
</a>
</li>
<li class="pro-info">
... ... @@ -203,6 +203,13 @@
</div>
{{/if}}
{{#if @root.freeShippingTip}}
<div class="fregit-remark">
<span>免运费</span>
{{@root.freeShippingTip}}
</div>
{{/if}}
<div class="cart-statement">
<div class="actions">
<div class="action">
... ...