移动系统liao
2024-05-09 5d6cb15ac86d9174393cb9d1538d69b567e2c26c
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
<template>
    <view>
        <u-toast ref="uToast" /><u-no-network></u-no-network>
        <u-navbar title="拼团详情" safeAreaInsetTop fixed placeholder>
            <view class="coreshop-navbar-left-slot" slot="left">
                <u-icon name="arrow-left" size="19" @click="goNavigateBack"></u-icon>
                <u-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
                <u-icon name="home" size="22" @click="goHome"></u-icon>
            </view>
            <view slot="right">
            </view>
        </u-navbar>
 
        <!--幻灯片-->
        <view class="coreshop-full-screen-banner-swiper-box">
            <u-swiper height="calc(750rpx * 6 / 6)" radius="0" :list="goodsInfo.album" :autoplay="autoplay" indicator indicatorMode="line" circular @click="clickImg"></u-swiper>
        </view>
 
        <view class="coreshop-margin-left-8 coreshop-margin-right-8  coreshop-margin-top-12 coreshop-padding-8 coreshop-border-radius-9 coreshop-bg-white">
            <view class="coreshop-flex coreshop-justify-between coreshop-align-center">
                <view class="coreshop-text-red coreshop-font-weight-bold">
                    <text class="coreshop-font-16">¥</text>
                    <text class="coreshop-font-24">{{ price || '0.00' }}</text>
                </view>
                <view class="coreshop-flex coreshop-text-left coreshop-justify-center coreshop-align-center">
                    <view class="coreshop-text-right coreshop-time-right" v-if="goodsInfo.pinTuanRule && goodsInfo.pinTuanRule.pinTuanStartStatus == 1">
                        <u-count-down :time="goodsInfo.pinTuanRule.lastTime*1000" :autoStart="true" :millisecond="true" format="DD天HH时mm分ss秒" @change="onChange">
                            <view class="time">
                                <view class="coreshop-font-12">仅剩:</view>
                                <view class="time__custom">
                                    <text class="time__custom__item">{{ timeData.days }}</text>
                                </view>
                                <text class="time__doc">天</text>
                                <view class="time__custom">
                                    <text class="time__custom__item">{{ timeData.hours>=10?timeData.hours:'0'+timeData.hours}}</text>
                                </view>
                                <text class="time__doc">:</text>
                                <view class="time__custom">
                                    <text class="time__custom__item">{{ timeData.minutes }}</text>
                                </view>
                                <text class="time__doc">:</text>
                                <view class="time__custom">
                                    <text class="time__custom__item">{{ timeData.seconds }}</text>
                                </view>
                            </view>
                        </u-count-down>
                    </view>
                    <view class="coreshop-text-right coreshop-time-right" v-if="goodsInfo.pinTuanRule && goodsInfo.pinTuanRule.pinTuanStartStatus == 2">
                        <u-count-down :time="goodsInfo.pinTuanRule.lastTime*1000" :autoStart="true" :millisecond="true" format="DD天HH时mm分ss秒" @change="onChange">
                            <view class="time">
                                <view class="coreshop-font-12">即将开团:</view>
                                <view class="time__custom">
                                    <text class="time__custom__item">{{ timeData.days }}</text>
                                </view>
                                <text class="time__doc">天</text>
                                <view class="time__custom">
                                    <text class="time__custom__item">{{ timeData.hours>=10?timeData.hours:'0'+timeData.hours}}</text>
                                </view>
                                <text class="time__doc">:</text>
                                <view class="time__custom">
                                    <text class="time__custom__item">{{ timeData.minutes }}</text>
                                </view>
                                <text class="time__doc">:</text>
                                <view class="time__custom">
                                    <text class="time__custom__item">{{ timeData.seconds }}</text>
                                </view>
                            </view>
                        </u-count-down>
                    </view>
                </view>
            </view>
            <view class="coreshop-margin-top-12 coreshop-multiple-line-clamp">
                <text class="coreshop-font-16 coreshop-text-black coreshop-font-weight-bold">{{ goodsInfo.name || '' }}</text>
            </view>
            <view class="coreshop-margin-top-8 coreshop-multiple-line-clamp">
                <text class="coreshop-font-14 coreshop-text-gray">{{ goodsInfo.brief || '' }}</text>
            </view>
            <view class="coreshop-flex coreshop-margin-top-8" v-if="goodsInfo.brand || goodsInfo.labels">
                <u-tag :text="goodsInfo.brand.name" v-if="goodsInfo.brand"></u-tag>
                <view class="coreshop-margin-left-6" v-for="item in goodsInfo.labels" :key="item.id">
                    <u-tag :text="item.name" :bgColor="item.style" :borderColor="item.style"></u-tag>
                </view>
            </view>
            <view class="coreshop-margin-top-8 coreshop-padding-top-16 coreshop-solid-top coreshop-flex coreshop-justify-between coreshop-align-center coreshop-text-gray">
                <view class="coreshop-font-12">
                    <text>已售:</text>
                    <text class="font-color-orange">{{ goodsInfo.buyPinTuanCount || '0' }}</text>
                </view>
                <view class="coreshop-font-12">
                    <u-icon name="share-fill" size="18" label="分享" :labelSize="12" labelPos="right" @click="goShare"></u-icon>
                </view>
                <view class="coreshop-font-12">
                    <u-icon name="star-fill" :size="18" label="收藏" :labelSize="12" labelPos="right" @click="collection" v-if="isfav"></u-icon>
                    <u-icon name="star" :size="18" label="收藏" :labelSize="12" labelPos="right" @click="collection" v-else></u-icon>
                </view>
            </view>
        </view>
 
 
        <view class="coreshop-margin-left-8 coreshop-margin-right-8  coreshop-margin-top-12 coreshop-padding-8 coreshop-border-radius-9 coreshop-bg-white">
            <!--服务-->
            <view class="coreshop-flex coreshop-flex-wrap coreshop-font-sm coreshop-flex-direction-row" @tap="serviceTap" v-if="serviceDescription.service.length>0">
                <view class="coreshop-basis-2">
                    <text class="coreshop-text-black coreshop-font-weight-bold coreshop-font-15">服务</text>
                </view>
                <view class="coreshop-basis-7 coreshop-flex coreshop-align-center">
                    <view class="coreshop-flex coreshop-flex-wrap coreshop-font-sm coreshop-flex-direction-row coreshop-align-center">
                        <u-icon name="checkmark-circle" size="12" labelSize="12" color="#e54d42" :label="item.title" v-for="(item, index) in serviceDescription.service" :key="index" class="coreshop-margin-right-10"></u-icon>
                    </view>
                </view>
                <view class="coreshop-basis-1">
                    <view class="coreshop-float-right">
                        <u-icon name="arrow-right"></u-icon>
                    </view>
                </view>
            </view>
            <!--发货/规格-->
            <view class="coreshop-solid-bottom coreshop-margin-top-10 coreshop-margin-bottom-10" v-if="serviceDescription.delivery.length>0" />
            <view class="coreshop-flex coreshop-flex-wrap coreshop-font-sm  coreshop-padding-top-10 coreshop-flex-direction-row" v-if="serviceDescription.delivery.length>0">
                <view class="coreshop-basis-2">
                    <text class="coreshop-text-black coreshop-font-weight-bold coreshop-font-15">发货</text>
                </view>
                <view class="coreshop-coreshop-basis-8 coreshop-flex coreshop-align-center">
                    <text class="coreshop-font-sm" v-for="(item, index) in serviceDescription.delivery" :key="index">{{item.description}}</text>
                </view>
            </view>
 
        </view>
 
        <!-- 团购拼单 -->
        <view class="coreshop-margin-left-8 coreshop-margin-right-8  coreshop-margin-top-12 coreshop-padding-8 coreshop-border-radius-9 coreshop-bg-white">
            <view class="coreshop-margin-bottom-16">
                <text class="coreshop-text-black coreshop-font-weight-bold coreshop-font-15">开团信息</text>
            </view>
            <view class="coreshop-cell-group coreshop-margin-top-10 coreshop-margin-bottom-10" v-if="pinTuanRecord.length > 0">
                <view class="coreshop-cell-item right-img">
                    <view class="coreshop-cell-item-hd">
                        <view class="coreshop-cell-hd-title">{{ teamCount || '0' }}人在拼单,可直接参与</view>
                    </view>
                </view>
                <view class="group-swiper">
                    <swiper class="group-swiper-c" :class="swiperSet.groupHeight" :indicator-dots="swiperSet.indicatorDots" :autoplay="swiperSet.autoplay" vertical="true" circular="true" :interval="swiperSet.interval" :duration="swiperSet.duration">
                        <swiper-item v-for="(item, index) in pinTuanRecord" :key="index">
                            <view class="swiper-item">
                                <view class="coreshop-cell-item" :class="item[0].isOverdue?'coreshop-lower-shelf':''">
                                    <view class="coreshop-cell-item-bd">
                                        <view class="coreshop-cell-bd-view">
                                            <text class="coreshop-cell-bd-text coreshop-font-xs">
                                                还差
                                                <text class="coreshop-text-red">{{ item[0].teamNums || '' }}人</text>
                                                拼成
                                            </text>
                                        </view>
                                        <view class="coreshop-cell-bd-view coreshop-text-center coreshop-flex coreshop-flex-nowrap coreshop-justify-center coreshop-align-center">
                                            <text class="coreshop-font-xs">剩余:</text>
                                            <u-count-down :time="item[0].lastTime * 1000 " class="coreshop-font-11"></u-count-down>
                                        </view>
                                    </view>
                                    <view class="img-lower-box" :class="item[0].isOverdue?'coreshop-lower-box':''" v-if="item[0].isOverdue">已结束</view>
                                    <view class="coreshop-cell-item-hd">
                                        <u-avatar-group :urls="item[0].teams" keyName="userAvatar" size="35" gap="0.2" random-bg-color="true"></u-avatar-group>
                                    </view>
                                    <view class="coreshop-cell-item-ft">
                                        <u-button type="success" size="mini" @click="selectTap(2, item[0].teamId)" v-if="!item[0].isOverdue">去拼单</u-button>
                                        <u-button type="default" size="mini" v-if="item[0].isOverdue">已结束</u-button>
                                    </view>
                                </view>
                                <view class="coreshop-cell-item" v-if="item[1]" :class="item[1].isOverdue?'coreshop-lower-shelf':''">
                                    <view class="coreshop-cell-item-bd">
                                        <view class="coreshop-cell-bd-view">
                                            <text class="coreshop-cell-bd-text coreshop-font-xs">
                                                还差
                                                <text class="coreshop-text-red">{{ item[1].teamNums || '' }}人</text>
                                                拼成
                                            </text>
                                        </view>
                                        <view class="coreshop-cell-bd-view coreshop-text-center coreshop-flex coreshop-flex-nowrap coreshop-justify-center coreshop-align-center">
                                            <text class="coreshop-font-xs">剩余:</text>
                                            <u-count-down :time="item[1].lastTime * 1000 " class="coreshop-font-11" @end="end(index,1)"></u-count-down>
                                        </view>
                                    </view>
                                    <view class="img-lower-box" :class="item[1].isOverdue?'coreshop-lower-box':''" v-if="item[1].isOverdue">已结束</view>
                                    <view class="coreshop-cell-item-hd">
                                        <u-avatar-group :urls="item[1].teams" keyName="userAvatar" size="35" gap="0.2" random-bg-color="true"></u-avatar-group>
                                    </view>
                                    <view class="coreshop-cell-item-ft">
                                        <u-button type="success" size="mini" @click="selectTap(2, item[1].teamId)" v-if="!item[1].isOverdue">去拼单</u-button>
                                        <u-button type="default" size="mini" v-if="item[1].isOverdue">已结束</u-button>
                                    </view>
                                </view>
                            </view>
                        </swiper-item>
                    </swiper>
                </view>
            </view>
            <view class="coreshop-cell-group coreshop-margin-top-10 coreshop-margin-bottom-10" v-else>
                <view class="coreshop-cell-item right-img">
                    <view class="coreshop-cell-item-hd"><view class="coreshop-cell-hd-title">暂无开团信息</view></view>
                </view>
            </view>
        </view>
 
        <!--评论-->
        <view class="coreshop-margin-left-8 coreshop-margin-right-8  coreshop-margin-top-12 coreshop-padding-8 coreshop-border-radius-9 coreshop-bg-white">
            <view class="coreshop-flex coreshop-flex-wrap coreshop-font-sm coreshop-flex-direction-row">
                <view class="coreshop-basis-3">
                    <text class="coreshop-text-black coreshop-font-weight-bold coreshop-font-15">评价({{commentsCount}})</text>
                </view>
                <view class="coreshop-basis-3"></view>
                <view class="coreshop-basis-4">
                    <view class="coreshop-float-right">
                        <u-icon name="arrow-right" label="查看更多" labelPos="left" labelSize="12px" labelColor="color['u-content-color']" @tap="goGoodComments(goodsInfo.id)"></u-icon>
                    </view>
                </view>
            </view>
            <view v-if="goodsComments.length">
                <view v-for="(item, index) in goodsComments" :key="index">
                    <view class="coreshop-solid-bottom coreshop-margin-top-10 coreshop-margin-bottom-10" />
                    <view class="coreshop-flex coreshop-flex-wrap coreshop-font-sm coreshop-padding-10 coreshop-flex-direction-row">
                        <view class="coreshop-basis-1">
                            <view class="coreshop-avatar sm round" :style="[{backgroundImage:'url('+ item.avatarImage +')'}]" />
                        </view>
                        <view class="coreshop-basis-9 coreshop-font-sm">
                            <view>{{ (item.nickName && item.nickName != '')?item.nickName:item.mobile }}</view>
                            <view class="coreshop-margin-top-10">{{ item.contentBody || ''}}</view>
                            <view class="coreshop-text-gray coreshop-margin-top-5">
                                <u-rate v-model="item.score" :count="5" size="15"></u-rate>
                            </view>
                            <view class="coreshop-margin-top-10" v-if="item.imagesArr">
                                <u-album :urls="item.imagesArr" rowCount="4"></u-album>
                            </view>
                            <view class="coreshop-text-gray coreshop-margin-top-5 coreshop-font-12">{{ item.createTime || ''}} {{ item.addon || ''}}</view>
                            <view class="coreshop-bg-gray coreshop-padding-10 coreshop-border-radius-tr-16 coreshop-margin-top-10" v-if="item.sellerContent">
                                商家回复:{{item.sellerContent}}
                            </view>
                        </view>
                    </view>
                </view>
            </view>
            <view class="coreshop-margin-top-8" v-else>
                <text class="coreshop-text-gray coreshop-font-12">该商品暂无评价</text>
            </view>
        </view>
 
        <!--参数-->
        <view class="coreshop-margin-left-8 coreshop-margin-right-8  coreshop-margin-top-12 coreshop-padding-8 coreshop-border-radius-9 coreshop-bg-white" v-if="goodsParams.length>0">
            <view>
                <text class="coreshop-text-black coreshop-font-weight-bold coreshop-font-15">参数</text>
            </view>
            <view class="goods-param-box">
                <view class="goods-param-line" v-for="(item, index) in goodsParams" :key="index">
                    <view class="name">
                        <text>{{item.name}}</text>
                    </view>
                    <view class="value">
                        <text>{{item.value}}</text>
                    </view>
                </view>
            </view>
        </view>
 
        <!--内容区-->
        <view class="coreshop-margin-top-8 coreshop-margin-bottom-12 coreshop-flex coreshop-justify-center coreshop-align-center">
            <view class="line-70"></view>
            <view class="coreshop-margin-left-12 coreshop-margin-right-12 coreshop-text-gray">详情介绍</view>
            <view class="line-70"></view>
        </view>
        <view class="coreshop-margin-top-10 coreshop-bg-white">
            <u-parse :content="goodsInfo.intro" :selectable="true" v-if="goodsInfo.intro"></u-parse>
            <!-- 无数据时默认显示 -->
            <view class="coreshop-emptybox coreshop-padding-10" v-else>
                <u-empty :icon="$globalConstVars.apiFilesUrl+'/static/images/empty/data.png'" icon-size="150" text="详情为空" mode="list"></u-empty>
            </view>
        </view>
 
        <!--单个拼团数据展示-->
        <u-popup mode="bottom" :show="pinTuanpop" closeable="true" @close="pinTuanHiiden()">
            <view class="ig-top" v-if="teamInfo.teams.length > 0">
                <view class="coreshop-flex coreshop-align-center coreshop-justify-center coreshop-margin-bottom-10">
                    <view class="">
                        剩余时间:
                        <u-count-down :time="teamInfo.lastTime * 1000" :autoStart="true" :millisecond="true" format="DD天HH时mm分ss秒"></u-count-down>
                    </view>
                </view>
                <view class="ig-top-m coreshop-flex coreshop-align-center coreshop-justify-center coreshop-margin-bottom-10">
                    <view class="user-head-img-c" v-for="(item, index) in teamInfo.teams" :key="index">
                        <view class="user-head-img-tip" v-if="item.recordId == item.teamId">拼主</view>
                        <image class="user-head-img coreshop-head-icon " :src="item.userAvatar" mode=""></image>
                    </view>
                    <view class="user-head-img-c uhihn" v-if="teamInfo.teamNums" v-for="n in teamInfo.teamNums" :key="n"><text>?</text></view>
                </view>
                <view class="ig-top-b coreshop-flex coreshop-align-center coreshop-justify-center coreshop-margin-bottom-10 coreshop-flex-direction-column">
                    <view class="igtb-top">
                        还差
                        <text class="coreshop-text-red">{{ teamInfo.teamNums || '' }}</text>
                        人,赶快拼单吧
                    </view>
                    <view class="igtb-mid"><button class="coreshop-btn" @click="selectTap(2, teamInfo.id)">参与拼团</button></view>
                </view>
            </view>
        </u-popup>
 
        <!-- 分享弹窗 -->
        <view class="coreshop-padding-0">
            <u-popup mode="bottom" :show="shareBox" ref="share">
                <!-- #ifdef MP-WEIXIN -->
                <coreshop-share-wx :shareType='$globalConstVars.shareType.pinTuan' :goodsId="goodsInfo.id" :groupId="pinTuanId" :shareTitle="goodsInfo.name" :shareContent="goodsInfo.brief" :shareHref="shareHref" @close="closeShare()"></coreshop-share-wx>
                <!-- #endif -->
                <!-- #ifdef APP-PLUS || APP-PLUS-NVUE -->
                <coreshop-share-app :shareType='$globalConstVars.shareType.pinTuan' :goodsId="goodsInfo.id" :groupId="pinTuanId" :shareTitle="goodsInfo.name" :shareContent="goodsInfo.brief" :shareHref="shareHref" @close="closeShare()"></coreshop-share-app>
                <!-- #endif -->
            </u-popup>
            <div id="qrCode" ref="qrCodeDiv"></div>
        </view>
 
        <!--常见问题-->
        <view class="coreshop-margin-left-8 coreshop-margin-right-8  coreshop-margin-top-12 coreshop-padding-8 coreshop-border-radius-9 coreshop-bg-white">
            <view class="coreshop-margin-bottom-16">
                <text class="coreshop-text-black coreshop-font-weight-bold coreshop-font-15">常见问题</text>
            </view>
            <view class="coreshop-flex coreshop-flex-wrap coreshop-margin-bottom-10 coreshop-flex-direction-row" v-for="(item, index) in serviceDescription.commonQuestion" :key="index">
                <view class="coreshop-basis-2 coreshop-font-13">
                    {{item.title}}
                </view>
                <view class="coreshop-basis-8">
                    <view class="coreshop-font-12">{{item.description}}</view>
                </view>
            </view>
            <view class="coreshop-solid-bottom coreshop-margin-top-10 coreshop-margin-bottom-10" />
            <view class="coreshop-text-center coreshop-text-blue  coreshop-padding-top-10 coreshop-font-13" @tap="goArticleList()">查看更多问题</view>
        </view>
 
 
        <!--为您推荐-->
        <view class="coreshop-margin-top-8 coreshop-margin-bottom-12 coreshop-flex coreshop-justify-center coreshop-align-center" v-if="shopRecommendData.length > 0">
            <view class="line-70"></view>
            <view class="coreshop-margin-left-12 coreshop-margin-right-12 coreshop-text-gray">为您推荐</view>
            <view class="line-70"></view>
        </view>
        <view class="coreshop-margin-left-8 coreshop-margin-right-8 index-goods coreshop-margin-top-10" v-if="shopRecommendData.length > 0">
            <custom-waterfalls-flow :value="shopRecommendData" @wapperClick="wapperClick" @imageClick="imageClick">
                <!-- #ifdef MP-WEIXIN -->
                <view class="goods" v-for="(item,index) in shopRecommendData" :key="index" slot="slot{{index}}">
                    <view class="coreshop-padding-top-6 coreshop-padding-bottom-3 coreshop-padding-left-8 coreshop-padding-right-8 coreshop-bg-white coreshop-border-radius-bl-18">
                        <view class="coreshop-title-294 coreshop-multiple-line-clamp">
                            <!--<image class="coreshop-image-price-tags" src="https://files.cdn.coreshop.cn/static/icon/icon-tag-vip-discount.png"></image>-->
                            <text class="coreshop-font-14">{{item.name}}</text>
                        </view>
                        <view class="coreshop-margin-top-8 coreshop-flex coreshop-justify-between coreshop-align-center">
                            <view class="coreshop-text-red coreshop-font-weight-bold">
                                <text class="coreshop-font-12">¥</text>
                                <text class="coreshop-font-16">{{item.price}}</text>
                                <span class="coreshop-font-xs  coreshop-text-through coreshop-margin-left-6 coreshop-text-gray">{{item.mktprice}}元</span>
                            </view>
                            <view>
                                <text class="coreshop-font-10 coreshop-text-gray">已售{{item.buyCount+item.initialSales}}{{item.unit}}</text>
                            </view>
                        </view>
                        <view class="coreshop-flex coreshop-flex-direction-row coreshop-font-11 coreshop-margin-top-10 coreshop-padding-top-10 coreshop-solid-top" v-if="pointSwitch==1 && pointExchangeModel==2 && pointShowExchangePrice==1 && item.pointsDeduction > 0">
                            <view>
                                {{ pointShowName}}兑换价:
                            </view>
                            <view class="coreshop-text-red">
                                {{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price-item.pointsDeduction).toFixed(2)}} 元
                            </view>
                        </view>
                        <view class="coreshop-flex coreshop-flex-direction-row coreshop-font-11 coreshop-margin-top-5" v-if="pointSwitch==1 && pointGetModel==2 && pointShowPoint==1 && item.points > 0">
                            <view>
                                购买赠送:
                            </view>
                            <view class="coreshop-text-red">
                                {{item.points}}{{ pointShowName}}
                            </view>
                        </view>
                    </view>
                </view>
                <!-- #endif -->
                <!-- #ifndef MP-WEIXIN -->
                <template v-slot:default="item">
                    <view class="goods">
                        <view class="coreshop-padding-top-6 coreshop-padding-bottom-3 coreshop-padding-left-8 coreshop-padding-right-8 coreshop-bg-white coreshop-border-radius-bl-18">
                            <view class="coreshop-title-294 coreshop-multiple-line-clamp">
                                <!--<image class="coreshop-image-price-tags" src="https://files.cdn.coreshop.cn/static/icon/icon-tag-vip-discount.png"></image>-->
                                <text class="coreshop-font-14">{{item.name}}</text>
                            </view>
                            <view class="coreshop-margin-top-8 coreshop-flex coreshop-justify-between coreshop-align-center">
                                <view class="coreshop-text-red coreshop-font-weight-bold">
                                    <text class="coreshop-font-12">¥</text>
                                    <text class="coreshop-font-16">{{item.price}}</text>
                                    <span class="coreshop-font-xs  coreshop-text-through coreshop-margin-left-6 coreshop-text-gray">{{item.mktprice}}元</span>
                                </view>
                                <view>
                                    <text class="coreshop-font-10 coreshop-text-gray">已售{{item.buyCount+item.initialSales}}{{item.unit}}</text>
                                </view>
                            </view>
                            <view class="coreshop-flex coreshop-flex-direction-row coreshop-font-11 coreshop-margin-top-10 coreshop-padding-top-10 coreshop-solid-top" v-if="pointSwitch==1 && pointExchangeModel==2 && pointShowExchangePrice==1 && item.pointsDeduction > 0">
                                <view>
                                    {{ pointShowName}}兑换价:
                                </view>
                                <view class="coreshop-text-red">
                                    {{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price-item.pointsDeduction).toFixed(2)}} 元
                                </view>
                            </view>
                            <view class="coreshop-flex coreshop-flex-direction-row coreshop-font-11 coreshop-margin-top-5" v-if="pointSwitch==1 && pointGetModel==2 && pointShowPoint==1 && item.points > 0">
                                <view>
                                    购买赠送:
                                </view>
                                <view class="coreshop-text-red">
                                    {{item.points}}{{ pointShowName}}
                                </view>
                            </view>
                        </view>
                    </view>
                </template>
                <!-- #endif -->
            </custom-waterfalls-flow>
        </view>
 
        <!--占位底部距离-->
        <view class="coreshop-tabbar-height" />
        <!--底部操作-->
        <view class="coreshop-good-footer-fixed">
            <view class="tabbar">
                <view class="coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-start coreshop-basis-4">
                    <!-- 客服按钮 -->
                    <!-- #ifdef APP-PLUS-NVUE || APP-PLUS -->
                    <view class="action" @click="showChat()">
                        <button class="noButtonStyle">
                            <u-icon name="server-fill" :size="20" label="找客服" :labelSize="12" labelPos="bottom"></u-icon>
                        </button>
                    </view>
                    <!-- #endif -->
                    <!-- #ifdef MP-WEIXIN -->
                    <view class="action">
                        <button open-type="contact" bindcontact="showChat" class="noButtonStyle" :send-message-title="goodsInfo.name" :send-message-path="'/pages/goods/goodDetails/goodDetails?id='+goodsInfo.id" :send-message-img="goodsInfo.image" show-message-card="true">
                            <u-icon name="server-fill" :size="20" label="找客服" :labelSize="12" space="5px" labelPos="bottom"></u-icon>
                        </button>
                    </view>
                    <!-- #endif -->
                    <view class="action" @click="redirectCart">
                        <button class="noButtonStyle">
                            <u-badge type="warning" :value="cartNums" showZero="false" absolute="true" :offset="[1, 4]"></u-badge>
                            <u-icon name="shopping-cart-fill" :size="24" label="购物车" :labelSize="12" space="1px" labelPos="bottom"></u-icon>
                        </button>
                    </view>
                </view>
                <view class="btn-group coreshop-flex coreshop-align-center coreshop-flex-direction-row coreshop-justify-between coreshop-basis-5">
                    <u-button type="error" size="normal" @click="selectTap(1)" shape="square">
                        <view class="coreshop-flex coreshop-flex-direction coreshop-align-center coreshop-line-height-initial">
                            <text class="price">¥{{ product.price || '0' }}</text>
                            <text class="coreshop-font-12">单独购买</text>
                        </view>
                    </u-button>
                    <u-button type="success" size="normal" @click="selectTap(2)" shape="square" v-if="goodsInfo.pinTuanRule && goodsInfo.pinTuanRule.pinTuanStartStatus == 1">
                        <view class="coreshop-flex coreshop-flex-direction coreshop-align-center coreshop-line-height-initial">
                            <text class="price">¥{{ pinTuanPrice || '0' }}</text>
                            <text class="coreshop-font-12">发起拼团</text>
                        </view>
                    </u-button>
                    <u-button type="primary" size="normal" shape="square" v-if="goodsInfo.pinTuanRule && goodsInfo.pinTuanRule.pinTuanStartStatus == 2">
                        <view class="coreshop-flex coreshop-flex-direction coreshop-align-center coreshop-line-height-initial">
                            <text class="price">¥{{ pinTuanPrice || '0' }}</text>
                            <text class="coreshop-font-12">即将开团</text>
                        </view>
                    </u-button>
                    <u-button type="default" size="normal" shape="square" v-if="goodsInfo.pinTuanRule && goodsInfo.pinTuanRule.pinTuanStartStatus == 3">
                        <view class="coreshop-flex coreshop-flex-direction coreshop-align-center coreshop-line-height-initial">
                            <text class="price">¥{{ pinTuanPrice || '0' }}</text>
                            <text class="coreshop-font-12">拼团已结束</text>
                        </view>
                    </u-button>
                </view>
            </view>
        </view>
 
        <!--弹出框-->
        <u-popup class="coreshop-bottom-popup-box" :show="bottomModal" mode="bottom" height="70%" @close="hideModal" :closeable="true">
            <view class="radius coreshop-bg-white">
                <!--标题-->
                <view class="coreshop-text-black coreshop-text-center coreshop-margin-top-15 coreshop-margin-bottom-15 coreshop-font-lg coreshop-title-bar">
                    <text>{{modalTitle}}</text>
                </view>
                <!--内容区域-->
                <view class="coreshop-modal-content">
                    <!--服务区域-->
                    <view class="coreshop-common-view-box service" v-if="modalType=='service'">
                        <view v-for="(item, index) in serviceDescription.service" :key="index">
                            <view class="coreshop-font-md coreshop-padding-bottom-10 coreshop-padding-top-10 coreshop-flex-direction-row">
                                <u-icon name="checkmark-circle" color="#e54d42" :label="item.title" labelSize="15px" label-pos="right"></u-icon>
                            </view>
                            <view class="coreshop-font-sm coreshop-text-gray coreshop-padding-bottom-5 coreshop-padding-top-5">
                                {{item.description}}
                            </view>
                        </view>
                    </view>
                    <!--促销区域-->
                    <view class="coreshop-common-view-box promotion" v-if="modalType=='promotion'">
                        <view class="text-view" v-for="(item, index) in promotion" :key="index">
                            <text class="cu-tag line-orange radius sm">{{item.name}}</text>
                            <text class="coreshop-margin-left-10 u-line-5 coreshop-text-black">{{item.name}}</text>
                        </view>
                    </view>
 
                </view>
            </view>
        </u-popup>
 
 
        <vk-data-goods-sku-popup v-model="skuSingleKey" border-radius="20" :amount-type="0" :localdata="goodsSkuInfo" mode="3" @open="openSkuSinglePopup" @close="closeSkuSinglePopup" @buy-now="buyNowForSingle" buy-now-text="单独购买"></vk-data-goods-sku-popup>
 
        <vk-data-goods-sku-popup v-model="skuKey" border-radius="20" :amount-type="0" :localdata="discountsGoodsSkuInfo" mode="3" @open="openSkuPopup" @close="closeSkuPopup" @buy-now="buyNow" buy-now-text="发起拼团"></vk-data-goods-sku-popup>
 
        <!-- 右边浮动球 -->
        <coreshop-fab horizontal="right" vertical="bottom" direction="vertical"></coreshop-fab>
        <!-- 登录提示 -->
        <coreshop-login-modal></coreshop-login-modal>
    </view>
 
</template>
<script>
    import { mapState } from 'vuex';
 
 
    export default {
 
        data() {
            return {
                // 是否打开SKU弹窗
                skuKey: false,
                skuSingleKey: false,
                // 后端返回的商品信息
                goodsSkuInfo: {},
                discountsGoodsSkuInfo: {},
                goodsId: 0, // 商品id
                pinTuanId: 0, // 拼团ID
                goodsInfo: {}, // 商品详情
                cartNums: 0, // 购物车数量
                product: {}, // 货品详情
                shopRecommendData: [], // 本店推荐数据
                goodsParams: [], // 商品参数信息
                goodsComments: [], // 商品评论信息
                commentsCount: 0, // 商品评论信息
                pinTuanType: 2, // 1单独购买 2拼团
                type: 2,
                cartType: this.$globalConstVars.paymentType.pinTuan,
                isfav: false, // 商品是否收藏
                //拼团列表滑动数据
                swiperSet: {
                    indicatorDots: false,
                    autoplay: false,
                    interval: 2000,
                    duration: 500,
                    groupHeight: '',
                },
                pinTuanpop: false,
                pinTuanPrice: 0,
                discountAmount: 0, //拼团优惠金额
                price: 0,
                teamCount: 0, //已经有多少人拼团
                pinTuanRecord: [], //拼团列表
 
                teamId: 0, //去参团的teamid
                teamInfo: {
                    teams: [],
                    lastTime: 0 //被邀请拼团倒计时
                },
                bottomModal: false,
                modalTitle: '',
                modalType: 'promotion',
                selectType: '',
                shareUrl: this.$globalConstVars.shareUrl,
                shareBox: false,
                serviceDescription: {
                    commonQuestion: [],
                    delivery: [],
                    service: [],
                },
                timeData: {},
            };
        },
        onLoad(e) {
            this.pinTuanId = e.id;
            if (e.teamId && e.teamId > 0) {
                this.teamId = e.teamId;
                this.getTeam(this.teamId);
            }
            if (this.pinTuanId) {
                this.getServiceDescription();
                this.getGoodsInfo();
                this.getGoodsParams();
                this.getGoodsComments();
            } else {
                this.$refs.uToast.show({
                    message: '获取失败', type: 'error', complete: function () {
                        uni.navigateBack({
                            delta: 1
                        });
                    }
                });
            }
            // 获取购物车数量
            this.getCartNums();
            //获取随机推荐数据
            this.getGoodsRecommendList();
        },
        computed: {
            ...mapState({
                hasLogin: state => state.hasLogin,
                userInfo: state => state.userInfo,
            }),
            hasLogin: {
                get() {
                    return this.$store.state.hasLogin;
                },
                set(val) {
                    this.$store.commit('hasLogin', val);
                }
            },
            userInfo: {
                get() {
                    return this.$store.state.userInfo;
                },
                set(val) {
                    this.$store.commit('userInfo', val);
                }
            },
            pointSwitch() { return this.$store.state.config.pointSwitch },
            pointShowExchangePrice() { return this.$store.state.config.pointShowExchangePrice },
            pointDiscountedProportion() { return this.$store.state.config.pointDiscountedProportion },
            pointExchangeModel() { return this.$store.state.config.pointExchangeModel },
            pointShowName() { return this.$store.state.config.pointShowName },
            pointGetModel() { return this.$store.state.config.pointGetModel },
            pointShowPoint() { return this.$store.state.config.pointShowPoint },
            shopName() {
                return this.$store.state.config.shopName;
            },
            shareTitle() {
                return this.$store.state.config.shareTitle;
            },
            shopLogo() {
                return this.$store.state.config.shopLogo;
            },
            // 获取店铺联系人手机号
            shopMobile() {
                return this.$store.state.config.shopMobile || 0;
            },
            // 判断商品是否是多规格商品  (为了兼容小程序 只能写在计算属性里面了)
            isSpes() {
                if (this.product.hasOwnProperty('defaultSpecificationDescription') && this.product.defaultSpecificationDescription && Object.keys(this.product.defaultSpecificationDescription).length) {
                    return true;
                } else {
                    return false;
                }
            },
            // 优惠信息重新组装
            promotion() {
                let arr = [];
                if (this.product.promotionList) {
                    for (let k in this.product.promotionList) {
                        arr.push(this.product.promotionList[k]);
                    }
                }
                return arr;
            },
            shareHref() {
                let pages = getCurrentPages();
                let page = pages[pages.length - 1];
                // #ifdef MP-WEIXIN || APP-PLUS || APP-PLUS-NVUE
                return this.$globalConstVars.apiBaseUrl + 'wap/' + page.route + '?id=' + this.goodsId + '&pinTuanId=' + this.pinTuanId;
                // #endif
            },
            defaultSpesDesc() {
                return this.product.defaultSpecificationDescription;
            }
        },
        methods: {
            wapperClick(item) {
                this.goGoodsDetail(item.id)
            },
            imageClick(item) {
                this.goGoodsDetail(item.id)
            },
            onChange(e) {
                this.timeData = e
            },
 
            // 立即购买
            buyNow(selectShop) {
                var that = this;
                uni.showLoading({
                    title: '加载中'
                });
                if (!this.hasLogin) {
                    uni.hideLoading();
                    this.$store.commit('showLoginTip', true);
                    return false;
                }
                if (selectShop.buy_num > 0) {
                    let data = {
                        ProductId: selectShop._id,
                        Nums: selectShop.buy_num,
                        type: 2,
                        cartType: this.cartType,
                        objectId: this.pinTuanId,
                        teamId: this.teamId
                    };
                    this.$u.api.addCart(data).then(res => {
                        if (res.status) {
                            let cartIds = res.data;
                            if (this.teamId == 0) {
                                this.$u.route('/pages/placeOrder/index/index?cartIds=' + JSON.stringify(cartIds) + '&orderType=' + this.cartType + '&objectId=' + this.pinTuanId);
                            } else {
                                this.$u.route('/pages/placeOrder/index/index?cartIds=' + JSON.stringify(cartIds) + '&orderType=' + this.cartType + '&objectId=' + this.pinTuanId + '&teamId=' + this.teamId);
                            }
                            uni.hideLoading();
                        } else {
                            this.$u.toast(res.msg);
                            uni.hideLoading();
                        }
                    });
                }
                that.closeSkuPopup();
            },
            // 立即购买
            buyNowForSingle(selectShop) {
                var that = this;
                uni.showLoading({
                    title: '加载中'
                });
                if (!this.hasLogin) {
                    uni.hideLoading();
                    this.$store.commit('showLoginTip', true);
                    return false;
                }
                if (selectShop.buy_num > 0) {
                    let data = {
                        productId: selectShop._id,
                        nums: selectShop.buy_num,
                        type: 2,
                        cartType: this.$globalConstVars.paymentType.common
                    }
                    this.$u.api.addCart(data).then(res => {
                        if (res.status) {
                            let cartIds = res.data;
                            that.$u.route('/pages/placeOrder/index/index?cartIds=' + JSON.stringify(cartIds));
                            uni.hideLoading();
                        } else {
                            this.$u.toast(res.msg);
                            uni.hideLoading();
                        }
                    });
                }
                that.closeSkuPopup();
            },
            getServiceDescription() {
                let _this = this;
                this.$u.api.getServiceDescription().then(res => {
                    if (res.status == true) {
                        _this.serviceDescription.commonQuestion = res.data.commonQuestion;
                        _this.serviceDescription.delivery = res.data.delivery;
                        _this.serviceDescription.service = res.data.service;
 
                    } else {
                        _this.$refs.uToast.show({
                            message: res.msg, type: 'error', complete: function () {
                                uni.navigateBack({
                                    delta: 1
                                });
                            }
                        })
                    }
                })
            },
            // 获取商品详情
            getGoodsInfo() {
                let data = {
                    id: this.pinTuanId,
                    data: true,
                };
                // 如果用户已经登录 要传用户token
                let userToken = this.$db.get('userToken');
                if (userToken) {
                    data.token = userToken
                }
                let _this = this;
                _this.$u.api.pinTuanGoodsInfo(data).then(res => {
                    if (res.status) {
                        if (res.data.length < 1) {
                            _this.$refs.uToast.show({
                                message: '该商品不存在,请返回重新选择商品。', type: 'error', complete: function () {
                                    uni.navigateBack({
                                        delta: 1
                                    });
                                }
                            });
                        } else if (res.data.isMarketable == false) {
                            _this.$refs.uToast.show({
                                message: '该商品已下架,请返回重新选择商品。', type: 'error', complete: function () {
                                    uni.navigateBack({
                                        delta: 1
                                    });
                                }
                            });
                        } else {
                            let info = res.data;
                            this.product = res.data.product;
                            this.goodsId = info.id;
                            _this.goodsInfo = info;
                            this.goodsSkuInfo = res.data.skuList;
 
                            let sku = uni.$u.deepClone(res.data.skuList);
                            let discountAmount = res.data.pinTuanRule.discountAmount;
                            for (var i = 0; i < sku.sku_list.length; i++) {
                                sku.sku_list[i].price = sku.sku_list[i].price - discountAmount;
                            }
                            this.discountsGoodsSkuInfo = sku;
 
                            if (_this.goodsInfo.album) {
                                var albums = [];
                                for (var i = 0; i < _this.goodsInfo.album.length; i++) {
                                    let album = {
                                        url: _this.goodsInfo.album[i],
                                        type: 'image'
                                    }
                                    albums.push(album);
                                }
                                _this.goodsInfo.album = albums;
                                if (_this.goodsInfo.video) {
                                    let videoObj = {
                                        url: _this.goodsInfo.video,
                                        poster: _this.goodsInfo.image,
                                        type: 'video'
                                    }
                                    _this.goodsInfo.album.unshift(videoObj);
                                    _this.autoplay = false;
                                }
                            }
 
                            _this.discountAmount = parseFloat(info.pinTuanRule.discountAmount).toFixed(2);
 
                            _this.isfav = _this.goodsInfo.isfav;
                            _this.price = _this.pinTuanPrice = parseFloat(_this.product.price - _this.discountAmount).toFixed(2);
 
                            // 获取拼团记录
                            // 获取拼团记录
                            let pinTuanData = info.pinTuanRecord;
                            let newData = new Array();
                            for (var k = 0; k < pinTuanData.length; k++) {
                                if (k == 0 || k % 2 == 0) {
                                    if (k + 1 < pinTuanData.length) {
                                        var a = [pinTuanData[k], pinTuanData[k + 1]];
                                    } else {
                                        var a = [pinTuanData[k]];
                                    }
                                    newData.push(a);
                                }
                            }
                            pinTuanData.length < 2 ? (_this.swiperSet.groupHeight = 'groupHeight') : (_this.swiperSet.groupHeight = '');
                            if (pinTuanData.length > 1) {
                                _this.swiperSet.autoplay = true;
                            }
                            _this.pinTuanRecord = newData;
                            _this.teamCount = info.pinTuanRecordNums;
                            // 判断如果登录用户添加商品浏览足迹
                            if (userToken) {
                                _this.goodsBrowsing();
                            }
 
 
 
                        }
                    }
                });
            },
            // 获取推荐商品信息
            getGoodsRecommendList() {
                let _this = this;
                let recommenddata = {
                    id: 10,
                    data: true
                }
                _this.$u.api.getGoodsRecommendList(recommenddata).then(res => {
                    if (res.status) {
                        _this.shopRecommendData = _this.$u.randomArray(res.data);
                    } else {
                        _this.$u.toast(res.msg)
                    }
                });
            },
            // 获取通过分享进来的拼团数据
            getTeam(id) {
                this.$u.api.getOrderPinTuanTeamInfo(
                    {
                        teamId: id
                    }).then(res => {
                        if (res.status) {
                            this.teamInfo = res.data;
                            if (res.data.status == 1) {
                                this.pinTuanShow();
                            } else {
                                this.teamId = 0;
                            }
                        } else {
                            this.$u.toast(res.msg);
                        }
                    }
                    );
            },
            // 获取购物车数量
            getCartNums() {
                let userToken = this.$db.get('userToken');
                if (userToken && userToken != '') {
                    // 获取购物车数量
                    this.$u.api.getCartNum().then(res => {
                        if (res.status) {
                            this.cartNums = res.data;
                        }
                    });
                }
            },
            // 商品收藏/取消
            collection() {
                let data = {
                    id: this.goodsInfo.id
                };
                this.$u.api.goodsCollection(data).then(res => {
                    if (res.status) {
                        this.isfav = !this.isfav;
                        this.$refs.uToast.show({ message: res.msg, type: 'success', back: false });
                    } else {
                        this.$u.toast(res.msg);
                    }
                });
            },
            // 获取商品参数信息
            getGoodsParams() {
                this.$u.api.goodsParams(
                    {
                        id: this.goodsId
                    }).then(res => {
                        if (res.status == true) {
                            this.goodsParams = res.data;
                        }
                    }
                    );
            },
            // 获取商品评论信息
            getGoodsComments() {
                let data = {
                    page: 1,
                    limit: 5,
                    id: this.goodsId,
                }
                this.$u.api.goodsComment(data).then(res => {
                    if (res.status == true) {
                        let _list = res.data.list;
                        this.commentsCount = res.data.commentsCount;
                        // 如果评论没有图片 在这块作处理否则控制台报错
                        _list.forEach(item => {
                            if (!item.hasOwnProperty('images')) {
                                this.$set(item, 'images', [])
                            }
                        });
                        this.goodsComments = [...this.goodsComments, ..._list];
                    } else {
                        console.log("错误2");
                        this.$u.toast(res.msg);
                    }
                })
            },
 
            // 添加商品浏览足迹
            goodsBrowsing() {
                let data = {
                    id: this.goodsInfo.id
                };
                this.$u.api.addGoodsBrowsing(data).then(res => { });
            },
            end(index, number) {
                this.pinTuanRecord[index][number].isOverdue = true;
            },
            goShare() {
                this.shareBox = true;
            },
            closeShare() {
                this.shareBox = false;
            },
            // 拼团弹出层
            pinTuanShow() {
                this.pinTuanpop = true;
            },
            pinTuanHiiden() {
                this.pinTuanpop = false;
            },
            // 图片点击放大
            clickImg(index) {
                if (this.goodsInfo.album[index].type == 'image') {
                    uni.previewImage({
                        urls: [this.goodsInfo.album[index].url],
                    });
                }
            },
            //在线客服
            showChat() {
                // #ifdef APP-PLUS || APP-PLUS-NVUE
                this.$u.route('/pages/member/customerService/index');
                // #endif
            },
            //获取分享URL
            getShareUrl() {
                let data = {
                    client: this.$globalConstVars.shareClient.wxMiNiProgram,
                    url: this.$globalConstVars.shareUrl,
                    type: this.$globalConstVars.shareModel.url,
                    page: this.$globalConstVars.shareType.pinTuan,
                    params: {
                        groupId: this.pinTuanId,
                        goodsId: this.goodsId,
                        teamId: this.teamId
                    }
                };
                this.$u.api.share(data).then(res => {
                    this.shareUrl = res.data
                });
            },
            serviceTap() {
                this.modalTitle = "说明";
                this.modalType = 'service';
                this.showModal();
            },
            promotionTap() {
                this.modalTitle = "促销优惠";
                this.modalType = 'promotion';
                this.showModal();
            },
            // 显示modal弹出框
            selectTap(type, teamId) {
                if (this.pinTuanpop) {
                    this.pinTuanpop = false;
                }
                this.pinTuanType = type;
                if (teamId) {
                    this.teamId = teamId;
                } else {
                    this.teamId = 0;
                }
                if (this.pinTuanType == 2) {
                    this.price = this.pinTuanPrice;
                } else {
                    this.price = this.product.price;
                }
                if (type === 1) {
                    this.openSkuSinglePopup();
                } else if (type === 2) {
                    this.openSkuPopup();
                }
            },
            // 打开sku弹出
            openSkuPopup() {
                this.skuKey = true;
                this.skuSingleKey = false;
            },
            closeSkuPopup() {
                this.skuKey = false;
                this.skuSingleKey = false;
            },
            openSkuSinglePopup() {
                this.skuSingleKey = true;
                this.skuKey = false;
            },
            closeSkuSinglePopup() {
                this.skuSingleKey = false;
                this.skuKey = false;
            },
            showModal() {
                this.bottomModal = true;
            },
            hideModal(e) {
                this.bottomModal = false;
                this.modalTitle = "";
                this.modalType = '';
            },
        },
        watch: {
            goodsId: {
                handler() {
                    this.getShareUrl();
                },
                deep: true
            },
            teamId: {
                handler() {
                    this.getShareUrl();
                },
                deep: true
            }
        },
        //分享
        onShareAppMessage(res) {
            return {
                title: this.goodsInfo.name,
                imageUrl: this.goodsInfo.image,
                path: this.shareUrl
            }
        },
        onShareTimeline(res) {
            return {
                title: this.goodsInfo.name,
                imageUrl: this.goodsInfo.image,
                path: this.shareUrl
            }
        },
    };
</script>
<style lang="scss">
    @import "details.scss";
    image { display: block; }
</style>