Authored by yyq

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

... ... @@ -15,7 +15,7 @@ const orderModel = require('../models/order');
const index = (req, res) => {
const type = req.query.type;
const page = req.query.page;
const uid = req.user.uid;
const uid = req.user.uid || '7394907';
orderModel.getOrderData(uid, type, page).then(result => {
res.display('index', {
... ... @@ -32,7 +32,7 @@ const index = (req, res) => {
const detail = (req, res) => {
const code = req.query.code;
const uid = req.user.uid;
const uid = req.user.uid || '7394907';
orderModel.getOrderDetail(uid, code).then(result => {
res.display('index', {
... ... @@ -58,9 +58,7 @@ const getOrderList = (req, res) => {
page: 'order',
isMe: true,
orderList: result.order.orderList,
paginationOpts: result.order.paginationOpts,
emptyMsg: result.order.emptyMsg,
showEmptyEn: result.order.showEmptyEn
orderData: result.order
});
});
};
... ...
... ... @@ -331,16 +331,22 @@ const getOrderData = (uid, type, page) => {
]
};
const emptyMsg = {
const emptyObject = {
1: {
text: '您暂时还没有订单',
showEmptyEn: true
emptyMsg: '暂时还没有订单哦~',
showEmptyEn: true,
btnText: '去首页看看',
url: '/'
},
2: {
text: '您暂时还没有待付款的订单'
emptyMsg: '没有待付款的订单哦~',
btnText: '查看全部订单',
url: '/me/'
},
3: {
text: '您暂时还没有待收货的订单'
emptyMsg: '没有待收货的订单哦~',
btnText: '查看全部订单',
url: '/me/'
}
};
... ... @@ -358,10 +364,7 @@ const getOrderData = (uid, type, page) => {
type: type
};
const empty = {
showEmptyEn: emptyMsg[type].showEmptyEn,
emptyMsg: emptyMsg[type].text
};
const empty = emptyObject[type];
navBar.tabs[typeActiveIndexMap[type]].isActive = true;
... ...
... ... @@ -56,12 +56,16 @@
{{/if}}
{{^}}
<div class="bg"></div>
{{#orderData}}
<div class="msg">
<p class="msg-zh bold">{{emptyMsg}}</p>
{{#if showEmptyEn}}
<p class="msg-en">You do not have an order for the time being</p>
{{/if}}
<span class="btn">去购物</span>
<a href="{{url}}">
<span class="btn">{{btnText}}</span>
</a>
</div>
{{/orderData}}
{{/if}}
</div>
... ...
... ... @@ -173,7 +173,7 @@ function fetchInitialData(evt, config, level) {
$('<span class="check-icon iconfont">&#xe60b;</span>').appendTo(liElement);
$('<span/>', {
class: 'dist-name',
'class': 'dist-name', // eslint-disable-line
title: item.text,
text: item.text,
id: 'area_' + item.value
... ... @@ -254,7 +254,7 @@ function setAddress(evt, config, level, areaId) {
$('<span class="check-icon iconfont" style="display: inline;">&#xe60b;</span>').appendTo(liElement);
$('<span/>', {
class: 'dist-name checked',
'class': 'dist-name checked', // eslint-disable-line
title: label,
text: label,
id: 'area_' + item.value
... ... @@ -262,7 +262,7 @@ function setAddress(evt, config, level, areaId) {
} else {
$('<span class="check-icon iconfont">&#xe60b;</span>').appendTo(liElement);
$('<span/>', {
class: 'dist-name',
'class': 'dist-name', // eslint-disable-line
title: item.text,
text: item.text,
id: 'area_' + item.value
... ... @@ -356,12 +356,12 @@ CascadingAddress.prototype.init = function() {
// div element
distItem = $('<div></div>', {
class: 'dist-item closed'
'class': 'dist-item closed' // eslint-disable-line
});
// 标签
$('<span/>', {
class: 'indicator-name',
'class': 'indicator-name', // eslint-disable-line
text: indicatorName
}).appendTo(distItem);
... ... @@ -381,7 +381,7 @@ CascadingAddress.prototype.init = function() {
// 省份城市区县选择panel
distPanel = $('<div/>', {
class: 'items-panel empty',
'class': 'items-panel empty', // eslint-disable-line
id: 'level_' + levels + '_panel',
text: config.defaultDes
});
... ...