Box2LineImageRightShadow.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <view
  3. class="d-flex flex-row flex-grow-1 justify-between shadow-s
  4. radius-base mb-3 p-2 pt-3 pb-3 overflow-hidden
  5. border-all-light-light-primary"
  6. :style="{
  7. height: 'calc(100% - 20rpx)',
  8. width: 'calc(100% - 10rpx)',
  9. }"
  10. @click="$emit('click')"
  11. >
  12. <view class="d-flex flex-row w-100">
  13. <image
  14. :class="[
  15. wideImage ? 'width-250' : 'width-150',
  16. 'height-150',
  17. 'radius-base',
  18. 'flex-shrink-0',
  19. ]"
  20. :src="image"
  21. :style="{
  22. backgroundImage: `url('${image}')`,
  23. backgroundSize: 'cover',
  24. }"
  25. mode="aspectFit"
  26. />
  27. <view class="d-flex flex-col ml-3 flex-one width-500">
  28. <view class="d-flex flex-row">
  29. <text :class="[
  30. 'color-primary size-base',
  31. desc || title1 ? 'text-lines-1' : 'text-lines-2',
  32. titleBox ? 'border-all-text' : '',
  33. ]">{{ title }}</text>
  34. </view>
  35. <text class="size-s color-second text-lines-2 mt-2">{{ desc }}</text>
  36. <RoundTags v-if="tags" :tags="tags" small />
  37. </view>
  38. </view>
  39. <text class="color-primary-second-text size-ss">{{ right }}</text>
  40. </view>
  41. </template>
  42. <script setup lang="ts">
  43. import type { PropType } from 'vue';
  44. import RoundTags from './RoundTags.vue';
  45. defineProps({
  46. title: String,
  47. desc: String,
  48. right: String,
  49. image: String,
  50. titleBox: {
  51. type: Boolean,
  52. default: false,
  53. },
  54. tags: {
  55. type: Array as PropType<string[]>,
  56. default: null
  57. },
  58. wideImage: {
  59. type: Boolean,
  60. default: false,
  61. },
  62. title1: {
  63. type: Boolean,
  64. default: false,
  65. }
  66. })
  67. </script>