yysj.js
4.53 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
$(function () {
var Date = undefined;
var appuintText = undefined
var bustime = undefined;
// 国有房屋无业点击选中记录
var busIndex = undefined
// 办事中心
var halloffice = undefined
var data = {
'dateList': [
{
week: '星期一',
date: '10月15号'
},
{
week: '星期二',
date: '10月16号'
},
{
week: '星期三',
date: '10月17号'
},
{
week: '星期二',
date: '10月18号'
},
{
week: '星期五',
date: '10月19号'
},
{
week: '星期六',
date: '10月19号'
}
],
"busList": [{
startTime: "09:30",
endTime: "10:30",
orgBusinessList: [
{
shortName: "一般抵押登记",
isyy: 1,
residueNumber: "约满"
},
{
shortName: "查封/解封登记",
isyy: 1,
residueNumber: "约满"
},
{
shortName: "有证房抵押首次登记",
isyy: 1,
residueNumber: "约满"
},
{
shortName: "商品房抵押登记",
isyy: 0,
residueNumber: "余3位"
}
]
}],
};
// 获取当前选中的日期
data.dateList[0].isSelect = true
for (var i = 0; i < data.dateList.length; i++) {
if (data.dateList[i].isSelect) {
Date = data.dateList[i].date
bustime = data.dateList[i].week
}
};
layui.use('element', function () {
let element = layui.element; //导航的hover效果、二级菜单等功能,需要依赖element模块
//监听导航点击
element.on('nav(demo)', function (elem) {
layer.msg(elem.text());
});
});
function a(i) {
Date = data.dateList[i].date
bustime = data.dateList[i].week
$(".swiper-slide").eq(i).addClass('active').siblings().removeClass('active');
}
layui.use('laytpl', function () {
laytpl = layui.laytpl;
var getTpl = document.getElementById('date').innerHTML
, view = document.getElementById('swiperDate');
laytpl(getTpl).render(data, function (html) {
view.innerHTML = html;
});
var getTpl1 = document.getElementById('business_item').innerHTML
, view1 = document.getElementById('business_list');
laytpl(getTpl1).render(data, function (html) {
view1.innerHTML = html;
});
});
var swiper = new Swiper('.swiper-container', {
slidesPerView: 5,
spaceBetween: 20,
slidesPerGroup: 1,
observer: true,
observeParents: true,
on: {
click: function (swiper) {
var index = swiper['clickedIndex'];
a(index);
}
},
loopFillGroupWithBlank: true,
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
function handle(){
layui.use('layer', function () {
layer.open({
type: 1,
title: '请确认以下信息',
shadeClose: true,
area: ['500px', '320px'],
scrollbar: false,
skin: 'confimInfo',
content: '<div class="infoContent">'
+ '<ul>'
+ '<li><span>姓名</span>:任超</li>'
+ '<li><span>身份证号</span>:610124193335522</li>'
+ '<li><span>联系电话</span>:18740677386</li>'
+ '</ul>'
+ '<div class="listItem"><h3>大厅名称:</h3>'+halloffice+'</div>'
+ '<div class="listItem"><h3>预约业务:</h3>' + appuintText + '</div>'
+ '<div class="listItem"><h3>预约时间:</h3>' + Date + ' ' + bustime + '</div>'
+ '<div class="confimButton"><button type="button" class="layui-btn cancel layui-btn-primary">取消</button><button type="button" class="layui-btn confim layui-btn-normal">确定</button></div>'
+ '</div>'
});
})
}
// 业务选择
$(document).on('click', '.business_item ul .item_appoint', function () {
halloffice = GetRequest()
appuintText = $(this).find('h3').text()
handle()
});
$(document).on('click', '.cancel', function () {
layer.closeAll()
})
$(document).on('click', '.confim', function () {
window.location.href = "./yyjg.html"
})
});
function GetRequest() {
var url = location.search; //获取url中"?"符后的字串
var theRequest = new Object();
if (url.indexOf("?") != -1) {
var str = url.substr(1);
strs = str.split("?");
for (var i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = decodeURIComponent(strs[i].split("=")[1]);
}
}
return theRequest.halloffice;
}