0428c855 by 任超

feat:预约时间

1 parent 0efd4585
...@@ -2,7 +2,8 @@ $(function () { ...@@ -2,7 +2,8 @@ $(function () {
2 2
3 var province = undefined 3 var province = undefined
4 var city = undefined 4 var city = undefined
5 5 // 办事大厅
6 var halloffice = '不夜城'
6 $('.area_list li').click(function () { 7 $('.area_list li').click(function () {
7 $(".area_list li").removeClass("active1") 8 $(".area_list li").removeClass("active1")
8 $(this).addClass("active1"); 9 $(this).addClass("active1");
...@@ -139,4 +140,9 @@ $(function () { ...@@ -139,4 +140,9 @@ $(function () {
139 infoWindow1.addEventListener('close', function (type, target, point) { 140 infoWindow1.addEventListener('close', function (type, target, point) {
140 $('.office_halls li').eq(1).removeClass('hallActive') 141 $('.office_halls li').eq(1).removeClass('hallActive')
141 }) 142 })
143
144 // 下一步
145 $('.nextButton').click(function(){
146 window.open("../yysj/index.html?halloffice="+halloffice+"","_self")
147 })
142 }) 148 })
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -5,12 +5,13 @@ $(function () { ...@@ -5,12 +5,13 @@ $(function () {
5 var bustime = undefined; 5 var bustime = undefined;
6 // 国有房屋无业点击选中记录 6 // 国有房屋无业点击选中记录
7 var busIndex = undefined 7 var busIndex = undefined
8 // 办事中心
9 var halloffice = undefined
8 var data = { 10 var data = {
9 'dateList': [ 11 'dateList': [
10 { 12 {
11 week: '星期一', 13 week: '星期一',
12 date: '10月15号', 14 date: '10月15号'
13 isSelect: true
14 }, 15 },
15 { 16 {
16 week: '星期二', 17 week: '星期二',
...@@ -33,30 +34,40 @@ $(function () { ...@@ -33,30 +34,40 @@ $(function () {
33 date: '10月19号' 34 date: '10月19号'
34 } 35 }
35 ], 36 ],
36 "list": ['上午:09:00-10:00', '上午:10:00-11:00', '上午:11:00-12:00', '下午:14:00-15:00', '下午:15:00-16:00'], 37 "busList": [{
37 "appint_detail": [ 38 startTime: "09:30",
38 { 39 endTime: "10:30",
39 'total': 2 40 orgBusinessList: [
40 }, 41 {
41 { 42 shortName: "一般抵押登记",
42 'total': 2 43 isyy: 1,
43 }, 44 residueNumber: "约满"
44 { 45 },
45 'total': 0 46 {
46 }, 47 shortName: "查封/解封登记",
47 { 48 isyy: 1,
48 'total': 0 49 residueNumber: "约满"
49 }, 50 },
50 { 51 {
51 'total': 1 52 shortName: "有证房抵押首次登记",
52 } 53 isyy: 1,
53 ] 54 residueNumber: "约满"
55 },
56 {
57 shortName: "商品房抵押登记",
58 isyy: 0,
59 residueNumber: "余3位"
60 }
61 ]
62 }],
54 }; 63 };
55 64
56 // 获取当前选中的日期 65 // 获取当前选中的日期
66 data.dateList[0].isSelect = true
57 for (var i = 0; i < data.dateList.length; i++) { 67 for (var i = 0; i < data.dateList.length; i++) {
58 if (data.dateList[i].isSelect) { 68 if (data.dateList[i].isSelect) {
59 Date = data.dateList[i].date 69 Date = data.dateList[i].date
70 bustime = data.dateList[i].week
60 } 71 }
61 }; 72 };
62 73
...@@ -69,50 +80,22 @@ $(function () { ...@@ -69,50 +80,22 @@ $(function () {
69 }); 80 });
70 function a(i) { 81 function a(i) {
71 Date = data.dateList[i].date 82 Date = data.dateList[i].date
83 bustime = data.dateList[i].week
72 $(".swiper-slide").eq(i).addClass('active').siblings().removeClass('active'); 84 $(".swiper-slide").eq(i).addClass('active').siblings().removeClass('active');
73 } 85 }
74 86
75 $('.business_list li').click(function () {
76 // 获取元素
77 appuintText = $(this).find('a').text()
78
79
80 $('.layui_anim_list').removeClass('disnone')
81 $('.layui_anim_content').show()
82 var demo = $('.layui-anim')
83 $('html,body').addClass('ovfHiden');
84 var othis = demo, anim = othis.data('anim');
85 othis.removeClass(anim);
86 setTimeout(function () {
87 demo.show()
88 othis.addClass(anim);
89 });
90
91 // 获取当前点击li 的下标
92 let index = $(this).index()
93 busIndex = index
94 })
95
96 layui.use('laytpl', function () { 87 layui.use('laytpl', function () {
97 laytpl = layui.laytpl; 88 laytpl = layui.laytpl;
98
99
100 var getTpl = document.getElementById('date').innerHTML 89 var getTpl = document.getElementById('date').innerHTML
101 , view = document.getElementById('swiperDate'); 90 , view = document.getElementById('swiperDate');
102 laytpl(getTpl).render(data, function (html) { 91 laytpl(getTpl).render(data, function (html) {
103 view.innerHTML = html; 92 view.innerHTML = html;
104 }); 93 });
105 94
106 var getTpl = document.getElementById('appoint_timeList').innerHTML 95 var getTpl1 = document.getElementById('business_item').innerHTML
107 , view = document.getElementById('view'); 96 , view1 = document.getElementById('business_list');
108 laytpl(getTpl).render(data, function (html) { 97 laytpl(getTpl1).render(data, function (html) {
109 view.innerHTML = html; 98 view1.innerHTML = html;
110 });
111
112 var getTpl = document.getElementById('appint_detail').innerHTML
113 , view = document.getElementById('view1');
114 laytpl(getTpl).render(data, function (html) {
115 view.innerHTML = html;
116 }); 99 });
117 }); 100 });
118 var swiper = new Swiper('.swiper-container', { 101 var swiper = new Swiper('.swiper-container', {
...@@ -133,85 +116,38 @@ $(function () { ...@@ -133,85 +116,38 @@ $(function () {
133 prevEl: '.swiper-button-prev', 116 prevEl: '.swiper-button-prev',
134 }, 117 },
135 }); 118 });
136 $(document).on('click', '.able_appint', function () { 119 function handle(){
137 $('.able_appint').removeClass("able_appintActive")
138 $(this).addClass("able_appintActive")
139
140 let index = $(this).index()
141 // 获取当前选中的日期
142 bustime = data.list[index]
143 modleClose()
144 $(".business_list li .allowedMask").remove()
145 $(".business_list li .reserved").remove()
146 var str = "<div class='reserved'> <i class='layui-icon layui-icon-log'></i> <div><p>" + appuintText + "</p><p>" + bustime + "</p></div> <i class='layui-icon appintDel layui-icon-reduce-circle'></i></div>"
147 $(".business_list li").append('<div class="allowedMask"></div>');
148 $(".business_list li:eq(" + busIndex + ") a").removeClass('not-allowed')
149 $(".business_list li").eq(busIndex).append(str);
150 $(".business_list li:eq(" + busIndex + ") a").hide()
151 });
152
153 // 删除预约记录
154 $(document).on('click', '.appintDel', function (event) {
155 $('.layui_anim_list').addClass('disnone')
156 $('.able_appint').removeClass('able_appintActive')
157 layui.use('layer', function () { 120 layui.use('layer', function () {
158 var layer = layui.layer; 121 layer.open({
159 layer.confirm('此操作将删除预约记录,是否继续', { 122 type: 1,
160 btn: ['取消', '继续'] //按钮 123 title: '请确认以下信息',
161 }, function () { 124 shadeClose: true,
162 layer.closeAll(); 125 area: ['500px', '320px'],
163 modleClose() 126 scrollbar: false,
164 }, function () { 127 skin: 'confimInfo',
165 modleClose() 128 content: '<div class="infoContent">'
166 $(".business_list li a").show() 129 + '<ul>'
167 $(".business_list li .allowedMask").remove() 130 + '<li><span>姓名</span>:任超</li>'
168 $(".business_list li .reserved").remove() 131 + '<li><span>身份证号</span>:610124193335522</li>'
132 + '<li><span>联系电话</span>:18740677386</li>'
133 + '</ul>'
134 + '<div class="listItem"><h3>大厅名称:</h3>'+halloffice+'</div>'
135 + '<div class="listItem"><h3>预约业务:</h3>' + appuintText + '</div>'
136 + '<div class="listItem"><h3>预约时间:</h3>' + Date + '&nbsp;&nbsp;' + bustime + '</div>'
137 + '<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>'
138 + '</div>'
169 }); 139 });
170 }); 140 })
141 }
142 // 业务选择
143 $(document).on('click', '.business_item ul li', function () {
144 halloffice = GetRequest()
145 appuintText = $(this).find('h3').text()
146 handle()
171 }); 147 });
172 148
173 149
174 $(document).on('click', '.allowedMask', function () {
175 $('.layui_anim_list').addClass('disnone')
176 modleClose()
177 });
178
179 // 下一步确认
180 $('.nextButton').click(function () {
181 if ($('.business_list li').has('.reserved').length) {
182 layui.use('layer', function () {
183 layer.open({
184 type: 1,
185 title: '请确认以下信息',
186 shadeClose: true,
187 area: ['500px', '320px'],
188 scrollbar: false,
189 skin: 'confimInfo',
190 content: '<div class="infoContent">'
191 + '<ul>'
192 + '<li><span>姓名</span>:任超</li>'
193 + '<li><span>身份证号</span>:610124193335522</li>'
194 + '<li><span>联系电话</span>:18740677386</li>'
195 + '</ul>'
196 + '<div class="listItem"><h3>大厅名称:</h3>碑林区不动产办事中心</div>'
197 + '<div class="listItem"><h3>预约业务:</h3>' + appuintText + '</div>'
198 + '<div class="listItem"><h3>预约时间:</h3>' + Date +'&nbsp;&nbsp;'+bustime+'</div>'
199 + '<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>'
200 + '</div>'
201 });
202 })
203 } else {
204 layui.use('layer', function () {
205 layer.alert('请先选择相应业务', {
206 skin: 'layui-layer-molv' //样式类名
207 , closeBtn: 0
208 }, function () {
209 layer.closeAll()
210 });
211 })
212 }
213 150
214 })
215 $(document).on('click', '.cancel', function () { 151 $(document).on('click', '.cancel', function () {
216 layer.closeAll() 152 layer.closeAll()
217 }) 153 })
...@@ -219,8 +155,15 @@ $(function () { ...@@ -219,8 +155,15 @@ $(function () {
219 window.location.href = "../yyjg/index.html" 155 window.location.href = "../yyjg/index.html"
220 }) 156 })
221 }); 157 });
222 function modleClose() { 158 function GetRequest() {
223 $('.layui_anim_content').hide() 159 var url = location.search; //获取url中"?"符后的字串
224 $('.layui-anim').hide() 160 var theRequest = new Object();
225 $('html,body').removeClass('ovfHiden'); 161 if (url.indexOf("?") != -1) {
162 var str = url.substr(1);
163 strs = str.split("?");
164 for (var i = 0; i < strs.length; i++) {
165 theRequest[strs[i].split("=")[0]] = decodeURIComponent(strs[i].split("=")[1]);
166 }
167 }
168 return theRequest.halloffice;
226 } 169 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -147,8 +147,8 @@ ...@@ -147,8 +147,8 @@
147 上一步 147 上一步
148 </a> 148 </a>
149 </button> 149 </button>
150 <button type="button" class="layui-btn layui-btn-normal"> 150 <button type="button" class="layui-btn nextButton layui-btn-normal">
151 <a href="../yysj/index.html" title="下一步"> 151 <a title="下一步">
152 下一步 152 下一步
153 </a> 153 </a>
154 </button> 154 </button>
......
...@@ -339,4 +339,66 @@ ...@@ -339,4 +339,66 @@
339 .confimButton .layui-btn { 339 .confimButton .layui-btn {
340 height: 30px; 340 height: 30px;
341 line-height: 30px; 341 line-height: 30px;
342 }
343 .layui-layer-ico {
344 background: none!important;
345 position: relative;
346 }
347 .layui-layer-ico::after {
348 content: '\2716';
349 position: absolute;
350 left: 0;
351 top: -2px;
352 font-size: 14px;
353 color: #fff;
354 }
355 /* ----------------------------------------------- */
356 .business_item .item_time {
357 float: left;
358 width: 200px;
359 background-color: #0091FF;
360 color: #fff;
361 margin-right: 15px;
362 height: 130px;
363 text-align: center;
364 line-height: 130px;
365 }
366 .business_item ul {
367 display: inline-block;
368 width: 80%;
369 }
370 .business_item ul li {
371 width: 33%;
372 display: inline-block;
373 background-color:#eee;
374 color: #fff;
375 border-radius: 3px;
376 text-align: center;
377 margin: 5px 0;
378 color: #666;
379 cursor: pointer;
380 padding: 7px 0;
381 position: relative;
382 }
383 .business_item ul li .mask {
384 position: absolute;
385 left: 0;
386 top: 0;
387 width: 100%;
388 height: 100%;
389 }
390 .business_item ul .item_appoint:hover {
391 background-color: #0091FF;
392 color: #fff;
393 }
394 .isAppoint {
395 cursor:not-allowed!important;
396 }
397 .business_item ul li h3 {
398 margin-bottom: 5px;
399 }
400 .business_item ul li p {
401 font-size: 12px;
402 text-align: center;
403 line-height: 14px;
342 } 404 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
18 <link rel="stylesheet" type="text/css" href="../../staticCss/common.css" /> 18 <link rel="stylesheet" type="text/css" href="../../staticCss/common.css" />
19 <link rel="stylesheet" type="text/css" href="./css/index.css"> 19 <link rel="stylesheet" type="text/css" href="./css/index.css">
20 </head> 20 </head>
21
22 <body> 21 <body>
23 <div class="yysj_main"> 22 <div class="yysj_main">
24 <div class="subject top-logo"> 23 <div class="subject top-logo">
...@@ -108,74 +107,25 @@ ...@@ -108,74 +107,25 @@
108 </div> 107 </div>
109 <!-- ----------------------------------业务选择start----------------------------------------------- --> 108 <!-- ----------------------------------业务选择start----------------------------------------------- -->
110 <div class="business_choice contentBox"> 109 <div class="business_choice contentBox">
111 <div class="title">
112 <h2>选择业务</h2>
113 <p>(请选择您要办理的业务)</p>
114 </div>
115 <div class="site-title"> 110 <div class="site-title">
116 <fieldset> 111 <fieldset>
117 <legend> 112 <legend>
118 <a href="" name="fieldset"> 113 <a href="" name="fieldset">
119 国有房屋 114 业务预约
120 </a> 115 </a>
121 </legend> 116 </legend>
122 </fieldset> 117 </fieldset>
123 </div> 118 </div>
124 <ul class="business_list"> 119 <div id="business_list">
125 <li> 120 </div>
126 <a title="二手房转移登记">
127 二手房转移登记
128 </a>
129 </li>
130 <li>
131 <a title="有证房抵押首次登记">
132 有证房抵押首次登记/注销登记
133 </a>
134 </li>
135 <li>
136 <a title="解封登记">
137 查封/解封登记
138 </a>
139 </li>
140 <li>
141 <a title="解封登记">
142 查封/解封登记
143 </a>
144 </li>
145 <li>
146 <a title="证房抵押首次登记">
147 证房抵押首次登记/注销登记
148 </a>
149 </li>
150 <li>
151 <a title="二手房转移登记">
152 二手房转移登记
153 </a>
154 </li>
155 </ul>
156 </div>
157 <div class="layui-anim layui_anim_list" data-anim="layui-anim-scale">
158 <h2>
159 <i class="layui-icon layui-icon-close" onclick="modleClose()"></i>
160 </h2>
161 <ul class="content_box">
162 <li id="view"></li>
163 <li id="view1"></li>
164 </ul>
165 </div> 121 </div>
166 <div class="layui_anim_content"></div>
167 122
168 <div class="next_button"> 123 <div class="next_button">
169 <button type="button" class="layui-btn layui-btn-normal"> 124 <button type="button" class="layui-btn layui-btn-normal">
170 <a href="../xxqu/index.html" title="上一步"> 125 <a href="../xzqy/index.html" title="上一步">
171 上一步 126 上一步
172 </a> 127 </a>
173 </button> 128 </button>
174 <button type="button" class="layui-btn layui-btn-normal nextButton">
175 <a title="下一步">
176 下一步
177 </a>
178 </button>
179 </div> 129 </div>
180 </div> 130 </div>
181 <!-- ----------------------------------内容模块的end----------------------------------------------- --> 131 <!-- ----------------------------------内容模块的end----------------------------------------------- -->
...@@ -273,37 +223,45 @@ ...@@ -273,37 +223,45 @@
273 {{# }); }} 223 {{# }); }}
274 </script> 224 </script>
275 225
276 226 <script id="business_item" type="text/html">
277 <script id="appoint_timeList" type="text/html"> 227 {{# layui.each(d.busList, function(index, item){ }}
278 <ul class="appointment_time"> 228 <div class="business_item">
279 {{# layui.each(d.list, function(index, item){ }} 229 <div class="item_time">
280 <li class="layui-bg-gray"> 230 <span>上午</span>
281 {{item}} 231 <span>{{item.startTime}}</span>
282 </li> 232 <span>-</span>
233 <span>{{item.endTime}}</span>
234 </div>
235 <ul>
236 {{# layui.each(item.orgBusinessList, function(index1, item1){ }}
237 {{# if(item1.isyy==0){ }}
238 <li class="item_appoint">
239 <h3>
240 {{item1.shortName}}
241 </h3>
242 {{# if(item1.isyy==1){ }}
243 <p style="color:#FF5722">({{item1.residueNumber}})</p>
244 {{# } }}
245 {{# if(item1.isyy==0){ }}
246 <p style="color:#5FB878">({{item1.residueNumber}})</p>
247 {{# } }}
248 </li>
249 {{# } }}
250 {{# if(item1.isyy==1){ }}
251 <li class="isAppoint">
252 <h3>
253 {{item1.shortName}}
254 </h3>
255 {{# if(item1.isyy==1){ }}
256 <p style="color:#FF5722">({{item1.residueNumber}})</p>
257 {{# } }}
258 {{# if(item1.isyy==0){ }}
259 <p style="color:#5FB878">({{item1.residueNumber}})</p>
260 {{# } }}
261 </li>
262 {{# } }}
263 {{# }); }}
264 </ul>
265 </div>
283 {{# }); }} 266 {{# }); }}
284 {{# if(d.list.length === 0){ }}
285 无数据
286 {{# } }}
287 </ul>
288 </script>
289
290 <script id="appint_detail" type="text/html">
291 <ol class="appint_detail">
292 {{# layui.each(d.appint_detail, function(index, item){ }}
293 {{# if(item.total > 0){ }}
294 <li class="able_appint">
295 <span>可预约</span>
296 <p>{{item.total}}</p>
297 </li>
298 {{# } }}
299 {{# if(item.total == 0){ }}
300 <li class="layui-bg-gray">
301 <p class="full_engagement">已约满</p>
302 </li>
303 {{# } }}
304 {{# }); }}
305 {{# if(d.list.length === 0){ }}
306 无数据
307 {{# } }}
308 </ol>
309 </script> 267 </script>
...\ No newline at end of file ...\ No newline at end of file
......