s-invoice-item.vue 2.0 KB

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