...
|
...
|
@@ -37,8 +37,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 个人中心入口
|
|
|
*/
|
|
|
public function indexAction()
|
|
|
{
|
|
|
public function indexAction() {
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('个人中心');
|
|
|
$this->setNavHeader('个人中心', true, SITE_MAIN);
|
...
|
...
|
@@ -62,8 +61,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 用户收藏的商品
|
|
|
*/
|
|
|
public function favoriteAction()
|
|
|
{
|
|
|
public function favoriteAction() {
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('我的收藏');
|
|
|
$this->setNavHeader('我的收藏', true, SITE_MAIN);
|
...
|
...
|
@@ -93,8 +91,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 用户收藏的商品-删除
|
|
|
*/
|
|
|
public function favoriteDelAction()
|
|
|
{
|
|
|
public function favoriteDelAction() {
|
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
...
|
...
|
@@ -114,8 +111,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 个人信息
|
|
|
*/
|
|
|
public function personalDetailsAction()
|
|
|
{
|
|
|
public function personalDetailsAction() {
|
|
|
$this->setTitle('个人信息');
|
|
|
$this->setNavHeader('个人信息', true, SITE_MAIN);
|
|
|
|
...
|
...
|
@@ -129,8 +125,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* YOHO币
|
|
|
*/
|
|
|
public function currencyAction()
|
|
|
{
|
|
|
public function currencyAction() {
|
|
|
$this->setTitle('YOHO币');
|
|
|
$this->setNavHeader('YOHO币', true, false);
|
|
|
|
...
|
...
|
@@ -145,8 +140,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 优惠券
|
|
|
*/
|
|
|
public function couponsAction()
|
|
|
{
|
|
|
public function couponsAction() {
|
|
|
|
|
|
$this->setTitle('优惠券');
|
|
|
$this->setNavHeader('优惠券', true, SITE_MAIN);
|
...
|
...
|
@@ -163,8 +157,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 我的消息
|
|
|
*/
|
|
|
public function messageAction()
|
|
|
{
|
|
|
public function messageAction() {
|
|
|
// $uid = $this->getUid();
|
|
|
$page = $this->get('page', 0);
|
|
|
$size = $this->get('size', 10);
|
...
|
...
|
@@ -178,8 +171,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 地址管理
|
|
|
*/
|
|
|
public function addressAction()
|
|
|
{
|
|
|
public function addressAction() {
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('地址管理');
|
|
|
$this->setNavHeader('地址管理', true, SITE_MAIN);
|
...
|
...
|
@@ -203,8 +195,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 修改地址或者添加新地址
|
|
|
*/
|
|
|
public function saveAddressAction()
|
|
|
{
|
|
|
public function saveAddressAction() {
|
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
...
|
...
|
@@ -231,8 +222,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 设置默认地址
|
|
|
*/
|
|
|
public function defaultAddressAction()
|
|
|
{
|
|
|
public function defaultAddressAction() {
|
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
...
|
...
|
@@ -253,8 +243,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 删除地址
|
|
|
*/
|
|
|
public function addressDelAction()
|
|
|
{
|
|
|
public function addressDelAction() {
|
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
...
|
...
|
@@ -273,8 +262,7 @@ class HomeController extends AbstractAction |
|
|
}
|
|
|
|
|
|
//在线客服
|
|
|
public function onlineServiceAction()
|
|
|
{
|
|
|
public function onlineServiceAction() {
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('在线客服');
|
|
|
$this->setNavHeader('在线客服', true, SITE_MAIN);
|
...
|
...
|
@@ -289,8 +277,7 @@ class HomeController extends AbstractAction |
|
|
}
|
|
|
|
|
|
//在线客服-具体详情
|
|
|
public function onlineServiceDetailAction()
|
|
|
{
|
|
|
public function onlineServiceDetailAction() {
|
|
|
$service = array();
|
|
|
$cateId = $this->get('cateId', 0);
|
|
|
$cateName = $this->get('cateName', '');
|
...
|
...
|
@@ -321,8 +308,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 意见反馈
|
|
|
*/
|
|
|
public function suggestAction()
|
|
|
{
|
|
|
public function suggestAction() {
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('意见反馈');
|
|
|
$this->setNavHeader('意见反馈', true, SITE_MAIN);
|
...
|
...
|
@@ -344,8 +330,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 意见反馈-提交表单页面
|
|
|
*/
|
|
|
public function suggestSubAction()
|
|
|
{
|
|
|
public function suggestSubAction() {
|
|
|
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('反馈问题');
|
...
|
...
|
@@ -373,8 +358,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 异步上传图片
|
|
|
*/
|
|
|
public function suggestimgUploadAction()
|
|
|
{
|
|
|
public function suggestimgUploadAction() {
|
|
|
$filename = $this->post('filename', '');
|
|
|
$result = \Index\UserModel::saveSuggestImg($filename);
|
|
|
|
...
|
...
|
@@ -384,8 +368,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 异步保存意见反馈数据
|
|
|
*/
|
|
|
public function savesuggestAction()
|
|
|
{
|
|
|
public function savesuggestAction() {
|
|
|
if ($this->isAjax()) {
|
|
|
$uid = $this->getUid();
|
|
|
$content = $this->post('content', '');
|
...
|
...
|
@@ -399,8 +382,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 会员等级展示页
|
|
|
*/
|
|
|
public function gradeAction()
|
|
|
{
|
|
|
public function gradeAction() {
|
|
|
//设置网站seo信息
|
|
|
$this->setTitle('会员等级');
|
|
|
//显示网站导航头部信息
|
...
|
...
|
@@ -419,8 +401,7 @@ class HomeController extends AbstractAction |
|
|
* 会员特权查看页
|
|
|
*/
|
|
|
|
|
|
public function preferentialAction()
|
|
|
{
|
|
|
public function preferentialAction() {
|
|
|
//设置网站seo信息
|
|
|
$this->setTitle('会员等级');
|
|
|
//显示网站导航头部信息
|
...
|
...
|
@@ -434,12 +415,11 @@ class HomeController extends AbstractAction |
|
|
}
|
|
|
|
|
|
/*
|
|
|
* 我的订单页面
|
|
|
* 我的订单页面,获得nav导航条焦点。并且异步请求订单详情列表页(getOrders)
|
|
|
*/
|
|
|
|
|
|
public function orderAction()
|
|
|
{
|
|
|
//获得type值
|
|
|
public function orderAction() {
|
|
|
//获得type值,type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论。
|
|
|
$type = $this->get('type', 1);
|
|
|
$this->setTitle('我的订单');
|
|
|
$this->setNavHeader('我的订单');
|
...
|
...
|
@@ -449,7 +429,7 @@ class HomeController extends AbstractAction |
|
|
} else {
|
|
|
$this->error();
|
|
|
}
|
|
|
|
|
|
//渲染模板
|
|
|
$this->_view->display('order', array(
|
|
|
'order' => $order,
|
|
|
'pageFooter' => true,
|
...
|
...
|
@@ -458,8 +438,7 @@ class HomeController extends AbstractAction |
|
|
}
|
|
|
|
|
|
//ajax请求订单页面
|
|
|
public function getOrdersAction()
|
|
|
{
|
|
|
public function getOrdersAction() {
|
|
|
//判断是不是ajax请求
|
|
|
if (!$this->isAjax()) {
|
|
|
$this->error();
|
...
|
...
|
@@ -474,15 +453,18 @@ class HomeController extends AbstractAction |
|
|
$uid = '10267443'; //测试用
|
|
|
//调用模型层getOrder方法获得并处理数据
|
|
|
$data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid);
|
|
|
//如果没有订单数据,就给一个随便逛逛链接
|
|
|
/* 如果取不到订单数据时,分两种情况:
|
|
|
1、page>1时,echo一个空格字符串到浏览器。
|
|
|
2、page=1时,就给一个随便逛逛的链接。
|
|
|
* */
|
|
|
$order = array();
|
|
|
if (!empty($data)) {
|
|
|
$order['orders'] = $data;
|
|
|
} else {
|
|
|
if ($page > 1) {
|
|
|
echo " ";
|
|
|
} else {
|
|
|
$order['walkwayUrl'] = 'http://www.baidu.com';
|
|
|
} elseif ($page = 1) {
|
|
|
$order['walkwayUrl'] = self::strollAction();
|
|
|
}
|
|
|
}
|
|
|
//渲染模板
|
...
|
...
|
@@ -493,21 +475,22 @@ class HomeController extends AbstractAction |
|
|
* 我的订单-取消订单
|
|
|
*/
|
|
|
|
|
|
public function cancelOrderAction()
|
|
|
{
|
|
|
public function cancelOrderAction() {
|
|
|
|
|
|
//判断是不是ajax请求
|
|
|
if (!$this->isAjax()) {
|
|
|
$this->error();
|
|
|
}
|
|
|
//传入order_code和uid以取消订单
|
|
|
$order_code = $this->get('orderCode');
|
|
|
$order_code = $this->get('id');
|
|
|
$uid = $this->getUid();
|
|
|
$uid = '10267443'; //测试用
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
$yh_channel = $this->get('yh_channel', 1);
|
|
|
$method = 'app.SpaceOrders.close';
|
|
|
//调用取消订单接口,返回订单取消状态
|
|
|
$data = OrderData::cancelOrderData($order_code, $uid, $gender, $yh_channel, $method);
|
|
|
//将取消状态返回至浏览器
|
|
|
$this->echoJson($data);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -515,8 +498,7 @@ class HomeController extends AbstractAction |
|
|
* 我的订单-删除订单
|
|
|
*/
|
|
|
|
|
|
public function delOrderAction()
|
|
|
{
|
|
|
public function delOrderAction() {
|
|
|
//判断是不是ajax请求
|
|
|
if (!$this->isAjax()) {
|
|
|
$this->error();
|
...
|
...
|
@@ -528,15 +510,39 @@ class HomeController extends AbstractAction |
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
$yh_channel = $this->get('yh_channel', 1);
|
|
|
$method = 'app.SpaceOrders.delOrderByCode';
|
|
|
//调用接口删除订单,并返回订单删除状态
|
|
|
$data = OrderData::deleteOrderData($order_code, $uid, $gender, $yh_channel, $method);
|
|
|
//将订单删除状态返回至浏览器
|
|
|
$this->echoJson($data);
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
* 我的订单-支付链接获取
|
|
|
*/
|
|
|
|
|
|
private function paymentAction() {
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
$yh_channel = $this->get('yh_channel', 1);
|
|
|
OrderModel::payment($gender, $yh_channel);
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
* 我的订单-随便逛逛链接获取
|
|
|
*/
|
|
|
|
|
|
private function strollAction() {
|
|
|
//获取性别、频道数据
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
$yh_channel = $this->get('yh_channel', 1);
|
|
|
//调用接口获取随便逛逛url地址,并return数据
|
|
|
$data = OrderModel::stroll($gender, $yh_channel);
|
|
|
return $data;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 订单详情页
|
|
|
*/
|
|
|
public function orderDetailAction()
|
|
|
{
|
|
|
public function orderDetailAction() {
|
|
|
$data = array(
|
|
|
'name' => '毛毛莉Lydia',
|
|
|
'phoneNum' => '18600001133',
|
...
|
...
|
|