/**
     * 领取卡券,入口
     */
    public function index() {
        //获取会员卡
        $jsSign = new WxJsSign(Config::APP_ID, Config::API_SECRET);
        $signPackage = $jsSign->GetSignPackage();

        $data = array(
            'appId' => $signPackage['appId'],
            'timestamp' => $signPackage['timestamp'],
            'nonceStr' => $signPackage['nonceStr'], //随机字符串
            'signature' => $signPackage['signature'],
        );

        //查看用户code
        $code = $this->_model->getCodeByOpenid($this->_openid);

        //添加用户到测试白名单,上线后删除此段
        //CARD_STATUS_VERIFY_OK 审核通过后去掉此段
        $whiteData = array('openid' => array($this->_openid), 'username' => array());
        $this->_admin_model->addUserToWhite($whiteData);

        $this->assign('code', $code);
		$this->assign('card_id', $this->_card_id);
        $this->assign('data', $data);
        $this->display('Index.index');
    }
Beispiel #2
0
    /**
     * 激活成功返回页面
     */
    public function activateSuccess() {
        $jsSign = new WxJsSign(Config::APP_ID, Config::API_SECRET);
        $signPackage = $jsSign->GetSignPackage();
        //JSAPI KEY
        $data = array(
            'appId' => $signPackage['appId'],
            'timestamp' => $signPackage['timestamp'],
            'nonceStr' => $signPackage['nonceStr'], //随机字符串
            'signature' => $signPackage['signature'],
        );
        $this->assign('data', $data);

        $this->display('Index.activateSuccess');
    }