goods_detail.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <view class="cu-modal bottom-modal" :class="{'show': visible}">
  3. <view class="mask" @click="close"></view>
  4. <view class="wrapper cu-dialog">
  5. <view>
  6. <view>
  7. <view class="title">
  8. 商品详情
  9. <view class="close" @click="close">
  10. <text class="cuIcon-close"></text>
  11. </view>
  12. </view>
  13. </view>
  14. <scroll-view style="height: 700rpx" scroll-y>
  15. <view class="paddingX20 flex-column-align-center">
  16. <view v-if="item" class="color-white2 paddingB5 bold font5">{{item.name}}</view>
  17. <image v-for="(item, index) in picArray" :key="index" class="image marginY5" :src="item" mode="aspectFit" />
  18. </view>
  19. </scroll-view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import resource from '@/utils/resource'
  26. export default {
  27. data() {
  28. return {
  29. resource,
  30. visible: false,
  31. picArray: [],
  32. item: null
  33. }
  34. },
  35. methods: {
  36. show(item) {
  37. this.visible = true
  38. this.item = item
  39. this.picArray = item.pic.split(',')
  40. },
  41. close() {
  42. this.visible = false
  43. this.picArray = []
  44. this.$emit('close')
  45. }
  46. }
  47. }
  48. </script>
  49. <style lang="scss" scoped>
  50. .mask {
  51. position: absolute;
  52. left: 0;
  53. right: 0;
  54. top: 0;
  55. bottom: 0;
  56. }
  57. .wrapper {
  58. background: #fff;
  59. border-radius: 15px 15px 0px 0px !important;
  60. .title {
  61. text-align: center;
  62. font-size: 32rpx;
  63. font-family: Source Han Sans, Source Han Sans;
  64. font-weight: 700;
  65. color: #000000;
  66. padding: 44rpx 0 48rpx 0;
  67. position: relative;
  68. }
  69. .close {
  70. position: absolute;
  71. right: 0;
  72. width: 48rpx;
  73. height: 48rpx;
  74. background: #ebebeb;
  75. border-radius: 48rpx;
  76. color: #a2a2a2;
  77. top: 30rpx;
  78. line-height: 48rpx;
  79. }
  80. }
  81. </style>