Files
QIDIStudio/resources/web/helio/js/index.js
2025-10-24 17:20:44 +08:00

31 lines
637 B
JavaScript

function IsInSlicer() {
let bMatch = navigator.userAgent.match(RegExp('BBL-Slicer', 'i'));
return bMatch;
}
function SendWXMessage(strMsg) {
let bCheck = IsInSlicer();
if (bCheck != null) {
window.wx.postMessage(strMsg);
}
}
function OpenPPLink() {
SendWXMessage("helio_link_pp");
}
function OpenTouLink() {
SendWXMessage("helio_link_tou");
}
function OpenHomeLink() {
SendWXMessage("helio_link_home");
}
function getUrlParam(name) {
const reg = new RegExp(`(^|&)${name}=([^&]*)(&|$)`);
const r = window.location.search.substr(1).match(reg);
return r ? decodeURIComponent(r[2]) : null;
}