Files
peko-h5/view/peko/modules/h5Income/js/rule.js
2023-07-14 15:27:25 +08:00

68 lines
1.6 KiB
JavaScript

let urlPrefix = getUrlPrefix()
let browser = checkVersion()
let env = EnvCheck();
if (env == 'test') {
new VConsole();
}
// 封裝layer消息提醒框
let layerIndex
const showLoading = (content = '加載中...') => {
layer.open({
type: 2,
shadeClose: false,
content,
success (e) {
layerIndex = $(e).attr('index')
}
})
}
const hideLoading = (index) => {
layer.close(index)
}
const toastMsg = (content = '操作完成', time = 2) => {
layer.open({
content,
time,
skin: 'msg'
})
}
$(function () {
setTimeout(function () {
getInfoFromClient()
if (browser.app) {
$('.back').hide();
}
setTimeout(function () {
getConfig()
}, 100)
})
})
// 提領配置接口接口
function getConfig () {
showLoading()
networkRequest({
type: 'GET',
url: urlPrefix + '/withdrawUser/config',
data: { uid: pubInfo.uid },
success (res) {
if (res.code === 200) {
$('.box p .b2').text(res.data.weekLimitCount);
$('.box p .b1').text(res.data.minValue);
} else if (res.code ? res.code == 401 : JSON.parse(res).code == 401) {
window.location.href = './login.html'
} else {
toastMsg(res.message)
}
console.log();
hideLoading(layerIndex)
},
error (err) {
hideLoading(layerIndex)
toastMsg('網絡錯誤,請退出重進')
}
})
}
// 返回按鈕
$('.back').click(function () {
window.history.go(-1)
})