Authored by 毕凯

合并代码

@@ -443,13 +443,13 @@ class Helpers @@ -443,13 +443,13 @@ class Helpers
443 * @param string $areaMobile 443 * @param string $areaMobile
444 * @return boolean 444 * @return boolean
445 */ 445 */
446 - public static function verifyAreaMobile($areaMobile) 446 + public static function verifyAreaMobile($areaMobile, $area)
447 { 447 {
448 if (empty($areaMobile)) { 448 if (empty($areaMobile)) {
449 return false; 449 return false;
450 } 450 }
451 if (!strpos($areaMobile, '-')) { 451 if (!strpos($areaMobile, '-')) {
452 - return self::areaMobielVerify($areaMobile); 452 + return self::areaMobielVerify($areaMobile, $area);
453 } else { 453 } else {
454 $mobileData = explode('-', $areaMobile); 454 $mobileData = explode('-', $areaMobile);
455 if (count($mobileData) != 2) { 455 if (count($mobileData) != 2) {
@@ -8,13 +8,13 @@ var $ = require('jquery'), @@ -8,13 +8,13 @@ var $ = require('jquery'),
8 lazyLoad = require('yoho.lazyload'), 8 lazyLoad = require('yoho.lazyload'),
9 Hammer = require('yoho.hammer'); 9 Hammer = require('yoho.hammer');
10 10
11 -var chosePanel = require('./chose-panel'),  
12 - cartInfo = require('./cart-info').cartInfo; 11 +var chosePanel = require('./chose-panel');
13 12
14 var $cartContent = $('.cart-content'); 13 var $cartContent = $('.cart-content');
15 14
16 var navHammer, 15 var navHammer,
17 - cartType = 'ordinary'; 16 + cartType = 'ordinary',
  17 + cartInfo;
18 18
19 require('./good'); 19 require('./good');
20 20
@@ -28,6 +28,12 @@ navHammer.on('tap', function(e) { @@ -28,6 +28,12 @@ navHammer.on('tap', function(e) {
28 return; 28 return;
29 } 29 }
30 30
  31 + if (cartType === 'ordinary') {
  32 + cartType = 'advance';
  33 + } else {
  34 + cartType = 'ordinary';
  35 + }
  36 +
31 $this.siblings('.active').removeClass('active'); 37 $this.siblings('.active').removeClass('active');
32 $this.addClass('active'); 38 $this.addClass('active');
33 39
@@ -41,7 +47,7 @@ navHammer.on('tap', function(e) { @@ -41,7 +47,7 @@ navHammer.on('tap', function(e) {
41 47
42 48
43 $('.btn-balance').on('touchend', function() { 49 $('.btn-balance').on('touchend', function() {
44 - window.location.href = '/shoppingCart/orderEnsure?cartType=' + cartType; 50 + window.location.href = '/cart/index/orderEnsure?cartType=' + cartType;
45 }); 51 });
46 52
47 //$('.advance-buy').on('touchend', function() { 53 //$('.advance-buy').on('touchend', function() {
@@ -66,4 +72,4 @@ $('.chose').on('touchend', function() { @@ -66,4 +72,4 @@ $('.chose').on('touchend', function() {
66 72
67 73
68 74
69 -cartInfo = 0;  
  75 +cartInfo = 0;
@@ -44,7 +44,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() { @@ -44,7 +44,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
44 44
45 $.ajax({ 45 $.ajax({
46 type: 'GET', 46 type: 'GET',
47 - url: '/shoppingCart/select', 47 + url: '/cart/index/select',
48 data: { 48 data: {
49 id: id 49 id: id
50 } 50 }
@@ -58,7 +58,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() { @@ -58,7 +58,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
58 } 58 }
59 $.ajax({ 59 $.ajax({
60 type: 'GET', 60 type: 'GET',
61 - url: '/shoppingCart/getCartData', 61 + url: '/cart/index/getCartData',
62 data: { 62 data: {
63 id: id 63 id: id
64 }, 64 },
@@ -79,18 +79,22 @@ $('.cart-goods').on('touchstart', '.checkbox', function() { @@ -79,18 +79,22 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
79 }); 79 });
80 }).on('touchstart', '.icon-edit', function() { 80 }).on('touchstart', '.icon-edit', function() {
81 81
82 - var $this = $(this),  
83 - $cartgood = $this.closest('.shopping-cart-good'),  
84 - $viewGood = $cartgood.find('.deps'),  
85 - $editGoot = $cartgood.find('.calculate-num');  
86 -  
87 - if ($viewGood.hasClass('show')) {  
88 - $viewGood.removeClass('show').addClass('hide');  
89 - $editGoot.removeClass('hide').addClass('show');  
90 - } else {  
91 - $viewGood.removeClass('hide').addClass('show');  
92 - $editGoot.removeClass('show').addClass('hide');  
93 - } 82 + //var $this = $(this);
  83 + //
  84 + //var $cartgood = $this.closest('.shopping-cart-good');
  85 + //
  86 + ////var id = $this.closest('.shopping-cart-good').data('id');
  87 + //
  88 + //var $viewGood = $cartgood.find('.deps');
  89 + // $editGoot = $cartgood.find('.calculate-num');
  90 + //
  91 + //if ($viewGood.hasClass('show')) {
  92 + // $viewGood.removeClass('show').addClass('hide');
  93 + // $editGoot.removeClass('hide').addClass('show');
  94 + //} else {
  95 + // $viewGood.removeClass('hide').addClass('show');
  96 + // $editGoot.removeClass('show').addClass('hide');
  97 + //}
94 98
95 99
96 }).on('touchstart', '.icon-del', function(e) { 100 }).on('touchstart', '.icon-del', function(e) {
@@ -116,7 +120,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() { @@ -116,7 +120,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
116 120
117 $.ajax({ 121 $.ajax({
118 method: 'post', 122 method: 'post',
119 - url: '/shoppingCart/del', 123 + url: '/cart/index/del',
120 data: { 124 data: {
121 id: id 125 id: id
122 } 126 }
@@ -163,11 +167,6 @@ $('.cart-goods').on('touchstart', '.checkbox', function() { @@ -163,11 +167,6 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
163 // }); 167 // });
164 //}) 168 //})
165 169
166 -  
167 -$('.btn-balance').on('touchend', function() {  
168 - window.location.href = '/shoppingCart/orderEnsure?cartType=' + 'ordinary';  
169 -});  
170 -  
171 $('.down').on('touchend', function() { 170 $('.down').on('touchend', function() {
172 chosePanel.show(); 171 chosePanel.show();
173 }); 172 });
@@ -176,7 +175,7 @@ $('.cut').on('touchend', function() { @@ -176,7 +175,7 @@ $('.cut').on('touchend', function() {
176 175
177 $.ajax({ 176 $.ajax({
178 type: 'GET', 177 type: 'GET',
179 - url: '/shoppingCart/modify', 178 + url: '/cart/index/modify',
180 data: { 179 data: {
181 old_product_sku: id, 180 old_product_sku: id,
182 new_product_sku: id, 181 new_product_sku: id,
@@ -199,9 +199,9 @@ $yohoPage.on('touchstart', '.tap-hightlight', function() { @@ -199,9 +199,9 @@ $yohoPage.on('touchstart', '.tap-hightlight', function() {
199 $(this).removeClass('highlight'); 199 $(this).removeClass('highlight');
200 }); 200 });
201 201
202 -$('.nav-home').on('touchstart', function() {  
203 - $('.homebuttom').toggleClass('none');  
204 -}); 202 +// $('.nav-home').on('touchstart', function() {
  203 +// $('.homebuttom').toggleClass('none');
  204 +// });
205 205
206 (function() { 206 (function() {
207 var lastTime = 0, 207 var lastTime = 0,
@@ -47,7 +47,7 @@ @@ -47,7 +47,7 @@
47 {{/if}} 47 {{/if}}
48 48
49 49
50 - <span class="iconfont icon-edit">&#xe61e;</span> 50 +
51 <span class="iconfont icon-del">&#xe621;</span> 51 <span class="iconfont icon-del">&#xe621;</span>
52 </p> 52 </p>
53 <p class="row"> 53 <p class="row">
@@ -4,14 +4,14 @@ @@ -4,14 +4,14 @@
4 <a href="{{#if backUrl}}{{backUrl}}{{^}}javascript:history.go(-1);{{/if}}" class="iconfont nav-back">&#xe610;</a> 4 <a href="{{#if backUrl}}{{backUrl}}{{^}}javascript:history.go(-1);{{/if}}" class="iconfont nav-back">&#xe610;</a>
5 {{/navBack}} 5 {{/navBack}}
6 {{#navHome}} 6 {{#navHome}}
7 - <a class="iconfont nav-home">&#xe611;</a> 7 + <a href="{{.}}" class="iconfont nav-home">&#xe611;</a>
8 {{/navHome}} 8 {{/navHome}}
9 {{#navTitle}} 9 {{#navTitle}}
10 <p class="nav-title">{{.}}</p> 10 <p class="nav-title">{{.}}</p>
11 {{/navTitle}} 11 {{/navTitle}}
12 {{# navBtn}} 12 {{# navBtn}}
13 <!-- <span class="nav-btn">{{.}}</span> --> 13 <!-- <span class="nav-btn">{{.}}</span> -->
14 - <i class="iconfont nav-home">&#xe638;</i> 14 + <!-- <i class="iconfont nav-home">&#xe638;</i> -->
15 {{/ navBtn}} 15 {{/ navBtn}}
16 </header> 16 </header>
17 <div class="homebuttom none"> 17 <div class="homebuttom none">
@@ -41,11 +41,12 @@ class HomeController extends AbstractAction @@ -41,11 +41,12 @@ class HomeController extends AbstractAction
41 { 41 {
42 // 设置网站标题 42 // 设置网站标题
43 $this->setTitle('个人中心'); 43 $this->setTitle('个人中心');
44 - $this->setNavHeader('个人中心', SITE_MAIN . '/?go=1', '', true); 44 + $this->setNavHeader('个人中心', SITE_MAIN . '/?go=1');
45 45
46 $data = array( 46 $data = array(
47 'myIndexPage' => true, 47 'myIndexPage' => true,
48 'showDownloadApp' => true, 48 'showDownloadApp' => true,
  49 + 'navHome' => true,
49 'pageFooter' => true, 50 'pageFooter' => true,
50 'cartUrl' => Helpers::url('/cart/index/index', null), 51 'cartUrl' => Helpers::url('/cart/index/index', null),
51 'signinUrl' => Helpers::url('/signin.html', array('refer' => Helpers::url('/home'))), 52 'signinUrl' => Helpers::url('/signin.html', array('refer' => Helpers::url('/home'))),
@@ -385,7 +385,11 @@ class UserModel @@ -385,7 +385,11 @@ class UserModel
385 // 处理YOHO币数据 385 // 处理YOHO币数据
386 if(isset($yohoCoin['data']) && !empty($yohoCoin['data'])){ 386 if(isset($yohoCoin['data']) && !empty($yohoCoin['data'])){
387 $coinList = $yohoCoin['data']['coinlist']; 387 $coinList = $yohoCoin['data']['coinlist'];
388 - $data['money'] = $yohoCoin['data']['total']; 388 +
  389 + // 获取有货币总数
  390 + $total = self::getYohoCoinData($uid);
  391 + $data['money'] = !empty($total) ? $total['yohoCoin']['coinNum'] : 0;
  392 +
389 foreach($coinList as $key => $val){ 393 foreach($coinList as $key => $val){
390 $result[$key]['title'] = $val['message']; 394 $result[$key]['title'] = $val['message'];
391 $result[$key]['time'] = $val['date']; 395 $result[$key]['time'] = $val['date'];
@@ -167,7 +167,6 @@ class DetailModel @@ -167,7 +167,6 @@ class DetailModel
167 $colorStorageNum = 0; 167 $colorStorageNum = 0;
168 $totalStorageNum = 0; // 总库存数 168 $totalStorageNum = 0; // 总库存数
169 foreach ($baseInfo['goodsList'] as $value) { 169 foreach ($baseInfo['goodsList'] as $value) {
170 - $sizeList = array();  
171 $colorStorageNum = 0; 170 $colorStorageNum = 0;
172 $sizeStorageStr = ''; 171 $sizeStorageStr = '';
173 172
@@ -286,7 +286,7 @@ class IndexController extends AbstractAction @@ -286,7 +286,7 @@ class IndexController extends AbstractAction
286 $uid = $this->getUid(true); 286 $uid = $this->getUid(true);
287 $cartGoods = CartModel::getCartData($uid, $shoppingKey); 287 $cartGoods = CartModel::getCartData($uid, $shoppingKey);
288 if (empty($cartGoods) || isset($cartGoods['isEmptyCart'])) { 288 if (empty($cartGoods) || isset($cartGoods['isEmptyCart'])) {
289 - $this->go(Helpers::url('/shoppingcart')); 289 + $this->go(Helpers::url('/cart/index/index'));
290 } 290 }
291 291
292 $cartType = $this->get('cartType', 'ordinary'); 292 $cartType = $this->get('cartType', 'ordinary');
@@ -113,7 +113,7 @@ class LoginController extends AbstractAction @@ -113,7 +113,7 @@ class LoginController extends AbstractAction
113 113
114 /* 判断参数是否有效 */ 114 /* 判断参数是否有效 */
115 $verifyEmail = Helpers::verifyEmail($profile); 115 $verifyEmail = Helpers::verifyEmail($profile);
116 - $verifyMobile = ($area === '86') ? Helpers::verifyMobile($profile) : Helpers::verifyAreaMobile($profile); 116 + $verifyMobile = ($area === '86') ? Helpers::verifyMobile($profile) : Helpers::verifyAreaMobile($profile, $area);
117 if (!$verifyEmail && !$verifyMobile) { 117 if (!$verifyEmail && !$verifyMobile) {
118 break; 118 break;
119 } 119 }