|
@@ -84,7 +84,7 @@ export function setStoreFilter(filter) { |
|
@@ -84,7 +84,7 @@ export function setStoreFilter(filter) { |
84
|
export function setShopId(shopId) {
|
84
|
export function setShopId(shopId) {
|
85
|
return {
|
85
|
return {
|
86
|
type: SET_SHOP_ID,
|
86
|
type: SET_SHOP_ID,
|
87
|
- payload: 860,
|
87
|
+ payload: shopId,
|
88
|
};
|
88
|
};
|
89
|
}
|
89
|
}
|
90
|
|
90
|
|
|
@@ -122,7 +122,7 @@ export function getShopInfo() { |
|
@@ -122,7 +122,7 @@ export function getShopInfo() { |
122
|
|
122
|
|
123
|
let fetchShopIntroInfo = (shopId, uid) => {
|
123
|
let fetchShopIntroInfo = (shopId, uid) => {
|
124
|
dispatch(shopInfoRequest());
|
124
|
dispatch(shopInfoRequest());
|
125
|
- return new BrandStoreService().fetchShopInfo(shopId, uid)
|
125
|
+ return new BrandStoreService(app.host).fetchShopInfo(shopId, uid)
|
126
|
.then(json => {
|
126
|
.then(json => {
|
127
|
dispatch(shopInfoSuccess(json));
|
127
|
dispatch(shopInfoSuccess(json));
|
128
|
})
|
128
|
})
|
|
@@ -175,7 +175,7 @@ export function getShopResources() { |
|
@@ -175,7 +175,7 @@ export function getShopResources() { |
175
|
|
175
|
|
176
|
let fetchShopsResourcesInfo = (shopId) => {
|
176
|
let fetchShopsResourcesInfo = (shopId) => {
|
177
|
dispatch(shopResourceRequest());
|
177
|
dispatch(shopResourceRequest());
|
178
|
- return new BrandStoreService().fetchShopResources(shopId)
|
178
|
+ return new BrandStoreService(app.host).fetchShopResources(shopId)
|
179
|
.then(json => {
|
179
|
.then(json => {
|
180
|
let payload = parseShopResources(json, shopId);
|
180
|
let payload = parseShopResources(json, shopId);
|
181
|
dispatch(shopResourcesSuccess(payload));
|
181
|
dispatch(shopResourcesSuccess(payload));
|
|
@@ -230,7 +230,7 @@ export function getShopCouponList() { |
|
@@ -230,7 +230,7 @@ export function getShopCouponList() { |
230
|
|
230
|
|
231
|
let fetchShopCouponList = (shopId, uid) => {
|
231
|
let fetchShopCouponList = (shopId, uid) => {
|
232
|
dispatch(shopCouponListRequest());
|
232
|
dispatch(shopCouponListRequest());
|
233
|
- return new BrandStoreService().fetchShopCouponList(shopId, uid)
|
233
|
+ return new BrandStoreService(app.host).fetchShopCouponList(shopId, uid)
|
234
|
.then(json => {
|
234
|
.then(json => {
|
235
|
let payload = parseCouponList(json);
|
235
|
let payload = parseCouponList(json);
|
236
|
dispatch(shopCouponListSuccess(payload));
|
236
|
dispatch(shopCouponListSuccess(payload));
|
|
@@ -307,7 +307,7 @@ export function getHotProduct() { |
|
@@ -307,7 +307,7 @@ export function getHotProduct() { |
307
|
}
|
307
|
}
|
308
|
|
308
|
|
309
|
dispatch(hotProductRequest());
|
309
|
dispatch(hotProductRequest());
|
310
|
- return new BrandStoreService().searchProductBySkn(productSkn)
|
310
|
+ return new BrandStoreService(app.host).searchProductBySkn(productSkn)
|
311
|
.then(json => {
|
311
|
.then(json => {
|
312
|
_.forEach(json.product_list, (value, key) => {
|
312
|
_.forEach(json.product_list, (value, key) => {
|
313
|
json.product_list[key].is_soon_sold_out = 'N';
|
313
|
json.product_list[key].is_soon_sold_out = 'N';
|
|
@@ -391,7 +391,7 @@ export function getProductList(reload=false) { |
|
@@ -391,7 +391,7 @@ export function getProductList(reload=false) { |
391
|
let order = productList.order;
|
391
|
let order = productList.order;
|
392
|
let page = productList.currentPage + 1;
|
392
|
let page = productList.currentPage + 1;
|
393
|
let pageSize = productList.pageSize;
|
393
|
let pageSize = productList.pageSize;
|
394
|
- let channel = 1;
|
394
|
+ let channel = app.channel;
|
395
|
|
395
|
|
396
|
let bSelectedFilterFactor,allFilterFactors;
|
396
|
let bSelectedFilterFactor,allFilterFactors;
|
397
|
allFilterFactors = filterFactors.toJS();
|
397
|
allFilterFactors = filterFactors.toJS();
|
|
@@ -404,7 +404,7 @@ export function getProductList(reload=false) { |
|
@@ -404,7 +404,7 @@ export function getProductList(reload=false) { |
404
|
}
|
404
|
}
|
405
|
}
|
405
|
}
|
406
|
dispatch(productListRequest());
|
406
|
dispatch(productListRequest());
|
407
|
- return new BrandStoreService().productList(shopId, channel, order, page, pageSize, allFilterFactors)
|
407
|
+ return new BrandStoreService(app.host).productList(shopId, channel, order, page, pageSize, allFilterFactors)
|
408
|
.then(json => {
|
408
|
.then(json => {
|
409
|
let payload = parseProductList(json);
|
409
|
let payload = parseProductList(json);
|
410
|
payload.endReached = payload.currentPage == payload.pageCount;
|
410
|
payload.endReached = payload.currentPage == payload.pageCount;
|
|
@@ -601,7 +601,7 @@ export function addFavorite() { |
|
@@ -601,7 +601,7 @@ export function addFavorite() { |
601
|
|
601
|
|
602
|
ReactNative.NativeModules.YH_CommonHelper.uid()
|
602
|
ReactNative.NativeModules.YH_CommonHelper.uid()
|
603
|
.then(uid => {
|
603
|
.then(uid => {
|
604
|
- return new BrandStoreService().addFavorite(shopId, shopId, uid)
|
604
|
+ return new BrandStoreService(app.host).addFavorite(shopId, shopId, uid)
|
605
|
.then(json => {
|
605
|
.then(json => {
|
606
|
console.log('收藏成功');
|
606
|
console.log('收藏成功');
|
607
|
dispatch(addFavoriteSuccess());
|
607
|
dispatch(addFavoriteSuccess());
|
|
@@ -614,7 +614,7 @@ export function addFavorite() { |
|
@@ -614,7 +614,7 @@ export function addFavorite() { |
614
|
.catch(error => {
|
614
|
.catch(error => {
|
615
|
ReactNative.NativeModules.YH_CommonHelper.login()
|
615
|
ReactNative.NativeModules.YH_CommonHelper.login()
|
616
|
.then(uid => {
|
616
|
.then(uid => {
|
617
|
- return new BrandStoreService().addFavorite(shopId, shopId, uid)
|
617
|
+ return new BrandStoreService(app.host).addFavorite(shopId, shopId, uid)
|
618
|
.then(json => {
|
618
|
.then(json => {
|
619
|
console.log('收藏成功');
|
619
|
console.log('收藏成功');
|
620
|
dispatch(addFavoriteSuccess());
|
620
|
dispatch(addFavoriteSuccess());
|
|
@@ -636,7 +636,7 @@ export function cancelFavorite() { |
|
@@ -636,7 +636,7 @@ export function cancelFavorite() { |
636
|
|
636
|
|
637
|
ReactNative.NativeModules.YH_CommonHelper.uid()
|
637
|
ReactNative.NativeModules.YH_CommonHelper.uid()
|
638
|
.then(uid => {
|
638
|
.then(uid => {
|
639
|
- return new BrandStoreService().cancelFavorite(shopId, shopId, uid)
|
639
|
+ return new BrandStoreService(app.host).cancelFavorite(shopId, shopId, uid)
|
640
|
.then(json => {
|
640
|
.then(json => {
|
641
|
console.log('取消收藏成功');
|
641
|
console.log('取消收藏成功');
|
642
|
dispatch(cancelFavoriteSuccess());
|
642
|
dispatch(cancelFavoriteSuccess());
|
|
@@ -658,13 +658,14 @@ export function getFavoriteState() { |
|
@@ -658,13 +658,14 @@ export function getFavoriteState() { |
658
|
|
658
|
|
659
|
ReactNative.NativeModules.YH_CommonHelper.uid()
|
659
|
ReactNative.NativeModules.YH_CommonHelper.uid()
|
660
|
.then(uid => {
|
660
|
.then(uid => {
|
661
|
- return new BrandStoreService().isFavorite(shopId, uid)
|
661
|
+ return new BrandStoreService(app.host).isFavorite(shopId, uid)
|
662
|
.then(json => {
|
662
|
.then(json => {
|
663
|
if (json) {
|
663
|
if (json) {
|
664
|
dispatch(addFavoriteSuccess());
|
664
|
dispatch(addFavoriteSuccess());
|
665
|
}
|
665
|
}
|
666
|
})
|
666
|
})
|
667
|
.catch(error => {
|
667
|
.catch(error => {
|
|
|
668
|
+
|
668
|
});
|
669
|
});
|
669
|
})
|
670
|
})
|
670
|
.catch(error => {
|
671
|
.catch(error => {
|