dt_unit_head_v2.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <view class="comp-goods-wrap">
  3. <view class="titleContent">
  4. <view class="title">{{ titleLeft }}</view>
  5. <view class="dian"></view>
  6. <view class="strongTitle">{{titleRight}}</view>
  7. </view>
  8. <view v-if="isShowMore" class="goods-text-title">
  9. <view class="text">{{memo}}</view>
  10. <view class="mode" @tap="tapMore">
  11. <text class="text">查看更多</text>
  12. <image src="https://szsq.nxzhsq.cn/community/miniofile/image/arrow.png" class="more-arrow-img"></image>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. titleLeft: '',
  22. titleRight: ''
  23. }
  24. },
  25. props: {
  26. title: {
  27. type: String,
  28. default: ""
  29. },
  30. memo: {
  31. type: String,
  32. default: ""
  33. },
  34. isShowMore: {
  35. type: Boolean,
  36. default: true
  37. }
  38. },
  39. created() {
  40. let titLen = this.title.length;
  41. this.titleLeft = this.title.substring(0, titLen - 2)
  42. this.titleRight = this.title.substring(titLen - 2, titLen)
  43. // console.log(this.titleLeft)
  44. },
  45. methods: {
  46. tapMore() {
  47. this.$emit("more");
  48. }
  49. }
  50. };
  51. </script>
  52. <style lang="scss">
  53. .comp-goods-wrap {
  54. margin: 0 20 upx;
  55. margin-top: 60 upx;
  56. }
  57. .titleContent {
  58. display: flex;
  59. align-items: center;
  60. .title {
  61. font-size: 42 upx;
  62. font-weight: 800;
  63. color: rgba(0, 0, 0, 1);
  64. line-height: 42 upx;
  65. }
  66. .dian {
  67. width: 8 upx;
  68. height: 8 upx;
  69. background: $dt-color-primary;
  70. border-radius: 50%;
  71. margin: 0 6 upx;
  72. }
  73. .strongTitle {
  74. font-size: 42 upx;
  75. font-weight: 800;
  76. color: $dt-color-primary;
  77. }
  78. }
  79. .goods-text-title {
  80. display: flex;
  81. justify-content: space-between;
  82. height: 70 upx;
  83. align-items: center;
  84. .mode {
  85. display: flex;
  86. justify-content: space-between;
  87. height: 24 upx;
  88. align-items: center;
  89. .more-arrow-img {
  90. margin-left: 10 upx;
  91. width: 12 upx;
  92. height: 12 upx;
  93. }
  94. }
  95. .text {
  96. font-size: 24 upx;
  97. font-weight: 400;
  98. color: rgba(102, 102, 102, 1);
  99. }
  100. }
  101. </style>