...
|
...
|
@@ -16,17 +16,17 @@ use Plugin\Helpers; |
|
|
*/
|
|
|
class HomeController extends AbstractAction
|
|
|
{
|
|
|
|
|
|
/**
|
|
|
* 个人中心入口
|
|
|
*/
|
|
|
public function indexAction()
|
|
|
{
|
|
|
public function indexAction() {
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('个人中心');
|
|
|
$this->setNavHeader('个人中心', true, SITE_MAIN);
|
|
|
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 967016;
|
|
|
$uid = 8826435;
|
|
|
$data = \Index\UserModel::getUserProfileData($uid);
|
|
|
$data += \Index\UserModel::getInfoNumData($uid);
|
|
|
|
...
|
...
|
@@ -46,10 +46,15 @@ class HomeController extends AbstractAction |
|
|
*/
|
|
|
public function ordersAction()
|
|
|
{
|
|
|
// $uid = $this->getUid();
|
|
|
// $type = $this->get('type', 1);
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('我的订单');
|
|
|
$this->setNavHeader('我的订单', true, SITE_MAIN);
|
|
|
|
|
|
// $orders = \Index\UserModel::getUserOrderData(967016, $type);
|
|
|
$uid = $this->getUid();
|
|
|
$uid = 8826435;
|
|
|
$type = $this->get('type', 1);
|
|
|
|
|
|
$order = \Index\UserModel::getUserOrderData($uid, $type);
|
|
|
|
|
|
$order = array(
|
|
|
'orders' => array(
|
...
|
...
|
@@ -85,14 +90,12 @@ class HomeController extends AbstractAction |
|
|
);
|
|
|
|
|
|
$this->_view->display('order', array('order' => $order, 'orderPage' => true));
|
|
|
// print_r($orders);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 用户收藏的商品
|
|
|
*/
|
|
|
public function favoriteAction()
|
|
|
{
|
|
|
public function favoriteAction() {
|
|
|
$uid = $this->getUid();
|
|
|
|
|
|
$favProducts = \Index\UserModel::getFavProductData($uid);
|
...
|
...
|
@@ -207,8 +210,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 用户收藏的品牌
|
|
|
*/
|
|
|
public function favoritebrandAction()
|
|
|
{
|
|
|
public function favoritebrandAction() {
|
|
|
$uid = $this->getUid();
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
|
...
|
...
|
@@ -220,8 +222,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 个人信息
|
|
|
*/
|
|
|
public function personalDetailsAction()
|
|
|
{
|
|
|
public function personalDetailsAction() {
|
|
|
$this->setTitle('个人信息');
|
|
|
$this->setNavHeader('个人信息', true, SITE_MAIN);
|
|
|
|
...
|
...
|
@@ -230,51 +231,57 @@ class HomeController extends AbstractAction |
|
|
$data = \Index\UserModel::getUserProfileData($uid);
|
|
|
$data['pageFooter'] = true;
|
|
|
$this->_view->display('personal-details', $data);
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* YOHO币
|
|
|
*/
|
|
|
public function currencyAction()
|
|
|
{
|
|
|
public function currencyAction() {
|
|
|
// $uid = $this->getUid();
|
|
|
$this->setNavHeader('YOHO币', true, false);
|
|
|
|
|
|
$uid = 967016;
|
|
|
$currency = \Index\UserModel::getYohoCoinData($uid);
|
|
|
|
|
|
$this->_view->display('currency', $currency);
|
|
|
$this->setTitle('优惠券');
|
|
|
$this->setNavHeader('优惠券', true, SITE_MAIN);
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 8826435;
|
|
|
$coupons = array(
|
|
|
'couponsUrl' => array(
|
|
|
\Index\UserModel::getCouponData($uid, 0),
|
|
|
\Index\UserModel::getCouponData($uid, 1),
|
|
|
),
|
|
|
'couponsPage' => true
|
|
|
);
|
|
|
|
|
|
print_r($coupons);
|
|
|
$this->_view->display('coupons', $coupons);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 优惠券
|
|
|
*/
|
|
|
public function couponsAction()
|
|
|
{
|
|
|
public function couponsAction() {
|
|
|
|
|
|
$this->setTitle('优惠券');
|
|
|
$this->setNavHeader('优惠券', true, SITE_MAIN);
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 8826435;
|
|
|
$status = $this->get('status', 0);
|
|
|
$coupons = array(
|
|
|
'couponsUrl' => array(
|
|
|
\Index\UserModel::getCouponData($uid, 0),
|
|
|
\Index\UserModel::getCouponData($uid, 1),
|
|
|
),
|
|
|
'couponsUrl' => \Index\UserModel::getCouponData($uid, $status),
|
|
|
'couponsPage' => true
|
|
|
);
|
|
|
|
|
|
print_r($coupons);
|
|
|
$this->_view->display('coupons', $coupons);
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 我的消息
|
|
|
*/
|
|
|
public function messageAction()
|
|
|
{
|
|
|
public function messageAction() {
|
|
|
// $uid = $this->getUid();
|
|
|
$page = $this->get('page', 0);
|
|
|
$size = $this->get('size', 10);
|
...
|
...
|
@@ -283,14 +290,12 @@ class HomeController extends AbstractAction |
|
|
$messages = \Index\UserModel::getMessageData($uid, $page, $size);
|
|
|
|
|
|
print_r($messages);
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 地址管理
|
|
|
*/
|
|
|
public function addressAction()
|
|
|
{
|
|
|
public function addressAction() {
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('地址管理');
|
|
|
$this->setNavHeader('地址管理', true, SITE_MAIN);
|
...
|
...
|
@@ -314,8 +319,7 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 修改地址或者添加新地址
|
|
|
*/
|
|
|
public function saveAddressAction()
|
|
|
{
|
|
|
public function saveAddressAction() {
|
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
...
|
...
|
@@ -337,14 +341,12 @@ class HomeController extends AbstractAction |
|
|
} else {
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 设置默认地址
|
|
|
*/
|
|
|
public function defaultAddressAction()
|
|
|
{
|
|
|
public function defaultAddressAction() {
|
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
...
|
...
|
@@ -360,12 +362,10 @@ class HomeController extends AbstractAction |
|
|
} else {
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//在线客服
|
|
|
public function onlineServiceAction()
|
|
|
{
|
|
|
public function onlineServiceAction() {
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('在线客服');
|
|
|
$this->setNavHeader('在线客服', true, SITE_MAIN);
|
...
|
...
|
@@ -380,13 +380,11 @@ class HomeController extends AbstractAction |
|
|
}
|
|
|
|
|
|
//在线客服-具体详情
|
|
|
public function onlineServiceDetailAction()
|
|
|
{
|
|
|
public function onlineServiceDetailAction() {
|
|
|
$service = array();
|
|
|
$cateId = $this->get('cateId', 0);
|
|
|
$cateName = $this->get('cateName', '');
|
|
|
if ($cateId > 0)
|
|
|
{
|
|
|
if ($cateId > 0) {
|
|
|
$service = home\OnlineModel::getOnlineServiceDetail($cateId);
|
|
|
}
|
|
|
$this->setTitle('在线客服');
|
...
|
...
|
@@ -397,16 +395,14 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 我的逛
|
|
|
*/
|
|
|
public function myGuangAction()
|
|
|
{
|
|
|
public function myGuangAction() {
|
|
|
echo 'My Guang';
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 意见反馈
|
|
|
*/
|
|
|
public function suggestAction()
|
|
|
{
|
|
|
public function suggestAction() {
|
|
|
$udid = $this->getUdid();
|
|
|
$page = $this->get('page', 1);
|
|
|
$limit = $this->get('limit', 30);
|
...
|
...
|
@@ -443,9 +439,9 @@ class HomeController extends AbstractAction |
|
|
'bad' => false)
|
|
|
)
|
|
|
));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 意见反馈-提交表单
|
|
|
*/
|
...
|
...
|
@@ -480,18 +476,16 @@ class HomeController extends AbstractAction |
|
|
$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);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 会员等级展示页
|
|
|
*/
|
|
|
public function gradeAction(){
|
|
|
public function gradeAction() {
|
|
|
//设置网站seo信息
|
|
|
$this->setTitle('会员等级');
|
|
|
//显示网站导航头部信息
|
...
|
...
|
@@ -499,102 +493,67 @@ class HomeController extends AbstractAction |
|
|
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
$channel = Helpers::getChannelByCookie();
|
|
|
$uid = $this -> getUid();
|
|
|
$uid = '7566245';//临时测试用
|
|
|
$data = GradeModel::getGrade($gender,$channel,$uid);
|
|
|
$uid = $this->getUid();
|
|
|
$uid = '7566245'; //临时测试用
|
|
|
$data = GradeModel::getGrade($gender, $channel, $uid);
|
|
|
$data['pageFooter'] = true;
|
|
|
$this -> _view -> display('vip-grade',$data);
|
|
|
$this->_view->display('vip-grade', $data);
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
*会员特权查看页
|
|
|
* 会员特权查看页
|
|
|
*/
|
|
|
public function preferentialAction(){
|
|
|
public function preferentialAction() {
|
|
|
//设置网站seo信息
|
|
|
$this->setTitle('会员等级');
|
|
|
//显示网站导航头部信息
|
|
|
$this->setNavHeader('会员特权详情');
|
|
|
|
|
|
$channel = Helpers::getChannelByCookie();
|
|
|
$uid = $this -> getUid();
|
|
|
$data = GradeModel::getPreferential($channel,$uid);
|
|
|
$uid = $this->getUid();
|
|
|
$data = GradeModel::getPreferential($channel, $uid);
|
|
|
$data['pageFooter'] = true;
|
|
|
$this -> _view -> display('privilege',$data);
|
|
|
$this->_view->display('privilege', $data);
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
*我的订单页面
|
|
|
* 我的订单页面
|
|
|
*/
|
|
|
public function orderAction(){
|
|
|
|
|
|
do{
|
|
|
//判断是不是ajax请求
|
|
|
// if(!$this -> isAjax()){
|
|
|
// break;
|
|
|
// }
|
|
|
//判断参数是否有效
|
|
|
$type = $this -> get('type',1);
|
|
|
$page = $this -> get('page',1);
|
|
|
$limit = $this -> get('limit',10);
|
|
|
public function orderAction() {
|
|
|
//获取基本参数:type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论
|
|
|
$type = $this->get('type', 1);
|
|
|
$page = $this->get('page', 1);
|
|
|
$limit = $this->get('limit', 10);
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
$yh_channel = $this -> get('yh_channel',1);
|
|
|
$uid = $this -> getUid();
|
|
|
if(!empty($type) && !is_numeric($type)){
|
|
|
break;
|
|
|
}
|
|
|
//$data = OrderModel::getOrder();
|
|
|
$data = OrderModel::getOrder($type,$page,$limit,$gender,$yh_channel,$uid);
|
|
|
//print_r($data);
|
|
|
$yh_channel = $this->get('yh_channel', 1);
|
|
|
$uid = $this->getUid();
|
|
|
$uid = '7566245'; //测试用
|
|
|
//调用模型层getOrder方法获得并处理数据
|
|
|
$data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid);
|
|
|
//如果没有订单数据,就给一个随便逛逛链接
|
|
|
$order = array();
|
|
|
if (!empty($data)) {
|
|
|
$order['orders'] = $data;
|
|
|
} else {
|
|
|
$order['walkwayUrl'] = 'http://www.baidu.com';
|
|
|
}
|
|
|
while(false);
|
|
|
//$this -> _view -> display('order',$data);
|
|
|
//渲染模板
|
|
|
$this->_view->display('order', array(
|
|
|
'order' => $order,
|
|
|
'orderPage' => true
|
|
|
));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 订单详情页
|
|
|
/*
|
|
|
* 我的订单-处理ajax请求页面(切换订单状态)
|
|
|
*/
|
|
|
public function orderDetailAction()
|
|
|
{
|
|
|
$data = array(
|
|
|
'name' => '毛毛莉Lydia',
|
|
|
'phoneNum' => '18600001133',
|
|
|
'address' => '南京市建邺区嘉陵江东街18号国家广告产业园5栋17楼',
|
|
|
'orderStatus' => '待收货',
|
|
|
'orderNum' => '418358063',
|
|
|
'orderTime' => '2014-03-10 17:25:10',
|
|
|
|
|
|
'unreceived' => true,
|
|
|
'logisticsUrl' => '',
|
|
|
'logisticsCompany' => '顺丰',
|
|
|
'logisticsNum' => '51537443456',
|
|
|
|
|
|
'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'
|
|
|
)
|
|
|
),
|
|
|
public function orderAjaxAction() {
|
|
|
|
|
|
'sumPrice' => 799,
|
|
|
'salePrice' => 80,
|
|
|
'freight' => 5,
|
|
|
'yohoCoin' => 5,
|
|
|
'price' => 719
|
|
|
);
|
|
|
$this->_view->display('order-detail', array('orderDetail' => $data, 'orderDetailPage' => true));
|
|
|
//判断是不是ajax请求
|
|
|
if (!$this->isAjax()) {
|
|
|
$this->error();
|
|
|
}
|
|
|
self::orderAction();
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|