# **使用介绍**
#### A应用取出config接口的`diversion_strategy`参数,这里会使用到(`policy_version`、`bundles`、`integral_wall_path`、`integral_wall_path3`),用于拼接hap链接,再加上lp传给快应用的参数options,再新增一个参数`is_dredge=1`
```
/**
* @name 对象转url
* @description 用于生成url
* @author 小宋
* @date 2024/10/22 18:01
* @param obj object 参数对象
* @return params string url参数
**/
const objectToUrlParams = (obj) => {
const params = [];
for (let key in obj) {
if (obj.hasOwnProperty(key)) {
let value = obj[key];
// let param = encodeURIComponent(key) + '=' + encodeURIComponent(value);
let param = key + '=' + value;
params.push(param);
}
}
return params.join('&');
}
/**
* @name 生成hap链接url
* @description 用于跳转其他应用
* @author 小宋
* @date 2024/10/22 18:01
* @param options object lp所有参数
* @param configData object config接口返回所有参数
* @return url string hap链接url
**/
const getHapUrl = (options,configData) => {
const { diversion_strategy } = configData;
const { policy_version,bundles,integral_wall_path,integral_wall_path3,s_link_id,ds_guiding_other_app } = diversion_strategy
let path = null;
let url = null;
if(ds_guiding_other_app != 1 || !policy_version || !bundles || !integral_wall_path || !integral_wall_path3 || !s_link_id){
return url;
}
if(policy_version == 3){
path = integral_wall_path3
}else{
path = integral_wall_path
}
options.is_dredge = 1
options.s_link_id = s_link_id
options.uniqueId = 生成时间戳方法
url = "hap://app/" + bundles + "/" + path + "?" + objectToUrlParams(options)
return url;
}
```
#### B应用
1.在是否上报接口判断`is_dredge=1`直接返回
2.质量分接口需要新增`is_dredge`参数
3.推广数据统计接口`quick/promotionData`、推广数据统计V3接口`quick/promotionData3`新增`is_dredge`参数