trajectory.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <view class="trajectory">
  3. <view class="title">访问轨迹</view>
  4. <time-axis v-for="item in trajectoryList" :key="item.userID">
  5. <template #title>
  6. <text>{{item.accessTime}}</text>
  7. </template>
  8. <template #content>
  9. <view class="time-axis-content">
  10. <image :src="item.titleImage || '../../../../static/temp/icon-new@2x.png'" class="axis-product" mode=""></image>
  11. <view class="axis-product-info">
  12. <view class="product-title">【{{item.pageType | pageTypeChange}}】</view>
  13. <view class="product-info" v-if="item.title">{{item.title}}</view>
  14. </view>
  15. </view>
  16. </template>
  17. </time-axis>
  18. </view>
  19. </template>
  20. <script>
  21. import TimeAxis from './time-axis.vue'
  22. export default {
  23. props: {
  24. trajectoryList: {
  25. type: Array,
  26. default: () => ([])
  27. }
  28. },
  29. components: {
  30. TimeAxis
  31. },
  32. filters: {
  33. pageTypeChange(val) {
  34. const obj = {
  35. '6': '商品',
  36. '11': '文章',
  37. '8': '搜索记录'
  38. }
  39. return obj[val]
  40. }
  41. },
  42. data() {
  43. return {}
  44. }
  45. }
  46. </script>
  47. <style lang="scss">
  48. .trajectory {
  49. margin: 24rpx auto;
  50. width: 702rpx;
  51. background-color: #fff;
  52. border-radius: 16rpx;
  53. padding: 40rpx 32rpx;
  54. box-sizing: border-box;
  55. .title {
  56. color: #333333;
  57. font-size: 28rpx;
  58. font-weight: bold;
  59. margin-bottom: 30rpx;
  60. }
  61. }
  62. .axis-product {
  63. width: 136rpx;
  64. height: 136rpx;
  65. object-fit: contain;
  66. }
  67. .axis-product-info {
  68. display: flex;
  69. flex-direction: column;
  70. height: 136rpx;
  71. width: 426rpx;
  72. color: #333333;
  73. font-size: 26rpx;
  74. margin-left: 24rpx;
  75. .product-info {
  76. margin-top: 16rpx;
  77. overflow: hidden;
  78. -webkit-line-clamp: 2;
  79. text-overflow: ellipsis;
  80. display: -webkit-box;
  81. -webkit-box-orient: vertical;
  82. height: 73rpx;
  83. width: 426rpx;
  84. }
  85. }
  86. .time-axis-content {
  87. display: flex;
  88. align-items: center;
  89. }
  90. </style>