Authored by ccbikai(👎🏻🍜)

Merge branch 'release/5.2' into gray

@@ -276,6 +276,7 @@ exports.check = (req, res, next) => { @@ -276,6 +276,7 @@ exports.check = (req, res, next) => {
276 code: 200, 276 code: 200,
277 redirect, 277 redirect,
278 newer: true, 278 newer: true,
  279 + registerCode: r1.data.code
279 }); 280 });
280 281
281 return; 282 return;
@@ -329,7 +330,7 @@ exports.password = (req, res, next) => { @@ -329,7 +330,7 @@ exports.password = (req, res, next) => {
329 let mobile = _.get(req.session, 'smsLogin.mobile'); 330 let mobile = _.get(req.session, 'smsLogin.mobile');
330 let area = _.get(req.session, 'smsLogin.area'); 331 let area = _.get(req.session, 'smsLogin.area');
331 let password = (req.body.password || '').trim(); 332 let password = (req.body.password || '').trim();
332 - let smsCode = +req.body.smsCode || 0; 333 + let registerCode = +req.body.registerCode || 0;
333 334
334 if (!password) { 335 if (!password) {
335 data.message = PASSWORD_REQUIRED; 336 data.message = PASSWORD_REQUIRED;
@@ -349,7 +350,7 @@ exports.password = (req, res, next) => { @@ -349,7 +350,7 @@ exports.password = (req, res, next) => {
349 let shoppingKey = cookie.getShoppingKey(req); 350 let shoppingKey = cookie.getShoppingKey(req);
350 351
351 352
352 - RegService.regMobileAes(area, mobile, password, shoppingKey, smsCode).then(result => { 353 + RegService.regMobileAes(area, mobile, password, shoppingKey, registerCode).then(result => {
353 if (!result.code || result.code !== 200) { 354 if (!result.code || result.code !== 200) {
354 return Promise.reject(result); 355 return Promise.reject(result);
355 } 356 }
1 {{#data}} 1 {{#data}}
2 - <div style="background-image:url({{src}})" class="divide-image"></div> 2 + <div style="background-image:url({{image src 640 26}})" class="divide-image"></div>
3 {{/data}} 3 {{/data}}
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <div class="hot-single"> 2 <div class="hot-single">
3 {{> common/floor-header-more}} 3 {{> common/floor-header-more}}
4 {{> resources/new-floor-banner}} 4 {{> resources/new-floor-banner}}
5 - <div class="hot-single-goods-list" {{#background}}style="background-image: url({{src}})"{{/background}}> 5 + <div class="hot-single-goods-list" {{#background}}style="background-image: url({{image src 640 330}})"{{/background}}>
6 <ul> 6 <ul>
7 {{#list}} 7 {{#list}}
8 <li class="hot-single-goods"> 8 <li class="hot-single-goods">
1 {{#appIconList}} 1 {{#appIconList}}
2 -<div class="icons-wrapper" style="background-image:url({{back_image}})"> 2 +<div class="icons-wrapper" style="background-image:url({{image back_image 640 360}})">
3 <ul class="icons-list clearfix"> 3 <ul class="icons-list clearfix">
4 {{#data}} 4 {{#data}}
5 <li class="icons-item item-{{../number}}"><a href="{{url}}" class="imagebar"><img src="{{image src 98 98}}" alt=""></a><a href="{{url}}" class="linkbar">{{title}}</a></li> 5 <li class="icons-item item-{{../number}}"><a href="{{url}}" class="imagebar"><img src="{{image src 98 98}}" alt=""></a><a href="{{url}}" class="linkbar">{{title}}</a></li>
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 {{> common/floor-header-more}} 3 {{> common/floor-header-more}}
4 <div class="new-user-icon">新人专享</div> 4 <div class="new-user-icon">新人专享</div>
5 {{> resources/new-floor-banner}} 5 {{> resources/new-floor-banner}}
6 - <div class="new-user-goods-container" {{#background}} style="background-image: url({{src}})" {{/background}}> 6 + <div class="new-user-goods-container" {{#background}} style="background-image: url({{image src 640 213}})" {{/background}}>
7 <ul> 7 <ul>
8 {{#list}} 8 {{#list}}
9 <li class="new-user-good"> 9 <li class="new-user-good">
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 4
5 {{> resources/new-floor-banner}} 5 {{> resources/new-floor-banner}}
6 6
7 - <div class="vip-only-goods-list" {{#background}} style="background-image: url({{src}})" {{/background}}> 7 + <div class="vip-only-goods-list" {{#background}} style="background-image: url({{image src 640 330}})" {{/background}}>
8 <ul> 8 <ul>
9 {{#list}} 9 {{#list}}
10 <a href="//m.yohobuy.com/product/show_{{product_skn}}"> 10 <a href="//m.yohobuy.com/product/show_{{product_skn}}">
@@ -35,7 +35,8 @@ $pwd.bind('input', function() { @@ -35,7 +35,8 @@ $pwd.bind('input', function() {
35 }); 35 });
36 36
37 $btnSure.toggleClass('disable', !bool); 37 $btnSure.toggleClass('disable', !bool);
38 -}); 38 +})
  39 +
39 40
40 qs = window.queryString; 41 qs = window.queryString;
41 42
@@ -131,3 +132,9 @@ $btnSure.on('touchstart', function() { @@ -131,3 +132,9 @@ $btnSure.on('touchstart', function() {
131 $('.agreement-detail').on('click', function() { 132 $('.agreement-detail').on('click', function() {
132 $(this).attr('href', '//m.yohobuy.com/passport/agreement' + window.location.search); 133 $(this).attr('href', '//m.yohobuy.com/passport/agreement' + window.location.search);
133 }); 134 });
  135 +
  136 +
  137 +// 如果有值, 立刻校验
  138 +if ($pwd.val()) {
  139 + $pwd.triggerHandler('input');
  140 +}
@@ -146,7 +146,7 @@ page = { @@ -146,7 +146,7 @@ page = {
146 checkPoint('YB_MOBILE_LOGIN_C'); // 埋点 146 checkPoint('YB_MOBILE_LOGIN_C'); // 埋点
147 147
148 if (res.newer) { 148 if (res.newer) {
149 - res.redirect = res.redirect + '&smsCode=' + code; 149 + res.redirect = res.redirect + '&registerCode=' + res.registerCode;
150 } 150 }
151 151
152 location.href = res.redirect; 152 location.href = res.redirect;
@@ -154,6 +154,6 @@ require('./detail/page-render')(function() { @@ -154,6 +154,6 @@ require('./detail/page-render')(function() {
154 154
155 $(function() { 155 $(function() {
156 if ($('#product-coupon-switch').val() === 'true') { 156 if ($('#product-coupon-switch').val() === 'true') {
157 - require(['./detail/brand-coupon']); // amd 157 + require('./detail/brand-coupon'); // amd
158 } 158 }
159 }); 159 });
1 -/* global define */  
2 -// amd  
3 -define(function(require) {  
4 - 'use strict'; 1 +'use strict';
5 2
6 - /** 3 +/**
7 * 商品详情: 品牌券 4 * 商品详情: 品牌券
8 */ 5 */
9 - var tip = require('plugin/tip');  
10 - var $ = require('yoho-jquery');  
11 - var $body = $(document.body); 6 +var tip = require('plugin/tip');
  7 +var $ = require('yoho-jquery');
  8 +var $body = $(document.body);
12 9
13 - var brandCoupon = { 10 +var brandCoupon = {
14 skn: null, 11 skn: null,
15 brandId: null, 12 brandId: null,
16 $entry: null, 13 $entry: null,
@@ -116,10 +113,9 @@ define(function(require) { @@ -116,10 +113,9 @@ define(function(require) {
116 this.$couponDrawer.toggleClass('open', bool); 113 this.$couponDrawer.toggleClass('open', bool);
117 $body.toggleClass('coupon-drawer-open', bool); 114 $body.toggleClass('coupon-drawer-open', bool);
118 } 115 }
119 - }; 116 +};
120 117
121 - brandCoupon.init( 118 +brandCoupon.init(
122 $('#productSkn').val(), 119 $('#productSkn').val(),
123 $('#brand-id').val() 120 $('#brand-id').val()
124 - );  
125 -}); 121 +);
1 .divide-image { 1 .divide-image {
2 - height: 30px; 2 + height: 26px;
3 width: 100%; 3 width: 100%;
4 background-size: 100% 100%; 4 background-size: 100% 100%;
5 } 5 }
@@ -75,13 +75,6 @@ module.exports = (list) => { @@ -75,13 +75,6 @@ module.exports = (list) => {
75 floor.data.length === 1 && 75 floor.data.length === 1 &&
76 (floor.singleOne = true); 76 (floor.singleOne = true);
77 77
78 - // vip专享 人气单品背景处理  
79 - if ((floor.vipUse || floor.popularSingleProduct || floor.newUserFloor) && floor.data && floor.data.background) {  
80 - let a = floor.data.background.src;  
81 - a = a.substr(0, a.indexOf('?'));  
82 - floor.data.background.src = a;  
83 - }  
84 -  
85 // 处理价格两位小数 78 // 处理价格两位小数
86 if ((floor.vipUse || floor.popularSingleProduct || floor.newUserFloor) && floor.data) { 79 if ((floor.vipUse || floor.popularSingleProduct || floor.newUserFloor) && floor.data) {
87 for (let item of floor.data.list) { 80 for (let item of floor.data.list) {
@@ -93,24 +86,11 @@ module.exports = (list) => { @@ -93,24 +86,11 @@ module.exports = (list) => {
93 } 86 }
94 } 87 }
95 88
96 - // 图标楼层背景图  
97 - if (floor.appIconList && floor.back_image) {  
98 - let a = floor.back_image;  
99 - a = a.substr(0, a.indexOf('?'));  
100 - floor.back_image = a;  
101 - }  
102 -  
103 // sale banner名字 89 // sale banner名字
104 if (floor.sale1T1L4R && floor.data && floor.data.big_image) { 90 if (floor.sale1T1L4R && floor.data && floor.data.big_image) {
105 floor.data.banner_image = floor.data.big_image; 91 floor.data.banner_image = floor.data.big_image;
106 } 92 }
107 93
108 - // 分隔图楼层  
109 - if (floor.divideImage && floor.divideImage.data && floor.divideImage.data.src) {  
110 - let a = floor.divideImage.data.src;  
111 - a = a.substr(0, a.indexOf('?'));  
112 - floor.divideImage.data.src = a;  
113 - }  
114 formatData.push(floor); 94 formatData.push(floor);
115 }); 95 });
116 96