confirm.html
42.8 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
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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
<!DOCTYPE html>
<html lang="zh">
{include file="public/head"/}
<!--swiper引入-->
<link rel="stylesheet" href="__CDN__/assets/store/js/Swiper-3.4.2/css/swiper.min.css">
<script type="text/javascript" src="__CDN__/assets/store/js/Swiper-3.4.2/js/swiper.min.js"></script>
<style>
/*新增、修改收货人信息模态窗*/
.modal-dialog {
width: 423px;
height: 485px;
}
.modal-header {
height: 80px;
border: 0;
}
.modal-body {
padding: 10px 24px 20px 24px;
max-height: none;
}
.modal-title {
height: 50px;
line-height: 50px;
text-align: center;
font-size: 20px;
font-family: PingFang SC;
font-weight: 500;
color: rgba(6, 18, 30, 1);
}
form {
font-size: 14px;
font-family: PingFang SC;
font-weight: 500;
color: rgba(61, 68, 77, 1);
}
form .form-group {
width: 100%;
height: 54px;
margin: 0 0 20px 0;
position: relative;
}
form .form-group .tipsInfo {
position: absolute;
width: 100%;
height: 20px;
font-size: 10px;
color: red;
top: 55px;
left: 0;
}
form .form-group .form-control {
width: 100%;
height: 100%;
box-shadow: none;
}
form .form-group:nth-child(3), form .form-group:nth-child(5) {
position: relative;
}
form .form-group:nth-child(3) span {
display: inline-block;
position: absolute;
top: 15px;
right: 20px;
font-size: 16px;
font-family: PingFang SC;
font-weight: 400;
color: rgba(140, 145, 152, 1);
}
form .form-group:nth-child(5) span {
display: inline-block;
position: absolute;
top: 35px;
left: 12px;
font-size: 16px;
font-family: PingFang SC;
font-weight: 400;
line-height: 22px;
color: rgba(140, 145, 152, 1);
}
form p {
height: 22px;
padding-left: 9px;
font-size: 16px;
font-family: PingFang SC;
font-weight: 500;
line-height: 22px;
color: rgba(6, 18, 30, 1);
}
form button {
width: 100%;
height: 51px;
border: 0 !important;
background: rgba(0, 159, 142, 1) !important;
border-radius: 2px !important;
font-size: 18px !important;
font-family: PingFang SC;
font-weight: 400 !important;
color: rgba(255, 255, 255, 1) !important;
}
form .imgBox {
margin-bottom: 20px;
}
</style>
<style>
body {
background: rgba(249, 249, 249, 1);
}
.content {
width: 100%;
font-size: 0;
}
/*订单信息部分样式*/
.content .orderInfoBox {
width: 100%;
/*height: 905px;*/
background: rgba(249, 249, 249, 1);
}
.content .orderInfoBox .titleBox {
width: 1200px;
height: 60px;
line-height: 60px;
background: rgba(255, 255, 255, 1);
border-radius: 8px;
margin: 12px auto;
}
.content .orderInfoBox .titleBox span:first-child {
display: inline-block;
float: left;
width: 6px;
height: 20px;
margin-top: 21px;
background: rgba(0, 159, 142, 1);
border-radius: 2px;
}
.content .orderInfoBox .titleBox span:nth-child(2) {
height: 22px;
line-height: 22px;
float: left;
margin-top: 20px;
padding-left: 12px;
font-size: 16px;
font-family: PingFang SC;
font-weight: 500;
color: rgba(0, 159, 142, 1);
}
/*物流方式部分样式*/
.content .orderInfoBox .sendModeBox {
width: 1200px;
height: 108px;
background: rgba(255, 255, 255, 1);
border-radius: 8px;
margin: 0 auto 12px auto;
}
.content .orderInfoBox .title {
width: 100%;
height: 40px;
padding: 0 30px;
font-size: 14px;
font-family: PingFang SC;
font-weight: 500;
line-height: 40px;
color: rgba(61, 68, 77, 1);
border-bottom: 1px solid rgba(238, 238, 238, 1);
margin: 0;
}
.content .orderInfoBox .sendModeBox ul {
width: 100%;
height: 68px;
padding: 0 30px;
}
.content .orderInfoBox .sendModeBox ul li {
list-style-type: none;
float: left;
width: 95px;
height: 65px;
line-height: 65px;
margin-right: 30px;
font-size: 14px;
font-family: PingFang SC;
font-weight: 400;
color: rgba(6, 18, 30, 1);
cursor: pointer;
}
.content .orderInfoBox .sendModeBox ul li img {
width: 16px;
height: 16px;
margin-right: 12px;
}
/*快递_收货人信息部分样式*/
.content .orderInfoBox .consigneeBox {
width: 1200px;
background: rgba(255, 255, 255, 1);
border-radius: 8px;
margin: 0 auto 12px auto;
}
.content .orderInfoBox .title {
display: inline-block;
}
.content .orderInfoBox .title span {
display: inline-block;
float: right;
width: 84px;
height: 40px;
font-size: 14px;
font-family: PingFang SC;
font-weight: 500;
line-height: 40px;
color: rgba(0, 159, 142, 1);
cursor: pointer;
}
.content .orderInfoBox .consigneeBox ul {
width: 100%;
padding: 0;
}
.content .orderInfoBox .consigneeBox ul li {
list-style-type: none;
width: 100%;
height: 112px;
cursor: pointer;
}
.content .orderInfoBox .consigneeBox ul li .imgBox {
float: left;
width: 76px;
height: 100%;
text-align: center;
line-height: 112px;
}
.content .orderInfoBox .consigneeBox ul li .contentBox {
width: 1090px;
height: 100%;
margin-left: 77px;
overflow: hidden;
border-bottom: 1px solid rgba(238, 238, 238, 1);
}
.content .orderInfoBox .consigneeBox ul li .contentBox .box {
width: 100%;
height: 20px;
}
.content .orderInfoBox .consigneeBox ul li .contentBox .box:first-child {
margin: 30px 0 12px 0;
}
.content .orderInfoBox .consigneeBox ul li .contentBox .box {
margin: 0;
font-size: 14px;
font-family: PingFang SC;
font-weight: 500;
line-height: 20px;
color: rgba(91, 94, 99, 1);
}
.content .orderInfoBox .consigneeBox ul li .contentBox .box p {
margin: 0;
display: inline-block;
}
.content .orderInfoBox .consigneeBox ul li .contentBox .box p .phone {
display: inline-block;
margin-left: 10px;
font-size: 12px;
}
.content .orderInfoBox .consigneeBox ul li .contentBox .box .btnSpan {
display: inline-block;
width: 60px;
height: 17px;
float: right;
text-align: right;
}
.content .orderInfoBox .consigneeBox ul li .contentBox .box .btnSpan span {
display: inline-block;
vertical-align: middle;
}
.content .orderInfoBox .consigneeBox ul li .contentBox .box .btnSpan img{
margin-right: 6px;
}
/*跑腿_收货人信息*/
.content .orderInfoBox .errandsBox {
display: none;
width: 1200px;
background: rgba(255, 255, 255, 1);
border-radius: 8px;
margin: 0 auto 12px auto;
}
.content .orderInfoBox .errandsBox ul {
width: 100%;
/*padding: 0 30px;*/
}
.content .orderInfoBox .errandsBox ul li {
list-style-type: none;
width: 100%;
/*height: 116px;*/
cursor: pointer;
}
.content .orderInfoBox .errandsBox ul li .imgBox {
float: left;
width: 76px;
height: 100%;
text-align: center;
line-height: 112px;
}
.content .orderInfoBox .errandsBox ul li .contentBox {
width: 1064px;
height: 100%;
margin-left: 77px;
overflow: hidden;
border-bottom: 1px solid rgba(238, 238, 238, 1);
padding-top: 20px;
}
.content .orderInfoBox .errandsBox ul li .contentBox p {
font-size: 14px;
font-family: PingFang SC;
font-weight: 500;
line-height: 20px;
color: rgba(91, 94, 99, 1);
margin-bottom: 8px;
}
/*支付方式部分样式*/
.content .orderInfoBox .payModeBox {
width: 1200px;
/*height: 264px;*/
background: rgba(255, 255, 255, 1);
border-radius: 8px;
margin: 0 auto 12px auto;
}
.content .orderInfoBox .payModeBox ul {
width: 100%;
padding: 0 30px;
}
.content .orderInfoBox .payModeBox ul li {
list-style-type: none;
width: 100%;
height: 68px;
cursor: pointer;
}
.content .orderInfoBox .payModeBox ul li .imgBox {
float: left;
width: 76px;
height: 100%;
text-align: center;
line-height: 68px;
}
.content .orderInfoBox .payModeBox ul li .contentBox {
width: 1064px;<!---->
height: 100%;
margin-left: 77px;
overflow: hidden;
border-bottom: 1px solid rgba(238, 238, 238, 1);
padding-top: 20px;
font-size: 14px;
font-family: PingFang SC;
font-weight: 400;
line-height: 20px;
color: rgba(6, 18, 30, 1);
}
/*二维码部分样式*/
.content .orderInfoBox .downloadBox {
display: none;
width: 1200px;
height: 132px;
border-radius: 8px;
margin: 8px auto 0 auto;
padding: 0 30px;
}
.content .orderInfoBox .downloadBox div {
display: inline-block;
width: 100px;
}
.content .orderInfoBox .downloadBox div img {
width: 100px;
height: 100px;
margin-bottom: 12px;
}
.content .orderInfoBox .downloadBox div p {
margin: 0;
width: 100px;
height: 20px;
text-align: center;
font-size: 14px;
font-family: PingFang SC;
font-weight: 400;
line-height: 20px;
color: rgba(6, 18, 30, 1);
}
/*提交订单部分样式*/
.content .orderInfoBox .submitBox {
width: 1200px;
height: 52px;
background: rgba(255, 255, 255, 1);
border-radius: 8px;
margin: 60px auto 50px auto;
padding-left: 30px;
}
.content .orderInfoBox .submitBox p {
display: inline-block;
width: 160px;
height: 52px;
line-height: 52px;
font-size: 14px;
font-family: PingFang SC;
font-weight: 500;
color: rgba(140, 145, 152, 1);
margin: 0;
}
.content .orderInfoBox .submitBox p:nth-child(3) {
width: 680px;
text-align: right;
padding-right: 21px;
}
.content .orderInfoBox .submitBox p:nth-child(3) span {
font-size: 16px;
color: rgba(234, 50, 43, 1);
}
.content .orderInfoBox .submitBox .btn {
width: 170px;
height: 52px;
background: rgba(0, 159, 142, 1);
border: 0;
font-size: 16px;
font-family: PingFang SC;
font-weight: 500;
line-height: 22px;
color: rgba(255, 255, 255, 1);
border-radius: 0;
margin-top: -12px;
}
</style>
<style>
#payModal{
display: none;
}
.modal-box {
width: 716px;
height: 438px;
top: 25%;
left: 50%;
transform: translateX(-50%);
z-index: 99999;
overflow: hidden;
position: fixed;
border: 6px solid #bbb;
background-color: #fff;
-webkit-animation: scale-in both cubic-bezier(.4, 0, 0, 1.5) .3s;
animation: scale-in both cubic-bezier(.4, 0, 0, 1.5) .3s;
}
.modal-left {
float: left;
width: 333px;
padding: 20px 50px 25px 45px;
}
#payModal .modal-qrcode {
width: 210px;
height: 210px;
display: block;
margin: 0 auto 20px;
}
.icon-qrcode {
width: 16px;
height: 16px;
margin-right: 3px;
position: relative;
display: inline-block;
vertical-align: middle;
background-position: 0 -88px;
}
.modal-left .icon {
font-size: 0;
background-image: url(https://mpay.meituan.com/resource/cashier/img/icon-common@2x.rcJBe.png);
background-size: 168px;
}
#payModal .modal-info {
color: #f80;
font-size: 12px;
padding: 13px 0;
text-align: center;
background-color: #f7f7f7;
}
.modal-right {
float: left;
}
#payModal p{
font-size: 18px;
text-align: center;
line-height: 32px;
margin-bottom: 16px;
}
#payModal .orange {
color: #f80;
}
#payModal .modal-qr{
padding-top: 20px;
border: 1px solid #ddd;
}
.icon-clock {
width: 12px;
height: 12px;
margin-right: 5px;
}
.icon-close {
top: 13px;
right: 13px;
width: 13px;
height: 13px;
z-index: 5;
cursor: pointer;
position: absolute;
background-position: -17px -88px;
}
.modal-right .icon {
font-size: 0;
background-image: url(https://mpay.meituan.com/resource/cashier/img/icon-common@2x.rcJBe.png);
background-size: 168px;
}
#payModal .model-right img {
width: 371px;
height: 438px;
}
</style>
<body>
{include file="public/header"/}
<!--主要内容-->
<div class="content">
{include file="public/nav"}
<!--订单信息部分-->
<div class="orderInfoBox">
<!--标题部分-->
<div class="titleBox">
<span></span>
<span id="orderTitle">订单确认</span>
</div>
<!--物流方式-->
<div class="sendModeBox">
<p class="title">物流方式</p>
<ul>
<li onclick="changeSendMode(1)"><img id="expressImg" src="__CDN__/assets/store/images/checkbox_orange.png" alt="img">快递运输
</li>
<li onclick="changeSendMode(2)"><img id="dadaImg" src="__CDN__/assets/store/images/radioUnSelect.png" alt="img">达达快递
</li>
<li onclick="changeSendMode(3)"><img id="meiTuanImg" src="__CDN__/assets/store/images/radioUnSelect.png" alt="img">美团跑腿
</li>
</ul>
</div>
<!--快递_收货人信息-->
<div class="consigneeBox">
<p class="title">
收货人信息
<span onclick="addConsignee()">新增收货地址</span>
</p>
<ul class="address_box">
{foreach name="$address" item="a"}
<li onclick="changeConsignee(this)" data-address_id="{$a.id}">
<div class="imgBox">
<img class="checkImg" src="{if condition='$a.is_default eq 1'}__CDN__/assets/store/images/checkbox_orange.png{else /}__CDN__/assets/store/images/radioUnSelect.png{/if}" alt="img">
</div>
<div class="contentBox address-{$a.id}">
<div class="box">
<p>
<span class="name">{$a.name}</span>
<span class="phone">{$a.phone}</span>
</p>
<span class="btnSpan" onclick="edit(this)">
<img src="__CDN__/assets/store/images/icon_bianji.png" alt="img">
<span></span>编辑
</span>
</div>
<div class="box">
<p class="address">
<span data-province_id="{$a.province_id}">{$a.province_name}</span>
<span data-city_id="{$a.city_id}">{$a.city_name}</span>
<span data-county_id="{$a.county_id}">{$a.county_name}</span>
<span>{$a.address}</span>
</p>
<span class="btnSpan" onclick="del(this,'{$a.id}')"><img src="__CDN__/assets/store/images/icon_del.png" alt="">
<span>删除</span>
</span>
</div>
</div>
</li>
{/foreach}
</ul>
</div>
<!--跑腿_收货人信息-->
<div class="errandsBox">
<p class="title">
店铺信息
</p>
<ul>
{foreach name="$store" item="s"}
<li onclick="changeErrands(this)">
<div class="imgBox">
<img class="checkImg" src="__CDN__/assets/store/images/checkbox_orange.png" alt="img">
</div>
<div class="contentBox">
<p>联系人(店铺名称):<span class="shopName">{$s.name}</span></p>
<p>电话:<span class="phone">{$s.phone}</span></p>
<p>店铺地址:
<span class="address">
<span data-province_id="{$s.province_id}">{$s.province_name}</span>
<span data-city_id="{$s.city_id}">{$s.city_name}</span>
<span data-county_id="{$s.county_id}">{$s.county_name}</span>
<span>{$s.address}</span>
</span>
</p>
{foreach name="$s.goods" item="g"}
<p>
<span>商品:{$g.goodsname}</span>
<span>数量:{$g.number}</span>
</p>
{/foreach}
</div>
</li>
{/foreach}
</ul>
</div>
<!--支付方式-->
<div class="payModeBox">
<p class="title">支付方式</p>
<ul>
<li onclick="changePayMode(this,'weChat')">
<div class="imgBox">
<img class="checkImg" src="__CDN__/assets/store/images/checkbox_orange.png" alt="img">
</div>
<div class="contentBox">
<img src="__CDN__/assets/store/images/weixin.png" alt="img">
微信支付
</div>
</li>
<li onclick="changePayMode(this,'aliPay')">
<div class="imgBox">
<img class="checkImg" src="__CDN__/assets/store/images/radioUnSelect.png" alt="img">
</div>
<div class="contentBox">
<img src="__CDN__/assets/store/images/zhufubao.png" alt="img">
支付宝
</div>
</li>
</ul>
</div>
<!--二维码部分-->
<div class="downloadBox">
<div>
<img src="{$site.dada_image}" alt="img">
<p>下载达达</p>
</div>
<div>
<img src="{$site.meituan_image}" alt="img">
<p>下载美团</p>
</div>
</div>
<!--提交订单部分-->
<div class="submitBox">
<p>商品金额:<span>¥{$goods_total}</span></p>
<p>物流费用:<span>¥{$postage_total}</span></p>
<p>应付总额:<span>¥{$total}</span></p>
<button id="submitBtn" type="button" class="btn" onclick="submitOrder()">提交订单</button>
</div>
</div>
</div>
<!--新增、修改收货人信息模态窗-->
<div class="modal fade" id="changeInfoModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
<img src="__CDN__/assets/store/images/close_icon.png" alt="close">
</button>
<h4 class="modal-title" id="myModalLabel">
新增/修改收货人信息
</h4>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<input type="text" class="form-control" id="userName" placeholder="姓名">
<span id="userNameTips" class="tipsInfo"></span>
</div>
<div class="form-group">
<input type="text" class="form-control" id="phoneNum" placeholder="手机号">
<span id="phoneNumTips" class="tipsInfo"></span>
</div>
<div style="display: flex;">
<div class="form-group">
<select id="province" class="form-control" placeholder="请选择省份">
<option value="">请选择</option>
{foreach name="$province" item="p"}
<option value="{$p.id}">{$p.name}</option>
{/foreach}
</select>
</div>
<div class="form-group">
<select id="city" class="form-control" placeholder="请选择城市">
<option value="">请选择</option>
<!--{foreach name="$city" item="c"}
<option value="{$c.id}">{$c.name}</option>
{/foreach}-->
</select>
</div>
<div class="form-group">
<select id="county" class="form-control" placeholder="请选择省份">
<option value="">请选择</option>
<!--{foreach name="$county" item="c"}
<option value="{$c.id}">{$c.name}</option>
{/foreach}-->
</select>
</div>
</div>
<div class="form-group">
<input type="text" class="form-control" id="addressDetail" placeholder="详细地址">
<span id="addressDetailTips" class="tipsInfo"></span>
</div>
<input type="hidden" id="address_id" value=""/>
<button type="button" class="btn btn-submit" onclick="sendInfo()">确定</button>
</form>
</div>
</div>
</div>
</div>
<!--支付窗口-->
<div id="payModal">
<div class="mask" style="position: fixed;top: 0;left: 0;width: 100%;height: 100%;background: #000;opacity: 0.6;z-index: 9999;"></div>
<div class="modal-box">
<div class="modal-left">
<p>
<span>请使用 </span>
<span class="orange">微信 </span>
<i class="icon icon-qrcode"></i>
<span class="orange"> 扫一扫</span><br>扫描二维码支付
</p>
<div class="modal-qr">
<img class="modal-qrcode"
src=""
alt="您的浏览器版本太低, 请升级您的浏览器">
<div class="modal-info">
<img class="icon-clock" src="__CDN__/assets/store/images/clock.png">
<span>二维码有效时长为2小时, 请尽快支付</span>
</div>
</div>
</div>
<div class="modal-right"><i class="icon icon-close"></i><img
src="https://mpay.meituan.com/resource/cashier/img/weixin-qrcode.1xf1oN.jpg" alt="微信扫码">
</div>
</div>
</div>
<!--begin:提示弹层-->
<div class="toast">提示框</div>
<div class="bg"></div>
{include file="public/footer"/}
{include file="public/js"/}
<script>
var order_id = '';//用于判断订单状态
var order_status = 1;//用于判断订单状态
var sendMode = 1;//配送方式
var payMode = 1;//支付方式
var data = '{$data}';
var number = "{$goods_number}";
var province_id = "{$province_id}";
$(function () {
var source = window.location.href.split('source=')[1];
if (source){
$('#orderTitle').html('订单详情');
$('#submitBtn').hide();
}
});
//更换运输方式
function changeSendMode(type) {
sendMode = type;
$.ajax({
url:"{:url('index/order/confirm_ajax')}",
type:"POST",
data:{'data':data,'number':number,'province_id':province_id,'express':type},
success:function (res) {
if(res.code == 1){
$('.sendModeBox ul li img').attr('src', '__CDN__/assets/store/images/radioUnSelect.png');
if (type == 1) {
//快递
$('.errandsBox,.downloadBox').hide();
$('.consigneeBox').show();
$('#expressImg').attr('src', '__CDN__/assets/store/images/checkbox_orange.png');
} else if (type == 2) {
//达达
$('.consigneeBox').hide();
$('.errandsBox,.downloadBox').show();
$('.downloadBox').find('div').eq(0).show();
$('.downloadBox').find('div').eq(1).hide();
$('#dadaImg').attr('src', '__CDN__/assets/store/images/checkbox_orange.png');
} else {
//美团
$('.consigneeBox').hide();
$('.errandsBox,.downloadBox').show();
$('.downloadBox').find('div').eq(0).hide();
$('.downloadBox').find('div').eq(1).show();
$('#meiTuanImg').attr('src', '__CDN__/assets/store/images/checkbox_orange.png');
}
$('.submitBox').find('p').eq(0).find('span').html("¥"+res.data.goods_total);
$('.submitBox').find('p').eq(1).find('span').html("¥"+res.data.postage_total);
$('.submitBox').find('p').eq(2).find('span').html("¥"+res.data.total);
}
},
error:function (res) {
toast('与服务器断开连接');
}
})
}
//新增收货信息
function addConsignee() {
$('#userName').val('');
$('#phoneNum').val('');
$('#addressDetail').val('');
$('#address_id').val('');
getProvince();
getCity();
getCounty();
$('#changeInfoModal').modal();
}
//发送收货人信息
function sendInfo() {
var name = $('#userName').val();
var phone = $('#phoneNum').val();
var reg = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
var province_id = $('#province').val();
var city_id = $('#city').val();
var county_id = $('#county').val();
var address = $('#addressDetail').val();
var address_id = $('#address_id').val();
if(name == ''){
toast('请输入姓名');
return false;
}else if(phone == ''){
toast('请输入电话');
return false;
}else if(!reg.test(phone)){
toast('请输入正确的手机号');
return false;
}else if(province_id == ''){
toast('请选择省份');
return false;
}else if(city_id == ''){
toast('请选择城市');
return false;
}else if(county_id == ''){
toast('请选择区/县');
return false;
}else if(address == ''){
toast('请输入详细地址');
return false;
}
$.ajax({
url:"{:url('index/address/update')}",
type:"POST",
data:{'name':name,'phone':phone,'province_id':province_id,'city_id':city_id,'county_id':county_id,'address':address,'address_id':address_id},
success:function (res) {
if(res.code == 1){
var data = res.data;
if(address_id != ''){
//编辑
var html = "<div class=\"box\">\n" +
" <p>\n" +
" <span class=\"name\">"+data.name+"</span>\n" +
" <span class=\"phone\">"+data.phone+"</span>\n" +
" </p>\n" +
" <span class=\"btnSpan\" onclick=\"edit(this)\">\n" +
" <img src=\"__CDN__/assets/store/images/icon_bianji.png\" alt=\"img\">\n" +
" <span></span>编辑\n" +
" </span>\n" +
" </div>\n" +
" <div class=\"box\">\n" +
" <p class=\"address\">\n" +
" <span data-province_id=\""+data.province_id+"\">"+data.province_name+"</span>\n" +
" <span data-city_id=\""+data.city_id+"\">"+data.city_name+"</span>\n" +
" <span data-county_id=\""+data.county_id+"\">"+data.county_name+"</span>\n" +
" <span>"+data.address+"</span>\n" +
" </p>\n" +
" <span class=\"btnSpan\" onclick=\"del(this,"+data.id+")\"><img src=\"__CDN__/assets/store/images/icon_del.png\" alt=\"\">\n" +
" <span>删除</span>\n" +
" </span>\n" +
" </div>";
$(".address-"+data.id+"").html(html);
}else{
//新增
var html = "<li onclick=\"changeConsignee(this)\" data-address_id=\""+data.id+"\">\n" +
" <div class=\"imgBox\">\n" +
" <img class=\"checkImg\" src=\"__CDN__/assets/store/images/checkbox_orange.png\" alt=\"img\">\n" +
" </div>\n" +
" <div class=\"contentBox address-"+data.id+"\">\n" +
" <div class=\"box\">\n" +
" <p>\n" +
" <span class=\"name\">"+data.name+"</span>\n" +
" <span class=\"phone\">"+data.phone+"</span>\n" +
" </p>\n" +
" <span class=\"btnSpan\" onclick=\"edit(this)\">\n" +
" <img src=\"__CDN__/assets/store/images/icon_bianji.png\" alt=\"img\">\n" +
" <span></span>编辑\n" +
" </span>\n" +
" </div>\n" +
" <div class=\"box\">\n" +
" <p class=\"address\">\n" +
" <span data-province_id=\""+data.province_id+"\">"+data.province_name+"</span>\n" +
" <span data-city_id=\""+data.city_id+"\">"+data.city_name+"</span>\n" +
" <span data-county_id=\""+data.county_id+"\">"+data.county_name+"</span>\n" +
" <span>"+data.address+"</span>\n" +
" </p>\n" +
" <span class=\"btnSpan\" onclick=\"del(this,"+data.id+")\"><img src=\"__CDN__/assets/store/images/icon_del.png\" alt=\"\">\n" +
" <span>删除</span>\n" +
" </span>\n" +
" </div>\n" +
" </div>\n" +
" </li>";
//将所有收货地址变为未选中状态
$('.imgBox').find('img').attr('src',"__CDN__/assets/store/images/radioUnSelect.png");
$('.address_box').prepend(html);
}
$('#changeInfoModal').modal('hide');
toast('操作成功');
}
},
error:function (res) {
toast('与服务器断开连接');
}
});
}
//更改收货人
function changeConsignee(obj) {
$('.content .orderInfoBox .consigneeBox ul li .checkImg').attr('src', '__CDN__/assets/store/images/radioUnSelect.png');
$(obj).find('.checkImg').attr('src', '__CDN__/assets/store/images/checkbox_orange.png');
}
//更改跑腿收货人
function changeErrands(obj) {
$('.content .orderInfoBox .errandsBox ul li .checkImg').attr('src', '__CDN__/assets/store/images/radioUnSelect.png');
$(obj).find('.checkImg').attr('src', '__CDN__/assets/store/images/checkbox_orange.png');
}
//修改收件信息
function edit(obj) {
/*console.log($(obj).parent().next('.address').html());
var name = $(obj).parent().find('.name').html().split('<span')[0];
var phone = $(obj).parent().find('.phone').html();
$('#userName').val(name);
$('#phoneNum').val(phone);
var province_id2 = $(obj).parents().find('.address').find('span').eq(0).attr('data-province_id');
console.log(province_id2);
getProvince(0,province_id2);
var city_id2 = $(obj).parents().find('.address').find('span').eq(1).attr('data-city_id');
console.log(city_id2);
getCity(province_id2,city_id2);
var county_id2 = $(obj).parents().find('.address').find('span').eq(2).attr('data-county_id');
console.log(county_id2);
getCounty(city_id2,county_id2);
$('#addressDetail').val();
$('#changeInfoModal').modal();*/
var address_id = $(obj).parent().parent().parent().attr('data-address_id');
var name = $(obj).prev().find('span').eq(0).html();
var phone = $(obj).prev().find('span').eq(1).html();
var province_id2 = $(obj).parent().next().find('.address span').eq(0).attr('data-province_id');
var city_id2 = $(obj).parent().next().find('.address span').eq(1).attr('data-city_id');
var county_id2 = $(obj).parent().next().find('.address span').eq(2).attr('data-county_id');
var address = $(obj).parent().next().find('.address span').eq(3).html();
$('#userName').val(name);
$('#phoneNum').val(phone);
getProvince(0,province_id2);
getCity(province_id2,city_id2);
getCounty(city_id2,county_id2);
$('#addressDetail').val(address);
$('#address_id').val(address_id);
$('#changeInfoModal').modal();
}
//删除收件信息
function del(obj,id) {
$.ajax({
url:"{:url('index/address/del')}",
type:"POST",
data:{'id':id},
success:function (res) {
if(res.code == 1){
$(obj).parent().parent().parent('li').remove();
toast('操作成功');
}
},
error:function (res) {
toast('与服务器断开连接');
}
});
}
//修改支付方式
function changePayMode(obj, type) {
$('.content .orderInfoBox .payModeBox ul li .checkImg').attr('src', '__CDN__/assets/store/images/radioUnSelect.png');
$(obj).find('.checkImg').attr('src', '__CDN__/assets/store/images/checkbox_orange.png');
if (type == 'weChat') {
//微信支付
payMode = 1;
} else if (type == 'aliPay') {
//支付宝支付
payMode = 2;
} else {
//云闪付
payMode = 3;
}
}
//提交订单
function submitOrder() {
if(sendMode == 1){
var address_id = '';
console.log($('.address_box .imgBox').length);
for(var i=0;i<=$('.address_box .imgBox').length;i++){
if($('.address_box .imgBox').eq(i).find('img').attr('src') == '__CDN__/assets/store/images/checkbox_orange.png'){
address_id = $('.address_box .imgBox').eq(i).parent().attr('data-address_id');
console.log(address_id);
break;
}
}
if(address_id == ''){
toast('请选择收货地址');
return false;
}
}
$.ajax({
url:"{:url('index/order/create_order')}",
type:"POST",
data:{"data":data,'number':number,"pay_type":payMode,'address_id':address_id,"express":sendMode,'province_id':province_id},
success:function (res) {
console.log(res);
if(res.code == 1){
if(payMode == 1){
//微信支付
order_id = res.data.order_id;
$('#payModal').show();
$('.modal-left .modal-qrcode').attr('src',res.data.url);
}else if(payMode == 2){
//支付宝支付
order_id = res.data.order_id;
window.open(res.data.url);
}
}
},
error:function (res) {
toast('与服务器断开连接');
}
})
}
setInterval(function(){order_pay()},3000);
//检测订单支付状态
function order_pay() {
console.log(order_id);console.log(order_status);
if(order_id != '' && order_status != 2){
$.ajax({
url:"{:url('index/order/order_pay')}",
type:"POST",
data:{'order_id':order_id},
success:function(res){
console.log(res);
if(res.code == 1){
order_id = '';
order_status = 2;
toast('支付成功');
setTimeout(function(){
window.location.href = res.url;
},2000);
// window.location.href = res.url;
}
},
error:function(res){
toast('与服务器断开连接')
}
})
}
}
//更换省份
$("#province").on("change",function(){
var province_id2 = $(this).val();
getCity(province_id2);
getCounty();
});
//更换城市
$("#city").on("change",function(){
var city_id2 = $(this).val();
getCounty(city_id2);
});
//获取省份
function getProvince(pid = 0,select_id = 0){
$.ajax({
url:"{:url('index/sundry/get_area')}",
type:"POST",
data:{"pid":pid,'level':1},
success:function (res) {
console.log(res);
var html = "<option value=\"\">请选择</option>";
if(res.code == 1){
$(res.data).each(function (key1, vo) {
var is_select = "";
if(select_id == vo.id){
is_select = "selected";
}
html += "<option value=\""+vo.id+"\" "+is_select+">"+vo.name+"</option>";
});
}
console.log(html);
$('#province').html(html);
},
error:function (res) {
toast('与服务器断开连接')
}
})
}
//获取城市
function getCity(province_id2, select_id = 0){
$.ajax({
url:"{:url('index/sundry/get_area')}",
type:"POST",
data:{"pid":province_id2,'level':2},
success:function (res) {
console.log(res);
var html = "<option value=\"\">请选择</option>";
if(res.code == 1){
$(res.data).each(function (key1, vo) {
var is_select = "";
if(select_id == vo.id){
is_select = "selected";
}
html += "<option value=\""+vo.id+"\" "+is_select+">"+vo.name+"</option>";
});
}
console.log(html);
$('#city').html(html);
},
error:function (res) {
toast('与服务器断开连接')
}
})
}
//获取区/县
function getCounty(city_id2, select_id = 0){
$.ajax({
url:"{:url('index/sundry/get_area')}",
type:"POST",
data:{"pid":city_id2,'level':3},
success:function (res) {
console.log(res);
var html = "<option value=\"\">请选择</option>";
if(res.code == 1){
$(res.data).each(function (key1, vo) {
var is_select = "";
if(select_id == vo.id){
is_select = "selected";
}
html += "<option value=\""+vo.id+"\" "+is_select+">"+vo.name+"</option>";
});
}
$('#county').html(html);
},
error:function (res) {
toast('与服务器断开连接')
}
})
}
// 取消支付
$('.icon-close').click(function () {
$('#payModal').hide();
});
</script>
</body>
</html>