more.vue 1.9 KB

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