...
|
...
|
@@ -16,24 +16,24 @@ use Plugin\Helpers; |
|
|
*/
|
|
|
class HomeController extends AbstractAction
|
|
|
{
|
|
|
|
|
|
/**
|
|
|
* 个人中心入口
|
|
|
*/
|
|
|
public function indexAction()
|
|
|
{
|
|
|
// 设置网站标题
|
|
|
public function indexAction() {
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('个人中心');
|
|
|
$this->setNavHeader('个人中心', true, SITE_MAIN);
|
|
|
$this->setNavHeader('个人中心', true, SITE_MAIN);
|
|
|
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 967016;
|
|
|
$uid = 8826435;
|
|
|
$data = \Index\UserModel::getUserProfileData($uid);
|
|
|
$data += \Index\UserModel::getInfoNumData($uid);
|
|
|
|
|
|
// 优选新品数据
|
|
|
$channel = Helpers::getChannelByCookie();
|
|
|
$data['recommendForYou'] = \Index\UserModel::getPreferenceData($channel);
|
|
|
// print_r($data);
|
|
|
// 优选新品数据
|
|
|
$channel = Helpers::getChannelByCookie();
|
|
|
$data['recommendForYou'] = \Index\UserModel::getPreferenceData($channel);
|
|
|
// print_r($data);
|
|
|
|
|
|
$data['myIndexPage'] = true;
|
|
|
$data['pageFooter'] = true;
|
...
|
...
|
@@ -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);
|
|
|
|
|
|
$uid = $this->getUid();
|
|
|
$uid = 8826435;
|
|
|
$type = $this->get('type', 1);
|
|
|
|
|
|
// $orders = \Index\UserModel::getUserOrderData(967016, $type);
|
|
|
$order = \Index\UserModel::getUserOrderData($uid, $type);
|
|
|
|
|
|
$order = array(
|
|
|
'orders' => array(
|
...
|
...
|
@@ -85,19 +90,17 @@ class HomeController extends AbstractAction |
|
|
);
|
|
|
|
|
|
$this->_view->display('order', array('order' => $order, 'orderPage' => true));
|
|
|
// print_r($orders);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 用户收藏的商品
|
|
|
*/
|
|
|
public function favoriteAction()
|
|
|
{
|
|
|
$uid = $this->getUid();
|
|
|
/**
|
|
|
* 用户收藏的商品
|
|
|
*/
|
|
|
public function favoriteAction() {
|
|
|
$uid = $this->getUid();
|
|
|
|
|
|
$favProducts = \Index\UserModel::getFavProductData($uid);
|
|
|
$favProducts = \Index\UserModel::getFavProductData($uid);
|
|
|
|
|
|
//print_r($favProducts);
|
|
|
//print_r($favProducts);
|
|
|
|
|
|
$this->_view->display('favorite', array(
|
|
|
'favPage' => true, //加载js
|
...
|
...
|
@@ -202,57 +205,43 @@ class HomeController extends AbstractAction |
|
|
)
|
|
|
)
|
|
|
));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 用户收藏的品牌
|
|
|
*/
|
|
|
public function favoritebrandAction()
|
|
|
{
|
|
|
$uid = $this->getUid();
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
/**
|
|
|
* 用户收藏的品牌
|
|
|
*/
|
|
|
public function favoritebrandAction() {
|
|
|
$uid = $this->getUid();
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
|
|
|
$favBrands = \Index\UserModel::getFavBrandData($uid, $gender);
|
|
|
$favBrands = \Index\UserModel::getFavBrandData($uid, $gender);
|
|
|
|
|
|
print_r($favBrands);
|
|
|
}
|
|
|
print_r($favBrands);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 个人信息
|
|
|
*/
|
|
|
public function personalDetailsAction()
|
|
|
{
|
|
|
/**
|
|
|
* 个人信息
|
|
|
*/
|
|
|
public function personalDetailsAction() {
|
|
|
$this->setTitle('个人信息');
|
|
|
$this->setNavHeader('个人信息', true, SITE_MAIN);
|
|
|
$this->setNavHeader('个人信息', true, SITE_MAIN);
|
|
|
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 967016;
|
|
|
$data = \Index\UserModel::getUserProfileData($uid);
|
|
|
$data['pageFooter'] = true;
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 967016;
|
|
|
$data = \Index\UserModel::getUserProfileData($uid);
|
|
|
$data['pageFooter'] = true;
|
|
|
$this->_view->display('personal-details', $data);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* YOHO币
|
|
|
*/
|
|
|
public function currencyAction() {
|
|
|
// $uid = $this->getUid();
|
|
|
$this->setNavHeader('YOHO币', true, false);
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* YOHO币
|
|
|
*/
|
|
|
public function currencyAction()
|
|
|
{
|
|
|
// $uid = $this->getUid();
|
|
|
$this->setNavHeader('YOHO币', true, false);
|
|
|
|
|
|
$uid = 967016;
|
|
|
$currency = \Index\UserModel::getYohoCoinData($uid);
|
|
|
|
|
|
$this->_view->display('currency', $currency);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 优惠券
|
|
|
*/
|
|
|
public function couponsAction()
|
|
|
{
|
|
|
$uid = 967016;
|
|
|
$currency = \Index\UserModel::getYohoCoinData($uid);
|
|
|
|
|
|
$this->setTitle('优惠券');
|
|
|
$this->setNavHeader('优惠券', true, SITE_MAIN);
|
...
|
...
|
@@ -266,106 +255,117 @@ class HomeController extends AbstractAction |
|
|
'couponsPage' => true
|
|
|
);
|
|
|
|
|
|
print_r($coupons);
|
|
|
$this->_view->display('coupons', $coupons);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
/**
|
|
|
* 优惠券
|
|
|
*/
|
|
|
public function couponsAction() {
|
|
|
|
|
|
/**
|
|
|
* 我的消息
|
|
|
*/
|
|
|
public function messageAction()
|
|
|
{
|
|
|
// $uid = $this->getUid();
|
|
|
$page = $this->get('page', 0);
|
|
|
$size = $this->get('size', 10);
|
|
|
$this->setTitle('优惠券');
|
|
|
$this->setNavHeader('优惠券', true, SITE_MAIN);
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 8826435;
|
|
|
$status = $this->get('status', 0);
|
|
|
$coupons = array(
|
|
|
'couponsUrl' => \Index\UserModel::getCouponData($uid, $status),
|
|
|
'couponsPage' => true
|
|
|
);
|
|
|
|
|
|
$uid = 967016;
|
|
|
$messages = \Index\UserModel::getMessageData($uid, $page, $size);
|
|
|
print_r($coupons);
|
|
|
$this->_view->display('coupons', $coupons);
|
|
|
}
|
|
|
|
|
|
print_r($messages);
|
|
|
/**
|
|
|
* 我的消息
|
|
|
*/
|
|
|
public function messageAction() {
|
|
|
// $uid = $this->getUid();
|
|
|
$page = $this->get('page', 0);
|
|
|
$size = $this->get('size', 10);
|
|
|
|
|
|
}
|
|
|
$uid = 967016;
|
|
|
$messages = \Index\UserModel::getMessageData($uid, $page, $size);
|
|
|
|
|
|
/**
|
|
|
* 地址管理
|
|
|
*/
|
|
|
public function addressAction()
|
|
|
{
|
|
|
// 设置网站标题
|
|
|
print_r($messages);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 地址管理
|
|
|
*/
|
|
|
public function addressAction() {
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('地址管理');
|
|
|
$this->setNavHeader('地址管理', true, SITE_MAIN);
|
|
|
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 967016;
|
|
|
|
|
|
$address = \Index\UserModel::getAddressData($uid);
|
|
|
$addressList = \Index\UserModel::getAddressListData($uid);
|
|
|
$address = \Index\UserModel::getAddressData($uid);
|
|
|
$addressList = \Index\UserModel::getAddressListData($uid);
|
|
|
|
|
|
// print_r($address);
|
|
|
// print_r($address);
|
|
|
|
|
|
$this->_view->display('address', array(
|
|
|
'addressPage' => true,
|
|
|
'pageFooter' => true,
|
|
|
'address' => $address,
|
|
|
'addressList' => $addressList
|
|
|
'addressList' => $addressList
|
|
|
));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 修改地址或者添加新地址
|
|
|
*/
|
|
|
public function saveAddressAction()
|
|
|
{
|
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 967016;
|
|
|
$address = $this->post('address', '');
|
|
|
$area_code = $this->post('area_code', '');
|
|
|
$consignee = $this->post('consignee', '');
|
|
|
$email = $this->post('email', '');
|
|
|
$id = $this->post('id', null);
|
|
|
$mobile = $this->post('mobile', '');
|
|
|
$zip_code = $this->post('zip_code', '');
|
|
|
|
|
|
$result = \Index\UserModel::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
|
|
echo ' ';
|
|
|
} else {
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
/**
|
|
|
* 修改地址或者添加新地址
|
|
|
*/
|
|
|
public function saveAddressAction() {
|
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 967016;
|
|
|
$address = $this->post('address', '');
|
|
|
$area_code = $this->post('area_code', '');
|
|
|
$consignee = $this->post('consignee', '');
|
|
|
$email = $this->post('email', '');
|
|
|
$id = $this->post('id', null);
|
|
|
$mobile = $this->post('mobile', '');
|
|
|
$zip_code = $this->post('zip_code', '');
|
|
|
|
|
|
$result = \Index\UserModel::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 设置默认地址
|
|
|
*/
|
|
|
public function defaultAddressAction()
|
|
|
{
|
|
|
$result = array();
|
|
|
if (empty($result)) {
|
|
|
echo ' ';
|
|
|
} else {
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if ($this->isAjax()) {
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 967016;
|
|
|
$id = $this->post('id', '');
|
|
|
/**
|
|
|
* 设置默认地址
|
|
|
*/
|
|
|
public function defaultAddressAction() {
|
|
|
$result = array();
|
|
|
|
|
|
$result = \Index\UserModel::setDefaultAddress($uid, $id);
|
|
|
}
|
|
|
if ($this->isAjax()) {
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 967016;
|
|
|
$id = $this->post('id', '');
|
|
|
|
|
|
if (empty($result)) {
|
|
|
echo ' ';
|
|
|
} else {
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
$result = \Index\UserModel::setDefaultAddress($uid, $id);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
if (empty($result)) {
|
|
|
echo ' ';
|
|
|
} 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('在线客服');
|
...
|
...
|
@@ -395,25 +393,23 @@ class HomeController extends AbstractAction |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 我的逛
|
|
|
*/
|
|
|
public function myGuangAction()
|
|
|
{
|
|
|
echo 'My Guang';
|
|
|
}
|
|
|
* 我的逛
|
|
|
*/
|
|
|
public function myGuangAction() {
|
|
|
echo 'My Guang';
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 意见反馈
|
|
|
*/
|
|
|
public function suggestAction()
|
|
|
{
|
|
|
$udid = $this->getUdid();
|
|
|
$page = $this->get('page', 1);
|
|
|
$limit = $this->get('limit', 30);
|
|
|
/**
|
|
|
* 意见反馈
|
|
|
*/
|
|
|
public function suggestAction() {
|
|
|
$udid = $this->getUdid();
|
|
|
$page = $this->get('page', 1);
|
|
|
$limit = $this->get('limit', 30);
|
|
|
|
|
|
$suggest = \Index\UserModel::getSuggestData($udid, $page, $limit);
|
|
|
$suggest = \Index\UserModel::getSuggestData($udid, $page, $limit);
|
|
|
|
|
|
//print_r($suggest);
|
|
|
//print_r($suggest);
|
|
|
$this->_view->display('suggest', array(
|
|
|
'suggestPage' => true, //加载js
|
|
|
'pageHeader' => array(
|
...
|
...
|
@@ -443,8 +439,8 @@ class HomeController extends AbstractAction |
|
|
'bad' => false)
|
|
|
)
|
|
|
));
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 意见反馈-提交表单
|
...
|
...
|
@@ -480,121 +476,84 @@ 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);
|
|
|
|
|
|
$result = \Index\UserModel::saveSuggestData($uid, $content, $suggest_type);
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
/**
|
|
|
* 会员等级展示页
|
|
|
*/
|
|
|
public function gradeAction() {
|
|
|
//设置网站seo信息
|
|
|
$this->setTitle('会员等级');
|
|
|
//显示网站导航头部信息
|
|
|
$this->setNavHeader('会员等级');
|
|
|
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
$channel = Helpers::getChannelByCookie();
|
|
|
$uid = $this->getUid();
|
|
|
$uid = '7566245'; //临时测试用
|
|
|
$data = GradeModel::getGrade($gender, $channel, $uid);
|
|
|
$data['pageFooter'] = true;
|
|
|
$this->_view->display('vip-grade', $data);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 会员等级展示页
|
|
|
*/
|
|
|
public function gradeAction(){
|
|
|
//设置网站seo信息
|
|
|
$this->setTitle('会员等级');
|
|
|
//显示网站导航头部信息
|
|
|
$this->setNavHeader('会员等级');
|
|
|
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
$channel = Helpers::getChannelByCookie();
|
|
|
$uid = $this -> getUid();
|
|
|
$uid = '7566245';//临时测试用
|
|
|
$data = GradeModel::getGrade($gender,$channel,$uid);
|
|
|
$data['pageFooter'] = true;
|
|
|
$this -> _view -> display('vip-grade',$data);
|
|
|
}
|
|
|
/*
|
|
|
*会员特权查看页
|
|
|
*/
|
|
|
public function preferentialAction(){
|
|
|
//设置网站seo信息
|
|
|
$this->setTitle('会员等级');
|
|
|
//显示网站导航头部信息
|
|
|
$this->setNavHeader('会员特权详情');
|
|
|
|
|
|
$channel = Helpers::getChannelByCookie();
|
|
|
$uid = $this -> getUid();
|
|
|
$data = GradeModel::getPreferential($channel,$uid);
|
|
|
$data['pageFooter'] = true;
|
|
|
$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);
|
|
|
$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);
|
|
|
}
|
|
|
while(false);
|
|
|
//$this -> _view -> display('order',$data);
|
|
|
}
|
|
|
/*
|
|
|
* 会员特权查看页
|
|
|
*/
|
|
|
public function preferentialAction() {
|
|
|
//设置网站seo信息
|
|
|
$this->setTitle('会员等级');
|
|
|
//显示网站导航头部信息
|
|
|
$this->setNavHeader('会员特权详情');
|
|
|
|
|
|
$channel = Helpers::getChannelByCookie();
|
|
|
$uid = $this->getUid();
|
|
|
$data = GradeModel::getPreferential($channel, $uid);
|
|
|
$data['pageFooter'] = true;
|
|
|
$this->_view->display('privilege', $data);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 订单详情页
|
|
|
/*
|
|
|
* 我的订单页面
|
|
|
*/
|
|
|
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 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();
|
|
|
$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';
|
|
|
}
|
|
|
//渲染模板
|
|
|
$this->_view->display('order', array(
|
|
|
'order' => $order,
|
|
|
'orderPage' => true
|
|
|
));
|
|
|
}
|
|
|
|
|
|
'sumPrice' => 799,
|
|
|
'salePrice' => 80,
|
|
|
'freight' => 5,
|
|
|
'yohoCoin' => 5,
|
|
|
'price' => 719
|
|
|
);
|
|
|
$this->_view->display('order-detail', array('orderDetail' => $data, 'orderDetailPage' => true));
|
|
|
/*
|
|
|
* 我的订单-处理ajax请求页面(切换订单状态)
|
|
|
*/
|
|
|
public function orderAjaxAction() {
|
|
|
|
|
|
//判断是不是ajax请求
|
|
|
if (!$this->isAjax()) {
|
|
|
$this->error();
|
|
|
}
|
|
|
self::orderAction();
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|