Back.php 5.57 KB
<?php
use Action\WebAction;
use LibModels\Web\Passport\RegData;
use Passport\PassportModel;
use Plugin\Helpers;

class BackController extends WebAction
{
    /**
     * 找回密码
     */
    public function indexAction()
    {
        $banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);
        $data = array(
            'simpleHeader' => PassportModel::getSimpleHeader(false),
            'backPage' => true,
            'back' => array(
                'coverHref' => $banner['url'],
                'coverImg' => $banner['img'],
                'countryCode' => '86',
                'countryName' => '中国',
                'countryList' => RegData::getAreasData(),
            )
        );
        $this->_view->display('index', $data);
    }

    public function authcodeAction()
    {
        echo $this->echoJson(array('code'=> 200));
    }
    
    /**
     * 
     */
    public function emailAction()
    {
        $phoneNum = $this->post('phoneNum','');
        $captcha = $this->post('captcha','');
        if(Helpers::verifyEmail($phoneNum)){ //验证邮箱
            $email = $phoneNum;
            $this->redirect('sendemail');
        } else if(Helpers::verifyMobile($phoneNum)) {//验证手机号
            $mobile = $phoneNum;
            $this->redirect('verification');
        }
    }
    
    /**
     * 发送邮件
     */
    public function sendemailAction() {
        $simpleHeader = array(
            'logo' => array(
                'img' => 'http://static.yohobuy.com/newheader/img/logo_e.png',
                'url' => 'http://www.yohobuy.com'
            ),
            'tool' => array(
                'user' => '2586703@qq.com',
                'userCenter' => '',
                'loginHref' => '',
                'logoutHref' => '',
                'registerHref' => '',
                'favoriteHref' => '',
                'couponHref' => '',
                'orderHref' => '',
                'helpHref' => ''
            )
        );
        $data = array(
            'simpleHeader' => $simpleHeader,
            'sendEmail' => array(
                'coverHref' => '/passport',
                'coverImg' => 'http://img12.static.yhbimg.com/yhb-img01/2015/12/01/07/020a0b6e7ff908d0c2bc4045b4fef42b9f.png?imageView/2/w/252/h/190',
                'countrys' => array()
            )
        );
        $this->_view->display('send-email', $data);
    }

    /**
     * 重置密码
     */
    public function resetPwdAction() {
        $simpleHeader = array(
            'logo' => array(
                'img' => 'http://static.yohobuy.com/newheader/img/logo_e.png',
                'url' => 'http://www.yohobuy.com'
            ),
            'tool' => array(
                'user' => '2586703@qq.com',
                'userCenter' => '',
                'loginHref' => '',
                'logoutHref' => '',
                'registerHref' => '',
                'favoriteHref' => '',
                'couponHref' => '',
                'orderHref' => '',
                'helpHref' => ''
            )
        );
        $data = array(
            'simpleHeader' => $simpleHeader,
            'resetPage' => true,
            'resetPwd' => array(
                'coverHref' => '/passport',
                'coverImg' => 'http://img12.static.yhbimg.com/yhb-img01/2015/12/01/07/020a0b6e7ff908d0c2bc4045b4fef42b9f.png?imageView/2/w/252/h/190',
                'countrys' => array()
            )
        );
        $this->_view->display('reset-pwd', $data);
    }

    public function resetSuccessAction() {
        $simpleHeader = array(
            'logo' => array(
                'img' => 'http://static.yohobuy.com/newheader/img/logo_e.png',
                'url' => 'http://www.yohobuy.com'
            ),
            'tool' => array(
                'user' => '2586703@qq.com',
                'userCenter' => '',
                'loginHref' => '',
                'logoutHref' => '',
                'registerHref' => '',
                'favoriteHref' => '',
                'couponHref' => '',
                'orderHref' => '',
                'helpHref' => ''
            )
        );
        $data = array(
            'simpleHeader' => $simpleHeader,
            'resetSuccess' => array(
                'coverHref' => '/passport',
                'coverImg' => 'http://img12.static.yhbimg.com/yhb-img01/2015/12/01/07/020a0b6e7ff908d0c2bc4045b4fef42b9f.png?imageView/2/w/252/h/190',
                'countrys' => array()
            )
        );
        $this->_view->display('reset-success', $data);
    }

    public function verificationAction() {
        $simpleHeader = array(
            'logo' => array(
                'img' => 'http://static.yohobuy.com/newheader/img/logo_e.png',
                'url' => 'http://www.yohobuy.com'
            ),
            'tool' => array(
                'user' => '2586703@qq.com',
                'userCenter' => '',
                'loginHref' => '',
                'logoutHref' => '',
                'registerHref' => '',
                'favoriteHref' => '',
                'couponHref' => '',
                'orderHref' => '',
                'helpHref' => ''
            )
        );
        $data = array(
            'simpleHeader' => $simpleHeader,
            'vertificationPage' => true,
            'verification' => array(
                'coverHref' => '/passport',
                'coverImg' => 'http://img12.static.yhbimg.com/yhb-img01/2015/12/01/07/020a0b6e7ff908d0c2bc4045b4fef42b9f.png?imageView/2/w/252/h/190',
                'countrys' => array()
            )
        );
        $this->_view->display('verification', $data);
    }
}