222
杨磊
昨天 f1ee7357faf2bc1c2d62d4784ca02cd2213b8d30
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
<template>
  <div class="homePage">
    <div class="infoBox">
      <div class="contentBox">
        <div class="crumbs">
          <el-breadcrumb separator-class="el-icon-arrow-right">
            <el-breadcrumb-item :to="{ name: 'bookStore' }">数字教材</el-breadcrumb-item>
            <el-breadcrumb-item>详情</el-breadcrumb-item>
          </el-breadcrumb>
        </div>
        <div class="infoTag" v-if="bookInfo.projectTitle">
          <el-tooltip
            class="item"
            effect="dark"
            :content="bookInfo.projectTitle"
            placement="top-start"
          >
            <div class="tagText">
              {{ bookInfo.projectTitle }}
            </div>
          </el-tooltip>
        </div>
        <div class="bookDetail" v-loading="loading">
          <div class="bookImg">
            <img class="autoImg" :src="bookInfo.icon ? bookInfo.icon : defaultImg" alt="" />
          </div>
          <span class="iconfont icon-tubiaozhizuo"></span>
 
          <div class="detailBox">
            <div class="bookTitle">
              <div class="bookName" :title="bookInfo.name">
                {{ bookInfo.name }}
              </div>
              <div class="bookTag" :title="bookInfo.seriesName">
                {{ bookInfo.seriesName }}
              </div>
              <div class="collectBox">
                <div class="collectText" @click="collectBook" v-if="bookInfo.isFavourite">
                  已收藏
                </div>
                <img
                  @click="collectBook"
                  v-if="bookInfo.isFavourite"
                  class="buyIcon"
                  src="@/assets/images/xiehe/detail/Collection_fill.png"
                  style="margin-right: 10px"
                />
                <span v-else class="iconfont icon-shoucang" style="margin-right: 10px"> </span>
 
                <div class="collectText" @click="collectBook" v-else>
                  收藏
 
                  <img
                    class="buyIcon"
                    src="@/assets/images/xiehe/detail/Collection.png"
                    style="margin-right: 10px"
                  />
                </div>
              </div>
            </div>
            <div class="authorBox">
              <div class="titleBox1">
                <div>作者:</div>
                <div>出版时间:</div>
              </div>
              <div class="valueBox">
                <div>
                  {{ bookInfo.author ? bookInfo.author : '-' }}
                </div>
                <div>
                  {{
                    bookInfo.publicationDate
                      ? moment(bookInfo.publicationDate).format('YYYY-MM-DD')
                      : '-'
                  }}
                </div>
              </div>
              <div class="titleBox1" style="margin-left: 30px">
                <div>ISBN:</div>
                <div>版次:</div>
              </div>
              <div class="valueBox">
                <div>
                  {{ bookInfo.isbn ? bookInfo.isbn : '-' }}
                </div>
                <div>
                  {{ bookInfo.pubNumber ? bookInfo.pubNumber : '-' }}
                </div>
              </div>
            </div>
            <div class="authorBox" style="box-sizing: border-box">
              <div class="titleBox1">
                <div>分类:</div>
              </div>
              <div class="valueBox">
                <div>全国高等职业教育预防医学专业规划教材</div>
              </div>
            </div>
            <div class="purchaseBox">
              <div class="priceBox">
                <span v-if="bookInfo.price && bookInfo.price > 0">
                  <span>数字教材</span><span>¥</span> <span>{{ bookInfo.price || '-' }}</span
                  ><span v-if="bookInfo.VirtualPrice">原价:¥{{ bookInfo.VirtualPrice }}</span>
                </span>
 
                <span class="price" v-else>
                  <span class="freePrice">免费</span>
                </span>
              </div>
              <div
                class="buyInfo"
                v-if="
                  (currentRoute !== 'teachingServices' && bookInfo.paperBookDD) ||
                  bookInfo.paperBookJD ||
                  bookInfo.paperBookTmall
                "
              >
                纸质书其他购买渠道:
                <span @click="toJDLink" v-if="bookInfo.paperBookJD">
                  <img class="buyIcon" src="@/assets/images/bookStore/京东icon-01.svg" />京东</span
                >
                <span @click="toDDLink" v-if="bookInfo.paperBookDD"
                  ><img class="buyIcon" src="@/assets/images/bookStore/当当网.svg" />当当</span
                >
                <span @click="toTmLink" v-if="bookInfo.paperBookTmall"
                  ><img
                    class="buyIcon"
                    src="@/assets/images/bookStore/tianmaologo2.svg"
                  />天猫</span
                >
              </div>
            </div>
            <div class="btnBox">
              <el-button
                v-if="
                  currentRoute !== 'teachingServices' &&
                  !bookInfo.alreadyBuy &&
                  bookInfo.isSell &&
                  bookInfo.isSell == '1'
                "
                type="primary"
                :disabled="bookInfo.alreadyBuy"
                @click="gotoOrder"
                >电子书购买</el-button
              >
              <el-button
                v-if="bookInfo.pdfFreeFile && !bookInfo.alreadyBuy"
                type="primary"
                plain
                style="min-width: 98px"
                @click="previewBook"
                >试读</el-button
              >
              <el-button
                v-else-if="bookInfo.pdfFile && bookInfo.alreadyBuy"
                type="primary"
                plain
                style="min-width: 98px"
                @click="previewBook"
                >立即阅读</el-button
              >
              <el-button
                v-if="currentRoute == 'teachingServices' && !bookInfo.alreadyBuy"
                plain
                @click="addEbook"
                >电子样书</el-button
              >
              <el-button v-if="currentRoute == 'teachingServices'" plain @click="addPaperBook"
                >纸质样书</el-button
              >
              <el-button plain @click="applyTextBook" v-if="!bookInfo.alreadyBuy"
                >申请试用</el-button
              >
              <el-button plain @click="useCode" v-if="!bookInfo.alreadyBuy">使用购书码</el-button>
              <el-button plain @click="read" v-if="bookInfo.alreadyBuy">开始阅读</el-button>
            </div>
          </div>
        </div>
      </div>
    </div>
    <el-dialog v-model="buyBookCodeDialog" title="购书" width="30%">
      <div class="buyBookCode">
        <div style="line-height: 30px">购书码 :</div>
        <el-input style="width: 70%" v-model="activateCode" clearable />
      </div>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="buyBookCodeDialog = false">取消</el-button>
          <el-button type="primary" @click="userActiveCodeGet"> 激活 </el-button>
        </span>
      </template>
    </el-dialog>
    <div class="detailContent contentBox">
      <div class="resourceBox">
        <div class="tabsBox">
          <el-tabs v-model="editableTabsValue" type="card" class="demo-tabs">
            <el-tab-pane
              v-for="item in editableTabs"
              :key="item.name"
              :label="item.title"
              :name="item.name"
            >
              {{ item.content }}
            </el-tab-pane>
          </el-tabs>
        </div>
        <div v-if="editableTabsValue == '1'" class="textbookInfo">
          <div class="textbookInfoItem">
            <div class="titleBorderBox">图书简介</div>
            <div class="textbookContent" v-if="bookInfo.content" v-html="bookInfo.content"></div>
            <div v-else>
              <el-empty description="暂无数据" />
            </div>
          </div>
          <div class="textbookInfoItem">
            <div class="titleBorderBox">作者简介</div>
            <div
              class="authorInfo"
              v-if="bookInfo.authorIntroduction"
              v-html="bookInfo.authorIntroduction"
            ></div>
            <div v-else>
              <el-empty description="暂无数据" />
            </div>
          </div>
        </div>
        <div v-else-if="editableTabsValue == '2'" class="catalogue">
          <div v-if="bookInfo.catalogue" v-html="bookInfo.catalogue" class="catalogueContent"></div>
          <el-empty description="暂无数据" v-else />
        </div>
        <div v-else-if="editableTabsValue == '6'" class="supportingResources">
          <div class="resourcesBox">
            <el-empty v-if="!resourceHave" :image-size="150" description="暂无内容"></el-empty>
            <div class="distribution" v-if="resourceHave">
              <div class="titleBorderBox">资源分布</div>
              <div class="echartsBox">
                <div class="left">
                  <div id="chartsContent" style="width: 600px; height: 400px"></div>
                </div>
                <div class="right">
                  <div>
                    <p>资源种类</p>
                    <p>
                      <span class="num">{{ resourceData.length }}</span
                      >种
                    </p>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div v-else class="catalogue"><el-empty description="暂无数据" /></div>
      </div>
      <div class="recommendBox">
        <div class="recommendTitle">推荐教材</div>
        <div class="newRecommendList">
          <div class="recommendItem" v-for="item in recommendBookListData" :key="item.id">
            <div class="recommendItemImg">
              <img class="autoImg" :src="item.icon" />
            </div>
            <div class="infoBox2">
              <div class="bookName2">{{ item.name }}</div>
              <div class="author2">
                作者:{{ item.authorcaupress_author ? item.caupress_author : '-' }}
              </div>
              <div class="priceBox2">
                <span class="oldPrice" v-if="item.oldPrice">原价:¥{{ item.oldPrice }}</span>
                <span class="price" v-if="item.price && item.price > 0">
                  定价:¥
                  <span>{{ item.price }}</span>
                </span>
                <span class="price" v-else> 定价:<span class="freePrice">免费</span> </span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <teacherCertification :isShow="teacherDialog" @dialog-Change="dialogChange" />
  </div>
</template>
 
<script setup>
import moment from 'moment'
import axios from 'axios'
import * as echarts from 'echarts'
import defaultImg from '@/assets/images/book-cover.png'
import imgIcon from '@/assets/images/digitalTextbooks/img.png'
import AudioIcon from '@/assets/images/digitalTextbooks/Audio.png'
import DIcon from '@/assets/images/digitalTextbooks/3D.png'
import PPTIcon from '@/assets/images/digitalTextbooks/PPT.png'
import shijuanIcon from '@/assets/images/digitalTextbooks/shijuan.png'
import shixunIcon from '@/assets/images/digitalTextbooks/shixun.png'
import tuozhanIcon from '@/assets/images/digitalTextbooks/tuozhan.png'
import videoIcon from '@/assets/images/digitalTextbooks/video.png'
import VRIcon from '@/assets/images/digitalTextbooks/VR.png'
import ziliaoIcon from '@/assets/images/digitalTextbooks/ziliao.png'
import teacherCertification from '@/views/personalCenter/teacherCertification.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { ref, onBeforeMount, inject, reactive, onMounted, watchEffect } from 'vue'
const MG = inject('MG')
const config = inject('config')
const logIn = inject('logIn')
import { useUserStore } from '@/store'
const userStore = useUserStore()
let teacherDialog = ref(false)
 
import { useRouter, useRoute } from 'vue-router'
import { applyBookStore } from '@/store'
const route = useRoute()
const router = useRouter()
let bookInfo = ref({})
let digitalTextId = ref('')
let resourceData = ref([])
let recommendBookListData = ref([])
let editableTabsValue = ref('1')
let activateCode = ref('')
let resourceHave = ref(true)
let loading = ref(false)
let buyBookCodeDialog = ref(false)
var chartDom = null
var myChart = {}
var option = null
 
const editableTabs = reactive([
  {
    title: '教材信息',
    name: '1',
  },
  {
    title: '目录',
    name: '2',
  },
  {
    title: '配套资源',
    name: '3',
  },
  {
    title: '题库',
    name: '4',
  },
  {
    title: '教师资源',
    name: '5',
  },
  {
    title: '资源统计',
    name: '6',
  },
])
 
onMounted(() => {
  digitalTextId.value = route.query.bookId
  getBookDetail(digitalTextId.value)
  getRecommendBookList()
})
 
watchEffect(() => {
  if (editableTabsValue.value == '6') {
    getBookResource()
  }
})
 
const getTextBookList = async () => {
  const data = {
    start: 0,
    size: 9999,
    topicIdOrRefCode: 'applyDigitalBook',
    appRefCode: config.appRefCode,
    sort: {
      type: 'Desc',
      field: 'CreateDate',
    },
  }
  const res = await MG.ugc.getTopicMessageList(data)
  if (res.datas && res.datas.length > 0) {
    for (let i = 0; i < res.datas.length; i++) {
      const item = res.datas[i]
      item.content = JSON.parse(item.content)[0]
      item.productId = item.content.id
    }
    const currentBook = res.datas.find((item) => item.productId == digitalTextId.value)
    if (currentBook) {
      return currentBook
    } else {
      return null
    }
  } else {
    return null
  }
}
 
const read = () => {
  let token = localStorage.getItem(config.tokenKey)
  const url = config.textBookResourceUrl + '?bookId=' + bookInfo.value.refCode + '&token=' + token
  window.open(url)
}
 
const userActiveCodeGet = () => {
  let lock = true
  console.log(activateCode.value, 'activateCode.value')
 
  if (activateCode.value == '') {
    ElMessage({
      type: 'error',
      message: '请输入激活码!',
    })
  } else {
    if (lock) {
      lock = false
 
      MG.store
        .getActiveCode({
          code: activateCode.value,
        })
        .then((res) => {
          console.log(res, 'res')
          const cfg = JSON.parse(res.config)
          console.log(cfg, 'cfg')
          if (cfg && cfg.length > 0) {
            const isActive = cfg.findIndex((item) => item.id == digitalTextId.value)
 
            if (isActive > -1) {
              MG.store
                .userActiveCode({
                  code: activateCode.value,
                })
                .then((res) => {
                  ElMessage({
                    type: res == '激活成功' ? 'success' : 'error',
                    message: res,
                  })
                  activateCode.value = ''
                  buyBookCodeDialog.value = false
                  getBookDetail(digitalTextId.value)
                  lock = true
                })
            } else {
              ElMessage({
                type: 'error',
                message: '您输入的购书码有误',
              })
            }
          } else {
            ElMessage({
              type: 'error',
              message: '您输入的购书码有误',
            })
          }
        })
    }
  }
}
 
const useCode = () => {
  if (localStorage.getItem(config.tokenKey)) {
    buyBookCodeDialog.value = true
  } else {
    logIn()
  }
}
 
const dialogChange = (val) => {
  if (val == false) {
    teacherDialog.value = false
  } else {
    teacherDialog.value = true
  }
}
 
//收藏书籍
const collectBook = () => {
  if (localStorage.getItem(config.tokenKey)) {
    if (bookInfo.value.isFavourite) {
      MG.store
        .delProductLink({
          productIds: [bookInfo.value.id],
          linkType: 'FavoriteBookCity',
        })
        .then(() => {
          bookInfo.value.isFavourite = false
        })
    } else {
      let params = {
        productIds: [bookInfo.value.id],
        linkType: 'FavoriteBookCity',
      }
      MG.store.addProductLink(params).then((res) => {
        bookInfo.value.isFavourite = true
      })
    }
  } else {
    logIn()
    console.log(logIn)
  }
}
 
//申请试用
const applyTextBook = async () => {
  console.log(userStore.userInfo, 'userInfo')
  const isApply = await getTextBookList()
  if (isApply?.state == 'WaitAudit') {
    ElMessageBox.confirm('您已申请试用该书,是否前往查看', '提示', {
      confirmButtonText: '确定',
      cancelButtonText: '取消',
      type: 'warning',
    }).then(() => {
      router.push({
        path: '/myApply',
      })
    })
  } else {
    toApply()
  }
}
 
const toApply = () => {
  if (localStorage.getItem(config.tokenKey)) {
    if (userStore.userInfo && userStore.userInfo.role == 'Teacher') {
      localStorage.setItem('applyBookInfo', JSON.stringify(bookInfo.value))
      router.push({
        path: '/textBookApply',
      })
    } else {
      teacherDialog.value = true
    }
  } else {
    logIn()
  }
}
 
const getRecommendBookList = () => {
  MG.store
    .getProductList({
      path: 'recommendedTextbooks',
      paging: {
        start: 0,
        size: 5,
      },
      fields: {
        author: [],
      },
    })
    .then((res) => {
      console.log(res, '推荐教材')
      recommendBookListData.value = res.datas
    })
}
 
const getBookResource = () => {
  try {
    axios
      .get('https://yxjy.pumcp.com/books/resource/' + bookInfo.value.refCode + '/resource.json')
      .then(async (res) => {
        console.log(res, 'resource')
        if (res.data.length > 0) {
          res.data.forEach((item) => {
            if (item.resourceTypeShow == '图片') {
              item.icon = imgIcon
            } else if (item.resourceTypeShow == '视频') {
              item.icon = videoIcon
            } else if (item.resourceTypeShow == '音频') {
              item.icon = AudioIcon
            } else if (item.resourceTypeShow == 'PPT') {
              item.icon = PPTIcon
            } else if (item.resourceTypeShow == '拓展') {
              item.icon = tuozhanIcon
            } else if (item.resourceTypeShow == '资料') {
              item.icon = ziliaoIcon
            } else if (item.resourceTypeShow == '试卷') {
              item.icon = shijuanIcon
            } else if (item.resourceTypeShow == '3D') {
              item.icon = DIcon
            } else if (item.resourceTypeShow == '实训') {
              item.icon = shixunIcon
            } else if (item.resourceTypeShow == 'VR') {
              item.icon = VRIcon
            } else {
              item.icon = ziliaoIcon
            }
          })
          resourceData.value = await groupByResourceTypeShow(res.data)
          resourceHave.value = true
          console.log(resourceData.value, 'resourceData')
          initChart(resourceData.value)
        } else {
          resourceHave.value = false
        }
      })
      .catch((error) => {
        console.log(error, 'error1')
 
        resourceData = []
        resourceHave = false
      })
  } catch (error) {
    console.log(error, 'error')
    resourceData = []
    resourceHave = false
  }
}
 
const groupByResourceTypeShow = (resources) => {
  const grouped = resources.reduce((acc, item) => {
    const key = item.resourceTypeShow
    if (!acc[key]) {
      acc[key] = {
        resourceTypeShow: key,
        list: [],
      }
    }
    acc[key].list.push(item)
    return acc
  }, {})
  return Object.values(grouped)
}
 
const initChart = (data) => {
  let dataList = []
  let num = []
  data.forEach((item) => {
    dataList.push(item.resourceTypeShow)
    num.push(item.list.length)
  })
  chartDom = document.getElementById('chartsContent')
  console.log(chartDom, 'chartDom')
 
  myChart = echarts.init(chartDom)
  myChart.setOption({
    tooltip: {},
    xAxis: {
      data: dataList,
    },
    yAxis: {},
    series: [
      {
        name: '数量',
        type: 'bar',
        data: num,
        itemStyle: {
          color: function (params) {
            // params.dataIndex是数据项的索引,你可以根据这个索引来设置不同的颜色
            const colors = [
              '#5EA1FF',
              '#FF5A85',
              '#7E7AFF',
              '#3CB768',
              '#FF8F54',
              '#FF574B',
              '#3DB0BF',
              '#FBBB3B',
              '#3B5EFB',
              '#B1FB3B',
            ]
            return colors[params.dataIndex % colors.length]
          },
        },
      },
    ],
  })
}
 
const getBookDetail = (id) => {
  loading.value = true
  const query = {
    path: '*',
    queryType: '*',
    productId: id,
    storeInfo: 'defaultGoodsStore1',
    coverSize: {
      height: 300,
      width: 210,
    },
    fields: {
      author: [],
      isbn: [],
      editionPrinting: [],
      publicationDate: [],
      content: [],
      authorIntroduction: [],
      catalogue: [],
      probationPage: [],
      teachingLevel: [],
      professionalCategory: [],
      executiveEditor: [],
    },
  }
  MG.store.getProductDetail(query).then((res) => {
    console.log(res, 'res')
    bookInfo.value = res.datas
    loading.value = false
    console.log(res.datas, 'res')
  })
}
</script>
 
<style lang="less" scoped>
.homePage {
  min-width: 1220px;
  min-height: calc(100vh - 61.8%);
  background-color: #fff;
  padding-bottom: 100px;
}
 
.infoBox {
  width: 100%;
  height: 530px;
  padding-top: 10px;
  background-color: #fff;
  background-image: url('@/assets/images/xiehe/detail/details_bg.png');
}
.infoTag {
  position: relative;
  width: 0px;
  height: 0px;
  border-right: 20px solid #fff;
  border-left: 503px solid #e50021;
  border-top: 19px solid #e50021;
  border-bottom: 19px solid #e50021;
}
.tagText {
  position: absolute;
  left: -480px;
  top: -9.5px;
  max-width: 480px;
  text-overflow: ellipsis;
  color: #fff;
  font-size: 18px;
  overflow: hidden;
  white-space: nowrap;
}
.bookDetail {
  display: flex;
  overflow: hidden;
  margin-top: 30px;
}
.bookImg {
  position: relative;
  width: 338px;
  height: 400px;
  box-shadow: 2px 2px 10px #f2f2f2;
}
.detailBox {
  flex: 1;
  height: 450px;
  position: relative;
  margin-top: 20px;
  overflow: hidden;
}
.collectBox {
  position: absolute;
  right: 80px;
  font-size: 14px;
  color: #999999;
  cursor: pointer;
}
 
.collectBox span:nth-child(1) {
  margin-right: 10px;
  font-size: 16px;
}
.collectBox span:nth-child(2) {
  margin-left: 10px;
  margin-right: 10px;
 
  font-size: 16px;
}
.iconfont {
  font-size: 25px !important;
  vertical-align: middle;
}
.bookTitle {
  width: 100%;
  height: 40px;
  line-height: 40px;
  padding-left: 100px;
  display: flex;
  padding-right: 240px;
  box-sizing: border-box;
}
.collectText {
  font-size: 18px;
  line-height: 18px;
  display: inline-block;
}
.bookName {
  flex: 1;
  font-size: 26px;
  color: #333;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.bookTag {
  max-width: 200px;
  font-size: 16px;
  color: #333;
  line-height: 36px;
  margin-left: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.authorBox {
  width: 80%;
  display: flex;
  padding: 20px;
  padding-left: 100px;
  position: relative;
}
.valueBox {
  margin-left: 20px;
}
.valueBox div {
  height: 30px;
}
.titleBox1 div {
  height: 30px;
}
.relationBox {
  position: absolute;
  right: 50px;
  color: #999;
  cursor: pointer;
  font-size: 14px;
}
.purchaseBox {
  margin-left: 100px;
  padding-top: 20px;
}
.priceBox {
  border-bottom: 1px dashed #ececec;
  background-color: #b2d9c8;
  height: 50px;
  line-height: 50px;
  padding-left: 20px;
}
.priceBox span:nth-child(1) {
  color: #000;
  font-weight: 700;
  font-size: 16px;
  padding-right: 20px;
}
.priceBox span:nth-child(2) {
  color: #e50021;
  font-size: 16px;
}
.priceBox span:nth-child(3) {
  color: #e50021;
  font-size: 22px;
  font-weight: 700;
  padding-right: 20px;
}
.priceBox span:nth-child(4) {
  color: #333;
  font-size: 16px;
  padding-right: 20px;
  text-decoration: line-through;
}
.buyInfo {
  padding: 20px 0px;
  border-bottom: 1px dashed #ececec;
  cursor: pointer;
}
.buyInfo img {
  margin-left: 10px;
}
.btnBox {
  margin-left: 100px;
  margin-top: 30px;
}
.infoItem {
  display: flex;
  margin-top: 40px;
}
.infoImg {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid #ccc;
  background: #efefef;
  text-align: center;
  line-height: 60px;
  position: relative;
}
.infoImg i {
  font-size: 28px;
}
.infoList {
  margin-top: 20px;
  overflow: auto;
}
.infoContent {
  flex: 1;
  overflow: hidden;
  padding: 0 20px 0 10px;
}
.infoDialog {
  padding: 20px;
}
.infoTitle {
  width: 100%;
  display: flex;
  justify-content: space-between;
}
.infoText {
  margin-top: 24px;
  line-height: 20px;
}
.contactBox {
  padding: 0px 40px;
}
.contacItem {
  margin-top: 20px;
}
.contacIcon {
  padding-right: 20px;
}
.subBtn {
  margin-top: 20px;
  text-align: right;
}
.buyIcon {
  width: 24px;
  height: 24px;
  vertical-align: middle;
}
.crumbs {
  margin-top: 10px;
  border-bottom: 1px solid rgba(20, 73, 65, 0.26);
  padding-bottom: 20px;
}
 
.detailContent {
  margin-top: 30px;
  display: flex;
  justify-content: space-between;
  .resourceBox {
    width: 76%;
  }
  .textbookInfo {
    padding: 20px 0;
  }
}
.titleBorderBox {
  height: 30px;
  line-height: 30px;
  font-weight: 700;
  border-left: 6px solid #019e58;
  padding-left: 20px;
  font-size: 18px;
}
.textbookInfoItem {
  margin-top: 20px;
}
 
.distribution {
  .title {
    margin: 10px 0;
    font-weight: bold;
  }
  .echartsBox {
    height: 400px;
    border-radius: 7px 7px 7px 7px;
    border: 1px solid #e4e7ed;
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    margin-top: 20px;
  }
  .left {
  }
  .right {
    background: rgba(64, 158, 255, 0.09);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 200px;
    p {
      line-height: 30px;
    }
    .num {
      font-size: 18px;
      font-weight: bold;
    }
  }
  .list {
    display: flex;
    margin-bottom: 40px;
    .listItem {
      width: 100px;
      display: block;
      box-sizing: border-box;
      .imgBox {
        margin: 0 auto;
        position: relative;
        width: 80px;
        height: 80px;
      }
      .bookInfo {
        margin: 0;
        overflow: hidden;
        text-align: center;
        .title {
          color: #333;
          margin: 10px 0;
          white-space: nowrap;
          text-overflow: ellipsis;
          overflow: hidden;
        }
      }
    }
  }
}
 
.recommendBox {
  width: 23%;
  border: 1px solid #e4e7ed;
  border-radius: 10px;
  .recommendTitle {
    height: 50px;
    line-height: 50px;
    padding-left: 20px;
    border-bottom: 1px solid #e4e7ed;
    color: #333333;
    font-weight: 700;
  }
}
 
.newRecommendList {
  padding-top: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  .recommendItem {
    margin-right: 20px;
    height: 300px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    cursor: pointer;
    background-color: #fff;
    padding-top: 10px;
    margin-top: 10px;
    &:last-child {
      margin-right: 0;
    }
  }
  .recommendItemImg {
    width: 150px;
    height: 200px;
    position: relative;
    margin: 0 auto;
  }
  .infoBox2 {
    text-align: center;
    margin-top: 10px;
  }
  .author2 {
    margin-top: 10px;
  }
  .priceBox2 {
    margin-top: 10px;
    .oldPrice {
      font-size: 16px;
      color: #444444;
      text-decoration: line-through;
      margin-right: 20px;
    }
    .price {
      span {
        font-weight: bold;
        font-size: 14px;
      }
    }
  }
}
.textbookContent,
.authorInfo {
  margin-top: 20px;
  line-height: 28px;
}
.buyBookCode {
  width: 100%;
  display: flex;
  padding: 40px 10px;
  text-align: center;
  align-items: center;
}
.tab-name {
  width: 100px;
  height: 40px;
}
</style>