...
|
...
|
@@ -24,23 +24,21 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 初始化
|
|
|
*/
|
|
|
public function init()
|
|
|
{
|
|
|
public function init() {
|
|
|
// 检查用户是否登录, 未登录则跳转到登录页
|
|
|
$uid = 8826435; //$this->getUid(true);
|
|
|
$action = $this->getRequest()->getActionName();
|
|
|
if (!$uid && $action !== 'index') {
|
|
|
$this->go(Helpers::url('/signin.html'));
|
|
|
}
|
|
|
|
|
|
|
|
|
parent::init();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 个人中心入口
|
|
|
*/
|
|
|
public function indexAction()
|
|
|
{
|
|
|
public function indexAction() {
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('个人中心');
|
|
|
$this->setNavHeader('个人中心');
|
...
|
...
|
@@ -66,8 +64,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 用户收藏的商品
|
|
|
*/
|
|
|
public function favoriteAction()
|
|
|
{
|
|
|
public function favoriteAction() {
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('我的收藏');
|
|
|
$this->setNavHeader('我的收藏', true, SITE_MAIN);
|
...
|
...
|
@@ -83,9 +80,9 @@ class HomeController extends AbstractAction |
|
|
'pageFooter' => true,
|
|
|
'favorite' => true,
|
|
|
'hasFavProduct' => $favProducts,
|
|
|
'productUrl' => '/product/new',
|
|
|
'productUrl' => '/product/new',
|
|
|
'hasFavBrand' => $favBrands,
|
|
|
'brandUrl' => '/product/new'
|
|
|
'brandUrl' => '/product/new'
|
|
|
);
|
|
|
// 判断是否为品牌收藏页
|
|
|
if ($tab === 'brand') {
|
...
|
...
|
@@ -98,8 +95,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 用户收藏的商品-删除
|
|
|
*/
|
|
|
public function favoriteDelAction()
|
|
|
{
|
|
|
public function favoriteDelAction() {
|
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
...
|
...
|
@@ -119,8 +115,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 个人信息
|
|
|
*/
|
|
|
public function personalDetailsAction()
|
|
|
{
|
|
|
public function personalDetailsAction() {
|
|
|
$this->setTitle('个人信息');
|
|
|
$this->setNavHeader('个人信息', true, SITE_MAIN);
|
|
|
|
...
|
...
|
@@ -134,8 +129,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* YOHO币
|
|
|
*/
|
|
|
public function currencyAction()
|
|
|
{
|
|
|
public function currencyAction() {
|
|
|
$this->setTitle('YOHO币');
|
|
|
$this->setNavHeader('YOHO币', true, false);
|
|
|
|
...
|
...
|
@@ -149,8 +143,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 优惠券
|
|
|
*/
|
|
|
public function couponsAction()
|
|
|
{
|
|
|
public function couponsAction() {
|
|
|
$this->setTitle('优惠券');
|
|
|
$this->setNavHeader('优惠券', true, SITE_MAIN);
|
|
|
|
...
|
...
|
@@ -158,8 +151,8 @@ class HomeController extends AbstractAction |
|
|
$uid = 8826435;
|
|
|
$coupons = array(
|
|
|
'couponsUrl' => array(
|
|
|
'used' => \Index\UserModel::getCouponData($uid, 0),
|
|
|
'unused' => \Index\UserModel::getCouponData($uid, 1)
|
|
|
'used' => \Index\UserModel::getCouponData($uid, 0),
|
|
|
'unused' => \Index\UserModel::getCouponData($uid, 1)
|
|
|
),
|
|
|
'couponsPage' => true
|
|
|
);
|
...
|
...
|
@@ -170,8 +163,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 我的消息
|
|
|
*/
|
|
|
public function messageAction()
|
|
|
{
|
|
|
public function messageAction() {
|
|
|
$uid = $this->getUid();
|
|
|
$page = $this->get('page', 0);
|
|
|
$size = $this->get('size', 10);
|
...
|
...
|
@@ -184,8 +176,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 地址管理
|
|
|
*/
|
|
|
public function addressAction()
|
|
|
{
|
|
|
public function addressAction() {
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('地址管理');
|
|
|
$this->setNavHeader('地址管理');
|
...
|
...
|
@@ -205,8 +196,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 修改地址或者添加新地址
|
|
|
*/
|
|
|
public function saveAddressAction()
|
|
|
{
|
|
|
public function saveAddressAction() {
|
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
...
|
...
|
@@ -232,8 +222,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 设置默认地址
|
|
|
*/
|
|
|
public function defaultAddressAction()
|
|
|
{
|
|
|
public function defaultAddressAction() {
|
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
...
|
...
|
@@ -252,8 +241,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 删除地址
|
|
|
*/
|
|
|
public function delAddressAction()
|
|
|
{
|
|
|
public function delAddressAction() {
|
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
...
|
...
|
@@ -271,8 +259,7 @@ class HomeController extends AbstractAction |
|
|
}
|
|
|
|
|
|
//在线客服
|
|
|
public function onlineServiceAction()
|
|
|
{
|
|
|
public function onlineServiceAction() {
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('在线客服');
|
|
|
$this->setNavHeader('在线客服', true, SITE_MAIN);
|
...
|
...
|
@@ -287,8 +274,7 @@ class HomeController extends AbstractAction |
|
|
}
|
|
|
|
|
|
//在线客服-具体详情
|
|
|
public function onlineServiceDetailAction()
|
|
|
{
|
|
|
public function onlineServiceDetailAction() {
|
|
|
$service = array();
|
|
|
$cateId = $this->get('cateId', 0);
|
|
|
$cateName = $this->get('cateName', '');
|
...
|
...
|
@@ -303,8 +289,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 我的逛
|
|
|
*/
|
|
|
public function myGuangAction()
|
|
|
{
|
|
|
public function myGuangAction() {
|
|
|
$page = $this->get('page', 1);
|
|
|
$limit = $this->get('limit', 10);
|
|
|
$uid = $this->getUid();
|
...
|
...
|
@@ -327,8 +312,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 意见反馈
|
|
|
*/
|
|
|
public function suggestAction()
|
|
|
{
|
|
|
public function suggestAction() {
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('意见反馈');
|
|
|
$this->setNavHeader('意见反馈', true, SITE_MAIN);
|
...
|
...
|
@@ -350,8 +334,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 意见反馈-提交表单页面
|
|
|
*/
|
|
|
public function suggestSubAction()
|
|
|
{
|
|
|
public function suggestSubAction() {
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('反馈问题');
|
|
|
|
...
|
...
|
@@ -372,8 +355,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 异步上传图片
|
|
|
*/
|
|
|
public function suggestimgUploadAction()
|
|
|
{
|
|
|
public function suggestimgUploadAction() {
|
|
|
//$filename = $this->post('filename', '');
|
|
|
$result = UserModel::saveSuggestImg('fileData');
|
|
|
|
...
|
...
|
@@ -383,8 +365,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 异步保存意见反馈数据
|
|
|
*/
|
|
|
public function savesuggestAction()
|
|
|
{
|
|
|
public function savesuggestAction() {
|
|
|
if ($this->isAjax()) {
|
|
|
$uid = $this->getUid();
|
|
|
$content = $this->post('content', '');
|
...
|
...
|
@@ -399,8 +380,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 异步点击靠谱或者不靠谱
|
|
|
*/
|
|
|
public function upAndDownAction()
|
|
|
{
|
|
|
public function upAndDownAction() {
|
|
|
if ($this->isAjax()) {
|
|
|
$uid = $this->getUid();
|
|
|
$udid = $this->getUdid();
|
...
|
...
|
@@ -414,8 +394,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 会员等级展示页
|
|
|
*/
|
|
|
public function gradeAction()
|
|
|
{
|
|
|
public function gradeAction() {
|
|
|
//设置网站seo信息
|
|
|
$this->setTitle('会员等级');
|
|
|
//显示网站导航头部信息
|
...
|
...
|
@@ -430,23 +409,23 @@ class HomeController extends AbstractAction |
|
|
/*
|
|
|
* 会员特权查看页
|
|
|
*/
|
|
|
public function preferentialAction()
|
|
|
{
|
|
|
|
|
|
public function preferentialAction() {
|
|
|
//设置网站seo信息
|
|
|
$this->setTitle('会员等级');
|
|
|
//显示网站导航头部信息
|
|
|
$this->setNavHeader('会员特权详情');
|
|
|
$data = GradeModel::getPreferential();
|
|
|
$data['pageFooter'] = true;
|
|
|
|
|
|
|
|
|
$this->_view->display('privilege', $data);
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
* 我的订单页面,获得nav导航条焦点。并且异步请求订单详情列表页(getOrders)
|
|
|
*/
|
|
|
public function orderAction()
|
|
|
{
|
|
|
|
|
|
public function orderAction() {
|
|
|
//获得type值,type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论。
|
|
|
$type = $this->get('type', 1);
|
|
|
$this->setTitle('我的订单');
|
...
|
...
|
@@ -466,17 +445,17 @@ class HomeController extends AbstractAction |
|
|
}
|
|
|
|
|
|
//ajax请求订单页面
|
|
|
public function getOrdersAction()
|
|
|
{
|
|
|
public function getOrdersAction() {
|
|
|
//判断是不是ajax请求
|
|
|
if (!$this->isAjax()) {
|
|
|
$this->error();
|
|
|
}
|
|
|
//获取基本参数:type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论
|
|
|
//获取基本参数:type 1:全部 2:待付款 3:待发货 4:待收货 5:待评论 7:失败 取消 订单
|
|
|
$type = $this->get('type', 1);
|
|
|
$page = $this->get('page', 1);
|
|
|
$limit = $this->get('limit', 10);
|
|
|
$uid = $this->getUid();
|
|
|
$uid = '12';//测试数据
|
|
|
//调用模型层getOrder方法获得并处理数据
|
|
|
$data = OrderModel::getOrder($type, $page, $limit, $uid);
|
|
|
/* 如果取不到订单数据时,分两种情况:
|
...
|
...
|
@@ -501,8 +480,7 @@ class HomeController extends AbstractAction |
|
|
* 我的订单-取消订单
|
|
|
*/
|
|
|
|
|
|
public function cancelOrderAction()
|
|
|
{
|
|
|
public function cancelOrderAction() {
|
|
|
|
|
|
//判断是不是ajax请求
|
|
|
if (!$this->isAjax()) {
|
...
|
...
|
@@ -524,8 +502,7 @@ class HomeController extends AbstractAction |
|
|
* 我的订单-删除订单
|
|
|
*/
|
|
|
|
|
|
public function delOrderAction()
|
|
|
{
|
|
|
public function delOrderAction() {
|
|
|
//判断是不是ajax请求
|
|
|
if (!$this->isAjax()) {
|
|
|
$this->error();
|
...
|
...
|
@@ -546,8 +523,7 @@ class HomeController extends AbstractAction |
|
|
* 我的订单-支付链接获取
|
|
|
*/
|
|
|
|
|
|
private function paymentAction()
|
|
|
{
|
|
|
private function paymentAction() {
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
$yh_channel = $this->get('yh_channel', 1);
|
|
|
OrderModel::payment($gender, $yh_channel);
|
...
|
...
|
@@ -557,8 +533,7 @@ class HomeController extends AbstractAction |
|
|
* 我的订单-随便逛逛链接获取
|
|
|
*/
|
|
|
|
|
|
private function strollAction()
|
|
|
{
|
|
|
private function strollAction() {
|
|
|
//获取性别、频道数据
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
$yh_channel = $this->get('yh_channel', 1);
|
...
|
...
|
@@ -570,8 +545,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 订单详情页
|
|
|
*/
|
|
|
public function orderDetailAction()
|
|
|
{
|
|
|
public function orderDetailAction() {
|
|
|
$data = array(
|
|
|
'name' => '毛毛莉Lydia',
|
|
|
'phoneNum' => '18600001133',
|
...
|
...
|
|