...
|
...
|
@@ -13,6 +13,7 @@ const { |
|
|
SWITCH_GENDER,
|
|
|
JUMP_WITH_URL,
|
|
|
} = require('../../constants/actionTypes').default;
|
|
|
import {urlAddParamOfType} from '../../../common/utils/urlHandler';
|
|
|
|
|
|
export function setSegment(segment) {
|
|
|
return {
|
...
|
...
|
@@ -157,37 +158,11 @@ export function jumpWithUrl(url) { |
|
|
return;
|
|
|
}
|
|
|
//拼接type
|
|
|
url = urlAddParamOfType(url);
|
|
|
url = urlAddParamOfType(url, '7')
|
|
|
|
|
|
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
|
|
|
return {
|
|
|
type: JUMP_WITH_URL,
|
|
|
payload: url
|
|
|
};
|
|
|
} |
|
|
|
|
|
function urlAddParamOfType(url) {
|
|
|
let strs= new Array();
|
|
|
let dataString = '';
|
|
|
if (url.indexOf('yohobuy=') !== -1) {
|
|
|
strs = url.split("yohobuy=");
|
|
|
if (strs.length == 1) {
|
|
|
dataString = strs[0];
|
|
|
} else {
|
|
|
dataString = strs[1];
|
|
|
}
|
|
|
} else {
|
|
|
strs = url.split("yohobuy=");
|
|
|
if (strs.length == 1) {
|
|
|
dataString = strs[0];
|
|
|
} else {
|
|
|
dataString = strs[1];
|
|
|
}
|
|
|
}
|
|
|
var obj = JSON.parse(dataString); //由JSON字符串转换为JSON对象
|
|
|
obj.params.type = '7';
|
|
|
let totalUrlWithType = "yohobuy=" + JSON.stringify(obj);
|
|
|
if (strs.length > 1) {
|
|
|
totalUrlWithType = strs[0] + totalUrlWithType;
|
|
|
}
|
|
|
return totalUrlWithType;
|
|
|
} |
...
|
...
|
|