s-userinfoai-item.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <!-- 用户信息卡片 -->
  2. <template>
  3. <view
  4. :class="[{ 'border-bottom': props.hasBorderBottom }]"
  5. class="userinfoai-item ss-flex ss-row-between ss-col-center"
  6. >
  7. <view v-if="!isEmpty(props.item)" class="item-left">
  8. <view class="area-text ss-flex ss-col-center">
  9. <uni-tag
  10. v-if="props.item.defaultStatus"
  11. class="ss-m-r-10"
  12. custom-style="background-color: var(--ui-BG-Main); border-color: var(--ui-BG-Main); color: #fff;"
  13. size="small"
  14. text="默认"
  15. />
  16. {{ props.item.areaName }}
  17. </view>
  18. </view>
  19. <view v-else>
  20. <view class="userinfoai-text ss-m-b-10">请选择用户信息</view>
  21. </view>
  22. <slot>
  23. <button class="ss-reset-button edit-btn" @tap.stop="onEdit">
  24. <view class="edit-icon ss-flex ss-row-center ss-col-center">
  25. <image :src="sheep.$url.static('/static/img/shop/member/userinfoai/edit.png')" />
  26. </view>
  27. </button>
  28. </slot>
  29. </view>
  30. </template>
  31. <script setup>
  32. /**
  33. * 基础组件 - 用户信息卡片
  34. *
  35. * @param {String} icon = _icon-edit - icon
  36. *
  37. * @event {Function()} click - 点击
  38. * @event {Function()} actionClick - 点击工具栏
  39. *
  40. * @slot - 默认插槽
  41. */
  42. import sheep from '@/sheep';
  43. import { isEmpty } from 'lodash-es';
  44. const props = defineProps({
  45. item: {
  46. type: Object,
  47. default() {},
  48. },
  49. hasBorderBottom: {
  50. type: Boolean,
  51. defult: true,
  52. },
  53. });
  54. const onEdit = () => {
  55. sheep.$router.go('/pages/member/userinfoai/edit', {
  56. id: props.item.id,
  57. });
  58. };
  59. </script>
  60. <style lang="scss" scoped>
  61. .userinfoai-item {
  62. padding: 24rpx 30rpx;
  63. .item-left {
  64. width: 600rpx;
  65. }
  66. .area-text {
  67. font-size: 26rpx;
  68. font-weight: 400;
  69. color: $dark-9;
  70. }
  71. .userinfoai-text {
  72. font-size: 32rpx;
  73. font-weight: 500;
  74. color: #333333;
  75. line-height: 48rpx;
  76. }
  77. .person-text {
  78. font-size: 28rpx;
  79. font-weight: 400;
  80. color: $dark-9;
  81. }
  82. }
  83. .edit-btn {
  84. width: 44rpx;
  85. height: 44rpx;
  86. background: $gray-f;
  87. border-radius: 50%;
  88. .edit-icon {
  89. width: 24rpx;
  90. height: 24rpx;
  91. }
  92. }
  93. image {
  94. width: 100%;
  95. height: 100%;
  96. }
  97. </style>