吉光研途前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
1.5 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <template>
  2. <view class="module" @click="onClick">
  3. <image class="module-bg" :src="data.image" mode="scaleToFill"></image>
  4. <view class="flex module-fg">
  5. <button class="flex btn">
  6. <view>更多</view>
  7. <uv-icon name="arrow-down-fill" color="#808080" size="10rpx"></uv-icon>
  8. </button>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. props: {
  15. value: {
  16. type: Boolean,
  17. default: true
  18. },
  19. data: {
  20. type: Object,
  21. default() {
  22. return {}
  23. }
  24. },
  25. style: {
  26. type: String,
  27. default: ''
  28. },
  29. },
  30. computed: {
  31. isFold: {
  32. set(val) {
  33. this.$emit('input', val)
  34. },
  35. get() {
  36. return this.value
  37. }
  38. }
  39. },
  40. methods: {
  41. onClick() {
  42. const isFold = !this.isFold
  43. this.isFold = isFold
  44. this.$emit('change', isFold)
  45. },
  46. },
  47. }
  48. </script>
  49. <style scoped lang="scss">
  50. $w: calc(100vw - 38rpx*2);
  51. .module {
  52. font-size: 0;
  53. width: $w;
  54. height: auto;
  55. position: relative;
  56. font-size: 0;
  57. border-radius: 25rpx;
  58. overflow: hidden;
  59. box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0,0,0,0.16);
  60. &-bg {
  61. width: $w;
  62. height: calc(#{$w} * 179 / 714);
  63. }
  64. &-fg {
  65. position: absolute;
  66. top: 0;
  67. left: 0;
  68. align-items: center;
  69. justify-content: flex-end;
  70. width: 100%;
  71. height: 100%;
  72. padding: 0 22rpx;
  73. box-sizing: border-box;
  74. }
  75. .btn {
  76. column-gap: 10rpx;
  77. font-size: 22rpx;
  78. color: #808080;
  79. }
  80. }
  81. </style>