u-panel.vue 1016 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <view class="u-panel" :class="theme">
  3. <view class="u-panel-title u-flex" v-if="title">
  4. <image v-if="theme==='red'" class="icon" src="/static/home_label_red.png"></image>
  5. <image v-else class="icon" src="/static/home_label.png"></image>
  6. <view class="">{{title}}</view>
  7. <view style="flex:1" />
  8. </view>
  9. <slot />
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. name: "u-panel",
  15. props: {
  16. title: {
  17. type: String,
  18. default: ''
  19. },
  20. theme: {
  21. type: String,
  22. default: ''
  23. },
  24. },
  25. }
  26. </script>
  27. <style lang="scss" scoped>
  28. .u-panel {
  29. background: #FFFFFF;
  30. margin-bottom: 24rpx;
  31. box-shadow: 0px 4rpx 22rpx 0px rgba(232, 237, 251, 0.8);
  32. border-radius: 6rpx;
  33. padding: 12rpx 32rpx 24rpx;
  34. &.red {
  35. .u-panel-title {
  36. color: #EF6960;
  37. }
  38. }
  39. .u-panel-title {
  40. padding: 24rpx 0;
  41. text-align: left;
  42. font-size: 30rpx;
  43. font-weight: bold;
  44. color: #078EF7;
  45. .icon {
  46. width: 7rpx;
  47. height: 30rpx;
  48. margin-right: 20rpx;
  49. }
  50. }
  51. }
  52. </style>