Authored by Rock Zhang

修改优惠券页面的错误,目前优惠券还缺少没有获取到优惠券的显示内容

... ... @@ -6,3 +6,11 @@
{{# used}}<i></i>{{/ used}}
</div>
{{/coupons}}
{{#if noRecord}}
<div class="no-record">
<div class="icon"></div>
<span>暂无优惠券</span>
<a class="walk-way" href="{{walkwayUrl}}">随便逛逛</a>
</div>
{{/if}}
\ No newline at end of file
... ...
... ... @@ -368,8 +368,21 @@ class UserModel
// 调用接口获取优惠券数据
$coupons = UserData::couponData($uid, $status, $page);
// 没有获取到优惠券时
if (!$coupons) {
$result['topURL'] = '/product/new';
$result['noRecord'] = true;
return $result;
}
// 处理优惠券数据
if (isset($coupons['data']) && !empty($coupons['data']['total'])) {
if (isset($coupons['data'])) {
// 不能再查到结果了
if ($page == 1 && $coupons['data']['total'] === 0) {
$result['walkwayUrl'] = '/product/new';
$result['noRecord'] = true;
} else {
$result['coupons'] = $coupons['data']['info'];
foreach ($result['coupons'] as &$val) {
... ... @@ -378,7 +391,7 @@ class UserModel
$val['used'] = true;
}
}
}
}
return $result;
... ...
... ... @@ -339,7 +339,7 @@ class DetailModel
// 详情配图
if (isset($sizeInfo['productIntroBo']['productIntro'])) {
$productIntro = strstr($sizeInfo['productIntroBo']['productIntro'], '<br />');
$productIntro = $sizeInfo['productIntroBo']['productIntro'];
if ($productIntro) {
$result['productDetail'] = array(
'title' => '商品详情',
... ...