customCard.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <view class="custom-card">
  3. <view class="custom-card-header">
  4. <view class="custom-card-action" @tap="BackPage">
  5. <u-icon name="arrow-left" color="#333333" size="32rpx" />
  6. <view class="custom-card-action-text">
  7. <slot name="backText"></slot>
  8. </view>
  9. </view>
  10. <view class="cu-bar-right">
  11. <slot name="right"></slot>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. name: 'custom-card',
  19. props: {},
  20. data() {
  21. return {};
  22. },
  23. methods: {
  24. BackPage() {
  25. uni.navigateBack({
  26. delta: 1,
  27. });
  28. },
  29. },
  30. };
  31. </script>
  32. <style scoped lang="scss">
  33. .custom-card {
  34. border-radius: 16upx;
  35. opacity: 1;
  36. padding-top: 80rpx;
  37. }
  38. .custom-card-header {
  39. padding: 0 20rpx;
  40. height: 90rpx;
  41. color: #333333;
  42. font-size: 28rpx;
  43. font-weight: 600;
  44. font-family: 'PingFang SC';
  45. line-height: 44rpx;
  46. position: relative;
  47. .custom-card-action {
  48. display: flex;
  49. align-items: center;
  50. height: 90rpx;
  51. line-height: 90rpx;
  52. .custom-card-action-text {
  53. width: 90%;
  54. text-align: center;
  55. color: #042118;
  56. font-size: 34rpx;
  57. }
  58. }
  59. .cu-bar-right {
  60. position: absolute;
  61. right: 20rpx;
  62. top: 20rpx;
  63. }
  64. }
  65. </style>