dialog_1.vue 1.7 KB

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