Authored by 盖剑秋

Change base url from service.yohops.cn to api.yoho.cn and add an extra data requ…

…est for coupon. reiviewed by Boss Lin.
Showing 36 changed files with 76 additions and 34 deletions
... ... @@ -6,7 +6,7 @@ let InitialState = Record({
platform: 'ios', // ios, android
channel: 1, // 1 - boy, 2 - girl, 3 - kid, 4 - lifestyle, 5 - yoho
host: 'http://api.yoho.cn',
serviceHost: 'http://service.yoho.cn',
serviceHost: 'http://api.yoho.cn',
});
export default InitialState;
... ...
... ... @@ -6,7 +6,7 @@ let InitialState = Record({
platform: 'ios', // ios, android
channel: 1, // 1 - boy, 2 - girl, 3 - kid, 4 - lifestyle, 5 - yoho
host: 'http://api.yoho.cn',
serviceHost: 'http://service.yoho.cn',
serviceHost: 'http://api.yoho.cn',
abversion: 'A', //A,B
});
... ...
... ... @@ -79,6 +79,7 @@ export function couponCenter(reload = false) {
dispatch(couponCenterSuccess(payload.floors));
dispatch(dataExposure(payload.logFloors));
couponExtraData(payload.floors ,contentCode, uid);
})
.catch(error => {
dispatch(couponCenterFailure(error));
... ... @@ -95,6 +96,29 @@ export function couponCenter(reload = false) {
};
}
function couponExtraData(originFloors, contentCode, uid) {
return (dispatch) => {
return new CouponService().fetchExtraData(contentCode, uid)
.then(json => {
originFloors.map((item, i) => {
if (item.templateName == 'getCoupon' && item.data) {
json.map((extraItem, k) => {
if (item.data.couponId == extraItem.couponId) {
item.data.status = extraItem.status?extraItem.status:'';
item.data.hasNum = extraItem.hasNum?extraItem.hasNum:0;
}
})
}
})
dispatch(couponCenterSuccess(originFloors));
})
.catch(error => {
console.log(error);
});
}
}
function parseFloors(json) {
let carousel_banner = (data) => {
let images = [];
... ...
... ... @@ -12,6 +12,24 @@ export default class CouponService {
this.api = new Request(baseURL);
}
async fetchExtraData(contentCode, uid) {
return await this.api.get({
url: '',
body: {
method: 'app.promotion.couponStatus',
contentCode,
uid,
'debug':'XYZ',
}
})
.then((json) => {
return json;
})
.catch((error) => {
throw(error);
});
}
async fetchFloors(contentCode, uid) {
return await this.api.get({
url: '',
... ...
... ... @@ -6,7 +6,7 @@ let InitialState = Record({
platform: 'ios', // ios, android
channel: 1, // 1 - boy, 2 - girl, 3 - kid, 4 - lifestyle, 5 - yoho
host: 'http://api.yoho.cn',
serviceHost: 'http://service.yoho.cn',
serviceHost: 'http://api.yoho.cn',
});
export default InitialState;
... ...
... ... @@ -6,7 +6,7 @@ let InitialState = Record({
platform: 'ios', // ios, android
channel: 1, // 1 - boy, 2 - girl, 3 - kid, 4 - lifestyle, 5 - yoho
host: 'http://api.yoho.cn',
serviceHost: 'http://service.yoho.cn',
serviceHost: 'http://api.yoho.cn',
singleHost: 'http://single.yoho.cn/favorite',
});
... ...
... ... @@ -5,7 +5,7 @@ import Request from '../../common/services/NativeRequest';
export default class DetailService {
constructor (host) {
let baseURL = 'http://service.yoho.cn';
let baseURL = 'http://api.yoho.cn';
if(host){
baseURL = host;
}
... ...
... ... @@ -5,7 +5,7 @@ import Request from '../../common/services/NativeRequest';
export default class ListService {
constructor(host) {
let baseURL = 'http://service.yoho.cn';
let baseURL = 'http://api.yoho.cn';
if (host) {
baseURL = host;
}
... ...
... ... @@ -6,7 +6,7 @@ let InitialState = Record({
platform: 'ios', // ios, android
channel: 1, // 1 - boy, 2 - girl, 3 - kid, 4 - lifestyle, 5 - yoho
host: 'http://api.yoho.cn',
serviceHost: 'http://service.yoho.cn',
serviceHost: 'http://api.yoho.cn',
});
export default InitialState;
... ...
... ... @@ -5,7 +5,7 @@ import Request from '../../common/services/NativeRequest';
export default class DetailService {
constructor (host) {
let baseURL = 'http://service.yoho.cn';
let baseURL = 'http://api.yoho.cn';
if(host){
baseURL = host;
}
... ...
... ... @@ -6,7 +6,7 @@ let InitialState = Record({
platform: 'ios', // ios, android
channel: 1, // 1 - boy, 2 - girl, 3 - kid, 4 - lifestyle, 5 - yoho
host: 'http://api.yoho.cn',
serviceHost: 'http://service.yoho.cn',
serviceHost: 'http://api.yoho.cn',
});
export default InitialState;
... ...
... ... @@ -6,7 +6,7 @@ let InitialState = Record({
platform: 'ios', // ios, android
channel: 1, // 1 - boy, 2 - girl, 3 - kid, 4 - lifestyle, 5 - yoho
host: 'http://api.yoho.cn',
serviceHost: 'http://service.yoho.cn',
serviceHost: 'http://api.yoho.cn',
});
export default InitialState;
... ...
... ... @@ -6,7 +6,7 @@ let InitialState = Record({
platform: 'ios', // ios, android
channel: 1, // 1 - boy, 2 - girl, 3 - kid, 4 - lifestyle, 5 - yoho
host: 'http://api.yoho.cn',
serviceHost: 'http://service.yoho.cn',
serviceHost: 'http://api.yoho.cn',
});
export default InitialState;
... ...
... ... @@ -6,7 +6,7 @@ let InitialState = Record({
platform: 'ios', // ios, android
channel: 1, // 1 - boy, 2 - girl, 3 - kid, 4 - lifestyle, 5 - yoho
host: 'http://api.yoho.cn',
serviceHost: 'http://service.yoho.cn',
serviceHost: 'http://api.yoho.cn',
billHost: 'http://bill.m.yohobuy.com',
globalApiHost: 'http://api-global.yohobuy.com',
singleHost: 'http://single.yoho.cn',
... ...
... ... @@ -6,7 +6,7 @@ let InitialState = Record({
platform: 'ios', // ios, android
channel: 1, // 1 - boy, 2 - girl, 3 - kid, 4 - lifestyle, 5 - yoho
host: 'http://api.yoho.cn',
serviceHost: 'http://service.yoho.cn',
serviceHost: 'http://api.yoho.cn',
abversion: 'A', //A,B
});
... ...
... ... @@ -5,7 +5,7 @@ import {Record, List, Map} from 'immutable';
let InitialState = Record({
platform: 'ios', // ios, android
host: 'http://api.yoho.cn',
serviceHost: 'http://service.yoho.cn',
serviceHost: 'http://api.yoho.cn',
channel: 1, // 1 - boy, 2 - girl, 3 - kid, 4 - lifestyle, 5 - yoho
});
... ...
... ... @@ -5,7 +5,7 @@ import Request from '../../common/services/NativeRequest';
export default class AddCouponService {
constructor (host) {
let baseURL = 'http://service.yoho.cn';
let baseURL = 'http://api.yoho.cn';
if(host){
baseURL = host;
}
... ...
... ... @@ -5,7 +5,7 @@ import Request from '../../common/services/NativeRequest';
export default class CouponService {
constructor (host) {
let baseURL = 'http://service.yoho.cn';
let baseURL = 'http://api.yoho.cn';
if(host){
baseURL = host;
}
... ...
... ... @@ -5,7 +5,7 @@ import Request from '../../common/services/NativeRequest';
export default class PurchaseCodeService {
constructor (host) {
let baseURL = 'http://service.yoho.cn';
let baseURL = 'http://api.yoho.cn';
if(host){
baseURL = host;
}
... ...
... ... @@ -9,7 +9,7 @@ import {
export default class YohoCoinService {
constructor (host) {
let baseURL = 'http://service.yoho.cn';
let baseURL = 'http://api.yoho.cn';
if(host){
baseURL = host;
}
... ...
... ... @@ -6,7 +6,7 @@ let InitialState = Record({
platform: 'ios', // ios, android
channel: 1, // 1 - boy, 2 - girl, 3 - kid, 4 - lifestyle, 5 - yoho
host: 'http://api.yoho.cn',
serviceHost: 'http://service.yoho.cn',
serviceHost: 'http://api.yoho.cn',
});
export default InitialState;
... ...
... ... @@ -6,7 +6,7 @@ let InitialState = Record({
platform: 'ios', // ios, android
channel: 1, // 1 - boy, 2 - girl, 3 - kid, 4 - lifestyle, 5 - yoho
host: 'http://api.yoho.cn',
serviceHost: 'http://service.yoho.cn',
serviceHost: 'http://api.yoho.cn',
singleHost: 'http://single.yoho.cn/favorite',
yohoodTicketSkn:'51335912',
yohoodTicketsSkn: '51335908',
... ...
... ... @@ -5,7 +5,7 @@ import Request from '../../common/services/NativeRequest';
export default class DetailService {
constructor(host) {
let baseURL = 'http://service.yoho.cn';
let baseURL = 'http://api.yoho.cn';
if (host) {
baseURL = host;
}
... ...
... ... @@ -5,7 +5,7 @@ import Request from '../../common/services/NativeRequest';
export default class ListService {
constructor (host) {
let baseURL = 'http://service.yoho.cn';
let baseURL = 'http://api.yoho.cn';
if(host){
baseURL = host;
}
... ...
... ... @@ -6,7 +6,7 @@ let InitialState = Record({
platform: 'ios', // ios, android
channel: 1, // 1 - boy, 2 - girl, 3 - kid, 4 - lifestyle, 5 - yoho
host: 'http://api.yoho.cn',
serviceHost: 'http://service.yoho.cn',
serviceHost: 'http://api.yoho.cn',
categoryId: '',
});
... ...
... ... @@ -6,7 +6,7 @@ let InitialState = Record({
platform: 'ios', // ios, android
channel: 1, // 1 - boy, 2 - girl, 3 - kid, 4 - lifestyle, 5 - yoho
host: 'http://api.yoho.cn',
serviceHost: 'http://service.yoho.cn',
serviceHost: 'http://api.yoho.cn',
abversion: 'A', //A,B
});
... ...
... ... @@ -6,7 +6,7 @@ let InitialState = Record({
platform: 'ios', // ios, android
channel: 1, // 1 - boy, 2 - girl, 3 - kid, 4 - lifestyle, 5 - yoho
host: 'http://api.yoho.cn',
servicehost: 'http://service.yoho.cn',
servicehost: 'http://api.yoho.cn',
});
export default InitialState;
... ...
... ... @@ -6,7 +6,7 @@ export default class DetailService {
constructor(host) {
let baseURL = 'http://service.yoho.cn';
let baseURL = 'http://api.yoho.cn';
if(host){
baseURL = host;
}
... ...
... ... @@ -5,7 +5,7 @@ import Request from '../../common/services/NativeRequest';
export default class PlustarService {
constructor () {
let baseURL = 'http://service.yoho.cn';
let baseURL = 'http://api.yoho.cn';
this.api = new Request(baseURL);
}
... ...
... ... @@ -6,7 +6,7 @@ let InitialState = Record({
platform: 'ios', // ios, android
channel: 1, // 1 - boy, 2 - girl, 3 - kid, 4 - lifestyle, 5 - yoho
host: 'http://api.yoho.cn',
serviceHost: 'http://service.yoho.cn',
serviceHost: 'http://api.yoho.cn',
type: '',
shop_id: 0,
brand_id: 0,
... ...
... ... @@ -5,7 +5,7 @@ import Request from '../../common/services/NativeRequest';
export default class QRCodeService {
constructor () {
let baseURL = 'http://service.yoho.cn';
let baseURL = 'http://api.yoho.cn';
this.api = new Request(baseURL);
}
... ...
... ... @@ -6,7 +6,7 @@ let InitialState = Record({
platform: 'ios', // ios, android
channel: 1, // 1 - boy, 2 - girl, 3 - kid, 4 - lifestyle, 5 - yoho
host: 'http://api.yoho.cn',
serviceHost: 'http://service.yoho.cn',
serviceHost: 'http://api.yoho.cn',
abversion: 'A', //A,B
globalHost: 'http://api-global.yohobuy.com'
});
... ...
... ... @@ -6,7 +6,7 @@ let InitialState = Record({
platform: 'ios', // ios, android
channel: 1, // 1 - boy, 2 - girl, 3 - kid, 4 - lifestyle, 5 - yoho
host: 'http://api.yoho.cn',
serviceHost: 'http://service.yoho.cn',
serviceHost: 'http://api.yoho.cn',
});
export default InitialState;
... ...
... ... @@ -5,7 +5,7 @@ import {Record, List, Map} from 'immutable';
let InitialState = Record({
platform: 'ios', // ios, android
host: 'http://api.yoho.cn',
serviceHost: 'http://service.yoho.cn',
serviceHost: 'http://api.yoho.cn',
privilegeId: 0,
userLevel: "0",
channel: "1",
... ...
... ... @@ -6,7 +6,7 @@ let InitialState = Record({
platform: 'ios', // ios, android
channel: 1, // 1 - boy, 2 - girl, 3 - kid, 4 - lifestyle, 5 - yoho
host: 'http://api.yoho.cn',
servicehost: 'http://service.yoho.cn',
servicehost: 'http://api.yoho.cn',
});
export default InitialState;
... ...
... ... @@ -5,7 +5,7 @@ import {Record, List, Map} from 'immutable';
let InitialState = Record({
platform: 'ios', // ios, android
host: 'http://api.yoho.cn',
serviceHost: 'http://service.yoho.cn',
serviceHost: 'http://api.yoho.cn',
privilegeId: 0,
userLevel: "0",
channel: "1",
... ...