|
|
'use strict';
|
|
|
|
|
|
import {Platform} from 'react-native';
|
|
|
|
|
|
import Request from '../../common/services/NativeRequest';
|
|
|
|
|
|
export default class BrandService {
|
...
|
...
|
@@ -13,21 +15,43 @@ export default class BrandService { |
|
|
}
|
|
|
|
|
|
async getBrandList(yh_channel, fromPage='iFP_Brand'){
|
|
|
return await this.api.get({
|
|
|
url: '',
|
|
|
body: {
|
|
|
method: 'app.brand.newBrandList',
|
|
|
yh_channel,
|
|
|
app_type: 1,
|
|
|
fromPage,
|
|
|
}
|
|
|
})
|
|
|
.then((json) => {
|
|
|
return json;
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
throw(error);
|
|
|
});
|
|
|
|
|
|
//增加兼容性判断,android会在gender不为空时自动添加全局gender参数
|
|
|
if(Platform.OS === 'android'){
|
|
|
return await this.api.get({
|
|
|
url: '',
|
|
|
body: {
|
|
|
method: 'app.brand.newBrandList',
|
|
|
yh_channel,
|
|
|
gender: '',
|
|
|
app_type: 1,
|
|
|
fromPage,
|
|
|
}
|
|
|
})
|
|
|
.then((json) => {
|
|
|
return json;
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
throw(error);
|
|
|
});
|
|
|
}
|
|
|
else{
|
|
|
return await this.api.get({
|
|
|
url: '',
|
|
|
body: {
|
|
|
method: 'app.brand.newBrandList',
|
|
|
yh_channel,
|
|
|
app_type: 1,
|
|
|
fromPage,
|
|
|
}
|
|
|
})
|
|
|
.then((json) => {
|
|
|
return json;
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
throw(error);
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
async getBrandResourceB(channel_id, content_code, fromPage='iFP_Brand'){
|
...
|
...
|
|