Authored by biao

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

Showing 32 changed files with 880 additions and 167 deletions
@@ -1282,7 +1282,7 @@ @@ -1282,7 +1282,7 @@
1282 chosed: true, 1282 chosed: true,
1283 name: '黄色', 1283 name: '黄色',
1284 colorNum:10, 1284 colorNum:10,
1285 - shortUrl:'', 1285 + sizeNumStr:'10/20/30' //对应的商品尺码数目,用斜杠分割
1286 1286
1287 }, 1287 },
1288 ... 1288 ...
@@ -1292,7 +1292,8 @@ @@ -1292,7 +1292,8 @@
1292 id: 2, 1292 id: 2,
1293 chosed: true, 1293 chosed: true,
1294 name: 'X', 1294 name: 'X',
1295 - sizeNum: 2 1295 + sizeNum: 2,
  1296 + colorNumStr:'10/20/30' //对应的商品颜色数目用斜杠分割
1296 }, 1297 },
1297 ... 1298 ...
1298 ], 1299 ],
@@ -48,6 +48,32 @@ class CartData @@ -48,6 +48,32 @@ class CartData
48 } 48 }
49 49
50 /** 50 /**
  51 + * 购物车商品选择与取消接口
  52 + *
  53 + * @param int $uid 用户ID
  54 + * @param string $sku 商品sku列表
  55 + * @param string $shoppingKey 未登录用户唯一识别码
  56 + * @return array 购物车接口返回的数据
  57 + */
  58 + public static function selectGoods($uid, $sku, $shoppingKey)
  59 + {
  60 + $param = Yohobuy::param();
  61 + $param['method'] = 'app.Shopping.selected';
  62 + $param['product_sku_list'] = $sku;
  63 +
  64 + if (!empty($uid)) {
  65 + $param['uid'] = $uid;
  66 + }
  67 + if (!empty($shoppingKey)) {
  68 + $param['shopping_key'] = $shoppingKey;
  69 + }
  70 +
  71 + $param['client_secret'] = Sign::getSign($param);
  72 +
  73 + return Yohobuy::get(Yohobuy::API_URL, $param);
  74 + }
  75 +
  76 + /**
51 * 购物车数据 77 * 购物车数据
52 * 78 *
53 * @param int $uid 用户ID 79 * @param int $uid 用户ID
@@ -212,9 +212,10 @@ class UserData @@ -212,9 +212,10 @@ class UserData
212 * @param int $uid 用户ID 212 * @param int $uid 用户ID
213 * @param int $page 第几页,默认1 213 * @param int $page 第几页,默认1
214 * @param int $limit 限制读取的数目,默认10 214 * @param int $limit 限制读取的数目,默认10
  215 + * @param string $type 请求类型 get,post
215 * @return array YOHO币接口返回的数据 216 * @return array YOHO币接口返回的数据
216 */ 217 */
217 - public static function yohoCoinData($uid, $page = 1, $limit = 10) 218 + public static function yohoCoinData($uid, $page = 1, $limit = 10,$type = 'get')
218 { 219 {
219 $param = Yohobuy::param(); 220 $param = Yohobuy::param();
220 $param['method'] = 'app.yohocoin.lists'; 221 $param['method'] = 'app.yohocoin.lists';
@@ -223,7 +224,7 @@ class UserData @@ -223,7 +224,7 @@ class UserData
223 $param['limit'] = $limit; 224 $param['limit'] = $limit;
224 $param['client_secret'] = Sign::getSign($param); 225 $param['client_secret'] = Sign::getSign($param);
225 226
226 - return Yohobuy::get(Yohobuy::API_URL, $param); 227 + return Yohobuy::$type(Yohobuy::API_URL, $param);
227 } 228 }
228 229
229 /** 230 /**
@@ -556,6 +556,86 @@ class Helpers @@ -556,6 +556,86 @@ class Helpers
556 } 556 }
557 557
558 /** 558 /**
  559 + * 格式化购物车商品
  560 + *
  561 + * @param array $cartGoods 购物车商品列表
  562 + * @param bool $haveLink 控制是否需要商品链接
  563 + */
  564 + public static function formatCartGoods($cartGoods, $haveLink = false)
  565 + {
  566 + $arr = array();
  567 +
  568 + $oneGoods = array();
  569 + foreach ($cartGoods as $key => $value) {
  570 + $oneGoods['id'] = $value['product_sku'];
  571 + $oneGoods['skn'] = $value['product_skn'];
  572 + $oneGoods['name'] = $value['product_name'];
  573 + $oneGoods['thumb'] = !empty($value['goods_images']) ? Images::getImageUrl($value['goods_images'], 120, 120) : '';
  574 + $oneGoods['color'] = $value['color_name'];
  575 + $oneGoods['size'] = $value['size_name'];
  576 + $oneGoods['appearDate'] = '12月'; // 目前app接口没有返回该数据
  577 + $oneGoods['price'] = $value['real_price'];
  578 + $oneGoods['count'] = $value['buy_number'];
  579 + $oneGoods['lowStocks'] = ($value['buy_number'] < $value['storage_number']);
  580 + //gift=>是否赠品,advanceBuy=>是否加价购,soldOut=>失效商品;
  581 + if (!isset($value['goods_type'])) {
  582 + $oneGoods['soldOut'] = true;
  583 + } elseif ($value['goods_type'] == 'gift') {
  584 + $oneGoods['gift'] = true;
  585 + } elseif ($value['goods_type'] == 'price_gift') {
  586 + $oneGoods['advanceBuy'] = true;
  587 + }
  588 + // 上市期
  589 + if (!empty($value['expect_arrival_time'])) {
  590 + $oneGoods['appearDate'] = $value['expect_arrival_time'];
  591 + }
  592 + // 商品链接
  593 + if ($haveLink && isset($value['product_id'])) {
  594 + $oneGoods['link'] = self::url('/product/pro_' . $value['product_id'] . '_' . $value['goods_id'] . '/' . $value['cn_alphabet'] . '.html');
  595 + }
  596 +
  597 + $arr[$key] = $oneGoods;
  598 + }
  599 +
  600 + return $arr;
  601 + }
  602 +
  603 + /**
  604 + * 格式化加价购商品
  605 + *
  606 + * @param array $advanceGoods 加价购商品列表
  607 + * @param bool $haveLink 控制是否需要商品链接
  608 + */
  609 + public static function formatAdvanceGoods($advanceGoods)
  610 + {
  611 + $arr = array();
  612 +
  613 +
  614 + $gift = array();
  615 + $oneGoods = array();
  616 + foreach ($advanceGoods as $value) {
  617 + $gift = array();
  618 + $gift['promotionTitle'] = $value['promotion_title'];
  619 +
  620 + foreach ($value['goods_list'] as $single) {
  621 + $oneGoods['id'] = $single['product_skn'];
  622 + $oneGoods['name'] = $single['product_name'];
  623 + $oneGoods['thumb'] = !empty($single['goods_images']) ? Images::getImageUrl($single['goods_images'], 120, 120) : '';
  624 + $oneGoods['appearDate'] = '12月'; // 目前app接口没有返回该数据
  625 + $oneGoods['price'] = $single['last_price'];
  626 + $oneGoods['marketPrice'] = $single['market_price'];
  627 + $oneGoods['count'] = $single['storage_number'];
  628 +
  629 + $gift['goods'][] = $oneGoods;
  630 + }
  631 +
  632 + $arr[] = $gift;
  633 + }
  634 +
  635 + return $arr;
  636 + }
  637 +
  638 + /**
559 * 订单状态,按订单支付类型和订单状态 639 * 订单状态,按订单支付类型和订单状态
560 * @var array 640 * @var array
561 */ 641 */
  1 +var $ = require('jquery');
  2 +var page = 1;
  3 +
  4 +function ajaxCurrencyDetail(page) {
  5 + $.ajax({
  6 + type: 'POST',
  7 + url: '/home/ajaxCurrencyDetail',
  8 + dataType: 'html',
  9 + data: {
  10 + page: page
  11 + },
  12 + success: function(data) {
  13 + $('.coin-detail').append(data);
  14 + window.rePosFooter();
  15 + }
  16 + });
  17 +}
  18 +
  19 +$(window).scroll(function() {
  20 + if ($(window).scrollTop() + $(window).height() > $('body').height() - 1) {
  21 + page++;
  22 + ajaxCurrencyDetail(page);
  23 + return;
  24 + }
  25 +});
  26 +
  27 +ajaxCurrencyDetail(page);
@@ -18,3 +18,4 @@ require('./address-act'); @@ -18,3 +18,4 @@ require('./address-act');
18 require('./logistic'); 18 require('./logistic');
19 require('./pay'); 19 require('./pay');
20 require('./personal-details'); 20 require('./personal-details');
  21 +require('./currency');
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 */ 5 */
6 6
7 var $ = require('jquery'), 7 var $ = require('jquery'),
  8 + lazyLoad = require('yoho.lazyload'),
8 Hammer = require('yoho.hammer'); 9 Hammer = require('yoho.hammer');
9 10
10 var $cartContent = $('.cart-content'); 11 var $cartContent = $('.cart-content');
@@ -13,6 +14,8 @@ var navHammer; @@ -13,6 +14,8 @@ var navHammer;
13 14
14 require('./good'); 15 require('./good');
15 16
  17 +lazyLoad($('img.lazy'));
  18 +
16 navHammer = new Hammer(document.getElementsByClassName('cart-nav')[0]); 19 navHammer = new Hammer(document.getElementsByClassName('cart-nav')[0]);
17 navHammer.on('tap', function(e) { 20 navHammer.on('tap', function(e) {
18 var $this = $(e.target).closest('li'); 21 var $this = $(e.target).closest('li');
@@ -58,21 +58,51 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) { @@ -58,21 +58,51 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) {
58 }).on('touchstart', '#chose-btn-sure', function() { 58 }).on('touchstart', '#chose-btn-sure', function() {
59 59
60 //确定 60 //确定
61 -}).on('touchstart', '.block', function() { 61 +}).on('touchstart', '.block', function(e) {
62 62
63 //尺寸颜色点选 63 //尺寸颜色点选
64 - var $this = $(this);  
65 -  
66 - if ($this.hasClass('.chosed') || $this.hasClass('disable')) { 64 + var $this = $(this),
  65 + $that = $(e.target).closest('.chose-items'),
  66 + numArray,
  67 + index;
  68 +
  69 + if ($this.hasClass('chosed')) {
  70 + $this.parent().find('.block').removeClass('chosed');
  71 + $that.find('.num .left-num').html('');
  72 + } else if ($this.hasClass('disable')) {
  73 + $this.css('background-color', '#000');
67 return; 74 return;
  75 + } else if (!$this.hasClass('chosed')) {
  76 + $this.siblings('.chosed').removeClass('chosed');
  77 + $this.addClass('chosed');
  78 + index = $this.index();
  79 +
  80 +
  81 + //根据颜色切换图片
  82 + if ($this.closest('.block-list').hasClass('color-list')) {
  83 + $('.chose-panel .basic-info').find('.thumb').addClass('hide').eq(index).removeClass('hide');
  84 + }
  85 +
  86 + //剩余的商品数
  87 + if ($that.find('.color-list ul>li').hasClass('chosed') && $that.find('.size-list ul>li').hasClass('chosed')) {
  88 + numArray = $this.closest('.block-list').siblings(':first').find('.chosed').data('numstr').split('/');
  89 + $that.find('.num .left-num').html('剩余' + numArray[index] + '件');
  90 + } else {
  91 + $that.find('.num .left-num').html('');
  92 + }
  93 +
  94 + //点击切换
68 } 95 }
69 96
70 - $this.siblings('.chosed').removeClass('chosed');  
71 - $this.addClass('chosed');  
72 }).on('touchstart', '.btn-minus', function() { 97 }).on('touchstart', '.btn-minus', function() {
73 var num = +$num.val(); 98 var num = +$num.val();
74 99
75 - if (num === 1) { 100 + //若颜色和尺码没有被同时选中,则不能点击
  101 + if ($('.block-list>ul>li.chosed').length < 2) {
  102 + return;
  103 + }
  104 +
  105 + if (num === 0) {
76 return; 106 return;
77 } 107 }
78 108
@@ -80,6 +110,11 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) { @@ -80,6 +110,11 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) {
80 }).on('touchstart', '.btn-plus', function() { 110 }).on('touchstart', '.btn-plus', function() {
81 var num = +$num.val(); 111 var num = +$num.val();
82 112
  113 + //若颜色和尺码没有被同时选中,则不能点击
  114 + if ($('.block-list>ul>li.chosed').length < 2) {
  115 + return;
  116 + }
  117 +
83 //TODO:库存数验证 118 //TODO:库存数验证
84 $num.val(num + 1); 119 $num.val(num + 1);
85 }); 120 });
@@ -8,78 +8,151 @@ var $ = require('jquery'), @@ -8,78 +8,151 @@ var $ = require('jquery'),
8 ellipsis = require('mlellipsis'), 8 ellipsis = require('mlellipsis'),
9 lazyLoad = require('yoho.lazyload'); 9 lazyLoad = require('yoho.lazyload');
10 10
11 -var chosePanel = require('./chose-panel'); 11 +var dialog = require('../me/dialog'),
  12 + tip = require('../plugin/tip');
12 13
13 -var $curDelPanel; 14 +var $names;
14 15
15 -//删除面板显示后任何点击行为都将触发隐藏面板  
16 -function docTouchEvt() {  
17 - $curDelPanel && $curDelPanel.addClass('hide'); 16 +//chosePanel = require('./chose-panel');
18 17
19 - //  
20 - $(document).off('touchstart', docTouchEvt);  
21 -} 18 +var cartType = 'ordinary';
  19 +
  20 +//var $curDelPanel;
  21 +
  22 +////删除面板显示后任何点击行为都将触发隐藏面板
  23 +//function docTouchEvt() {
  24 +// $curDelPanel && $curDelPanel.addClass('hide');
  25 +//
  26 +// //
  27 +// $(document).off('touchstart', docTouchEvt);
  28 +//}
22 29
23 ellipsis.init(); 30 ellipsis.init();
24 31
25 -lazyLoad($('.lazy')); 32 +lazyLoad({
  33 + try_again_css: 'order-failure'
  34 +});
26 35
27 -$('.name')[0].mlellipsis(2); 36 +$names = $('.name');
  37 +if ($names.length > 0) {
  38 + $names[0].mlellipsis(2);
  39 +}
28 40
29 //TIP:事件委托在.cart-goods,商品列表的容器统一需要有.cart-goods 41 //TIP:事件委托在.cart-goods,商品列表的容器统一需要有.cart-goods
30 $('.cart-goods').on('touchstart', '.checkbox', function() { 42 $('.cart-goods').on('touchstart', '.checkbox', function() {
31 - var $this = $(this);  
32 -  
33 - if ($this.hasClass('icon-cb-checked')) {  
34 - $this.removeClass('icon-cb-checked').addClass('icon-checkbox');  
35 - } else {  
36 - $this.removeClass('icon-checkbox').addClass('icon-cb-checked');  
37 - }  
38 -}).on('touchstart', '.icon-edit', function() {  
39 - var id = $(this).closest('.shopping-cart-good').data('id'); 43 + var $this = $(this),
  44 + id = $(this).closest('.shopping-cart-good').data('id');
40 45
41 $.ajax({ 46 $.ajax({
42 type: 'GET', 47 type: 'GET',
43 - url: '/shoppingCart/goodinfo', 48 + url: '/shoppingCart/select',
44 data: { 49 data: {
45 id: id 50 id: id
46 - },  
47 - success: function(data) {  
48 - if (data.code === 200) {  
49 - chosePanel.show(data.data); 51 + }
  52 + }).then(function(data) {
  53 + if (data.code === 200) {
  54 + if ($this.hasClass('icon-cb-checked')) {
  55 + $this.removeClass('icon-cb-checked').addClass('icon-checkbox');
  56 + } else {
  57 + $this.removeClass('icon-checkbox').addClass('icon-cb-checked');
50 } 58 }
51 } 59 }
  60 + $.ajax({
  61 + type: 'GET',
  62 + url: '/shoppingCart/getCartData',
  63 + data: {
  64 + id: id
  65 + },
  66 + success: function(data) {
  67 + if (data) {
  68 + $('#good-totalprice').html('¥' + data.commonCart.price);
  69 + $('#good-activityPrice').html('¥' + data.commonCart.activityPrice);
  70 + $('#good-total').html(data.commonCart.count + '件总计:¥' + data.commonCart.sumPrice);
  71 + }
  72 + },
  73 + error: function() {
  74 + tip.show('网络错误');
  75 + }
  76 + });
  77 +
  78 + }).fail(function() {
  79 + tip.show('网络错误');
52 }); 80 });
  81 +}).on('touchstart', '.icon-edit', function() {
  82 +
53 }).on('touchstart', '.icon-del', function(e) { 83 }).on('touchstart', '.icon-del', function(e) {
  84 + var $this = $(this);
  85 +
54 e.stopPropagation(); 86 e.stopPropagation();
55 87
56 //手动触发docTouchEvt清除因点击到del按钮上而被阻止冒泡到doc上的事件从而清除已打开的删除面板 88 //手动触发docTouchEvt清除因点击到del按钮上而被阻止冒泡到doc上的事件从而清除已打开的删除面板
57 - docTouchEvt();  
58 -  
59 - $curDelPanel = $(this).closest('.shopping-cart-good').children('.opt-panel').removeClass('hide');  
60 -  
61 - $(document).on('touchstart', docTouchEvt);  
62 -}).on('touchstart', '.opt-panel', function() {  
63 - var $this = $(this),  
64 - id = $this.closest('.shopping-cart-good').data('id'),  
65 - url;  
66 -  
67 - if ($this.closest('.put-in-favorite').length > 0) {  
68 -  
69 - //移入收藏夹  
70 - url = '/shoppingCart/col';  
71 - } else {  
72 -  
73 - //删除  
74 - url = '/shoppingCart/del';  
75 - } 89 + //docTouchEvt();
  90 + //
  91 + //$curDelPanel = $(this).closest('.shopping-cart-good').children('.opt-panel').removeClass('hide');
  92 + //
  93 + //$(document).on('touchstart', docTouchEvt);
76 94
77 - $.ajax({  
78 - type: 'POST',  
79 - url: url,  
80 - data: {  
81 - id: id 95 + dialog.showDialog({
  96 + dialogText: '您确定要从购物车中删除吗?',
  97 + hasFooter: {
  98 + leftBtnText: '取消',
  99 + rightBtnText: '确定'
82 } 100 }
  101 + }, function() {
  102 + var id = $this.closest('.shopping-cart-good').data('id');
  103 +
  104 + $.ajax({
  105 + method: 'post',
  106 + url: '/shoppingCart/del',
  107 + data: {
  108 + id: id
  109 + }
  110 + }).then(function(data) {
  111 + if (data.code === 200) {
  112 + dialog.showDialog({
  113 + dialogText: '删除成功',
  114 + autoHide: true,
  115 + fast: true
  116 + });
  117 + history.go(0);
  118 + }
  119 + }).fail(function() {
  120 + dialog.showDialog({
  121 + autoHide: true,
  122 + dialogText: '网络错误~'
  123 + });
  124 + });
83 }); 125 });
  126 +
  127 +});
  128 +
  129 +// .on('touchstart', '.opt-panel', function() {
  130 +// var $this = $(this),
  131 +// id = $this.closest('.shopping-cart-good').data('id'),
  132 +// url;
  133 +//
  134 +// if ($this.closest('.put-in-favorite').length > 0) {
  135 +//
  136 +// //移入收藏夹
  137 +// url = '/shoppingCart/col';
  138 +// } else {
  139 +//
  140 +// //删除
  141 +// url = '/shoppingCart/del';
  142 +// }
  143 +//
  144 +// $.ajax({
  145 +// type: 'POST',
  146 +// url: url,
  147 +// data: {
  148 +// id: id
  149 +// }
  150 +// });
  151 +//})
  152 +
  153 +
  154 +$('.btn-balance').on('touchend', function() {
  155 + window.location.href = '/shoppingCart/orderEnsure?cartType=' + cartType;
84 }); 156 });
85 157
  158 +
@@ -7,11 +7,15 @@ @@ -7,11 +7,15 @@
7 var $ = require('jquery'), 7 var $ = require('jquery'),
8 lazyLoad = require('yoho.lazyload'), 8 lazyLoad = require('yoho.lazyload'),
9 Hammer = require('yoho.hammer'), 9 Hammer = require('yoho.hammer'),
  10 + Handlebars = require('yoho.handlebars'),
  11 + tip = require('../plugin/tip'),
10 orderInfo = require('./order-info').orderInfo; 12 orderInfo = require('./order-info').orderInfo;
11 13
12 var dispatchModeHammer, 14 var dispatchModeHammer,
13 dispatchTimeHammer, 15 dispatchTimeHammer,
14 - $invoice = $('.invoice'); 16 + $invoice = $('.invoice'),
  17 + $price = $('.price-cal'),
  18 + priceTmpl = Handlebars.compile($('#tmpl-price').html());
15 19
16 lazyLoad(); 20 lazyLoad();
17 21
@@ -55,9 +59,77 @@ $('.invoice').on('touchend', '.checkbox', function() { @@ -55,9 +59,77 @@ $('.invoice').on('touchend', '.checkbox', function() {
55 } 59 }
56 }); 60 });
57 61
  62 +function orderCompute() {
  63 + $.ajax({
  64 + method: 'POST',
  65 + url: '/shoppingCart/orderCompute',
  66 + data: {
  67 + cartType: orderInfo('cartType'),
  68 + deliveryId: orderInfo('deliveryId'),
  69 + paymentTypeId: orderInfo('paymentTypeId'),
  70 + couponCode: orderInfo('couponCode'),
  71 + yohoCoin: orderInfo('yohoCoin')
  72 + }
  73 + }).then(function(res) {
  74 + var priceHtml;
  75 +
  76 + if (!res) {
  77 + tip.show('网络出错');
  78 + } else {
  79 + priceHtml = priceTmpl({
  80 + sumPrice: res.order_amount,
  81 + salePrice: res.discount_amount,
  82 + freight: res.promotion_formula_list[1].promotion_amount,
  83 + yohoCoin: res.use_yoho_coin,
  84 + price: res.last_order_amount
  85 + });
  86 +
  87 + $price.html(priceHtml);
  88 + }
  89 + }).fail(function() {
  90 + tip.show('网络出错');
  91 + });
  92 +}
  93 +
  94 +function submitOrder() {
  95 + $.ajax({
  96 + method: 'POST',
  97 + url: '/shoppingCart/orderSub',
  98 + data: {
  99 + addressId: orderInfo('addressId'),
  100 + cartType: orderInfo('cartType'),
  101 + deliveryId: orderInfo('deliveryId') || 1,
  102 + deliveryTimeId: orderInfo('deliveryTimeId') || 1,
  103 + invoiceText: orderInfo('invoiceText'),
  104 + invoiceType: orderInfo('invoiceType'),
  105 + msg: orderInfo('msg'),
  106 + paymentTypeId: orderInfo('paymentTypeId'),
  107 + paymentType: orderInfo('paymentType'), //支付方式
  108 + couponCode: orderInfo('couponCode'),
  109 + yohoCoin: orderInfo('yohoCoin')
  110 + }
  111 + }).then(function(res) {
  112 + if (!res) {
  113 + tip.show('网络出错');
  114 + }
  115 + if (res.code !== 200) {
  116 + tip.show(res.message || '网络出错');
  117 + } else {
  118 + console.log(1);
  119 + }
  120 + }).fail(function() {
  121 + tip.show('网络出错');
  122 + });
  123 +}
  124 +
58 // 界面点击,状态存 cookie 125 // 界面点击,状态存 cookie
  126 +if (!orderInfo('addressId')) {
  127 + orderInfo('addressId', $('.address-wrap').data('address-id'));
  128 +}
  129 +
59 $('.dispatch-mode').on('touchend', 'li', function() { 130 $('.dispatch-mode').on('touchend', 'li', function() {
60 orderInfo('deliveryId', $(this).data('id')); 131 orderInfo('deliveryId', $(this).data('id'));
  132 + orderCompute();
61 }); 133 });
62 134
63 $('.dispatch-time').on('touchend', 'li', function() { 135 $('.dispatch-time').on('touchend', 'li', function() {
@@ -69,9 +141,12 @@ $('.coin').on('touchend', function() { @@ -69,9 +141,12 @@ $('.coin').on('touchend', function() {
69 141
70 if ($this.find('.checkbox').hasClass('icon-cb-checked')) { 142 if ($this.find('.checkbox').hasClass('icon-cb-checked')) {
71 orderInfo('yohoCoin', $this.data('yoho-coin')); 143 orderInfo('yohoCoin', $this.data('yoho-coin'));
  144 + $this.find('.coin-check em').show();
72 } else { 145 } else {
73 orderInfo('yohoCoin', 0); 146 orderInfo('yohoCoin', 0);
  147 + $this.find('.coin-check em').hide();
74 } 148 }
  149 + orderCompute();
75 }); 150 });
76 151
77 $invoice.on('touchend', function() { 152 $invoice.on('touchend', function() {
@@ -92,4 +167,6 @@ $('#msg').find('input').on('blur', function() { @@ -92,4 +167,6 @@ $('#msg').find('input').on('blur', function() {
92 167
93 $('.pay-mode').on('click', 'li', function() { 168 $('.pay-mode').on('click', 'li', function() {
94 orderInfo('paymentTypeId', $(this).data('pay-id')); 169 orderInfo('paymentTypeId', $(this).data('pay-id'));
  170 + orderInfo('paymentType', $(this).data('pay-type'));
  171 + submitOrder();
95 }); 172 });
@@ -9,7 +9,20 @@ var info = window.cookie('order-info'); @@ -9,7 +9,20 @@ var info = window.cookie('order-info');
9 try { 9 try {
10 info = JSON.parse(info); 10 info = JSON.parse(info);
11 } catch (e) { 11 } catch (e) {
12 - info = {}; 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('order-info', JSON.stringify(info));
13 } 26 }
14 27
15 exports.orderInfo = function(key, value) { 28 exports.orderInfo = function(key, value) {
1 $vip: sprite-map("me/vip/*.png", $spacing: 10px); 1 $vip: sprite-map("me/vip/*.png", $spacing: 10px);
2 $fav: sprite-map("me/fav/*.png", $spacing: 5px); 2 $fav: sprite-map("me/fav/*.png", $spacing: 5px);
3 3
4 -@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service", "my-guang", "ihelp", "browse-record", "logistic", "pay";  
5 - 4 +@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service", "my-guang", "ihelp", "browse-record", "logistic", "pay","yoho-coin-new", "yoho-coin-detail";
  1 +.yoho-coin-detail-page {
  2 + background: #f0f0f0;
  3 + .money{
  4 + width: 100%;
  5 + height: pxToRem(70px);
  6 + background:#fff;
  7 + margin-bottom: pxToRem(20px);
  8 + line-height: pxToRem(70px);
  9 + font-size: pxToRem(30px);
  10 + text-indent: 1em;
  11 + span{
  12 + color: #f00;
  13 + font-weight: bold;
  14 + }
  15 + }
  16 + .coin-detail {
  17 + background: #fff;
  18 + border-top: 1px solid #e0e0e0;
  19 + border-bottom: 1px solid #e0e0e0;
  20 + }
  21 +
  22 + .detail-item {
  23 + position: relative;
  24 + margin-left: pxToRem(30px);
  25 + border-bottom: 1px solid #e0e0e0;
  26 + color: #444;
  27 + padding: pxToRem(15px) 0;
  28 +
  29 + .title {
  30 + width: pxToRem(480px);
  31 + font-size: pxToRem(28px);
  32 + line-height: pxToRem(40px);
  33 + font-weight: bold;
  34 + overflow: hidden;
  35 + text-overflow: ellipsis;
  36 + white-space: nowrap;
  37 + }
  38 +
  39 + .time {
  40 + font-size: pxToRem(20px);
  41 + line-height: pxToRem(30px);
  42 + color: #b0b0b0;
  43 + }
  44 +
  45 + .count {
  46 + position: absolute;
  47 + right: 0;
  48 + top: 0;
  49 + margin-right: pxToRem(30px);
  50 + font-size: pxToRem(28px);
  51 + font-weight: bold;
  52 + line-height: pxToRem(100px);
  53 + }
  54 + }
  55 +
  56 + li:last-child {
  57 + .detail-item {
  58 + border-bottom: none;
  59 + }
  60 + }
  61 +}
  1 +.yoho-coin-new-page {
  2 + padding-top: pxToRem(30px);
  3 + text-align: center;
  4 +
  5 + .coin-num {
  6 + color: #d0021b;
  7 + font-size: pxToRem(66px);
  8 + font-weight: bold;
  9 + line-height: pxToRem(106px);
  10 + letter-spacing: pxToRem(8px);
  11 + }
  12 +
  13 + .info {
  14 + color: #b0b0b0;
  15 + font-size: pxToRem(24px);
  16 + line-height: 1;
  17 +
  18 + .dollar {
  19 + display: inline-block;
  20 + margin-right: pxToRem(6px);
  21 + vertical-align: middle;
  22 + width: pxToRem(24px);
  23 + height: pxToRem(24px);
  24 + background: image-url("me/yoho-coin/dollar.png") center center;
  25 + background-size: 100%;
  26 + }
  27 + }
  28 +
  29 + .more {
  30 + display: inline-block;
  31 + margin: pxToRem(30px) 0;
  32 + color: #444;
  33 + font-size: pxToRem(24px);
  34 + line-height: pxToRem(36px);
  35 + width: pxToRem(152px);
  36 + height: pxToRem(36px);
  37 + text-align: center;
  38 + border: 1px solid #444;
  39 + border-radius: pxToRem(36px);
  40 + }
  41 +
  42 + .coin-tip {
  43 + margin-bottom: pxToRem(30px);
  44 + padding: pxToRem(20px) pxToRem(30px);
  45 + font-size: pxToRem(24px);
  46 + line-height: pxToRem(32px);
  47 + color: #dc6870;
  48 + border-top: 1px solid #e0e0e0;
  49 + border-bottom: 1px solid #e0e0e0;
  50 +
  51 + .icon {
  52 + display: inline-block;
  53 + width: pxToRem(32px);
  54 + height: pxToRem(32px);
  55 + font-weight: bold;
  56 + border: 2px solid #dc6870;
  57 + border-radius: 50%;
  58 + }
  59 + }
  60 +
  61 + .banner {
  62 + margin-bottom: pxToRem(30px);
  63 + }
  64 +}
@@ -79,6 +79,11 @@ @@ -79,6 +79,11 @@
79 left: 0; 79 left: 0;
80 top: 20rem / $pxConvertRem; 80 top: 20rem / $pxConvertRem;
81 } 81 }
  82 + >span.left-num{
  83 + position: absolute;
  84 + left: pxToRem(380px);
  85 + top: 20rem / $pxConvertRem;
  86 + }
82 } 87 }
83 88
84 .block { 89 .block {
@@ -99,6 +104,11 @@ @@ -99,6 +104,11 @@
99 background-position: bottom right; 104 background-position: bottom right;
100 color: #e10; 105 color: #e10;
101 } 106 }
  107 +
  108 + &.disable {
  109 + color: #e0e0e0;
  110 + border-color: #e0e0e0;
  111 + }
102 } 112 }
103 113
104 .num { 114 .num {
1 .shopping-cart-good { 1 .shopping-cart-good {
  2 + $cartRed: #d0253b;
2 position: relative; 3 position: relative;
3 padding-left: 16rem / $pxConvertRem; 4 padding-left: 16rem / $pxConvertRem;
4 5
@@ -16,26 +17,30 @@ @@ -16,26 +17,30 @@
16 17
17 .info { 18 .info {
18 float: left; 19 float: left;
19 - margin-left: 50rem / $pxConvertRem; 20 + margin-left: 30rem / $pxConvertRem;
20 padding: 16rem / $pxConvertRem 0; 21 padding: 16rem / $pxConvertRem 0;
21 - border-bottom: 1px solid #e0e0e0; 22 + padding-right: 20rem / $pxConvertRem;
22 } 23 }
23 24
24 .thumb { 25 .thumb {
25 float: left; 26 float: left;
26 - width: 120rem / $pxConvertRem;  
27 - height: 160rem / $pxConvertRem; 27 + width: 180rem / $pxConvertRem;
  28 + height: 200rem / $pxConvertRem;
  29 + background-size: 100%;
  30 + background-repeat: no-repeat;
28 } 31 }
29 - 32 +
30 .deps { 33 .deps {
31 - margin-left: 135rem / $pxConvertRem;  
32 - padding-right: 20rem / $pxConvertRem; 34 + margin-left: 173rem / $pxConvertRem;
  35 + padding-bottom: 60rem / $pxConvertRem;
  36 + border-bottom: 1px solid #e0e0e0;
33 } 37 }
34 38
35 .name { 39 .name {
36 font-size: 28rem / $pxConvertRem; 40 font-size: 28rem / $pxConvertRem;
  41 + color: #5a5a5a;
37 } 42 }
38 - 43 +
39 .row:nth-child(2) { 44 .row:nth-child(2) {
40 font-size: 22rem / $pxConvertRem; 45 font-size: 22rem / $pxConvertRem;
41 height: 45rem / $pxConvertRem; 46 height: 45rem / $pxConvertRem;
@@ -55,12 +60,14 @@ @@ -55,12 +60,14 @@
55 } 60 }
56 61
57 .appear-date { 62 .appear-date {
58 - color: #e01; 63 + color: $cartRed;
  64 + display: block;
  65 + margin-top: 4rem / $pxConvertRem;
59 } 66 }
60 67
61 .price { 68 .price {
62 font-size: 24rem / $pxConvertRem; 69 font-size: 24rem / $pxConvertRem;
63 - color: #000; 70 + color: $cartRed;
64 } 71 }
65 72
66 .count { 73 .count {
@@ -78,7 +85,11 @@ @@ -78,7 +85,11 @@
78 border: none; 85 border: none;
79 color: #fff; 86 color: #fff;
80 text-align: center; 87 text-align: center;
81 - margin-left: 16rem / $pxConvertRem; 88 + float: right;
  89 + margin-top: 20rem / $pxConvertRem;
  90 + margin-right: 16rem / $pxConvertRem;
  91 + border-radius: 20rem / $pxConvertRem;
  92 + padding: 4rem / $pxConvertRem;
82 } 93 }
83 94
84 .sold-out { 95 .sold-out {
@@ -86,7 +97,7 @@ @@ -86,7 +97,7 @@
86 } 97 }
87 98
88 .low-stocks { 99 .low-stocks {
89 - background: #e01; 100 + background: #7f7f7f;
90 } 101 }
91 102
92 .icon-del, 103 .icon-del,
@@ -140,4 +151,10 @@ @@ -140,4 +151,10 @@
140 } 151 }
141 } 152 }
142 } 153 }
143 -}  
  154 +}
  155 +
  156 +.shopping-cart-good:last-child {
  157 + .deps {
  158 + border: none;
  159 + }
  160 +}
  1 +{{# currency}}
  2 + <li>
  3 + <div class="detail-item">
  4 + <p class="title">{{title}}</p>
  5 + <p class="time">{{time}}</p>
  6 + <div class="count">
  7 + {{count}}
  8 + </div>
  9 + </div>
  10 + </li>
  11 +{{/ currency}}
  1 +
  2 +{{> layout/header}}
  3 +<div class="yoho-coin-detail-page yoho-page">
  4 + <div class="money">你拥有的有货币:<span>{{ money}}</span></div>
  5 +
  6 + <ul class="coin-detail"></ul>
  7 +</div>
  8 +{{> layout/footer}}
  1 +{{> layout/header}}
  2 +<div class="yoho-coin-new-page yoho-page">
  3 + <div class="coin">
  4 + <p class="coin-num">
  5 + 7876
  6 + </p>
  7 + <p class="info">
  8 + <span class="dollar"></span>
  9 + YOHO
  10 + </p>
  11 + <a href="" class="more">查看明细</a>
  12 + <div class="coin-tip">
  13 + <span class="icon">!</span>
  14 + 您有300个YOHO币即将于20171231日过期,请尽快使用
  15 + </div>
  16 + </div>
  17 + <div class="banner">
  18 + <a href="">
  19 + {{!-- 演示图片 --}}
  20 + <img src="http://temp.im/640x200" alt="">
  21 + </a>
  22 + </div>
  23 +
  24 + {{> home/maybe_like}}
  25 +</div>
  26 +{{> layout/footer}}
@@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
81 优惠券 81 优惠券
82 <span class="iconfont num">{{coupon_num}} &#xe604;</span> 82 <span class="iconfont num">{{coupon_num}} &#xe604;</span>
83 </a> 83 </a>
84 - <a class="list-item" href="/home/currency"> 84 + <a class="list-item" href="/home/currencyDetail">
85 <span class="iconfont icon">&#xe635;</span> 85 <span class="iconfont icon">&#xe635;</span>
86 YOHO 86 YOHO
87 <span class="iconfont num">{{yoho_coin_num}} &#xe604;</span> 87 <span class="iconfont num">{{yoho_coin_num}} &#xe604;</span>
1 {{> layout/header}} 1 {{> layout/header}}
2 <div class="order-ensure-page yoho-page"> 2 <div class="order-ensure-page yoho-page">
3 {{# orderEnsure}} 3 {{# orderEnsure}}
4 - <a class="address-wrap block" href="/shoppingCart/selectAddress"> 4 + <a class="address-wrap block" href="/shoppingCart/selectAddress" data-address-id="{{addressId}}">
5 <p class="infos"> 5 <p class="infos">
6 收货地址 6 收货地址
7 <span class="per-info">{{name}} {{phoneNum}}</span> 7 <span class="per-info">{{name}} {{phoneNum}}</span>
@@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
41 41
42 <section class="block"> 42 <section class="block">
43 <ul class="sale-invoice"> 43 <ul class="sale-invoice">
44 - {{# coupon}} 44 + {{#if coupon}}
45 <li class="coupon"> 45 <li class="coupon">
46 <a href="/shoppingCart/selectCoupon"> 46 <a href="/shoppingCart/selectCoupon">
47 <!-- <a href="{{url}}"> --> 47 <!-- <a href="{{url}}"> -->
@@ -65,7 +65,7 @@ @@ -65,7 +65,7 @@
65 {{/if}} 65 {{/if}}
66 </a> 66 </a>
67 </li> 67 </li>
68 - {{/ coupon}} 68 + {{/if}}
69 69
70 {{# yohoCoin}} 70 {{# yohoCoin}}
71 <li class="coin" data-yoho-coin="{{.}}"> 71 <li class="coin" data-yoho-coin="{{.}}">
@@ -79,16 +79,16 @@ @@ -79,16 +79,16 @@
79 {{/ yohoCoin}} 79 {{/ yohoCoin}}
80 80
81 {{#if invoice}} 81 {{#if invoice}}
82 - <li class="invoice"> 82 + <li class="invoice {{#if needInvoice}}focus{{/if}}">
83 <span class="title">发票</span> 83 <span class="title">发票</span>
84 - <span class="iconfont checkbox icon-checkbox"></span> 84 + <span class="iconfont checkbox {{#if needInvoice}}icon-cb-checked{{else}}icon-checkbox{{/if}}"></span>
85 <form id="invoice"> 85 <form id="invoice">
86 - <input type="text" name="invoice-title" value="" placeholder="发票抬头"> 86 + <input type="text" name="invoice-title" value="{{invoiceText}}" placeholder="发票抬头">
87 <label> 87 <label>
88 发票类型 88 发票类型
89 <select class="invoice-type" name="invoice-type"> 89 <select class="invoice-type" name="invoice-type">
90 {{# invoice}} 90 {{# invoice}}
91 - <option value="{{id}}">{{name}}</option> 91 + <option value="{{id}}" {{#if isSelected}}selected{{/if}}>{{name}}</option>
92 {{/ invoice}} 92 {{/ invoice}}
93 </select> 93 </select>
94 </label> 94 </label>
@@ -98,27 +98,27 @@ @@ -98,27 +98,27 @@
98 </ul> 98 </ul>
99 99
100 <form id="msg" action="" method="post"> 100 <form id="msg" action="" method="post">
101 - <input type="text" name="msg" value="" placeholder="留言"> 101 + <input type="text" name="msg" value="{{msg}}" placeholder="留言">
102 </form> 102 </form>
103 </section> 103 </section>
104 104
105 - <section class="block"> 105 + <section class="price-cal block">
106 <ul class="total"> 106 <ul class="total">
107 <li> 107 <li>
108 <span>总价</span> 108 <span>总价</span>
109 - &nbsp;&nbsp;¥ {{sumPrice}} 109 + &nbsp;&nbsp;¥{{sumPrice}}
110 </li> 110 </li>
111 <li> 111 <li>
112 <span>活动价</span> 112 <span>活动价</span>
113 - - ¥ {{salePrice}} 113 + - ¥{{salePrice}}
114 </li> 114 </li>
115 <li> 115 <li>
116 <span>运费</span> 116 <span>运费</span>
117 - + ¥ {{freight}} 117 + + ¥{{freight}}
118 </li> 118 </li>
119 <li> 119 <li>
120 <span>YOHO币</span> 120 <span>YOHO币</span>
121 - - ¥ {{yohoCoin}} 121 + - ¥{{yohoCoin}}
122 </li> 122 </li>
123 <li class="cost"> 123 <li class="cost">
124 应付金额: <em>¥{{price}}</em> 124 应付金额: <em>¥{{price}}</em>
@@ -128,7 +128,7 @@ @@ -128,7 +128,7 @@
128 128
129 <ul class="pay-mode"> 129 <ul class="pay-mode">
130 {{# paymentWay}} 130 {{# paymentWay}}
131 - <li class="{{#if default}}default{{/if}}" data-pay-id={{id}}> 131 + <li class="{{#if default}}default{{/if}}" data-pay-type="{{paymentType}}" data-pay-id="{{id}}">
132 <span class="iconfont"> 132 <span class="iconfont">
133 {{#if default}} 133 {{#if default}}
134 &#xe62f; 134 &#xe62f;
@@ -142,4 +142,27 @@ @@ -142,4 +142,27 @@
142 </ul> 142 </ul>
143 {{/ orderEnsure}} 143 {{/ orderEnsure}}
144 </div> 144 </div>
  145 +<script id="tmpl-price" type="text/tmpl">
  146 + <ul class="total">
  147 + <li>
  148 + <span>总价</span>
  149 + &nbsp;&nbsp;¥\{{sumPrice}}
  150 + </li>
  151 + <li>
  152 + <span>活动价</span>
  153 + - ¥\{{salePrice}}
  154 + </li>
  155 + <li>
  156 + <span>运费</span>
  157 + + \{{freight}}
  158 + </li>
  159 + <li>
  160 + <span>YOHO币</span>
  161 + - ¥\{{yohoCoin}}
  162 + </li>
  163 + <li class="cost">
  164 + 应付金额: <em>¥\{{price}}</em>
  165 + </li>
  166 + </ul>
  167 +</script>
145 {{> layout/footer}} 168 {{> layout/footer}}
@@ -324,3 +324,8 @@ @@ -324,3 +324,8 @@
324 seajs.use('js/me/pay'); 324 seajs.use('js/me/pay');
325 </script> 325 </script>
326 {{/if}} 326 {{/if}}
  327 +{{#if currencyDetail}}
  328 +<script>
  329 + seajs.use('js/me/currency');
  330 +</script>
  331 +{{/if}}
@@ -32,26 +32,26 @@ @@ -32,26 +32,26 @@
32 <div class="price-compute"> 32 <div class="price-compute">
33 <p class="sum-price"> 33 <p class="sum-price">
34 <span class="title">总价</span> 34 <span class="title">总价</span>
35 - ¥{{price}} 35 + <span id="good-totalprice">¥{{price}}</span>
36 </p> 36 </p>
37 <p class="activity-price"> 37 <p class="activity-price">
38 <span class="title"> 38 <span class="title">
39 活动价 39 活动价
40 <i class="minus">-</i> 40 <i class="minus">-</i>
41 </span> 41 </span>
42 - ¥{{activityPrice}} 42 + <span id="good-activityPrice">¥{{activityPrice}}</span>
43 </p> 43 </p>
44 </div> 44 </div>
45 45
46 <div class="balance"> 46 <div class="balance">
47 <span class="iconfont icon-cb-checked"></span> 47 <span class="iconfont icon-cb-checked"></span>
48 <p> 48 <p>
49 - <span> 49 + <span id="good-total">
50 {{count}}件总计:¥{{sumPrice}} 50 {{count}}件总计:¥{{sumPrice}}
51 </span> 51 </span>
52 <span class="tip">(不含运费)</span> 52 <span class="tip">(不含运费)</span>
53 </p> 53 </p>
54 - <button class="btn-balance"> 54 + <a class="btn-balance">
55 结算 55 结算
56 - </button> 56 + </a>
57 </div> 57 </div>
@@ -3,7 +3,13 @@ @@ -3,7 +3,13 @@
3 <div class="main"> 3 <div class="main">
4 <div class="infos"> 4 <div class="infos">
5 <div class="basic-info"> 5 <div class="basic-info">
6 - <img class="thumb" src={{thumb}}> 6 + {{#thumbs}}
  7 + {{#if @first}}
  8 + <img class="thumb" src={{img}}>
  9 + {{else}}
  10 + <img class="thumb hide" src={{img}}>
  11 + {{/if}}
  12 + {{/thumbs}}
7 <div class="text-info"> 13 <div class="text-info">
8 <p class="name">{{name}}</p> 14 <p class="name">{{name}}</p>
9 <p class="price"> 15 <p class="price">
@@ -15,21 +21,21 @@ @@ -15,21 +21,21 @@
15 </div> 21 </div>
16 </div> 22 </div>
17 <div class="chose-items"> 23 <div class="chose-items">
18 - <div class="color-list"> 24 + <div class="color-list block-list">
19 <span>颜色</span> 25 <span>颜色</span>
20 <ul class="clearfix" data-type="color"> 26 <ul class="clearfix" data-type="color">
21 {{# colors}} 27 {{# colors}}
22 - <li class="block {{#if chosed}}chosed{{/if}}" data-id={{id}}> 28 + <li class="block {{#if chosed}}chosed{{/if}} {{#unless colorNum}}disable{{/unless}}" data-id={{id}} data-numstr="{{sizeNumStr}}">
23 {{name}} 29 {{name}}
24 </li> 30 </li>
25 {{/ colors}} 31 {{/ colors}}
26 </ul> 32 </ul>
27 </div> 33 </div>
28 - <div class="size-list"> 34 + <div class="size-list block-list">
29 <span>尺码</span> 35 <span>尺码</span>
30 - <ul class="clearfix {{#if @first}}{{^}}hide{{/if}}" data-type="size" > 36 + <ul class="clearfix" data-type="size" >
31 {{# sizes}} 37 {{# sizes}}
32 - <li class="block {{#if chosed}}chosed{{/if}}" data-id={{id}}> 38 + <li class="block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}disable{{/unless}}" data-id={{id}} data-numstr="{{colorNumStr}}">
33 {{name}} 39 {{name}}
34 </li> 40 </li>
35 {{/ sizes}} 41 {{/ sizes}}
@@ -44,8 +50,9 @@ @@ -44,8 +50,9 @@
44 <input id="good-num" class="good-num" type="text" value={{num}}> 50 <input id="good-num" class="good-num" type="text" value={{num}}>
45 <a class="btn btn-plus" href="javascript:void(0);"> 51 <a class="btn btn-plus" href="javascript:void(0);">
46 <span class="iconfont">&#xe624;</span> 52 <span class="iconfont">&#xe624;</span>
47 - </a> 53 + </a>
48 </div> 54 </div>
  55 + <span class="left-num"></span>
49 </div> 56 </div>
50 </div> 57 </div>
51 </div> 58 </div>
@@ -22,6 +22,9 @@ @@ -22,6 +22,9 @@
22 <span class="price"> 22 <span class="price">
23 ¥{{price}} 23 ¥{{price}}
24 </span> 24 </span>
  25 + <span class="price">
  26 + ¥{{salePrice}}
  27 + </span>
25 <span class="count"> 28 <span class="count">
26 ×{{count}} 29 ×{{count}}
27 </span> 30 </span>
@@ -17,11 +17,6 @@ @@ -17,11 +17,6 @@
17 </span> 17 </span>
18 {{/if}} 18 {{/if}}
19 19
20 - {{#if appearDate}}  
21 - <span class="appear-date">  
22 - 上市期:{{appearDate}}  
23 - </span>  
24 - {{/if}}  
25 </p> 20 </p>
26 <p class="row"> 21 <p class="row">
27 <span class="price"> 22 <span class="price">
@@ -36,18 +31,27 @@ @@ -36,18 +31,27 @@
36 </span> 31 </span>
37 {{/if}} 32 {{/if}}
38 33
  34 +
  35 + <span class="iconfont icon-edit">&#xe61e;</span>
  36 + <span class="iconfont icon-del">&#xe621;</span>
  37 + </p>
  38 + <p class="row">
39 {{#if lowStocks}} 39 {{#if lowStocks}}
40 <span class="low-stocks"> 40 <span class="low-stocks">
41 库存不足 41 库存不足
42 </span> 42 </span>
43 {{/if}} 43 {{/if}}
44 -  
45 - <span class="iconfont icon-edit">&#xe61e;</span>  
46 - <span class="iconfont icon-del">&#xe621;</span> 44 + </p>
  45 + <p class="row">
  46 + {{#if appearDate}}
  47 + <span class="appear-date">
  48 + 上市期:{{appearDate}}
  49 + </span>
  50 + {{/if}}
47 </p> 51 </p>
48 </div> 52 </div>
49 </div> 53 </div>
50 - <div class="opt-panel hide"> 54 + <!--<div class="opt-panel hide">
51 <div class="put-in-favorite"> 55 <div class="put-in-favorite">
52 <span class="iconfont">&#xe622;</span> 56 <span class="iconfont">&#xe622;</span>
53 <span>移入</span> 57 <span>移入</span>
@@ -57,5 +61,5 @@ @@ -57,5 +61,5 @@
57 <span class="iconfont">&#xe626;</span> 61 <span class="iconfont">&#xe626;</span>
58 删除 62 删除
59 </div> 63 </div>
60 - </div>  
61 -</div>  
  64 + </div>-->
  65 +</div>
@@ -876,5 +876,45 @@ class HomeController extends AbstractAction @@ -876,5 +876,45 @@ class HomeController extends AbstractAction
876 ); 876 );
877 $this->_view->display('helpDetail', $data); 877 $this->_view->display('helpDetail', $data);
878 } 878 }
  879 + /**
  880 + * YOHO币详情 新版
  881 + */
  882 + public function currencyDetailAction()
  883 + {
  884 + $this->setTitle('YOHO币');
  885 + $this->setNavHeader('YOHO币', true, false);
  886 +
  887 + $data['money'] = '0';
  888 + $page = $this->post('page',1);
  889 + $size = $this->post('size', 20);
  890 + // $data = UserModel::getYohoCoinLists($this->_uid,$page,$size);
  891 + $data = UserModel::getYohoCoinLists(3965746,$page,$size);
  892 + $this->_view->display('currency-detail', array(
  893 + 'money' => $data['money'],
  894 + 'pageFooter' => true,
  895 + 'currencyDetail' => true,
  896 + 'currencyDetailPage' => true
  897 + ));
  898 +
  899 + }
  900 +
  901 + /**
  902 + * YOHO币详情 AJAX
  903 + */
  904 + public function ajaxCurrencyDetailAction()
  905 + {
  906 + $data['list'] = array();
  907 + $data['money'] = 0;
  908 + $page = $this->post('page',1);
  909 + $size = $this->post('size', 20);
  910 + $data = UserModel::getYohoCoinLists($this->_uid,$page,$size);
  911 + //$data = UserModel::getYohoCoinLists(3965746,$page,$size);
  912 + $this->_view->display('ajax-currency-detail', array(
  913 + 'currency' => $data['list'],
  914 + 'pageFooter' => true,
  915 + 'currencyDetailPage' => true
  916 + ));
  917 +
  918 + }
879 919
880 } 920 }
@@ -13,7 +13,6 @@ class ShoppingCartController extends AbstractAction @@ -13,7 +13,6 @@ class ShoppingCartController extends AbstractAction
13 /* 13 /*
14 * 购物车首页 14 * 购物车首页
15 */ 15 */
16 -  
17 public function indexAction() 16 public function indexAction()
18 { 17 {
19 $this->setTitle('购物车'); 18 $this->setTitle('购物车');
@@ -30,6 +29,47 @@ class ShoppingCartController extends AbstractAction @@ -30,6 +29,47 @@ class ShoppingCartController extends AbstractAction
30 // 渲染模板 29 // 渲染模板
31 $this->_view->display('index', $data); 30 $this->_view->display('index', $data);
32 } 31 }
  32 + /*
  33 + * 异步获取购物车数据
  34 + */
  35 + public function getCartDataAction()
  36 + {
  37 + $result = array();
  38 +
  39 + if ($this->isAjax()) {
  40 + $shoppingKey = Helpers::getShoppingKeyByCookie();
  41 + $uid = $this->getUid(true);
  42 +
  43 + $result = CartModel::getCartData($uid, $shoppingKey);
  44 + }
  45 +
  46 + if (empty($result)) {
  47 + echo ' ';
  48 + } else {
  49 + $this->echoJson($result);
  50 + }
  51 + }
  52 +
  53 + /**
  54 + * 购物车商品选择与取消
  55 + */
  56 + public function selectAction()
  57 + {
  58 + $result = array();
  59 +
  60 + if ($this->isAjax()) {
  61 + $productId = $this->post('id', 0);
  62 + $uid = $this->getUid(true);
  63 + $shoppingKey = $this->getSession('shoppingKey');
  64 + $result = CartModel::selectGoods($uid, $productId, $shoppingKey);
  65 + }
  66 +
  67 + if (empty($result)) {
  68 + echo ' ';
  69 + } else {
  70 + $this->echoJson($result);
  71 + }
  72 + }
33 73
34 /** 74 /**
35 * 移出购物车 75 * 移出购物车
@@ -155,8 +195,7 @@ class ShoppingCartController extends AbstractAction @@ -155,8 +195,7 @@ class ShoppingCartController extends AbstractAction
155 'orderEnsurePage' => true, 195 'orderEnsurePage' => true,
156 'orderEnsure' => CartModel::cartPay($uid, $cartType, $cookieData) 196 'orderEnsure' => CartModel::cartPay($uid, $cartType, $cookieData)
157 ); 197 );
158 -  
159 - 198 + // var_dump($data);
160 $this->_view->display('order-ensure', $data); 199 $this->_view->display('order-ensure', $data);
161 } 200 }
162 201
@@ -169,10 +208,10 @@ class ShoppingCartController extends AbstractAction @@ -169,10 +208,10 @@ class ShoppingCartController extends AbstractAction
169 208
170 if ($this->isAjax()) { 209 if ($this->isAjax()) {
171 $cartType = $this->post('cartType', 'ordinary'); 210 $cartType = $this->post('cartType', 'ordinary');
172 - $deliveryWay = $this->post('deliveryWay', 1);  
173 - $paymentType = $this->post('paymentType', 1);  
174 - $couponCode = $this->post('paymentType', null);  
175 - $yohoCoin = $this->post('paymentType', null); 211 + $deliveryWay = $this->post('deliveryId', 1);
  212 + $paymentType = $this->post('paymentTypeId', 1);
  213 + $couponCode = $this->post('couponCode', null);
  214 + $yohoCoin = $this->post('yohoCoin', null);
176 $uid = $this->getUid(true); 215 $uid = $this->getUid(true);
177 $result = CartModel::orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $yohoCoin); 216 $result = CartModel::orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $yohoCoin);
178 } 217 }
@@ -268,13 +307,13 @@ class ShoppingCartController extends AbstractAction @@ -268,13 +307,13 @@ class ShoppingCartController extends AbstractAction
268 $uid = $this->getUid(true); 307 $uid = $this->getUid(true);
269 $addressId = $this->post('addressId', null); 308 $addressId = $this->post('addressId', null);
270 $cartType = $this->post('cartType', 'ordinary'); // 默认普通购物车 309 $cartType = $this->post('cartType', 'ordinary'); // 默认普通购物车
271 - $deliveryTime = $this->post('deliveryTime', 1); // 默认只工作日配送  
272 - $deliveryWay = $this->post('deliveryWay', 1); // 默认普通快递  
273 - $invoiceTitle = $this->post('invoiceTitle', null);  
274 - $invoiceId = $this->post('invoiceId', null);  
275 - $paymentId = $this->post('paymentId', 15); 310 + $deliveryTime = $this->post('deliveryTimeId', 1); // 默认只工作日配送
  311 + $deliveryWay = $this->post('deliveryId', 1); // 默认普通快递
  312 + $invoiceTitle = $this->post('invoiceText', null);
  313 + $invoiceId = $this->post('invoiceType', null);
  314 + $paymentId = $this->post('paymentTypeId', 15);
276 $paymentType = $this->post('paymentType', 1); // 默认在线支付 315 $paymentType = $this->post('paymentType', 1); // 默认在线支付
277 - $remark = $this->post('remark', null); // 默认在线支付 316 + $remark = $this->post('msg', null);
278 $yohoCoin = $this->post('yohoCoin', 1); 317 $yohoCoin = $this->post('yohoCoin', 1);
279 $result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $yohoCoin); 318 $result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $yohoCoin);
280 } 319 }
@@ -283,7 +322,7 @@ class ShoppingCartController extends AbstractAction @@ -283,7 +322,7 @@ class ShoppingCartController extends AbstractAction
283 echo ' '; 322 echo ' ';
284 } else { 323 } else {
285 // 提交成功清除Cookie 324 // 提交成功清除Cookie
286 - $this->setCookie('orderInfo', null); 325 + $this->setCookie('order-info', null);
287 326
288 $this->echoJson($result); 327 $this->echoJson($result);
289 } 328 }
@@ -63,13 +63,13 @@ class CartModel @@ -63,13 +63,13 @@ class CartModel
63 63
64 /* 普通购物车 */ 64 /* 普通购物车 */
65 if(isset($cart['ordinary_cart_data'])) { 65 if(isset($cart['ordinary_cart_data'])) {
66 - $result['commonGoodsCount'] = count($cart['ordinary_cart_data']['goods_list']); 66 + $result['commonGoodsCount'] = $cart['ordinary_cart_data']['shopping_cart_data']['goods_count'];
67 $result['commonCart'] = self::procCartData($cart['ordinary_cart_data']); 67 $result['commonCart'] = self::procCartData($cart['ordinary_cart_data']);
68 } 68 }
69 69
70 /* 预售购物车 */ 70 /* 预售购物车 */
71 if(isset($cart['advance_cart_data'])) { 71 if(isset($cart['advance_cart_data'])) {
72 - $result['presellGoodsCount'] = count($cart['advance_cart_data']['goods_list']); 72 + $result['presellGoodsCount'] = $cart['advance_cart_data']['shopping_cart_data']['goods_count'];
73 $result['preSellCart'] = self::procCartData($cart['advance_cart_data']); 73 $result['preSellCart'] = self::procCartData($cart['advance_cart_data']);
74 } 74 }
75 75
@@ -79,6 +79,30 @@ class CartModel @@ -79,6 +79,30 @@ class CartModel
79 } 79 }
80 80
81 /** 81 /**
  82 + * 购物车商品选择与取消接口返回的数据处理
  83 + *
  84 + * @param int $uid 用户ID
  85 + * @param string $sku 商品sku列表
  86 + * @param string $shoppingKey 未登录用户唯一识别码
  87 + * @return array 处理之后的数据的数据
  88 + */
  89 + public static function selectGoods($uid, $sku, $shoppingKey)
  90 + {
  91 + $result = array('code' => 400, 'message' => '出错啦~');
  92 +
  93 + // 处理sku
  94 + $sku_list = json_encode(array($sku => 1));
  95 +
  96 + $select = CartData::selectGoods($uid, $sku_list, $shoppingKey);
  97 + if ($select && isset($select['code'])) {
  98 + $result['code'] = $select['code'];
  99 + $result['message'] = $select['message'];
  100 + }
  101 +
  102 + return $result;
  103 + }
  104 +
  105 + /**
82 * 移出购物车 106 * 移出购物车
83 * 107 *
84 * @param int $uid 用户ID 108 * @param int $uid 用户ID
@@ -306,7 +330,7 @@ class CartModel @@ -306,7 +330,7 @@ class CartModel
306 // cookie保存的数据 330 // cookie保存的数据
307 if (!empty($cookieData)) { 331 if (!empty($cookieData)) {
308 $orderInfo = json_decode($cookieData, true); 332 $orderInfo = json_decode($cookieData, true);
309 -// $orderCompute = self::orderCompute($uid, $cartType, $orderInfo['deliveryId'], $orderInfo['paymentTypeId'], $orderInfo['couponCode'], $orderInfo['yohoCoin']); 333 + $orderCompute = self::orderCompute($uid, $cartType, $orderInfo['deliveryId'], $orderInfo['paymentTypeId'], $orderInfo['couponCode'], $orderInfo['yohoCoin']);
310 } 334 }
311 335
312 // 根据地址id查询地址信息 336 // 根据地址id查询地址信息
@@ -425,13 +449,24 @@ class CartModel @@ -425,13 +449,24 @@ class CartModel
425 $one = array(); 449 $one = array();
426 $one['id'] = $inv['invoices_type_id']; 450 $one['id'] = $inv['invoices_type_id'];
427 $one['name'] = $inv['invoices_type_name']; 451 $one['name'] = $inv['invoices_type_name'];
  452 + isset($orderInfo['invoiceType']) && $one['id'] == $orderInfo['invoiceType'] && $one['isSelected'] = true;
428 453
429 $result['invoice'][] = $one; 454 $result['invoice'][] = $one;
430 } 455 }
  456 +
  457 + // 发票信息需要记录
  458 + if (isset($orderInfo['invoice'])) {
  459 + $result['needInvoice'] = $orderInfo['invoice'];
  460 + $result['invoiceText'] = $orderInfo['invoiceText'];
  461 + }
  462 +
431 } 463 }
432 464
  465 + // 留言
  466 + isset($orderInfo['msg']) && $result['msg'] = $orderInfo['msg'];
  467 +
433 // 优惠券数据 468 // 优惠券数据
434 - $coupons = array('notUsed' => true); 469 + $coupons = array();
435 !empty($orderCompute['coupon_amount']) && $coupons['value'] = $orderInfo['couponValue']; 470 !empty($orderCompute['coupon_amount']) && $coupons['value'] = $orderInfo['couponValue'];
436 $coupons += self::getCouponList($uid, 0, 1, true); 471 $coupons += self::getCouponList($uid, 0, 1, true);
437 $result['coupon'] = $coupons; 472 $result['coupon'] = $coupons;
@@ -540,7 +575,7 @@ class CartModel @@ -540,7 +575,7 @@ class CartModel
540 $result = array(); 575 $result = array();
541 576
542 $orderSubRes = CartData::orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $yohoCoin); 577 $orderSubRes = CartData::orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $yohoCoin);
543 - if ($orderSubRes && isset($orderSubRes['code']) && $orderSubRes['code'] === 200) { 578 + if ($orderSubRes && isset($orderSubRes['code'])) {
544 $result = $orderSubRes; 579 $result = $orderSubRes;
545 } 580 }
546 581
@@ -559,26 +594,19 @@ class CartModel @@ -559,26 +594,19 @@ class CartModel
559 $result = array(); 594 $result = array();
560 595
561 $oneGoods = array(); 596 $oneGoods = array();
562 - // 购买的商品列表  
563 - foreach ($data['goods_list'] as $value) {  
564 - $oneGoods['id'] = $value['product_sku'];  
565 - $oneGoods['skn'] = $value['product_skn'];  
566 - $oneGoods['name'] = $value['product_name'];  
567 - $oneGoods['thumb'] = Images::getImageUrl($value['goods_images'], 120, 120);  
568 - $oneGoods['color'] = $value['color_name'];  
569 - $oneGoods['size'] = $value['size_name'];  
570 - $oneGoods['appearDate'] = '12月'; // 目前app接口没有返回该数据  
571 - $oneGoods['price'] = $value['real_price'];  
572 - $oneGoods['count'] = $value['buy_number'];  
573 - $oneGoods['lowStocks'] = true;  
574 -  
575 - $result['goods'][] = $oneGoods;  
576 - } 597 + // 购买的可用商品列表
  598 + $validGoods = Helpers::formatCartGoods($data['goods_list']);
  599 + !empty($validGoods) && $result['goods'] = $validGoods;
  600 +
  601 + // 失效商品列表
  602 + $notValidGoods = Helpers::formatCartGoods($data['sold_out_goods_list']);
  603 + !empty($notValidGoods) && $result['$notValidGoods'] = $notValidGoods;
  604 +
577 // 赠品 605 // 赠品
578 - count($data['gift_list']) && $result['freebieOrAdvanceBuy'] = true; 606 + (count($data['gift_list']) || count($data['price_gift'])) && $result['freebieOrAdvanceBuy'] = true;
579 $result['freebie'] = $data['gift_list']; 607 $result['freebie'] = $data['gift_list'];
580 // 加价购 608 // 加价购
581 - $result['advanceBuy'] = $data['price_gift']; 609 + $result['advanceBuy'] = Helpers::formatAdvanceGoods($data['price_gift']);
582 // 结算数据 610 // 结算数据
583 $result['price'] = $data['shopping_cart_data']['order_amount']; 611 $result['price'] = $data['shopping_cart_data']['order_amount'];
584 $result['activityPrice'] = $data['shopping_cart_data']['discount_amount']; 612 $result['activityPrice'] = $data['shopping_cart_data']['discount_amount'];
@@ -369,6 +369,37 @@ class UserModel @@ -369,6 +369,37 @@ class UserModel
369 } 369 }
370 370
371 /** 371 /**
  372 + * 处理YOHO币变化履历数据
  373 + *
  374 + * @param int $uid 用户ID
  375 + * @param int $page 当前页
  376 + * @param int $limit 一页记录数
  377 + * @return array|mixed 处理之后的YOHO币数据
  378 + */
  379 + public static function getYohoCoinLists($uid, $page, $limit)
  380 + {
  381 + $result = array();
  382 +
  383 + // 调用接口获取YOHO币
  384 + $yohoCoin = UserData::yohoCoinData($uid, $page, $limit, 'post');
  385 + // 处理YOHO币数据
  386 + if(isset($yohoCoin['data']) && !empty($yohoCoin['data'])){
  387 + $coinList = $yohoCoin['data']['coinlist'];
  388 + $data['money'] = $yohoCoin['data']['total'];
  389 + foreach($coinList as $key => $val){
  390 + $result[$key]['title'] = $val['message'];
  391 + $result[$key]['time'] = $val['date'];
  392 + if($val['num'] > 0){
  393 + $val['num'] = '+'.$val['num'];
  394 + }
  395 + $result[$key]['count'] = $val['num'];
  396 + }
  397 + }
  398 + $data['list'] = $result;
  399 + return $data;
  400 + }
  401 +
  402 + /**
372 * 处理优惠券数据 403 * 处理优惠券数据
373 * 404 *
374 * @param int $uid 用户ID 405 * @param int $uid 用户ID
@@ -56,8 +56,8 @@ class BindController extends AbstractAction @@ -56,8 +56,8 @@ class BindController extends AbstractAction
56 $nickname = $this->get('nickname'); 56 $nickname = $this->get('nickname');
57 $areaCode = $this->get('areaCode', '86'); 57 $areaCode = $this->get('areaCode', '86');
58 $isReg = $this->get('isReg'); 58 $isReg = $this->get('isReg');
59 - $mobile=$this->get('mobile');  
60 - 59 + $phoneNum=$this->get('phoneNum');
  60 +
61 $data = array( 61 $data = array(
62 'bindIndex'=>true,//js标识 62 'bindIndex'=>true,//js标识
63 'backUrl' => '/', // 返回的URL链接 63 'backUrl' => '/', // 返回的URL链接
@@ -68,7 +68,7 @@ class BindController extends AbstractAction @@ -68,7 +68,7 @@ class BindController extends AbstractAction
68 'nickname' => $nickname, //昵称 68 'nickname' => $nickname, //昵称
69 'isReg' => $isReg, //是否是已注册过的手机号 69 'isReg' => $isReg, //是否是已注册过的手机号
70 'areaCode' => $areaCode, //国别码 70 'areaCode' => $areaCode, //国别码
71 - 'phoneNum'=>$mobile,//手机号码 71 + 'phoneNum'=>$phoneNum,//手机号码
72 ); 72 );
73 73
74 // 渲染模板 74 // 渲染模板
@@ -114,31 +114,31 @@ class BindController extends AbstractAction @@ -114,31 +114,31 @@ class BindController extends AbstractAction
114 break; 114 break;
115 } 115 }
116 116
117 - $mobile = $this->post('mobile'); 117 + $phoneNum = $this->post('phoneNum');
118 $openId = $this->post('openId'); 118 $openId = $this->post('openId');
119 $areaCode = $this->post('areaCode', '86'); 119 $areaCode = $this->post('areaCode', '86');
120 $sourceType = $this->post('sourceType'); 120 $sourceType = $this->post('sourceType');
121 $nickname = $this->post('nickname'); 121 $nickname = $this->post('nickname');
122 122
123 123
124 - if (!is_numeric($mobile) || !$openId || !$areaCode || !$sourceType) 124 + if (!is_numeric($phoneNum) || !$openId || !$areaCode || !$sourceType)
125 { 125 {
126 break; 126 break;
127 } 127 }
128 128
129 - $res = BindData::bindCheck($mobile, $openId, $sourceType); 129 + $res = BindData::bindCheck($phoneNum, $openId, $sourceType);
130 if (!isset($res['code'])) 130 if (!isset($res['code']))
131 { 131 {
132 break; 132 break;
133 } 133 }
134 if ($res['code'] == 200) 134 if ($res['code'] == 200)
135 { 135 {
136 - $next = Helpers::url('/passport/bind/code', array('isReg' => $res['data']['is_register'], 'openId' => $openId, 'sourceType' => $sourceType, 'nickname' => $nickname, 'areaCode' => $areaCode, 'mobile' => $mobile)); 136 + $next = Helpers::url('/passport/bind/code', array('isReg' => $res['data']['is_register'], 'openId' => $openId, 'sourceType' => $sourceType, 'nickname' => $nickname, 'areaCode' => $areaCode, 'phoneNum' => $phoneNum));
137 $data = array('code' => $res['code'], 'message' => $res['message'], 'data' => array('isReg' => $res['data']['is_register'], 'next' => $next)); 137 $data = array('code' => $res['code'], 'message' => $res['message'], 'data' => array('isReg' => $res['data']['is_register'], 'next' => $next));
138 } 138 }
139 else 139 else
140 { 140 {
141 - $data = array('code' => 500, 'message' => $res['message'], 'data' => $res['data']); 141 + $data = array('code' => $res['code'], 'message' => $res['message'], 'data' => $res['data']);
142 } 142 }
143 } 143 }
144 while (false); 144 while (false);
@@ -159,15 +159,15 @@ class BindController extends AbstractAction @@ -159,15 +159,15 @@ class BindController extends AbstractAction
159 break; 159 break;
160 } 160 }
161 161
162 - $mobile = $this->post('mobile'); 162 + $phoneNum = $this->post('phoneNum');
163 $areaCode = $this->post('areaCode'); 163 $areaCode = $this->post('areaCode');
164 164
165 - if (!is_numeric($mobile)) 165 + if (!is_numeric($phoneNum))
166 { 166 {
167 break; 167 break;
168 } 168 }
169 169
170 - $data = BindData::sendBindMsg($areaCode,$mobile); 170 + $data = BindData::sendBindMsg($areaCode,$phoneNum);
171 if (!isset($data['code'])) 171 if (!isset($data['code']))
172 { 172 {
173 break; 173 break;
@@ -191,16 +191,16 @@ class BindController extends AbstractAction @@ -191,16 +191,16 @@ class BindController extends AbstractAction
191 break; 191 break;
192 } 192 }
193 193
194 - $mobile = $this->post('mobile'); 194 + $phoneNum = $this->post('phoneNum');
195 $msgCode = $this->post('msgCode'); 195 $msgCode = $this->post('msgCode');
196 $areaCode = $this->post('areaCode'); 196 $areaCode = $this->post('areaCode');
197 197
198 - if (!is_numeric($mobile) || !$msgCode) 198 + if (!is_numeric($phoneNum) || !$msgCode)
199 { 199 {
200 break; 200 break;
201 } 201 }
202 202
203 - $data = BindData::checkBindCode($areaCode,$mobile, $msgCode); 203 + $data = BindData::checkBindCode($areaCode,$phoneNum, $msgCode);
204 if (!isset($data['code'])) 204 if (!isset($data['code']))
205 { 205 {
206 break; 206 break;
@@ -224,19 +224,19 @@ class BindController extends AbstractAction @@ -224,19 +224,19 @@ class BindController extends AbstractAction
224 break; 224 break;
225 } 225 }
226 226
227 - $mobile = $this->post('mobile'); 227 + $phoneNum = $this->post('phoneNum');
228 $openId = $this->post('openId'); 228 $openId = $this->post('openId');
229 $areaCode = $this->post('areaCode', '86'); 229 $areaCode = $this->post('areaCode', '86');
230 $sourceType = $this->post('sourceType'); 230 $sourceType = $this->post('sourceType');
231 $nickname = $this->post('nickname'); 231 $nickname = $this->post('nickname');
232 $password = $this->post('password'); 232 $password = $this->post('password');
233 233
234 - if (!is_numeric($mobile) || !$openId || !$sourceType || !$areaCode) 234 + if (!is_numeric($phoneNum) || !$openId || !$sourceType || !$areaCode)
235 { 235 {
236 break; 236 break;
237 } 237 }
238 238
239 - $res = BindData::bindMobile($openId, $nickname, $sourceType, $mobile, $areaCode, $password); 239 + $res = BindData::bindMobile($openId, $nickname, $sourceType, $phoneNum, $areaCode, $password);
240 if (!isset($res['code'])) 240 if (!isset($res['code']))
241 { 241 {
242 break; 242 break;