Authored by 毕凯

Merge remote-tracking branch 'origin/hotfix/uidhandle'

... ... @@ -6,7 +6,7 @@
<span class="tel">{{mobile}}</span>
<p class="address-info">{{area}} {{address}}</p>
<div class="action iconfont">
<span class="edit" data-href="/home/addressAct?id={{address_id}}&refer=buynow&product_sku={{product_sku}}&buy_number={{buy_number}}">&#xe61e;</span>
<span class="edit" data-href="/home/addressAct?id={{address_id}}&refer=buynow&product_sku={{../product_sku}}&buy_number={{buy_number}}">&#xe61e;</span>
<span class="del" data-id="{{address_id}}">&#xe621;</span>
</div>
</div>
... ...
... ... @@ -59,7 +59,7 @@ const collectArticle = (req, res, next) => {
/* 判断用户是否登录 */
let id = req.body.id,
opt = req.body.opt || 'ok',
uid = req.body.uid;
uid = req.user.uid;
/* 判断是不是登录成功 */
if (!uid) {
... ... @@ -112,7 +112,7 @@ const favoriteBrand = (req, res, next) => {
/* 判断参数是否有效 */
let id = req.body.id,
opt = req.body.opt || 'ok',
uid = req.user.uid || (req.body.uid && parseInt(req.body.uid, 10)) || req.cookies.appUid,
uid = req.user.uid,
isBrand = req.body.isBrand;
if (!stringProcess.isNumeric(id) || !stringProcess.isNumeric(uid)) {
... ...
... ... @@ -105,18 +105,12 @@ exports.indexRedirect = (req, res) => {
exports.userSkn = (req, res, next) => {
let isApp = req.body.app_version || req.body.appVersion || false;
let uid = '';
let uid = req.user.uid;
let param = {};
let skns = req.body.skns || '';
skns = skns.split(',') || [];
if (req.yoho.isApp) {
uid = req.body.uid;
} else {
uid = req.user.uid;
}
if (uid) {
param.uid = uid;
param.content_code = req.body.code || '';
... ...
... ... @@ -134,19 +134,11 @@ exports.getDetailData = (req, res, next) => {
* [品牌详情异步数据]
*/
exports.getDetailDataAsync = (req, res, next) => {
let uid;
let uid = req.user.uid;
let udid = req.sessionID || 'yoho';
let brandId = req.body.brand_id || 0;
let isApp = req.body.isApp || false;
if (isApp) {
if (req.body.uid) {
uid = parseInt(req.body.uid, 10);
}
} else {
uid = req.user.uid;
}
if (!brandId) {
return res.json({code: 400, message: '参数错误'});
}
... ...
... ... @@ -21,7 +21,7 @@ const _serverCrash = (res, params, err, next) => {
};
const _banksInit = () => {
const banks = ['农业银行', '中国银行', '工商银行', '建设银行', '光大银行', '兴业银行', '邮储银行', '民生银行', '中信银行', '广发银行'];
const banks = ['农业银行', '中国银行', '工商银行', '建设银行', '光大银行', '兴业银行', '邮储银行', '中信银行', '广发银行'];
if (new Date() >= new Date('2016-10-18 00:00:00')) {
// 2016年10月12日至17日 平安银行业务暂停(平安银行期间不支持服务)
... ... @@ -676,12 +676,21 @@ const bankCard = (req, res, next) => {
let uid = req.user.uid;
installmentModel.getBankCards(uid).then((result) => {
let noBank = true;
_.forEach(result, (val) => {
if (val.validStatus === false) {
noBank = false;
}
});
res.render('installment/bank-card', {
module: 'home',
page: 'bank-card',
title: '我的银行卡',
isInstallmentPage: true,
accountList: result,
noBank: noBank,
userName: _.get(result, '[0].userName')
});
}).catch((err) => {
... ...
... ... @@ -153,6 +153,7 @@ const _processBankCards = (list) => {
_.forEach(list, (data) => {
data.url = '/home/installment/card-detail?cardIdNo=' + data.cardIdNo;
data.validStatus = data.validStatus === '2';
// 正则替换卡号,保留后4位
data.cardNo = data.cardNo.replace(/(\d+)(\d{4})$/, function(a, b, c) {
... ...
... ... @@ -3,7 +3,7 @@
<span>{{coinNum}}</span>
</div>
<div class="btn-c">
<a class="acquiring-help" href='https://activity.yoho.cn/feature/905.html?share_id=3111&title=YOHO!FAMILY积分说明&openby:yohobuy={"action":"go.h5","params":{"url":"https://activity.yoho.cn/feature/905.html?share_id=3111&title=YOHO!FAMILY积分说明"}}'>如何获取积分</a>
<a class="acquiring-help" href='https://m.yohobuy.com/activity/feature/905.html?share_id=3111&title=YOHO!FAMILY积分说明&openby:yohobuy={"action":"go.h5","params":{"url":"https://m.yohobuy.com/activity/feature/905.html?share_id=3111&title=YOHO!FAMILY积分说明"}}'>如何获取积分</a>
{{#if isNowApp}}
<a class="detail" href='//m.yohobuy.com/home/family/coinDetail?plateType=3&openby:yohobuy={"action":"go.h5","params":{"url":"http://m.yohobuy.com/home/family/coinDetail","param":{"plateType":"3"}}}'>积分明细</a>
{{else if isMarsApp}}
... ...
<div class="bank-card-page">
{{#if accountList}}
{{#if noBank}}
<div class="card-tips">
<div class="left">
<p>您设置的银行卡所属银行已暂停服务,为了不影响您的还款,请添加新银行卡</p>
</div>
<div class="right hide">
<a class="iconfont" href="//m.yohobuy.com/home/installment/bind-card?name={{userName}}">去更换&nbsp;&#xe604;</a>
</div>
</div>
{{/if}}
<div class="bank-card-list" data-user="{{userName}}">
{{#accountList}}
<a class="card-bg-{{lowerCase bankCode}} card-nav" href="{{url}}"><span>{{cardNo}}</span></a>
<a class="card-bg-{{lowerCase bankCode}} card-nav" href="{{url}}">
<span>{{cardNo}}</span>
{{#if validStatus}}
<div class="out-of-service">暂停服务</div>
{{/if}}
</a>
{{/accountList}}
</div>
{{/if}}
</div>
... ...
... ... @@ -274,13 +274,12 @@ const remind = (req, res) => {
on_off: req.body.on_off === 'true' ? true : false,
activity_id: Number.parseInt(req.body.activity_id, 10),
product_skn: Number.parseInt(req.body.product_skn, 10),
uid: Number.parseInt(req.body.uid, 10),
uid: req.user.uid,
sec_kill_id: Number.parseInt(req.body.sec_kill_id, 10),
app_type: 0
})
.then(result => {
return res.json(result);
});
}).then(result => {
return res.json(result);
});
};
// Middleware:检测 app_version 是否正确
... ...
... ... @@ -13,15 +13,15 @@
</style>
<script type="application/ld+json">
{
@context: "https://ziyuan.baidu.com/contexts/cambrian.jsonld",
@id: "https://m.yohobuy.com/mip/guang/info/{{mipId}}.html",
appid: "1583402501013173",
title: "{{title}} | Yoho!Buy有货 | 潮流购物逛不停",
images: [
"@context": "https://ziyuan.baidu.com/contexts/cambrian.jsonld",
"@id": "https://m.yohobuy.com/mip/guang/info/{{mipId}}.html",
"appid": "1583402501013173",
"title": "{{title}} | Yoho!Buy有货 | 潮流购物逛不停",
"images": [
"{{mipPic}}"
],
description: "{{mipDes}}",
pubDate: "{{mipPublishTime}}"
"description": "{{mipDes}}",
"pubDate": "{{mipPublishTime}}"
}
</script>
</head>
... ...
{
"name": "yohobuywap-node",
"version": "6.2.35",
"version": "6.2.36",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -3,6 +3,35 @@
padding: 30px 30px 0;
}
.card-tips {
width: 100%;
height: 88px;
background-color: #ff8080;
font-size: 24px;
padding: 10px 25px;
.left {
float: left;
height: 68px;
line-height: 34px;
font-size: 24px;
color: #fff;
}
.right {
float: right;
width: 170px;
height: 68px;
line-height: 68px;
text-align: right;
.iconfont {
color: #fff;
font-size: 20px;
}
}
}
.card-nav {
width: 100%;
height: 200px;
... ... @@ -20,6 +49,20 @@
color: #fff;
font-size: 40px;
}
.out-of-service {
width: 120px;
height: 40px;
border-radius: 6px;
background-color: #fff;
font-size: 24px;
color: #ff575c;
line-height: 40px;
text-align: center;
position: absolute;
top: 20px;
right: 20px;
}
}
.card-bg-abc {
... ...