Authored by 陈峰

版本号

... ... @@ -11,12 +11,18 @@ exports.index = (req, res, next) => {
if (Number(appversion.substr(0, 1) < 5) || (Number(appversion.substr(0, 1)) === 5 && Number(appversion.substr(2, 1)) < 2)) {
esc = true;
}
let uname;
try {
uname = esc ? decodeURIComponent(params.uname) : decodeURIComponent(params.uname.replace(/\%/g, escape('%')));
} catch (e) {
uname = params.uname;
}
model.getQr({
token: params.token,
}).then(result => {
params.token = result;
params.uname = esc ? decodeURIComponent(params.uname) : decodeURIComponent(params.uname.replace(/\%/g, escape('%')));
params.uname = uname;
params.icon = params.icon || 'https://img11.static.yhbimg.com/yhb-img01/2016/07/05/13/017ec560b82c132ab2fdb22f7cf6f42b83.png?imageView/2/w/{width}/h/{height}';
res.render('myqrcode', {
title: '查看二维码',
... ...
... ... @@ -121,7 +121,8 @@ const local = {
emailRetriveUrl: '/passport/back/email', // 通过邮箱找回密码的URL链接
module: 'passport',
page: 'login',
title: '登录'
title: '登录',
reg: true
});
},
international: (req, res) => {
... ...
... ... @@ -11,8 +11,9 @@
<div id="js-img-check" {{#captchaShow }}data-init{{/captchaShow}}></div>
<span id="btn-login" class="btn btn-login disable">登录</span>
<p class="op-container">
<a class="sms-login" href={{smsLoginUrl}}>手机号码快捷登录</a>
<span id="forget-pwd" class="forget-pwd">忘记密码</span>
<a class="op-item internat" href={{internationalUrl}}>海外手机</a>
<a class="op-item sms-login" href={{smsLoginUrl}}>快速登录</a>
<span id="forget-pwd" class="op-item forget-pwd">忘记密码</span>
</p>
<div class="third-party-login">
<div class="tp-link">
... ... @@ -22,15 +23,12 @@
<a class="alipay" href={{aliLoginUrl}}></a>
</div>
</div>
<a class="international" href={{internationalUrl}}>International Customer</a>
<div class="go-register">
<i class="iconfont">&#xe610;</i>
<a href={{registerUrl}}>注册Yoho!Family</a>
</div>
<div class="login-tip">
<div class="info-icon"></div>
Yoho!Family账号可登录Yoho!Buy有货
</div>
<div id="retrive-pwd-mask" class="mask"></div>
<ul id="retrive-pwd-ways" class="retrive-pwd-ways">
<li>
... ...
... ... @@ -6,4 +6,7 @@
{{#headerText}}
<p class="title">{{.}}</p>
{{/headerText}}
{{#reg}}
<a href="{{registerUrl}}" class="opts register">注册</a>
{{/reg}}
</div>
\ No newline at end of file
... ...
... ... @@ -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.2.5/yas.js', '_yas'));
}(window, document, 'script', (document.location.protocol === 'https:' ? 'https:' : 'http:') + '//cdn.yoho.cn/yas-jssdk/2.3.0/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.2.5', 'yohobuy_m', uid, '', '');
window._yas(1 * new Date(), '2.3.0', 'yohobuy_m', uid, '', '');
}
setTimeout(function() {
... ...
{
"name": "m-yohobuy-node",
"version": "90.4.11",
"version": "93.4.11",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -280,7 +280,7 @@ function ajaxResource() {
$.ajax({
method: 'get',
url: location.protocol + '//m.yohobuy.com/product/opt/favoriteBrand',
url: '/product/opt/favoriteBrand',
data: {
id: self.parent().attr('shopId'),
opt: opt,
... ... @@ -323,7 +323,7 @@ function ajaxResource() {
// vip专属等级查询
$.ajax({
method: 'POST',
url: location.protocol + '//m.yohobuy.com/channel/userVip',
url: '/channel/userVip',
data: {
channel: 1,
},
... ...
... ... @@ -3,17 +3,57 @@
*/
const qs = require('yoho-qs');
const u = navigator.userAgent;
const isFromYOHO = /m\.yohobuy\.com/i.test(document.referrer);
const isApp = /yohobuy/i.test(u) || !!window.yohoInterface || /app_version=/i.test(location.search) || /openrefer=/i.test(location.search);
const isiOS = /(iPhone|iPad|iPod|iOS)/i.test(u); // ios终端
const isAndroid = /Android/i.test(u); // android终端
const iOSVersion = parseInt((u.match(/OS (\d+)_(\d+)_?(\d+)?/i) || [])[1], 10); // iOS 版本
const nodownload = document.getElementById('no-download'); // 页面不需要下载
const urlBlacklist = ['m.yohobuy.com/brands', 'm.yohobuy.com/passport'];
const blackCheck = urlBlacklist.some(function (url) {
return new RegExp(url, 'i').test(location.href);
});
const canOpenApp = () => {
if (isApp || isFromYOHO || nodownload || qs.nodownload || qs.no_openapp || blackCheck) {
return false;
}
return isAndroid || iOSVersion < 9 || qs.openapp;
};
const getAppPath = () => {
return document.getElementById('main-wrap').dataset.apppath || 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.home","params":{"gender":"1","channel":"2"}}';
let appPath = document.getElementById('main-wrap').dataset.apppath || 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.home","params":{"gender":"1","channel":"2"}}';
let ct = qs.mkt_code || qs.union_type;
if (ct) {
appPath = appPath.replace('goapp?', 'goapp?ct=' + ct + '&');
}
return appPath;
};
if (qs.openapp) {
const u = navigator.userAgent.toLowerCase();
const isiOS = u.indexOf('os') > -1 || u.indexOf('iphone') > -1 || u.indexOf('mac') > -1 || u.indexOf('ipad') > -1;
if (canOpenApp()) {
let appPath = getAppPath();
let ifr;
if (window._yas && window._yas.sendCustomInfo) {
window._yas.sendCustomInfo({
op: 'YB_H5_AWAKE_APP',
param: JSON.stringify({
PAGE_NAME: encodeURIComponent(document.title),
PAGE_URL: encodeURIComponent(location.href)
})
}, true);
}
if (window._hmt && window._hmt.push) {
window._hmt.push(['_trackEvent', 'H5唤起APP', isiOS ? 'Apple' : 'Android', document.title, location.href]);
}
if (isiOS) {
window.location.href = appPath;
} else {
... ... @@ -22,14 +62,4 @@ if (qs.openapp) {
ifr.style.display = 'none';
document.body.appendChild(ifr);
}
// let time = Date.now();
// window.setTimeout(function() {
// document.body.removeChild(ifr);
// if (Date.now() - time < 2200) {
// window.location.href = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho';
// }
// }, 2000);
}
... ...
... ... @@ -67,6 +67,22 @@ body.passport-body {
background-size: 100% 100%;
margin: 0 auto;
}
.opts {
display: block;
background: transparent;
border: solid 1PX #fff;
width: auto;
height: 30PX;
line-height: 30PX;
border-radius: 30PX;
color: #fff;
padding-left: 15PX;
padding-right: 15PX;
position: absolute;
right: 0;
top: 5PX;
}
}
.input-container,
... ...
... ... @@ -17,19 +17,21 @@
position: relative;
width: 100%;
margin: 20PX 0;
text-align: left;
text-align: center;
font-size: 16PX;
display: flex;
.sms-login {
text-decoration: underline;
color: #858585;
.op-item {
flex: 1;
color: #fff;
}
.internat {
text-align: left;
}
.forget-pwd {
position: absolute;
right: 0;
text-decoration: underline;
color: #858585;
text-align: right;
}
}
... ... @@ -96,7 +98,7 @@
}
.login-tip {
font-size: 16PX;
font-size: 14PX;
position: relative;
color: #d8d8d8;
margin: 15PX 0;
... ...
... ... @@ -11,7 +11,13 @@ const url = require('url');
* @return referer
*/
exports.refererLimit = (referer, blacklist) => { // eslint-disable-line
let result = decodeURIComponent(referer || '/home');
let result;
try {
result = decodeURIComponent(referer || '/home');
} catch (e) {
result = referer || '/home';
}
let urlObj = url.parse(result, false, true);
... ...