dialog_1.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <view class="dialogs">
  3. <swiper class="swiper" circular @change="diaSpecs" :current="is_specs">
  4. <swiper-item class="list" v-for="(item,index) in specsList" :key="index">
  5. <view class="list_1">
  6. <image class="image" :src="item.file&&item.file.length>0?item.file[0].url:info.goods.file[0].url" mode="aspectFit"></image>
  7. </view>
  8. <view class="name">
  9. <text>{{item.name}}</text>
  10. </view>
  11. </swiper-item>
  12. </swiper>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. props: {
  19. info: {
  20. type: Object
  21. },
  22. is_specs: {
  23. type: Number
  24. },
  25. },
  26. data() {
  27. return {
  28. specsList: [],
  29. };
  30. },
  31. methods: {
  32. diaSpecs(e) {
  33. const that = this;
  34. that.$emit('diaSpecs', e)
  35. },
  36. },
  37. watch: {
  38. info: {
  39. deep: true,
  40. immediate: true,
  41. handler(val) {
  42. if (val && val.specs && val.specs.length > 0) this.$set(this, `specsList`, val?.specs)
  43. }
  44. }
  45. },
  46. }
  47. </script>
  48. <style lang="scss">
  49. .dialogs {
  50. swiper {
  51. height: 60vh;
  52. }
  53. .list {
  54. .list_1 {
  55. padding: 2vw;
  56. margin: 0 0 5vw 0;
  57. .image {
  58. width: 100%;
  59. height: 40vh;
  60. }
  61. }
  62. .name {
  63. text-align: center;
  64. margin: 0 10vw;
  65. background-color: #6666669f;
  66. border-radius: 25px;
  67. padding: 2vw;
  68. text {
  69. color: #fff;
  70. font-size: 15px;
  71. overflow: hidden;
  72. text-overflow: ellipsis;
  73. -webkit-line-clamp: 2;
  74. word-break: break-all;
  75. display: -webkit-box;
  76. -webkit-box-orient: vertical;
  77. }
  78. }
  79. }
  80. }
  81. </style>