Authored by Rock Zhang

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

... ... @@ -5,4 +5,12 @@
<p>{{ couponValidity}}</p>
{{# used}}<i></i>{{/ used}}
</div>
{{/coupons}}
\ No newline at end of file
{{/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,17 +368,30 @@ 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'])) {
$result['coupons'] = $coupons['data']['info'];
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) {
// 处理已使用的优惠券
if ($status == 1) {
$val['used'] = true;
foreach ($result['coupons'] as &$val) {
// 处理已使用的优惠券
if ($status == 1) {
$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' => '商品详情',
... ...