2024-02-22 19:28:16 +08:00
|
|
|
/**
|
|
|
|
* 结算 埋点方法
|
|
|
|
* @param {string} key
|
|
|
|
* @param {number} settlementType
|
|
|
|
*/
|
|
|
|
const settlementFun = (token, settlementType) => {
|
2024-02-25 17:58:32 +08:00
|
|
|
let obj_yz_data = JSON.parse(sessionStorage.getItem("bm_auth"));
|
2024-02-28 14:13:05 +08:00
|
|
|
if (obj_yz_data && obj_yz_data.settlement_data.is_settlement) {
|
2024-02-25 17:58:32 +08:00
|
|
|
return;
|
|
|
|
}
|
2024-02-22 19:28:16 +08:00
|
|
|
let params = {
|
|
|
|
token,
|
|
|
|
type: settlementType
|
|
|
|
};
|
|
|
|
req.axiosPost("/key/settlement/create", params).then((res) => {
|
2024-02-23 17:25:07 +08:00
|
|
|
console.log("点 =>", res);
|
2024-02-22 19:28:16 +08:00
|
|
|
if (res.code === 200) {
|
|
|
|
// 接口请求成功后,就不能再请求接口了
|
|
|
|
let obj_sy = JSON.parse(sessionStorage.getItem("bm_auth"));
|
|
|
|
obj_sy.settlement_data.is_settlement = true;
|
|
|
|
sessionStorage.setItem("bm_auth", JSON.stringify(obj_sy));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|
2024-02-27 17:46:13 +08:00
|
|
|
|
|
|
|
// 兼容IOS 返回
|
|
|
|
const locationReplace = (url) => {
|
|
|
|
if (history.replaceState) {
|
|
|
|
history.replaceState(null, document.title, url);
|
|
|
|
history.go(0);
|
|
|
|
} else {
|
|
|
|
location.replace(url);
|
|
|
|
}
|
|
|
|
};
|
2024-03-14 09:57:00 +08:00
|
|
|
|
|
|
|
// 获取url参数
|
|
|
|
const getQueryString = (name) => {
|
|
|
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
|
|
|
var r = window.location.search.substr(1).match(reg);
|
|
|
|
if (r != null) return unescape(r[2]);
|
|
|
|
return null;
|
|
|
|
};
|