Authored by xiaowei

我的逛

... ... @@ -29,7 +29,6 @@ class GuangData
$param['limit'] = $limit;
$param['yh_channel'] = $yh_channel;
$param['client_secret'] = Sign::getSign($param);
// return Yohobuy::post(Yohobuy::API_URL, $param);
return Yohobuy::post(Yohobuy::SERVICE_URL . self::GUANG_URI . 'getUserFavArticleList', $param);
}
... ...
... ... @@ -37,7 +37,8 @@ class HomeController extends AbstractAction
/**
* 个人中心入口
*/
public function indexAction() {
public function indexAction()
{
// 设置网站标题
$this->setTitle('个人中心');
$this->setNavHeader('个人中心', true, SITE_MAIN);
... ... @@ -61,7 +62,8 @@ class HomeController extends AbstractAction
/**
* 用户收藏的商品
*/
public function favoriteAction() {
public function favoriteAction()
{
// 设置网站标题
$this->setTitle('我的收藏');
$this->setNavHeader('我的收藏', true, SITE_MAIN);
... ... @@ -81,7 +83,8 @@ class HomeController extends AbstractAction
'hasFavBrand' => $favBrands
);
// 判断时候为品牌页
if ($tab === 'brand') {
if ($tab === 'brand')
{
$data['brandTab'] = true;
}
... ... @@ -91,19 +94,24 @@ class HomeController extends AbstractAction
/**
* 用户收藏的商品-删除
*/
public function favoriteDelAction() {
public function favoriteDelAction()
{
$result = array();
if ($this->isAjax()) {
if ($this->isAjax())
{
$uid = $this->getUid();
$fav_id = $this->post('fav_id', 0);
$result = \Index\UserModel::favoriteDelete($uid, $fav_id);
}
if (empty($result)) {
if (empty($result))
{
echo ' ';
} else {
}
else
{
$this->echoJson($result);
}
}
... ... @@ -111,7 +119,8 @@ class HomeController extends AbstractAction
/**
* 个人信息
*/
public function personalDetailsAction() {
public function personalDetailsAction()
{
$this->setTitle('个人信息');
$this->setNavHeader('个人信息', true, SITE_MAIN);
... ... @@ -125,7 +134,8 @@ class HomeController extends AbstractAction
/**
* YOHO币
*/
public function currencyAction() {
public function currencyAction()
{
$this->setTitle('YOHO币');
$this->setNavHeader('YOHO币', true, false);
... ... @@ -140,7 +150,8 @@ class HomeController extends AbstractAction
/**
* 优惠券
*/
public function couponsAction() {
public function couponsAction()
{
$this->setTitle('优惠券');
$this->setNavHeader('优惠券', true, SITE_MAIN);
... ... @@ -157,7 +168,8 @@ class HomeController extends AbstractAction
/**
* 我的消息
*/
public function messageAction() {
public function messageAction()
{
// $uid = $this->getUid();
$page = $this->get('page', 0);
$size = $this->get('size', 10);
... ... @@ -171,7 +183,8 @@ class HomeController extends AbstractAction
/**
* 地址管理
*/
public function addressAction() {
public function addressAction()
{
// 设置网站标题
$this->setTitle('地址管理');
$this->setNavHeader('地址管理', true, SITE_MAIN);
... ... @@ -195,10 +208,12 @@ class HomeController extends AbstractAction
/**
* 修改地址或者添加新地址
*/
public function saveAddressAction() {
public function saveAddressAction()
{
$result = array();
if ($this->isAjax()) {
if ($this->isAjax())
{
// $uid = $this->getUid();
$uid = 8826435;
$address = $this->post('address', '');
... ... @@ -212,9 +227,12 @@ class HomeController extends AbstractAction
$result = \Index\UserModel::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code);
}
if (empty($result)) {
if (empty($result))
{
echo ' ';
} else {
}
else
{
$this->echoJson($result);
}
}
... ... @@ -222,10 +240,12 @@ class HomeController extends AbstractAction
/**
* 设置默认地址
*/
public function defaultAddressAction() {
public function defaultAddressAction()
{
$result = array();
if ($this->isAjax()) {
if ($this->isAjax())
{
// $uid = $this->getUid();
$uid = 8826435;
$id = $this->post('id', '');
... ... @@ -233,9 +253,12 @@ class HomeController extends AbstractAction
$result = \Index\UserModel::setDefaultAddress($uid, $id);
}
if (empty($result)) {
if (empty($result))
{
echo ' ';
} else {
}
else
{
$this->echoJson($result);
}
}
... ... @@ -243,10 +266,12 @@ class HomeController extends AbstractAction
/**
* 删除地址
*/
public function addressDelAction() {
public function addressDelAction()
{
$result = array();
if ($this->isAjax()) {
if ($this->isAjax())
{
// $uid = $this->getUid();
$uid = 8826435;
$id = $this->post('id', '');
... ... @@ -254,15 +279,19 @@ class HomeController extends AbstractAction
$result = \Index\UserModel::deleteAddress($uid, $id);
}
if (empty($result)) {
if (empty($result))
{
echo ' ';
} else {
}
else
{
$this->echoJson($result);
}
}
//在线客服
public function onlineServiceAction() {
public function onlineServiceAction()
{
// 设置网站标题
$this->setTitle('在线客服');
$this->setNavHeader('在线客服', true, SITE_MAIN);
... ... @@ -277,11 +306,13 @@ 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('在线客服');
... ... @@ -297,19 +328,27 @@ class HomeController extends AbstractAction
$page = $this->get('page', 1);
$limit = $this->get('limit', 10);
$uid = $this->getUid();
$uid=5687179;
$uid = 5687179;
$gender = Helpers::getGenderByCookie();
$yh_channel = Helpers::getChannelByCookie();
$guangInfo = \home\GuangModel::getMyGuang($uid, $page,$yh_channel,$gender, $limit);
$guangInfo = \home\GuangModel::getMyGuang($uid, $page, $yh_channel, $gender, $limit);
if ($page == 1)
{
$this->setTitle('我收藏的');
$this->setNavHeader('我收藏的', true, '');
$this->_view->display('my-guang', array( 'myGuangPage' => true,'myGuang'=>array('infos'=>$guangInfo),'pageFooter' => true));
$this->_view->display('my-guang', array('myGuangPage' => true, 'myGuang' => array('infos' => $guangInfo), 'pageFooter' => true));
}
else
{
$this->_view->display('my-guang-partial', array('infos' => $guangInfo));
}
}
/**
* 意见反馈
*/
public function suggestAction() {
public function suggestAction()
{
// 设置网站标题
$this->setTitle('意见反馈');
$this->setNavHeader('意见反馈', true, SITE_MAIN);
... ... @@ -331,7 +370,8 @@ class HomeController extends AbstractAction
/**
* 意见反馈-提交表单页面
*/
public function suggestSubAction() {
public function suggestSubAction()
{
// 设置网站标题
$this->setTitle('反馈问题');
... ... @@ -359,7 +399,8 @@ class HomeController extends AbstractAction
/**
* 异步上传图片
*/
public function suggestimgUploadAction() {
public function suggestimgUploadAction()
{
$filename = $this->post('filename', '');
$result = \Index\UserModel::saveSuggestImg($filename);
... ... @@ -369,8 +410,10 @@ class HomeController extends AbstractAction
/**
* 异步保存意见反馈数据
*/
public function savesuggestAction() {
if ($this->isAjax()) {
public function savesuggestAction()
{
if ($this->isAjax())
{
$uid = $this->getUid();
$content = $this->post('content', '');
$suggest_type = $this->get('suggest_type', 2);
... ... @@ -383,7 +426,8 @@ class HomeController extends AbstractAction
/**
* 会员等级展示页
*/
public function gradeAction() {
public function gradeAction()
{
//设置网站seo信息
$this->setTitle('会员等级');
//显示网站导航头部信息
... ... @@ -402,7 +446,8 @@ class HomeController extends AbstractAction
* 会员特权查看页
*/
public function preferentialAction() {
public function preferentialAction()
{
//设置网站seo信息
$this->setTitle('会员等级');
//显示网站导航头部信息
... ... @@ -419,15 +464,19 @@ class HomeController extends AbstractAction
* 我的订单页面,获得nav导航条焦点。并且异步请求订单详情列表页(getOrders)
*/
public function orderAction() {
public function orderAction()
{
//获得type值,type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论。
$type = $this->get('type', 1);
$this->setTitle('我的订单');
$this->setNavHeader('我的订单');
$data = OrderModel::getNavs($type);
if (!empty($data)) {
if (!empty($data))
{
$order['navs'] = $data;
} else {
}
else
{
$this->error();
}
//渲染模板
... ... @@ -439,9 +488,11 @@ class HomeController extends AbstractAction
}
//ajax请求订单页面
public function getOrdersAction() {
public function getOrdersAction()
{
//判断是不是ajax请求
if (!$this->isAjax()) {
if (!$this->isAjax())
{
$this->error();
}
//获取基本参数:type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论
... ... @@ -459,12 +510,18 @@ class HomeController extends AbstractAction
2、page=1时,就给一个随便逛逛的链接。
* */
$order = array();
if (!empty($data)) {
if (!empty($data))
{
$order['orders'] = $data;
} else {
if ($page > 1) {
}
else
{
if ($page > 1)
{
echo " ";
} elseif ($page = 1) {
}
elseif ($page = 1)
{
$order['walkwayUrl'] = self::strollAction();
}
}
... ... @@ -476,10 +533,12 @@ class HomeController extends AbstractAction
* 我的订单-取消订单
*/
public function cancelOrderAction() {
public function cancelOrderAction()
{
//判断是不是ajax请求
if (!$this->isAjax()) {
if (!$this->isAjax())
{
$this->error();
}
//传入order_code和uid以取消订单
... ... @@ -499,9 +558,11 @@ class HomeController extends AbstractAction
* 我的订单-删除订单
*/
public function delOrderAction() {
public function delOrderAction()
{
//判断是不是ajax请求
if (!$this->isAjax()) {
if (!$this->isAjax())
{
$this->error();
}
//传入order_code和uid以删除订单
... ... @@ -521,7 +582,8 @@ 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);
... ... @@ -531,7 +593,8 @@ class HomeController extends AbstractAction
* 我的订单-随便逛逛链接获取
*/
private function strollAction() {
private function strollAction()
{
//获取性别、频道数据
$gender = Helpers::getGenderByCookie();
$yh_channel = $this->get('yh_channel', 1);
... ... @@ -543,7 +606,8 @@ class HomeController extends AbstractAction
/**
* 订单详情页
*/
public function orderDetailAction() {
public function orderDetailAction()
{
$data = array(
'name' => '毛毛莉Lydia',
'phoneNum' => '18600001133',
... ...