Authored by htoooth

add pic

... ... @@ -5,13 +5,13 @@
<div class="content">
<ul class="login-ul">
<div class="switch-login-type" data-type="DesktopLogin">
<div id="device-bg" class="type-desktop-bg"></div>
<div id="device-bg" class="type-mobile-bg"></div>
<div class="type-tip tip-title">
<div id="device-tip" style="margin-left: 15px;margin-top: 8px">扫码登录更安全</div>
</div>
</div>
<div class="desktop-login hide">
<div class="desktop-login">
<li class="relative clearfix">
<h2 class="title">会员登录</h2>
... ... @@ -114,7 +114,7 @@
</div>
<div class="mobile-login">
<div class="mobile-login hide">
<li class="relative clearfix center qrcode-login-title">
<div>
... ... @@ -125,6 +125,7 @@
<li class="relative clearfix center">
<div class="qrcode"></div>
<div class="qrcode-overlay"></div>
</li>
... ...
... ... @@ -15,29 +15,41 @@ module.exports = {
port: 6002,
siteUrl: 'http://www.yohobuy.com',
domains: {
api: 'http://devapi.yoho.cn:58078/',
service: 'http://devservice.yoho.cn:58077/',
search: 'http://192.168.102.216:8080/yohosearch/'
favApi: 'http://192.168.102.31:8092/brower',
api: 'http://api.yoho.yohoops.org/',
service: 'http://service.yoho.yohoops.org/',
search: 'http://search.yohoops.org/yohosearch/'
},
subDomains: {
host: 'www.yohobuy.com',
host: '.yohobuy.com',
default: '//www.yohobuy.com',
guang: '//guang.yohobuy.com',
list: '//list.yohobuy.com',
search: '//search.yohobuy.com',
huodong: '//huodong.yohobuy.com',
activity: '//activity.yohobuy.com',
index: '//www.yohobuy.com'
index: '//yohobuy.com'
},
useOneapm: false,
useCache: false,
memcache: {
master: ['192.168.102.222:11213'],
slave: ['192.168.102.222:11213'],
session: ['192.168.102.222:11213'],
master: ['127.0.0.1:11211'],
slave: ['127.0.0.1:11211'],
session: ['127.0.0.1:11211'],
timeout: 1000,
retries: 0
},
interfaceShunt: {
useInterfaceShunt: false,
tencentServers: {
api: ['123.206.1.98', '123.206.2.80'],
service: ['123.206.1.98', '123.206.2.80']
},
awsServers: {
api: 'app-java-168863769.cn-north-1.elb.amazonaws.com.cn',
service: 'service-yoho-579825100.cn-north-1.elb.amazonaws.com.cn'
}
},
loggers: {
infoFile: {
name: 'info',
... ... @@ -49,10 +61,10 @@ module.exports = {
name: 'error',
level: 'error',
filename: 'logs/error.log',
handleExceptions: true,
maxFiles: 7
handleExceptions: true
},
udp: { // send by udp
measurement: 'yohobuy_node_log',
level: 'debug', // logger level
host: 'influxdblog.yohoops.org', // influxdb host
port: '4444' // influxdb port
... ... @@ -86,15 +98,27 @@ if (isProduction) {
timeout: 3000
},
useOneapm: true,
useCache: true
useCache: true,
interfaceShunt: {
useInterfaceShunt: false,
tencentServers: {
api: ['123.206.1.98', '123.206.2.80'],
service: ['123.206.1.98', '123.206.2.80']
},
awsServers: {
api: 'app-java-168863769.cn-north-1.elb.amazonaws.com.cn',
service: 'service-yoho-579825100.cn-north-1.elb.amazonaws.com.cn'
}
}
});
} else if (isTest) {
Object.assign(module.exports, {
appName: 'www.yohobuy.com for test',
domains: {
api: 'http://testapi.yoho.cn:28078/',
service: 'http://testservice.yoho.cn:28077/',
search: 'http://192.168.102.216:8080/yohosearch/'
favApi: 'http://192.168.102.31:8092/brower',
api: process.env.TEST_API || 'http://testapi.yoho.cn:28078/',
service: process.env.TEST_SERVICE || 'http://testservice.yoho.cn:28077/',
search: process.env.TEST_SEARCH || 'http://192.168.102.216:8080/yohosearch/'
},
useOneapm: true,
useCache: true,
... ...
... ... @@ -85,7 +85,8 @@ var $accountInput = $('#account'),
$qrcodeInput = $('#qrcode'),
getQrCodeVal = function() {
return $qrcodeInput.val();
};
},
$qrCodeContainer = $('.qrcode');
// 提示
var $accountTip = $accountInput.siblings('.err-tip'),
... ... @@ -189,24 +190,30 @@ var AccountLoginType = {
/* 设备登录类型 */
/** ************************************************************************/
var deviceChangeLoginTypeEvent = $.Callbacks(); //eslint-disable-line
var $switchDeviceType = $('.switch-login-type');
var $switchDeviceType = $('#device-bg');
var DeviceLoginType = {
DesktopLogin: {
ele: '.desktop-login',
hide: '.mobile-login',
dataType: 'MobileLogin',
tipText: '扫码登录更安全',
bgClass: 'type-mobile-bg'
bgClass: 'type-mobile-bg',
removeClass: 'type-desktop-bg'
},
MobileLogin: {
ele: '.mobile-login',
hide: '.desktop-login',
dataType: 'DesktopLogin',
tipText: '密码登录在这里',
bgClass: 'type-desktop-bg'
bgClass: 'type-desktop-bg',
removeClass: 'type-mobile-bg'
}
};
var $deviceTips = $('.type-tip');
var desktopShowOnce = $.Callbacks('once'); //eslint-disable-line
var mobileShowOnce = $.Callbacks('once'); //eslint-disable-line
// 切换登录方式
accountChangeLoginTypeEvent.add(function(type) {
... ... @@ -236,6 +243,14 @@ accountChangeLoginTypeEvent.add(function(type) {
}
});
desktopShowOnce.add(function() {
$deviceTips.removeClass('hide');
});
mobileShowOnce.add(function() {
$deviceTips.removeClass('hide');
});
/** ************************************************************************/
/* 加载自定义库 */
/** ************************************************************************/
... ... @@ -856,15 +871,29 @@ $switchLoginType.on('click', 'div', function() {
// 切换登录模式:帐号登录和二维码登录
$switchDeviceType.on('click', function() {
var $this = $(this),
type = $this.data('type');
$parent = $this.parent(),
type = $parent.data('type');
$deviceTips.addClass('hide');
$(DeviceLoginType[type].ele).removeClass('hide');
$(DeviceLoginType[type].hide).addClass('hide');
$this.data('type', DeviceLoginType[type].dataType);
$parent.data('type', DeviceLoginType[type].dataType);
$this.removeClass(DeviceLoginType[type].removeClass)
.addClass(DeviceLoginType[type].bgClass);
$parent.find('#device-tip').html(DeviceLoginType[type].tipText);
if (type === 'DesktopLogin') {
desktopShowOnce.fire();
} else {
mobileShowOnce.fire();
}
});
console.log(type);
console.log(DeviceLoginType[type].ele);
console.log(DeviceLoginType[type].hide);
$qrCodeContainer.on('mouseenter', function() {
console.log('enter');
}).on('mouseleave', function() {
console.log('leave');
});
/** ************************************************************************/
... ... @@ -903,3 +932,5 @@ $('.qrcode').qrcode({
size: 150,
text: getQrCodeVal()
});
$switchDeviceType.triggerHandler('click');
... ...
... ... @@ -231,6 +231,7 @@
height: 40px;
background: url(/passport/desktop-login.png) no-repeat;
float: right;
cursor: pointer;
}
.type-mobile-bg {
... ... @@ -238,6 +239,7 @@
height: 40px;
background: url(/passport/mobile-login.png) no-repeat;
float: right;
cursor: pointer;
}
}
... ... @@ -268,6 +270,14 @@
margin: 0 auto;
}
.qrcode-overlay {
position: absolute;
width: 100px;
height: 30px;
background-color: red;
top: 0;
}
.qrcode-login-title {
margin-bottom: 50px !important;
}
... ... @@ -276,4 +286,6 @@
color: #9B9B9B;
font-size: 13px;
}
}
... ...