Files
OMS/app/wap/statics/js/main.js
2025-12-28 23:13:25 +08:00

39 lines
948 B
JavaScript

/**
* Shopex OMS
*
* Copyright (c) 2025 Shopex (http://www.shopex.cn)
* Licensed under Apache-2.0 with additional terms (See LICENSE file)
*/
//Open the Mobile Front-end Codebase JS
$(document).mobile();
$('form').on('complete.validator', function(e, rs) {
try {
rs = JSON.parse(rs);
}
catch(e) {}
if (rs.redirect) {
if(rs.message) {
$(document).off('hide.tips')
.on('hide.tips', function() {
location.href = rs.redirect;
});
}
else {
location.href = rs.redirect;
}
}
if(rs.error) {
return $(document).mobile('tips', 'show', [rs.message, 'msg']);
}
if(rs.success) {
if(rs.message) $(document).mobile('tips', 'show', [rs.message, 'msg']);
}
})
// if ((/MicroMessenger/i).test(window.navigator.userAgent)) {
// document.querySelector('[data-topbar]').style.display = 'none';
// }