...
|
...
|
@@ -4,6 +4,7 @@ use Action\AbstractAction; |
|
|
use home\GradeModel;
|
|
|
use home\OrderModel;
|
|
|
use Plugin\Helpers;
|
|
|
use LibModels\Wap\Home\OrderData;
|
|
|
|
|
|
/**
|
|
|
* 个人中心相关的控制器
|
...
|
...
|
@@ -25,10 +26,10 @@ class HomeController extends AbstractAction |
|
|
$this->setTitle('个人中心');
|
|
|
$this->setNavHeader('个人中心', true, SITE_MAIN);
|
|
|
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 8826435;
|
|
|
$data = \Index\UserModel::getUserProfileData($uid);
|
|
|
$data += \Index\UserModel::getInfoNumData($uid);
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 8826435;
|
|
|
$data = \Index\UserModel::getUserProfileData($uid);
|
|
|
$data += \Index\UserModel::getInfoNumData($uid);
|
|
|
|
|
|
// 优选新品数据
|
|
|
$channel = Helpers::getChannelByCookie();
|
...
|
...
|
@@ -41,57 +42,6 @@ class HomeController extends AbstractAction |
|
|
$this->_view->display('index', $data);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 用户订单
|
|
|
*/
|
|
|
public function ordersAction()
|
|
|
{
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('我的订单');
|
|
|
$this->setNavHeader('我的订单', true, SITE_MAIN);
|
|
|
|
|
|
$uid = $this->getUid();
|
|
|
$uid = 8826435;
|
|
|
$type = $this->get('type', 1);
|
|
|
|
|
|
$order = \Index\UserModel::getUserOrderData($uid, $type);
|
|
|
|
|
|
$order = array(
|
|
|
'orders' => array(
|
|
|
array(
|
|
|
'orderNum' => '408539077',
|
|
|
'tradingStatus' => '交易成功',
|
|
|
'goods' => array(
|
|
|
array(
|
|
|
'id' => 1,
|
|
|
'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
|
|
|
'name' => 'Adidas Originals ZX FLUXM22508',
|
|
|
'color' => '黄',
|
|
|
'size' => '43',
|
|
|
'price' => '699.00',
|
|
|
'count' => '2'
|
|
|
),
|
|
|
array(
|
|
|
'id' => 1,
|
|
|
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/11/04/05/0188f1aca49ac478a565ec029b5d2d4a6c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
|
|
|
'name' => 'B.Duck浴室玩伴mini浮水鸭',
|
|
|
'gift' => true,
|
|
|
'color' => '黄',
|
|
|
'size' => '43',
|
|
|
'price' => '0.00',
|
|
|
'count' => '1'
|
|
|
)
|
|
|
),
|
|
|
'count' => 2,
|
|
|
'sumCost' => '699.00',
|
|
|
'unpaid' => true,
|
|
|
)
|
|
|
)
|
|
|
);
|
|
|
|
|
|
$this->_view->display('order', array('order' => $order, 'orderPage' => true));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 用户收藏的商品
|
|
|
*/
|
...
|
...
|
@@ -131,7 +81,7 @@ class HomeController extends AbstractAction |
|
|
),
|
|
|
'hasFavBrand' => array(
|
|
|
'0' => array(
|
|
|
'id'=> '1',
|
|
|
'id' => '1',
|
|
|
'brandImg' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
|
|
|
'brandName' => 'VANS',
|
|
|
'update' => 12,
|
...
|
...
|
@@ -161,7 +111,7 @@ class HomeController extends AbstractAction |
|
|
)
|
|
|
),
|
|
|
'1' => array(
|
|
|
'id'=> '2',
|
|
|
'id' => '2',
|
|
|
'brandImg' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
|
|
|
'brandName' => 'VANS',
|
|
|
'update' => 12,
|
...
|
...
|
@@ -191,7 +141,7 @@ class HomeController extends AbstractAction |
|
|
)
|
|
|
),
|
|
|
'2' => array(
|
|
|
'id'=> '3',
|
|
|
'id' => '3',
|
|
|
'brandImg' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
|
|
|
'brandName' => 'VANS',
|
|
|
'update' => 12,
|
...
|
...
|
@@ -391,19 +341,19 @@ class HomeController extends AbstractAction |
|
|
* 意见反馈
|
|
|
*/
|
|
|
public function suggestAction() {
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('意见反馈');
|
|
|
$this->setNavHeader('意见反馈', true, SITE_MAIN);
|
|
|
|
|
|
$udid = $this->getUdid();
|
|
|
$page = $this->get('page', 1);
|
|
|
$limit = $this->get('limit', 30);
|
|
|
|
|
|
$suggest = \Index\UserModel::getSuggestData($udid, $page, $limit);
|
|
|
|
|
|
//print_r($suggest);
|
|
|
print_r($suggest);
|
|
|
$this->_view->display('suggest', array(
|
|
|
'suggestPage' => true, //加载js
|
|
|
'pageHeader' => array(
|
|
|
'navBack' => true,
|
|
|
'navTitle' => '意见反馈'
|
|
|
),
|
|
|
'pageFooter' => true,
|
|
|
'suggest' => true,
|
|
|
'suggestContent' => array(
|
...
|
...
|
@@ -429,12 +379,10 @@ 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);
|
...
|
...
|
@@ -452,18 +400,16 @@ class HomeController extends AbstractAction |
|
|
'suggestSub' => true,
|
|
|
'pageFooter' => true
|
|
|
));
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 异步保存意见反馈数据
|
|
|
*/
|
|
|
public function savesuggestAction()
|
|
|
{
|
|
|
if($this->isAjax()) {
|
|
|
$uid = $this->getUid();
|
|
|
$content = $this->post('content', '');
|
|
|
$suggest_type = $this->get('suggest_type', 2);
|
|
|
/**
|
|
|
* 异步保存意见反馈数据
|
|
|
*/
|
|
|
public function savesuggestAction() {
|
|
|
if ($this->isAjax()) {
|
|
|
$uid = $this->getUid();
|
|
|
$content = $this->post('content', '');
|
|
|
$suggest_type = $this->get('suggest_type', 2);
|
|
|
$result = \Index\UserModel::saveSuggestData($uid, $content, $suggest_type);
|
|
|
|
|
|
$this->echoJson($result);
|
...
|
...
|
@@ -491,6 +437,7 @@ class HomeController extends AbstractAction |
|
|
/*
|
|
|
* 会员特权查看页
|
|
|
*/
|
|
|
|
|
|
public function preferentialAction() {
|
|
|
//设置网站seo信息
|
|
|
$this->setTitle('会员等级');
|
...
|
...
|
@@ -507,7 +454,24 @@ class HomeController extends AbstractAction |
|
|
/*
|
|
|
* 我的订单页面
|
|
|
*/
|
|
|
public function orderAction() {
|
|
|
public function orderAction(){
|
|
|
$type = $this -> get('type',1);
|
|
|
$data = OrderModel::getNavs($type);
|
|
|
if(!empty($data)){
|
|
|
$order['navs'] = $data;
|
|
|
}
|
|
|
$this->_view->display('order', array(
|
|
|
'order' => $order
|
|
|
));
|
|
|
}
|
|
|
|
|
|
|
|
|
//ajax请求订单页面
|
|
|
public function getOrderAction() {
|
|
|
//判断是不是ajax请求
|
|
|
if (!$this->isAjax()) {
|
|
|
$this->error();
|
|
|
}
|
|
|
//获取基本参数:type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论
|
|
|
$type = $this->get('type', 1);
|
|
|
$page = $this->get('page', 1);
|
...
|
...
|
@@ -516,56 +480,71 @@ class HomeController extends AbstractAction |
|
|
$yh_channel = $this->get('yh_channel', 1);
|
|
|
$uid = $this->getUid();
|
|
|
$uid = '7566245'; //测试用
|
|
|
$this -> setTitle('我的订单');
|
|
|
$this -> setNavHeader('我的订单');
|
|
|
//调用模型层getOrder方法获得并处理数据
|
|
|
$data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid);
|
|
|
//如果没有订单数据,就给一个随便逛逛链接
|
|
|
//print_r($data);
|
|
|
$order = array();
|
|
|
// if (!empty($data)) {
|
|
|
// $order['orders'] = $data;
|
|
|
// } else {
|
|
|
// $order['walkwayUrl'] = 'http://www.baidu.com';
|
|
|
// }
|
|
|
$order['navs'] = array(
|
|
|
array(
|
|
|
'name' => '全部',
|
|
|
'active' => true,
|
|
|
'typeId' => '1'
|
|
|
),
|
|
|
array(
|
|
|
'name' => '待付款',
|
|
|
'typeId' => '2'
|
|
|
),
|
|
|
array(
|
|
|
'name' => '待发货',
|
|
|
'typeId' => '3'
|
|
|
),
|
|
|
array(
|
|
|
'name' => '待收货',
|
|
|
'typeId' => '4'
|
|
|
)
|
|
|
);
|
|
|
if (!empty($data)) {
|
|
|
$order['orders'] = $data;
|
|
|
} else {
|
|
|
$order['walkwayUrl'] = 'http://www.baidu.com';
|
|
|
}
|
|
|
//渲染模板
|
|
|
$this->_view->display('order', array(
|
|
|
$this->_view->display('orderContent', array(
|
|
|
'order' => $order,
|
|
|
'orderPage' => true,
|
|
|
'pageFooter' => true
|
|
|
));
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
* 我的订单-处理ajax请求页面(切换订单状态)
|
|
|
* 我的订单-取消订单
|
|
|
*/
|
|
|
public function getOrdersAction() {
|
|
|
|
|
|
public function cancelOrderAction() {
|
|
|
|
|
|
//判断是不是ajax请求
|
|
|
if (!$this->isAjax()) {
|
|
|
$this->error();
|
|
|
}
|
|
|
self::orderAction();
|
|
|
//传入order_code和uid以取消订单
|
|
|
$order_code = $this->get('orderCode');
|
|
|
$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);
|
|
|
if ($data['code'] == 200) {
|
|
|
echo $data['message'];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
* 我的订单-删除订单
|
|
|
*/
|
|
|
|
|
|
public function deleteOrderAction() {
|
|
|
//判断是不是ajax请求
|
|
|
if (!$this->isAjax()) {
|
|
|
$this->error();
|
|
|
}
|
|
|
//传入order_code和uid以删除订单
|
|
|
$order_code = $this->get('orderCode');
|
|
|
$uid = $this->getUid();
|
|
|
$uid = '10267443'; //测试用
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
$yh_channel = $this->get('yh_channel', 1);
|
|
|
$method = 'app.SpaceOrders.delOrderByCode';
|
|
|
$data = OrderData::deleteOrderData($order_code, $uid, $gender, $yh_channel, $method);
|
|
|
if ($data['code'] == 200) {
|
|
|
echo $data['message'];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 订单详情页
|
|
|
*/
|
|
|
public function orderDetailAction()
|
|
|
{
|
|
|
$data = array(
|
...
|
...
|
|