Merge branch 'release/1.0' of git.yoho.cn:fe/yoho-blk into release/1.0
Showing
20 changed files
with
134 additions
and
33 deletions
@@ -43,7 +43,7 @@ | @@ -43,7 +43,7 @@ | ||
43 | 43 | ||
44 | <form id="back-form" class="back-form" action="/passport/back/email" method="post"> | 44 | <form id="back-form" class="back-form" action="/passport/back/email" method="post"> |
45 | <li class="clearfix"> | 45 | <li class="clearfix"> |
46 | - <select id="area" class="country-list" name="region"> | 46 | + <select id="area" class="country-list" name="area"> |
47 | {{#each region}} | 47 | {{#each region}} |
48 | <option {{#if selected}}selected="selected"{{/if}} value="{{areaCode}}">{{name}}</option> | 48 | <option {{#if selected}}selected="selected"{{/if}} value="{{areaCode}}">{{name}}</option> |
49 | {{/each}} | 49 | {{/each}} |
@@ -27,6 +27,7 @@ const list = { | @@ -27,6 +27,7 @@ const list = { | ||
27 | 27 | ||
28 | if (data.filter) { | 28 | if (data.filter) { |
29 | retData.filter = DataHelper.filterHandle(data.filter, q); | 29 | retData.filter = DataHelper.filterHandle(data.filter, q); |
30 | + retData.filter.showPrice = data.total > 10; | ||
30 | nav = _.concat(nav, retData.filter.nav); | 31 | nav = _.concat(nav, retData.filter.nav); |
31 | } | 32 | } |
32 | 33 | ||
@@ -78,6 +79,7 @@ const list = { | @@ -78,6 +79,7 @@ const list = { | ||
78 | 79 | ||
79 | if (data.filter) { | 80 | if (data.filter) { |
80 | retData.filter = DataHelper.filterHandle(data.filter, q); | 81 | retData.filter = DataHelper.filterHandle(data.filter, q); |
82 | + retData.filter.showPrice = data.total > 10; | ||
81 | } | 83 | } |
82 | 84 | ||
83 | retData.navPath = { | 85 | retData.navPath = { |
@@ -24,7 +24,8 @@ const Query = { | @@ -24,7 +24,8 @@ const Query = { | ||
24 | let retData = { | 24 | let retData = { |
25 | module: 'product', | 25 | module: 'product', |
26 | page: 'list', | 26 | page: 'list', |
27 | - title: '列表' | 27 | + title: '列表', |
28 | + query: query | ||
28 | }; | 29 | }; |
29 | 30 | ||
30 | Search.queryProduct(q).then(result => { | 31 | Search.queryProduct(q).then(result => { |
@@ -120,6 +120,7 @@ const shop = { | @@ -120,6 +120,7 @@ const shop = { | ||
120 | if (ret.filter) { | 120 | if (ret.filter) { |
121 | delete q.brand; | 121 | delete q.brand; |
122 | data.filter = DataHelper.filterHandle(ret.filter, req.query); | 122 | data.filter = DataHelper.filterHandle(ret.filter, req.query); |
123 | + data.filter.showPrice = ret.total > 10; | ||
123 | } | 124 | } |
124 | 125 | ||
125 | data.paginationData = { | 126 | data.paginationData = { |
@@ -4,6 +4,8 @@ | @@ -4,6 +4,8 @@ | ||
4 | {{> path-nav}} | 4 | {{> path-nav}} |
5 | {{/ navPath}} | 5 | {{/ navPath}} |
6 | </div> | 6 | </div> |
7 | + | ||
8 | + {{#if paginationData.total}} | ||
7 | <div class="center-content clearfix"> | 9 | <div class="center-content clearfix"> |
8 | <div class="left"> | 10 | <div class="left"> |
9 | {{!-- 筛选区域 --}} | 11 | {{!-- 筛选区域 --}} |
@@ -24,4 +26,8 @@ | @@ -24,4 +26,8 @@ | ||
24 | {{{ pagination paginationData }}} | 26 | {{{ pagination paginationData }}} |
25 | </div> | 27 | </div> |
26 | </div> | 28 | </div> |
29 | + | ||
30 | + {{^}} | ||
31 | + {{> list/empty}} | ||
32 | + {{/if}} | ||
27 | </div> | 33 | </div> |
@@ -5,6 +5,8 @@ | @@ -5,6 +5,8 @@ | ||
5 | {{> path-nav}} | 5 | {{> path-nav}} |
6 | {{/ navPath}} | 6 | {{/ navPath}} |
7 | </div> | 7 | </div> |
8 | + | ||
9 | + {{#if paginationData.total}} | ||
8 | <div class="center-content clearfix"> | 10 | <div class="center-content clearfix"> |
9 | <div class="left"> | 11 | <div class="left"> |
10 | {{!-- 筛选区域 --}} | 12 | {{!-- 筛选区域 --}} |
@@ -15,7 +17,8 @@ | @@ -15,7 +17,8 @@ | ||
15 | <div class="right"> | 17 | <div class="right"> |
16 | {{!-- 新品banner --}} | 18 | {{!-- 新品banner --}} |
17 | {{# banner}} | 19 | {{# banner}} |
18 | - <div class="banner-img" style="height: 200px;margin-bottom:30px; background:url({{image src 850 200 2}}) no-repeat top center;"></div> | 20 | + <div class="banner-img" |
21 | + style="height: 200px;margin-bottom:30px; background:url({{image src 850 200 2}}) no-repeat top center;"></div> | ||
19 | {{/banner}} | 22 | {{/banner}} |
20 | {{!-- 已选中条件 --}} | 23 | {{!-- 已选中条件 --}} |
21 | {{#filter}} | 24 | {{#filter}} |
@@ -29,4 +32,7 @@ | @@ -29,4 +32,7 @@ | ||
29 | {{{ pagination paginationData }}} | 32 | {{{ pagination paginationData }}} |
30 | </div> | 33 | </div> |
31 | </div> | 34 | </div> |
35 | + {{^}} | ||
36 | + {{> list/empty}} | ||
37 | + {{/if}} | ||
32 | </div> | 38 | </div> |
@@ -9,6 +9,8 @@ | @@ -9,6 +9,8 @@ | ||
9 | {{> list/shop-menu }} | 9 | {{> list/shop-menu }} |
10 | {{> list/banner-info }} | 10 | {{> list/banner-info }} |
11 | </div> | 11 | </div> |
12 | + | ||
13 | + {{#if paginationData.total}} | ||
12 | <div class="center-content clearfix"> | 14 | <div class="center-content clearfix"> |
13 | <div class="left"> | 15 | <div class="left"> |
14 | {{!-- 筛选区域 --}} | 16 | {{!-- 筛选区域 --}} |
@@ -29,4 +31,7 @@ | @@ -29,4 +31,7 @@ | ||
29 | {{{ pagination paginationData }}} | 31 | {{{ pagination paginationData }}} |
30 | </div> | 32 | </div> |
31 | </div> | 33 | </div> |
34 | + {{^}} | ||
35 | + {{> list/empty}} | ||
36 | + {{/if}} | ||
32 | </div> | 37 | </div> |
apps/product/views/partial/list/empty.hbs
0 → 100644
1 | +<div class="yoho-list-empty center-content"> | ||
2 | + | ||
3 | + <div class="tip-search"> | ||
4 | + <span class="iconfont"></span> | ||
5 | + </div> | ||
6 | + | ||
7 | + <p class="tip-cn">抱歉! 未找到{{#if query}}与"<span>{{query}}</span>"{{/if}}相关商品</p> | ||
8 | + | ||
9 | + <p class="tip-en">Did not find the relevant goods</p> | ||
10 | + | ||
11 | + <p class="tip-cn-sm">建议您: 看看输入的文字是否有误 / 减少分类条件限制 / 重新搜索</p> | ||
12 | +</div> |
@@ -36,12 +36,12 @@ const index = (req, res, next) => { | @@ -36,12 +36,12 @@ const index = (req, res, next) => { | ||
36 | result.data.printPriceRadio = [ | 36 | result.data.printPriceRadio = [ |
37 | { | 37 | { |
38 | value: '1', | 38 | value: '1', |
39 | - name: '是', | ||
40 | - checked: true | 39 | + name: '是' |
41 | }, | 40 | }, |
42 | { | 41 | { |
43 | value: '0', | 42 | value: '0', |
44 | - name: '否' | 43 | + name: '否', |
44 | + checked: true | ||
45 | } | 45 | } |
46 | ]; | 46 | ]; |
47 | 47 |
No preview for this file type
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > | 2 | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > |
3 | <svg xmlns="http://www.w3.org/2000/svg"> | 3 | <svg xmlns="http://www.w3.org/2000/svg"> |
4 | <metadata> | 4 | <metadata> |
5 | -Created by FontForge 20120731 at Tue Jul 19 15:52:03 2016 | 5 | +Created by FontForge 20120731 at Wed Jul 20 18:17:41 2016 |
6 | By admin | 6 | By admin |
7 | </metadata> | 7 | </metadata> |
8 | <defs> | 8 | <defs> |
@@ -19,7 +19,7 @@ Created by FontForge 20120731 at Tue Jul 19 15:52:03 2016 | @@ -19,7 +19,7 @@ Created by FontForge 20120731 at Tue Jul 19 15:52:03 2016 | ||
19 | bbox="0 -224 1303 896.303" | 19 | bbox="0 -224 1303 896.303" |
20 | underline-thickness="50" | 20 | underline-thickness="50" |
21 | underline-position="-100" | 21 | underline-position="-100" |
22 | - unicode-range="U+0078-E645" | 22 | + unicode-range="U+0078-E647" |
23 | /> | 23 | /> |
24 | <missing-glyph horiz-adv-x="374" | 24 | <missing-glyph horiz-adv-x="374" |
25 | d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" /> | 25 | d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" /> |
@@ -239,5 +239,10 @@ q22 35 34.5 57t25.5 64t13 84q0 115 -74 196t-179 81zM841 356q-26 -40 -70 -89t-84. | @@ -239,5 +239,10 @@ q22 35 34.5 57t25.5 64t13 84q0 115 -74 196t-179 81zM841 356q-26 -40 -70 -89t-84. | ||
239 | q4 -14 17 -14t17 14q23 57 71.5 92t107.5 35q82 0 139.5 -63t57.5 -152q0 -46 -16 -83.5t-47 -86.5z" /> | 239 | q4 -14 17 -14t17 14q23 57 71.5 92t107.5 35q82 0 139.5 -63t57.5 -152q0 -46 -16 -83.5t-47 -86.5z" /> |
240 | <glyph glyph-name="uniE645" unicode="" | 240 | <glyph glyph-name="uniE645" unicode="" |
241 | d="M933 411h-394v394q0 11 -8 19t-19 8t-19 -8t-8 -19v-394h-394q-11 0 -19 -8t-8 -19t8 -19t19 -8h394v-394q0 -11 8 -19t19 -8t19 8t8 19v394h394q11 0 19 8t8 19t-8 19t-19 8z" /> | 241 | d="M933 411h-394v394q0 11 -8 19t-19 8t-19 -8t-8 -19v-394h-394q-11 0 -19 -8t-8 -19t8 -19t19 -8h394v-394q0 -11 8 -19t19 -8t19 8t8 19v394h394q11 0 19 8t8 19t-8 19t-19 8z" /> |
242 | + <glyph glyph-name="uniE646" unicode="" | ||
243 | +d="M922 812h-922l1024 -1024v922q0 42 -30 72t-72 30zM891 642l-236 -307q-6 -8 -15.5 -9t-16.5 5q-1 1 -1 2l-2 2l-98 106q-10 12 -10 28t10.5 27t25 11t24.5 -11q2 -2 4 -5l63 -99l217 283q6 8 15.5 9t16.5 -6t8 -17.5t-5 -18.5z" /> | ||
244 | + <glyph glyph-name="uniE647" unicode="" | ||
245 | +d="M1024 -106l-230 231q83 88 111.5 203.5t-3 231t-118.5 202.5q-66 65 -150.5 99.5t-172.5 34.5q-89 0 -175 -34.5t-152 -99.5q-66 -66 -100 -152t-34 -173t34 -173t100 -152t151 -100t176 -34q85 0 166 31.5t147 92.5l231 -230zM157 134q-60 60 -92.5 138.5t-32.5 162.5 | ||
246 | +q0 174 125 304q60 60 138.5 92.5t165.5 32.5q174 0 304 -125q61 -61 93 -141t32 -161t-32 -161t-93 -142q-60 -60 -139 -92t-165.5 -32t-165 32t-138.5 92z" /> | ||
242 | </font> | 247 | </font> |
243 | </defs></svg> | 248 | </defs></svg> |
No preview for this file type
No preview for this file type
@@ -83,12 +83,18 @@ function validatePhoneNumLocal() { | @@ -83,12 +83,18 @@ function validatePhoneNumLocal() { | ||
83 | 83 | ||
84 | if (val !== '') { | 84 | if (val !== '') { |
85 | if (/^[0-9]+$/.test(val)) { | 85 | if (/^[0-9]+$/.test(val)) { |
86 | - if (phoneRegx[$regionCodeText.text()].test(val)) { | 86 | + |
87 | + // 这里只做中国区验证 | ||
88 | + if ($regionCodeText.text() === '+86') { | ||
89 | + if (val.length === 11 && phoneRegx['+86'.test(val)]) { | ||
87 | return true; | 90 | return true; |
88 | } else { | 91 | } else { |
89 | - errTip($phone, '手机号码格式不正确,请重新输入'); | 92 | + errTip($phone, '手机号码不正确,请重新输入'); |
90 | return false; | 93 | return false; |
91 | } | 94 | } |
95 | + } | ||
96 | + | ||
97 | + return true; | ||
92 | } else { | 98 | } else { |
93 | if (emailRegx.test(val)) { | 99 | if (emailRegx.test(val)) { |
94 | return true; | 100 | return true; |
@@ -129,19 +129,25 @@ $phoneNumInput.on('blur', function() { | @@ -129,19 +129,25 @@ $phoneNumInput.on('blur', function() { | ||
129 | return; | 129 | return; |
130 | } | 130 | } |
131 | 131 | ||
132 | - if (length !== 11) { | ||
133 | - errTip($phone, '手机号码格式不正确'); | 132 | + if (/^[0-9]+$/.test($phoneNumInput.val())) { |
133 | + | ||
134 | + // 这里只做中国区验证 | ||
135 | + if ($regionCodeText.text() === '+86') { | ||
136 | + if ($phoneNumInput.length === 11 && phoneRegx['+86'].test($phoneNumInput.val())) { | ||
137 | + ep.emit('phoneNum', true); | ||
138 | + return; | ||
139 | + } else { | ||
140 | + errTip($phone, '手机号码不正确,请重新输入'); | ||
134 | ep.emit('phoneNum', false); | 141 | ep.emit('phoneNum', false); |
135 | return; | 142 | return; |
136 | } | 143 | } |
137 | - | ||
138 | - if (!phoneRegx[$regionCodeText.text()].test($phoneNumInput.val())) { | ||
139 | - errTip($phone, '手机号码格式不正确'); | 144 | + } |
145 | + ep.emit('phoneNum', true); | ||
146 | + return; | ||
147 | + } else { | ||
140 | ep.emit('phoneNum', false); | 148 | ep.emit('phoneNum', false); |
141 | return; | 149 | return; |
142 | } | 150 | } |
143 | - | ||
144 | - ep.emit('phoneNum', true); | ||
145 | }); | 151 | }); |
146 | 152 | ||
147 | $imgCaptchaInput.on('blur', function() { | 153 | $imgCaptchaInput.on('blur', function() { |
@@ -61,20 +61,18 @@ function validateAccountLocal() { | @@ -61,20 +61,18 @@ function validateAccountLocal() { | ||
61 | 61 | ||
62 | if (phoneNum !== '') { | 62 | if (phoneNum !== '') { |
63 | if (/^[0-9]+$/.test(phoneNum)) { | 63 | if (/^[0-9]+$/.test(phoneNum)) { |
64 | - // 不是11位 | ||
65 | - if (phoneNum.length !== 11) { | ||
66 | - errTip($phone, '手机号码不正确,请重新输入'); | ||
67 | - return false; | ||
68 | - } | ||
69 | 64 | ||
70 | - // 如果是纯数字,则作为手机号码处理 | ||
71 | - if (regionCode !== '+86' || | ||
72 | - mailPhoneRegx.phoneRegx[regionCode].test(phoneNum)) { | 65 | + // 这里只做中国区验证 |
66 | + if (regionCode === '+86') { | ||
67 | + if (phoneNum.length === 11 && mailPhoneRegx.phoneRegx['+86'.test(phoneNum)]) { | ||
73 | return true; | 68 | return true; |
74 | } else { | 69 | } else { |
75 | errTip($phone, '手机号码不正确,请重新输入'); | 70 | errTip($phone, '手机号码不正确,请重新输入'); |
76 | return false; | 71 | return false; |
77 | } | 72 | } |
73 | + } | ||
74 | + | ||
75 | + return true; | ||
78 | } else { | 76 | } else { |
79 | 77 | ||
80 | // 邮箱验证 | 78 | // 邮箱验证 |
@@ -244,17 +244,23 @@ function validatePhoneNumLocal() { | @@ -244,17 +244,23 @@ function validatePhoneNumLocal() { | ||
244 | regionCode = $regionCodeText.text(); | 244 | regionCode = $regionCodeText.text(); |
245 | 245 | ||
246 | if (length === 0) { | 246 | if (length === 0) { |
247 | - errTip($phone, '请输入手机号码'); | ||
248 | - return false; | ||
249 | - } else if (length !== 11) { | ||
250 | - errTip($phone, '手机号码格式不正确,请重新输入'); | ||
251 | - return false; | ||
252 | - } else if (!/^[0-9]+$/.test(phoneNum) || | ||
253 | - (regionCode === '+86' && !regValidate.phoneRegx[regionCode].test(phoneNum))) { | ||
254 | - errTip($phone, '手机号码格式不正确,请重新输入'); | ||
255 | return false; | 247 | return false; |
248 | + } | ||
249 | + | ||
250 | + if (/^[0-9]+$/.test($phoneNumInput.val())) { | ||
251 | + | ||
252 | + // 这里只做中国区验证 | ||
253 | + if (regionCode === '+86') { | ||
254 | + if (phoneNum.length === 11 && regValidate.phoneRegx['+86'].test(phoneNum.val())) { | ||
255 | + return true; | ||
256 | } else { | 256 | } else { |
257 | + errTip($phone, '手机号码不正确,请重新输入'); | ||
258 | + return false; | ||
259 | + } | ||
260 | + } | ||
257 | return true; | 261 | return true; |
262 | + } else { | ||
263 | + return false; | ||
258 | } | 264 | } |
259 | } | 265 | } |
260 | 266 |
@@ -34,6 +34,8 @@ var $printPrice = $('#print-price'); | @@ -34,6 +34,8 @@ var $printPrice = $('#print-price'); | ||
34 | 34 | ||
35 | var $invoice = $('#invoice-content'); | 35 | var $invoice = $('#invoice-content'); |
36 | 36 | ||
37 | +require('yoho-jquery-dotdotdot'); | ||
38 | + | ||
37 | require('../plugins/check'); // before 地址和发票 | 39 | require('../plugins/check'); // before 地址和发票 |
38 | 40 | ||
39 | require('./order/address'); // 地址 | 41 | require('./order/address'); // 地址 |
@@ -41,6 +43,11 @@ require('./order/invoice'); // 发票 | @@ -41,6 +43,11 @@ require('./order/invoice'); // 发票 | ||
41 | 43 | ||
42 | lazyLoad($('img.lazy')); | 44 | lazyLoad($('img.lazy')); |
43 | 45 | ||
46 | +// dot | ||
47 | +$('.brand-and-name .name').dotdotdot({ | ||
48 | + wrap: 'letter' | ||
49 | +}); | ||
50 | + | ||
44 | // JIT拆单 | 51 | // JIT拆单 |
45 | $('.show-package').click(function() { | 52 | $('.show-package').click(function() { |
46 | $('.package-list').toggleClass('hide'); | 53 | $('.package-list').toggleClass('hide'); |
@@ -346,3 +346,41 @@ | @@ -346,3 +346,41 @@ | ||
346 | } | 346 | } |
347 | } | 347 | } |
348 | } | 348 | } |
349 | + | ||
350 | +.yoho-list-empty { | ||
351 | + | ||
352 | + height: 800px; | ||
353 | + | ||
354 | + .tip-search { | ||
355 | + margin-top: 100px; | ||
356 | + text-align: center; | ||
357 | + | ||
358 | + .iconfont { | ||
359 | + font-size: 100px; | ||
360 | + color: #666; | ||
361 | + } | ||
362 | + } | ||
363 | + | ||
364 | + p { | ||
365 | + text-align: center; | ||
366 | + } | ||
367 | + | ||
368 | + .tip-cn { | ||
369 | + margin-top: 30px; | ||
370 | + font-size: 18px; | ||
371 | + font-weight: 700; | ||
372 | + | ||
373 | + span { | ||
374 | + color: #379ed6; | ||
375 | + } | ||
376 | + } | ||
377 | + | ||
378 | + .tip-en { | ||
379 | + margin-top: 15px; | ||
380 | + font-size: 14px; | ||
381 | + } | ||
382 | + | ||
383 | + .tip-cn-sm { | ||
384 | + margin-top: 20px; | ||
385 | + } | ||
386 | +} |
-
Please register or login to post a comment