提交 all-in-one H5 本地适配

This commit is contained in:
Chopper711
2026-06-10 22:19:17 +08:00
parent ab77ab7c2e
commit f0939430c9
12 changed files with 20554 additions and 51 deletions

View File

@@ -233,9 +233,9 @@ function navigationToBack(type) {
* 计算当前时间到第二天0点的倒计时[秒]
* @returns {number}
*/
export function theNextDayTime() {
const nowDate = new Date();
const time =
export function theNextDayTime() {
const nowDate = new Date();
const time =
new Date(
nowDate.getFullYear(),
nowDate.getMonth(),
@@ -243,17 +243,21 @@ export function theNextDayTime() {
0,
0,
0
).getTime() - nowDate.getTime();
return parseInt(time / 1000);
}
module.exports = {
unixToDate,
dateToUnix,
formatPrice,
).getTime() - nowDate.getTime();
return parseInt(time / 1000);
}
const Foundation = {
unixToDate,
dateToUnix,
formatPrice,
secrecyMobile,
randomString,
countTimeDown,
theNextDayTime,
whetherNavigate,
checkBankno,
};
whetherNavigate,
checkBankno,
};
// uni-app H5 的 webpack 模块包装会把 CommonJS exports 标记为只读,使用 ES 默认导出兼容现有默认导入。
export default Foundation;

View File

@@ -241,10 +241,7 @@
uuid._whatwgRNG = _whatwgRNG;
if (('undefined' !== typeof module) && module.exports) {
// Publish as node.js module
module.exports = uuid;
} else if (typeof define === 'function' && define.amd) {
if (typeof define === 'function' && define.amd) {
// Publish as AMD module
define(function() { return uuid; });
} else {
@@ -259,4 +256,7 @@
_window.uuid = uuid;
}
})('undefined' !== typeof window ? window : null);
})('undefined' !== typeof window ? window : ('undefined' !== typeof globalThis ? globalThis : {}));
// uni-app H5 的 webpack 包装会把 CommonJS exports 标记为只读,避免使用 module.exports 重新赋值。
export default ('undefined' !== typeof globalThis ? globalThis.uuid : undefined);