修改优惠券页面的错误,目前优惠券还缺少没有获取到优惠券的显示内容
Showing
3 changed files
with
30 additions
and
9 deletions
@@ -5,4 +5,12 @@ | @@ -5,4 +5,12 @@ | ||
5 | <p>{{ couponValidity}}</p> | 5 | <p>{{ couponValidity}}</p> |
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,17 +368,30 @@ class UserModel | @@ -368,17 +368,30 @@ 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 | + $result['coupons'] = $coupons['data']['info']; | ||
374 | 387 | ||
375 | - foreach ($result['coupons'] as &$val) { | ||
376 | - // 处理已使用的优惠券 | ||
377 | - if ($status == 1) { | ||
378 | - $val['used'] = true; | 388 | + foreach ($result['coupons'] as &$val) { |
389 | + // 处理已使用的优惠券 | ||
390 | + if ($status == 1) { | ||
391 | + $val['used'] = true; | ||
392 | + } | ||
379 | } | 393 | } |
380 | } | 394 | } |
381 | - | ||
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