34 |
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 |
-
170 |
171 |
+
172 |
173 |
174 |
175 |
176 |
-
177 |
178 |
+
179 |
180 |
181 |
182 |
183 |
-
184 |
185 |
+
186 |
187 |
188 |
189 | 移除商品
190 |
191 |
192 | 移除商品
193 |
194 |
195 | 移除商品
196 |
197 |
198 | 移除商品
199 |
200 |
201 | 移除商品
202 |
203 |
204 | 移除商品
205 |
206 |
207 | 移除商品
208 |
209 |
210 | 移除商品
211 |
212 |
213 | 移除商品
214 |
215 |
216 | 移除商品
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
257 |
258 |
259 |
260 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
已选商品0件
274 |
共计: 0.00
275 |
276 |
277 |
278 |
279 |
280 |
281 | 删除菜品X
282 | 您确认要删除该菜品吗?
283 |
287 |
288 |
289 |
356 |
--------------------------------------------------------------------------------
/css/style1.css:
--------------------------------------------------------------------------------
1 | @charset "utf-8";
2 |
3 | body, h1, h2, h3, h4, h5, h6, p, pre, blockquote, dl, dt, dd, ul, ol, li, form, fieldset, legend, input, textarea, button, th, td {
4 | margin: 0;
5 | padding: 0;
6 | }
7 | .nav_bg {
8 | height: 44px;
9 | line-height: 44px;
10 | background: #2196f3;
11 | }
12 | .nav_bg .wrap {
13 | width: 1200px;
14 | margin: 0;
15 | display: block
16 | }
17 | .nav {
18 | float: left;
19 | }
20 |
21 | .nav a {
22 | display: block;
23 | float: left;
24 | padding: 0 20px;
25 | color: #fff;
26 | font-size: 16px;
27 | height: 44px;
28 | line-height: 44px;
29 | }
30 | .clearfix:after {
31 | content: ".";
32 | display: block;
33 | height: 0;
34 | clear: both;
35 | visibility: hidden;
36 | }
37 | .nav {
38 | position: relative;
39 | z-index: 1;
40 | }
41 |
42 | .nav .nLi {
43 | float: left;
44 | position: relative;
45 | display: inline;
46 | }
47 | .nav .nLi .e {
48 | padding: 0 0 0 90px;
49 | float: left;
50 | }
51 | .nav .nLi .d {
52 | padding: 0 0 0 20px;
53 | float: left;
54 | }
55 | .nav .nLi h3 a {
56 | display: block;
57 | }
58 |
59 | .nav .nLi .d a:hover {
60 | background: #0D5780;
61 | color: #fff;
62 | }
63 | .nav .on h3 a {
64 | background: #1784db;
65 | color: #fff;
66 | }
67 | .projects .rightborder .cont::-webkit-scrollbar {/*滚动条整体样式*/
68 | width: 10px; /*高宽分别对应横竖滚动条的尺寸*/
69 | height: 1px;
70 | }
71 | .projects .rightborder .cont::-webkit-scrollbar-thumb {/*滚动条里面小方块*/
72 | border-radius: 10px;
73 | background-color: silver;
74 | background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%,
75 | rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);
76 | }
77 | .projects .rightborder .cont::-webkit-scrollbar-track {/*滚动条里面轨道*/
78 | -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
79 | /*border-radius: 10px;*/
80 | background: #EDEDED;
81 | }
82 | .projects2 .rightborder .cont::-webkit-scrollbar {/*滚动条整体样式*/
83 | width: 10px; /*高宽分别对应横竖滚动条的尺寸*/
84 | height: 1px;
85 | }
86 | .projects2 .rightborder .cont::-webkit-scrollbar-thumb {/*滚动条里面小方块*/
87 | border-radius: 10px;
88 | background-color: silver;
89 | background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%,
90 | rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);
91 | }
92 | .projects2 .rightborder .cont::-webkit-scrollbar-track {/*滚动条里面轨道*/
93 | -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
94 | /*border-radius: 10px;*/
95 | background: #EDEDED;
96 | }
97 | .left .leftborder li.border1{height:60px; width: 110px;position:relative; display:block;padding:85px 0 0 100px;}
98 | .left .leftborder li.border2{height:50px; width: 110px; display:block;padding:30px 0 0 100px;}
99 | .left .leftborder li.border3{height:50px; width: 110px; display:block;padding:20px 0 0 100px;}
100 | .left .leftborder li.border3clicked a{color: black; display:block;font-size:16px;color:rgb(0, 225, 255);position: relative;}
101 | .left .leftborder li.border3clicked{height:50px; width: 110px; display:block;padding:20px 0 0 100px;}
102 | .left .leftborder li.border4{height:50px; width: 110px; display:block;padding:20px 0 0 100px;}
103 | .left .leftborder li.border4clicked{height:50px; width: 110px; display:block;padding:20px 0 0 100px;}
104 | .left .leftborder li.border4clicked a{color: black; display:block;font-size:16px;color:rgb(0, 225, 255);position: relative;}
105 | .left .leftborder li.border5{height:50px; width: 110px; display:block;padding:20px 0 0 100px;}
106 | .left .leftborder li.border5clicked{height:50px; width: 110px; display:block;padding:20px 0 0 100px;}
107 | .left .leftborder li.border5clicked a{color: black; display:block;font-size:16px;color:rgb(0, 225, 255);position: relative;}
108 | .left .leftborder li.border2clicked{height:50px; width: 110px; display:block;padding:30px 0 0 100px;}
109 | .left .leftborder li a{color: black; display:block;font-size:16px;position: relative;}
110 | .left .leftborder li.border2clicked a{color: black; display:block;font-size:16px;color:rgb(0, 225, 255);position: relative;}
111 | .left .leftborder li.border1 .inner{color:grey; display:block;font-size:12px;position: relative;}
112 | .left .leftborder li.border1 .inner:hover{ border:none; color:#ff4500; text-decoration: none;}
113 | .projects {
114 | background-color: #fff;
115 | border-left: 1px solid #e5e5e5;
116 | border-right: 1px solid #e5e5e5;
117 | /* -moz-box-shadow: 0 1px 3px #ddd;
118 | -webkit-box-shadow: 0 1px 3px #ddd;
119 | box-shadow: 0 1px 3px #ddd;
120 | -webkit-animation: bottom-in .5s ease 0s backwards;
121 | -moz-animation: bottom-in .5s ease 0s backwards;
122 | animation: bottom-in .5s ease 0s backwards; */
123 | position: absolute;
124 | top: 12%;
125 | left:20%;
126 | height:824px;
127 | /* height: 460px; */
128 | width:950px;
129 |
130 |
131 | }
132 | .projects .rightborder .instruct{
133 | height:25px;
134 | width:950px;
135 |
136 | position:relative;
137 | display:block;
138 | border-bottom: .5px silver solid;
139 | background-color: silver;
140 | font-size: 13px;
141 |
142 | text-align: justify;
143 | }
144 |
145 | .projects .rightborder .dishes{
146 | height:80px;
147 | width:950px;
148 | position:relative;
149 | display:block;
150 | border-bottom: .5px silver solid;
151 | /* background-color: silver; */
152 | font-size: 15px;
153 | text-align: center;
154 | /* padding: 0 0 0 30px; */
155 |
156 | text-align: justify;
157 | }
158 | .projects .rightborder .cont{
159 | height:440px;
160 | width: 950px;;
161 | /* overflow-x: hidden;
162 | overflow-y: auto; */
163 | }
164 | .projects .rightborder .dishes #one{
165 | height:50px;
166 | width:110px;
167 | border-left:.5px silver solid ;
168 | border-right: .5px silver solid;
169 | position:absolute; top:0;left: 14.45%;
170 | padding: 30px 0 0 0px;
171 | text-align: center;
172 | font-size: 14px;
173 | }
174 | .projects .rightborder .dishes #two{
175 | height:63px;
176 | width:170px;
177 | font-size: 13px;
178 | border-right: .5px silver solid;
179 | position:absolute; top:0;left: 29.45%;
180 | padding: 25px 15px 0 0px;
181 | text-align: center;
182 | }
183 |
184 | .projects .rightborder .dishes #three{
185 | height:50px;
186 | width:110px;
187 | font-family: Verdana,Tahoma,arial;
188 | color: #3c3c3c;
189 | font-weight: bold;
190 | font-size: 13px;
191 | border-right: .5px silver solid;
192 | position:absolute; top:0;left: 52.45%;
193 | padding: 30px 0 0 40px;
194 | /* text-align: center; */
195 | }
196 |
197 | .projects .rightborder .dishes #four{
198 | height:50px;
199 | width:80px;
200 | font-size: 13px;
201 | font-family: Verdana,Tahoma,arial;
202 | color: #3c3c3c;
203 | font-weight: bold;
204 | border-right: .5px silver solid;
205 | position:absolute; top:0;left: 74.45%;
206 | padding: 30px 0 0 10px;
207 | }
208 |
209 | .projects .rightborder .dishes #five{
210 | height:50px;
211 | width:80px;
212 |
213 |
214 | position:absolute; top:0;left: 84.45%;
215 | text-align: center;
216 | padding: 10px 0 0 30px;
217 | }
218 |
219 |
220 | .projects .rightborder .dishes #five .inn{
221 | height: 20px;
222 | width: 90px;
223 | background-color: white;
224 | color: black;
225 | font-size: 12px;
226 | border: black .5px solid;
227 | }
228 | .projects .rightborder .dishes #six .inn{
229 | height: 20px;
230 | width: 90px;
231 | background-color: white;
232 | font-size: 12px;
233 | position:absolute; top:54%;left:87.78%;
234 | text-align: center;
235 | color: black;
236 | border: black .5px solid;
237 |
238 | }
239 | .projects .rightborder .dishes #five .inn:hover{
240 | background:crimson;
241 | color: white;
242 | cursor: pointer;
243 | /* border: black .5px solid; */
244 |
245 | }
246 | .projects .rightborder .dishes #six .inn:hover{
247 | background:rgb(255, 238, 1);
248 | color: black;
249 | cursor: pointer;
250 | /* border: black .5px solid; */
251 |
252 | }
253 | .projects2 {
254 | background-color: #fff;
255 | border-left: 1px solid #e5e5e5;
256 | border-right: 1px solid #e5e5e5;
257 | /* -moz-box-shadow: 0 1px 3px #ddd;
258 | -webkit-box-shadow: 0 1px 3px #ddd;
259 | box-shadow: 0 1px 3px #ddd;
260 | -webkit-animation: bottom-in .5s ease 0s backwards;
261 | -moz-animation: bottom-in .5s ease 0s backwards;
262 | animation: bottom-in .5s ease 0s backwards; */
263 | position: absolute;
264 | top: 14%;
265 | left:20%;
266 | height:424px;
267 | /* height: 460px; */
268 | width:950px;
269 |
270 | }
271 | .projects2 .rightborder .instruct{
272 | height:25px;
273 | width:950px;
274 |
275 | position:relative;
276 | display:block;
277 | border-bottom: .5px silver solid;
278 | background-color: silver;
279 | font-size: 13px;
280 |
281 | text-align: justify;
282 | }
283 | .projects2 .rightborder .dishes{
284 | height:80px;
285 | width:950px;
286 | position:relative;
287 | display:block;
288 | border-bottom: .5px silver solid;
289 | /* background-color: silver; */
290 | font-size: 15px;
291 | text-align: center;
292 | /* padding: 0 0 0 30px; */
293 |
294 | text-align: justify;
295 | }
296 | .projects2 .rightborder .cont{
297 | height:440px;
298 | width: 950px;;
299 | /* overflow-x: hidden;
300 | overflow-y: auto; */
301 | }
302 | .projects2 .rightborder .dishes #one{
303 | height:50px;
304 | width:110px;
305 | border-left:.5px silver solid ;
306 | border-right: .5px silver solid;
307 | position:absolute; top:0;left: 14.45%;
308 | padding: 30px 0 0 0px;
309 | text-align: center;
310 | font-size: 14px;
311 | }
312 | .projects2 .rightborder .dishes #two{
313 | height:55px;
314 | width:170px;
315 | font-size: 13px;
316 | border-right: .5px silver solid;
317 | position:absolute; top:0;left: 29.45%;
318 | padding: 25px 15px 0 0px;
319 | text-align: center;
320 | }
321 |
322 | .projects2 .rightborder .dishes #three{
323 | height:50px;
324 | width:110px;
325 | font-family: Verdana,Tahoma,arial;
326 | color: #3c3c3c;
327 | font-weight: bold;
328 | font-size: 13px;
329 | border-right: .5px silver solid;
330 | position:absolute; top:0;left: 52.45%;
331 | padding: 30px 0 0 40px;
332 | /* text-align: center; */
333 | }
334 |
335 | .projects2 .rightborder .dishes #four{
336 | height:50px;
337 | width:80px;
338 | font-size: 13px;
339 | font-family: Verdana,Tahoma,arial;
340 | color: #3c3c3c;
341 | font-weight: bold;
342 | border-right: .5px silver solid;
343 | position:absolute; top:0;left: 74.45%;
344 | padding: 30px 0 0 10px;
345 | }
346 |
347 | .projects2 .rightborder .dishes #five{
348 | height:50px;
349 | width:80px;
350 |
351 |
352 | position:absolute; top:0;left: 84.45%;
353 | text-align: center;
354 | padding: 10px 0 0 30px;
355 | }
356 |
357 |
358 | .projects2 .rightborder .dishes #five .inn{
359 | height: 20px;
360 | width: 90px;
361 | background-color: white;
362 | color: black;
363 | font-size: 12px;
364 | border: black .5px solid;
365 | }
366 | .projects2 .rightborder .dishes #six .inn{
367 | height: 20px;
368 | width: 90px;
369 | background-color: white;
370 | font-size: 12px;
371 | position:absolute; top:54%;left:87.78%;
372 | text-align: center;
373 | color: black;
374 | border: black .5px solid;
375 |
376 | }
377 | .projects2 .rightborder .dishes #five .inn:hover{
378 | background:crimson;
379 | color: white;
380 | cursor: pointer;
381 | /* border: black .5px solid; */
382 |
383 | }
384 | .projects2 .rightborder .dishes #six .inn:hover{
385 | background:rgb(255, 238, 1);
386 | color: black;
387 | cursor: pointer;
388 | /* border: black .5px solid; */
389 |
390 | }
391 |
392 | button, input, optgroup, select, textarea {
393 | color: inherit;
394 | font: inherit;
395 | outline: none;
396 | }
397 |
398 | button, input, optgroup, select {
399 | vertical-align: middle;
400 | }
401 |
402 | button, select {
403 | text-transform: none;
404 | }
405 |
406 | input {
407 | line-height: normal;
408 | }
409 |
410 | button {
411 | overflow: visible;
412 | }
413 |
414 | textarea {
415 | resize: none;
416 | }
417 |
418 | button, html input[type="button"], input[type="reset"], input[type="submit"] {
419 | -webkit-appearance: button;
420 | cursor: pointer;
421 | }
422 |
423 | button[disabled], html input[disabled] {
424 | cursor: default;
425 | }
426 |
427 | button::-moz-focus-inner, input::-moz-focus-inner {
428 | border: 0;
429 | padding: 0;
430 | }
431 |
432 | input[type="checkbox"], input[type="radio"] {
433 | box-sizing: border-box;
434 | padding: 0;
435 | }
436 |
437 | input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button {
438 | height: auto;
439 | }
440 |
441 | input[type="search"] {
442 | -webkit-appearance: textfield;
443 | -moz-box-sizing: content-box;
444 | -webkit-box-sizing: content-box;
445 | box-sizing: content-box;
446 | }
447 |
448 | input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration {
449 | -webkit-appearance: none;
450 | }
451 |
452 | input::-webkit-input-placeholder,
453 | textarea::-webkit-input-placeholder {
454 | color: #C7C7C7;
455 | }
456 |
457 | input::-moz-placeholder,
458 | textarea::-moz-placeholder {
459 | color: #C7C7C7;
460 | opacity: 1;
461 | }
462 |
463 | input:-ms-input-placeholder,
464 | textarea:-ms-input-placeholder {
465 | color: #C7C7C7;
466 | }
467 |
468 | table {
469 | border-collapse: collapse;
470 | border-spacing: 0;
471 | }
472 |
473 | td, th {
474 | padding: 0;
475 | }
476 | .dialog-confirm .dialog-submit {
477 | border: none;
478 | background-color: #6f55c0;
479 | color: #fff;
480 | text-align: center;
481 | text-decoration: none; }
482 | .dialog-confirm .dialog-submit:hover {
483 | text-decoration: none;
484 | background-color: #8032f5; }
485 | .dialog-confirm .disabled.dialog-submit, .dialog-confirm .disabled.dialog-submit:hover {
486 | border: 1px solid #ddd;
487 | color: #999;
488 | background-color: #f8f8f8;
489 | cursor: not-allowed; }
490 |
491 | .dialog-confirm .dialog-cancel {
492 | border: 1px solid #ddd;
493 | color: #666;
494 | text-align: center;
495 | text-decoration: none; }
496 | .dialog-confirm .dialog-cancel:hover {
497 | color: #6f55c0;
498 | border-color: #6f55c0;
499 | text-decoration: none; }
500 | .dialog-confirm .disabled.dialog-cancel, .dialog-confirm .disabled.dialog-cancel:hover {
501 | border: 1px solid #ddd;
502 | color: #999;
503 | background-color: #f8f8f8;
504 | cursor: not-allowed; }
505 |
506 | .dialog-background {
507 | display: none;
508 | position: fixed;
509 | left: 0;
510 | top: 0;
511 | z-index: 990;
512 | width: 100%;
513 | height: 100%;
514 | padding: 0;
515 | margin: 0;
516 | background-color: rgba(0, 0, 0, 0.5);
517 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#88000000,endColorstr=#88000000); }
518 |
519 | .dialog-section {
520 | opacity: 0;
521 | filter: alpha(opacity=0);
522 | display: none;
523 | position: absolute;
524 | top: 50%;
525 | left: 50%;
526 | z-index: 999;
527 | padding: 0;
528 | margin: 0;
529 | background-color: #FFF;
530 | box-shadow: 0 0 8px rgba(0, 0, 0, 0.5); }
531 |
532 | .dialog-body,
533 | .dialog-imagelist {
534 | box-sizing: content-box;
535 | z-index: 1;
536 | min-width: 516px;
537 | height: 100%;
538 | padding: 32px;
539 | padding-top: 48px;
540 | margin: 0;
541 | overflow: hidden; }
542 | .dialog-body.withNoPadding,
543 | .dialog-imagelist.withNoPadding {
544 | padding: 0; }
545 | .dialog-body.withNoMinWidth,
546 | .dialog-imagelist.withNoMinWidth {
547 | min-width: auto;
548 | min-width: 0; }
549 |
550 | .dialog-body img {
551 | display: block;
552 | vertical-align: top; }
553 |
554 | .dialog-btnPrev,
555 | .dialog-btnNext {
556 | position: absolute; }
557 |
558 | .dialog-btnPrev,
559 | .dialog-btnNext {
560 | top: 50%;
561 | z-index: 9;
562 | margin-top: -18px;
563 | width: 36px;
564 | height: 36px;
565 | overflow: hidden;
566 | font: 16px/36px 'Simsun';
567 | text-align: center;
568 | color: #fff !important;
569 | cursor: pointer;
570 | background-color: #7F7F7F;
571 | background-color: rgba(0, 0, 0, 0.5); }
572 |
573 | .dialog-btnPrev {
574 | left: 0; }
575 |
576 | .dialog-btnNext {
577 | right: 0; }
578 |
579 | .dialog-disabled {
580 | cursor: not-allowed;
581 | background-color: rgba(0, 0, 0, 0.3);
582 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#44000000,endColorstr=#44000000); }
583 |
584 | .dialog-header {
585 | position: relative;
586 | width: auto;
587 | height: 39px;
588 | padding: 0 46px 0 16px;
589 | margin: 0;
590 | border-bottom: 1px solid #d9d9d9;
591 | font-size: 16px;
592 | line-height: 39px;
593 | white-space: nowrap;
594 | background-color: #e6e6e6; }
595 | .dialog-header + .dialog-body {
596 | padding-top: 32px; }
597 | .dialog-header + .dialog-body.withNoPadding {
598 | padding: 0; }
599 |
600 | .dialog-close {
601 | display: inline-block;
602 | vertical-align: middle;
603 | background-image: url("images/icons-dialog.png");
604 | background-repeat: no-repeat;
605 | position: absolute;
606 | right: 16px;
607 | top: 12px;
608 | width: 14px;
609 | height: 14px;
610 | padding: 0;
611 | margin: 0;
612 | background-position: 0 -135px;
613 | cursor: pointer; }
614 |
615 | #dialogTipBox .dialog-body {
616 | padding-top: 48px;
617 | padding-bottom: 48px; }
618 | #dialogTipBox .dialog-msg {
619 | padding: 0;
620 | margin: 0;
621 | text-align: center; }
622 | #dialogTipBox .dialog-msg-text {
623 | padding: 0;
624 | margin: 0;
625 | font-size: 16px; }
626 | #dialogTipBox .i-success,
627 | #dialogTipBox .i-warning,
628 | #dialogTipBox .i-error {
629 | position: relative;
630 | display: inline-block;
631 | top: -2px;
632 | margin-right: 20px;
633 | width: 36px;
634 | height: 36px;
635 | vertical-align: middle;
636 | background-image: url("images/icons-dialog.png");
637 | background-repeat: no-repeat; }
638 | #dialogTipBox .i-success {
639 | background-position: 0 0; }
640 | #dialogTipBox .i-warning {
641 | background-position: 0 -45px; }
642 | #dialogTipBox .i-error {
643 | background-position: 0 -90px; }
644 |
645 | .dialog-confirm {
646 | box-sizing: content-box;
647 | position: relative;
648 | width: 235px;
649 | min-width: 235px;
650 | font-size: 0;
651 | text-align: left;
652 | margin: 0 auto; }
653 | .dialog-confirm.withCenter {
654 | text-align: center; }
655 | .dialog-confirm.withIcon, .dialog-confirm.withIconSuccess, .dialog-confirm.withIconWarning, .dialog-confirm.withIconError {
656 | padding-left: 54px; }
657 | .dialog-confirm.withIcon:before, .dialog-confirm.withIconSuccess:before, .dialog-confirm.withIconWarning:before, .dialog-confirm.withIconError:before {
658 | content: '';
659 | display: inline-block;
660 | vertical-align: middle;
661 | background-image: url("images/icons-dialog.png");
662 | background-repeat: no-repeat;
663 | position: absolute;
664 | left: 0;
665 | top: 0;
666 | width: 36px;
667 | height: 36px;
668 | background-position: 0 -45px; }
669 | .dialog-confirm.withIconSuccess:before {
670 | background-position: 0 0; }
671 | .dialog-confirm.withIconWarning:before {
672 | background-position: 0 -45px; }
673 | .dialog-confirm.withIconError:before {
674 | background-position: 0 -90px; }
675 | .dialog-confirm .dialog-msg {
676 | padding: 0;
677 | margin: 0;
678 | font-size: 16px;
679 | line-height: 32px; }
680 | .dialog-confirm .dialog-msg + .dialog-desc {
681 | margin-top: 10px; }
682 | .dialog-confirm .dialog-desc {
683 | padding: 0;
684 | margin: 0;
685 | font-size: 12px;
686 | line-height: 24px;
687 | margin-bottom: 20px; }
688 | .dialog-confirm .dialog-content {
689 | padding: 0;
690 | margin: 0;
691 | font-size: 12px;
692 | line-height: 24px;
693 | text-align: left; }
694 | .dialog-confirm .dialog-content + .dialog-buttonBox {
695 | text-align: center; }
696 | .dialog-confirm .dialog-buttonBox {
697 | overflow: hidden;
698 | padding: 0;
699 | margin: 24px 0 0 0; }
700 | .dialog-confirm .dialog-buttonBox a {
701 | margin-left: 15px; }
702 | .dialog-confirm .dialog-buttonBox a:first-child {
703 | margin-left: 0; }
704 | .dialog-confirm .dialog-submit,
705 | .dialog-confirm .dialog-cancel {
706 | display: inline-block; }
707 | .dialog-confirm .dialog-submit {
708 | width: 98px;
709 | height: 29px;
710 | font-size: 12px;
711 | line-height: 29px; }
712 | .dialog-confirm .dialog-cancel {
713 | box-sizing: content-box;
714 | width: 96px;
715 | height: 27px;
716 | font-size: 12px;
717 | line-height: 27px; }
718 |
719 | .dialog-success-top {
720 | position: fixed;
721 | left: 50%;
722 | top: 0;
723 | z-index: 999;
724 | min-width: 400px;
725 | padding: 0;
726 | margin: 0;
727 | border-radius: 5px;
728 | border-top-left-radius: 0;
729 | border-top-right-radius: 0;
730 | font-size: 16px;
731 | line-height: 46px;
732 | text-align: center;
733 | color: #fff;
734 | background-color: #4aac42; }
735 | .dialog-success-top .i-icon {
736 | position: relative;
737 | display: inline-block;
738 | vertical-align: middle;
739 | width: 26px;
740 | height: 18px;
741 | margin-right: 15px;
742 | background: url("images/icons-dialog.png") no-repeat 0 -180px; }
743 |
744 | .dialog-warning-top {
745 | position: fixed;
746 | left: 50%;
747 | top: 0;
748 | z-index: 999;
749 | min-width: 400px;
750 | padding: 0;
751 | margin: 0;
752 | border-radius: 5px;
753 | border-top-left-radius: 0;
754 | border-top-right-radius: 0;
755 | font-size: 16px;
756 | line-height: 46px;
757 | text-align: center;
758 | color: #fff;
759 | background-color: #ff4400; }
760 |
--------------------------------------------------------------------------------
/js/universial.js:
--------------------------------------------------------------------------------
1 | $('#six *').click(function() {
2 | $.sendConfirm({
3 | title: '请您对该菜品进行评价',
4 | content: '
' + '
' + '
* 评价等级(1-5):
' + '
' + '
' + '
' + '
' + '
* 给该菜品提出意见:
' + '
' + '
' + '
' + '
' + '
* 给本食堂评价:
' + '
' + '
' + '
' + '
',
5 | button: {
6 | confirm: '确认',
7 | cancel: '取消'
8 | },
9 | width: 260,
10 | onBeforeConfirm: function() {
11 | // onBeforeConfirm返回false,将阻止onConfirm的执行
12 | $.sendMsg('评价成功,感谢您的建议', 3000, function() {
13 | console.log('sendMsg closed');
14 |
15 | });
16 | return false;
17 | },
18 | onConfirm: function() {
19 | $.sendMsg('评价成功,感谢您的建议', 3000, function() {
20 | console.log('sendMsg closed');
21 |
22 | });
23 | },
24 | onCancel: function() {
25 | $.sendMsg('抱歉亲,这次评价不成功哦。', 3000, function() {
26 | console.log('sendMsg closed');
27 |
28 | });
29 | },
30 | onClose: function() {
31 | $.sendMsg('抱歉亲,这次评价不成功哦。', 3000, function() {
32 | console.log('sendMsg closed');
33 |
34 | });
35 | }
36 | });
37 | });
38 | $('#order1').click(function() {
39 | $.sendConfirm({
40 | withCenter: true,
41 | title: '点餐交易确认',
42 | msg: '您确定要点此菜品吗?',
43 | button: {
44 | confirm: '确认',
45 | cancel: '取消',
46 | cancelFirst: true
47 | },
48 | onConfirm: function() {
49 |
50 | $.sendMsg('点菜成功,菜品已加入购物车', 3000, function() {
51 | // 第一种
52 |
53 | console.log('sendMsg closed');
54 | var span = $('#first').html();
55 |
56 | var picname=span.split("\n")[1].split("src")[1].slice(2,8);
57 | var dishname=span.split("\n")[2].split(">")[1].split("<")[0].replace(/(^\s+)|(\s+$)/g,"");
58 | var dishdisc=span.split("\n")[3].split(">")[1].split("<")[0];
59 | var dishprice=span.split("\n")[4].split(">")[1].split("<")[0];
60 | var dishnum=span.split("\n")[5].split(">")[1].split("<")[0];
61 | var db = openDatabase('dishes', '1.0', '点餐数据库', 30*1024*1024);
62 | var msg;
63 | addData(picname, dishname, dishdisc,dishprice,dishnum);
64 | function addData(picname, dishname, dishdisc,dishprice,dishnum) {
65 | db.transaction(function(tx) {
66 | tx.executeSql("CREATE TABLE IF NOT EXISTS MsgDate(picname TEXT,dishname TEXT,dishdisc TEXT,disprice TEXT,dishnum TEXT)", []);
67 | tx.executeSql("INSERT INTO MsgDate VALUES (?,?,?,?,?)", [picname, dishname, dishdisc,dishprice,dishnum], function(tx, rs) {
68 |
69 | },
70 | function(tx, error) {
71 | alert(error.source + "::" + error.message);
72 | }
73 | )
74 | })
75 | }
76 | });
77 | },
78 | onCancel: function() {
79 |
80 | $.sendMsg('点菜失败', 3000, function() {
81 | console.log('sendMsg closed');
82 |
83 | });
84 | },
85 | onClose: function() {
86 |
87 | $.sendMsg('点菜失败', 3000, function() {
88 | console.log('sendMsg closed');
89 |
90 | });
91 | console.log('点击关闭!');
92 | }
93 | });
94 | });
95 | $('#order2').click(function() {
96 | $.sendConfirm({
97 | withCenter: true,
98 | title: '点餐交易确认',
99 | msg: '您确定要点此菜品吗?',
100 | button: {
101 | confirm: '确认',
102 | cancel: '取消',
103 | cancelFirst: true
104 | },
105 | onConfirm: function() {
106 |
107 | $.sendMsg('点菜成功,菜品已加入购物车!', 3000, function() {
108 | console.log('sendMsg closed');
109 | console.log('sendMsg closed');
110 | var span = $('#second').html();
111 |
112 | var picname=span.split("\n")[1].split("src")[1].slice(2,8);
113 | var dishname=span.split("\n")[2].split(">")[1].split("<")[0].replace(/(^\s+)|(\s+$)/g,"");
114 | var dishdisc=span.split("\n")[3].split(">")[1].split("<")[0];
115 | var dishprice=span.split("\n")[4].split(">")[1].split("<")[0];
116 | var dishnum=span.split("\n")[5].split(">")[1].split("<")[0];
117 | var db = openDatabase('dishes', '1.0', '点餐数据库', 30*1024*1024);
118 | var msg;
119 | addData(picname, dishname, dishdisc,dishprice,dishnum);
120 | function addData(picname, dishname, dishdisc,dishprice,dishnum) {
121 | db.transaction(function(tx) {
122 | tx.executeSql("CREATE TABLE IF NOT EXISTS MsgDate(picname TEXT,dishname TEXT,dishdisc TEXT,disprice TEXT,dishnum TEXT)", []);
123 | tx.executeSql("INSERT INTO MsgDate VALUES (?,?,?,?,?)", [picname, dishname, dishdisc,dishprice,dishnum], function(tx, rs) {
124 |
125 | },
126 | function(tx, error) {
127 | alert(error.source + "::" + error.message);
128 | }
129 | )
130 | })
131 | }
132 |
133 | });
134 | },
135 | onCancel: function() {
136 |
137 | $.sendMsg('点菜失败', 3000, function() {
138 | console.log('sendMsg closed');
139 |
140 | });
141 | },
142 | onClose: function() {
143 |
144 | $.sendMsg('点菜失败', 3000, function() {
145 | console.log('sendMsg closed');
146 |
147 | });
148 | console.log('点击关闭!');
149 | }
150 | });
151 | });
152 | $('#order3').click(function() {
153 | $.sendConfirm({
154 | withCenter: true,
155 | title: '点餐交易确认',
156 | msg: '您确定要点此菜品吗?',
157 | button: {
158 | confirm: '确认',
159 | cancel: '取消',
160 | cancelFirst: true
161 | },
162 | onConfirm: function() {
163 |
164 | $.sendMsg('点菜成功,菜品已加入购物车!', 3000, function() {
165 | console.log('sendMsg closed');
166 | var span = $('#third').html();
167 |
168 | var picname=span.split("\n")[1].split("src")[1].slice(2,8);
169 | var dishname=span.split("\n")[2].split(">")[1].split("<")[0].replace(/(^\s+)|(\s+$)/g,"");
170 | var dishdisc=span.split("\n")[3].split(">")[1].split("<")[0];
171 | var dishprice=span.split("\n")[4].split(">")[1].split("<")[0];
172 | var dishnum=span.split("\n")[5].split(">")[1].split("<")[0];
173 | var db = openDatabase('dishes', '1.0', '点餐数据库', 30*1024*1024);
174 | var msg;
175 | addData(picname, dishname, dishdisc,dishprice,dishnum);
176 | function addData(picname, dishname, dishdisc,dishprice,dishnum) {
177 | db.transaction(function(tx) {
178 | tx.executeSql("CREATE TABLE IF NOT EXISTS MsgDate(picname TEXT,dishname TEXT,dishdisc TEXT,disprice TEXT,dishnum TEXT)", []);
179 | tx.executeSql("INSERT INTO MsgDate VALUES (?,?,?,?,?)", [picname, dishname, dishdisc,dishprice,dishnum], function(tx, rs) {
180 |
181 | },
182 | function(tx, error) {
183 | alert(error.source + "::" + error.message);
184 | }
185 | )
186 | })
187 | }
188 |
189 | });
190 | },
191 | onCancel: function() {
192 |
193 | $.sendMsg('点菜失败', 3000, function() {
194 | console.log('sendMsg closed');
195 |
196 | });
197 | },
198 | onClose: function() {
199 |
200 | $.sendMsg('点菜失败', 3000, function() {
201 | console.log('sendMsg closed');
202 |
203 | });
204 | console.log('点击关闭!');
205 | }
206 | });
207 | });
208 | $('#order4').click(function() {
209 | $.sendConfirm({
210 | withCenter: true,
211 | title: '点餐交易确认',
212 | msg: '您确定要点此菜品吗?',
213 | button: {
214 | confirm: '确认',
215 | cancel: '取消',
216 | cancelFirst: true
217 | },
218 | onConfirm: function() {
219 |
220 | $.sendMsg('点菜成功,菜品已加入购物车!', 3000, function() {
221 | console.log('sendMsg closed');
222 | var span = $('#fourth').html();
223 |
224 | var picname=span.split("\n")[1].split("src")[1].slice(2,8);
225 | var dishname=span.split("\n")[2].split(">")[1].split("<")[0].replace(/(^\s+)|(\s+$)/g,"");
226 | var dishdisc=span.split("\n")[3].split(">")[1].split("<")[0];
227 | var dishprice=span.split("\n")[4].split(">")[1].split("<")[0];
228 | var dishnum=span.split("\n")[5].split(">")[1].split("<")[0];
229 | var db = openDatabase('dishes', '1.0', '点餐数据库', 30*1024*1024);
230 | var msg;
231 | addData(picname, dishname, dishdisc,dishprice,dishnum);
232 | function addData(picname, dishname, dishdisc,dishprice,dishnum) {
233 | db.transaction(function(tx) {
234 | tx.executeSql("CREATE TABLE IF NOT EXISTS MsgDate(picname TEXT,dishname TEXT,dishdisc TEXT,disprice TEXT,dishnum TEXT)", []);
235 | tx.executeSql("INSERT INTO MsgDate VALUES (?,?,?,?,?)", [picname, dishname, dishdisc,dishprice,dishnum], function(tx, rs) {
236 |
237 | },
238 | function(tx, error) {
239 | alert(error.source + "::" + error.message);
240 | }
241 | )
242 | })
243 | }
244 |
245 | });
246 | },
247 | onCancel: function() {
248 |
249 | $.sendMsg('点菜失败', 3000, function() {
250 | console.log('sendMsg closed');
251 |
252 | });
253 | },
254 | onClose: function() {
255 |
256 | $.sendMsg('点菜失败', 3000, function() {
257 | console.log('sendMsg closed');
258 |
259 | });
260 | console.log('点击关闭!');
261 | }
262 | });
263 | });
264 | $('#order5').click(function() {
265 | $.sendConfirm({
266 | withCenter: true,
267 | title: '点餐交易确认',
268 | msg: '您确定要点此菜品吗?',
269 | button: {
270 | confirm: '确认',
271 | cancel: '取消',
272 | cancelFirst: true
273 | },
274 | onConfirm: function() {
275 |
276 | $.sendMsg('点菜成功,菜品已加入购物车!', 3000, function() {
277 | console.log('sendMsg closed');
278 | var span = $('#fifth').html();
279 |
280 | var picname=span.split("\n")[1].split("src")[1].slice(2,8);
281 | var dishname=span.split("\n")[2].split(">")[1].split("<")[0].replace(/(^\s+)|(\s+$)/g,"");
282 | var dishdisc=span.split("\n")[3].split(">")[1].split("<")[0];
283 | var dishprice=span.split("\n")[4].split(">")[1].split("<")[0];
284 | var dishnum=span.split("\n")[5].split(">")[1].split("<")[0];
285 | var db = openDatabase('dishes', '1.0', '点餐数据库', 30*1024*1024);
286 | var msg;
287 | addData(picname, dishname, dishdisc,dishprice,dishnum);
288 | function addData(picname, dishname, dishdisc,dishprice,dishnum) {
289 | db.transaction(function(tx) {
290 | tx.executeSql("CREATE TABLE IF NOT EXISTS MsgDate(picname TEXT,dishname TEXT,dishdisc TEXT,disprice TEXT,dishnum TEXT)", []);
291 | tx.executeSql("INSERT INTO MsgDate VALUES (?,?,?,?,?)", [picname, dishname, dishdisc,dishprice,dishnum], function(tx, rs) {
292 |
293 | },
294 | function(tx, error) {
295 | alert(error.source + "::" + error.message);
296 | }
297 | )
298 | })
299 | }
300 |
301 | });
302 | },
303 | onCancel: function() {
304 |
305 | $.sendMsg('点菜失败', 3000, function() {
306 | console.log('sendMsg closed');
307 |
308 | });
309 | },
310 | onClose: function() {
311 |
312 | $.sendMsg('点菜失败', 3000, function() {
313 | console.log('sendMsg closed');
314 |
315 | });
316 | console.log('点击关闭!');
317 | }
318 | });
319 | });
320 | $('#order6').click(function() {
321 | $.sendConfirm({
322 | withCenter: true,
323 | title: '点餐交易确认',
324 | msg: '您确定要点此菜品吗?',
325 | button: {
326 | confirm: '确认',
327 | cancel: '取消',
328 | cancelFirst: true
329 | },
330 | onConfirm: function() {
331 |
332 | $.sendMsg('点菜成功,菜品已加入购物车', 3000, function() {
333 | // 第一种
334 |
335 | console.log('sendMsg closed');
336 | var span = $('#sixth').html();
337 |
338 | var picname=span.split("\n")[1].split("src")[1].slice(2,8);
339 | var dishname=span.split("\n")[2].split(">")[1].split("<")[0].replace(/(^\s+)|(\s+$)/g,"");
340 | var dishdisc=span.split("\n")[3].split(">")[1].split("<")[0];
341 | var dishprice=span.split("\n")[4].split(">")[1].split("<")[0];
342 | var dishnum=span.split("\n")[5].split(">")[1].split("<")[0];
343 | var db = openDatabase('dishes', '1.0', '点餐数据库', 30*1024*1024);
344 | var msg;
345 | addData(picname, dishname, dishdisc,dishprice,dishnum);
346 | function addData(picname, dishname, dishdisc,dishprice,dishnum) {
347 | db.transaction(function(tx) {
348 | tx.executeSql("CREATE TABLE IF NOT EXISTS MsgDate(picname TEXT,dishname TEXT,dishdisc TEXT,disprice TEXT,dishnum TEXT)", []);
349 | tx.executeSql("INSERT INTO MsgDate VALUES (?,?,?,?,?)", [picname, dishname, dishdisc,dishprice,dishnum], function(tx, rs) {
350 |
351 | },
352 | function(tx, error) {
353 | alert(error.source + "::" + error.message);
354 | }
355 | )
356 | })
357 | }
358 | });
359 | },
360 | onCancel: function() {
361 |
362 | $.sendMsg('点菜失败', 3000, function() {
363 | console.log('sendMsg closed');
364 |
365 | });
366 | },
367 | onClose: function() {
368 |
369 | $.sendMsg('点菜失败', 3000, function() {
370 | console.log('sendMsg closed');
371 |
372 | });
373 | console.log('点击关闭!');
374 | }
375 | });
376 | });
377 | $('#order7').click(function() {
378 | $.sendConfirm({
379 | withCenter: true,
380 | title: '点餐交易确认',
381 | msg: '您确定要点此菜品吗?',
382 | button: {
383 | confirm: '确认',
384 | cancel: '取消',
385 | cancelFirst: true
386 | },
387 | onConfirm: function() {
388 |
389 | $.sendMsg('点菜成功,菜品已加入购物车!', 3000, function() {
390 | console.log('sendMsg closed');
391 | console.log('sendMsg closed');
392 | var span = $('#seventh').html();
393 |
394 | var picname=span.split("\n")[1].split("src")[1].slice(2,8);
395 | var dishname=span.split("\n")[2].split(">")[1].split("<")[0].replace(/(^\s+)|(\s+$)/g,"");
396 | var dishdisc=span.split("\n")[3].split(">")[1].split("<")[0];
397 | var dishprice=span.split("\n")[4].split(">")[1].split("<")[0];
398 | var dishnum=span.split("\n")[5].split(">")[1].split("<")[0];
399 | var db = openDatabase('dishes', '1.0', '点餐数据库', 30*1024*1024);
400 | var msg;
401 | addData(picname, dishname, dishdisc,dishprice,dishnum);
402 | function addData(picname, dishname, dishdisc,dishprice,dishnum) {
403 | db.transaction(function(tx) {
404 | tx.executeSql("CREATE TABLE IF NOT EXISTS MsgDate(picname TEXT,dishname TEXT,dishdisc TEXT,disprice TEXT,dishnum TEXT)", []);
405 | tx.executeSql("INSERT INTO MsgDate VALUES (?,?,?,?,?)", [picname, dishname, dishdisc,dishprice,dishnum], function(tx, rs) {
406 |
407 | },
408 | function(tx, error) {
409 | alert(error.source + "::" + error.message);
410 | }
411 | )
412 | })
413 | }
414 |
415 | });
416 | },
417 | onCancel: function() {
418 |
419 | $.sendMsg('点菜失败', 3000, function() {
420 | console.log('sendMsg closed');
421 |
422 | });
423 | },
424 | onClose: function() {
425 |
426 | $.sendMsg('点菜失败', 3000, function() {
427 | console.log('sendMsg closed');
428 |
429 | });
430 | console.log('点击关闭!');
431 | }
432 | });
433 | });
434 | $('#order8').click(function() {
435 | $.sendConfirm({
436 | withCenter: true,
437 | title: '点餐交易确认',
438 | msg: '您确定要点此菜品吗?',
439 | button: {
440 | confirm: '确认',
441 | cancel: '取消',
442 | cancelFirst: true
443 | },
444 | onConfirm: function() {
445 |
446 | $.sendMsg('点菜成功,菜品已加入购物车!', 3000, function() {
447 | console.log('sendMsg closed');
448 | var span = $('#eighth').html();
449 |
450 | var picname=span.split("\n")[1].split("src")[1].slice(2,8);
451 | var dishname=span.split("\n")[2].split(">")[1].split("<")[0].replace(/(^\s+)|(\s+$)/g,"");
452 | var dishdisc=span.split("\n")[3].split(">")[1].split("<")[0];
453 | var dishprice=span.split("\n")[4].split(">")[1].split("<")[0];
454 | var dishnum=span.split("\n")[5].split(">")[1].split("<")[0];
455 | var db = openDatabase('dishes', '1.0', '点餐数据库', 30*1024*1024);
456 | var msg;
457 | addData(picname, dishname, dishdisc,dishprice,dishnum);
458 | function addData(picname, dishname, dishdisc,dishprice,dishnum) {
459 | db.transaction(function(tx) {
460 | tx.executeSql("CREATE TABLE IF NOT EXISTS MsgDate(picname TEXT,dishname TEXT,dishdisc TEXT,disprice TEXT,dishnum TEXT)", []);
461 | tx.executeSql("INSERT INTO MsgDate VALUES (?,?,?,?,?)", [picname, dishname, dishdisc,dishprice,dishnum], function(tx, rs) {
462 |
463 | },
464 | function(tx, error) {
465 | alert(error.source + "::" + error.message);
466 | }
467 | )
468 | })
469 | }
470 |
471 | });
472 | },
473 | onCancel: function() {
474 |
475 | $.sendMsg('点菜失败', 3000, function() {
476 | console.log('sendMsg closed');
477 |
478 | });
479 | },
480 | onClose: function() {
481 |
482 | $.sendMsg('点菜失败', 3000, function() {
483 | console.log('sendMsg closed');
484 |
485 | });
486 | console.log('点击关闭!');
487 | }
488 | });
489 | });
490 | $('#order9').click(function() {
491 | $.sendConfirm({
492 | withCenter: true,
493 | title: '点餐交易确认',
494 | msg: '您确定要点此菜品吗?',
495 | button: {
496 | confirm: '确认',
497 | cancel: '取消',
498 | cancelFirst: true
499 | },
500 | onConfirm: function() {
501 |
502 | $.sendMsg('点菜成功,菜品已加入购物车!', 3000, function() {
503 | console.log('sendMsg closed');
504 | var span = $('#ninth').html();
505 |
506 | var picname=span.split("\n")[1].split("src")[1].slice(2,8);
507 | var dishname=span.split("\n")[2].split(">")[1].split("<")[0].replace(/(^\s+)|(\s+$)/g,"");
508 | var dishdisc=span.split("\n")[3].split(">")[1].split("<")[0];
509 | var dishprice=span.split("\n")[4].split(">")[1].split("<")[0];
510 | var dishnum=span.split("\n")[5].split(">")[1].split("<")[0];
511 | var db = openDatabase('dishes', '1.0', '点餐数据库', 30*1024*1024);
512 | var msg;
513 | addData(picname, dishname, dishdisc,dishprice,dishnum);
514 | function addData(picname, dishname, dishdisc,dishprice,dishnum) {
515 | db.transaction(function(tx) {
516 | tx.executeSql("CREATE TABLE IF NOT EXISTS MsgDate(picname TEXT,dishname TEXT,dishdisc TEXT,disprice TEXT,dishnum TEXT)", []);
517 | tx.executeSql("INSERT INTO MsgDate VALUES (?,?,?,?,?)", [picname, dishname, dishdisc,dishprice,dishnum], function(tx, rs) {
518 |
519 | },
520 | function(tx, error) {
521 | alert(error.source + "::" + error.message);
522 | }
523 | )
524 | })
525 | }
526 |
527 | });
528 | },
529 | onCancel: function() {
530 |
531 | $.sendMsg('点菜失败', 3000, function() {
532 | console.log('sendMsg closed');
533 |
534 | });
535 | },
536 | onClose: function() {
537 |
538 | $.sendMsg('点菜失败', 3000, function() {
539 | console.log('sendMsg closed');
540 |
541 | });
542 | console.log('点击关闭!');
543 | }
544 | });
545 | });
546 | $('#order10').click(function() {
547 | $.sendConfirm({
548 | withCenter: true,
549 | title: '点餐交易确认',
550 | msg: '您确定要点此菜品吗?',
551 | button: {
552 | confirm: '确认',
553 | cancel: '取消',
554 | cancelFirst: true
555 | },
556 | onConfirm: function() {
557 |
558 | $.sendMsg('点菜成功,菜品已加入购物车!', 3000, function() {
559 | console.log('sendMsg closed');
560 | var span = $('#tenth').html();
561 |
562 | var picname=span.split("\n")[1].split("src")[1].slice(2,8);
563 | var dishname=span.split("\n")[2].split(">")[1].split("<")[0].replace(/(^\s+)|(\s+$)/g,"");
564 | var dishdisc=span.split("\n")[3].split(">")[1].split("<")[0];
565 | var dishprice=span.split("\n")[4].split(">")[1].split("<")[0];
566 | var dishnum=span.split("\n")[5].split(">")[1].split("<")[0];
567 | var db = openDatabase('dishes', '1.0', '点餐数据库', 30*1024*1024);
568 | var msg;
569 | addData(picname, dishname, dishdisc,dishprice,dishnum);
570 | function addData(picname, dishname, dishdisc,dishprice,dishnum) {
571 | db.transaction(function(tx) {
572 | tx.executeSql("CREATE TABLE IF NOT EXISTS MsgDate(picname TEXT,dishname TEXT,dishdisc TEXT,disprice TEXT,dishnum TEXT)", []);
573 | tx.executeSql("INSERT INTO MsgDate VALUES (?,?,?,?,?)", [picname, dishname, dishdisc,dishprice,dishnum], function(tx, rs) {
574 |
575 | },
576 | function(tx, error) {
577 | alert(error.source + "::" + error.message);
578 | }
579 | )
580 | })
581 | }
582 |
583 | });
584 | },
585 | onCancel: function() {
586 |
587 | $.sendMsg('点菜失败', 3000, function() {
588 | console.log('sendMsg closed');
589 |
590 | });
591 | },
592 | onClose: function() {
593 |
594 | $.sendMsg('点菜失败', 3000, function() {
595 | console.log('sendMsg closed');
596 |
597 | });
598 | console.log('点击关闭!');
599 | }
600 | });
601 | });
--------------------------------------------------------------------------------
/js/jquery.dialog.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @file 基于jQuery的弹窗组件
3 | * @author 龙泉
4 | * @version 1.0.0
5 | */
6 | (function(factory) {
7 | if (typeof define === 'function' && define.amd) {
8 | // AMD module
9 | define(['jquery'], factory);
10 | } else if (typeof module !== "undefined" && module.exports) {
11 | // Node/CommonJS
12 | // Seajs build
13 | factory(require('jquery'));
14 | } else {
15 | // 浏览器全局模式
16 | factory(jQuery);
17 | }
18 | })(function($) {
19 | var closeClass = '.j_dialogClose';
20 |
21 | // 默认参数配置
22 | var dialogDef = {
23 | id: '', // 如果页面中存在多个样式的弹窗,可用ID区别样式
24 | title: 'Title',
25 | isFixed: true,
26 | hideHeader: false,
27 | hideClose: false,
28 | content: null,
29 | callback: null,
30 | withNoPadding: false, // 是否不设置padding
31 | withNoMinWidth: false, // 是否不设置最小宽度
32 | bgHide: true, // 点击背景是否隐藏
33 | escHide: true // 按ESC按键是否隐藏
34 | };
35 |
36 | // 全局变量
37 | var dialogConfig = {
38 | windows: $(window),
39 | lightbox: '.dialog-background',
40 | section: '.dialog-section',
41 | imageTag: '.dialog-imageitem',
42 | imageData: {},
43 | width: 0,
44 | height: 0,
45 | left: 0,
46 | top: 0,
47 | paddingWidth: 0,
48 | paddingHeight: 0,
49 | resizeParams: ['.dialog-section']
50 | };
51 |
52 | // 用户传递过来的参数集
53 | var dialogOpts = {};
54 |
55 | // 基础实现
56 | var Dialog = {
57 | /**
58 | * 显示dialog弹窗
59 | * @param {Object} opts 配置选项
60 | * @return {undefined}
61 | */
62 | show: function(opts) {
63 | dialogOpts = $.extend({}, dialogDef, opts || {});
64 |
65 | if (opts.content) {
66 | Dialog.dialog(opts);
67 | } else {
68 | Dialog.lightbox(opts);
69 | }
70 |
71 | // 初始化时执行的回调函数
72 | typeof dialogOpts.onInit === 'function' && dialogOpts.onInit();
73 |
74 | // 改变浏览器大小时,动态改变内容显示盒子的位置
75 | dialogConfig.windows.on('resize', function() {
76 | Dialog.settings.apply(window, dialogConfig.resizeParams);
77 | });
78 | },
79 |
80 | /**
81 | * 关闭dialog弹窗
82 | * @param {Function} callback 回调函数
83 | * @return {undefined}
84 | */
85 | hide: function(callback) {
86 | var oLightBox = $(dialogConfig.lightbox);
87 | var oSection = $(dialogConfig.section);
88 |
89 | if (dialogOpts.isFixed) {
90 | oSection.animate({
91 | marginTop: -(dialogConfig.top - 150),
92 | opacity: 0
93 | });
94 | } else {
95 | oSection.animate({
96 | top: (dialogConfig.top + 150),
97 | opacity: 0
98 | });
99 | }
100 |
101 | oLightBox.fadeOut(function() {
102 | oLightBox.remove();
103 | oSection.remove();
104 | callback && callback();
105 | });
106 | },
107 |
108 | dialog: function(opts) {
109 | Dialog.install(opts);
110 | dialogConfig.resizeParams = [dialogConfig.section, true, true];
111 | Dialog.settings.apply(window, dialogConfig.resizeParams);
112 | },
113 |
114 | lightbox: function(opts) {
115 | var clickObj_src = opts.clickObj.attr('data-src') || opts.clickObj.attr('data-image');
116 | dialogConfig.now = 0;
117 | Dialog.getImages_src(dialogOpts.imagelist);
118 | Dialog.loadImage(clickObj_src, true, Dialog.settings);
119 | Dialog.getNow(clickObj_src);
120 | },
121 |
122 | install: function(opts) {
123 | var oBody = $('body');
124 | var headerHtml = '';
125 | var closeHtml = '';
126 | var markId = '';
127 | var addClass = '';
128 | var $background = oBody.find(dialogConfig.lightbox);
129 |
130 | if (!dialogOpts.content) {
131 | var content = '' + '
![]()
' + '
' + ' ' + '<' + '>';
132 | } else {
133 | var content = dialogOpts.content;
134 | }
135 |
136 | if (dialogOpts.hideHeader) {
137 | headerHtml = '';
138 | }
139 |
140 | if (dialogOpts.hideClose) {
141 | closeHtml = '';
142 | }
143 |
144 | if (dialogOpts.id) {
145 | markId = ' id="' + dialogOpts.id + '"';
146 | }
147 |
148 | var plugs_lightbox = '';
149 | var plugs_lightbox_section = '' + headerHtml + '
' + content + '
' + closeHtml + '
';
150 |
151 | // 如果之前有打开弹窗,先将其关闭
152 | if ($background.length) {
153 | $background.stop().fadeIn();
154 | oBody.find(dialogConfig.section).remove();
155 | } else {
156 | oBody.append(plugs_lightbox)
157 | }
158 |
159 | oBody.append(plugs_lightbox_section);
160 | $(dialogConfig.lightbox).fadeIn();
161 | $(dialogConfig.section).show();
162 |
163 | var iPaddingWidth = $(dialogConfig.section).outerWidth() - $(dialogConfig.section).width();
164 | var iPaddingHeight = $(dialogConfig.section).outerHeight() - $(dialogConfig.section).height();
165 |
166 | dialogConfig.paddingWidth = iPaddingWidth;
167 | dialogConfig.paddingHeight = iPaddingHeight;
168 | dialogOpts.callback && dialogOpts.callback();
169 | },
170 |
171 | getNow: function(loadImage_src) {
172 | for (var i = 0, len = dialogConfig.images.length; i < len; i++) {
173 | if (loadImage_src === dialogConfig.images[i]) {
174 | dialogConfig.now = i;
175 | }
176 | }
177 | },
178 |
179 | getImages_src: function(images) {
180 | var images = (typeof images == 'string') ? $(images) : images;
181 | dialogConfig.images = [];
182 |
183 | for (var i = 0, len = images.length; i < len; i++) {
184 | var currentImage = images.eq(i);
185 | var currentImage_src = currentImage.attr('data-src') || currentImage.attr('data-image');
186 | var currentImage_src = $.trim(currentImage_src);
187 | if (currentImage_src !== '') {
188 | dialogConfig.images.push(currentImage_src);
189 | }
190 | }
191 | },
192 |
193 | loadImage: function(loadImage_src, isMove, callback) {
194 | var image = new Image();
195 | image.onload = function() {
196 | if ($('.dialog-section').length === 0) {
197 | Dialog.install(dialogOpts);
198 | $('.dialog-btnPrev').on('click', function() {
199 | Dialog.switchImage(false, false);
200 | });
201 | $('.dialog-btnNext').on('click', function() {
202 | Dialog.switchImage(true, false);
203 | });
204 | }
205 |
206 | Dialog.setBtnSate();
207 |
208 | var section = $(dialogConfig.section);
209 | var imageTag = $(dialogConfig.imageTag);
210 |
211 | dialogConfig.imageData = {
212 | width: this.width,
213 | height: this.height,
214 | src: loadImage_src
215 | };
216 |
217 | dialogConfig.resizeParams = [section, imageTag, isMove];
218 | callback && callback.apply(window, dialogConfig.resizeParams);
219 | }
220 | image.src = loadImage_src;
221 | },
222 |
223 | switchImage: function(d, isMove) {
224 | if (d) {
225 | dialogConfig.now++;
226 | } else {
227 | dialogConfig.now--;
228 | }
229 |
230 | if (dialogConfig.now < 0) {
231 | dialogConfig.now = dialogConfig.images.length - 1;
232 | }
233 |
234 | if (dialogConfig.now > dialogConfig.images.length - 1) {
235 | dialogConfig.now = 0;
236 | }
237 |
238 | var loadImage_src = dialogConfig.images[dialogConfig.now];
239 | Dialog.loadImage(loadImage_src, isMove, Dialog.settings);
240 | },
241 |
242 | setBtnSate: function() {
243 | if (dialogConfig.images.length < 2) {
244 | $('.dialog-btnPrev, .dialog-btnNext').hide();
245 | }
246 | },
247 |
248 | // 设置内容显示盒子的大小,位置
249 | settings: function(section, imageTag, isMove) {
250 | var section = (typeof section == 'string') ? $(section) : section;
251 | var winHeight = $(window).height();
252 |
253 | if (!dialogOpts.content) {
254 | var sectionHeight = 116, // 外围容器默认的高度,为了方便,这里暂时使用固定值,后期改版再做调整
255 | configWidth = dialogConfig.imageData.width,
256 | configHeight = dialogConfig.imageData.height;
257 | dialogConfig.width = configWidth;
258 | dialogConfig.height = configHeight;
259 | if (sectionHeight + dialogConfig.height > winHeight) {
260 | dialogConfig.height = winHeight - sectionHeight - 50;
261 | dialogConfig.height = dialogConfig.height < 500 ? 500 : dialogConfig.height;
262 | dialogConfig.width = Math.round(dialogConfig.width * (dialogConfig.height / configHeight));
263 | }
264 | } else {
265 | section.css({
266 | left: '0px'
267 | }); // 固定布局时,容器的left应该为0,样式文件不好修改,暂时在这里调整
268 | dialogConfig.width = section.width();
269 | dialogConfig.height = section.height();
270 | }
271 |
272 | var outerWidth = dialogConfig.width + dialogConfig.paddingWidth;
273 | var outerHeight = dialogConfig.height + dialogConfig.paddingHeight + $('.dialog-header').outerHeight();
274 |
275 | if (typeof imageTag === 'object') {
276 | imageTag.hide().attr('src', dialogConfig.imageData.src).css({
277 | width: dialogConfig.width,
278 | height: dialogConfig.height
279 | }).fadeIn();
280 | }
281 |
282 | if (dialogOpts.isFixed) {
283 | dialogConfig.left = Math.floor(outerWidth / 2);
284 | dialogConfig.top = Math.floor(outerHeight / 2);
285 | section.css({
286 | position: 'fixed',
287 | left: '50%'
288 | });
289 |
290 | if (isMove) {
291 | section.css({
292 | marginLeft: -dialogConfig.left,
293 | marginTop: -dialogConfig.top
294 | });
295 | } else {
296 | section.animate({
297 | marginLeft: -dialogConfig.left,
298 | marginTop: -dialogConfig.top
299 | }, {
300 | queue: false
301 | });
302 | }
303 | } else {
304 | var scrollLeft = dialogConfig.windows.scrollLeft();
305 | var scrollTop = dialogConfig.windows.scrollTop();
306 | var windowWidth = $(dialogConfig.lightbox).width();
307 |
308 | dialogConfig.left = Math.floor((windowWidth - outerWidth) / 2) + scrollLeft;
309 | dialogConfig.top = Math.floor((winHeight - outerHeight) / 2) + scrollTop;
310 | section.css({
311 | position: 'absolute',
312 | marginLeft: 0,
313 | marginTop: 0
314 | });
315 |
316 | if (isMove) {
317 | section.css({
318 | left: dialogConfig.left,
319 | top: dialogConfig.top
320 | });
321 | } else {
322 | section.animate({
323 | left: dialogConfig.left,
324 | top: dialogConfig.top
325 | }, {
326 | queue: false
327 | });
328 | }
329 | }
330 |
331 | if (imageTag) {
332 | Dialog.move(section, isMove);
333 | }
334 | },
335 |
336 | // 显示时的动画效果
337 | move: function(section, isMove) {
338 | if (dialogOpts.isFixed && isMove) {
339 | section.css({
340 | marginTop: -(dialogConfig.top - 150)
341 | }).animate({
342 | marginTop: -dialogConfig.top,
343 | opacity: 1
344 | }, function() {
345 | section.css('overflow', 'visible');
346 | });
347 | } else if (isMove) {
348 | section.css({
349 | top: (dialogConfig.top + 150)
350 | }).animate({
351 | top: dialogConfig.top,
352 | opacity: 1
353 | }, function() {
354 | section.css('overflow', 'visible');
355 | });
356 | }
357 |
358 | section.animate({
359 | width: dialogConfig.width
360 | }, {
361 | queue: false
362 | });
363 | },
364 |
365 | // 取消默认事件
366 | cancelDefault: function(e) {
367 | e.preventDefault();
368 | e.stopPropagation();
369 | }
370 | };
371 |
372 | // 弹窗类公共处理函数封装
373 | $.extend({
374 | /**
375 | * 发送成功的提示框(置顶)
376 | * @param {String} msg 提示语
377 | * @param {Number} duration 持续多长时间后关闭
378 | * @param {Function} callback 回调函数
379 | * @return {undefined}
380 | */
381 | sendSuccessToTop: function(msg, duration, callback) {
382 | var content = '' + ' ' + msg + '
';
383 |
384 | $('body').append(content);
385 |
386 | var $tipBox = $('.dialog-success-top'),
387 | width = $tipBox.width();
388 |
389 | $tipBox.css({
390 | 'margin-left': -(width / 2),
391 | 'margin-top': 20,
392 | 'opacity': 0
393 | });
394 |
395 | $tipBox.animate({
396 | 'opacity': 1,
397 | 'margin-top': 0
398 | }, 400, function() {
399 | // 自动隐藏
400 | clearTimeout(window.cc_timerSendSuccessToTop);
401 | window.cc_timerSendSuccessToTop = setTimeout(function() {
402 | $tipBox.fadeOut(function() {
403 | $tipBox.remove();
404 | typeof callback === 'function' && callback();
405 | })
406 | }, duration || 3000);
407 | });
408 | },
409 |
410 | /**
411 | * 发送警告的提示框(置顶)
412 | * @param {String} msg 提示语
413 | * @param {Number} duration 持续多长时间后关闭
414 | * @param {Function} callback 回调函数
415 | * @return {undefined}
416 | */
417 | sendWarningToTop: function(msg, duration, callback) {
418 | var content = '' + ' ' + msg + '
';
419 |
420 | $('body').append(content);
421 |
422 | var $tipBox = $('.dialog-warning-top'),
423 | width = $tipBox.width();
424 |
425 | $tipBox.css({
426 | 'margin-left': -(width / 2),
427 | 'margin-top': 20,
428 | 'opacity': 0
429 | });
430 |
431 | $tipBox.animate({
432 | 'opacity': 1,
433 | 'margin-top': 0
434 | }, 400, function() {
435 | // 自动隐藏
436 | clearTimeout(window.cc_timerSendWarningToTop);
437 | window.cc_timerSendWarningToTop = setTimeout(function() {
438 | $tipBox.fadeOut(function() {
439 | $tipBox.remove();
440 | typeof callback === 'function' && callback();
441 | });
442 | }, duration || 3000);
443 | });
444 | },
445 |
446 | /**
447 | * 发送提示信息
448 | * @param {String} msg 提示语
449 | * @param {Number} duration 持续多长时间后关闭
450 | * @param {Function} callback 回调函数
451 | * @param {string} iconStr icon内容
452 | * @return {undefined}
453 | */
454 | sendMsg: function(msg, duration, callback, iconStr) {
455 | // 缺省duration参数
456 | if ($.isFunction(duration)) {
457 | callback = duration;
458 | duration = undefined;
459 | }
460 |
461 | var content = '' + '
' + (iconStr || '') + msg + '
' + '
';
462 |
463 | var _options = {
464 | id: 'dialogTipBox',
465 | title: ' ',
466 | hideHeader: true,
467 | hideClose: false,
468 | content: content,
469 | callback: duration === false ? null : function() {
470 | // 自动隐藏
471 | clearTimeout(window.timerDialogHide);
472 | window.timerDialogHide = setTimeout(function() {
473 | $(closeClass).trigger('click');
474 | }, duration || 3000);
475 | },
476 | onClose: function() {
477 | typeof callback === 'function' && callback();
478 | }
479 | };
480 |
481 | Dialog.show(_options);
482 | },
483 |
484 | /**
485 | * 发送成功(弹窗)
486 | * @param {String} msg 提示语
487 | * @param {Number} duration 持续多长时间后关闭
488 | * @param {Function} callback 回调函数
489 | * @return {undefined}
490 | */
491 | sendSuccess: function(msg, duration, callback) {
492 | $.sendMsg(msg, duration, callback, '');
493 | },
494 |
495 | /**
496 | * 发送警告(弹窗)
497 | * @param {String} msg 提示语
498 | * @param {Number} duration 持续多长时间后关闭
499 | * @param {Function} callback 回调函数
500 | * @return {undefined}
501 | */
502 | sendWarning: function(msg, duration, callback) {
503 | $.sendMsg(msg, duration, callback, '');
504 | },
505 |
506 | /**
507 | * 发送错误(弹窗)
508 | * @param {String} msg 提示语
509 | * @param {Number} duration 持续多长时间后关闭
510 | * @param {Function} callback 回调函数
511 | * @return {undefined}
512 | */
513 | sendError: function(msg, duration, callback) {
514 | $.sendMsg(msg, duration, callback, '');
515 | },
516 |
517 | /**
518 | * 发送确认提示框
519 | * @param {Object} options 配置选项
520 | * @return {undefined}
521 | */
522 | sendConfirm: function(options) {
523 | // 配置选项合并
524 | options = $.extend(true, {
525 | id: 'dialogConfirmBox',
526 | title: '提示框',
527 | hideHeader: false,
528 | hideClose: false,
529 | withCenter: false, // 是否水平居中
530 | withIcon: false, // 是否显示icon,可传递withIcon的替代类名
531 | autoClose: false, // 是否自动关闭
532 | timeout: 3000, // 多少毫秒之后自动关闭
533 | width: null, // 自定义宽度
534 | noconfirm: false, // 提交按钮是否添加noconfirm属性
535 | msg: '', // 提示语
536 | desc: '', // 描述文本
537 | content: '', // 自定义内容
538 | button: {
539 | confirm: '确认', // 确认按钮-标题,null表示不显示,可以通过{text:'按钮文本', href:'按钮链接', target:'链接打开方式',behavior:'是否执行行为'}进行自定义设置
540 | cancel: '取消', // 取消按钮-标题,null表示不显示,可以通过{text:'按钮文本', href:'按钮链接', target:'链接打开方式',behavior:'是否执行行为'}进行自定义设置
541 | cancelFirst: false // 取消狂是否在前面
542 | }
543 | }, options);
544 |
545 | // 是否显示按钮
546 | var confirmValue = options.button.confirm,
547 | cancelValue = options.button.cancel,
548 | isShowButton = options.button && (confirmValue || cancelValue),
549 | buttonConfirm = '',
550 | buttonCancel = '',
551 | buttonContent = '',
552 | appendClass = '',
553 | appendStyle = '';
554 |
555 | if (isShowButton) {
556 | buttonConfirm = (confirmValue ? '' + (confirmValue.text || confirmValue) + '' : '');
557 | buttonCancel = (cancelValue ? '' + (cancelValue.text || cancelValue) + '' : '');
558 | buttonContent = '' + (options.button.cancelFirst ? buttonCancel + buttonConfirm : buttonConfirm + buttonCancel) + '
'
559 | }
560 |
561 | if (options.withCenter) {
562 | appendClass += ' withCenter';
563 | }
564 |
565 | if (options.withIcon) {
566 | appendClass += ' ' + (typeof options.withIcon === 'string' ? options.withIcon : 'withIcon');
567 | }
568 |
569 | if (options.width !== null) {
570 | appendStyle = ' style="width:' + options.width + (typeof options.width === 'string' ? '' : 'px') + ';"';
571 | }
572 |
573 | // 弹窗内容
574 | var content = '' + (options.msg === '' ? '' : '
' + options.msg + '
') + (options.desc === '' ? '' : '
' + options.desc + '
') + (options.content === '' ? '' : '
' + options.content + '
') + (buttonContent) + '
';
575 | options.content = content;
576 |
577 | // 自动隐藏选项
578 | if (options.autoClose) {
579 | var _callbackCopy = options.callback || $.noop;
580 | options.callback = function() {
581 | _callbackCopy();
582 | // 自动隐藏
583 | clearTimeout(window.timerDialogHide);
584 | window.timerDialogHide = setTimeout(function() {
585 | $(closeClass).trigger('click');
586 | }, options.timeout);
587 | };
588 | }
589 |
590 | Dialog.show(options);
591 | }
592 | });
593 |
594 | // 相关事件绑定
595 | (function() {
596 | var $doc = $(document);
597 |
598 | // 绑定:用于关闭对话弹窗
599 | $doc.on('click', closeClass, function() {
600 | var $that = $(this), beforeReturn;
601 |
602 | // 如果返回false,则表示中断关闭弹窗
603 | typeof dialogOpts.onBeforeClose === 'function' && (beforeReturn = dialogOpts.onBeforeClose($that));
604 | if (beforeReturn === false) return;
605 |
606 | clearTimeout(window.timerDialogHide);
607 | Dialog.hide(function() {
608 | if (typeof dialogOpts.onClose === 'function') {
609 | dialogOpts.onClose($that, beforeReturn);
610 | }
611 | });
612 | });
613 |
614 | // 绑定:用于执行弹窗的确认操作
615 | $doc.on('click', '.j_dialogConfirm', function() {
616 | var $that = $(this), beforeReturn;
617 |
618 | // 如果提交按钮存在noconfirm属性,将不执行响应
619 | if ($that.attr('noconfirm') !== undefined) return;
620 |
621 | // 如果返回false,则表示中断关闭弹窗
622 | typeof dialogOpts.onBeforeConfirm === 'function' && (beforeReturn = dialogOpts.onBeforeConfirm($that));
623 | if (beforeReturn === false) return;
624 |
625 | clearTimeout(window.timerDialogHide);
626 | Dialog.hide(function() {
627 | if (typeof dialogOpts.onConfirm === 'function') {
628 | dialogOpts.onConfirm($that, beforeReturn);
629 | }
630 | });
631 | });
632 |
633 | // 绑定:用于执行弹窗的取消操作
634 | $doc.on('click', '.j_dialogCancel', function() {
635 | var $that = $(this), beforeReturn;
636 |
637 | // 如果返回false,则表示中断关闭弹窗
638 | typeof dialogOpts.onBeforeCancel === 'function' && (beforeReturn = dialogOpts.onBeforeCancel($that));
639 | if (beforeReturn === false) return;
640 |
641 | clearTimeout(window.timerDialogHide);
642 | Dialog.hide(function() {
643 | if (typeof dialogOpts.onCancel === 'function') {
644 | dialogOpts.onCancel($that, beforeReturn);
645 | }
646 | });
647 | });
648 |
649 | // 绑定:点击弹窗遮罩层关闭弹窗
650 | $doc.on('click', '.j_bgHide', function() {
651 | $(closeClass).trigger('click');
652 | });
653 |
654 | // 绑定:按ESC按键关闭弹窗
655 | $doc.on('keyup', function(ev) {
656 | if (ev.keyCode == 27 && $('.j_escHide').length) {
657 | $(closeClass).trigger('click').removeClass('j_dialogClose');
658 | }
659 | });
660 | })();
661 |
662 | // 使用$.dialog()进行访问
663 | $.dialog = Dialog.show;
664 | $.dialogClose = Dialog.hide;
665 | });
--------------------------------------------------------------------------------