Autouserinfo.php 2.92 KB
<?php

use Action\AbstractAction;
use LibModels\Web\Passport\RegData;
use LibModels\Web\Passport\LoginData;
use LibModels\Web\Home\IndexData;
use Passport\PassportModel as PassportModel;
use Plugin\Helpers;
use Plugin\Images;
use Plugin\Partner\Factory;

class AutouserinfoController extends AbstractAction
{

    /**
     * 第三方登录完善个人信息:
     * 绑定手机号
     */
    public function indexAction()
    {
        $this->setTitle('联合登录补全信息');
        $nickname = $this->get('nickname');
        $openId = $this->get('openId');
        $sourceType = $this->get('sourceType');

        //登录后跳转页面
        $refer = $this->getCookie('refer');
        if (empty($refer)) {
            $refer = SITE_MAIN;
        }
        else {
            $refer = rawurldecode($refer);
        }

        //获取用户
        $uid = $this->getUid(true);
        if (!$uid) {
            $isLogin = false;
            $username = '';
        }
        else {
            $isLogin = true;
            $username = $this->_uname;
        }
        $simpleHeader = PassportModel::getSimpleHeader($isLogin, $username);

        //整合
        $data = array(
            'loginPage' => true,
            'simpleHeader' => $simpleHeader,
            'passport' => array(
                'coverHref' => '',
                'coverImg' => 'http://img12.static.yhbimg.com/yhb-img01/2015/12/01/07/020a0b6e7ff908d0c2bc4045b4fef42b9f.png?imageView/2/w/252/h/190',
            ),
        );

        $this->_view->display('index', $data);
    }

    /**
     * 完善信息页面
     */
    public function userInfoAction()
    {
        //获取用户
        $uid = $this->getUid(true);
        $nickname = $this->get('nickname');
        $openId = $this->get('openId');
        $sourceType = $this->get('sourceType');

        if (!$uid) {
            $isLogin = false;
            $username = '';
        }
        else {
            $isLogin = true;
            $username = $this->_uname;
        }
        $simpleHeader = PassportModel::getSimpleHeader($isLogin, $username);
        //整合
        $data = array(
            'simpleHeader' => $simpleHeader,
            'passport' => array(
                'coverHref' => '',
                'coverImg' => 'http://img12.static.yhbimg.com/yhb-img01/2015/12/01/07/020a0b6e7ff908d0c2bc4045b4fef42b9f.png?imageView/2/w/252/h/190',
                'goShoppingUrl' => SITE_MAIN,
                'completeInfoUrl' => Helpers::url('/passport/autouserinfo/index', array('openId' => $openId, 'sourceType' => $sourceType, 'nickname' => $nickname)),
            ),
        );

        $this->_view->display('userinfo', $data);
    }

    /*
     * 发送绑定验证吗
     */
    
    /*
     * 验证图形验证码
     */

    /*
     * 验证短信验证码
     */

    /*
     * 绑定手机号
     */
}