s-userinfoai-item.vue 2.2 KB

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