first commit

This commit is contained in:
编码猿
2024-09-27 01:31:25 +08:00
commit 07c46ac300
558 changed files with 37414 additions and 0 deletions

45
h5/js/utils/index.js Normal file
View File

@@ -0,0 +1,45 @@
/**
* 工具函数
*/
class Utils {
constructor () {
setTimeout(()=> this.AppBack(),100)
}
AppBack() {
document.querySelector(".icon-back1") && document.querySelector(".icon-back1").addEventListener('click',function () {
history.back()
})
}
GetQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return decodeURIComponent(r[2]); return null;
}
SetHeaderTitle(title) {
document.querySelector(".header_theme1 span").innerText = title
}
longPress(Dom, func, timeout = 500) {
var timeOutEvent;
Dom.addEventListener('touchstart', function (e) {
clearTimeout(timeOutEvent);
timeOutEvent = setTimeout(function () {
func();
}, timeout);
});
Dom.addEventListener('touchmove', function (e) {
clearTimeout(timeOutEvent);
});
Dom.addEventListener('touchend', function (e) {
clearTimeout(timeOutEvent);
});
}
}
var utils = new Utils();