Showing
5 changed files
with
72 additions
and
13 deletions
@@ -1560,7 +1560,6 @@ let getNewProductAsyncData = (data) => { | @@ -1560,7 +1560,6 @@ let getNewProductAsyncData = (data) => { | ||
1560 | } | 1560 | } |
1561 | finalResult.isStudent = data.isStudent; | 1561 | finalResult.isStudent = data.isStudent; |
1562 | 1562 | ||
1563 | - | ||
1564 | return finalResult; | 1563 | return finalResult; |
1565 | }); | 1564 | }); |
1566 | }); | 1565 | }); |
@@ -1753,7 +1752,8 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => { | @@ -1753,7 +1752,8 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => { | ||
1753 | goodsId: value.goods_id, | 1752 | goodsId: value.goods_id, |
1754 | colorId: value.color_id, | 1753 | colorId: value.color_id, |
1755 | name: size.size_name, | 1754 | name: size.size_name, |
1756 | - sizeNum: size.storage_number | 1755 | + sizeNum: size.storage_number, |
1756 | + sizeInfo: size.size_info | ||
1757 | }); | 1757 | }); |
1758 | 1758 | ||
1759 | sizeName = size.size_name; | 1759 | sizeName = size.size_name; |
@@ -1762,7 +1762,8 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => { | @@ -1762,7 +1762,8 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => { | ||
1762 | // 判断出没有库存则显示灰色 | 1762 | // 判断出没有库存则显示灰色 |
1763 | let build = { | 1763 | let build = { |
1764 | id: size.size_id, | 1764 | id: size.size_id, |
1765 | - storage: size.storage_number | 1765 | + storage: size.storage_number, |
1766 | + sizeInfo: size.size_info | ||
1766 | }; | 1767 | }; |
1767 | 1768 | ||
1768 | allSizeList[sizeName] = (allSizeList[sizeName] === null || | 1769 | allSizeList[sizeName] = (allSizeList[sizeName] === null || |
@@ -1771,6 +1772,7 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => { | @@ -1771,6 +1772,7 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => { | ||
1771 | colorStorageGroup[value.product_skc][sizeName] = parseInt(size.storage_number, 10); | 1772 | colorStorageGroup[value.product_skc][sizeName] = parseInt(size.storage_number, 10); |
1772 | }); | 1773 | }); |
1773 | 1774 | ||
1775 | + | ||
1774 | // 颜色分组 | 1776 | // 颜色分组 |
1775 | colorList.push({ | 1777 | colorList.push({ |
1776 | id: value.color_id, | 1778 | id: value.color_id, |
@@ -1796,11 +1798,13 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => { | @@ -1796,11 +1798,13 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => { | ||
1796 | size: [] | 1798 | size: [] |
1797 | }; | 1799 | }; |
1798 | _.forEach(allSizeList, (value, key) => { | 1800 | _.forEach(allSizeList, (value, key) => { |
1801 | + | ||
1799 | // 默认尺码 | 1802 | // 默认尺码 |
1800 | sizeGroup[0].size.push({ | 1803 | sizeGroup[0].size.push({ |
1801 | name: key, | 1804 | name: key, |
1802 | sizeNum: _.toNumber(value.storage) > 0 ? true : false, | 1805 | sizeNum: _.toNumber(value.storage) > 0 ? true : false, |
1803 | - id: value.id | 1806 | + id: value.id, |
1807 | + sizeInfo: value.sizeInfo | ||
1804 | }); | 1808 | }); |
1805 | 1809 | ||
1806 | colorGroup[i] = { | 1810 | colorGroup[i] = { |
@@ -1831,6 +1835,7 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => { | @@ -1831,6 +1835,7 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => { | ||
1831 | // 遍历所有颜色, 构建尺码显示数据 | 1835 | // 遍历所有颜色, 构建尺码显示数据 |
1832 | i = 1; | 1836 | i = 1; |
1833 | _.forEach(colorList, function(value) { | 1837 | _.forEach(colorList, function(value) { |
1838 | + | ||
1834 | // 各个尺码的颜色, 每行显示一个颜色的对应尺码 | 1839 | // 各个尺码的颜色, 每行显示一个颜色的对应尺码 |
1835 | sizeGroup[i] = { | 1840 | sizeGroup[i] = { |
1836 | size: sizeList[value.skcId], | 1841 | size: sizeList[value.skcId], |
@@ -1841,6 +1846,7 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => { | @@ -1841,6 +1846,7 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => { | ||
1841 | colorGroup[0].color.push(value); | 1846 | colorGroup[0].color.push(value); |
1842 | ++i; | 1847 | ++i; |
1843 | }); | 1848 | }); |
1849 | + | ||
1844 | } | 1850 | } |
1845 | let soldOut = (origin.storage_sum === 0) || (totalStorageNum === 0); // status | 1851 | let soldOut = (origin.storage_sum === 0) || (totalStorageNum === 0); // status |
1846 | let notForSale = origin.attribute === 2; | 1852 | let notForSale = origin.attribute === 2; |
@@ -24,13 +24,18 @@ module.exports = { | @@ -24,13 +24,18 @@ module.exports = { | ||
24 | // imCs: 'http://im.yohobuy.com/api', | 24 | // imCs: 'http://im.yohobuy.com/api', |
25 | // imServer: 'http://im.yohobuy.com/server' | 25 | // imServer: 'http://im.yohobuy.com/server' |
26 | 26 | ||
27 | - api: 'http://api.yoho.cn/', | ||
28 | - service: 'http://service.yoho.cn/', | ||
29 | - liveApi: 'http://api.live.yoho.cn/', | ||
30 | - singleApi: 'http://single.yoho.cn/', | ||
31 | - imSocket: 'wss://imsocket.yohobuy.com:443', | ||
32 | - imCs: 'https://imhttp.yohobuy.com/api', | ||
33 | - imServer: 'https://imhttp.yohobuy.com/server' | 27 | + // api: 'http://api.yoho.cn/', |
28 | + // service: 'http://service.yoho.cn/', | ||
29 | + // liveApi: 'http://api.live.yoho.cn/', | ||
30 | + // singleApi: 'http://single.yoho.cn/', | ||
31 | + // imSocket: 'wss://imsocket.yohobuy.com:443', | ||
32 | + // imCs: 'https://imhttp.yohobuy.com/api', | ||
33 | + // imServer: 'https://imhttp.yohobuy.com/server' | ||
34 | + | ||
35 | + api: 'http://dev-api.yohops.com:9999/', | ||
36 | + service: 'http://dev-service.yohops.com:9999/', | ||
37 | + liveApi: 'http://testapi.live.yohops.com:9999/', | ||
38 | + singleApi: 'http://api-test1.yohops.com:9999/' | ||
34 | }, | 39 | }, |
35 | subDomains: { | 40 | subDomains: { |
36 | host: '.m.yohobuy.com', | 41 | host: '.m.yohobuy.com', |
@@ -22,6 +22,9 @@ | @@ -22,6 +22,9 @@ | ||
22 | {{/ isY}} | 22 | {{/ isY}} |
23 | {{/if}} | 23 | {{/if}} |
24 | </p> | 24 | </p> |
25 | + <p class="not-choose">请选择颜色、尺码</p> | ||
26 | + <p class="choosed-info hide"></p> | ||
27 | + <p class="size-info hide"></p> | ||
25 | </div> | 28 | </div> |
26 | </div> | 29 | </div> |
27 | <div class="chose-items"> | 30 | <div class="chose-items"> |
@@ -40,7 +43,7 @@ | @@ -40,7 +43,7 @@ | ||
40 | {{#each sizes}} | 43 | {{#each sizes}} |
41 | <ul class="size-row clearfix {{#unless @first}}hide{{/unless}}"> | 44 | <ul class="size-row clearfix {{#unless @first}}hide{{/unless}}"> |
42 | {{#each size}} | 45 | {{#each size}} |
43 | - <li class="block {{#if chosed}} chosed{{/if}} {{#unless sizeNum}} zero-stock {{/unless}}" data-num="{{sizeNum}}" data-id="{{id}}" data-skuid="{{skuId}}">{{name}}</li> | 46 | + <li class="block {{#if chosed}} chosed{{/if}} {{#unless sizeNum}} zero-stock {{/unless}}" data-num="{{sizeNum}}" data-id="{{id}}" data-skuid="{{skuId}}" data-info="{{sizeInfo}}">{{name}}</li> |
44 | {{/each}} | 47 | {{/each}} |
45 | </ul> | 48 | </ul> |
46 | {{/each}} | 49 | {{/each}} |
@@ -362,6 +362,30 @@ $yohoPage.on('touchstart', '.chose-panel', function(e) { | @@ -362,6 +362,30 @@ $yohoPage.on('touchstart', '.chose-panel', function(e) { | ||
362 | return false; | 362 | return false; |
363 | }); | 363 | }); |
364 | 364 | ||
365 | +function chosedLength() { | ||
366 | + var $chosedL = $('.block-list>ul>li.chosed'), | ||
367 | + infoHtml; | ||
368 | + | ||
369 | + $('.choosed-info').removeClass('hide'); | ||
370 | + if (!$('.not-choose').hasClass('hide')) { | ||
371 | + $('.not-choose').addClass('hide'); | ||
372 | + } | ||
373 | + | ||
374 | + if ($chosedL.length === 2) { | ||
375 | + $chosedL.each(function(val) { | ||
376 | + | ||
377 | + infoHtml = '已选:' + $chosedL.eq(0).html() + '、' + $chosedL.eq(1).html(); | ||
378 | + }) | ||
379 | + } else if ($chosedL.length === 1) { | ||
380 | + infoHtml = '已选:' + $chosedL.eq(0).html(); | ||
381 | + } else { | ||
382 | + $('.choosed-info').addClass('hide'); | ||
383 | + $('.not-choose').removeClass('hide'); | ||
384 | + } | ||
385 | + | ||
386 | + $('.choosed-info').html(infoHtml); | ||
387 | +} | ||
388 | + | ||
365 | $yohoPage.on('touchstart', '.color-list .block', function() { | 389 | $yohoPage.on('touchstart', '.color-list .block', function() { |
366 | var $this = $(this), | 390 | var $this = $(this), |
367 | index = $this.index(), | 391 | index = $this.index(), |
@@ -450,6 +474,7 @@ $yohoPage.on('touchstart', '.color-list .block', function() { | @@ -450,6 +474,7 @@ $yohoPage.on('touchstart', '.color-list .block', function() { | ||
450 | return false; | 474 | return false; |
451 | } | 475 | } |
452 | 476 | ||
477 | + chosedLength(); | ||
453 | 478 | ||
454 | }).on('touchstart', '.size-list .block', function() { | 479 | }).on('touchstart', '.size-list .block', function() { |
455 | var $this = $(this), | 480 | var $this = $(this), |
@@ -475,6 +500,10 @@ $yohoPage.on('touchstart', '.color-list .block', function() { | @@ -475,6 +500,10 @@ $yohoPage.on('touchstart', '.color-list .block', function() { | ||
475 | // 老的选中颜色去掉勾选,新的选中颜色加上勾选 | 500 | // 老的选中颜色去掉勾选,新的选中颜色加上勾选 |
476 | changeColorChosed(0); | 501 | changeColorChosed(0); |
477 | 502 | ||
503 | + if (!$('.size-info').hasClass('hide')) { | ||
504 | + $('.size-info').addClass('hide'); | ||
505 | + } | ||
506 | + | ||
478 | // 当前尺码不是选中状态,选中时 | 507 | // 当前尺码不是选中状态,选中时 |
479 | } else { | 508 | } else { |
480 | hasChooseSize = true; | 509 | hasChooseSize = true; |
@@ -496,6 +525,8 @@ $yohoPage.on('touchstart', '.color-list .block', function() { | @@ -496,6 +525,8 @@ $yohoPage.on('touchstart', '.color-list .block', function() { | ||
496 | curColorIndex = index + 1; | 525 | curColorIndex = index + 1; |
497 | $curSizeBlock = $this; | 526 | $curSizeBlock = $this; |
498 | 527 | ||
528 | + $('.size-info').html($(this).data('info')).removeClass('hide'); | ||
529 | + | ||
499 | if (window._yas && window._yas.sendCustomInfo) { | 530 | if (window._yas && window._yas.sendCustomInfo) { |
500 | window._yas.sendCustomInfo({ | 531 | window._yas.sendCustomInfo({ |
501 | op: 'YB_GDS_SIZE_C', | 532 | op: 'YB_GDS_SIZE_C', |
@@ -513,6 +544,8 @@ $yohoPage.on('touchstart', '.color-list .block', function() { | @@ -513,6 +544,8 @@ $yohoPage.on('touchstart', '.color-list .block', function() { | ||
513 | $this.toggleClass('chosed'); | 544 | $this.toggleClass('chosed'); |
514 | $('#good-num').val(1); | 545 | $('#good-num').val(1); |
515 | 546 | ||
547 | + chosedLength(); | ||
548 | + | ||
516 | // 设置按钮的样式和文字 | 549 | // 设置按钮的样式和文字 |
517 | updateConformButtonClassAndText(); | 550 | updateConformButtonClassAndText(); |
518 | }); | 551 | }); |
@@ -80,7 +80,8 @@ | @@ -80,7 +80,8 @@ | ||
80 | 80 | ||
81 | .sale-price { | 81 | .sale-price { |
82 | margin-right: 15px; | 82 | margin-right: 15px; |
83 | - color: #e10; | 83 | + color: #D0021b; |
84 | + font-size: 28px; | ||
84 | 85 | ||
85 | &.no-price { | 86 | &.no-price { |
86 | color: #000; | 87 | color: #000; |
@@ -91,6 +92,17 @@ | @@ -91,6 +92,17 @@ | ||
91 | color: #b0b0b0; | 92 | color: #b0b0b0; |
92 | text-decoration: line-through; | 93 | text-decoration: line-through; |
93 | } | 94 | } |
95 | + | ||
96 | + .size-info { | ||
97 | + font-size: 24px; | ||
98 | + display: block; | ||
99 | + margin-top: 5px; | ||
100 | + color: #444; | ||
101 | + } | ||
102 | + | ||
103 | + .hide { | ||
104 | + display: none; | ||
105 | + } | ||
94 | } | 106 | } |
95 | 107 | ||
96 | .color-list, | 108 | .color-list, |
-
Please register or login to post a comment