mirror of
https://github.com/QIDITECH/QIDIStudio.git
synced 2026-02-02 01:48:42 +03:00
fix some bug
This commit is contained in:
31
resources/web/helio/js/index.js
Normal file
31
resources/web/helio/js/index.js
Normal file
@@ -0,0 +1,31 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user