This commit is contained in:
Dragon
2022-11-24 15:45:52 +08:00
parent cb316076f9
commit 896431e871
7 changed files with 442 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
// 封装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'
})
}
var browser = checkVersion();
const urlPrefix = getUrlPrefix();
var getUrl = getQueryString();
if (EnvCheck() == 'test') {//degBug
new VConsole();
}
$(function () {
getInfoFromClient();//请求依赖
})
function request () {
showLoading()
networkRequest({
type: 'GET',
url: urlPrefix + '',
data: {},
success: function (res) {
if (res.code == 200) {
$('.box .phone input').val('');
$('.box .code input').val('');
$('.pop_up').show();
hideLoading(layerIndex)
} else {
hideLoading(layerIndex)
toastMsg(ress.message)
}
},
error () {
toastMsg('網絡錯誤');
}
});
}
// 提交按钮
$('.box .but').click(function () {
var num = Number($('.box .phone .num').text().match(/\d+/)[0]);
var phone = Number($('.box .phone input').val());
var code = Number($('.box .code input').val());
console.log(num, phone, code);
})
// 关闭弹窗
$('.pop_up .pop_up_in img').click(function () {
$('.pop_up').hide();
})
// 关闭弹窗
$('.pop_up .pop_up_in .but').click(function () {
$('.pop_up').hide();
})