Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
35 changed files
with
401 additions
and
518 deletions
@@ -846,7 +846,16 @@ | @@ -846,7 +846,16 @@ | ||
846 | 846 | ||
847 | { | 847 | { |
848 | id: 1, | 848 | id: 1, |
849 | + inValid: true, //是否是失效商品, | ||
850 | + | ||
851 | + showCheckbox: true, //是否显示checkbox【赠品和加价购不显示】 | ||
852 | + checked: true, //是否选中 | ||
853 | + | ||
849 | thumb: '', | 854 | thumb: '', |
855 | + | ||
856 | + isAdvanceBuy: true, //是否是加价购商品 | ||
857 | + isGift: ture, //是否是赠品 | ||
858 | + | ||
850 | name: '', | 859 | name: '', |
851 | color: '黄色', | 860 | color: '黄色', |
852 | size: 'L', | 861 | size: 'L', |
@@ -27,6 +27,7 @@ class DetailData | @@ -27,6 +27,7 @@ class DetailData | ||
27 | * | 27 | * |
28 | * @param int $productId 商品ID | 28 | * @param int $productId 商品ID |
29 | * @param int $uid 用户ID | 29 | * @param int $uid 用户ID |
30 | + * @param int $productSkn SKN | ||
30 | * @return array | 31 | * @return array |
31 | */ | 32 | */ |
32 | public static function baseInfo($productId, $uid, $productSkn = null) | 33 | public static function baseInfo($productId, $uid, $productSkn = null) |
@@ -576,30 +576,31 @@ class Helpers | @@ -576,30 +576,31 @@ class Helpers | ||
576 | $oneGoods['thumb'] = !empty($value['goods_images']) ? Images::getImageUrl($value['goods_images'], 90, 100) : ''; | 576 | $oneGoods['thumb'] = !empty($value['goods_images']) ? Images::getImageUrl($value['goods_images'], 90, 100) : ''; |
577 | $oneGoods['color'] = $value['color_name']; | 577 | $oneGoods['color'] = $value['color_name']; |
578 | $oneGoods['size'] = $value['size_name']; | 578 | $oneGoods['size'] = $value['size_name']; |
579 | - $oneGoods['isSelected'] = $value['selected'] === 'Y'; | 579 | + $oneGoods['checked'] = $value['selected'] === 'Y'; |
580 | $oneGoods['price'] = self::transPrice($value['sales_price']); | 580 | $oneGoods['price'] = self::transPrice($value['sales_price']); |
581 | $oneGoods['count'] = $value['buy_number']; | 581 | $oneGoods['count'] = $value['buy_number']; |
582 | 582 | ||
583 | - if ($isValid) { | 583 | + if ($isValid) { // 库存不足 |
584 | $oneGoods['lowStocks'] = ($value['buy_number'] > $value['storage_number']); | 584 | $oneGoods['lowStocks'] = ($value['buy_number'] > $value['storage_number']); |
585 | } | 585 | } |
586 | 586 | ||
587 | //gift=>是否赠品,advanceBuy=>是否加价购,soldOut=>失效商品; | 587 | //gift=>是否赠品,advanceBuy=>是否加价购,soldOut=>失效商品; |
588 | if (!isset($value['goods_type'])) { | 588 | if (!isset($value['goods_type'])) { |
589 | - $oneGoods['isSoldOut'] = true; | 589 | + $oneGoods['inValid'] = true; |
590 | } elseif ($value['goods_type'] == 'gift' && !isset($value['isAdvanceBuy'])) { | 590 | } elseif ($value['goods_type'] == 'gift' && !isset($value['isAdvanceBuy'])) { |
591 | $oneGoods['isGift'] = true; | 591 | $oneGoods['isGift'] = true; |
592 | } elseif ($value['goods_type'] == 'price_gift') { | 592 | } elseif ($value['goods_type'] == 'price_gift') { |
593 | $oneGoods['isAdvanceBuy'] = true; | 593 | $oneGoods['isAdvanceBuy'] = true; |
594 | + } else { | ||
595 | + $oneGoods['showCheckbox'] = true; | ||
594 | } | 596 | } |
597 | + | ||
595 | // 上市期 | 598 | // 上市期 |
596 | if ($isAdvanceCart && !empty($value['expect_arrival_time'])) { | 599 | if ($isAdvanceCart && !empty($value['expect_arrival_time'])) { |
597 | $oneGoods['appearDate'] = $value['expect_arrival_time']; | 600 | $oneGoods['appearDate'] = $value['expect_arrival_time']; |
598 | } | 601 | } |
599 | // 商品链接 | 602 | // 商品链接 |
600 | - if (isset($value['cn_alphabet'])) { | ||
601 | - $oneGoods['url'] = self::url('/product/pro_' . $value['product_id'] . '_' . $value['goods_id'] . '/' . $value['cn_alphabet'] . '.html'); | ||
602 | - } | 603 | + $oneGoods['link'] = self::url('/product/show_' . $value['product_skn'] . '.html'); |
603 | 604 | ||
604 | $arr[$key] = $oneGoods; | 605 | $arr[$key] = $oneGoods; |
605 | } | 606 | } |
@@ -629,7 +630,7 @@ class Helpers | @@ -629,7 +630,7 @@ class Helpers | ||
629 | $oneGoods['id'] = $single['product_skn']; | 630 | $oneGoods['id'] = $single['product_skn']; |
630 | $oneGoods['name'] = $single['product_name']; | 631 | $oneGoods['name'] = $single['product_name']; |
631 | $oneGoods['thumb'] = !empty($single['goods_images']) ? Images::getImageUrl($single['goods_images'], 120, 160) : ''; | 632 | $oneGoods['thumb'] = !empty($single['goods_images']) ? Images::getImageUrl($single['goods_images'], 120, 160) : ''; |
632 | - $oneGoods['price'] = self::transPrice($single['last_price']); | 633 | + $oneGoods['price'] = self::transPrice($single['sales_price']); |
633 | $oneGoods['marketPrice'] = self::transPrice($single['market_price']); | 634 | $oneGoods['marketPrice'] = self::transPrice($single['market_price']); |
634 | $oneGoods['count'] = $single['storage_number']; | 635 | $oneGoods['count'] = $single['storage_number']; |
635 | 636 |
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 Sat Dec 5 16:26:44 2015 | 5 | +Created by FontForge 20120731 at Thu Dec 17 13:53:30 2015 |
6 | By Ads | 6 | By Ads |
7 | </metadata> | 7 | </metadata> |
8 | <defs> | 8 | <defs> |
@@ -19,7 +19,7 @@ Created by FontForge 20120731 at Sat Dec 5 16:26:44 2015 | @@ -19,7 +19,7 @@ Created by FontForge 20120731 at Sat Dec 5 16:26:44 2015 | ||
19 | bbox="-0.75 -224 3943 833" | 19 | bbox="-0.75 -224 3943 833" |
20 | underline-thickness="50" | 20 | underline-thickness="50" |
21 | underline-position="-100" | 21 | underline-position="-100" |
22 | - unicode-range="U+0078-E63F" | 22 | + unicode-range="U+0078-E640" |
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" /> |
@@ -257,5 +257,11 @@ d="M512 -66q-10 0 -24.5 -0.5t-25 -1t-24 0t-24.5 1.5l-222 -146q0 227 5 243q-164 1 | @@ -257,5 +257,11 @@ d="M512 -66q-10 0 -24.5 -0.5t-25 -1t-24 0t-24.5 1.5l-222 -146q0 227 5 243q-164 1 | ||
257 | q-91 0 -176.5 -31.5t-148.5 -83.5t-100.5 -124.5t-37.5 -150.5q0 -95 53 -179t142 -138v-170l146 97q16 -3 35.5 -4t49 0t37.5 1q41 0 81 6.5t77 18.5t72 29.5t65 39.5t56.5 47.5t47 55t35 61t22 66t7.5 69.5q0 104 -63.5 194.5t-170.5 143t-229 52.5zM768 300 | 257 | q-91 0 -176.5 -31.5t-148.5 -83.5t-100.5 -124.5t-37.5 -150.5q0 -95 53 -179t142 -138v-170l146 97q16 -3 35.5 -4t49 0t37.5 1q41 0 81 6.5t77 18.5t72 29.5t65 39.5t56.5 47.5t47 55t35 61t22 66t7.5 69.5q0 104 -63.5 194.5t-170.5 143t-229 52.5zM768 300 |
258 | q-27 0 -45.5 18.5t-18.5 45.5t18.5 45.5t45.5 18.5t45.5 -18.5t18.5 -45.5t-18.5 -45.5t-45.5 -18.5zM512 300q-27 0 -45.5 18.5t-18.5 45.5t18.5 45.5t45.5 18.5t45.5 -18.5t18.5 -45.5t-18.5 -45.5t-45.5 -18.5zM256 300q-27 0 -45.5 18.5t-18.5 45.5t18.5 45.5t45.5 18.5 | 258 | q-27 0 -45.5 18.5t-18.5 45.5t18.5 45.5t45.5 18.5t45.5 -18.5t18.5 -45.5t-18.5 -45.5t-45.5 -18.5zM512 300q-27 0 -45.5 18.5t-18.5 45.5t18.5 45.5t45.5 18.5t45.5 -18.5t18.5 -45.5t-18.5 -45.5t-45.5 -18.5zM256 300q-27 0 -45.5 18.5t-18.5 45.5t18.5 45.5t45.5 18.5 |
259 | t45.5 -18.5t18.5 -45.5t-18.5 -45.5t-45.5 -18.5z" /> | 259 | t45.5 -18.5t18.5 -45.5t-18.5 -45.5t-45.5 -18.5z" /> |
260 | + <glyph glyph-name="uniE640" unicode="" | ||
261 | +d="M957 510q-5 8 -14 13.5t-24 5.5h-598l-29 62l-4 7q-1 3 -4 7t-8 8q-4 3 -7 6l-2 1l-8 4h-2q-5 2 -9 2l-4 1h-5h-118q-23 0 -40 -16.5t-17 -40.5q0 -6 1.5 -12.5t4.5 -12.5t7 -10.5t8.5 -8.5t10.5 -7t12.5 -4.5t12.5 -1.5h81l33 -71q3 -10 8 -21t8 -17l3 -5l81 -181 | ||
262 | +q0 -2 2 -5l15 -32q9 -30 39 -38v-3h392l18 1v2q14 4 24.5 14t14.5 24l98 217q40 77 19 112zM909 413l-93 -207l-3 1l-4 -15q-5 -19 -25 -19l-19 1v-1h-340h-18q-8 0 -15 5t-9 14l-4 15l-3 -1l-93 208q-1 1 -3.5 5.5t-7 14.5t-7.5 20l-42 92h-102q-10 0 -17 7t-7 17 | ||
263 | +q0 7 3 12.5t9 9t12 3.5h119l3 -1h2q1 0 2 -1l4 -2q2 -1 4 -3q1 -1 2 -1.5t1 -1.5l4 -6l38 -83h619q8 0 10 -3q3 -6 1 -19t-7.5 -29.5t-13.5 -31.5zM470 107q-33 0 -56.5 -23t-23.5 -56q0 -22 10.5 -40.5t29 -29t40.5 -10.5q33 0 56.5 23.5t23.5 56.5t-23.5 56t-56.5 23z | ||
264 | +M470 -23q-21 0 -36 15t-15 36t15 36t36 15q14 0 25.5 -7t18.5 -19t7 -25q0 -22 -15 -36.5t-36 -14.5zM747 107q-33 0 -56.5 -23t-23.5 -56q0 -22 10.5 -40.5t29 -29t40.5 -10.5q33 0 56.5 23.5t23.5 56.5t-23.5 56t-56.5 23zM747 -23q-14 0 -26 6.5t-18.5 18.5t-6.5 25.5 | ||
265 | +t6.5 25.5t18.5 19t26 7q21 0 36 -15t15 -36t-15 -36t-36 -15z" /> | ||
260 | </font> | 266 | </font> |
261 | </defs></svg> | 267 | </defs></svg> |
No preview for this file type
No preview for this file type
static/js/cart/cart-info.js
deleted
100644 → 0
1 | -/** | ||
2 | - * 购物车信息读取 | ||
3 | - * @author: liangzhifeng<zhifeng.liang@yoho.cn> | ||
4 | - * @date: 2015/12/15 | ||
5 | - */ | ||
6 | -var info = window.cookie('cart-info'); | ||
7 | - | ||
8 | -// info 必须是 JSON 字符串 | ||
9 | -try { | ||
10 | - info = JSON.parse(info); | ||
11 | -} catch (e) { | ||
12 | - info = { | ||
13 | - deliveryId: null, | ||
14 | - deliveryTimeId: null, | ||
15 | - paymentTypeId: null, | ||
16 | - yohoCoin: null, | ||
17 | - addressId: null, | ||
18 | - couponCode: null, | ||
19 | - couponValue: null, | ||
20 | - invoice: null, | ||
21 | - invoiceText: null, | ||
22 | - invoiceType: null, | ||
23 | - msg: null | ||
24 | - }; | ||
25 | - window.setCookie('cart-info', JSON.stringify(info)); | ||
26 | -} | ||
27 | - | ||
28 | -exports.cartInfo = function(key, value) { | ||
29 | - if (value === undefined) { | ||
30 | - return info[key]; | ||
31 | - } | ||
32 | - info[key] = value; | ||
33 | - window.setCookie('cart-info', JSON.stringify(info)); | ||
34 | -}; |
@@ -50,8 +50,16 @@ if ($('.cart-nav').length > 0) { | @@ -50,8 +50,16 @@ if ($('.cart-nav').length > 0) { | ||
50 | //trigger lazyload | 50 | //trigger lazyload |
51 | $(window).trigger('scroll'); | 51 | $(window).trigger('scroll'); |
52 | }); | 52 | }); |
53 | + | ||
54 | + setTimeout(function() { | ||
55 | + $('#presell-tip').addClass('hide'); | ||
56 | + }, 3000); | ||
53 | } | 57 | } |
54 | 58 | ||
59 | +$('.advance-buy').on('touchend', function() { | ||
60 | + window.location.href = '/cart/index/advanceBuy?cartType=' + cartType; | ||
61 | +}); | ||
62 | + | ||
55 | $('.btn-balance').on('touchend', function() { | 63 | $('.btn-balance').on('touchend', function() { |
56 | if (hasChecked) { | 64 | if (hasChecked) { |
57 | window.location.href = '/cart/index/orderEnsure?cartType=' + cartType; | 65 | window.location.href = '/cart/index/orderEnsure?cartType=' + cartType; |
@@ -10,53 +10,41 @@ | @@ -10,53 +10,41 @@ | ||
10 | // 异步渲染的模板统一插入 #chose-panel ,兼容页面多个选择框 | 10 | // 异步渲染的模板统一插入 #chose-panel ,兼容页面多个选择框 |
11 | 11 | ||
12 | var $ = require('jquery'), | 12 | var $ = require('jquery'), |
13 | - Handlebars = require('yoho.handlebars'), | ||
14 | tip = require('../plugin/tip'), | 13 | tip = require('../plugin/tip'), |
15 | loading = require('../plugin/loading'); | 14 | loading = require('../plugin/loading'); |
16 | 15 | ||
17 | -var panelTmpl, | ||
18 | - $chosePanel = $('#chose-panel'), | 16 | +var $chosePanel = $('#chose-panel'), |
19 | $num, | 17 | $num, |
20 | $chosed, | 18 | $chosed, |
21 | - | ||
22 | - // re = /\d+/, | 19 | + $imgsThumb, |
20 | + $leftNum, | ||
23 | leftNum, | 21 | leftNum, |
24 | confirming, | 22 | confirming, |
25 | - hasChooseColor = false, | ||
26 | - hasChooseSize = false, | ||
27 | curColorIndex, | 23 | curColorIndex, |
28 | curSizeIndex, | 24 | curSizeIndex, |
29 | $curSizeRow, | 25 | $curSizeRow, |
30 | - $curSizeBlock = null, | ||
31 | - $sizeRowList = $('.size-list ul'); | ||
32 | - | ||
33 | -// 读取模板 | ||
34 | -$.get('/cart/index/giftinfoTpl', function(html) { | ||
35 | - if (!html) { | ||
36 | - tip.show('网络错误'); | ||
37 | - return; | ||
38 | - } | ||
39 | - panelTmpl = Handlebars.compile(html); | ||
40 | -}).fail(function() { | ||
41 | - tip.show('网络错误'); | ||
42 | -}); | 26 | + hasChooseColor, |
27 | + hasChooseSize, | ||
28 | + $curSizeBlock, | ||
29 | + $sizeRowList, | ||
30 | + cbFn, | ||
31 | + $allChoseItems, | ||
32 | + queryString, | ||
33 | + $yohoPage = $('.yoho-page'); | ||
43 | 34 | ||
44 | //初始化购物车面板显示 | 35 | //初始化购物车面板显示 |
45 | function init() { | 36 | function init() { |
46 | - | ||
47 | - //$colorList = $('.chose-panel .color-list ul>li'); | ||
48 | - //$sizeList = $('.chose-panel .size-list ul>li'); | ||
49 | - //firstColorId = $colorList.eq(0).data('id'); | ||
50 | - //$sizeList.each(function() { | ||
51 | - // colorIndex = $(this).data('colorid'); | ||
52 | - // | ||
53 | - // if (colorIndex === firstColorId) { | ||
54 | - // $(this).removeClass('hide'); | ||
55 | - // } | ||
56 | - //}); | ||
57 | - | ||
58 | - var $firstRow = $sizeRowList.eq(0); | ||
59 | - | 37 | + var $firstRow; |
38 | + | ||
39 | + hasChooseColor = false; | ||
40 | + hasChooseSize = false; | ||
41 | + $curSizeBlock = null; | ||
42 | + queryString = $.queryString(); | ||
43 | + $imgsThumb = $('.chose-panel').find('.thumb'); | ||
44 | + $allChoseItems = $('.chose-items'); | ||
45 | + $sizeRowList = $('.size-list ul'); | ||
46 | + $leftNum = $('#left-num'); | ||
47 | + $firstRow = $sizeRowList.eq(0); | ||
60 | $firstRow.toggleClass('hide'); | 48 | $firstRow.toggleClass('hide'); |
61 | $curSizeRow = $firstRow; | 49 | $curSizeRow = $firstRow; |
62 | } | 50 | } |
@@ -75,34 +63,63 @@ function checkColorSizeNum() { | @@ -75,34 +63,63 @@ function checkColorSizeNum() { | ||
75 | return true; | 63 | return true; |
76 | } | 64 | } |
77 | 65 | ||
78 | -init(); | ||
79 | - | ||
80 | -function show(data) { | ||
81 | - if (data) { | ||
82 | - $chosePanel.html(panelTmpl(data)); | 66 | +function show(html, cb) { |
67 | + if (html) { | ||
68 | + $chosePanel.html(html); | ||
83 | init(); | 69 | init(); |
84 | } | 70 | } |
85 | $('.chose-panel').show(); | 71 | $('.chose-panel').show(); |
86 | - | ||
87 | - $('body').css('overflow', 'hidden'); | ||
88 | $num = $('#good-num'); | 72 | $num = $('#good-num'); |
73 | + cbFn = cb; | ||
89 | } | 74 | } |
90 | 75 | ||
91 | -////显示当前Panel | ||
92 | -//function show() { | ||
93 | -// $('.chose-panel').show(); | ||
94 | -// | ||
95 | -// $('body').css('overflow', 'hidden'); | ||
96 | -// $num = $('#good-num'); | ||
97 | -//} | ||
98 | - | ||
99 | //隐藏当前Panel | 76 | //隐藏当前Panel |
100 | function hide() { | 77 | function hide() { |
101 | $('.chose-panel').hide(); | 78 | $('.chose-panel').hide(); |
102 | - $('body').css('overflow', 'auto'); | ||
103 | } | 79 | } |
104 | 80 | ||
105 | -$('.yoho-page').on('touchstart', '.chose-panel', function(e) { | 81 | +//修改加入购物车的文字和背景 |
82 | +function updateConformButtonClassAndText() { | ||
83 | + $chosed = $allChoseItems.find('.chosed'); | ||
84 | + if (2 === $chosed.closest('.zero-stock').length) { | ||
85 | + $('#chose-btn-sure').css('background-color', '#c0c0c0').html('已售罄'); | ||
86 | + } else { | ||
87 | + $('#chose-btn-sure').css('background-color', '#eb0313').html('确定'); | ||
88 | + } | ||
89 | +} | ||
90 | + | ||
91 | +//重置颜色块的库存为0的样式 | ||
92 | +function resetColorZeroStock($siblingBlock) { | ||
93 | + var numArray = ($curSizeBlock.data('numstr') + '').split('/'), | ||
94 | + i; | ||
95 | + | ||
96 | + if (!hasChooseSize) { | ||
97 | + $siblingBlock.find('ul>li').each(function() { | ||
98 | + $(this).removeClass('zero-stock'); | ||
99 | + if ('0' === $(this).data('num')) { | ||
100 | + $(this).addClass('zero-stock'); | ||
101 | + } | ||
102 | + }); | ||
103 | + | ||
104 | + } else { | ||
105 | + for (i = 0; i < numArray.length; i++) { | ||
106 | + if ('0' === numArray[i]) { | ||
107 | + $siblingBlock.find('.block').eq(i).addClass('zero-stock'); | ||
108 | + } | ||
109 | + } | ||
110 | + } | ||
111 | +} | ||
112 | + | ||
113 | +// 选择了颜色切换商品图片 | ||
114 | +function changeGoodImgWhenClickColor() { | ||
115 | + if (hasChooseColor && curColorIndex) { | ||
116 | + $imgsThumb.addClass('hide').eq(curColorIndex).removeClass('hide'); | ||
117 | + } | ||
118 | +} | ||
119 | + | ||
120 | +init(); | ||
121 | + | ||
122 | +$yohoPage.on('touchstart', '.chose-panel', function(e) { | ||
106 | var $cur = $(e.target); | 123 | var $cur = $(e.target); |
107 | 124 | ||
108 | if ($cur.closest('.main').length > 0) { | 125 | if ($cur.closest('.main').length > 0) { |
@@ -113,12 +130,11 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) { | @@ -113,12 +130,11 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) { | ||
113 | hide(); | 130 | hide(); |
114 | }); | 131 | }); |
115 | 132 | ||
116 | -$('.color-list').on('touchstart', '.block', function(e) { | 133 | +$yohoPage.on('touchstart', '.color-list .block', function(e) { |
117 | var $this = $(this), | 134 | var $this = $(this), |
118 | - $that = $(e.target).closest('.chose-items'), | ||
119 | index, | 135 | index, |
120 | - curSelectedSizeBlock, | ||
121 | - $sizeChosed, | 136 | + curSizeBlock, |
137 | + $preSiblingBlock, | ||
122 | scindex, | 138 | scindex, |
123 | curGoodNum; | 139 | curGoodNum; |
124 | 140 | ||
@@ -127,50 +143,44 @@ $('.color-list').on('touchstart', '.block', function(e) { | @@ -127,50 +143,44 @@ $('.color-list').on('touchstart', '.block', function(e) { | ||
127 | $this.siblings('.chosed').removeClass('chosed'); | 143 | $this.siblings('.chosed').removeClass('chosed'); |
128 | index = $this.index(); | 144 | index = $this.index(); |
129 | 145 | ||
130 | - $sizeChosed = $siblingBlock.find('.chosed'); | ||
131 | - scindex = $sizeChosed.index(); | 146 | + $preSiblingBlock = $siblingBlock.find('.chosed'); |
147 | + scindex = $preSiblingBlock.index(); | ||
132 | $curSizeRow = $sizeRowList.eq(index); | 148 | $curSizeRow = $sizeRowList.eq(index); |
133 | 149 | ||
134 | // 当前颜色已经是选中状态,再点击时 | 150 | // 当前颜色已经是选中状态,再点击时 |
135 | if ($this.hasClass('chosed')) { | 151 | if ($this.hasClass('chosed')) { |
136 | 152 | ||
137 | //颜色原来已经是勾选时,要清空剩余件数的提示 | 153 | //颜色原来已经是勾选时,要清空剩余件数的提示 |
138 | - $that.find('.num .left-num').html(''); | ||
139 | - $('#left-num').val(0); | 154 | + $allChoseItems.find('.num .left-num').html(''); |
155 | + $leftNum.val(0); | ||
140 | hasChooseColor = false; | 156 | hasChooseColor = false; |
141 | 157 | ||
142 | // 当前颜色不是选中状态,选中时 | 158 | // 当前颜色不是选中状态,选中时 |
143 | } else { | 159 | } else { |
144 | hasChooseColor = true; | 160 | hasChooseColor = true; |
145 | 161 | ||
146 | - //根据颜色切换图片 | ||
147 | - if ($this.closest('.block-list').hasClass('color-list')) { | ||
148 | - $('.chose-panel').find('.thumb').addClass('hide').eq(index).removeClass('hide'); | ||
149 | - } | ||
150 | - | ||
151 | //把当前选中颜色对应的尺码那一行显示出来 | 162 | //把当前选中颜色对应的尺码那一行显示出来 |
152 | $sizeRowList.addClass('hide'); | 163 | $sizeRowList.addClass('hide'); |
153 | $curSizeRow.removeClass('hide').addClass('show'); | 164 | $curSizeRow.removeClass('hide').addClass('show'); |
154 | 165 | ||
155 | // 之前选中的尺码去掉勾选样式 | 166 | // 之前选中的尺码去掉勾选样式 |
156 | - if ($sizeChosed.length > 0) { | ||
157 | - $sizeChosed.removeClass('chosed'); | ||
158 | - curSelectedSizeBlock = $curSizeRow.children().get(scindex); | 167 | + if ($preSiblingBlock.length > 0) { |
168 | + $preSiblingBlock.removeClass('chosed'); | ||
169 | + curSizeBlock = $curSizeRow.children().get(scindex); | ||
159 | } | 170 | } |
160 | 171 | ||
161 | // 当前选中颜色对应的尺码行,其对应的尺码加上勾选样式 (前提是要判断下这个尺码是否存在) | 172 | // 当前选中颜色对应的尺码行,其对应的尺码加上勾选样式 (前提是要判断下这个尺码是否存在) |
162 | - if (curSelectedSizeBlock) { | ||
163 | - curGoodNum = $(curSelectedSizeBlock).data('num'); | ||
164 | - $(curSelectedSizeBlock).addClass('chosed'); | 173 | + if (curSizeBlock) { |
174 | + curGoodNum = $(curSizeBlock).data('num'); | ||
175 | + $(curSizeBlock).addClass('chosed'); | ||
165 | 176 | ||
166 | //如果当前有尺码被选中,且数量等于0,则颜色块添加数量为0的样式 | 177 | //如果当前有尺码被选中,且数量等于0,则颜色块添加数量为0的样式 |
167 | if (curGoodNum > 0) { | 178 | if (curGoodNum > 0) { |
168 | - $that.find('.num .left-num').html('剩余' + curGoodNum + '件'); | ||
169 | - $('#left-num').val(curGoodNum); | 179 | + $allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件'); |
180 | + $leftNum.val(curGoodNum); | ||
170 | } else { | 181 | } else { |
171 | - $(curSelectedSizeBlock).removeClass('zero-stock').addClass('zero-stock'); | ||
172 | - $that.find('.num .left-num').html(''); | ||
173 | - $('#left-num').val(0); | 182 | + $allChoseItems.find('.num .left-num').html(''); |
183 | + $leftNum.val(0); | ||
174 | } | 184 | } |
175 | } | 185 | } |
176 | } | 186 | } |
@@ -180,106 +190,31 @@ $('.color-list').on('touchstart', '.block', function(e) { | @@ -180,106 +190,31 @@ $('.color-list').on('touchstart', '.block', function(e) { | ||
180 | curColorIndex = index; | 190 | curColorIndex = index; |
181 | 191 | ||
182 | // 设置按钮的样式和文字 | 192 | // 设置按钮的样式和文字 |
183 | - $chosed = $('.chose-items').find('.chosed'); | ||
184 | - if (2 === $chosed.closest('.zero-stock').length) { | ||
185 | - $('#chose-btn-sure').css('background-color', '#c0c0c0'); | ||
186 | - $('#chose-btn-sure').html('已售罄'); | ||
187 | - } else { | ||
188 | - $('#chose-btn-sure').css('background-color', '#eb0313'); | ||
189 | - $('#chose-btn-sure').html('确定'); | ||
190 | - } | ||
191 | - | ||
192 | - /**if ($chosed.length === 0) { | ||
193 | - $this.closest('ul>li').each(function() { | ||
194 | - $(this).removeClass('zero-stock'); | ||
195 | - if ('0' === $(this).data('num')) { | ||
196 | - $(this).addClass('zero-stock'); | ||
197 | - } | ||
198 | - }); | ||
199 | - | ||
200 | - $siblingBlock.find('ul>li').each(function() { | ||
201 | - $(this).removeClass('zero-stock'); | ||
202 | - if ('0' === $(this).data('num')) { | ||
203 | - $(this).addClass('zero-stock'); | ||
204 | - } | ||
205 | - }); | ||
206 | - } else if ($chosed.length === 1 && $this.hasClass('chosed')) { | ||
207 | - $sizeList.addClass('hide'); | ||
208 | - | ||
209 | - //切换尺码信息 | ||
210 | - $sizeList.each(function() { | ||
211 | - colorIndex = $(this).data('colorid'); | ||
212 | - if (colorIndex === $this.data('id')) { | ||
213 | - $(this).removeClass('hide'); | ||
214 | - } | ||
215 | - }); | ||
216 | - | ||
217 | - numArray = ($chosed.data('numstr') + '').split('/'); | ||
218 | - $siblingBlock.find('.block').removeClass('zero-stock'); | ||
219 | - for (i = 0; i < numArray.length; i++) { | ||
220 | - if ('0' === numArray[i]) { | ||
221 | - $siblingBlock.find('.block').eq(i).addClass('zero-stock'); | ||
222 | - } | ||
223 | - } | ||
224 | - } else if ($chosed.length === 1 && !$this.hasClass('chosed')) { | ||
225 | - $('#chose-btn-sure').css('background-color', '#eb0313'); | ||
226 | - $('#chose-btn-sure').html('确定'); | ||
227 | - | ||
228 | - $siblingBlock.find('ul>li').each(function() { | ||
229 | - $(this).removeClass('zero-stock'); | ||
230 | - if ('0' === $(this).data('num')) { | ||
231 | - $(this).addClass('zero-stock'); | ||
232 | - } | ||
233 | - }); | ||
234 | - $that.find('.num .left-num').html(''); | ||
235 | - } else if ($chosed.length === 2) { | ||
236 | - $siblingBlock.find('.block').removeClass('zero-stock'); | ||
237 | - for (i = 0; i < currentNumArray.length; i++) { | ||
238 | - if ('0' === currentNumArray[i]) { | ||
239 | - $siblingBlock.find('.block').eq(i).addClass('zero-stock'); | ||
240 | - } | ||
241 | - } | ||
242 | - numArray = ($siblingBlock.find('.chosed').data('numstr') + '').split('/'); | ||
243 | - $that.find('.num .left-num').html('剩余' + numArray[index] + '件'); | ||
244 | - if (2 === $chosed.closest('.zero-stock').length) { | ||
245 | - $('#chose-btn-sure').css('background-color', '#c0c0c0'); | ||
246 | - $('#chose-btn-sure').html('已售罄'); | ||
247 | - } else { | ||
248 | - $('#chose-btn-sure').css('background-color', '#eb0313'); | ||
249 | - $('#chose-btn-sure').html('确定'); | ||
250 | - } | ||
251 | - }**/ | 193 | + updateConformButtonClassAndText(); |
252 | 194 | ||
195 | + // 修改颜色时修改商品图片 | ||
196 | + changeGoodImgWhenClickColor(); | ||
253 | }); | 197 | }); |
254 | 198 | ||
255 | -$('.size-list').on('touchstart', '.block', function(e) { | 199 | +$yohoPage.on('touchstart', '.size-list .block', function(e) { |
256 | var $this = $(this), | 200 | var $this = $(this), |
257 | - $that = $(e.target).closest('.chose-items'), | ||
258 | index, | 201 | index, |
259 | - $colorChosed, | ||
260 | curGoodNum; | 202 | curGoodNum; |
261 | 203 | ||
262 | var $siblingBlock = $this.closest('.block-list').siblings(':first'); | 204 | var $siblingBlock = $this.closest('.block-list').siblings(':first'); |
263 | 205 | ||
264 | $this.siblings('.chosed').removeClass('chosed'); | 206 | $this.siblings('.chosed').removeClass('chosed'); |
265 | index = $this.index(); | 207 | index = $this.index(); |
266 | - | ||
267 | - $colorChosed = $siblingBlock.find('.chosed'); | ||
268 | $curSizeRow = $sizeRowList.eq(index); | 208 | $curSizeRow = $sizeRowList.eq(index); |
269 | 209 | ||
270 | // 当前尺码已经是选中状态,再点击时 | 210 | // 当前尺码已经是选中状态,再点击时 |
271 | if ($this.hasClass('chosed')) { | 211 | if ($this.hasClass('chosed')) { |
272 | 212 | ||
273 | //尺码原来已经是勾选时,要清空剩余件数的提示 | 213 | //尺码原来已经是勾选时,要清空剩余件数的提示 |
274 | - $that.find('.num .left-num').html(''); | 214 | + $allChoseItems.find('.num .left-num').html(''); |
275 | $('#left-num').val(0); | 215 | $('#left-num').val(0); |
276 | hasChooseSize = false; | 216 | hasChooseSize = false; |
277 | 217 | ||
278 | - // 去掉已经选中颜色的 数量为0的样式 | ||
279 | - if ($colorChosed.length > 0) { | ||
280 | - $colorChosed.removeClass('zero-stock').addClass('zero-stock'); | ||
281 | - } | ||
282 | - | ||
283 | // 当前尺码不是选中状态,选中时 | 218 | // 当前尺码不是选中状态,选中时 |
284 | } else { | 219 | } else { |
285 | hasChooseSize = true; | 220 | hasChooseSize = true; |
@@ -291,15 +226,15 @@ $('.size-list').on('touchstart', '.block', function(e) { | @@ -291,15 +226,15 @@ $('.size-list').on('touchstart', '.block', function(e) { | ||
291 | $curSizeBlock.removeClass('chosed'); | 226 | $curSizeBlock.removeClass('chosed'); |
292 | } | 227 | } |
293 | 228 | ||
294 | - // 如果当前有尺码被选中,且数量等于0,则颜色块添加数量为0的样式, 否则显示剩余件数 | 229 | + // 如果当前有尺码被选中,且数量等于0, 否则显示剩余件数 |
295 | if (curGoodNum > 0 && hasChooseColor) { | 230 | if (curGoodNum > 0 && hasChooseColor) { |
296 | - $that.find('.num .left-num').html('剩余' + curGoodNum + '件'); | 231 | + $allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件'); |
297 | $('#left-num').val(curGoodNum); | 232 | $('#left-num').val(curGoodNum); |
298 | } else { | 233 | } else { |
299 | - $colorChosed.removeClass('zero-stock').addClass('zero-stock'); | ||
300 | - $that.find('.num .left-num').html(''); | 234 | + $allChoseItems.find('.num .left-num').html(''); |
301 | $('#left-num').val(0); | 235 | $('#left-num').val(0); |
302 | } | 236 | } |
237 | + | ||
303 | } | 238 | } |
304 | 239 | ||
305 | $this.toggleClass('chosed'); | 240 | $this.toggleClass('chosed'); |
@@ -307,83 +242,15 @@ $('.size-list').on('touchstart', '.block', function(e) { | @@ -307,83 +242,15 @@ $('.size-list').on('touchstart', '.block', function(e) { | ||
307 | $curSizeBlock = $this; | 242 | $curSizeBlock = $this; |
308 | 243 | ||
309 | // 设置按钮的样式和文字 | 244 | // 设置按钮的样式和文字 |
310 | - $chosed = $('.chose-items').find('.chosed'); | ||
311 | - if (2 === $chosed.closest('.zero-stock').length) { | ||
312 | - $('#chose-btn-sure').css('background-color', '#c0c0c0'); | ||
313 | - $('#chose-btn-sure').html('已售罄'); | ||
314 | - } else { | ||
315 | - $('#chose-btn-sure').css('background-color', '#eb0313'); | ||
316 | - $('#chose-btn-sure').html('确定'); | ||
317 | - } | 245 | + updateConformButtonClassAndText(); |
318 | 246 | ||
319 | - /**if ($chosed.length === 0) { | ||
320 | - $this.closest('ul>li').each(function() { | ||
321 | - $(this).removeClass('zero-stock'); | ||
322 | - if ('0' === $(this).data('num')) { | ||
323 | - $(this).addClass('zero-stock'); | ||
324 | - } | ||
325 | - }); | ||
326 | - | ||
327 | - $siblingBlock.find('ul>li').each(function() { | ||
328 | - $(this).removeClass('zero-stock'); | ||
329 | - if ('0' === $(this).data('num')) { | ||
330 | - $(this).addClass('zero-stock'); | ||
331 | - } | ||
332 | - }); | ||
333 | - } else if ($chosed.length === 1 && $this.hasClass('chosed')) { | ||
334 | - if ($this.closest('.block-list').hasClass('color-list')) { | ||
335 | - | ||
336 | - $sizeList.addClass('hide'); | ||
337 | - | ||
338 | - //切换尺码信息 | ||
339 | - $sizeList.each(function() { | ||
340 | - colorIndex = $(this).data('colorid'); | ||
341 | - if (colorIndex === $this.data('id')) { | ||
342 | - $(this).removeClass('hide'); | ||
343 | - } | ||
344 | - }); | ||
345 | - } | ||
346 | - | ||
347 | - numArray = ($chosed.data('numstr') + '').split('/'); | ||
348 | - $siblingBlock.find('.block').removeClass('zero-stock'); | ||
349 | - for (i = 0; i < numArray.length; i++) { | ||
350 | - if ('0' === numArray[i]) { | ||
351 | - $siblingBlock.find('.block').eq(i).addClass('zero-stock'); | ||
352 | - } | ||
353 | - } | ||
354 | - } else if ($chosed.length === 1 && !$this.hasClass('chosed')) { | ||
355 | - $('#chose-btn-sure').css('background-color', '#eb0313'); | ||
356 | - $('#chose-btn-sure').html('确定'); | ||
357 | - | ||
358 | - $siblingBlock.find('ul>li').each(function() { | ||
359 | - $(this).removeClass('zero-stock'); | ||
360 | - if ('0' === $(this).data('num')) { | ||
361 | - $(this).addClass('zero-stock'); | ||
362 | - } | ||
363 | - }); | ||
364 | - $that.find('.num .left-num').html(''); | ||
365 | - } else if ($chosed.length === 2) { | ||
366 | - $siblingBlock.find('.block').removeClass('zero-stock'); | ||
367 | - for (i = 0; i < currentNumArray.length; i++) { | ||
368 | - if ('0' === currentNumArray[i]) { | ||
369 | - $siblingBlock.find('.block').eq(i).addClass('zero-stock'); | ||
370 | - } | ||
371 | - } | ||
372 | - numArray = ($siblingBlock.find('.chosed').data('numstr') + '').split('/'); | ||
373 | - $that.find('.num .left-num').html('剩余' + numArray[index] + '件'); | ||
374 | - if (2 === $chosed.closest('.zero-stock').length) { | ||
375 | - $('#chose-btn-sure').css('background-color', '#c0c0c0'); | ||
376 | - $('#chose-btn-sure').html('已售罄'); | ||
377 | - } else { | ||
378 | - $('#chose-btn-sure').css('background-color', '#eb0313'); | ||
379 | - $('#chose-btn-sure').html('确定'); | ||
380 | - } | ||
381 | - }**/ | 247 | + // 重置颜色块的样式 |
248 | + resetColorZeroStock($siblingBlock); | ||
382 | 249 | ||
383 | }); | 250 | }); |
384 | 251 | ||
385 | -$('.btn-minus').on('touchstart', function() { | ||
386 | - var num = $num.val(); | 252 | +$yohoPage.on('touchstart', '.btn-minus', function() { |
253 | + var num = parseInt($num.val(), 10); | ||
387 | 254 | ||
388 | leftNum = $('#left-num').val(); | 255 | leftNum = $('#left-num').val(); |
389 | 256 | ||
@@ -396,10 +263,8 @@ $('.btn-minus').on('touchstart', function() { | @@ -396,10 +263,8 @@ $('.btn-minus').on('touchstart', function() { | ||
396 | } | 263 | } |
397 | 264 | ||
398 | $num.val(num - 1); | 265 | $num.val(num - 1); |
399 | -}); | ||
400 | - | ||
401 | -$('.btn-plus').on('touchstart', function() { | ||
402 | - var num = $num.val(); | 266 | +}).on('touchstart', '.btn-plus', function() { |
267 | + var num = parseInt($num.val(), 10); | ||
403 | 268 | ||
404 | leftNum = $('#left-num').val(); | 269 | leftNum = $('#left-num').val(); |
405 | 270 | ||
@@ -414,9 +279,7 @@ $('.btn-plus').on('touchstart', function() { | @@ -414,9 +279,7 @@ $('.btn-plus').on('touchstart', function() { | ||
414 | 279 | ||
415 | //TODO:库存数验证 | 280 | //TODO:库存数验证 |
416 | $num.val(num + 1); | 281 | $num.val(num + 1); |
417 | -}); | ||
418 | - | ||
419 | -$('#chose-btn-sure').on('touchstart', function() { | 282 | +}).on('touchstart', '#chose-btn-sure', function() { |
420 | 283 | ||
421 | var productSku, | 284 | var productSku, |
422 | buyNumber = $('#good-num').val() - 0, | 285 | buyNumber = $('#good-num').val() - 0, |
@@ -426,10 +289,12 @@ $('#chose-btn-sure').on('touchstart', function() { | @@ -426,10 +289,12 @@ $('#chose-btn-sure').on('touchstart', function() { | ||
426 | numInCart = $('.num-tag').html() - 0, | 289 | numInCart = $('.num-tag').html() - 0, |
427 | num = $num.val(); | 290 | num = $num.val(); |
428 | 291 | ||
292 | + //颜色尺码没有选择 | ||
429 | if (!checkColorSizeNum()) { | 293 | if (!checkColorSizeNum()) { |
430 | return; | 294 | return; |
431 | } | 295 | } |
432 | 296 | ||
297 | + //TODO status change | ||
433 | if ($('#chose-btn-sure').html() === '已售罄') { | 298 | if ($('#chose-btn-sure').html() === '已售罄') { |
434 | return; | 299 | return; |
435 | } | 300 | } |
@@ -459,15 +324,19 @@ $('#chose-btn-sure').on('touchstart', function() { | @@ -459,15 +324,19 @@ $('#chose-btn-sure').on('touchstart', function() { | ||
459 | productSku: productSku, | 324 | productSku: productSku, |
460 | buyNumber: buyNumber, | 325 | buyNumber: buyNumber, |
461 | promotionId: promotionId, | 326 | promotionId: promotionId, |
462 | - isEdit: isEdit | 327 | + isEdit: isEdit, |
328 | + cartType: queryString.cartType | ||
463 | } | 329 | } |
464 | }).done(function(res) { | 330 | }).done(function(res) { |
465 | loading.hideLoadingMask(); | 331 | loading.hideLoadingMask(); |
466 | if (res.code === 200) { | 332 | if (res.code === 200) { |
467 | - $('.num-tag').html(numInCart + buyNumber); | ||
468 | - $('.num-tag').removeClass('hide'); | 333 | + $('.num-tag').html(numInCart + buyNumber).removeClass('hide'); |
469 | confirming = false; | 334 | confirming = false; |
470 | hide(); | 335 | hide(); |
336 | + | ||
337 | + if (cbFn) { | ||
338 | + cbFn(); | ||
339 | + } | ||
471 | } | 340 | } |
472 | if (res.message) { | 341 | if (res.message) { |
473 | tip.show(res.message); | 342 | tip.show(res.message); |
@@ -10,7 +10,8 @@ var $ = require('jquery'), | @@ -10,7 +10,8 @@ var $ = require('jquery'), | ||
10 | loading = require('../plugin/loading'), | 10 | loading = require('../plugin/loading'), |
11 | chosePanel = require('./chose-panel'); | 11 | chosePanel = require('./chose-panel'); |
12 | 12 | ||
13 | -var $page = $('.gift-advance-page'); | 13 | +var $page = $('.gift-advance-page'), |
14 | + queryString = $.queryString(); | ||
14 | 15 | ||
15 | lazyLoad($('.lazy')); | 16 | lazyLoad($('.lazy')); |
16 | 17 | ||
@@ -19,19 +20,15 @@ function getProductInfo(skn, promotionId) { | @@ -19,19 +20,15 @@ function getProductInfo(skn, promotionId) { | ||
19 | $.get('/cart/index/giftinfo', { | 20 | $.get('/cart/index/giftinfo', { |
20 | skn: skn, | 21 | skn: skn, |
21 | promotionId: promotionId | 22 | promotionId: promotionId |
22 | - }).then(function(res) { | ||
23 | - if (!res) { | 23 | + }).then(function(html) { |
24 | + if (!html) { | ||
24 | tip.show('网络错误'); | 25 | tip.show('网络错误'); |
25 | return; | 26 | return; |
26 | } | 27 | } |
27 | - if (res.code === 200) { | ||
28 | - chosePanel.show({ | ||
29 | - cartInfo: res.data | 28 | + chosePanel.show(html, function() { |
29 | + window.location.href = '/cart/index/index?cartType=' + queryString.cartType; | ||
30 | }); | 30 | }); |
31 | - } else { | ||
32 | - tip.show(res.message || '网络错误'); | ||
33 | - } | ||
34 | - }).fail(function() { | 31 | + }, function() { |
35 | tip.show('网络错误'); | 32 | tip.show('网络错误'); |
36 | }).always(function() { | 33 | }).always(function() { |
37 | loading.hideLoadingMask(); | 34 | loading.hideLoadingMask(); |
@@ -10,7 +10,8 @@ var $ = require('jquery'), | @@ -10,7 +10,8 @@ var $ = require('jquery'), | ||
10 | lazyLoad = require('yoho.lazyload'); | 10 | lazyLoad = require('yoho.lazyload'); |
11 | 11 | ||
12 | var dialog = require('../me/dialog'), | 12 | var dialog = require('../me/dialog'), |
13 | - tip = require('../plugin/tip'); | 13 | + tip = require('../plugin/tip'), |
14 | + orderInfo = require('./order-info').orderInfo; | ||
14 | 15 | ||
15 | var $selectAllBtn = $('.balance .checkbox'), | 16 | var $selectAllBtn = $('.balance .checkbox'), |
16 | cartType = $('#cartType').val(), | 17 | cartType = $('#cartType').val(), |
@@ -106,13 +107,14 @@ $('.cart-goods').on('touchstart', '.checkbox', function() { | @@ -106,13 +107,14 @@ $('.cart-goods').on('touchstart', '.checkbox', function() { | ||
106 | autoHide: true, | 107 | autoHide: true, |
107 | fast: true | 108 | fast: true |
108 | }); | 109 | }); |
110 | + orderInfo('couponCode', null); | ||
111 | + orderInfo('couponName', null); | ||
109 | history.go(0); | 112 | history.go(0); |
113 | + } else { | ||
114 | + tip.show(data.message); | ||
110 | } | 115 | } |
111 | }, function() { | 116 | }, function() { |
112 | - dialog.showDialog({ | ||
113 | - autoHide: true, | ||
114 | - dialogText: '网络异常' | ||
115 | - }); | 117 | + tip.show('网络异常'); |
116 | }); | 118 | }); |
117 | }); | 119 | }); |
118 | 120 | ||
@@ -224,5 +226,3 @@ $selectAllBtn.on('touchend', function() { | @@ -224,5 +226,3 @@ $selectAllBtn.on('touchend', function() { | ||
224 | $('.down').on('touchend', function() { | 226 | $('.down').on('touchend', function() { |
225 | chosePanel.show(); | 227 | chosePanel.show(); |
226 | }); | 228 | }); |
227 | - | ||
228 | - |
@@ -28,11 +28,13 @@ if (window.getUid() !== orderInfo('uid')) { | @@ -28,11 +28,13 @@ if (window.getUid() !== orderInfo('uid')) { | ||
28 | order.init(); | 28 | order.init(); |
29 | } | 29 | } |
30 | 30 | ||
31 | -if ($couponUse.data('value') !== orderInfo('couponValue')) { | 31 | +if ($couponUse.data('name') !== orderInfo('couponName')) { |
32 | orderInfo('couponCode', null); | 32 | orderInfo('couponCode', null); |
33 | - orderInfo('couponValue', null); | 33 | + orderInfo('couponName', null); |
34 | } | 34 | } |
35 | 35 | ||
36 | +orderInfo('cartType', queryString.cartType || queryString.carttype || 'ordinary'); | ||
37 | + | ||
36 | function dispacthTapEvt(e) { | 38 | function dispacthTapEvt(e) { |
37 | var $cur = $(e.target).closest('li'); | 39 | var $cur = $(e.target).closest('li'); |
38 | 40 | ||
@@ -78,7 +80,7 @@ function orderCompute() { | @@ -78,7 +80,7 @@ function orderCompute() { | ||
78 | method: 'POST', | 80 | method: 'POST', |
79 | url: '/cart/index/orderCompute', | 81 | url: '/cart/index/orderCompute', |
80 | data: { | 82 | data: { |
81 | - cartType: orderInfo('cartType'), | 83 | + cartType: orderInfo('cartType') || 'ordinary', |
82 | deliveryId: orderInfo('deliveryId'), | 84 | deliveryId: orderInfo('deliveryId'), |
83 | paymentTypeId: orderInfo('paymentTypeId'), | 85 | paymentTypeId: orderInfo('paymentTypeId'), |
84 | couponCode: orderInfo('couponCode'), | 86 | couponCode: orderInfo('couponCode'), |
@@ -89,22 +91,19 @@ function orderCompute() { | @@ -89,22 +91,19 @@ function orderCompute() { | ||
89 | 91 | ||
90 | if (!res) { | 92 | if (!res) { |
91 | tip.show('网络出错'); | 93 | tip.show('网络出错'); |
94 | + window.location.reload(); | ||
92 | } else { | 95 | } else { |
93 | - if (res.order_amount) { | 96 | + /*if (res.order_amount) { |
94 | res.order_amount = (+res.order_amount).toFixed(2); | 97 | res.order_amount = (+res.order_amount).toFixed(2); |
95 | } | 98 | } |
96 | if (res.discount_amount) { | 99 | if (res.discount_amount) { |
97 | res.discount_amount = (+res.discount_amount).toFixed(2); | 100 | res.discount_amount = (+res.discount_amount).toFixed(2); |
98 | - } | 101 | + }*/ |
99 | if (res.last_order_amount) { | 102 | if (res.last_order_amount) { |
100 | res.last_order_amount = (+res.last_order_amount).toFixed(2); | 103 | res.last_order_amount = (+res.last_order_amount).toFixed(2); |
101 | } | 104 | } |
102 | priceHtml = priceTmpl({ | 105 | priceHtml = priceTmpl({ |
103 | - sumPrice: res.order_amount, | ||
104 | - salePrice: res.discount_amount, | ||
105 | - freight: res.promotion_formula_list[1].promotion_amount, | ||
106 | - couponPrice: res.coupon_amount, | ||
107 | - yohoCoin: res.use_yoho_coin, | 106 | + cartPayData: res.promotion_formula_list, |
108 | price: res.last_order_amount | 107 | price: res.last_order_amount |
109 | }); | 108 | }); |
110 | 109 | ||
@@ -112,6 +111,7 @@ function orderCompute() { | @@ -112,6 +111,7 @@ function orderCompute() { | ||
112 | } | 111 | } |
113 | }).fail(function() { | 112 | }).fail(function() { |
114 | tip.show('网络出错'); | 113 | tip.show('网络出错'); |
114 | + window.location.reload(); | ||
115 | }); | 115 | }); |
116 | } | 116 | } |
117 | 117 | ||
@@ -141,11 +141,12 @@ function submitOrder() { | @@ -141,11 +141,12 @@ function submitOrder() { | ||
141 | url: '/cart/index/orderSub', | 141 | url: '/cart/index/orderSub', |
142 | data: { | 142 | data: { |
143 | addressId: orderInfo('addressId'), | 143 | addressId: orderInfo('addressId'), |
144 | - cartType: queryString.cartType || queryString.carttype || 'ordinary', | 144 | + cartType: orderInfo('cartType') || 'ordinary', |
145 | deliveryId: orderInfo('deliveryId'), | 145 | deliveryId: orderInfo('deliveryId'), |
146 | deliveryTimeId: orderInfo('deliveryTimeId'), | 146 | deliveryTimeId: orderInfo('deliveryTimeId'), |
147 | - invoiceText: invoiceText, | ||
148 | - invoiceType: $invoice.find('.invoice-type').val() || orderInfo('invoiceType'), | 147 | + invoiceText: orderInfo('invoice') ? invoiceText : null, |
148 | + invoiceType: orderInfo('invoice') ? ($invoice.find('.invoice-type').val() || | ||
149 | + orderInfo('invoiceType')) : null, | ||
149 | msg: msg, | 150 | msg: msg, |
150 | paymentTypeId: orderInfo('paymentTypeId'), | 151 | paymentTypeId: orderInfo('paymentTypeId'), |
151 | paymentType: orderInfo('paymentType'), //支付方式 | 152 | paymentType: orderInfo('paymentType'), //支付方式 |
@@ -15,11 +15,12 @@ function init() { | @@ -15,11 +15,12 @@ function init() { | ||
15 | yohoCoin: $('.coin').data('yoho-coin') || 0, | 15 | yohoCoin: $('.coin').data('yoho-coin') || 0, |
16 | addressId: null, | 16 | addressId: null, |
17 | couponCode: null, | 17 | couponCode: null, |
18 | - couponValue: null, | 18 | + couponName: null, |
19 | invoice: null, | 19 | invoice: null, |
20 | invoiceText: null, | 20 | invoiceText: null, |
21 | invoiceType: null, | 21 | invoiceType: null, |
22 | - msg: null | 22 | + msg: null, |
23 | + cartType: 'ordinary' | ||
23 | }; | 24 | }; |
24 | window.setCookie('order-info', JSON.stringify(info)); | 25 | window.setCookie('order-info', JSON.stringify(info)); |
25 | } | 26 | } |
@@ -7,9 +7,20 @@ | @@ -7,9 +7,20 @@ | ||
7 | var $ = require('jquery'), | 7 | var $ = require('jquery'), |
8 | orderInfo = require('./order-info').orderInfo; | 8 | orderInfo = require('./order-info').orderInfo; |
9 | 9 | ||
10 | +var $confim = $('.confim-mask'), | ||
11 | + deleteId; | ||
12 | + | ||
10 | $('.address-item').on('touchend', function() { | 13 | $('.address-item').on('touchend', function() { |
11 | orderInfo('addressId', $(this).data('address-id')); | 14 | orderInfo('addressId', $(this).data('address-id')); |
12 | }).on('touchend', '.edit', function() { | 15 | }).on('touchend', '.edit', function() { |
13 | window.location.href = $(this).data('href'); | 16 | window.location.href = $(this).data('href'); |
14 | return false; | 17 | return false; |
18 | +}).on('touchend', '.del', function() { | ||
19 | + deleteId = $(this).data('address-id'); | ||
20 | +}); | ||
21 | + | ||
22 | +$confim.on('touchend', '.confim', function() { | ||
23 | + if (orderInfo('addressId') === deleteId) { | ||
24 | + orderInfo('addressId', null); | ||
25 | + } | ||
15 | }); | 26 | }); |
@@ -37,7 +37,7 @@ $newCoupon.on('submit', function() { | @@ -37,7 +37,7 @@ $newCoupon.on('submit', function() { | ||
37 | if (res.code === 200) { | 37 | if (res.code === 200) { |
38 | tip.show('优惠券可用'); | 38 | tip.show('优惠券可用'); |
39 | orderInfo('couponCode', res.data.coupon_code); | 39 | orderInfo('couponCode', res.data.coupon_code); |
40 | - orderInfo('couponValue', res.data.coupon_value); | 40 | + orderInfo('couponName', res.data.coupon_title); |
41 | window.location.href = '/cart/index/orderEnsure'; | 41 | window.location.href = '/cart/index/orderEnsure'; |
42 | } else { | 42 | } else { |
43 | tip.show(res.message || '网络错误'); | 43 | tip.show(res.message || '网络错误'); |
@@ -52,12 +52,12 @@ $('#coupon-list').on('touchend', '.employ-main', function() { | @@ -52,12 +52,12 @@ $('#coupon-list').on('touchend', '.employ-main', function() { | ||
52 | var $this = $(this); | 52 | var $this = $(this); |
53 | 53 | ||
54 | orderInfo('couponCode', $this.data('coupon-code')); | 54 | orderInfo('couponCode', $this.data('coupon-code')); |
55 | - orderInfo('couponValue', $this.data('coupon-value')); | 55 | + orderInfo('couponName', $this.data('coupon-name')); |
56 | }); | 56 | }); |
57 | 57 | ||
58 | $('body').on('touchend', '.not-use', function() { | 58 | $('body').on('touchend', '.not-use', function() { |
59 | orderInfo('couponCode', null); | 59 | orderInfo('couponCode', null); |
60 | - orderInfo('couponValue', null); | 60 | + orderInfo('couponName', null); |
61 | }); | 61 | }); |
62 | 62 | ||
63 | 63 |
@@ -20,7 +20,15 @@ var api = require('../api'), | @@ -20,7 +20,15 @@ var api = require('../api'), | ||
20 | var trim = $.trim; | 20 | var trim = $.trim; |
21 | var showErrTip = tip.show; | 21 | var showErrTip = tip.show; |
22 | 22 | ||
23 | +var requesting = false; | ||
24 | + | ||
23 | function nextStep(url, mobileNo, areaCode) { | 25 | function nextStep(url, mobileNo, areaCode) { |
26 | + if (requesting) { | ||
27 | + return false; | ||
28 | + } | ||
29 | + | ||
30 | + requesting = true; | ||
31 | + | ||
24 | $.ajax({ | 32 | $.ajax({ |
25 | type: 'POST', | 33 | type: 'POST', |
26 | url: '/passport/bind/sendBindMsg', | 34 | url: '/passport/bind/sendBindMsg', |
@@ -31,9 +39,13 @@ function nextStep(url, mobileNo, areaCode) { | @@ -31,9 +39,13 @@ function nextStep(url, mobileNo, areaCode) { | ||
31 | success: function(res) { | 39 | success: function(res) { |
32 | console.log(res.data); | 40 | console.log(res.data); |
33 | location.href = url; | 41 | location.href = url; |
42 | + | ||
43 | + requesting = false; | ||
34 | }, | 44 | }, |
35 | error: function() { | 45 | error: function() { |
36 | tip.show('出错了,请重试!'); | 46 | tip.show('出错了,请重试!'); |
47 | + | ||
48 | + requesting = false; | ||
37 | } | 49 | } |
38 | }); | 50 | }); |
39 | } | 51 | } |
@@ -65,7 +65,7 @@ if (navtabHammer) { | @@ -65,7 +65,7 @@ if (navtabHammer) { | ||
65 | 65 | ||
66 | if (gotoConsultHammer) { | 66 | if (gotoConsultHammer) { |
67 | gotoConsultHammer.on('tap', function() { | 67 | gotoConsultHammer.on('tap', function() { |
68 | - location.href = $(gotoConsultEle).data('href'); | 68 | + location.href = $(gotoConsultEle).find('a').attr('href'); |
69 | }); | 69 | }); |
70 | } | 70 | } |
71 | 71 |
@@ -36,6 +36,37 @@ | @@ -36,6 +36,37 @@ | ||
36 | li:first-child span { | 36 | li:first-child span { |
37 | border-right: 1px solid #e0e0e0; | 37 | border-right: 1px solid #e0e0e0; |
38 | } | 38 | } |
39 | + | ||
40 | + li:last-child { | ||
41 | + position: relative; | ||
42 | + } | ||
43 | + | ||
44 | + .presell-tip { | ||
45 | + position: absolute; | ||
46 | + z-index: 1; | ||
47 | + left: -2rem; | ||
48 | + top: 1.75rem; | ||
49 | + } | ||
50 | + | ||
51 | + .triangle { | ||
52 | + width: 0; | ||
53 | + height: 0; | ||
54 | + border-left: 8px solid transparent; | ||
55 | + border-right: 8px solid transparent; | ||
56 | + border-bottom: 12px solid #000; | ||
57 | + margin-left: 6rem; | ||
58 | + } | ||
59 | + | ||
60 | + .pt-content { | ||
61 | + position: relative; | ||
62 | + padding: 10px; | ||
63 | + background: #000; | ||
64 | + color: #fff; | ||
65 | + font-size: 20px; | ||
66 | + @include border-radius(5px); | ||
67 | + text-align: center; | ||
68 | + width: 7rem; | ||
69 | + } | ||
39 | } | 70 | } |
40 | 71 | ||
41 | .login-info { | 72 | .login-info { |
@@ -195,8 +226,6 @@ | @@ -195,8 +226,6 @@ | ||
195 | } | 226 | } |
196 | } | 227 | } |
197 | 228 | ||
198 | -} | ||
199 | -.shopping-cart-zero{ | ||
200 | .cart-zero{ | 229 | .cart-zero{ |
201 | width: 100%; | 230 | width: 100%; |
202 | height: auto; | 231 | height: auto; |
@@ -118,14 +118,14 @@ | @@ -118,14 +118,14 @@ | ||
118 | margin-left: 20rem / $pxConvertRem; | 118 | margin-left: 20rem / $pxConvertRem; |
119 | } | 119 | } |
120 | 120 | ||
121 | - .coupon-use, | ||
122 | - .coin-check { | 121 | + .coupon-use { |
123 | float: right; | 122 | float: right; |
124 | color: #999; | 123 | color: #999; |
125 | - | ||
126 | - &.used { | ||
127 | - color: #f00; | ||
128 | - } | 124 | + text-align: right; |
125 | + width: 360rem / $pxConvertRem; | ||
126 | + white-space: nowrap; | ||
127 | + text-overflow: ellipsis; | ||
128 | + overflow: hidden; | ||
129 | 129 | ||
130 | .iconfont { | 130 | .iconfont { |
131 | color: #999; | 131 | color: #999; |
@@ -141,6 +141,10 @@ | @@ -141,6 +141,10 @@ | ||
141 | color: #000; | 141 | color: #000; |
142 | } | 142 | } |
143 | 143 | ||
144 | + &.used { | ||
145 | + color: #f00; | ||
146 | + } | ||
147 | + | ||
144 | em { | 148 | em { |
145 | color: #f00; | 149 | color: #f00; |
146 | } | 150 | } |
@@ -161,11 +161,18 @@ | @@ -161,11 +161,18 @@ | ||
161 | color: #fff; | 161 | color: #fff; |
162 | text-align: center; | 162 | text-align: center; |
163 | font-size: 12px; | 163 | font-size: 12px; |
164 | + | ||
165 | + &:before { | ||
166 | + display: block; | ||
167 | + line-height: 1; | ||
168 | + @include transform(scale(0.833)); | ||
169 | + } | ||
164 | } | 170 | } |
165 | 171 | ||
166 | .gift-tag { | 172 | .gift-tag { |
167 | height: 25rem / $pxConvertRem; | 173 | height: 25rem / $pxConvertRem; |
168 | background: #a1ce4e; | 174 | background: #a1ce4e; |
175 | + | ||
169 | &:before { | 176 | &:before { |
170 | content: '赠品'; | 177 | content: '赠品'; |
171 | } | 178 | } |
@@ -174,6 +181,7 @@ | @@ -174,6 +181,7 @@ | ||
174 | .advance-buy-tag { | 181 | .advance-buy-tag { |
175 | height: 25rem / $pxConvertRem; | 182 | height: 25rem / $pxConvertRem; |
176 | background: #eb76aa; | 183 | background: #eb76aa; |
184 | + | ||
177 | &:before { | 185 | &:before { |
178 | content: '加价购'; | 186 | content: '加价购'; |
179 | } | 187 | } |
@@ -228,4 +236,4 @@ | @@ -228,4 +236,4 @@ | ||
228 | .appear-date { | 236 | .appear-date { |
229 | color: #f00; | 237 | color: #f00; |
230 | } | 238 | } |
231 | -} | ||
239 | +} |
1 | +{{> cart/chose-panel}} |
1 | {{> layout/header}} | 1 | {{> layout/header}} |
2 | - {{# shoppingCart}} | ||
3 | - {{#if isEmptyCart}} | ||
4 | - <div class="shopping-cart-zero yoho-page"> | ||
5 | - <div class="cart-zero"> | ||
6 | - <i class="iconfont"></i> | ||
7 | - <p>您的购物车暂无商品</p> | ||
8 | - <a href="/product/new">随便逛逛</a> | ||
9 | - </div> | ||
10 | - {{> product/recommend-for-you}} | ||
11 | - </div> | ||
12 | - {{^}} | ||
13 | - <div id="mainCart" class="shopping-cart-page yoho-page"> | ||
14 | - | ||
15 | - | ||
16 | - | ||
17 | - {{#if showLoginInfo}} | 2 | +<div id="mainCart" class="shopping-cart-page yoho-page"> |
3 | + {{# shoppingCart}} | ||
4 | + {{#if showLoginInfo}} | ||
18 | <p class="login-info"> | 5 | <p class="login-info"> |
19 | <span class="iconfont"></span> | 6 | <span class="iconfont"></span> |
20 | 请您先 | 7 | 请您先 |
21 | <a class="btn btn-login" href="{{signurl}}">登录</a> | 8 | <a class="btn btn-login" href="{{signurl}}">登录</a> |
22 | 可以同步电脑和手机中的商品 | 9 | 可以同步电脑和手机中的商品 |
23 | </p> | 10 | </p> |
24 | - {{^}} | ||
25 | - {{#if cartNav}} | 11 | + {{/if}} |
12 | + {{#if isEmptyCart}} | ||
13 | + <div class="cart-zero"> | ||
14 | + <i class="iconfont"></i> | ||
15 | + <p>您的购物车暂无商品</p> | ||
16 | + <a href="/product/new">随便逛逛</a> | ||
17 | + </div> | ||
18 | + {{> product/recommend-for-you}} | ||
19 | + {{^}} | ||
20 | + {{#if cartNav}} | ||
26 | <ul class="cart-nav clearfix"> | 21 | <ul class="cart-nav clearfix"> |
27 | <li class="active"> | 22 | <li class="active"> |
28 | <span> | 23 | <span> |
@@ -33,33 +28,33 @@ | @@ -33,33 +28,33 @@ | ||
33 | <span> | 28 | <span> |
34 | 预售商品({{presellGoodsCount}}) | 29 | 预售商品({{presellGoodsCount}}) |
35 | </span> | 30 | </span> |
31 | + <div id="presell-tip" class="presell-tip"> | ||
32 | + <div class="triangle"></div> | ||
33 | + <p class="pt-content">预售商品点这里结算哦~</p> | ||
34 | + </div> | ||
36 | </li> | 35 | </li> |
37 | </ul> | 36 | </ul> |
38 | - {{/if}} | ||
39 | {{/if}} | 37 | {{/if}} |
40 | 38 | ||
41 | {{# commonCart}} | 39 | {{# commonCart}} |
42 | - <div class="cart-content common"> | ||
43 | - {{> cart/cart-content}} | ||
44 | - </div> | 40 | + <div class="cart-content common"> |
41 | + {{> cart/cart-content}} | ||
42 | + </div> | ||
45 | {{/ commonCart}} | 43 | {{/ commonCart}} |
46 | 44 | ||
47 | {{# preSellCart}} | 45 | {{# preSellCart}} |
48 | - <div class="cart-content presell hide"> | ||
49 | - <p class="presell-info"> | ||
50 | - <span class="iconfont"></span> | ||
51 | - <span class="txt">预售商品全场包邮,到货后立即发货</span> | ||
52 | - <span class="txt">预售商品不参加活动,不可使用优惠券</span> | ||
53 | - </p> | ||
54 | - {{> cart/cart-content}} | ||
55 | - </div> | 46 | + <div class="cart-content presell hide"> |
47 | + <p class="presell-info"> | ||
48 | + <span class="iconfont"></span> | ||
49 | + <span class="txt">预售商品全场包邮,到货后立即发货</span> | ||
50 | + <span class="txt">预售商品不参加活动,不可使用优惠券</span> | ||
51 | + </p> | ||
52 | + {{> cart/cart-content}} | ||
53 | + </div> | ||
56 | {{/ preSellCart}} | 54 | {{/ preSellCart}} |
57 | - | ||
58 | - </div> | ||
59 | {{/if}} | 55 | {{/if}} |
60 | 56 | ||
61 | <input id="cartType" type="hidden" value="{{cartType}}"> | 57 | <input id="cartType" type="hidden" value="{{cartType}}"> |
62 | - {{/ shoppingCart}} | ||
63 | - | ||
64 | - {{> cart/chose-panel}} | 58 | + {{/ shoppingCart}} |
59 | +</div> | ||
65 | {{> layout/footer}} | 60 | {{> layout/footer}} |
@@ -49,9 +49,9 @@ | @@ -49,9 +49,9 @@ | ||
49 | {{count}}张可用 | 49 | {{count}}张可用 |
50 | </span> | 50 | </span> |
51 | 51 | ||
52 | - {{#if value}} | ||
53 | - <span class="used coupon-use" data-value="{{value}}"> | ||
54 | - -¥{{value}} | 52 | + {{#if couponName}} |
53 | + <span class="used coupon-use" data-name="{{couponName}}"> | ||
54 | + {{couponName}} | ||
55 | <i class="iconfont"></i> | 55 | <i class="iconfont"></i> |
56 | </span> | 56 | </span> |
57 | {{^}} | 57 | {{^}} |
@@ -65,11 +65,18 @@ | @@ -65,11 +65,18 @@ | ||
65 | </li> | 65 | </li> |
66 | <li class="coin" data-yoho-coin="{{yohoCoin}}"> | 66 | <li class="coin" data-yoho-coin="{{yohoCoin}}"> |
67 | <span class="title">YOHO币</span> | 67 | <span class="title">YOHO币</span> |
68 | - <span class="desc">可抵¥{{yohoCoin}}</span> | ||
69 | - <span class="coin-check"> | ||
70 | - <em>- ¥ {{yohoCoin}}</em> | ||
71 | - <i class="iconfont checkbox icon-cb-checked"></i> | ||
72 | - </span> | 68 | + |
69 | + {{#if yohoCoin}} | ||
70 | + <span class="desc">可抵¥{{yohoCoin}}</span> | ||
71 | + <span class="coin-check"> | ||
72 | + <em>- ¥ {{yohoCoin}}</em> | ||
73 | + <i class="iconfont checkbox icon-cb-checked"></i> | ||
74 | + </span> | ||
75 | + {{^}} | ||
76 | + <span class="not-used coin-check"> | ||
77 | + 无YOHO币可用 | ||
78 | + </span> | ||
79 | + {{/if}} | ||
73 | </li> | 80 | </li> |
74 | 81 | ||
75 | {{#if invoice}} | 82 | {{#if invoice}} |
@@ -98,28 +105,12 @@ | @@ -98,28 +105,12 @@ | ||
98 | 105 | ||
99 | <section class="price-cal block"> | 106 | <section class="price-cal block"> |
100 | <ul class="total"> | 107 | <ul class="total"> |
108 | + {{#cartPayData}} | ||
101 | <li> | 109 | <li> |
102 | - <span>总价</span> | ||
103 | - ¥{{sumPrice}} | ||
104 | - </li> | ||
105 | - <li> | ||
106 | - <span>活动价</span> | ||
107 | - - ¥{{salePrice}} | ||
108 | - </li> | ||
109 | - <li> | ||
110 | - <span>运费</span> | ||
111 | - + {{freight}} | ||
112 | - </li> | ||
113 | - {{#couponPrice}} | ||
114 | - <li> | ||
115 | - <span>优惠券</span> | ||
116 | - - ¥{{.}} | ||
117 | - </li> | ||
118 | - {{/couponPrice}} | ||
119 | - <li> | ||
120 | - <span>YOHO币</span> | ||
121 | - - ¥{{yohoCoin}} | 110 | + <span>{{promotion}}</span> |
111 | + {{promotion_amount}} | ||
122 | </li> | 112 | </li> |
113 | + {{/cartPayData}} | ||
123 | <li class="cost"> | 114 | <li class="cost"> |
124 | 应付金额: <em>¥{{price}}</em> | 115 | 应付金额: <em>¥{{price}}</em> |
125 | </li> | 116 | </li> |
@@ -128,6 +119,7 @@ | @@ -128,6 +119,7 @@ | ||
128 | 119 | ||
129 | <ul class="pay-mode"> | 120 | <ul class="pay-mode"> |
130 | {{# paymentWay}} | 121 | {{# paymentWay}} |
122 | + {{#if isSupport}} | ||
131 | <li class="{{#if recommend}}default{{/if}}" data-pay-type="{{paymentType}}" data-pay-id="{{id}}"> | 123 | <li class="{{#if recommend}}default{{/if}}" data-pay-type="{{paymentType}}" data-pay-id="{{id}}"> |
132 | <span class="iconfont"> | 124 | <span class="iconfont"> |
133 | {{#if recommend}} | 125 | {{#if recommend}} |
@@ -138,34 +130,19 @@ | @@ -138,34 +130,19 @@ | ||
138 | </span> | 130 | </span> |
139 | {{name}} | 131 | {{name}} |
140 | </li> | 132 | </li> |
133 | + {{/if}} | ||
141 | {{/ paymentWay}} | 134 | {{/ paymentWay}} |
142 | </ul> | 135 | </ul> |
143 | {{/ orderEnsure}} | 136 | {{/ orderEnsure}} |
144 | </div> | 137 | </div> |
145 | <script id="tmpl-price" type="text/tmpl"> | 138 | <script id="tmpl-price" type="text/tmpl"> |
146 | <ul class="total"> | 139 | <ul class="total"> |
140 | + \{{#cartPayData}} | ||
147 | <li> | 141 | <li> |
148 | - <span>总价</span> | ||
149 | - ¥\{{sumPrice}} | ||
150 | - </li> | ||
151 | - <li> | ||
152 | - <span>活动价</span> | ||
153 | - - ¥\{{salePrice}} | ||
154 | - </li> | ||
155 | - <li> | ||
156 | - <span>运费</span> | ||
157 | - + \{{freight}} | ||
158 | - </li> | ||
159 | - \{{#couponPrice}} | ||
160 | - <li> | ||
161 | - <span>优惠券</span> | ||
162 | - - ¥\{{.}} | ||
163 | - </li> | ||
164 | - \{{/couponPrice}} | ||
165 | - <li> | ||
166 | - <span>YOHO币</span> | ||
167 | - - ¥\{{yohoCoin}} | 142 | + <span>\{{promotion}}</span> |
143 | + \{{promotion_amount}} | ||
168 | </li> | 144 | </li> |
145 | + \{{/cartPayData}} | ||
169 | <li class="cost"> | 146 | <li class="cost"> |
170 | 应付金额: <em>¥\{{price}}</em> | 147 | 应付金额: <em>¥\{{price}}</em> |
171 | </li> | 148 | </li> |
@@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
13 | <script id="tmpl-coupon" type="text/tmpl"> | 13 | <script id="tmpl-coupon" type="text/tmpl"> |
14 | \{{#coupons}} | 14 | \{{#coupons}} |
15 | \{{^ notAvailable}} | 15 | \{{^ notAvailable}} |
16 | - <a class="employ-main" data-coupon-code="\{{ couponCode}}" data-coupon-value="\{{ couponValue}}" href="/cart/index/orderEnsure"> | 16 | + <a class="employ-main" data-coupon-code="\{{ couponCode}}" data-coupon-name="\{{ couponDetailInfomation}}" href="/cart/index/orderEnsure"> |
17 | <span>\{{ couponValue}}</span> | 17 | <span>\{{ couponValue}}</span> |
18 | <p class="coupon-name">\{{ couponDetailInfomation}}</p> | 18 | <p class="coupon-name">\{{ couponDetailInfomation}}</p> |
19 | <p>有效期:\{{ couponValidity}}</p> | 19 | <p>有效期:\{{ couponValidity}}</p> |
@@ -93,9 +93,9 @@ | @@ -93,9 +93,9 @@ | ||
93 | {{#if consultsNum}} | 93 | {{#if consultsNum}} |
94 | {{> product/feedback-tab}} | 94 | {{> product/feedback-tab}} |
95 | {{else}} | 95 | {{else}} |
96 | - <div class="nodata tap-hightlight"> | 96 | + <div class="nodata tap-hightlight" id="goto-consult"> |
97 | <span>暂无商品评价和咨询</span> | 97 | <span>暂无商品评价和咨询</span> |
98 | - <a href="{{link}}" class="go-consult">我要咨询<span class="iconfont"></span></a> | 98 | + <a href="{{consultsUrl}}" class="go-consult">我要咨询<span class="iconfont"></span></a> |
99 | </div> | 99 | </div> |
100 | {{/if}} | 100 | {{/if}} |
101 | {{/if}} | 101 | {{/if}} |
@@ -25,7 +25,7 @@ | @@ -25,7 +25,7 @@ | ||
25 | <li class="advance-buy"> | 25 | <li class="advance-buy"> |
26 | <span class="iconfont"></span> | 26 | <span class="iconfont"></span> |
27 | 加价购 | 27 | 加价购 |
28 | - <a href="/cart/index/advanceBuy"> | 28 | + <a href=""> |
29 | <span class="count">{{advanceBuyCount}}</span> | 29 | <span class="count">{{advanceBuyCount}}</span> |
30 | <span class="iconfont icon-right-arrow"></span> | 30 | <span class="iconfont icon-right-arrow"></span> |
31 | </a> | 31 | </a> |
@@ -33,14 +33,16 @@ | @@ -33,14 +33,16 @@ | ||
33 | {{/if}} | 33 | {{/if}} |
34 | </ul> | 34 | </ul> |
35 | {{/if}} | 35 | {{/if}} |
36 | + | ||
37 | +{{# promotionInfo}} | ||
36 | <div class="activity"> | 38 | <div class="activity"> |
37 | - <h1>以参与活动</h1> | 39 | + <h1>已参与活动</h1> |
38 | <ul> | 40 | <ul> |
39 | - {{# promotionInfo}} | ||
40 | - <li>{{name}}</li> | ||
41 | - {{/ promotionInfo}} | 41 | + <li>{{name}}</li> |
42 | </ul> | 42 | </ul> |
43 | </div> | 43 | </div> |
44 | +{{/ promotionInfo}} | ||
45 | + | ||
44 | <div class="price-compute"> | 46 | <div class="price-compute"> |
45 | <p> | 47 | <p> |
46 | <span>总价(¥{{price}})<i>-</i></span> | 48 | <span>总价(¥{{price}})<i>-</i></span> |
@@ -37,34 +37,34 @@ | @@ -37,34 +37,34 @@ | ||
37 | 37 | ||
38 | <ul class="size-row clearfix hide"> | 38 | <ul class="size-row clearfix hide"> |
39 | {{# size}} | 39 | {{# size}} |
40 | - <li class="block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}" data-id={{id}} data-colorid="{{colorId}}" data-num="{{sizeNum}}" data-numstr="{{colorNumStr}}" data-skuid="{{skuId}}" data-goodid="{{goodsId}}"> | ||
41 | - {{name}} | ||
42 | - </li> | ||
43 | - {{/ size}} | ||
44 | - </ul> | 40 | + <li class="block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}" data-id="{{id}}" data-colorid="{{colorId}}" data-num="{{sizeNum}}" data-numstr="{{colorNumStr}}" data-skuid="{{skuId}}" data-goodid="{{goodsId}}"> |
41 | + {{name}} | ||
42 | + </li> | ||
43 | + {{/ size}} | ||
44 | + </ul> | ||
45 | 45 | ||
46 | - {{/ sizes}} | ||
47 | - </div> | ||
48 | - <p> | ||
49 | - <div class="num"> | ||
50 | - <span>数量</span> | ||
51 | - <div class="clearfix"> | ||
52 | - <a class="btn btn-minus" href="javascript:void(0);"> | ||
53 | - <span class="iconfont"></span> | ||
54 | - </a> | ||
55 | - <input id="good-num" class="good-num" type="text" value="1"> | ||
56 | - <a class="btn btn-plus" href="javascript:void(0);"> | ||
57 | - <span class="iconfont"></span> | ||
58 | - </a> | 46 | + {{/ sizes}} |
47 | + </div> | ||
48 | + <p> | ||
49 | + <div class="num"> | ||
50 | + <span>数量</span> | ||
51 | + <div class="clearfix"> | ||
52 | + <a class="btn btn-minus" href="javascript:void(0);"> | ||
53 | + <span class="iconfont"></span> | ||
54 | + </a> | ||
55 | + <input id="good-num" class="good-num" type="text" value="1"> | ||
56 | + <a class="btn btn-plus" href="javascript:void(0);"> | ||
57 | + <span class="iconfont"></span> | ||
58 | + </a> | ||
59 | + </div> | ||
60 | + <span class="left-num"></span> | ||
61 | + <input id="left-num" type="hidden" value="0"> | ||
59 | </div> | 62 | </div> |
60 | - <span class="left-num"></span> | ||
61 | - <input id="left-num" type="hidden" value="0"> | ||
62 | </div> | 63 | </div> |
63 | </div> | 64 | </div> |
64 | - </div> | ||
65 | - <div class="btn-wrap"> | ||
66 | - <button id="chose-btn-sure" class="btn btn-sure">确定</button> | 65 | + <div class="btn-wrap"> |
66 | + <button id="chose-btn-sure" class="btn btn-sure">确定</button> | ||
67 | + </div> | ||
67 | </div> | 68 | </div> |
68 | </div> | 69 | </div> |
69 | - </div> | ||
70 | - {{/cartInfo}} | ||
70 | +{{/cartInfo}} |
1 | -<div class="shopping-cart-good clearfix" data-id={{id}}> | ||
2 | - {{#if isSoldOut}} | 1 | +<div class="shopping-cart-good clearfix" data-id="{{id}}"> |
2 | + {{#if inValid}} | ||
3 | <span class="few-tag-expire">失效</span> | 3 | <span class="few-tag-expire">失效</span> |
4 | - {{^}} | ||
5 | - {{#if isSelected}} | ||
6 | - <span class="checkbox icon-cb-checked iconfont"></span> | ||
7 | - {{^}} | ||
8 | - <span class="checkbox icon-checkbox iconfont"></span> | ||
9 | - {{/if}} | 4 | + {{/if}} |
5 | + | ||
6 | + {{#if showCheckbox}} | ||
7 | + <span class="checkbox{{#if checked}} icon-cb-checked{{^}} icon-checkbox{{/if}} iconfont"></span> | ||
10 | {{/if}} | 8 | {{/if}} |
11 | 9 | ||
12 | <div class="info"> | 10 | <div class="info"> |
13 | - <img class="thumb lazy" data-original={{thumb}}> | 11 | + <a href="{{link}}"> |
12 | + <img class="thumb lazy" data-original="{{thumb}}"> | ||
13 | + </a> | ||
14 | {{#if isAdvanceBuy}} | 14 | {{#if isAdvanceBuy}} |
15 | <p class="few-tag plus-tag">加价购</p> | 15 | <p class="few-tag plus-tag">加价购</p> |
16 | - {{^}} | ||
17 | - {{#if isGift}} | 16 | + {{/if}} |
17 | + {{#if isGift}} | ||
18 | <p class="few-tag gift-tag">赠品</p> | 18 | <p class="few-tag gift-tag">赠品</p> |
19 | - {{/if}} | ||
20 | {{/if}} | 19 | {{/if}} |
21 | - </a> | ||
22 | 20 | ||
23 | <div class="deps show"> | 21 | <div class="deps show"> |
24 | - <p class="name row">{{name}}</p> | 22 | + <a href="{{link}}" class="name row">{{name}}</a> |
25 | <span class="count"> | 23 | <span class="count"> |
26 | ×{{count}} | 24 | ×{{count}} |
27 | </span> | 25 | </span> |
@@ -67,15 +65,5 @@ | @@ -67,15 +65,5 @@ | ||
67 | </p> | 65 | </p> |
68 | {{/if}} | 66 | {{/if}} |
69 | </div> | 67 | </div> |
70 | - <div class="calculate-num hide"> | ||
71 | - <div class="calculate"> | ||
72 | - <p><i class="iconfont cut"></i><span>{{count}}</span><i class="iconfont add"></i></p> | ||
73 | - <p><span>颜色:{{color}}尺码:{{size}}{{name}}</span><i class="iconfont down"></i></p> | ||
74 | - </div> | ||
75 | - <p><span class="price"> ¥{{price}}</span></p> | ||
76 | - <span class="count"> | ||
77 | - ×{{count}} | ||
78 | - </span> | ||
79 | - </div> | ||
80 | </div> | 68 | </div> |
81 | </div> | 69 | </div> |
@@ -411,6 +411,13 @@ class CartModel | @@ -411,6 +411,13 @@ class CartModel | ||
411 | $oneGoods['price'] = Helpers::transPrice($single['sales_price']); | 411 | $oneGoods['price'] = Helpers::transPrice($single['sales_price']); |
412 | $oneGoods['count'] = $single['buy_number']; | 412 | $oneGoods['count'] = $single['buy_number']; |
413 | 413 | ||
414 | + //gift=>是否赠品,advanceBuy=>是否加价购; | ||
415 | + if ($single['goods_type'] == 'gift' && !isset($single['isAdvanceBuy'])) { | ||
416 | + $oneGoods['gift'] = true; | ||
417 | + } elseif ($single['goods_type'] == 'price_gift') { | ||
418 | + $oneGoods['advanceBuy'] = true; | ||
419 | + } | ||
420 | + | ||
414 | $result['goods'][] = $oneGoods; | 421 | $result['goods'][] = $oneGoods; |
415 | } | 422 | } |
416 | } | 423 | } |
@@ -423,6 +430,7 @@ class CartModel | @@ -423,6 +430,7 @@ class CartModel | ||
423 | $onePay['id'] = $pay['payment_id']; | 430 | $onePay['id'] = $pay['payment_id']; |
424 | $onePay['paymentType'] = $pay['payment_type']; | 431 | $onePay['paymentType'] = $pay['payment_type']; |
425 | $onePay['name'] = $pay['payment_type_name']; | 432 | $onePay['name'] = $pay['payment_type_name']; |
433 | + $onePay['isSupport'] = $pay['is_support'] === 'Y'; | ||
426 | // $onePay['default'] = ($pay['default'] === 'Y'); | 434 | // $onePay['default'] = ($pay['default'] === 'Y'); |
427 | if ($onePay['paymentType'] == 1) { | 435 | if ($onePay['paymentType'] == 1) { |
428 | $onePay['recommend'] = true; | 436 | $onePay['recommend'] = true; |
@@ -437,23 +445,9 @@ class CartModel | @@ -437,23 +445,9 @@ class CartModel | ||
437 | 445 | ||
438 | // 订单数据 | 446 | // 订单数据 |
439 | if (isset($payReturn['shopping_cart_data']) && !empty($payReturn['shopping_cart_data'])) { | 447 | if (isset($payReturn['shopping_cart_data']) && !empty($payReturn['shopping_cart_data'])) { |
440 | - $sumPrice = isset($orderCompute['order_amount']) ? $orderCompute['order_amount'] : $payReturn['shopping_cart_data']['order_amount']; | ||
441 | - | ||
442 | - $freight = '¥0'; | ||
443 | - if (isset($orderCompute['promotion_formula_list'][1]['promotion_amount'])) { | ||
444 | - $freight = $orderCompute['promotion_formula_list'][1]['promotion_amount']; | ||
445 | - } elseif(isset($payReturn['shopping_cart_data']['promotion_formula_list'][1]['promotion_amount'])) { | ||
446 | - $freight = $payReturn['shopping_cart_data']['promotion_formula_list'][1]['promotion_amount']; | ||
447 | - } | ||
448 | - | ||
449 | - $couponPrice = isset($orderCompute['coupon_amount']) ? $orderCompute['coupon_amount'] : false; | ||
450 | - $salePrice = isset($orderCompute['discount_amount']) ? $orderCompute['discount_amount'] : $payReturn['shopping_cart_data']['discount_amount']; | 448 | + $result['cartPayData'] = isset($orderCompute['promotion_formula_list']) ? $orderCompute['promotion_formula_list'] : $payReturn['shopping_cart_data']['promotion_formula_list']; |
451 | $price = isset($orderCompute['last_order_amount']) ? $orderCompute['last_order_amount'] : $payReturn['shopping_cart_data']['last_order_amount']; | 449 | $price = isset($orderCompute['last_order_amount']) ? $orderCompute['last_order_amount'] : $payReturn['shopping_cart_data']['last_order_amount']; |
452 | - $result['sumPrice'] = Helpers::transPrice($sumPrice); | ||
453 | - $result['salePrice'] = Helpers::transPrice($salePrice); | ||
454 | $result['price'] = Helpers::transPrice($price); | 450 | $result['price'] = Helpers::transPrice($price); |
455 | - $result['freight'] = $freight; | ||
456 | - $result['couponPrice'] = $couponPrice; | ||
457 | } | 451 | } |
458 | 452 | ||
459 | // 发票有关数据 | 453 | // 发票有关数据 |
@@ -481,7 +475,7 @@ class CartModel | @@ -481,7 +475,7 @@ class CartModel | ||
481 | 475 | ||
482 | // 优惠券数据 | 476 | // 优惠券数据 |
483 | $coupons = array(); | 477 | $coupons = array(); |
484 | - !empty($orderCompute['coupon_amount']) && $coupons['value'] = $orderInfo['couponValue']; | 478 | + !empty($orderCompute['coupon_amount']) && $coupons['couponName'] = $orderInfo['couponName']; |
485 | $coupons += self::getCouponList($uid, true); | 479 | $coupons += self::getCouponList($uid, true); |
486 | $result['coupon'] = $coupons; | 480 | $result['coupon'] = $coupons; |
487 | } | 481 | } |
@@ -554,17 +548,21 @@ class CartModel | @@ -554,17 +548,21 @@ class CartModel | ||
554 | $coupons = CartData::getCouponList($uid); | 548 | $coupons = CartData::getCouponList($uid); |
555 | 549 | ||
556 | do { | 550 | do { |
557 | - if ($onlyTotal) { | ||
558 | - $result['count'] = count($coupons['data']['couponList']); | ||
559 | - break; | ||
560 | - } | ||
561 | - | ||
562 | if (isset($coupons['data']['couponList'])) { | 551 | if (isset($coupons['data']['couponList'])) { |
563 | - foreach ($coupons['data']['couponList'] as &$val) { | ||
564 | - $val['notAvailable'] = $val['isValidity'] === 'N'; | 552 | + foreach ($coupons['data']['couponList'] as $val) { |
553 | + $notAvailableRes = self::searchCoupon($uid, $val['couponCode']); | ||
554 | + // 处理可用的优惠券 | ||
555 | + if ($val['isValidity'] === 'N' || (isset($notAvailableRes['code']) && $notAvailableRes['code'] !== 200)) { | ||
556 | +// $val['notAvailable'] = true; | ||
557 | + continue; | ||
558 | + } | ||
559 | + $result[] = $val; | ||
565 | } | 560 | } |
561 | + } | ||
566 | 562 | ||
567 | - $result = $coupons['data']['couponList']; | 563 | + if ($onlyTotal) { |
564 | + $count = count($result); | ||
565 | + $result = array('count' => $count); | ||
568 | } | 566 | } |
569 | }while(0); | 567 | }while(0); |
570 | 568 | ||
@@ -776,8 +774,6 @@ class CartModel | @@ -776,8 +774,6 @@ class CartModel | ||
776 | 774 | ||
777 | $result['promotionInfo'][] = $info; | 775 | $result['promotionInfo'][] = $info; |
778 | } | 776 | } |
779 | - | ||
780 | - $result['promotionFormula'] = $data['shopping_cart_data']['promotion_formula']; | ||
781 | } | 777 | } |
782 | 778 | ||
783 | // 结算数据 | 779 | // 结算数据 |
@@ -316,7 +316,7 @@ class UserModel | @@ -316,7 +316,7 @@ class UserModel | ||
316 | } else { | 316 | } else { |
317 | $data = $records['data']['product_list']; | 317 | $data = $records['data']['product_list']; |
318 | foreach ($data as &$val) { | 318 | foreach ($data as &$val) { |
319 | - $val['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : ''; | 319 | + $val['link'] = Helpers::url('/product/show_' . $val['product_skn'] . '.html'); |
320 | $val['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 447, 596) : ''; | 320 | $val['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 447, 596) : ''; |
321 | $val['sales_price'] = Helpers::transPrice($val['sales_price']); | 321 | $val['sales_price'] = Helpers::transPrice($val['sales_price']); |
322 | $val['market_price'] = ($val['market_price'] - $val['sales_price'] > 0) ? $val['market_price'] . '.00' : false; | 322 | $val['market_price'] = ($val['market_price'] - $val['sales_price'] > 0) ? $val['market_price'] . '.00' : false; |
@@ -39,7 +39,7 @@ class DetailModel | @@ -39,7 +39,7 @@ class DetailModel | ||
39 | elseif (is_numeric($productSkn)) { | 39 | elseif (is_numeric($productSkn)) { |
40 | $baseInfo = DetailData::baseInfo(null, $uid, $productSkn); | 40 | $baseInfo = DetailData::baseInfo(null, $uid, $productSkn); |
41 | } | 41 | } |
42 | - | 42 | + |
43 | // 商品名称 | 43 | // 商品名称 |
44 | if (empty($baseInfo['productName'])) { | 44 | if (empty($baseInfo['productName'])) { |
45 | return $result; | 45 | return $result; |
@@ -186,7 +186,7 @@ class DetailModel | @@ -186,7 +186,7 @@ class DetailModel | ||
186 | // 商品的尺码列表 | 186 | // 商品的尺码列表 |
187 | if (isset($value['goodsSizeBoList'])) { | 187 | if (isset($value['goodsSizeBoList'])) { |
188 | foreach ($value['goodsSizeBoList'] as $size) { | 188 | foreach ($value['goodsSizeBoList'] as $size) { |
189 | - $sizeList[$value['colorId']][] = array( | 189 | + $sizeList[$value['productSkc']][] = array( |
190 | 'id' => $size['id'], | 190 | 'id' => $size['id'], |
191 | 'skuId' => $size['goodsSizeSkuId'], | 191 | 'skuId' => $size['goodsSizeSkuId'], |
192 | 'goodsId' => $size['goodsId'], | 192 | 'goodsId' => $size['goodsId'], |
@@ -196,7 +196,7 @@ class DetailModel | @@ -196,7 +196,7 @@ class DetailModel | ||
196 | ); | 196 | ); |
197 | $colorStorageNum += intval($size['goodsSizeStorageNum']); | 197 | $colorStorageNum += intval($size['goodsSizeStorageNum']); |
198 | $sizeStorageStr .= $size['goodsSizeStorageNum'] . '/'; | 198 | $sizeStorageStr .= $size['goodsSizeStorageNum'] . '/'; |
199 | - $colorStorageGroup[$size['sizeName']][$value['colorId']] = $size['goodsSizeStorageNum']; | 199 | + $colorStorageGroup[$size['sizeName']][$value['productSkc']] = $size['goodsSizeStorageNum']; |
200 | } | 200 | } |
201 | 201 | ||
202 | // 颜色分组 | 202 | // 颜色分组 |
@@ -214,9 +214,9 @@ class DetailModel | @@ -214,9 +214,9 @@ class DetailModel | ||
214 | $thumbImageList[] = array('img' => Helpers::getImageUrl($value['colorImage'], 60, 60)); | 214 | $thumbImageList[] = array('img' => Helpers::getImageUrl($value['colorImage'], 60, 60)); |
215 | 215 | ||
216 | // 添加尺码对应的各个颜色的库存量 | 216 | // 添加尺码对应的各个颜色的库存量 |
217 | - foreach ($sizeList as $colorId => $sizeArr) { | 217 | + foreach ($sizeList as $skc => $sizeArr) { |
218 | foreach ($sizeArr as $key => $value) { | 218 | foreach ($sizeArr as $key => $value) { |
219 | - $sizeList[$colorId][$key]['colorNumStr'] = implode('/', array_values($colorStorageGroup[$value['name']])); | 219 | + $sizeList[$skc][$key]['colorNumStr'] = implode('/', array_values($colorStorageGroup[$value['name']])); |
220 | } | 220 | } |
221 | } | 221 | } |
222 | 222 | ||
@@ -226,7 +226,7 @@ class DetailModel | @@ -226,7 +226,7 @@ class DetailModel | ||
226 | 226 | ||
227 | // 格式化尺码对应的各个颜色分组 | 227 | // 格式化尺码对应的各个颜色分组 |
228 | foreach ($colorGroup as $value) { | 228 | foreach ($colorGroup as $value) { |
229 | - $sizeGroup[]['size'] = $sizeList[ $value['id'] ]; | 229 | + $sizeGroup[]['size'] = $sizeList[ $value['skcId'] ]; |
230 | } | 230 | } |
231 | 231 | ||
232 | // 商品图: 多个 | 232 | // 商品图: 多个 |
@@ -149,7 +149,7 @@ class IndexController extends AbstractAction | @@ -149,7 +149,7 @@ class IndexController extends AbstractAction | ||
149 | $shoppingKey = Helpers::getShoppingKeyByCookie(); | 149 | $shoppingKey = Helpers::getShoppingKeyByCookie(); |
150 | $uid = $this->getUid(true); | 150 | $uid = $this->getUid(true); |
151 | $cartType = $this->get('cartType', 'ordinary'); | 151 | $cartType = $this->get('cartType', 'ordinary'); |
152 | - $data = array('giftPage' => true); | 152 | + $data = array('giftPage' => true, 'cartType' => $cartType); |
153 | $data += CartModel::getCartData($uid, $shoppingKey, $cartType, true); | 153 | $data += CartModel::getCartData($uid, $shoppingKey, $cartType, true); |
154 | 154 | ||
155 | // 渲染模板 | 155 | // 渲染模板 |
@@ -167,7 +167,7 @@ class IndexController extends AbstractAction | @@ -167,7 +167,7 @@ class IndexController extends AbstractAction | ||
167 | $shoppingKey = Helpers::getShoppingKeyByCookie(); | 167 | $shoppingKey = Helpers::getShoppingKeyByCookie(); |
168 | $uid = $this->getUid(true); | 168 | $uid = $this->getUid(true); |
169 | $cartType = $this->get('cartType', 'ordinary'); | 169 | $cartType = $this->get('cartType', 'ordinary'); |
170 | - $data = array('advanceBuyPage' => true); | 170 | + $data = array('advanceBuyPage' => true, 'cartType' => $cartType); |
171 | $data += CartModel::getCartData($uid, $shoppingKey, $cartType, false, true); | 171 | $data += CartModel::getCartData($uid, $shoppingKey, $cartType, false, true); |
172 | 172 | ||
173 | // 渲染模板 | 173 | // 渲染模板 |
@@ -192,15 +192,15 @@ class IndexController extends AbstractAction | @@ -192,15 +192,15 @@ class IndexController extends AbstractAction | ||
192 | $this->echoJson($result); | 192 | $this->echoJson($result); |
193 | } | 193 | } |
194 | 194 | ||
195 | - /* | ||
196 | - * 获取购物车加价购商品数据模板 | ||
197 | - */ | ||
198 | - public function giftinfoTplAction() | ||
199 | - { | ||
200 | - if ($this->isAjax()) { | ||
201 | - echo file_get_contents($this->_view->getScriptPath() . '/../partials/cart/chose-panel.phtml'); | ||
202 | - } | ||
203 | - } | 195 | +// /* |
196 | +// * 获取购物车加价购商品数据模板 | ||
197 | +// */ | ||
198 | +// public function giftinfoTplAction() | ||
199 | +// { | ||
200 | +// if ($this->isAjax()) { | ||
201 | +// echo file_get_contents($this->_view->getScriptPath() . '/../partials/cart/chose-panel.phtml'); | ||
202 | +// } | ||
203 | +// } | ||
204 | 204 | ||
205 | /* | 205 | /* |
206 | * 获取购物车加价购商品数据 | 206 | * 获取购物车加价购商品数据 |
@@ -215,7 +215,9 @@ class IndexController extends AbstractAction | @@ -215,7 +215,9 @@ class IndexController extends AbstractAction | ||
215 | $result = CartModel::giftProductData($skn, $promotionId); | 215 | $result = CartModel::giftProductData($skn, $promotionId); |
216 | } | 216 | } |
217 | 217 | ||
218 | - $this->echoJson($result); | 218 | + $this->_view->display('gift-info', array( |
219 | + 'cartInfo' => $result['data'] | ||
220 | + )); | ||
219 | } | 221 | } |
220 | 222 | ||
221 | /** | 223 | /** |
@@ -269,7 +271,7 @@ class IndexController extends AbstractAction | @@ -269,7 +271,7 @@ class IndexController extends AbstractAction | ||
269 | $this->auditJumpLogin(); | 271 | $this->auditJumpLogin(); |
270 | 272 | ||
271 | $this->setTitle('确认订单'); | 273 | $this->setTitle('确认订单'); |
272 | - $this->setNavHeader('确认订单'); | 274 | + $this->setNavHeader('确认订单', Helpers::url('/cart/index/index'), false); // 不显示右上角home按钮 |
273 | 275 | ||
274 | // 购物车商品为空跳转到购物车页面 | 276 | // 购物车商品为空跳转到购物车页面 |
275 | $shoppingKey = Helpers::getShoppingKeyByCookie(); | 277 | $shoppingKey = Helpers::getShoppingKeyByCookie(); |
-
Please register or login to post a comment