Authored by htoooth

add pic

@@ -5,13 +5,13 @@ @@ -5,13 +5,13 @@
5 <div class="content"> 5 <div class="content">
6 <ul class="login-ul"> 6 <ul class="login-ul">
7 <div class="switch-login-type" data-type="DesktopLogin"> 7 <div class="switch-login-type" data-type="DesktopLogin">
8 - <div id="device-bg" class="type-desktop-bg"></div> 8 + <div id="device-bg" class="type-mobile-bg"></div>
9 <div class="type-tip tip-title"> 9 <div class="type-tip tip-title">
10 <div id="device-tip" style="margin-left: 15px;margin-top: 8px">扫码登录更安全</div> 10 <div id="device-tip" style="margin-left: 15px;margin-top: 8px">扫码登录更安全</div>
11 </div> 11 </div>
12 </div> 12 </div>
13 13
14 - <div class="desktop-login hide"> 14 + <div class="desktop-login">
15 15
16 <li class="relative clearfix"> 16 <li class="relative clearfix">
17 <h2 class="title">会员登录</h2> 17 <h2 class="title">会员登录</h2>
@@ -114,7 +114,7 @@ @@ -114,7 +114,7 @@
114 114
115 </div> 115 </div>
116 116
117 - <div class="mobile-login"> 117 + <div class="mobile-login hide">
118 118
119 <li class="relative clearfix center qrcode-login-title"> 119 <li class="relative clearfix center qrcode-login-title">
120 <div> 120 <div>
@@ -125,6 +125,7 @@ @@ -125,6 +125,7 @@
125 125
126 <li class="relative clearfix center"> 126 <li class="relative clearfix center">
127 <div class="qrcode"></div> 127 <div class="qrcode"></div>
  128 + <div class="qrcode-overlay"></div>
128 </li> 129 </li>
129 130
130 131
@@ -15,29 +15,41 @@ module.exports = { @@ -15,29 +15,41 @@ module.exports = {
15 port: 6002, 15 port: 6002,
16 siteUrl: 'http://www.yohobuy.com', 16 siteUrl: 'http://www.yohobuy.com',
17 domains: { 17 domains: {
18 - api: 'http://devapi.yoho.cn:58078/',  
19 - service: 'http://devservice.yoho.cn:58077/',  
20 - search: 'http://192.168.102.216:8080/yohosearch/' 18 + favApi: 'http://192.168.102.31:8092/brower',
  19 + api: 'http://api.yoho.yohoops.org/',
  20 + service: 'http://service.yoho.yohoops.org/',
  21 + search: 'http://search.yohoops.org/yohosearch/'
21 }, 22 },
22 subDomains: { 23 subDomains: {
23 - host: 'www.yohobuy.com', 24 + host: '.yohobuy.com',
24 default: '//www.yohobuy.com', 25 default: '//www.yohobuy.com',
25 guang: '//guang.yohobuy.com', 26 guang: '//guang.yohobuy.com',
26 list: '//list.yohobuy.com', 27 list: '//list.yohobuy.com',
27 search: '//search.yohobuy.com', 28 search: '//search.yohobuy.com',
28 huodong: '//huodong.yohobuy.com', 29 huodong: '//huodong.yohobuy.com',
29 activity: '//activity.yohobuy.com', 30 activity: '//activity.yohobuy.com',
30 - index: '//www.yohobuy.com' 31 + index: '//yohobuy.com'
31 }, 32 },
32 useOneapm: false, 33 useOneapm: false,
33 useCache: false, 34 useCache: false,
34 memcache: { 35 memcache: {
35 - master: ['192.168.102.222:11213'],  
36 - slave: ['192.168.102.222:11213'],  
37 - session: ['192.168.102.222:11213'], 36 + master: ['127.0.0.1:11211'],
  37 + slave: ['127.0.0.1:11211'],
  38 + session: ['127.0.0.1:11211'],
38 timeout: 1000, 39 timeout: 1000,
39 retries: 0 40 retries: 0
40 }, 41 },
  42 + interfaceShunt: {
  43 + useInterfaceShunt: false,
  44 + tencentServers: {
  45 + api: ['123.206.1.98', '123.206.2.80'],
  46 + service: ['123.206.1.98', '123.206.2.80']
  47 + },
  48 + awsServers: {
  49 + api: 'app-java-168863769.cn-north-1.elb.amazonaws.com.cn',
  50 + service: 'service-yoho-579825100.cn-north-1.elb.amazonaws.com.cn'
  51 + }
  52 + },
41 loggers: { 53 loggers: {
42 infoFile: { 54 infoFile: {
43 name: 'info', 55 name: 'info',
@@ -49,10 +61,10 @@ module.exports = { @@ -49,10 +61,10 @@ module.exports = {
49 name: 'error', 61 name: 'error',
50 level: 'error', 62 level: 'error',
51 filename: 'logs/error.log', 63 filename: 'logs/error.log',
52 - handleExceptions: true,  
53 - maxFiles: 7 64 + handleExceptions: true
54 }, 65 },
55 udp: { // send by udp 66 udp: { // send by udp
  67 + measurement: 'yohobuy_node_log',
56 level: 'debug', // logger level 68 level: 'debug', // logger level
57 host: 'influxdblog.yohoops.org', // influxdb host 69 host: 'influxdblog.yohoops.org', // influxdb host
58 port: '4444' // influxdb port 70 port: '4444' // influxdb port
@@ -86,15 +98,27 @@ if (isProduction) { @@ -86,15 +98,27 @@ if (isProduction) {
86 timeout: 3000 98 timeout: 3000
87 }, 99 },
88 useOneapm: true, 100 useOneapm: true,
89 - useCache: true 101 + useCache: true,
  102 + interfaceShunt: {
  103 + useInterfaceShunt: false,
  104 + tencentServers: {
  105 + api: ['123.206.1.98', '123.206.2.80'],
  106 + service: ['123.206.1.98', '123.206.2.80']
  107 + },
  108 + awsServers: {
  109 + api: 'app-java-168863769.cn-north-1.elb.amazonaws.com.cn',
  110 + service: 'service-yoho-579825100.cn-north-1.elb.amazonaws.com.cn'
  111 + }
  112 + }
90 }); 113 });
91 } else if (isTest) { 114 } else if (isTest) {
92 Object.assign(module.exports, { 115 Object.assign(module.exports, {
93 appName: 'www.yohobuy.com for test', 116 appName: 'www.yohobuy.com for test',
94 domains: { 117 domains: {
95 - api: 'http://testapi.yoho.cn:28078/',  
96 - service: 'http://testservice.yoho.cn:28077/',  
97 - search: 'http://192.168.102.216:8080/yohosearch/' 118 + favApi: 'http://192.168.102.31:8092/brower',
  119 + api: process.env.TEST_API || 'http://testapi.yoho.cn:28078/',
  120 + service: process.env.TEST_SERVICE || 'http://testservice.yoho.cn:28077/',
  121 + search: process.env.TEST_SEARCH || 'http://192.168.102.216:8080/yohosearch/'
98 }, 122 },
99 useOneapm: true, 123 useOneapm: true,
100 useCache: true, 124 useCache: true,
@@ -85,7 +85,8 @@ var $accountInput = $('#account'), @@ -85,7 +85,8 @@ var $accountInput = $('#account'),
85 $qrcodeInput = $('#qrcode'), 85 $qrcodeInput = $('#qrcode'),
86 getQrCodeVal = function() { 86 getQrCodeVal = function() {
87 return $qrcodeInput.val(); 87 return $qrcodeInput.val();
88 - }; 88 + },
  89 + $qrCodeContainer = $('.qrcode');
89 90
90 // 提示 91 // 提示
91 var $accountTip = $accountInput.siblings('.err-tip'), 92 var $accountTip = $accountInput.siblings('.err-tip'),
@@ -189,24 +190,30 @@ var AccountLoginType = { @@ -189,24 +190,30 @@ var AccountLoginType = {
189 /* 设备登录类型 */ 190 /* 设备登录类型 */
190 /** ************************************************************************/ 191 /** ************************************************************************/
191 var deviceChangeLoginTypeEvent = $.Callbacks(); //eslint-disable-line 192 var deviceChangeLoginTypeEvent = $.Callbacks(); //eslint-disable-line
192 -var $switchDeviceType = $('.switch-login-type'); 193 +var $switchDeviceType = $('#device-bg');
193 var DeviceLoginType = { 194 var DeviceLoginType = {
194 DesktopLogin: { 195 DesktopLogin: {
195 ele: '.desktop-login', 196 ele: '.desktop-login',
196 hide: '.mobile-login', 197 hide: '.mobile-login',
197 dataType: 'MobileLogin', 198 dataType: 'MobileLogin',
198 tipText: '扫码登录更安全', 199 tipText: '扫码登录更安全',
199 - bgClass: 'type-mobile-bg' 200 + bgClass: 'type-mobile-bg',
  201 + removeClass: 'type-desktop-bg'
200 }, 202 },
201 MobileLogin: { 203 MobileLogin: {
202 ele: '.mobile-login', 204 ele: '.mobile-login',
203 hide: '.desktop-login', 205 hide: '.desktop-login',
204 dataType: 'DesktopLogin', 206 dataType: 'DesktopLogin',
205 tipText: '密码登录在这里', 207 tipText: '密码登录在这里',
206 - bgClass: 'type-desktop-bg' 208 + bgClass: 'type-desktop-bg',
  209 + removeClass: 'type-mobile-bg'
207 } 210 }
208 }; 211 };
209 212
  213 +var $deviceTips = $('.type-tip');
  214 +
  215 +var desktopShowOnce = $.Callbacks('once'); //eslint-disable-line
  216 +var mobileShowOnce = $.Callbacks('once'); //eslint-disable-line
210 217
211 // 切换登录方式 218 // 切换登录方式
212 accountChangeLoginTypeEvent.add(function(type) { 219 accountChangeLoginTypeEvent.add(function(type) {
@@ -236,6 +243,14 @@ accountChangeLoginTypeEvent.add(function(type) { @@ -236,6 +243,14 @@ accountChangeLoginTypeEvent.add(function(type) {
236 } 243 }
237 }); 244 });
238 245
  246 +desktopShowOnce.add(function() {
  247 + $deviceTips.removeClass('hide');
  248 +});
  249 +
  250 +mobileShowOnce.add(function() {
  251 + $deviceTips.removeClass('hide');
  252 +});
  253 +
239 /** ************************************************************************/ 254 /** ************************************************************************/
240 /* 加载自定义库 */ 255 /* 加载自定义库 */
241 /** ************************************************************************/ 256 /** ************************************************************************/
@@ -856,15 +871,29 @@ $switchLoginType.on('click', 'div', function() { @@ -856,15 +871,29 @@ $switchLoginType.on('click', 'div', function() {
856 // 切换登录模式:帐号登录和二维码登录 871 // 切换登录模式:帐号登录和二维码登录
857 $switchDeviceType.on('click', function() { 872 $switchDeviceType.on('click', function() {
858 var $this = $(this), 873 var $this = $(this),
859 - type = $this.data('type'); 874 + $parent = $this.parent(),
  875 + type = $parent.data('type');
  876 +
  877 + $deviceTips.addClass('hide');
860 878
861 $(DeviceLoginType[type].ele).removeClass('hide'); 879 $(DeviceLoginType[type].ele).removeClass('hide');
862 $(DeviceLoginType[type].hide).addClass('hide'); 880 $(DeviceLoginType[type].hide).addClass('hide');
863 - $this.data('type', DeviceLoginType[type].dataType); 881 + $parent.data('type', DeviceLoginType[type].dataType);
  882 + $this.removeClass(DeviceLoginType[type].removeClass)
  883 + .addClass(DeviceLoginType[type].bgClass);
  884 + $parent.find('#device-tip').html(DeviceLoginType[type].tipText);
  885 +
  886 + if (type === 'DesktopLogin') {
  887 + desktopShowOnce.fire();
  888 + } else {
  889 + mobileShowOnce.fire();
  890 + }
  891 +});
864 892
865 - console.log(type);  
866 - console.log(DeviceLoginType[type].ele);  
867 - console.log(DeviceLoginType[type].hide); 893 +$qrCodeContainer.on('mouseenter', function() {
  894 + console.log('enter');
  895 +}).on('mouseleave', function() {
  896 + console.log('leave');
868 }); 897 });
869 898
870 /** ************************************************************************/ 899 /** ************************************************************************/
@@ -903,3 +932,5 @@ $('.qrcode').qrcode({ @@ -903,3 +932,5 @@ $('.qrcode').qrcode({
903 size: 150, 932 size: 150,
904 text: getQrCodeVal() 933 text: getQrCodeVal()
905 }); 934 });
  935 +
  936 +$switchDeviceType.triggerHandler('click');
@@ -231,6 +231,7 @@ @@ -231,6 +231,7 @@
231 height: 40px; 231 height: 40px;
232 background: url(/passport/desktop-login.png) no-repeat; 232 background: url(/passport/desktop-login.png) no-repeat;
233 float: right; 233 float: right;
  234 + cursor: pointer;
234 } 235 }
235 236
236 .type-mobile-bg { 237 .type-mobile-bg {
@@ -238,6 +239,7 @@ @@ -238,6 +239,7 @@
238 height: 40px; 239 height: 40px;
239 background: url(/passport/mobile-login.png) no-repeat; 240 background: url(/passport/mobile-login.png) no-repeat;
240 float: right; 241 float: right;
  242 + cursor: pointer;
241 } 243 }
242 244
243 } 245 }
@@ -268,6 +270,14 @@ @@ -268,6 +270,14 @@
268 margin: 0 auto; 270 margin: 0 auto;
269 } 271 }
270 272
  273 + .qrcode-overlay {
  274 + position: absolute;
  275 + width: 100px;
  276 + height: 30px;
  277 + background-color: red;
  278 + top: 0;
  279 + }
  280 +
271 .qrcode-login-title { 281 .qrcode-login-title {
272 margin-bottom: 50px !important; 282 margin-bottom: 50px !important;
273 } 283 }
@@ -276,4 +286,6 @@ @@ -276,4 +286,6 @@
276 color: #9B9B9B; 286 color: #9B9B9B;
277 font-size: 13px; 287 font-size: 13px;
278 } 288 }
  289 +
  290 +
279 } 291 }