...
|
...
|
@@ -167,13 +167,14 @@ class HomeController extends AbstractAction |
|
|
$this->setNavHeader('优惠券', true, SITE_MAIN);
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 8826435;
|
|
|
$status = $this->get('status', 0);
|
|
|
$coupons = array(
|
|
|
'couponsUrl' => \Index\UserModel::getCouponData($uid, $status),
|
|
|
'couponsUrl' => array(
|
|
|
\Index\UserModel::getCouponData($uid, 0),
|
|
|
\Index\UserModel::getCouponData($uid, 1),
|
|
|
),
|
|
|
'couponsPage' => true
|
|
|
);
|
|
|
|
|
|
print_r($coupons);
|
|
|
$this->_view->display('coupons', $coupons);
|
|
|
|
|
|
}
|
...
|
...
|
@@ -207,37 +208,68 @@ class HomeController extends AbstractAction |
|
|
$uid = 967016;
|
|
|
|
|
|
$address = \Index\UserModel::getAddressData($uid);
|
|
|
$addressList = \Index\UserModel::getAddressListData($uid);
|
|
|
|
|
|
// print_r($address);
|
|
|
|
|
|
$this->_view->display('address', array(
|
|
|
'addressPage' => true,
|
|
|
'pageFooter' => true,
|
|
|
'address' => $address
|
|
|
'address' => $address,
|
|
|
'addressList' => $addressList
|
|
|
));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 修改地址
|
|
|
* 修改地址或者添加新地址
|
|
|
*/
|
|
|
public function editAddressAction()
|
|
|
public function saveAddressAction()
|
|
|
{
|
|
|
// 设置网站标题
|
|
|
$this->setTitle('修改地址');
|
|
|
$this->setNavHeader('修改地址', true, SITE_MAIN);
|
|
|
$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);
|
|
|
}
|
|
|
|
|
|
$address = \Index\UserModel::getAddressData($uid);
|
|
|
if (empty($result)) {
|
|
|
echo ' ';
|
|
|
} else {
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
|
|
|
// print_r($address);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 设置默认地址
|
|
|
*/
|
|
|
public function defaultAddressAction()
|
|
|
{
|
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 967016;
|
|
|
$id = $this->post('id', '');
|
|
|
|
|
|
$result = \Index\UserModel::setDefaultAddress($uid, $id);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
|
|
echo ' ';
|
|
|
} else {
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
|
|
|
$this->_view->display('edit_address', array(
|
|
|
'editAddressPage' => true,
|
|
|
'pageFooter' => true,
|
|
|
'address' => $address
|
|
|
));
|
|
|
}
|
|
|
|
|
|
//在线客服
|
...
|
...
|
@@ -261,10 +293,13 @@ class HomeController extends AbstractAction |
|
|
{
|
|
|
$service = array();
|
|
|
$cateId = $this->get('cateId', 0);
|
|
|
$cateName = $this->get('cateName', '');
|
|
|
if ($cateId > 0)
|
|
|
{
|
|
|
$service = home\OnlineModel::getOnlineServiceDetail($cateId);
|
|
|
}
|
|
|
$this->setTitle('在线客服');
|
|
|
$this->setNavHeader($cateName, true, '');
|
|
|
$this->_view->display('online_service_detail', $service);
|
|
|
}
|
|
|
|
...
|
...
|
|