Authored by Rock Zhang

Merge branch 'develop/wap' into beta/wap

Conflicts:
	library/Api/Yohobuy.php
... ... @@ -24,17 +24,17 @@ class Yohobuy
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
//java API
/**const API_URL = 'http://apih5.yoho.cn/';
const API_URL = 'http://apih5.yoho.cn/';
const API_URL2 = 'http://apih5.yoho.cn/';
const SERVICE_URL = 'http://serviceh5.yoho.cn/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
const API_OLD = 'http://api2.open.yohobuy.com/';**/
const API_OLD = 'http://api2.open.yohobuy.com/';
/* 测试环境 */
const API_URL = 'http://testapi.yoho.cn:28078/'; // 'http://192.168.102.205:8080/gateway/'
const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
const API_OLD = 'http://test2.open.yohobuy.com/';
// const API_URL = 'http://testapi.yoho.cn:28078/'; // 'http://192.168.102.205:8080/gateway/'
// const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// const API_OLD = 'http://test2.open.yohobuy.com/';
/* 预览环境 */
// const API_URL = 'http://preapi.yoho.cn/';
... ...
... ... @@ -95,7 +95,7 @@ function loadData($parent, url, page) {
//处理data等于end时如果loadingMask存在且没有hide样式的情况
if ($loadingMask && !$loadingMask.hasClass('hide')) {
$loadingMask.addClass('hide');
$parent.closest('.fav-type').find('.fav-null-box').removeClass('hide');
//$parent.closest('.fav-type').find('.fav-null-box').removeClass('hide');
}
$parent.closest('.fav-type').find('.fav-load-background')
... ...
... ... @@ -188,7 +188,19 @@ class UserModel
$favProduct = UserData::favoriteProductData($uid, $page, $limit);
// 处理用户收藏的商品数据
if (isset($favProduct['data']) && $page <= $favProduct['data']['page_total']) {
do {
// 开始就没获取到数据或者获取的数据为空时的处理
if (!isset($favProduct['data']['product_list']) && $page == 1) {
break;
}
// 加载第二页以及第二页之后的数据时接口不返回时的处理
if ($page > 1 && !$favProduct) {
$result['end'] = true;
break;
}
if ($page <= $favProduct['data']['page_total']) {
$datas = array();
$product = array();
foreach ($favProduct['data']['product_list'] as $val) {
... ... @@ -209,11 +221,16 @@ class UserModel
$datas[] = $product;
}
!empty($datas) && $result['hasFavProduct'] = $datas;
} else if (($page > 1 && !$favProduct) || $page > $favProduct['data']['page_total']) {
if (!empty($datas)) {
$result['hasFavProduct'] = $datas;
}
} else {
$result['end'] = true;
}
} while (false);
return $result;
}
... ... @@ -234,7 +251,19 @@ class UserModel
$favBrand = UserData::favoriteBrandData($uid, $gender, $page, $limit);
// 处理用户收藏的品牌数据
if (isset($favBrand['data']) && $page <= $favBrand['data']['page_total']) {
do {
// 开始就没获取到数据或者获取的数据为空时的处理
if (!isset($favBrand['data']['brand_list']) && $page == 1) {
break;
}
// 加载第二页以及第二页之后的数据时接口不返回时的处理
if ($page > 1 && !$favBrand) {
$result['end'] = true;
break;
}
if ($page <= $favBrand['data']['page_total']) {
$datas = array();
$brand = array();
foreach ($favBrand['data']['brand_list'] as $val) {
... ... @@ -264,10 +293,14 @@ class UserModel
$datas[] = $brand;
}
!empty($datas) && $result['hasFavBrand'] = $datas;
} else if (($page > 1 && !$favBrand) || $page > $favBrand['data']['page_total']) {
if (!empty($datas)) {
$result['hasFavBrand'] = $datas;
}
} else {
$result['end'] = true;
}
} while (false);
return $result;
}
... ...