lookPicModal.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <a-modal
  3. centered
  4. class="productInfoPicDetail-modal"
  5. :footer="null"
  6. :maskClosable="false"
  7. title="产品图片"
  8. v-model="isShow"
  9. @cancle="isShow=false"
  10. :width="800">
  11. <a-carousel arrows>
  12. <div slot="prevArrow" slot-scope="props" class="custom-slick-arrow" style="left: 10px;zIndex: 1">
  13. <a-icon type="left-circle" />
  14. </div>
  15. <div slot="nextArrow" slot-scope="props" class="custom-slick-arrow" style="right: 10px">
  16. <a-icon type="right-circle" />
  17. </div>
  18. <div><h3>1</h3></div>
  19. <div><h3>2</h3></div>
  20. <div><h3>3</h3></div>
  21. <div><h3>4</h3></div>
  22. </a-carousel>
  23. <div class="btn-cont"><a-button id="product-management-detail-modal-back" @click="isShow = false">返回列表</a-button></div>
  24. </a-modal>
  25. </template>
  26. <script>
  27. // import { dealerProductDetail } from '@/api/dealerProduct'
  28. export default {
  29. name: 'ProductInfoPicDetailModal',
  30. props: {
  31. openModal: { // 弹框显示状态
  32. type: Boolean,
  33. default: false
  34. },
  35. itemId: {
  36. type: [Number, String],
  37. default: ''
  38. }
  39. },
  40. data () {
  41. return {
  42. isShow: this.openModal, // 是否打开弹框
  43. detailsData: null // 详情数据
  44. }
  45. },
  46. methods: {
  47. // 获取详情
  48. getDetail () {
  49. // dealerProductDetail({ id: this.itemId }).then(res => {
  50. // if (res.status == 200) {
  51. // this.detailsData = res.data
  52. // }else{
  53. // this.detailsData = null
  54. // }
  55. // })
  56. }
  57. },
  58. watch: {
  59. // 父页面传过来的弹框状态
  60. openModal (newValue, oldValue) {
  61. this.isShow = newValue
  62. },
  63. // 重定义的弹框状态
  64. isShow (newValue, oldValue) {
  65. if (!newValue) {
  66. this.$emit('close')
  67. }
  68. },
  69. itemId (newValue, oldValue) {
  70. if (this.isShow && newValue) {
  71. this.getDetail()
  72. }
  73. }
  74. }
  75. }
  76. </script>
  77. <style lang="less">
  78. .productInfoPicDetail-modal{
  79. .ant-modal-body {
  80. padding: 40px 40px 24px;
  81. }
  82. .btn-cont {
  83. text-align: center;
  84. margin: 35px 0 10px;
  85. }
  86. }
  87. </style>
  88. <style scoped>
  89. /* For demo */
  90. .ant-carousel >>> .slick-slide {
  91. text-align: center;
  92. height: 160px;
  93. line-height: 160px;
  94. background: #364d79;
  95. overflow: hidden;
  96. }
  97. .ant-carousel >>> .custom-slick-arrow {
  98. width: 25px;
  99. height: 25px;
  100. font-size: 25px;
  101. color: #fff;
  102. background-color: rgba(31, 45, 61, 0.11);
  103. opacity: 0.3;
  104. }
  105. .ant-carousel >>> .custom-slick-arrow:before {
  106. display: none;
  107. }
  108. .ant-carousel >>> .custom-slick-arrow:hover {
  109. opacity: 0.5;
  110. }
  111. .ant-carousel >>> .slick-slide h3 {
  112. color: #fff;
  113. }
  114. </style>