Authored by xuqi

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

framework @ 75bbc3b0
1 -Subproject commit e9d066dd88a8e7e37103021c427a205a5cfcdcec 1 +Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
@@ -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)
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 /** 8 /**
9 * @ignore 9 * @ignore
10 */ 10 */
11 -class OAuthException extends Exception { 11 +class OAuthException extends \Exception {
12 // pass 12 // pass
13 } 13 }
14 14
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 -};  
@@ -10,56 +10,37 @@ @@ -10,56 +10,37 @@
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 19
22 // re = /\d+/, 20 // re = /\d+/,
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;
43 30
44 //初始化购物车面板显示 31 //初始化购物车面板显示
45 function init() { 32 function init() {
  33 + var $firstRow;
46 34
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 - 35 + hasChooseColor = false;
  36 + hasChooseSize = false;
  37 + $curSizeBlock = null;
  38 + $sizeRowList = $('.size-list ul');
  39 + $firstRow = $sizeRowList.eq(0);
60 $firstRow.toggleClass('hide'); 40 $firstRow.toggleClass('hide');
61 $curSizeRow = $firstRow; 41 $curSizeRow = $firstRow;
62 } 42 }
  43 +init();
63 44
64 function checkColorSizeNum() { 45 function checkColorSizeNum() {
65 if (!hasChooseColor && !hasChooseSize) { 46 if (!hasChooseColor && !hasChooseSize) {
@@ -75,11 +56,9 @@ function checkColorSizeNum() { @@ -75,11 +56,9 @@ function checkColorSizeNum() {
75 return true; 56 return true;
76 } 57 }
77 58
78 -init();  
79 -  
80 -function show(data) {  
81 - if (data) {  
82 - $chosePanel.html(panelTmpl(data)); 59 +function show(html) {
  60 + if (html) {
  61 + $chosePanel.html(html);
83 init(); 62 init();
84 } 63 }
85 $('.chose-panel').show(); 64 $('.chose-panel').show();
@@ -88,20 +67,55 @@ function show(data) { @@ -88,20 +67,55 @@ function show(data) {
88 $num = $('#good-num'); 67 $num = $('#good-num');
89 } 68 }
90 69
91 -////显示当前Panel  
92 -//function show() {  
93 -// $('.chose-panel').show();  
94 -//  
95 -// $('body').css('overflow', 'hidden');  
96 -// $num = $('#good-num');  
97 -//}  
98 -  
99 //隐藏当前Panel 70 //隐藏当前Panel
100 function hide() { 71 function hide() {
101 $('.chose-panel').hide(); 72 $('.chose-panel').hide();
102 $('body').css('overflow', 'auto'); 73 $('body').css('overflow', 'auto');
103 } 74 }
104 75
  76 +//修改加入购物车的文字和背景
  77 +function updateConformButtonClassAndText() {
  78 + $chosed = $('.chose-items').find('.chosed');
  79 + if (2 === $chosed.closest('.zero-stock').length) {
  80 + $('#chose-btn-sure').css('background-color', '#c0c0c0');
  81 + $('#chose-btn-sure').html('已售罄');
  82 + } else {
  83 + $('#chose-btn-sure').css('background-color', '#eb0313');
  84 + $('#chose-btn-sure').html('确定');
  85 + }
  86 +}
  87 +
  88 +//重置颜色块的库存为0的样式
  89 +function resetColorZeroStock($siblingBlock) {
  90 + var numArray = ($curSizeBlock.data('numstr') + '').split('/'),
  91 + i;
  92 +
  93 + if (!hasChooseSize) {
  94 + $siblingBlock.find('ul>li').each(function() {
  95 + $(this).removeClass('zero-stock');
  96 + if ('0' === $(this).data('num')) {
  97 + $(this).addClass('zero-stock');
  98 + }
  99 + });
  100 +
  101 + } else {
  102 + for (i = 0; i < numArray.length; i++) {
  103 + if ('0' === numArray[i]) {
  104 + $siblingBlock.find('.block').eq(i).addClass('zero-stock');
  105 + }
  106 + }
  107 + }
  108 +}
  109 +
  110 +// 选择了颜色切换商品图片
  111 +function changeGoodImgWhenClickColor() {
  112 + if (hasChooseColor && curColorIndex) {
  113 + $('.chose-panel').find('.thumb').addClass('hide').eq(curColorIndex).removeClass('hide');
  114 + }
  115 +}
  116 +
  117 +init();
  118 +
105 $('.yoho-page').on('touchstart', '.chose-panel', function(e) { 119 $('.yoho-page').on('touchstart', '.chose-panel', function(e) {
106 var $cur = $(e.target); 120 var $cur = $(e.target);
107 121
@@ -143,11 +157,6 @@ $('.color-list').on('touchstart', '.block', function(e) { @@ -143,11 +157,6 @@ $('.color-list').on('touchstart', '.block', function(e) {
143 } else { 157 } else {
144 hasChooseColor = true; 158 hasChooseColor = true;
145 159
146 - //根据颜色切换图片  
147 - if ($this.closest('.block-list').hasClass('color-list')) {  
148 - $('.chose-panel').find('.thumb').addClass('hide').eq(index).removeClass('hide');  
149 - }  
150 -  
151 //把当前选中颜色对应的尺码那一行显示出来 160 //把当前选中颜色对应的尺码那一行显示出来
152 $sizeRowList.addClass('hide'); 161 $sizeRowList.addClass('hide');
153 $curSizeRow.removeClass('hide').addClass('show'); 162 $curSizeRow.removeClass('hide').addClass('show');
@@ -180,91 +189,22 @@ $('.color-list').on('touchstart', '.block', function(e) { @@ -180,91 +189,22 @@ $('.color-list').on('touchstart', '.block', function(e) {
180 curColorIndex = index; 189 curColorIndex = index;
181 190
182 // 设置按钮的样式和文字 191 // 设置按钮的样式和文字
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 - }**/ 192 + updateConformButtonClassAndText();
252 193
  194 + // 修改颜色时修改商品图片
  195 + changeGoodImgWhenClickColor();
253 }); 196 });
254 197
255 $('.size-list').on('touchstart', '.block', function(e) { 198 $('.size-list').on('touchstart', '.block', function(e) {
256 var $this = $(this), 199 var $this = $(this),
257 $that = $(e.target).closest('.chose-items'), 200 $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 // 当前尺码已经是选中状态,再点击时
@@ -275,11 +215,6 @@ $('.size-list').on('touchstart', '.block', function(e) { @@ -275,11 +215,6 @@ $('.size-list').on('touchstart', '.block', function(e) {
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;
@@ -296,10 +231,10 @@ $('.size-list').on('touchstart', '.block', function(e) { @@ -296,10 +231,10 @@ $('.size-list').on('touchstart', '.block', function(e) {
296 $that.find('.num .left-num').html('剩余' + curGoodNum + '件'); 231 $that.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 $that.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,78 +242,10 @@ $('.size-list').on('touchstart', '.block', function(e) { @@ -307,78 +242,10 @@ $('.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 - }  
318 -  
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('确定'); 245 + updateConformButtonClassAndText();
357 246
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
@@ -426,6 +293,7 @@ $('#chose-btn-sure').on('touchstart', function() { @@ -426,6 +293,7 @@ $('#chose-btn-sure').on('touchstart', function() {
426 numInCart = $('.num-tag').html() - 0, 293 numInCart = $('.num-tag').html() - 0,
427 num = $num.val(); 294 num = $num.val();
428 295
  296 + //颜色尺码没有选择
429 if (!checkColorSizeNum()) { 297 if (!checkColorSizeNum()) {
430 return; 298 return;
431 } 299 }
@@ -19,17 +19,12 @@ function getProductInfo(skn, promotionId) { @@ -19,17 +19,12 @@ function getProductInfo(skn, promotionId) {
19 $.get('/cart/index/giftinfo', { 19 $.get('/cart/index/giftinfo', {
20 skn: skn, 20 skn: skn,
21 promotionId: promotionId 21 promotionId: promotionId
22 - }).then(function(res) {  
23 - if (res.code === 200) {  
24 - chosePanel.show({  
25 - cartInfo: res.data,  
26 - cb: function(loc) {  
27 - window.location.href = loc;  
28 - }  
29 - });  
30 - } else {  
31 - tip.show(res.message); 22 + }).then(function(html) {
  23 + if (!html) {
  24 + tip.show('网络错误');
  25 + return;
32 } 26 }
  27 + chosePanel.show(html);
33 }, function() { 28 }, function() {
34 tip.show('网络错误'); 29 tip.show('网络错误');
35 }).always(function() { 30 }).always(function() {
@@ -38,33 +38,33 @@ @@ -38,33 +38,33 @@
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}}"> 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> 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">&#xe625;</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">&#xe624;</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">&#xe625;</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">&#xe624;</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}}
@@ -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;
@@ -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 // 颜色分组
@@ -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 /**