修改优惠券页面的错误,目前优惠券还缺少没有获取到优惠券的显示内容
Showing
3 changed files
with
24 additions
and
3 deletions
@@ -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 | +{{#if noRecord}} | ||
11 | +<div class="no-record"> | ||
12 | + <div class="icon"></div> | ||
13 | + <span>暂无优惠券</span> | ||
14 | + <a class="walk-way" href="{{walkwayUrl}}">随便逛逛</a> | ||
15 | +</div> | ||
16 | +{{/if}} |
@@ -368,8 +368,21 @@ class UserModel | @@ -368,8 +368,21 @@ 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'])) { | 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 { | ||
373 | $result['coupons'] = $coupons['data']['info']; | 386 | $result['coupons'] = $coupons['data']['info']; |
374 | 387 | ||
375 | foreach ($result['coupons'] as &$val) { | 388 | foreach ($result['coupons'] as &$val) { |
@@ -378,7 +391,7 @@ class UserModel | @@ -378,7 +391,7 @@ class UserModel | ||
378 | $val['used'] = true; | 391 | $val['used'] = true; |
379 | } | 392 | } |
380 | } | 393 | } |
381 | - | 394 | + } |
382 | } | 395 | } |
383 | 396 | ||
384 | return $result; | 397 | 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' => '商品详情', |
-
Please register or login to post a comment