|
|
<?php
|
|
|
|
|
|
use Action\AbstractAction;
|
|
|
use home\GradeModel;
|
|
|
use home\OrderModel;
|
|
|
use Plugin\Helpers;
|
|
|
use LibModels\Wap\Home\OrderData;
|
|
|
|
...
|
...
|
@@ -13,18 +11,33 @@ use LibModels\Wap\Home\OrderData; |
|
|
* @package
|
|
|
* @copyright yoho.inc
|
|
|
* @version 1.0 (2015-10-28 16:28:32)
|
|
|
* @author fei.hong <fei.hong@yoho.cn>
|
|
|
*/
|
|
|
class HomeController extends AbstractAction
|
|
|
{
|
|
|
protected $_uid;
|
|
|
|
|
|
// /**
|
|
|
// * 初始化
|
|
|
// */
|
|
|
// public function init()
|
|
|
// {
|
|
|
// // 检查用户是否登录, 未登录则跳转到登录页
|
|
|
// $uid = $this->getUid(true);
|
|
|
// if (!$uid) {
|
|
|
// $this->go(Helpers::url('/signin.html'));
|
|
|
// }
|
|
|
//
|
|
|
// parent::init();
|
|
|
// }
|
|
|
|
|
|
/**
|
|
|
* 个人中心入口
|
|
|
*/
|
|
|
public function indexAction() {
|
|
|
public function indexAction()
|
|
|
{
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('个人中心');
|
|
|
$this->setNavHeader('个人中心', true, SITE_MAIN);
|
|
|
$this->setNavHeader('个人中心');
|
|
|
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 8826435;
|
...
|
...
|
@@ -45,7 +58,8 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 用户收藏的商品
|
|
|
*/
|
|
|
public function favoriteAction() {
|
|
|
public function favoriteAction()
|
|
|
{
|
|
|
$uid = $this->getUid();
|
|
|
|
|
|
$favProducts = \Index\UserModel::getFavProductData($uid);
|
...
|
...
|
@@ -160,7 +174,8 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 用户收藏的品牌
|
|
|
*/
|
|
|
public function favoritebrandAction() {
|
|
|
public function favoritebrandAction()
|
|
|
{
|
|
|
$uid = $this->getUid();
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
|
...
|
...
|
@@ -170,11 +185,12 @@ class HomeController extends AbstractAction |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 个人信息
|
|
|
* 我的个人信息
|
|
|
*/
|
|
|
public function personalDetailsAction() {
|
|
|
public function mydetailsAction()
|
|
|
{
|
|
|
$this->setTitle('个人信息');
|
|
|
$this->setNavHeader('个人信息', true, SITE_MAIN);
|
|
|
$this->setNavHeader('个人信息');
|
|
|
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 967016;
|
...
|
...
|
@@ -186,9 +202,10 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* YOHO币
|
|
|
*/
|
|
|
public function currencyAction() {
|
|
|
public function currencyAction()
|
|
|
{
|
|
|
$this->setTitle('YOHO币');
|
|
|
$this->setNavHeader('优惠券', true, SITE_MAIN);
|
|
|
$this->setNavHeader('优惠券');
|
|
|
|
|
|
$uid = 967016;
|
|
|
$currency = \Index\UserModel::getYohoCoinData($uid);
|
...
|
...
|
@@ -200,10 +217,11 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 优惠券
|
|
|
*/
|
|
|
public function couponsAction() {
|
|
|
public function couponsAction()
|
|
|
{
|
|
|
|
|
|
$this->setTitle('优惠券');
|
|
|
$this->setNavHeader('优惠券', true, SITE_MAIN);
|
|
|
$this->setNavHeader('优惠券');
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 8826435;
|
|
|
$status = $this->get('status', 0);
|
...
|
...
|
@@ -219,7 +237,8 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 我的消息
|
|
|
*/
|
|
|
public function messageAction() {
|
|
|
public function messageAction()
|
|
|
{
|
|
|
// $uid = $this->getUid();
|
|
|
$page = $this->get('page', 0);
|
|
|
$size = $this->get('size', 10);
|
...
|
...
|
@@ -233,10 +252,11 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 地址管理
|
|
|
*/
|
|
|
public function addressAction() {
|
|
|
public function addressAction()
|
|
|
{
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('地址管理');
|
|
|
$this->setNavHeader('地址管理', true, SITE_MAIN);
|
|
|
$this->setNavHeader('地址管理');
|
|
|
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 967016;
|
...
|
...
|
@@ -257,7 +277,8 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 修改地址或者添加新地址
|
|
|
*/
|
|
|
public function saveAddressAction() {
|
|
|
public function saveAddressAction()
|
|
|
{
|
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
...
|
...
|
@@ -284,7 +305,8 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 设置默认地址
|
|
|
*/
|
|
|
public function defaultAddressAction() {
|
|
|
public function defaultAddressAction()
|
|
|
{
|
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
...
|
...
|
@@ -303,12 +325,13 @@ class HomeController extends AbstractAction |
|
|
}
|
|
|
|
|
|
//在线客服
|
|
|
public function onlineServiceAction() {
|
|
|
public function onlineServiceAction()
|
|
|
{
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('在线客服');
|
|
|
$this->setNavHeader('在线客服', true, SITE_MAIN);
|
|
|
$this->setNavHeader('在线客服');
|
|
|
|
|
|
$service = home\OnlineModel::getOnlineServiceInfo();
|
|
|
$service = \Home\OnlineModel::getOnlineServiceInfo();
|
|
|
|
|
|
$this->_view->display('online_service', array(
|
|
|
'onlineServicePage' => true,
|
...
|
...
|
@@ -318,12 +341,13 @@ class HomeController extends AbstractAction |
|
|
}
|
|
|
|
|
|
//在线客服-具体详情
|
|
|
public function onlineServiceDetailAction() {
|
|
|
public function onlineServiceDetailAction()
|
|
|
{
|
|
|
$service = array();
|
|
|
$cateId = $this->get('cateId', 0);
|
|
|
$cateName = $this->get('cateName', '');
|
|
|
if ($cateId > 0) {
|
|
|
$service = home\OnlineModel::getOnlineServiceDetail($cateId);
|
|
|
$service = \Home\OnlineModel::getOnlineServiceDetail($cateId);
|
|
|
}
|
|
|
$this->setTitle('在线客服');
|
|
|
$this->setNavHeader($cateName, true, '');
|
...
|
...
|
@@ -333,17 +357,19 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 我的逛
|
|
|
*/
|
|
|
public function myGuangAction() {
|
|
|
public function myGuangAction()
|
|
|
{
|
|
|
echo 'My Guang';
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 意见反馈
|
|
|
*/
|
|
|
public function suggestAction() {
|
|
|
public function suggestAction()
|
|
|
{
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('意见反馈');
|
|
|
$this->setNavHeader('意见反馈', true, SITE_MAIN);
|
|
|
$this->setNavHeader('意见反馈');
|
|
|
|
|
|
$udid = $this->getUdid();
|
|
|
$page = $this->get('page', 1);
|
...
|
...
|
@@ -382,7 +408,8 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 意见反馈-提交表单
|
|
|
*/
|
|
|
public function suggest_subAction() {
|
|
|
public function suggest_subAction()
|
|
|
{
|
|
|
$udid = $this->getUdid();
|
|
|
$page = $this->get('page', 1);
|
|
|
$limit = $this->get('limit', 30);
|
...
|
...
|
@@ -405,7 +432,8 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 异步保存意见反馈数据
|
|
|
*/
|
|
|
public function savesuggestAction() {
|
|
|
public function savesuggestAction()
|
|
|
{
|
|
|
if ($this->isAjax()) {
|
|
|
$uid = $this->getUid();
|
|
|
$content = $this->post('content', '');
|
...
|
...
|
@@ -419,7 +447,8 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 会员等级展示页
|
|
|
*/
|
|
|
public function gradeAction() {
|
|
|
public function gradeAction()
|
|
|
{
|
|
|
//设置网站seo信息
|
|
|
$this->setTitle('会员等级');
|
|
|
//显示网站导航头部信息
|
...
|
...
|
@@ -438,7 +467,8 @@ class HomeController extends AbstractAction |
|
|
* 会员特权查看页
|
|
|
*/
|
|
|
|
|
|
public function preferentialAction() {
|
|
|
public function preferentialAction()
|
|
|
{
|
|
|
//设置网站seo信息
|
|
|
$this->setTitle('会员等级');
|
|
|
//显示网站导航头部信息
|
...
|
...
|
@@ -446,7 +476,7 @@ class HomeController extends AbstractAction |
|
|
|
|
|
$channel = Helpers::getChannelByCookie();
|
|
|
$uid = $this->getUid();
|
|
|
$data = GradeModel::getPreferential($channel, $uid);
|
|
|
$data = \Home\GradeModel::getPreferential($channel, $uid);
|
|
|
$data['pageFooter'] = true;
|
|
|
$this->_view->display('privilege', $data);
|
|
|
}
|
...
|
...
|
@@ -455,7 +485,8 @@ class HomeController extends AbstractAction |
|
|
* 我的订单页面
|
|
|
*/
|
|
|
|
|
|
public function orderAction() {
|
|
|
public function orderAction()
|
|
|
{
|
|
|
//获得type值
|
|
|
$type = $this->get('type', 1);
|
|
|
$this->setTitle('我的订单');
|
...
|
...
|
@@ -475,7 +506,8 @@ class HomeController extends AbstractAction |
|
|
}
|
|
|
|
|
|
//ajax请求订单页面
|
|
|
public function getOrderAction() {
|
|
|
public function getOrderAction()
|
|
|
{
|
|
|
//判断是不是ajax请求
|
|
|
if (!$this->isAjax()) {
|
|
|
$this->error();
|
...
|
...
|
@@ -505,7 +537,8 @@ class HomeController extends AbstractAction |
|
|
* 我的订单-取消订单
|
|
|
*/
|
|
|
|
|
|
public function cancelOrderAction() {
|
|
|
public function cancelOrderAction()
|
|
|
{
|
|
|
|
|
|
//判断是不是ajax请求
|
|
|
if (!$this->isAjax()) {
|
...
|
...
|
@@ -528,7 +561,8 @@ class HomeController extends AbstractAction |
|
|
* 我的订单-删除订单
|
|
|
*/
|
|
|
|
|
|
public function deleteOrderAction() {
|
|
|
public function deleteOrderAction()
|
|
|
{
|
|
|
//判断是不是ajax请求
|
|
|
if (!$this->isAjax()) {
|
|
|
$this->error();
|
...
|
...
|
@@ -549,7 +583,8 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 订单详情页
|
|
|
*/
|
|
|
public function orderDetailAction() {
|
|
|
public function orderDetailAction()
|
|
|
{
|
|
|
$data = array(
|
|
|
'name' => '毛毛莉Lydia',
|
|
|
'phoneNum' => '18600001133',
|
...
|
...
|
|