Authored by 郭成尧

领取优惠券方法+优惠券列表结构修改

... ... @@ -42,8 +42,8 @@ class CouponData
{
$param = Yohobuy::param();
$param['method'] = 'app.promotion.getCoupon';
$param['uid'] = $uid;
$param['couponId'] = $couponId;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
... ...
... ... @@ -82,6 +82,7 @@ class CouponFloorProcess
*/
private static function getCoupon($data)
{
$result = array();
if (empty($data)) {
return array();
}
... ... @@ -102,8 +103,9 @@ class CouponFloorProcess
break;
}
}
$data['isCoupon'] = true;
return $data;
$result = $data[0];
$result['isCoupon'] = true;
return $result;
}
/**
... ...
{{>layout/header}}
{{# floor}}
{{#if isCoupon}}
{{#each list}}
<div class="coupon-floor">
{{#if title}}
<div class="floor-title">{{title}}
... ... @@ -29,7 +28,6 @@
{{/if}}
</div>
</div>
{{/ list}}
{{/if}}
{{/ floor}}
<div class="floor-mask"></div>
... ...
... ... @@ -34,11 +34,6 @@ class CouponController extends AbstractAction
if (isset($resource['code']) && $resource['code'] == 200) {
$result = CouponFloorProcess::getContent($resource['data']);
}
// tar modified 1604191441
header("Content-type:text/html;charset=utf-8");
echo '<pre>';
var_dump($result);
echo '</pre>';
$this->_view->display('index', array(
'floor' => $result,
'floorPage' => true
... ... @@ -71,7 +66,7 @@ class CouponController extends AbstractAction
}
} else {
// 登录后调用领券接口
$result = $this->getCouponHandler($receiveData['couponID']);
$result = CouponData::receiveCoupon($this->getUid(),$receiveData['couponID']);
switch ($result['code']) {
case 200:
$returnData = [
... ...