Coupon.php 2.11 KB
<?php

/**
 * Created by PhpStorm.
 * User: Targaryen
 * Date: 2016/4/11
 * Time: 16:31
 */

use Action\AbstractAction;

class CouponController extends AbstractAction
{
    /**
     * 领券中心
     */
    public function indexAction()
    {
        var_dump('123456');
    }

    /**
     * 领券楼层
     */
    public function floorAction()
    {
        $data =[
            'title' => '领券中心',
            'showTitle' => 1,
            'coupons' => [
                [
                    'id' => 1,
                    'picUrl' => 'http://img12.static.yhbimg.com/yhb-img01/2016/01/19/11/02039485d87cc1b100b883244cf386e62d.jpg?imageView/2/w/640/h/200',
                    'status' => 1,
                    'num' => '123',
                    'go'=>'http://m.dev.yohobuy.com/boys',
                    'couponIds' =>[8024,2564,3587]
                ],
                [
                    'id' => 1,
                    'picUrl' => 'http://img12.static.yhbimg.com/yhb-img01/2016/01/19/11/02039485d87cc1b100b883244cf386e62d.jpg?imageView/2/w/640/h/200',
                    'status' => 2,
                    'num' => '0',
                    'go'=>'http://m.dev.yohobuy.com/boys',
                    'couponIds' =>[8024,2564,3587]
                ],
                [
                    'id' => 1,
                    'picUrl' => 'http://img12.static.yhbimg.com/yhb-img01/2016/01/19/11/02039485d87cc1b100b883244cf386e62d.jpg?imageView/2/w/640/h/200',
                    'status' => 3,
                    'num'=>'456',
                    'go'=>'http://m.dev.yohobuy.com/boys',
                    'couponIds' =>[8024,2564,3587]
                ],
            ]
        ];
        $this->_view->display('index', $data);
    }

    /**
     * 领券操作
     */
    public function receiveCouponAction()
    {
        $receiveData = filter_input_array(INPUT_GET,array(
            'id' => FILTER_DEFAULT
        ));
        $returnData = [
            'id' => $receiveData['id'],
            'status' => 1,
            'message' => '您已经领过券了!'
        ];

        $this->_view->display('receive-coupon',$returnData);
    }

}