Authored by 杨延青

Merge branch 'feature/yoluckShare' into 'release/0110'

Feature/yoluck share



See merge request !1661
... ... @@ -2,6 +2,15 @@ const _ = require('lodash');
const {YOLUCK_LIST_TYPE, YoLuckService} = require('../models/yoluck-service');
function _handelErrorMessage(e) {
if (e && e.statusCode === 503) {
e.title = '人数过多。。。';
e.message = '目前参与人数过多请点击刷新';
}
return e;
}
function index(req, res, next) {
let type = +req.query.type || YOLUCK_LIST_TYPE.running;
let uid = req.user.uid;
... ... @@ -17,7 +26,7 @@ function index(req, res, next) {
`/signin.html?refer=//m.yohobuy.com/activity/yoluck/index.html?type=${YOLUCK_LIST_TYPE.joined}`
);
} else {
return next(result.error);
return Promise.reject(result.error);
}
}
... ... @@ -30,8 +39,7 @@ function index(req, res, next) {
width750: true,
wechatShare: true
});
}).catch(next);
}).catch(e => next(_handelErrorMessage(e)));
}
function nextPage(req, res, next) {
... ... @@ -82,7 +90,7 @@ function detail(req, res, next) {
wechatShare: true
});
}).catch(next);
}).catch(e => next(_handelErrorMessage(e)));
}
... ...
... ... @@ -16,12 +16,12 @@
{{! 侧悬浮}}
{{#isEqualOr param.linkTarget '1' '3'}}
<a href="{{param.sidebarPageId}}" class="sidebar-link" target="_blank">
<img src="{{param.icon}}">
<img src="{{imageslim param.icon}}">
</a>
{{/isEqualOr}}
{{#isEqualOr param.linkTarget '2'}}
<div id="sidebar" pageid="{{param.sidebarPageId}}">
<img src="{{param.icon}}">
<img src="{{imageslim param.icon}}">
</div>
{{/isEqualOr}}
{{/isEqualOr}}
... ...
... ... @@ -25,6 +25,33 @@ const forceNoCache = (res) => {
}
};
const _err503 = (req, res, code, err) => {
res.status(code);
if (req.xhr) {
return res.json({
code: err.code,
message: err.message || '服务器繁忙请稍后重试!'
});
}
return res.render('error/510', {
err: err,
module: 'common',
page: 'error',
title: err.title || '服务器繁忙 | Yoho!Buy有货 | 潮流购物逛不停',
pageHeader: headerModel.setNav({
navTitle: err.title || err.message || '服务器繁忙请稍后重试!'
}),
showRefresh: {
message: err.message,
btnName: '刷新重试'
},
pageFooter: true,
isErr: true
});
};
const _err510 = (req, res, code, err) => {
res.status(code);
... ... @@ -196,6 +223,8 @@ exports.serverError = () => {
} else if (err.code === 9999991 || err.code === 9999992) {
return _err510(req, res, 510, err);
} else if (+err.statusCode === 503) {
return _err503(req, res, 510, err);
}
if (!res.headersSent) {
... ...
<div class="err-page yoho-page">
<div class="err-bg"></div>
<div class="err-bg {{#if showRefresh}}err-refresh{{/if}}">
{{#showRefresh}}
<div class="refresh-wrap">
<p class="refresh-msg">{{message}}</p>
<a class="refresh-btn" href="javascript:void(0)" onclick="location.reload()" >{{btnName}}</a>
</div>
{{/showRefresh}}
</div>
</div>
... ...
... ... @@ -88,7 +88,7 @@
"xml2js": "^0.4.19",
"yoho-express-session": "^2.0.0",
"yoho-md5": "^2.0.0",
"yoho-node-lib": "=0.6.41",
"yoho-node-lib": "=0.6.43",
"yoho-zookeeper": "^1.0.10"
},
"devDependencies": {
... ...
... ... @@ -186,6 +186,7 @@ if (+fellowInfo.type === 2) {
clipboardFellow.on('success', function(e) {
fellow(fellowInfo.tip);
tip.show('内容已复制', 2000);
e.clearSelection();
});
}
... ... @@ -200,6 +201,7 @@ if (+fellowInfo.type === 2) {
clipboardLottery.on('success', function(e) {
fellow(lotteryInfo.h5Tip);
tip.show('内容已复制', 2000);
e.clearSelection();
});
... ...
... ... @@ -11,6 +11,7 @@ let yoSdk = require('yoho-activity-sdk');
let yoho = require('js/yoho-app');
const DETAIL_URI = location.protocol + '//m.yohobuy.com/activity/yoluck';
let tip = require('js/plugin/tip');
let Clipboard = require('clipboard');
let publicCopyInfo = '';
... ... @@ -257,11 +258,17 @@ bus$.add(onTabClick);
bus$.add(onReachBottom);
function initClipboard() {
new Clipboard('.js-clipbroad', {
let _clipboard = new Clipboard('.js-clipbroad', {
text: function() {
return publicCopyInfo;
}
});
_clipboard.on('success', function() {
if (publicCopyInfo) {
tip.show('内容已复制', 2000);
}
});
}
initClipboard();
... ...
... ... @@ -88,9 +88,10 @@
content: "";
width: 100%;
height: 40px;
margin-top: -31px;
margin-top: -40px;
background: url("img/activity/yoluck/lottery-more.png");
background-size: 100%;
background-repeat: no-repeat;
display: block;
position: relative;
z-index: -1;
... ...
... ... @@ -129,3 +129,7 @@
display: none !important;
}
}
.yoho-tip {
top: 350px;
}
... ...
... ... @@ -87,4 +87,9 @@
.modal-view-lottery {
padding-top: 20px;
word-break: break-all;
}
.yoho-tip {
top: 350px;
}
... ...
... ... @@ -10,4 +10,31 @@
background: url("img/common/404.png") no-repeat;
background-size: 100% 100%;
}
.err-refresh {
margin-top: -250px;
}
.refresh-wrap {
width: 460px;
position: absolute;
left: 50%;
top: 100%;
margin-left: -230px;
text-align: center;
.refresh-msg {
line-height: 1.4;
padding: 20px 0;
}
.refresh-btn {
width: 200px;
line-height: 60px;
background-color: #414141;
display: block;
color: #fff;
margin: 10px auto;
}
}
}
... ...
... ... @@ -100,7 +100,7 @@ button {
color: #fff;
font-size: 24px;
border: none;
z-index: 100;
z-index: 1000;
box-sizing: border-box;
border-radius: 10PX;
}
... ...
This diff could not be displayed because it is too large.