Authored by Rock Zhang

添加异步获取三级地址列表的路由

@@ -28,6 +28,5 @@ @@ -28,6 +28,5 @@
28 确认 28 确认
29 </div> 29 </div>
30 </div> 30 </div>
31 - {{> me/address/address-list}}  
32 </div> 31 </div>
33 {{> layout/footer}} 32 {{> layout/footer}}
@@ -306,6 +306,23 @@ class HomeController extends AbstractAction @@ -306,6 +306,23 @@ class HomeController extends AbstractAction
306 }*/ 306 }*/
307 307
308 /** 308 /**
  309 + * 异步获取三级地址数据
  310 + */
  311 + public function locationListAction() {
  312 + $result = array();
  313 +
  314 + if ($this->isAjax()) {
  315 + $result['addressList'] = UserModel::getAddressListData($this->_uid);
  316 + }
  317 +
  318 + if (empty($result)) {
  319 + echo ' ';
  320 + } else {
  321 + $this->_view->display('location-list', $result);
  322 + }
  323 + }
  324 +
  325 + /**
309 * 地址管理 326 * 地址管理
310 */ 327 */
311 public function addressAction() { 328 public function addressAction() {
@@ -314,14 +331,12 @@ class HomeController extends AbstractAction @@ -314,14 +331,12 @@ class HomeController extends AbstractAction
314 $this->setNavHeader('地址管理'); 331 $this->setNavHeader('地址管理');
315 332
316 $address = UserModel::getAddressData($this->_uid); 333 $address = UserModel::getAddressData($this->_uid);
317 - $addressList = UserModel::getAddressListData($this->_uid);  
318 334
319 $this->_view->display('address', array( 335 $this->_view->display('address', array(
320 'addressPage' => true, 336 'addressPage' => true,
321 'pageFooter' => true, 337 'pageFooter' => true,
322 'address' => $address, 338 'address' => $address,
323 - 'showAddBtn' => (count($address) <= 5),  
324 - 'addressList' => $addressList 339 + 'showAddBtn' => (count($address) <= 5)
325 )); 340 ));
326 } 341 }
327 342