app-order-goods-info.vue 3.5 KB

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