吉光研途前端代码仓库
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.

112 lines
2.3 KiB

3 months ago
  1. <template>
  2. <view :style="style" @click="onClick">
  3. <view class="module">
  4. <image class="module-bg" src="@/static/image/bg-serve.png" mode="widthFix"></image>
  5. <image class="module-bg absolute" src="@/static/image/bg-serve-1.png" mode="widthFix"></image>
  6. <image class="module-bg absolute" src="@/static/image/bg-serve-2.png" mode="widthFix"></image>
  7. <view class="flex module-fg">
  8. <view class="flex module-info">
  9. <view class="title">{{ data.title }}</view>
  10. <image class="icon" src="@/static/image/serve-icon.png" mode="widthFix"></image>
  11. </view>
  12. <button class="flex btn">
  13. <view>更多</view>
  14. <uv-icon name="arrow-down-fill" color="#808080" size="10rpx"></uv-icon>
  15. </button>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. props: {
  23. value: {
  24. type: Boolean,
  25. default: true
  26. },
  27. data: {
  28. type: Object,
  29. default() {
  30. return {}
  31. }
  32. },
  33. style: {
  34. type: String,
  35. default: ''
  36. },
  37. },
  38. computed: {
  39. isFold: {
  40. set(val) {
  41. this.$emit('input', val)
  42. },
  43. get() {
  44. return this.value
  45. }
  46. }
  47. },
  48. methods: {
  49. onClick() {
  50. const isFold = !this.isFold
  51. this.isFold = isFold
  52. this.$emit('change', isFold)
  53. },
  54. },
  55. }
  56. </script>
  57. <style scoped lang="scss">
  58. .module {
  59. font-size: 0;
  60. width: 100%;
  61. height: auto;
  62. position: relative;
  63. &-bg {
  64. width: 100%;
  65. height: auto;
  66. }
  67. &-fg {
  68. position: absolute;
  69. top: 0;
  70. left: 0;
  71. justify-content: space-between;
  72. width: 100%;
  73. padding: 30rpx 30rpx 0 22rpx;
  74. box-sizing: border-box;
  75. }
  76. &-info {
  77. column-gap: 16rpx;
  78. .title {
  79. font-size: 32rpx;
  80. font-weight: 700;
  81. line-height: 1;
  82. font-family: PingFang SC;
  83. color: transparent;
  84. background-image: linear-gradient(to right, #6851A7, #AA87F0);
  85. background-clip: text;
  86. display: inline-block;
  87. }
  88. .icon {
  89. width: 30rpx;
  90. height: auto;
  91. }
  92. }
  93. .btn {
  94. column-gap: 10rpx;
  95. font-size: 22rpx;
  96. color: #808080;
  97. }
  98. }
  99. .absolute {
  100. position: absolute;
  101. top: 0;
  102. left: 0;
  103. }
  104. </style>