goods-info.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <view class="goods-info" v-if="productData">
  3. <view class="row">
  4. <!-- 名称 -->
  5. <view class="name" v-text="productData.name"></view>
  6. <!-- 分割线 -->
  7. <view class="dashed"></view>
  8. <!-- 分享 -->
  9. <button class="share" @click="$emit('share')">
  10. <text class="iconfont icon-fenxiang"></text>
  11. <text class="text">分享</text>
  12. </button>
  13. </view>
  14. <view class="row" v-if="tagList.length > 0">
  15. <!-- 标签 -->
  16. <view class="goods-tags">
  17. <view class="tag" v-for="(item, index) in tagList" :key="index">{{ item }}</view>
  18. </view>
  19. </view>
  20. <view class="row" v-if="recommend">
  21. <!-- 备注 -->
  22. <view class="remark" v-text="recommend"></view>
  23. </view>
  24. <tui-divider :height="48"></tui-divider>
  25. <view class="row">
  26. <!-- 服务 -->
  27. <view class="service">
  28. <view class="iconfont icon-wuyoushouhou"><text>无忧退货</text></view>
  29. <view class="iconfont icon-wuyoushouhou"><text>快速退款</text></view>
  30. <view class="iconfont icon-wuyoushouhou"><text>正品保证</text></view>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. name: 'goods-info',
  38. props: {
  39. productData: {
  40. type: Object,
  41. default: () => null
  42. }
  43. },
  44. computed: {
  45. tagList() {
  46. return this.productData.tagsList || []
  47. }
  48. }
  49. }
  50. </script>
  51. <style lang="scss" scoped>
  52. .goods-info {
  53. padding: 24rpx;
  54. background-color: #fff;
  55. .row {
  56. @extend .cm-flex-between;
  57. &:nth-child(2) {
  58. margin-top: 10rpx;
  59. margin-bottom: 28rpx;
  60. }
  61. }
  62. .name {
  63. width: 540rpx;
  64. min-height: 96rpx;
  65. padding-right: 16rpx;
  66. font-size: 34rpx;
  67. line-height: 48rpx;
  68. color: #333333;
  69. }
  70. .dashed {
  71. height: 80rpx;
  72. border-right: 1rpx dashed #b2b2b2;
  73. }
  74. .share {
  75. @extend .cm-flex-center;
  76. flex-direction: column;
  77. line-height: 1;
  78. background: transparent;
  79. width: 80rpx;
  80. height: 100rpx;
  81. padding: 0;
  82. margin: 0;
  83. &::after {
  84. display: none;
  85. }
  86. .iconfont {
  87. font-size: 50rpx;
  88. color: #ff457b;
  89. }
  90. .text {
  91. font-size: 22rpx;
  92. color: #999999;
  93. }
  94. }
  95. .goods-tags {
  96. @extend .cm-flex-center;
  97. justify-content: flex-start;
  98. flex-wrap: wrap;
  99. .tag {
  100. padding: 0 8rpx;
  101. margin-right: 20rpx;
  102. height: 34rpx;
  103. background: #fff3f7;
  104. border-radius: 6rpx;
  105. font-size: 20rpx;
  106. color: #ff457b;
  107. line-height: 34rpx;
  108. }
  109. }
  110. .remark {
  111. font-size: 24rpx;
  112. color: #333333;
  113. &::before {
  114. content: '备注:';
  115. color: #666;
  116. }
  117. }
  118. .service {
  119. @extend .cm-flex-center;
  120. justify-content: flex-start;
  121. .iconfont {
  122. margin-right: 40rpx;
  123. font-size: 22rpx;
  124. color: #ff457b;
  125. &:last-child {
  126. margin-right: 0;
  127. }
  128. text {
  129. margin-left: 8rpx;
  130. color: #999999;
  131. }
  132. }
  133. }
  134. }
  135. </style>