<?php
/**
 * 客户服务
 * @Copyright (C) 2016 汉潮 All rights reserved.
 * @License http://www.hanchao9999.com
 * @Author lss <lss@qq.com>
 */

namespace Member\Controller;
use Think\Controller;
class CustomerServiceController extends BaseController
{
    public function _initialize()
    {
        parent::_initialize();
        $goods_id = I('goods_id');
        $order_id = I('order_id');
        $this->assign('goods_id', $goods_id);
        $this->assign('order_id', $order_id);
        $this->assign($this->member_info);

    }

    /**
     *投诉列表
     */
    public function complaint_list()
    {
        $postdata = I('post.');
        $type = 1;
        $data = D('Common/Member')->service_list($postdata, $type);
        $this->assign($data);
        $this->assign($postdata);
        $this->assign('tplseo_title', '投诉列表_会员中心_' . C('WEB_SITE_TITLE'));
        $this->display();
    }

    /**
     *咨询列表
     */
    public function platform_service()
    {
        $postdata = I('post.');
        $type = array('neq', 1);
        $data = D('Common/Member')->service_list($postdata, $type);
        $this->assign($data);
        $this->assign('tplseo_title', '咨询列表_会员中心_' . C('WEB_SITE_TITLE'));
        $this->display();
    }

    /**
     *查看投诉页面
     */
    public function view()
    {
        $id = I('id');
        $type = I('type');
        $data = D('Common/Member')->service_cont($id);
        $this->assign($data);
        $this->assign('tplseo_title', '投诉_会员中心_' . C('WEB_SITE_TITLE'));
        if ($type == 1) {
            $this->display('complaint_service_ok');
        } else {
            $this->display('platform_service_ok');
        }
    }

    /**
     *删除咨询、投诉
     */
    public function del_service()
    {
        $id = I('id');
        $data = D('Common/Member')->del_service($id);
        $this->ajaxReturn($data);
    }

    /**
     *提交投诉、咨询
     */
    public function submit_service()
    {
        $postdata = I('post.');
        $data = D('Common/Member')->submit_service($postdata);
        $this->ajaxReturn($data);
    }

    /**
     *取消投诉、咨询
     */
    public function cancel_service()
    {
        $id = I('id');
        $data = D('Common/Member')->cancel_service($id);
        $this->ajaxReturn($data);
    }
}
?>