...
|
...
|
@@ -23,8 +23,8 @@ const { |
|
|
|
|
|
export function setSelectedCategoryType(index) {
|
|
|
return {
|
|
|
type: SET_SELECTED_CATEGORY,
|
|
|
payload: index
|
|
|
type: SET_SELECTED_CATEGORY,
|
|
|
payload: index
|
|
|
};
|
|
|
}
|
|
|
|
...
|
...
|
@@ -38,9 +38,9 @@ export function setSelectedCategory(index) { |
|
|
let myList = myproductList.list ? myproductList.list.toArray() : [];
|
|
|
|
|
|
if (index == 0 && list.length == 0) {
|
|
|
dispatch(getHaggleProductList());
|
|
|
}else if (index == 1 && myList.length == 0){
|
|
|
dispatch(getMyHaggleProductList());
|
|
|
dispatch(getHaggleProductList());
|
|
|
} else if (index == 1 && myList.length == 0) {
|
|
|
dispatch(getMyHaggleProductList());
|
|
|
}
|
|
|
};
|
|
|
}
|
...
|
...
|
@@ -54,9 +54,9 @@ export function refreshProductList(index) { |
|
|
});
|
|
|
|
|
|
if (index == 0) {
|
|
|
dispatch(getHaggleProductList());
|
|
|
}else if (index == 1){
|
|
|
dispatch(getMyHaggleProductList());
|
|
|
dispatch(getHaggleProductList());
|
|
|
} else if (index == 1) {
|
|
|
dispatch(getMyHaggleProductList());
|
|
|
}
|
|
|
|
|
|
};
|
...
|
...
|
@@ -114,6 +114,7 @@ export function myHaggleProductListFailure(error) { |
|
|
payload: error
|
|
|
};
|
|
|
}
|
|
|
|
|
|
export function getResourceRequest() {
|
|
|
return {
|
|
|
type: RESOURCE_INFO_REQUEST,
|
...
|
...
|
@@ -210,25 +211,25 @@ export function getMyHaggleProductList() { |
|
|
};
|
|
|
|
|
|
ReactNative.NativeModules.YH_CommonHelper.uid()
|
|
|
.then(uid => {
|
|
|
fetchMyHaggleProductList(uid);
|
|
|
})
|
|
|
.catch(error => {
|
|
|
ReactNative.NativeModules.YH_CommonHelper.login()
|
|
|
.then(uid => {
|
|
|
.then(uid => {
|
|
|
fetchMyHaggleProductList(uid);
|
|
|
})
|
|
|
.catch(error => {
|
|
|
})
|
|
|
.catch(error => {
|
|
|
ReactNative.NativeModules.YH_CommonHelper.login()
|
|
|
.then(uid => {
|
|
|
fetchMyHaggleProductList(uid);
|
|
|
})
|
|
|
.catch(error => {
|
|
|
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
|
|
|
};
|
|
|
}
|
|
|
|
|
|
function exposeProductListData(json) {
|
|
|
let res = json;
|
|
|
try{
|
|
|
try {
|
|
|
let list = json ? json.list : [];
|
|
|
if (!list) {
|
|
|
return json;
|
...
|
...
|
@@ -242,14 +243,16 @@ function exposeProductListData(json) { |
|
|
let inFloorIndex = parseInt(i) + 1 + json.page_size * (json.page - 1) + '';
|
|
|
item.yh_exposureData = {
|
|
|
P_NAME: pageName,
|
|
|
P_PARAM:item.activityId,
|
|
|
P_PARAM: item.activityId,
|
|
|
I_INDEX: inFloorIndex,
|
|
|
PRD_SKN: item.productSkn,
|
|
|
PRD_CHANNEL: item.productType ? "UFO" : "",
|
|
|
exposureEnd: 1
|
|
|
};
|
|
|
}
|
|
|
res.list = list;
|
|
|
}catch(error){}
|
|
|
} catch (error) {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -260,9 +263,9 @@ export function getHaggleStatus(productSkn, activityId, callBack) { |
|
|
let fetchHaggleStatus = (uid) => {
|
|
|
return new haggleService(app.host).fetcheProductHaggleStatus(uid, activityId, productSkn)
|
|
|
.then(json => {
|
|
|
let payload = json;
|
|
|
dispatch(haggleStatusSuccess(payload));
|
|
|
callBack && typeof callBack === 'function' && callBack(payload)
|
|
|
let payload = json;
|
|
|
dispatch(haggleStatusSuccess(payload));
|
|
|
callBack && typeof callBack === 'function' && callBack(payload)
|
|
|
})
|
|
|
.catch(error => {
|
|
|
ReactNative.NativeModules.YH_CommonHelper.showToast(error.message || '网络请求失败')
|
...
|
...
|
@@ -271,15 +274,15 @@ export function getHaggleStatus(productSkn, activityId, callBack) { |
|
|
|
|
|
ReactNative.NativeModules.YH_CommonHelper.uid()
|
|
|
.then(uid => {
|
|
|
fetchHaggleStatus(uid)
|
|
|
fetchHaggleStatus(uid)
|
|
|
})
|
|
|
.catch(error => {
|
|
|
ReactNative.NativeModules.YH_CommonHelper.login()
|
|
|
.then(uid => {
|
|
|
fetchHaggleStatus(uid)
|
|
|
})
|
|
|
.catch(error => {
|
|
|
});
|
|
|
.then(uid => {
|
|
|
fetchHaggleStatus(uid)
|
|
|
})
|
|
|
.catch(error => {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
};
|
...
|
...
|
|