detail.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <div>
  3. <nav-bar title="商品资料" @click-left="$router.back()"/>
  4. <div class="title">
  5. <van-image :src="productInfo.imageList[0].image"></van-image>
  6. <div class="store-title">
  7. {{productName}}
  8. </div>
  9. </div>
  10. <div class="store-info">
  11. 相关资料
  12. </div>
  13. <info-cell :info-type="1" :info-list="imageArchiveList"></info-cell>
  14. <info-cell :info-type="2" :info-list="videoArchiveList"></info-cell>
  15. <info-cell :info-type="3" :info-list="fileArchiveList"></info-cell>
  16. </div>
  17. </template>
  18. <script>
  19. import { archiveDetail } from '@/api/userApi/goods-information'
  20. import { productDetail } from '@/api/institutionApi/product'
  21. import infoCell from './components/infoCell.vue'
  22. export default {
  23. components: {
  24. infoCell
  25. },
  26. data () {
  27. return {
  28. fileArchiveList: [],
  29. imageArchiveList: [],
  30. videoArchiveList: [],
  31. productImage: '',
  32. productName: '',
  33. productInfo: {}
  34. }
  35. },
  36. computed: {
  37. queryId () {
  38. return this.$route.query.archiveId
  39. },
  40. productId () {
  41. return this.$route.query.productId
  42. },
  43. formData () {
  44. return {
  45. productId: this.productId,
  46. typeId: 0,
  47. userId: this.$store.getters.userId
  48. }
  49. }
  50. },
  51. mounted () {
  52. this.archiveDetail()
  53. },
  54. methods: {
  55. async archiveDetail () {
  56. const data = await archiveDetail({ userId: this.$store.getters.userId, archiveId: this.queryId })
  57. this.productDetail()
  58. this.fileArchiveList = data.fileArchiveList
  59. this.imageArchiveList = data.imageArchiveList
  60. this.videoArchiveList = data.videoArchiveList
  61. },
  62. async productDetail () {
  63. const data = await productDetail(this.formData)
  64. this.productInfo = data
  65. }
  66. }
  67. }
  68. </script>
  69. <style lang="scss" scoped>
  70. ::v-deep .van-image {
  71. width: 100vw;
  72. height: 100vw;
  73. }
  74. .store-title {
  75. font-size: 3.4vw;
  76. color: #333;
  77. line-height: 4.8vw;
  78. padding: 3.2vw 4.5vw 8vw 2.4vw;
  79. background: #fff;
  80. margin-bottom: 2.4vw;
  81. }
  82. .store-info {
  83. padding: 4vw 0;
  84. text-align: center;
  85. font-size: 4vw;
  86. color: #333;
  87. background: #fff;
  88. font-weight: 600;
  89. }
  90. </style>