mirror of
https://github.com/QIDITECH/QIDIStudio.git
synced 2026-01-31 00:48:41 +03:00
31 lines
637 B
JavaScript
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;
|
|
} |