vhall-mini-sdk 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/shared/mpUtils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";let deviceInfo_platform;function getDevicePlatform(){try{if(!deviceInfo_platform){const e=wx.getDeviceInfo();deviceInfo_platform=e.platform}return deviceInfo_platform}catch(e){return"unkown"}}function isInPc(){try{return deviceInfo_platform||this.getDevicePlatform(),"windows"===deviceInfo_platform||"mac"===deviceInfo_platform}catch(e){return!1}}function showToast(e,o="none",
|
|
1
|
+
"use strict";let deviceInfo_platform;function getDevicePlatform(){try{if(!deviceInfo_platform){const e=wx.getDeviceInfo();deviceInfo_platform=e.platform}return deviceInfo_platform}catch(e){return"unkown"}}function isInPc(){try{return deviceInfo_platform||this.getDevicePlatform(),"windows"===deviceInfo_platform||"mac"===deviceInfo_platform}catch(e){return!1}}function showToast(e,o="none",t=1500){return wx.showToast({title:e,icon:o,duration:t})}function reloadCurrentPage(){const e=getCurrentPages();if(!e||0===e.length)return void console.error("[SDK] reloadCurrentPage failed: page stack is empty");const o=e[e.length-1],{route:t,options:r}=o,n=Object.keys(r).map((e=>`${e}=${r[e]}`)).join("&"),a=`/${t}`+(n?`?${n}`:"");wx.redirectTo({url:a,success:()=>{console.log("[SDK] Page reloaded via redirectTo:",a)},fail:e=>{console.warn("[SDK] redirectTo failed, fallback to reLaunch:",e.errMsg),wx.reLaunch({url:a})}})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getDevicePlatform=getDevicePlatform,exports.isInPc=isInPc,exports.reloadCurrentPage=reloadCurrentPage,exports.showToast=showToast;
|