app-order-goods-info.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <view class="app-order-goods-info">
  3. <view class='dir-left-nowrap item-box' :style="{'margin-bottom': isLastOne ? '24rpx' : 0}">
  4. <image class='img box-grow-0' mode='aspectFill' :src='goods.pic_url'></image>
  5. <view class='box-grow-1'>
  6. <view class='goods-name'>{{goods.name}}</view>
  7. <view class='attr'>规格:
  8. <text v-for='item in goods.attr_list' :key='item.id'>{{item.attr_name}}</text>
  9. </view>
  10. <view class='dir-left-nowrap'>
  11. <view class='box-grow-1 goods-num'>x{{goods.num}}</view>
  12. <view class='box-grow-0' v-if="plugin == 'composition'">
  13. <view class='main-right price delete-price'>
  14. ¥{{goods.total_price}}
  15. </view>
  16. </view>
  17. <view class='box-grow-0 dir-left-nowrap' v-else>
  18. <view v-if="pluginData && pluginData.exchange_list && pluginData.exchange_list.length" class="price">{{pluginData.exchange_list[pluginIndex].value}}{{pluginData.price_name}}+</view>
  19. <view class='main-right price'>
  20. ¥{{pluginData.price_list ? pluginData.price_list[pluginIndex].value : goods.total_price}}
  21. </view>
  22. </view>
  23. <view class="share-price" v-if="isShare">佣金¥{{goods.share_price?goods.share_price:0}}</view>
  24. </view>
  25. <view class="composition-price" v-if="plugin == 'composition'">
  26. 搭配套餐价<text>¥{{goods.total_price}}</text>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. name: 'app-order-goods-info',
  35. data() {
  36. return {}
  37. },
  38. props: {
  39. goods: {
  40. type: Object,
  41. default: {}
  42. },
  43. plugin: {
  44. type: String,
  45. default: ''
  46. },
  47. isLastOne: {
  48. type: Boolean,
  49. default: true
  50. },
  51. isShare: {
  52. type: Boolean,
  53. default: false
  54. },
  55. pluginData: {
  56. type: Object,
  57. default: {}
  58. },
  59. pluginIndex: {
  60. type: Number,
  61. default: 0,
  62. }
  63. },
  64. }
  65. </script>
  66. <style scoped lang="scss">
  67. .app-order-goods-info {
  68. font-size: 24#{rpx};
  69. width: 100%;
  70. .img {
  71. width: 160#{rpx};
  72. height: 160#{rpx};
  73. margin-right: 20#{rpx};
  74. flex-shrink: 0;
  75. }
  76. .item-box {
  77. width: 100%;
  78. margin-bottom: 24#{rpx};
  79. }
  80. .label {
  81. color: $uni-general-color-two;
  82. }
  83. .price {
  84. color: $uni-important-color-black;
  85. &.delete-price {
  86. text-decoration: line-through;
  87. }
  88. }
  89. .composition-price {
  90. text-align: right;
  91. font-size: #{22rpx};
  92. color: #999999;
  93. text {
  94. font-size: #{28rpx};
  95. color: #353535;
  96. margin-left: #{8rpx};
  97. }
  98. }
  99. .goods-num {
  100. font-size: $uni-font-size-weak-one;
  101. color: $uni-general-color-two;
  102. }
  103. .attr {
  104. width: 450#{rpx};
  105. margin: 10#{rpx} 0;
  106. color: $uni-general-color-two;
  107. font-size: $uni-font-size-weak-one;
  108. display: inline-block;
  109. white-space: nowrap;
  110. overflow: hidden;
  111. text-overflow: ellipsis;
  112. text {
  113. margin-right: 10#{rpx};
  114. }
  115. }
  116. .goods-name {
  117. color: $uni-important-color-black;
  118. font-size: $uni-font-size-general-two;
  119. word-break: break-all;
  120. text-overflow: ellipsis;
  121. display: -webkit-box;
  122. -webkit-box-orient: vertical;
  123. -webkit-line-clamp: 2;
  124. overflow: hidden;
  125. }
  126. .share-price{
  127. position: absolute;
  128. right: 0;
  129. bottom: 16px;
  130. font-size: 22rpx;
  131. }
  132. }
  133. </style>