<?php

namespace Home\Controller;

use Home\Controller\BaseController;

class IndexController extends BaseController
{


    public function _initialize()
    {
        parent::_initialize();
        if (!cookie('token') && ACTION_NAME != 'login' && ACTION_NAME != 'register' && ACTION_NAME != 'index' && ACTION_NAME != 'indexsearch' && ACTION_NAME != 'forget') {
            $this->redirect('/login');
        }
    }

    /**
     * 首页
     */
    public function index()
    {
        $datas['cooperation_pf'] = $this->apiBaseCache('pc_home_cooperation_pf', '', ''); // 合作平台

        foreach ($datas as $k => $v) {
            $this->assign($k, $v['data']);
        }

        $this->display('Index/index');
    }

    /**
     * 首页搜索结果
     */
    public function indexsearch()
    {
        $this->display('Index/search');
    }

    /**
     * 登录页面
     */
    public function login()
    {
        $this->display('Login/index');
    }

    /**
     * 注册页面
     */
    public function register()
    {
        $this->display('Register/index');
    }

    /**
     * 忘记密码
     */
    public function forget()
    {
        $this->display('Forget/index');
    }

    /**
     * 后台管理首页
     */
    public function home()
    {
        $this->display('Home/index');
    }

    /**
     * 我的询价
     */
    public function inquiry()
    {
        $this->display('QuotePrice/inquiry');
    }

    /**
     * 发布询价
     */
    public function releaseinquiry()
    {
        $this->display('QuotePrice/releaseinquiry');
    }

    /**
     * 询价详情
     */
    public function inquirydetail()
    {
        $this->display('QuotePrice/inquirydetail');
    }

    /**
     * 我的报价
     */
    public function quote()
    {
        $this->display('QuotePrice/quote');
    }

    /**
     * 我的报价详情
     */
    public function quotedetail()
    {
        $this->display('QuotePrice/quotedetail');
    }

    /**
     * 抢单专区
     */
    public function roborder()
    {
        $this->display('RobOrder/index');
    }

    /**
     * 商品管理
     */
    public function goodmanage()
    {
        $this->display('GoodManage/index');
    }

    /**
     * 上传单个商品
     */
    public function uploadsingle()
    {
        $this->display('GoodManage/uploadsingle');
    }

    /**
     * 批量上传商品
     */
    public function bulkupload()
    {
        $this->display('GoodManage/bulkupload');
    }

    /**
     * 批量上传结果
     */
    public function uploadresult()
    {
        $this->display('GoodManage/uploadresult');
    }

    /**
     * 商品详情
     */
    public function gooddetail()
    {
        $this->display('GoodManage/gooddetail');
    }

    /**
     * 账户设置
     */
    public function account()
    {
        $this->display('Account/index');
    }

    /**
     * 积分管理
     */
    public function integral()
    {
        $this->display('Integral/index');
    }

    /**
     * 搜索结果
     */
    public function search()
    {
        $this->display('Search/index');
    }

    /**
     * 认证管理
     */
    public function certification()
    {
        $this->display('Certification/index');
    }

    /**
     * 通知
     */
    public function notice()
    {
        $this->display('Notice/index');
    }

    /**
     * 聊天
     */
    public function chat()
    {
        $this->display('Chat/index');
    }
}