more.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <view class="more" :style="{ height: value ? '430rpx' : '0px' }">
  3. <view class="flex_r more-list">
  4. <view class="flex_c_c more-item" v-for="(item, index) in list" :key="index" @click="onClick(item)">
  5. <view class="icon_ more-item-icon">
  6. <image class="img" :src="item.icon" mode="aspectFill"></image>
  7. </view>
  8. <view class="text_26" style="color: #686868">
  9. {{ item.title }}
  10. </view>
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. props: {
  18. value: {
  19. type: Boolean,
  20. default: false
  21. }
  22. },
  23. // #4c4c4c
  24. data() {
  25. return {
  26. isShow: false,
  27. list: [
  28. {
  29. type: 'img',
  30. icon: 'https://jymini.oss-cn-guangzhou.aliyuncs.com/mini/msg-photo.svg',
  31. title: '照片'
  32. },
  33. {
  34. type: 'order',
  35. icon: 'https://jymini.oss-cn-guangzhou.aliyuncs.com/mini/msg-order.svg',
  36. title: '订单'
  37. },
  38. // {
  39. // type: 'video',
  40. // icon: 'https://jymini.oss-cn-guangzhou.aliyuncs.com/mini/msg-order.svg',
  41. // title: '视频'
  42. // }
  43. ]
  44. };
  45. },
  46. created() {},
  47. watch: {
  48. value: {
  49. handler: function (newV) {
  50. this.isShow = newV;
  51. },
  52. immediate: true
  53. }
  54. },
  55. methods: {
  56. onClick(item) {
  57. this.$emit('onMore', item);
  58. }
  59. }
  60. };
  61. </script>
  62. <style lang="scss" scoped>
  63. .more {
  64. position: relative;
  65. box-sizing: border-box;
  66. width: 100%;
  67. background-color: #f6f6f6;
  68. overflow: hidden;
  69. transition: all 0.2s;
  70. .more-line {
  71. position: absolute;
  72. top: 0;
  73. left: 0;
  74. right: 0;
  75. }
  76. .more-list {
  77. box-sizing: border-box;
  78. padding: 20rpx;
  79. width: 100%;
  80. height: 370rpx;
  81. flex-wrap: wrap;
  82. }
  83. .more-item {
  84. width: 25%;
  85. height: 190rpx;
  86. .more-item-icon {
  87. width: 120rpx;
  88. height: 120rpx;
  89. background-color: #fff;
  90. border-radius: 30rpx;
  91. margin-bottom: 10rpx;
  92. .img {
  93. width: 50%;
  94. height: 50%;
  95. }
  96. }
  97. }
  98. }
  99. </style>