...
|
...
|
@@ -68,13 +68,14 @@ class HomeController extends AbstractAction |
|
|
$this->setTitle('我的收藏');
|
|
|
$this->setNavHeader('我的收藏', true, SITE_MAIN);
|
|
|
|
|
|
$tab = $this->get('tab', '');
|
|
|
$tab = $this->get('tab', '');
|
|
|
$uid = $this->getUid();
|
|
|
$uid = 8826435;
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
|
|
|
$favProducts = \Index\UserModel::getFavProductData($uid);
|
|
|
$favBrands = \Index\UserModel::getFavBrandData($uid, $gender);
|
|
|
|
|
|
$data = array(
|
|
|
'favPage' => true, //加载js
|
|
|
'pageFooter' => true,
|
...
|
...
|
@@ -82,7 +83,7 @@ class HomeController extends AbstractAction |
|
|
'hasFavProduct' => $favProducts,
|
|
|
'hasFavBrand' => $favBrands
|
|
|
);
|
|
|
// 判断时候为品牌页
|
|
|
// 判断是否为品牌收藏页
|
|
|
if ($tab === 'brand') {
|
|
|
$data['brandTab'] = true;
|
|
|
}
|
...
|
...
|
@@ -97,16 +98,20 @@ class HomeController extends AbstractAction |
|
|
{
|
|
|
$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);
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -207,7 +212,8 @@ class HomeController extends AbstractAction |
|
|
{
|
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
|
|
if ($this->isAjax())
|
|
|
{
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 8826435;
|
|
|
$address = $this->post('address', '');
|
...
|
...
|
@@ -221,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);
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -235,7 +244,8 @@ class HomeController extends AbstractAction |
|
|
{
|
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
|
|
if ($this->isAjax())
|
|
|
{
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 8826435;
|
|
|
$id = $this->post('id', '');
|
...
|
...
|
@@ -243,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);
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -257,7 +270,8 @@ class HomeController extends AbstractAction |
|
|
{
|
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
|
|
if ($this->isAjax())
|
|
|
{
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 8826435;
|
|
|
$id = $this->post('id', '');
|
...
|
...
|
@@ -265,9 +279,12 @@ class HomeController extends AbstractAction |
|
|
$result = \Index\UserModel::deleteAddress($uid, $id);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
|
|
if (empty($result))
|
|
|
{
|
|
|
echo ' ';
|
|
|
} else {
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -294,7 +311,8 @@ class HomeController extends AbstractAction |
|
|
$service = array();
|
|
|
$cateId = $this->get('cateId', 0);
|
|
|
$cateName = $this->get('cateName', '');
|
|
|
if ($cateId > 0) {
|
|
|
if ($cateId > 0)
|
|
|
{
|
|
|
$service = home\OnlineModel::getOnlineServiceDetail($cateId);
|
|
|
}
|
|
|
$this->setTitle('在线客服');
|
...
|
...
|
@@ -310,12 +328,26 @@ class HomeController extends AbstractAction |
|
|
$page = $this->get('page', 1);
|
|
|
$limit = $this->get('limit', 10);
|
|
|
$uid = $this->getUid();
|
|
|
$uid=5687179;
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
$yh_channel = Helpers::getChannelByCookie();
|
|
|
$guangInfo = \home\GuangModel::getMyGuang($uid, $page,$yh_channel,$gender, $limit);
|
|
|
$this->setTitle('我收藏的');
|
|
|
$this->setNavHeader('我收藏的', true, '');
|
|
|
$this->_view->display('my-guang', array( 'myGuangPage' => true,'myGuang'=>$guangInfo,'pageFooter' => true));
|
|
|
$guangInfo = \home\GuangModel::getMyGuang($uid, $page, $yh_channel, $gender, $limit);
|
|
|
$totalPage = $guangInfo['totalPage'];
|
|
|
unset($guangInfo['totalPage']);
|
|
|
if ($page == 1)
|
|
|
{
|
|
|
$this->setTitle('我收藏的');
|
|
|
$this->setNavHeader('我收藏的', true, '');
|
|
|
$this->_view->display('my-guang', array('myGuangPage' => true, 'myGuang' => array('infos' => $guangInfo), 'pageFooter' => true));
|
|
|
}
|
|
|
else if ($page > 1 && $page<=$totalPage)
|
|
|
{
|
|
|
$this->_view->display('my-guang-partial', array('infos' => $guangInfo));
|
|
|
}
|
|
|
else if ($page > 1 && $page>$totalPage)
|
|
|
{
|
|
|
echo ' ';//退出循环
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -350,10 +382,6 @@ class HomeController extends AbstractAction |
|
|
// 设置网站标题
|
|
|
$this->setTitle('反馈问题');
|
|
|
|
|
|
$param = \Api\Yohobuy::param();
|
|
|
unset($param['private_key']);
|
|
|
$param['project'] = 'suggest';
|
|
|
$param['client_secret'] = 'e7807a9522ab99af8b8fd926e1ebbd9a';
|
|
|
$data = array(
|
|
|
'suggestPage' => true, //加载js
|
|
|
'pageHeader' => array(
|
...
|
...
|
@@ -361,11 +389,9 @@ class HomeController extends AbstractAction |
|
|
'navTitle' => '反馈问题',
|
|
|
'navBtn' => '提交'
|
|
|
),
|
|
|
'param' => $param,
|
|
|
'suggestSub' => true,
|
|
|
'pageFooter' => true
|
|
|
);
|
|
|
//print_r($data);
|
|
|
|
|
|
$this->_view->display('suggest_sub', $data);
|
|
|
}
|
...
|
...
|
@@ -375,8 +401,8 @@ class HomeController extends AbstractAction |
|
|
*/
|
|
|
public function suggestimgUploadAction()
|
|
|
{
|
|
|
$filename = $this->post('filename', '');
|
|
|
$result = \Index\UserModel::saveSuggestImg($filename);
|
|
|
//$filename = $this->post('filename', '');
|
|
|
$result = \Index\UserModel::saveSuggestImg('fileData');
|
|
|
|
|
|
$this->echoJson($result);
|
|
|
}
|
...
|
...
|
@@ -386,10 +412,11 @@ class HomeController extends AbstractAction |
|
|
*/
|
|
|
public function savesuggestAction()
|
|
|
{
|
|
|
if ($this->isAjax()) {
|
|
|
if ($this->isAjax())
|
|
|
{
|
|
|
$uid = $this->getUid();
|
|
|
$content = $this->post('content', '');
|
|
|
$suggest_type = $this->get('suggest_type', 2);
|
|
|
$suggest_type = $this->post('suggest_type', 2);
|
|
|
$result = \Index\UserModel::saveSuggestData($uid, $content, $suggest_type);
|
|
|
|
|
|
$this->echoJson($result);
|
...
|
...
|
@@ -434,22 +461,25 @@ class HomeController extends AbstractAction |
|
|
}
|
|
|
|
|
|
/*
|
|
|
* 我的订单页面
|
|
|
* 我的订单页面,获得nav导航条焦点。并且异步请求订单详情列表页(getOrders)
|
|
|
*/
|
|
|
|
|
|
public function orderAction()
|
|
|
{
|
|
|
//获得type值
|
|
|
//获得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();
|
|
|
}
|
|
|
|
|
|
//渲染模板
|
|
|
$this->_view->display('order', array(
|
|
|
'order' => $order,
|
|
|
'pageFooter' => true,
|
...
|
...
|
@@ -461,7 +491,8 @@ class HomeController extends AbstractAction |
|
|
public function getOrdersAction()
|
|
|
{
|
|
|
//判断是不是ajax请求
|
|
|
if (!$this->isAjax()) {
|
|
|
if (!$this->isAjax())
|
|
|
{
|
|
|
$this->error();
|
|
|
}
|
|
|
//获取基本参数:type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论
|
...
|
...
|
@@ -474,15 +505,24 @@ 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)) {
|
|
|
if (!empty($data))
|
|
|
{
|
|
|
$order['orders'] = $data;
|
|
|
} else {
|
|
|
if ($page > 1) {
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
if ($page > 1)
|
|
|
{
|
|
|
echo " ";
|
|
|
} else {
|
|
|
$order['walkwayUrl'] = 'http://www.baidu.com';
|
|
|
}
|
|
|
elseif ($page = 1)
|
|
|
{
|
|
|
$order['walkwayUrl'] = self::strollAction();
|
|
|
}
|
|
|
}
|
|
|
//渲染模板
|
...
|
...
|
@@ -497,17 +537,20 @@ class HomeController extends AbstractAction |
|
|
{
|
|
|
|
|
|
//判断是不是ajax请求
|
|
|
if (!$this->isAjax()) {
|
|
|
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);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -518,7 +561,8 @@ class HomeController extends AbstractAction |
|
|
public function delOrderAction()
|
|
|
{
|
|
|
//判断是不是ajax请求
|
|
|
if (!$this->isAjax()) {
|
|
|
if (!$this->isAjax())
|
|
|
{
|
|
|
$this->error();
|
|
|
}
|
|
|
//传入order_code和uid以删除订单
|
...
|
...
|
@@ -528,10 +572,37 @@ 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;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 订单详情页
|
|
|
*/
|
...
|
...
|
|