yysj.js
3.36 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
$(function () {
var Date = undefined;
// 国有房屋无业点击选中记录
var busIndex = undefined
var data = {
'dateList': [
{
week: '星期一',
date: '10月15号',
isSelect: true
},
{
week: '星期二',
date: '10月16号'
},
{
week: '星期三',
date: '10月17号'
},
{
week: '星期二',
date: '10月18号'
},
{
week: '星期五',
date: '10月19号'
},
{
week: '星期六',
date: '10月19号'
}
],
"list": ['上午:09:00-10:00', '上午:10:00-11:00', '上午:11:00-12:00', '下午:14:00-15:00', '下午:15:00-16:00'],
"appint_detail": [
{
'total': 2
},
{
'total': 2
},
{
'total': 0
},
{
'total': 0
},
{
'total': 1
}
]
};
// 获取当前选中的日期
for (var i = 0; i < data.dateList.length; i++) {
if(data.dateList[i].isSelect) {
Date = data.dateList[i].date
}
};
layui.use('element', function () {
let element = layui.element; //导航的hover效果、二级菜单等功能,需要依赖element模块
//监听导航点击
element.on('nav(demo)', function (elem) {
//console.log(elem)
layer.msg(elem.text());
});
});
function a(i) {
$(".swiper-slide").eq(i).addClass('active').siblings().removeClass('active');
}
$('.business_list li').click(function () {
$('.layui_anim_content').show()
var demo = $('.layui-anim')
$('html,body').addClass('ovfHiden');
var othis = demo, anim = othis.data('anim');
othis.removeClass(anim);
setTimeout(function () {
demo.show()
othis.addClass(anim);
});
// 获取当前点击li 的下标
let index = $(this).index() + 1;
busIndex = index
})
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 getTpl = document.getElementById('appoint_timeList').innerHTML
, view = document.getElementById('view');
laytpl(getTpl).render(data, function (html) {
view.innerHTML = html;
});
var getTpl = document.getElementById('appint_detail').innerHTML
, view = document.getElementById('view1');
laytpl(getTpl).render(data, function (html) {
view.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',
},
});
$(document).on('click', '.able_appint', function () {
$('.able_appint').removeClass("able_appintActive")
$(this).addClass("able_appintActive")
modleClose()
console.log(9999, busIndex)
// $('.business_list li').eq(busIndex-1).addClass('bugActive')
});
});
function modleClose() {
$('.layui_anim_content').hide()
$('.layui-anim').hide()
$('html,body').removeClass('ovfHiden');
}