Authored by Rock Zhang

Merge branch 'develop' into test

@@ -6,3 +6,11 @@ @@ -6,3 +6,11 @@
6 {{# used}}<i></i>{{/ used}} 6 {{# used}}<i></i>{{/ used}}
7 </div> 7 </div>
8 {{/coupons}} 8 {{/coupons}}
  9 +
  10 +{{# noRecord}}
  11 +<div class="null">
  12 + <i></i>
  13 + <p>您还没有优惠券!</p>
  14 + <a href="{{topURL}}">随便逛逛</a>
  15 +</div>
  16 +{{/ noRecord}}
@@ -249,12 +249,12 @@ @@ -249,12 +249,12 @@
249 {{#if onlineServicePage}} 249 {{#if onlineServicePage}}
250 <script> 250 <script>
251 seajs.use('js/me/online-service'); 251 seajs.use('js/me/online-service');
252 -</script>onlineServiceDetailPage 252 +</script>
253 {{/if}} 253 {{/if}}
254 {{#if onlineServiceDetailPage}} 254 {{#if onlineServiceDetailPage}}
255 <script> 255 <script>
256 seajs.use('js/index/footer'); 256 seajs.use('js/index/footer');
257 -</script>onlineServiceDetailPage 257 +</script>
258 {{/if}} 258 {{/if}}
259 {{#if addressPage}} 259 {{#if addressPage}}
260 <script> 260 <script>
@@ -368,17 +368,33 @@ class UserModel @@ -368,17 +368,33 @@ class UserModel
368 // 调用接口获取优惠券数据 368 // 调用接口获取优惠券数据
369 $coupons = UserData::couponData($uid, $status, $page); 369 $coupons = UserData::couponData($uid, $status, $page);
370 370
  371 + // 没有获取到优惠券时
  372 + if (!$coupons) {
  373 + $result['topURL'] = '/product/new';
  374 + $result['noRecord'] = true;
  375 +
  376 + return $result;
  377 + }
  378 +
371 // 处理优惠券数据 379 // 处理优惠券数据
372 - if (isset($coupons['data']) && !empty($coupons['data']['total'])) {  
373 - $result['coupons'] = $coupons['data']['info']; 380 + if (isset($coupons['data'])) {
  381 + // 不能再查到结果了
  382 + if ($page == 1 && $coupons['data']['total'] === 0) {
  383 + $result['walkwayUrl'] = '/product/new';
  384 + $result['noRecord'] = true;
  385 + } else {
  386 + $couponArr = array();
  387 + isset($coupons['data']['info']) && $couponArr = $coupons['data']['info'];
374 388
375 - foreach ($result['coupons'] as &$val) { 389 + foreach ($couponArr as &$val) {
376 // 处理已使用的优惠券 390 // 处理已使用的优惠券
377 if ($status == 1) { 391 if ($status == 1) {
378 $val['used'] = true; 392 $val['used'] = true;
379 } 393 }
380 } 394 }
381 395
  396 + !empty($couponArr) && $result['coupons'] = $couponArr;
  397 + }
382 } 398 }
383 399
384 return $result; 400 return $result;
@@ -339,7 +339,7 @@ class DetailModel @@ -339,7 +339,7 @@ class DetailModel
339 339
340 // 详情配图 340 // 详情配图
341 if (isset($sizeInfo['productIntroBo']['productIntro'])) { 341 if (isset($sizeInfo['productIntroBo']['productIntro'])) {
342 - $productIntro = strstr($sizeInfo['productIntroBo']['productIntro'], '<br />'); 342 + $productIntro = $sizeInfo['productIntroBo']['productIntro'];
343 if ($productIntro) { 343 if ($productIntro) {
344 $result['productDetail'] = array( 344 $result['productDetail'] = array(
345 'title' => '商品详情', 345 'title' => '商品详情',