group.html
67.9 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
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
<script type="text/javascript" src="__PUBLIC__/js/rem_new.js"></script>
<!DOCTYPE html >
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>{$goods.goods_name}_{$tpshop_config.shop_info_store_title}</title>
<meta http-equiv="keywords" content="{$tpshop_config['shop_info_store_keyword']}" />
<meta name="description" content="{$tpshop_config['shop_info_store_desc']}" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="format-detection" content="telephone=no" />
<meta name="format-detection" content="email=no" />
<meta name="format-detection" content="address=no;">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<link rel="stylesheet" type="text/css" href="__STATIC__/css/public.css?v=__CSSVERSION__" />
<link rel="stylesheet" type="text/css" href="__STATIC__/css/goods.css?v=__CSSVERSION__" />
<link rel="stylesheet" type="text/css" href="__STATIC__/css/layer.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__/css/team.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/css/group_buying.css" />
<script type="text/javascript" src="__STATIC__/js/jquery.min.js"></script>
<script type="text/javascript" src="__STATIC__/js/touchslider.dev.js"></script>
<script type="text/javascript" src="__STATIC__/js/layer.js?v=__CSSVERSION__"></script>
<script type="text/javascript" src="__PUBLIC__/js/goodsInfoScroll.js?v=__CSSVERSION__"></script>
<script src="__PUBLIC__/js/global.js?v=__CSSVERSION__"></script>
<script src="__PUBLIC__/js/mobile_common.js?v=__CSSVERSION__"></script>
<script src="__STATIC__/js/common.js?v=__CSSVERSION__"></script>
<script type="text/javascript" src="__STATIC__/swiper/js/swiper.min.js"></script>
<link rel="stylesheet" type="text/css" href="__STATIC__/swiper/css/swiper.min.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/css/goods_info_new.css?v=__CSSVERSION__"/>
<!--<script type="text/javascript" src="__STATIC__/js/my_msg.js"></script>-->
<include file="public/my_msg2"/>
<include file="public/my_msg"/>
<style>
/*修改 left,width 20170327*/
.qqkefu {
position: fixed;
left: 20%;
bottom: 50px;
background-color: #fff;
border: 1px #eee solid;
width: 20%;
z-index: 999;
}
.qqkefu ul li {
border-bottom: 1px #eee solid;
height: 45px;
line-height: 45px;
font-size: 16px;
color: #666;
width: 100%;
text-align:center;
background-position: .1rem center;
overflow: hidden;
}
.nokill{ background:#adadad;text-align: center; line-height: 50px; color: #fff}
.erpapp{width:100%; height:50px; background-color:#ca3043;}
.erpapp img{height:30px; width:30px;border-radius: 30px;margin: 10px;display: inline-block;vertical-align: top;}
.erptext{color:#fff;line-height: 50px;width: 50%;display: inline-block;height: 50px;}
.openapp{background-color: #fff;color: #c93145;border-radius: 5px;display: inline-block;margin: 12px;vertical-align:top;height: 25px;width: 70px;text-align: center;line-height: 25px;margin-right: 0;margin-left: 0; float: right;margin-right: 20px;}
.xc-li.bs{ background:#d60021; color:#fff}
.xc-rule-frame{
width: 97%;height: 0.8rem;margin: auto; margin-top: 0.2rem;
}
.xc-rule{
width: 100%;height: 0.95rem;
}
.xc-attribute{
padding: 2px 5px;
background: #d60021;
color: #fff;
border-radius: 30px;
line-height: 40px;
}
#fsumbitbtn{
margin-bottom: 10px;
margin-top:110px;
border-radius: 36px;
height: 30px;
line-height: 30px;
}
.layermbox0_1 .layermchild{
position: fixed;
}
</style>
<?php $normal_gd=1;?>
</head>
<body>
<script type="text/javascript">
var is_fast_reg='{:get_fast_reg();}';
var process_request = "正在处理您的请求...";
</script>
<if condition="$ylpres">
<div class=" erpapp">
<img src="{$ylpres['appIcon']}">
<span class="cut erptext" style="">{$ylpres['appName']}欢迎你</span>
<span class="openapp" onclick="javascript:window.location.href='{$ylpres.downLoadUrl}'">打开APP</span>
</div>
</if>
<include file="public/info_video"/>
<div class="main">
<!--<div class="tab_nav">-->
<!--<div class="header">-->
<!--<div class="h-left">-->
<!--<a class="sb-back" href="javascript:history.back(-1)" title="返回"></a>-->
<!--</div>-->
<!--<div class="h-mid">-->
<!--<ul>-->
<!--<li><a href="javascript:;" class="tab_head on" id="goods_ka1" onClick="setGoodsTab('goods_ka',1,3)">商品</a></li>-->
<!--<li><a href="javascript:;" class="tab_head" id="goods_ka2" onClick="setGoodsTab('goods_ka',2,3)">详情</a></li>-->
<!--<li><a href="javascript:;" class="tab_head" id="goods_ka3" onClick="setGoodsTab('goods_ka',3,3)">评价</a></li>-->
<!--</ul>-->
<!--</div>-->
<!--<div class="h-right">-->
<!--<aside class="top_bar">-->
<!--<div onClick="show_menu();$('#close_btn').addClass('hid');" id="show_more">-->
<!--<a href="javascript:;"></a>-->
<!--</div>-->
<!--<a href="{:U('Mobile/Cart/cart',array('stoid'=>$Think.request.stoid))}" class="show_cart"><em class="global-nav__nav-shop-cart-num" id="tp_cart_info"></em></a>-->
<!--</aside>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<include file="public/navBall" />
<div class="tab_nav">
<div class="header">
<div class="h-left"><a class="sb-back" href="javascript:history.go(-1)" title="返回"></a></div>
<div class="h-mid">
<ul>
<li><a href="javascript:;" class="tab_head on" id="goods_ka1" onClick="setGoodsTab('goods_ka',1,3)">商品</a>
</li>
<li><a href="javascript:;" class="tab_head" id="goods_ka2"
onClick="setGoodsTab('goods_ka',2,3)">详情</a></li>
<li><a href="javascript:;" class="tab_head" id="goods_ka3"
onClick="setGoodsTab('goods_ka',3,3)">评价</a></li>
</ul>
</div>
<div class="h-right">
<aside class="top_bar">
<div onClick="show_menu();$('#close_btn').addClass('hid');" id="show_more"><a
href="javascript:;"></a></div>
<a href="{:U('Mobile/Cart/cart',array('stoid'=>$Think.request.stoid))}" class="show_cart"><em
class="global-nav__nav-shop-cart-num" id="tp_cart_info"></em></a>
</aside>
</div>
</div>
</div>
<!-- 是否默认门店 -->
<include file="public/pk_htm2"/>
<!--商品详情-->
<include file="public/menu" />
<div class="main" id="user_goods_ka_1" style="display:block;">
<div class="banner" style="position: relative">
<div id="slider" class="slider" style="overflow: hidden; visibility: visible; list-style: none; position: relative;">
<ul id="sliderlist" class="sliderlist" style="position: relative; overflow: hidden; transition: left 600ms ease; -webkit-transition: left 600ms ease;">
<if condition="$goods_videos">
<foreach name="$goods_videos" item="video">
<li style="float: left; display: block; width: 100%; position: relative"><span><a href="javascript:void(0)">
<img title="" width="100%" src="{:getImg($video.video_img,NOIMG)}"></a></span>
<div class="v_play"><img v_url="__WEBPUBLIC__{$video.video_url}"
src="__PUBLIC__/images/v_btn.png" onclick="play_video(this)"/></div>
</li>
</foreach>
</if>
<foreach name="goods_images_list" item="pic">
<li style="float: left; display: block; width: 100%;"><span><a href="javascript:void(0)">
<img class="pic_img" title="" width="100%" src="{:getimg($pic.image_url,NOIMG)}"></a></span></li>
</foreach>
</ul>
<div id="pagenavi">
<foreach name="goods_images_list" item="pic" key="k">
<a href="javasscript:void(0);" <if condition="$k eq 0">class="active"</if>></a>
</foreach>
</div>
</div>
<if condition="$goods_videos">
<!---视频图片的显示--->
<div class="video_pic">
<div class="click-playssss">
<div class="video-fonts ons" onclick="videos()">视频</div>
<div class="picture" onclick="pictures()">图片</div>
</div>
</div>
<!---页码显示--->
<div class="pic_num_set"><font id="show_pic_index"></font>/{:count($goods_images_list)}</div>
</if>
<!--团购头部-->
<div class="abs xc_top_img_frame">
<div class="rel img-frame flex ai_center jc_sb" style='background-image:url("__STATIC__/images/weixin/group_img.png");background-repeat: no-repeat;background-size: 100%'>
<text class="fs030 fc">¥<text class="fs040">{$group_buy_info.price}</text><text class="word-line fs018" style="vertical-align: middle;">零售价¥{$goods.market_price}</text>
</text>
<div class="fc end-time">
<p class="fs020 t_c">结束时间</p>
<p id="tests" class="fs020" style="letter-spacing: 0.02rem;"></p>
</div>
</div>
<img class="abs imgs" src="__STATIC__/images/weixin/activity-time.png">
</div>
</div>
<!--<div class="s_bottom"></div>-->
<script type="text/javascript">
$(function() {
$("div.module_special .wrap .major ul.list li:last-child").addClass("remove_bottom_line");
});
//--有视频和无视频要分别处理--
<if condition="$goods_videos">
//t2.slide(j); 跳转某个页面的函数
var t2 = new TouchSlider({
id: 'sliderlist', speed: 600, timeout: 6000, autoPlay:false,
//---获取跳到到页面的下标,精确控制---
before: function (index) {
if(index>0){
if($(".video-fonts").has('ons')) {
$(".video-fonts").removeClass('ons');
$(".picture").addClass('ons');
}
$("#show_pic_index").text(index);
$(".pic_num_set").show();
}else{
$(".pic_num_set").hide();
if($(".picture").has('ons')) {
$(".video-fonts").addClass('ons');
$(".picture").removeClass('ons');
}
}
}
});
function videos(){
if($(".picture").has('ons')) {
t2.slide(0);
}
}
function pictures() {
if($(".video-fonts").has('ons')) {
t2.slide(1);
}
}
<else/>
$("#pagenavi").show();
var active = 0, as = document.getElementById('pagenavi').getElementsByTagName('a');
for (var i = 0; i < as.length; i++) {
(function () {
var j = i;
as[i].onclick = function () {
t2.slide(j);
return false;
}
})();
}
var t2 = new TouchSlider({
id: 'sliderlist', speed: 600, timeout: 6000, before: function (index) {
as[active].className = '';
active = index;
as[active].className = 'active';
}
});
</if>
</script>
<form name="buy_goods_form" method="post" id="buy_goods_form">
<input type="hidden" name="goods_id" value="<?php echo I("id")?>"/>
<div class="product_info" style="border-bottom: 0.04rem solid #eee;">
<div class="info_dottm" style=" display: flex;justify-content: space-between;">
<div class="flex ai_center jc_sb xc-goods-detailed">
<if condition="get_redis_distribution($group_buy_info.id,$stoid,2)">
<image style="width:0.2rem;height: 0.2rem ;margin-left: 0.25rem;" src="__STATIC__/images/addmoney.png"></image>
</if>
<h3 class="name ellipsis-2 fs028"style="width: 70%;<if condition="get_redis_distribution($group_buy_info.id,$stoid,2)">margin-left: -0.37rem;</if>">{$goods.goods_name}</h3>
<div class="xc-share-frame-jieti flex ai_center" onClick="lookshare(event)">
<img class="share-frame" src="__STATIC__/images/weixin/share.png"/>
<text class="fs025 fc">分享</text>
</div>
</div>
<div class="right dn">
<!-- JiaThis Button BEGIN -->
<a href="http://www.jiathis.com/share" class="jiathis jiathis_txt" target="_blank">
<div id="pro_share" class="share"></div>
</a>
<script>
var yuming="{:curHostURL()}";
var jiathis_config = {
url: yuming+"/index.php?m=Home&c=Goods&a=goodsInfo&id={$Request.param.id}",
pic: "{:getimg($goods[original_img],NOIMG,0,1)}",
}
var is_distribut = getCookie('is_distribut');
var user_id = getCookie('user_id');
// 如果已经登录了, 并且是分销商
if (parseInt(is_distribut) == 1 && parseInt(user_id) > 0) {
jiathis_config.url = jiathis_config.url + "&first_leader=" + user_id;
}
//alert(jiathis_config.url);
</script>
<script type="text/javascript" src="http://v3.jiathis.com/code_mini/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END -->
</div>
</div>
<dl class="goods_price">
<script type="text/javascript" src="__STATIC__/js/lefttime.js"></script>
<!--<dt> <span id="goods_price">¥{$group_buy_info.price}</span><em>限时团购</em>
<strong id="leftTime">24:13:52</strong><!–<font>价格:¥{$goods.market_price}元</font>–> </dt>-->
</dl>
<script>
// 倒计时
function GetRTime2(){
var text = GetRTime('{$group_buy_info.end_time|date="Y/m/d H:i:s",###}');
$("#tests").text(text);
}
setInterval(GetRTime2,1000);
</script>
<!--<ul class="price_dottm">
<li style=" text-align:left">折扣:{$group_buy_info.rebate}折</li>
<li>{$commentStatistics.c0}人评价</li>
<li style=" text-align:right">已售:{$group_buy_info[virtual_num] + $group_buy_info[buy_num]}件</li>
</ul>-->
<!-- 拼团玩法-->
<div class="area-box explain-box">
<div class="pt_hb">
团购流程
</div>
<div class="flex jc_center" style='margin-top: 0.2rem; width:99%; margin-bottom: 0.3rem;'>
<div style='width:100%;'>
<div class="flex xc-rule-frame">
<div class="flex ai_center xc-rule " >
<div class="rel " style="width:29%;height: 100%">
<div class="circle yuan circle-color flex jc_center ai_center">1</div>
<div class="xc-wanfan" >选择商品</div>
<div class=" link link-color-red abs " style="top: 0.13rem;"></div>
</div>
<div class="rel "style="width:29%;height: 100%">
<div class="circle yuan t_c circle-color flex jc_center ai_center">2</div>
<div class="xc-wanfan">完成下单</div>
<div class="abs link1 link-color-red " style="top: 0.13rem;"></div>
</div>
<div class="rel flex" style="width:2.65rem;height: 100%;justify-content:space-between">
<div>
<div class=" circle yuan t_c circle-color flex jc_center ai_center" >3</div>
<div class="xc-wanfan">支付参与</div>
</div>
<div class="abs link2 link-color" style="top: 0.13rem; "></div>
<div>
<div class=" circle yuan circle-color1 flex jc_center ai_center" >4</div>
<div class="xc-wanfan" style="text-align: right">商家发货</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- //选择门店-->
<div class="store_frame" style="height: auto">
<div class="store">
<div class="flex jc_sb " style="height: 0.6rem">
<div class="store_top flex ai_center" >
<img src="__WEBPUBLIC__/miniapp/images/stores.png">
<text class="fs026 fg">选择门店</text>
</div>
<div class="flex ai_center fs028 red_bb tt_more_sto dn" onclick="open_store(1)">
更多门店 <text class="bg_jj"></text>
</div>
<div class="flex ai_center sto_loding_div">
<img src="__STATIC__/images/category/loader.gif" class="f_load" width="20" />
</div>
</div>
<!-- 显现默认的门店 和选择了的门店 -->
<div id="ff_page_sto" style="display: none"></div>
</div>
</div>
<!----保障服务---->
<if condition="$tpshop_config.service_bz">
<div class="xc-bzfw flex ai_center">
<img src="__WEBPUBLIC__/miniapp/images/bzfu_w.png">
<font class="fs025">{$tpshop_config.service_bz}</font>
</div>
</if>
<!-- 宝贝评价 -->
<div id="bbpj_div" style="display: none">
<div class="bb_view fs028 flex jc_sb ai_center" onclick="setGoodsTab('goods_ka',3,3)" style="padding-left: 0.2rem">
<div>宝贝评价<!--({{categories3[0].num}})--> (<text id="all_pj_text"></text>)</div>
<div class="red_bb flex ai_center"onclick="setGoodsTab('goods_ka',3,3)" >查看全部
<text class="bg_jj" style="margin-top: 0.02rem;"></text>
</div>
</div>
<div class="xc_comment flex" style="padding-left: 0.2rem">
<div class="xc_comment-have-pictures fs14" onclick="go_pj(5)" >有图<font id="pj_has_img"></font><!--({{categories3[1].num}})--> </div>
<div class="xc_comment-discuss fs14" onclick="go_pj(2)">好评<font id="pj_good"></font><!--({{categories3[2].num}})--> </div>
<div class="xc_comment-discuss fs14" onclick="go_pj(3)">中评<font id="pj_zhon"></font><!--({{categories3[2].num}})--> </div>
<div class="xc_comment-discuss fs14" onclick="go_pj(4)">差评<font id="pj_bad"></font><!--({{categories3[4].num}})--> </div>
</div>
<!-- 评论的轮播组件 -->
<div class="swiper-container" id="pj_swiper" style="width: 96.1%!important; margin-left: 0.2rem">
<div class="swiper-wrapper" id="pj_list"></div>
</div>
</div>
<!-- 商品详情参数 -->
<div class="tuwen_title flex rel">
<div class="g_line"></div>
<div class="center_s abs flex jc_center ai_center fs028" >
<img src="__WEBPUBLIC__//miniapp/images/tuwen_c.png">详情
</div>
</div>
<section class="index_floors">
<div class="t_g_info flex ai_center flex " style="margin-bottom: 0.08rem">
<div class="red_shu"></div>
<div class="fs028">商品信息</div>
</div>
<div class="table_s">
<div class="tb_item flex">
<div class="item_left t_c"><span>商品名称</span></div>
<div class="item_right"><span class="text">{$goods.goods_name}</span></div>
</div>
<div class="tb_item flex">
<div class="item_left t_c"><span>商品编号</span></div>
<div class="item_right"><span class="text">{$goods.goods_sn}</span></div>
</div>
<div class="tb_item flex">
<div class="item_left t_c"><span>商品条码</span></div>
<div class="item_right"><span class="text">{$goods.sku}</span></div>
</div>
<if condition="check_is_set(1) && $goods.cat_name">
<div class="tb_item flex">
<div class="item_left t_c"><span>品类</span></div>
<div class="item_right"><span class="text">{$goods.cat_name}</span></div>
</div>
</if>
<if condition="check_is_set(3) && $goods.brand_name">
<div class="tb_item flex">
<div class="item_left t_c"><span>品牌</span></div>
<div class="item_right"><span class="text">{$goods.brand_name}</span></div>
</div>
</if>
<if condition="check_is_set(2) && $goods.nation_name ">
<div class="tb_item flex">
<div class="item_left t_c"><span>国别</span></div>
<div class="item_right"><span class="text">{$goods.nation_name}</span></div>
</div>
</if>
<div class="tb_item flex">
<div class="item_left t_c"><span>规格</span></div>
<div class="item_right"><span class="text">{$goods.guige}</span></div>
</div>
<div class="tb_item flex" style="border-bottom: 0.01rem solid #eee;">
<div class="item_left t_c"><span>上架时间</span></div>
<div class="item_right"><span class="text">{$goods.on_time|date='Y-m-d H:i',###}</span></div>
</div>
</div>
<!-- 自动加载底部内容的div,必须为空。-->
<div id="mubiao"></div>
<!-- 推荐商品 -->
<div class="flex ai_center jc_center rel xc-linellae-frame">
<div class="xc-linellae"></div>
<div class="abs flex ai_center jc_center xc-recommend-frame ">
<img class=" xc-recommend" src="__STATIC__/images/weixin/zs.png"/>
<div class="xc-recommend-word">推荐</div>
</div>
</div>
<include file="public/floor_more"/>
</section>
</div>
<!--<section id="search_ka" class="huodong">
<div class="subNav">
<div class="att_title"> <span>团</span>
<p>团购活动</p>
</div>
</div>
<div class="navContent">
<ul class="youhui_list1">
<li>
<a href="javascript:void(0);" title="{$group_buy_info[title]}"><img src="__STATIC__/images/hui.png"></a>
<a href="javascript:void(0);">{$group_buy_info[title]} (活动时间:{$group_buy_info[start_time]|date="m月d日",###} - {$group_buy_info[end_time]|date="m月d日",###})</a>
</li>
</ul>
<div class="blank10"></div>
</div>
</section>-->
<!--<notempty name="prom_order">
<section id="search_ka" class="huodong">
<div class="subNav">
<div class="att_title"> <span>订</span>
<p>订单优惠</p>
</div>
</div>
<div class="navContent">
<foreach name="prom_order" item="v" key="k">
<ul class="youhui_list1" style="margin-top:0px;">
<li><img src="__STATIC__/images/hui.png">{$v['name']} (活动时间:{$v[start_time]|date="m月d日",###} - {$v[end_time]|date="m月d日",###})</li>
</ul>
</foreach>
<div class="blank10"></div>
</div>
</section>
</notempty>-->
<script type="text/javascript">
$(function() {
$(".subNav").click(function() {
$(this).next(".navContent").slideToggle(300).siblings(".navContent").slideUp(500);
$(this).toggleClass("on").siblings(".subNav").removeClass("on");
if ($(".is_scroll").length <= 0) {
$('html,body').animate({
'scrollTop': $('body')[0].scrollHeight
}, 600);
}
});
commentType = 1; // 评论类型
ajaxComment(1, 1); // ajax 加载评价列表
})
</script>
<script type="text/jscript">
function click_search() {
var search_ka = document.getElementById("search_ka");
if (search_ka.className == "s-buy open ui-section-box") {
search_ka.className = "s-buy ui-section-box";
} else {
search_ka.className = "s-buy open ui-section-box";
}
}
function changeAtt(t) {
t.lastChild.checked = 'checked';
for (var i = 0; i < t.parentNode.childNodes.length; i++) {
if (t.parentNode.childNodes[i].className == 'hover') {
t.parentNode.childNodes[i].className = '';
t.childNodes[0].checked = "checked";
}
}
t.className = "hover";
changePrice();
}
function changeAtt1(t) {
t.lastChild.checked = 'checked';
for (var i = 0; i < t.parentNode.childNodes.length; i++) {
if (t.className == 'hover') {
t.className = '';
t.childNodes[0].checked = false;
} else {
t.className = "hover";
t.childNodes[0].checked = true;
}
}
changePrice();
}
</script>
<div style=" height:8px; background:#eeeeee; margin-top:-1px;"></div>
</form>
</div>
<!-------- 商品信息----->
<div class="main" id="user_goods_ka_2" style="display:none;" >
<div id="xucheng" style="display:none">{$goods}</div>
<section class="index_floors">
<h2 ><span></span> <text class="goods-xinxi">商品信息</text> </h2>
<div class="table_s">
<div class="tb_item flex">
<div class="item_left t_c"><span>商品名称</span></div>
<div class="item_right"><span class="text">{$goods.goods_name}</span></div>
</div>
<div class="tb_item flex">
<div class="item_left t_c"><span>商品编号</span></div>
<div class="item_right"><span class="text">{$goods.goods_sn}</span></div>
</div>
<div class="tb_item flex">
<div class="item_left t_c"><span>商品条码</span></div>
<div class="item_right"><span class="text">{$goods.sku}</span></div>
</div>
<if condition="check_is_set(1) && $goods.cat_name">
<div class="tb_item flex">
<div class="item_left t_c"><span>品类</span></div>
<div class="item_right"><span class="text">{$goods.cat_name}</span></div>
</div>
</if>
<if condition="check_is_set(3) && $goods.brand_name">
<div class="tb_item flex">
<div class="item_left t_c"><span>品牌</span></div>
<div class="item_right"><span class="text">{$goods.brand_name}</span></div>
</div>
</if>
<if condition="check_is_set(2) && $goods.nation_name ">
<div class="tb_item flex">
<div class="item_left t_c"><span>国别</span></div>
<div class="item_right"><span class="text">{$goods.nation_name}</span></div>
</div>
</if>
<div class="tb_item flex">
<div class="item_left t_c"><span>规格</span></div>
<div class="item_right"><span class="text">{$goods.guige}</span></div>
</div>
<div class="tb_item flex" style="border-bottom: 0.01rem solid #eee;">
<div class="item_left t_c"><span>上架时间</span></div>
<div class="item_right"><span class="text">{$goods.on_time|date='Y-m-d H:i',###}</span></div>
</div>
</div>
</section>
<div class="product_main" style=""></div>
</div>
<div class="tab_attrs tab_item " id="user_goods_ka_3" style="display:none;">
<ul class="comment_nav flex jc_sb ai_center">
<li id="all_com_li" class="xc-li bs" ctype="1">
全部({$commentStatistics.c0})
<!-- <p>{$commentStatistics.c0}</p>-->
</li>
<li id="com_img_li" class="xc-li" ctype="5">
有图({$commentStatistics.c4})
<!--<p>{$commentStatistics.c4}</p>-->
</li>
<li id="com_gd_li" class="xc-li" ctype="2">
好评({$commentStatistics.c1})
<!--<p>{$commentStatistics.c1}</p>-->
</li>
<li id="xc-li"class="xc-li" ctype="3">
中评({$commentStatistics.c2})
<!--<p>{$commentStatistics.c2}</p>-->
</li>
<li id="com_bd_li" class="xc-li" ctype="4">
差评({$commentStatistics.c3})
<!--<p>{$commentStatistics.c3}</p>-->
</li>
</ul>
<div id="ECS_COMMENT"></div>
</div>
</div>
<script>
$(function () {
var gotop=$(".gotop");
$(window).scroll(function () {
($(window).scrollTop() > 100) ? gotop.show(500) : gotop.hide(100);
});
})
function goTop() {
$('html,body').animate({ 'scrollTop': 0 }, 600);
}
</script>
<a href="javascript:goTop();" class="gotop" style="display: none" ><img src="__STATIC__/images/topup.png"></a>
<div style=" height:60px;"></div>
<!---弹出窗--->
<div id="fselePop" class="layermbox layermbox0_1 dn" style="z-index: 1000000">
<div class="laymshade"></div>
<div class="layermmain">
<div class="section">
<div class="layermchild layermanim">
<div class="layermcont">
<ul class="tcbox">
<li class="liFirst">
<div class="flex" style="width: 100%;height: 101px">
<div class="tcimg">
<img id="fgoodsimg" src="{:getimg($goods['original_img'],NOIMG,0,1)}"/>
<span class="dis_vm"></span>
</div>
<span id="fpopclose" class="close"></span>
<div style="width: 70%">
<div style="width: 100%;height: 50%">
<div class="cat-goods-name ellipsis-2">
{$goods.goods_name}
</div>
</div>
<div class="tcinfo flex ai_fe">
<div>
<div class="tcprice" style="height: 25px">
<i>¥</i><font id="fpirce">{$curprice}</font>
</div>
<div class="flex fg" style="line-height: 20px;height: 16px;">
<div style="margin-right: 5px">已售:<font id="fsalenum">{$group_buy_info[virtual_num] + $group_buy_info[buy_num]}</font>件</div>
<div>可售:<font id="fsalenum">{$onlybuynum}</font>件</div>
</div>
<!--
许程 2019/12/04
<div>已选:<font id="fselected_pro">{$goods['guige']}</font></div>-->
</div>
</div>
</div>
</div>
<div class="store-frame">
<div class="flex jc_sb">
<div class="flex" style="width: 75%">
<div class="store_top flex ai_center"><img src="__WEBPUBLIC__/miniapp/images/stores.png"><text class="fs026 fg">选择门店</text></div>
</div>
<div class="flex ai_center fs024 red_bb" onclick="open_store(2)">
更多门店
<text class="bg_jj"></text>
</div>
</div>
<div id="ff_page_stos" style="width:100%;"></div>
</div>
</li>
<li class="attribute">
<ul>
<!-- 许程 2019/012/04
<li>
<div class="tcTit">
<div class="subNav" non="1">取货门店(<font id="fselestore">请选择门店</font>)</div>
</div>
</li>-->
<!--
许程2019/12/04
<li>
<p class="tcTit" style="padding: 0px;margin-top: 5px">商品属性</p>
<font id="fselected_pro"class="xc-attribute">{$goods['guige']}</font>
</li>-->
<li>
<p class="tcTit" style="padding: 0px;margin-top: 5px">商品属性</p>
<font id="fselected_pro"class="xc-attribute">{$goods['guige']}</font>
</li>
<li>
<span class="tcBy"><i>购买数量</i></span>
<span class="tcBy" style="overflow: hidden;height:21px">
<div class="act_wrap rel">
<div class="flex add-cut" >
<!--<a class="input-sub active" onClick="goods_cut()"></a>-->
<div class="active-cut fs14 flex jc_center ai_center t-c" onClick="goods_cut()">—</div>
<div class="d-il">
<input id="ffgoods_num" type="tel"
onkeydown="if(event.keyCode == 13) event.returnValue = false"
name="goods_num" value="1" class="input-num"
type="text">
</div>
<!-- <a class="input-add active" onClick="goods_add();"></a>-->
<div class="active-add fs030 flex jc_center ai_center t-c" onClick="goods_add()">+</div>
</div>
</div>
</span>
</li>
</ul>
</li>
<li id="selecat" class="area dn">
<div class="tcTit" style="border-bottom: 1px solid #dadada;">
< 选择门店
</div>
<ol class="addr-name" id="addr_catlist">
<foreach name="store" item="list">
<li sid="{$list.cat_id}">{$list.cat_name}</li>
</foreach>
</ol>
</li>
<li id="selepick" class="store dn">
<div class="tcTit" style="border-bottom: 1px solid #dadada;">
< <font id="fcat_name"></font>
</div>
<ol class="addr-name" id="pickuplist">
<!--<li>中山路店</li>-->
</ol>
</li>
</ul>
<div id="fsumbitbtn" type="0" class="layermbtn" onClick="checkup(this)">确定</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="footer_nav">
<ul>
<if condition="$is_chat eq 1 || $tpshop_config['qqlist']">
<li class="bian"><a onclick="showQQList()">
<if condition="$is_chat eq 1">
<em class="goods_nav1" style="background-image: url(__STATIC__/images/chat-2.png);"></em>
<else/>
<em class="goods_nav1"></em>
</if>
<span>客服</span></a>
</li>
</if>
<li class="bian"><a href="tel:{$tpshop_config['shop_info_phone']}"><em class="goods_nav2"></em><span>电话</span></a> </li>
<li><a href="javascript:collect_goods({$goods.goods_id})" id="favorite_add"><em class="goods_nav3"></em><span>收藏</span></a></li>
</ul>
<dl id="saleout" class="nokill dn">团购已经售完</dl>
<dl id="normal" style="padding-top: 11px">
<dd class="flow"><a class="button active_button" href="javascript:void(0);" onClick="setbuytype(0)" >加入购物车</a> </dd>
<dd class="goumai"><a style="display:block;" href="javascript:void(0);" onclick="setbuytype(1)">立即购买</a> </dd>
</dl>
</div>
<Input type="hidden" id="hidstoid" value="{$Think.request.stoid}">
<Input type="hidden" id="prom_num" value="{$goods_num}">
<Input type="hidden" id="prom_onlybuynum" value="{$onlybuynum}">
<Input type="hidden" id="fstore_limit" value="{$limit_num}">
<Input type="hidden" id="ulx" value="{:session('ulx'.session('user')['user_id'])}">
<Input type="hidden" id="uly" value="{:session('uly'.session('user')['user_id'])}">
<!----QQ客服--->
<div class="qqkefu dn">
<ul id="fqqlist"></ul>
</div>
<!-- 是否默认门店 -->
<if condition="$de_pick">
<Input type="hidden" id="is_def" value="1">
<Input type="hidden" id="def_pick" value="{$de_pick.pickup_id}">
<Input type="hidden" id="def_pick_name" value="{$de_pick.pickup_name}">
</if>
<script type="text/javascript">
var stoid="<?php echo I("stoid") ?>";
var id="<?php echo I("id")?>";
var distr_type="{$goods['distr_type']}";
var qqlist="{$tpshop_config['qqlist']}";
//商品起始库存
var store_count ={$goods.store_count};
var rlen ="{$len}";
var store_limit=$("#fstore_limit").val();
var prom_num=$("#prom_num").val();
var prom_onlybuynum=$("#prom_onlybuynum").val();
var selectnum=1;
/*---门店相关---*/
<empty name="store">
var list="";
<else>
var list={$storejs};
</empty>
var selectpid="";
var selectpiccount=-1;
function switch_spec(spec) {
$(spec).siblings().removeClass('hover');
$(spec).addClass('hover');
$(spec).siblings().children('input').prop('checked', false);
$(spec).children('input').prop('checked', true);
//更新商品价格
get_goods_price();
}
function get_goods_price() {
var goods_price = {$goods.shop_price}; // 商品起始价
var store_count = {$goods.store_count}; // 商品起始库存
//var spec_goods_price = {$spec_goods_price}; // 规格 对应 价格 库存表 //alert(spec_goods_price['28_100']['price']);
/*--如果有属性选择项
if (spec_goods_price != null) {
goods_spec_arr = new Array();
$("input[name^='goods_spec']:checked").each(function() {
goods_spec_arr.push($(this).val());
});
var spec_key = goods_spec_arr.sort(sortNumber).join('_'); //排序后组合成 key
goods_price = spec_goods_price[spec_key]['price']; // 找到对应规格的价格
store_count = spec_goods_price[spec_key]['store_count']; // 找到对应规格的库存
}--*/
var goods_num = parseInt($("#goods_num").val());
// 库存不足的情况
if (goods_num > store_count) {
goods_num = store_count;
alert('库存仅剩 ' + store_count + ' 件');
$("#goods_num").val(goods_num);
}
$("#goods_price").html('¥' + goods_price); // 变动价格显示
}
function sortNumber(a, b) {
return a - b;
}
function ajaxComment(commentType, page) {
var i0=layer.open({type:2});
$.ajax({
type: "GET",
url: "/index.php?m=Mobile&c=goods&a=ajaxComment&goods_id={$goods['goods_id']}&commentType=" + commentType + "&p=" + page+"&stoid="+$("#hidstoid").val(), //+tab,
success: function(data) {
$("#ECS_COMMENT").empty().append(data);
layer.close(i0);
}
});
}
/*-----------------定位相关------------------*/
var issortsto="{$is_sort_storage}";
function ismobile(test) {
var u = navigator.userAgent, app = navigator.appVersion;
if (/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))) {
if (window.location.href.indexOf("?mobile") < 0) {
try {
if (/iPhone|mac|iPod|iPad/i.test(navigator.userAgent)) {
return '0';
} else {
return '1';
}
} catch (e) { }
}
} else if (u.indexOf('iPad') > -1) {
return '0';
} else {
return '1';
}
};
var ii0=0;
//获取经纬度
function getCurLocation() {
navigator.geolocation.getCurrentPosition( // 该函数有如下三个参数
function (pos) { // 如果成果则执行该回调函数
var x = pos.coords.longitude;
var y = pos.coords.latitude;
mapshow(x,y);
}, function (err) { // 如果失败则执行该回调函数
//layer.open({content:'定位失败',time:2});
mapshow(0,0);
}, { // 附带参数
enableHighAccuracy: false, // 提高精度(耗费资源)
timeout: 5000, // 超过timeout则调用失败的回调函数
maximumAge: 1000 // 获取到的地理信息的有效期,超过有效期则重新获取一次位置信息
}
);
}
var isapple=false;
if (ismobile(1)=="0"){
isapple=true;
}
/*--显示门店--*/
// function mapshow(x,y) {
// var is_def=$("#is_def").val();
// /*---新增20171016,获取门店---*/
// $.ajax({
// type: "GET",
// url: "/index.php?m=Mobile&c=activity&a=getStorageList&stoid="+stoid+"&goodsid="+id+"&lx="+x+"&ly="+y+"&distr_type="+distr_type,//+tab,
// success: function (data) {
// layer.close(ii0);
// if(data.code==1){
// if(data.type==1){
// list=data.mini;
// var htm=""; var len=0;
// for (var i in list) {
// len++;
// htm += "<li onclick='setpickup(this)' pid='" + list[i]['pickup_id'] + "'>" + list[i]['pickup_name'] + "</li>";
// }
// $("#addr_catlist").html(htm);
//
// if(is_def){
// $("#fselestore").text($("#def_pick_name").val());
// selectpid = $("#def_pick").val();
// }
//
// if ((issortsto == 1 && (x!=0 || y!=0)) || len == 1) {
// if(!is_def) {
// var ele = list[0];
// $("#fselestore").text(ele.pickup_name);
// selectpid = ele.pickup_id;
// }
// }
// }else {
// list = data.store;
// var htm = "";
// for (var i in list) {
// htm += "<li sid='" + list[i].cat_id + "'>" + list[i].cat_name + "</li>";
// }
// $("#addr_catlist").html(htm);
//
// if(is_def){
// $("#fselestore").text($("#def_pick_name").val());
// selectpid = $("#def_pick").val();
// }
// /*---最小值拿出来---*/
// if (x != 0 || y != 0) {
// if (issortsto == 1 && !is_def) {
// var ele = data.min;
// $("#fselestore").text(ele.pickup_name);
// selectpid = ele.pickup_id;
// }
// }
// }
//
// /*--选择线下门店--*/
// $(".layermbox .area .addr-name li").click(function () {
// var id=parseInt($(this).attr("sid"));
// var htm="";
// /*----判断是否采用了线下库存----*/
// if(data.is_bline==0) {
// var ary;
// for(var i in list){
// if(list[i]["cat_id"]==id){
// ary= list[i];
// break;
// }
// }
// var cary = ary["list"];
// for (var i = 0; i < cary.length; i++) {
// if (cary[i]['count'] != undefined && cary[i]['count'] != null && cary[i]['count'] != "") {
// htm += "";
// } else {
// htm += "<li onclick='setpickup(this)' pid='" + cary[i]['pickup_id'] + "'>" + cary[i]['pickup_name'] + "</li>";
// }
// }
// }
//
// $("#fcat_name").text(ary['cat_name']);
// $("#pickuplist").html(htm);
// $("#ffgoods_num").val("1");
// $(".layermbox .area").addClass("dn");
// $(".layermbox .attribute").addClass("dn");
// $(".layermbox .store").removeClass("dn");
// });
//
// }
// else {
// $(".nokill").text('未找到门店');
// $(".nokill").show();
// $("#normal").hide();
// }
// }
// });
// }
/***
* 程序入口
*/
$(document).ready(function() {
if(parseInt(prom_onlybuynum)<=0 || parseInt(rlen)<=0 ){
$("#saleout").fadeIn(3);
$("#normal").fadeOut(3);
}
//新增20171207
$.ajax({
type: "GET",
url: "/index.php?m=Mobile&c=Cart&a=getNum&stoid="+stoid,//+tab,
success: function (data) {
$('#tp_cart_info').html(data);
},
error:function () {
$('#tp_cart_info').html("0");
}
});
/*--qq客服--*/
if (qqlist != undefined && qqlist!="") {
var list = qqlist.split(",");
var htm = "";
for (var i = 0; i < list.length; i++) {
htm += "<li><a target='_blank' href='http://wpa.qq.com/msgrd?v=3&uin=" + list[i] + "&site=qq&menu=yes'>客服"
+ (i + 1) + "<a></li>"
}
$("#fqqlist").html(htm);
}
//--判断整个页面的高度--
var hei=$("body").height();
var whei=window.innerHeight;
if(hei<=whei){
load_detail();
}
//--评价--
get_pj_fir();
//--加载更多--
$("#getmore").hide();
//getGoodsList();
});
/*--商品的数量的加减--*/
function goods_cut(){
selectpid=my_sele_pkid;
if(selectpid==""){
layer.open({content:'请先选择门店',time:2});
return;
}
var num_val=document.getElementById('ffgoods_num');
var new_num=num_val.value;
var Num = parseInt(new_num);
if(Num>1)Num=Num-1;
num_val.value=Num;
selectnum=Num;
}
function goods_add(){
selectpid=my_sele_pkid;
if(selectpid==""){
layer.open({content:'请先选择门店',time:2});
return;
}
var num_val=document.getElementById('ffgoods_num');
var new_num=num_val.value;
var Num = parseInt(new_num);
Num=Num+1;
/*--判断库存--*/
if (Num > store_count) {
layer.open({content: '购买数量超出库存', time: 2});
num_val.value = Num - 1;
return;
}
/*--判断活动商品数量是否超出--*/
if(prom_onlybuynum!="" && Num>parseInt(prom_onlybuynum)){
layer.open({content:'购买数量超出活动商品的数量',time:2});
num_val.value=Num-1;
return;
}
/*--判断限购--*/
if(store_limit!=""&&Num>parseInt(store_limit)){
layer.open({content:'购买数量超出抢购的限购数量',time:2});
num_val.value=Num-1;
return;
}
num_val.value=Num;
selectnum=Num;
}
//购买类别,加入购物车和立即购买
function setbuytype(i) {
$("#fselePop").removeClass("dn");
$("#fsumbitbtn").attr("type",i+"");
}
//购买按钮
function checkup(ob) {
selectpid=my_sele_pkid;
if(selectpid==""){
layer.open({content:'请先选择门店',time:2});
return;
}
var num_val=document.getElementById('ffgoods_num');
var new_num=num_val.value;
var Num = parseInt(new_num);
/*--判断库存--*/
if (Num > store_count) {
layer.open({content: '购买数量超出库存', time: 2});
return;
}
/*--判断活动商品数量是否超出--*/
if(prom_onlybuynum!="" && Num>parseInt(prom_onlybuynum)){
layer.open({content:'购买数量超出活动商品的数量',time:2});
return;
}
/*--判断限购--*/
if(store_limit!=""&&Num>parseInt(store_limit)){
layer.open({content:'购买数量超出抢购的限购数量',time:2});
return;
}
var url='/index.php/mobile/Activity/g_rdlen/id/{$group_buy_info.id}/stoid/{$Think.request.stoid}';
var r = ajax_return(url, null, false, 'post', 2);
if (r.code==1){
if(r.len==0){
$(ob).text("提交");
layer.open({content:'商品已抢光',time:2});
return false;
}else{
if(selectnum>r.len){
$(ob).text("提交");
layer.open({content:'购买数量超出抢购库存',time:2});
return false;
}
}
}
var text=$(ob).text();
if(text=="提交中"){
return false;
}
$(ob).text("提交中");
selectnum=Num;
var t=$(ob).attr("type");
if(t=="0") {
AjaxAddCart4(id,selectnum,0,selectpid)
}else{
AjaxAddCart4(id,selectnum,1,selectpid)
}
}
/**
* addcart 将商品加入购物车
* @goods_id 商品id
* @num 商品数量
* @pick_up 取货门店
* @form_id 商品详情页所在的 form表单
* @to_catr 加入购物车后再跳转到 购物车页面 默认不跳转 1 为跳转
* layer弹窗插件请参考http://layer.layui.com/mobile/
*/
function AjaxAddCart4(goods_id,num,to_catr,pick_up)
{
var getstoid = $("#hidstoid").val();
var goods_list = $('#goods_list').val();//针对搭配促销商品
var ii = layer.open({type: 2, shadeClose: false});
var timestamp = Date.parse(new Date());
var isinte0=$('#is_inte_normal').val();
var ispd0=0;
var is_pt=0;
var pdid=0; //拼单的活动ID
//积分购普通购买
if(isinte0==undefined) isinte0=0;
//拼单普通购买
if(to_catr==66) { to_catr=1;ispd0=1;}
//拼单开单
if(to_catr==4) { to_catr=1,is_pt=1} //商家参团
if(to_catr==5) { to_catr=1,is_pt=2} //会员开团
if(to_catr==6) { to_catr=1,is_pt=3} //阶梯开团
if("undefined" !=typeof(pd_promid)){ pdid=pd_promid;}
setTimeout(function () {
//如果有商品规格 说明是商品详情页提交
if ($("#buy_goods_form").length > 0) {
$.ajax({
type: "POST",
url: "/index.php?m=Mobile&c=Cart&a=ajaxAddCart&stoid=" +
getstoid + "&goods_id=" + goods_id + "&pickup_id=" + pick_up + "&goods_num=" + num + "&to_catr=" + to_catr + "&stime=" + timestamp + "&goods_list=" + goods_list,
data: {isinte:isinte0,ispd:ispd0},// 你的formid 搜索表单 序列化提交
dataType: 'json',
success: function (data) {
// 加入购物车后再跳转到 购物车页面
if (data.status < 0) {
$(".layermbox").addClass("dn");
layer.close(ii);
layer.open({content: data.msg, skin: 'msg', time: 2});
if (data.status == -101) {
location.href = "/index.php?m=Mobile&c=User&a=login&stoid="
+ getstoid + "&oldurl=" + encodeURIComponent(location.href);
}
if (data.status == -5) {
setTimeout(function () {
location.href = "/index.php?m=Mobile&c=cart&a=cart&stoid=" + getstoid ;
},2000)
}
$("#fsumbitbtn").text("确定");
return false;
}
$("#fsumbitbtn").text("确定");
$(".layermbox").addClass("dn");
if (to_catr == 1) //直接购买
{
layer.close(ii);
location.href = "/index.php?m=Mobile&c=Cart&a=cart2&stoid=" + getstoid + "&tocart=1&is_pt="+is_pt+"&pdid="+pdid;
}
else if (to_catr == 2) //积分购
{
layer.close(ii);
location.href = "/index.php?m=Mobile&c=Cart&a=cart5&stoid=" + getstoid + "&tocart=2";
}
else if (to_catr == 3) //赠送他人
{
layer.close(ii);
//location.href = "/index.php?m=Mobile&c=Cart&a=cart5&stoid=" + getstoid + "&tocart=2";
location.href = "/index.php/Mobile/giftuser/senduser/stoid/" + getstoid + "/tocart/1";
}
else {
layer.close(ii);
var cart_num = parseInt($('#tp_cart_info').html()) + parseInt(num);
$('#tp_cart_info').html(cart_num);
my_msg2("添加购物车成功",1);
/*许程 2019/12/13
var i = layer.open({
content: '添加成功!',
shadeClose: false,
btn: ['再逛逛', '去购物车'],
yes: function () {
layer.closeAll();
location.href = "/index.php?m=Mobile&c=index&a=index&stoid=" + getstoid + "";
}, no: function () {
location.href = "/index.php?m=Mobile&c=Cart&a=cart&stoid=" + getstoid + "";
}
});*/
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
$("#fsumbitbtn").text("确定");
layer.close(ii);
layer.open({content: '网络繁忙,正在刷新页面', time: 2});
setTimeout(function () {
//location.href = location.href;
}, 1500);
},
});
}else{ //否则可能是商品列表页 、收藏页商品点击加入购物车
$.ajax({
type : "POST",
url:"/index.php?m=Home&c=Cart&a=ajaxAddCart&stoid="+getstoid+"",
data :{goods_id:goods_id,goods_num:num} ,
dataType:'json',
success: function(data){
if(data.status == -1)
{
//layer.open({content: data.msg,time: 2});
location.href = "/index.php?m=Mobile&c=Goods&a=goodsInfo&id="+goods_id+"&stoid="+getstoid+"";
}
else
{
$("#fsumbitbtn").text("确定");
$(".layermbox").addClass("dn");
if(data.status < 0)
{
layer.open({content:data.msg, time:2});
return false;
}
cart_num = parseInt($('#tp_cart_info').html())+parseInt(num);
$('#tp_cart_info').html(cart_num)
layer.open({content: data.msg,time: 1});
return false;
}
},error: function(XMLHttpRequest, textStatus, errorThrown) {
layer.close(ii);
layer.open({content:'网络繁忙,正在刷新页面',time: 2});
setTimeout(function () {
//location.href=location.href;
},1500);
},
});
}
},400);
}
/*--qq客服--*/
function showQQList() {
<if condition="$is_chat eq 1">
window.location.href="/mchat/mbchat/index?goods_id={$Think.request.id}&stoid={$Think.request.stoid}";
<else/>
$(".qqkefu").fadeToggle();
</if>
}
/*--微信图片预览 --*/
$(document).on('click', '#sliderlist img.pic_img',function(event) {
var imgArray = [];
var curImageSrc = $(this).attr('src');
var oParent = $(this).parent();
if (curImageSrc) {
$('#sliderlist img.pic_img').each(function(index, el) {
var itemSrc = $(this).attr('src');
imgArray.push(itemSrc);
});
wx.previewImage({
current: curImageSrc,
urls: imgArray
});
}
});
/*--微信图片预览 评价的图片预览--*/
$(document).on('click', '#sliderlist img.pic_img',function(event) {
var imgArray = [];
var curImageSrc = $(this).attr('src');
var oParent = $(this).parent();
if (curImageSrc) {
$('#sliderlist img.pic_img').each(function(index, el) {
var itemSrc = $(this).attr('src');
imgArray.push(itemSrc);
});
wx.previewImage({
current: curImageSrc,
urls: imgArray
});
}
});
/*--微信图片评价中的图片预览 --*/
$(document).on('click', '.iddle-goods-img .goods-img-nyf',function(event) {
var imgArrays = [];
var curImageSrcs = $(this).attr('src');
var oParent = $(this).parent();
if (curImageSrcs) {
$('.iddle-goods-img .goods-img-nyf').each(function(index, el) {
var itemSrc = $(this).attr('src');
imgArray.push(itemSrc);
});
wx.previewImage({
current: curImageSrcs,
urls: imgArrays
});
}
});
///滑动到底部事件
$(document).unbind("scroll");
$(document).bind("scroll", function (event) {
if ($(document).scrollTop()+50 >= $(document).height() - window.innerHeight) {
var html= $("#mubiao").html();
if(html==""){
var htm = $('.product_main').html();
if ($.trim(htm) == "") {
load_detail();
}
}else{
getGoodsList();
}
}
});
var d_loading=0;
function load_detail() {
if(d_loading) return false;
d_loading=1;
var i0=layer.open({type:2,shadeClose: false});
$.ajax({
type: "GET",
url: "/index.php?m=Mobile&c=goods&a=ajaxdetail&stoid=" + stoid+"&goods_id="+id,//+tab,
success: function (data) {
if($.trim(data)=="") data=" ";
$('.product_main').html(data);
$("#mubiao").html(data);
layer.close(i0);
d_loading=0;
}
});
}
/* --点击图片播放视频---*/
function play_video(ob) {
$("#navBox").hide();
var v_url=$(ob).attr("v_url");
$("#show_video").show();
$("#movie").attr("src",v_url);
var movie=document.getElementById("movie");
movie.play();
}
//----关闭视频播放-----
$(".video_close").click(function () {
$("#show_video").hide();
$("#navBox").show();
});
var pj_fir_data=null;
//获取评价的初始值
function get_pj_fir() {
$("#jr_pj_num").text(0);
var url="{$mini_host}/api/weshop/comment/countlist?store_id="+stoid+"&goods_id="+id;
$.ajax({
type: "GET",
url:url,
success: function (data) {
if(data.code==0){
var dd= [{ name: "全部",id: 1, num: 0 },{ name: "有图", id: 5,num: 0 },
{ name: "好评",id: 2, num: 0 }, { name: "中评",id: 3, num: 0 }, {
name: "差评", id: 4,num: 0
}, ];
var g = data.data[0];
var allnum = g.c0 + g.c1 + g.c2 + g.c3 + g.c4 + g.c5;
var num2 = g.c4 + g.c5;
var num3 = g.c3;
var num4 = g.c0 + g.c1 + g.c2;
dd[0].num = allnum;
if(allnum>0){
dd[1].num = g.cimg;
dd[2].num = num2;
dd[3].num = num3;
dd[4].num = num4;
pj_fir_data=dd;
$("#all_pj_text").text(allnum);
$("#jr_pj_num").text(allnum);
$("#pj_good").text("("+dd[2].num+")");
$("#pj_zhon").text("("+dd[3].num+")");
$("#pj_bad").text("("+dd[4].num+")");
$("#pj_has_img").text("("+dd[1].num+")");
$("#bbpj_div").show();
}
}
}
});
url="/mobile/goods/get_pj_list?stoid="+stoid+"&goods_id="+id+"&pageSize=3&parent_id=0&page=1";
//----获取3条-----
$.ajax({
type: "GET",
url:url,
success: function (data) {
$("#pj_list").html(data);
var swiper = new Swiper('#pj_swiper', {
slidesPerView:"1.22",//容器的数量
spaceBetween: 1,//框之间的距离
pagination: {
el: '.swiper-pagination',
clickable: true,
},
});
}
});
}
var user_id="{$tpshop_config['user_id']}";
var zaning=0;//控制点赞的状态
//--点赞功能---
function dian_zan(ob) {
if(user_id==""){
my_msg2("您还未绑定登陆",0);
return;
}
if(zaning) return false;
zaning=1;
var com_id=$(ob).attr("com_id");
var zannum= parseInt($(ob).find(".parameter-val").text());
var url="{$mini_host}/api/weshop/commentZan/save?store_id="+
stoid+"&goods_id="+id+"&comment_id="+com_id+"&user_id="+user_id;
var ty=$(ob).find("img").attr('ty');
//----获取3条-----
$.ajax({
type: "POST",
url:url,
success: function (data) {
zaning=0;
if(data.code==0){
if(data.msg=='点赞成功!'){
$(ob).find("img").attr('ty',0);
$(ob).find("img").attr("src","__STATIC__/images/weixin/dianzanred.png");
$(ob).find(".parameter-val").css('color',"#d60022");
zannum=zannum+1;
}else{
$(ob).find(".parameter-val").css('color',"#8a8a8a");
$(ob).find("img").attr('ty',1);
$(ob).find("img").attr("src","__STATIC__/images/weixin/dianzane.png");
zannum=zannum-1;
}
$(ob).find(".parameter-val").text(zannum);
}else{
my_msg2(data.msg,0);
}
}
});
}
//--点击评价按钮跳转---
function go_pj(ind) {
var name='goods_ka',i=3;
for(i=1;i<=3;i++){
var menu=document.getElementById(name+i);
var con=document.getElementById("user_"+name+"_"+i);
menu.className=i==3?"on":"";
con.style.display=i==3?"block":"none";
}
$(".comment_nav li ").removeClass("bs");
switch(ind){
case 5:
$("#com_img_li").addClass("bs");
break;
case 2:
$("#com_gd_li").addClass("bs");
break;
case 3:
$("#xc-li").addClass("bs");
break;
case 4:
$("#com_bd_li").addClass("bs");
break;
}
ajaxComment(ind, 1);
}
//--评价的标题栏的点击作用--
$(".comment_nav li ").click(function(){
$(".comment_nav li ").removeClass("bs");
$(this).addClass("bs");
var $commentType = $(this).attr('ctype');
ajaxComment($commentType, 1);// ajax 加载评价列表
});
var page_md=1;
var gooding=0;
var nomore_pG=0;
function getGoodsList() {
if(gooding) return false;
if(nomore_pG) return false;
gooding=1;
$('.get_more').show();
$('#getmore').hide();
$.ajax({
type: "get",
url: "/index.php?m=Mobile&c=Index&a=ajaxGetMore&p=" + page_md + "&stoid=<?php echo getMobileStoId()?>",
success: function (data) {
$('.get_more').hide();
if (data) {
gooding=0;
$("#J_ItemList>ul").append(data);
page_md++;
} else {
$('#getmore').remove(); nomore_pG=1;
}
},
error:function(XMLHttpRequest, textStatus, errorThrown){
gooding=0;
$("#ferweimap").hide();
}
});
}
</script>
<script src="__PUBLIC__/js/jqueryUrlGet.js"></script>
<!--获取get参数插件-->
<script>
set_first_leader(); //设置推荐人
</script>
<!-- 微信浏览器 调用微信 分享js-->
<include file="public/wx_share" />
<!-- 微信浏览器 调用微信 分享js end-->
<!--分享生成图片-->
<include file="public/openShare"/>
</body>
</html>