bljy.js
3.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
$(function () {
var title = undefined
var bus = undefined
var countDown = null
layui.use('element', function () {
let element = layui.element; //导航的hover效果、二级菜单等功能,需要依赖element模块
//监听导航点击
element.on('nav(demo)', function (elem) {
layer.msg(elem.text());
});
});
addTabs('#wssq')
title = GetQueryString('title')
bus = GetQueryString('bus')
// $('.name_title h2').text(title)
// $('.name_title p').text(bus)
function 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;
}
// 业务
// 点击获取验证码操作
$('.feachBtn').click(function () {
var tel = $("#tel").val();
//正则表达式
var reg = /(1[3-9]\d{9}$)/;
if (!reg.test(tel)) {
layer.msg("请输入正确格式的手机号码", {
icon: 5
});
return false;
} else {
let count = 5;
$('.feachBtn').attr('disabled', true);
$('.feachBtn').css({
background: '#eee',
color: '#707070',
});
count--;
countDown = setInterval(() => {
count--;
$('.feachBtn').text(count + '秒后可重新获取');
if (count === 0) {
$('.feachBtn').text('重新发送').removeAttr('disabled');
clearInterval(countDown);
}
}, 1000);
$('.feachBtn').text(count + '秒后可重新获取');
}
})
layui.use(['form'], function () {
var form = layui.form
//自定义验证规则
form.verify({
title: function (value) {
if (value.length == 0) {
return '权利人不能为空';
} else if (value.length < 2) {
return '权利人至少得2个字符啊';
}
}
});
//监听提交
form.on('submit(demo1)', function (data) {
layer.alert(JSON.stringify(data.field), {
title: '最终的提交信息'
})
return false;
});
});
// 进度条
var data = {
'progressList': [
{
stepName: "信息效验",
stepState: 1 //0:未办理 1:正在办理 2:已办理
},
{
stepName: "填报信息",
stepState: 0
},
{
stepName: "完税核税",
stepState: 0
},
{
stepName: "身份认证",
stepState: 0
},
{
stepName: "资料审核",
stepState: 0
},
{
stepName: "线上缴费",
stepState: 0
},
{
stepName: "生成电子证书",
stepState: 0
}
],
}
layui.use('laytpl', function () {
laytpl = layui.laytpl;
var getTpl = document.getElementById('progress').innerHTML
, view = document.getElementById('app_progress');
laytpl(getTpl).render(data, function (html) {
view.innerHTML = html;
});
layui.use(['element'], function () {
var element = layui.element;
//初始化动态元素,一些动态生成的元素如果不设置初始化,将不会有默认的动态效果
element.init();
});
});
})