order.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <view class="page-width order">
  3. <view class="page-width order-content">
  4. <view class="item dir-left-nowrap" v-for="(item, index) in order_list" :key="index">
  5. <view class="image">
  6. <image class="pic" :src="item.goods_info | getPicUrl"></image>
  7. <text v-if="sign" :class="[`${theme}-background`, `sign`]">{{sign}}</text>
  8. </view>
  9. <view class="name-attr-price dir-top-nowrap main-left">
  10. <view class="name">{{item.name}}</view>
  11. <view class="attr">
  12. <block
  13. v-for="(name, key) in JSON.parse(item.goods_info).attr_list"
  14. :key="key"
  15. >
  16. {{name.attr_group_name}}:{{name.attr_name}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  17. </block>
  18. </view>
  19. <view class="number-price dir-left-nowrap main-between">
  20. <text class="number gray">{{item.num}}</text>
  21. <text class="price black">{{item.total_price}}</text>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="total dir-left-nowrap main-right cross-center">
  26. <text class="gray-word gray">合计</text>
  27. <text class="black-word black">{{total_price}}</text>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. name: "order",
  35. props: {
  36. order_list: Array,
  37. sign: String,
  38. theme: String,
  39. total_price: Number,
  40. },
  41. filters: {
  42. getPicUrl(data) {
  43. let goods_attr = JSON.parse(data).goods_attr;
  44. return goods_attr.pic_url ? goods_attr.pic_url : goods_attr.cover_pic;
  45. }
  46. }
  47. }
  48. </script>
  49. <style scoped lang="scss">
  50. @import "../../css/gift.scss";
  51. .order {
  52. padding: #{0 24upx};
  53. margin-top: #{24upx};
  54. .order-content {
  55. background-color: #ffffff;
  56. padding: #{24upx 24upx 0 24upx};
  57. overflow: hidden;
  58. }
  59. }
  60. /*订单*/
  61. .item {
  62. margin-bottom: #{24upx};
  63. .image {
  64. width: #{160upx};
  65. height: #{160upx};
  66. position: relative;
  67. .pic {
  68. border-radius: #{8upx};
  69. width: #{160upx};
  70. height: #{160upx};
  71. }
  72. }
  73. .sign {
  74. position: absolute;
  75. top: 0;
  76. left: 0;
  77. border-top-left-radius: #{8upx};
  78. font-size: #{24upx};
  79. color: #ffffff;
  80. padding: #{10upx};
  81. }
  82. }
  83. /*名字价格规格*/
  84. .name-attr-price {
  85. width: calc(100% - #{160upx});
  86. padding-left: #{20upx};
  87. .name {
  88. font-size: #{24upx};
  89. line-height: #{30upx};
  90. height: #{60upx};
  91. margin-top: #{5upx};
  92. word-break: break-all;
  93. text-overflow: ellipsis;
  94. display: -webkit-box;
  95. -webkit-box-orient: vertical;
  96. -webkit-line-clamp: 2;
  97. overflow: hidden;
  98. white-space: normal !important;
  99. }
  100. .attr {
  101. font-size: #{24upx};
  102. color: #999999;
  103. margin-top: #{17upx};
  104. word-break: break-all;
  105. text-overflow: ellipsis;
  106. display: -webkit-box;
  107. -webkit-box-orient: vertical;
  108. -webkit-line-clamp: 1;
  109. overflow: hidden;
  110. white-space: normal !important;
  111. }
  112. .number-price {
  113. font-size: #{24upx};
  114. line-height: 1;
  115. margin-top: #{20upx};
  116. .number:before {
  117. content: "×";
  118. font-size: 80%;
  119. }
  120. .price:before {
  121. content: "¥";
  122. }
  123. }
  124. }
  125. /*合计*/
  126. .total {
  127. padding: #{24upx 0};
  128. /*灰字*/
  129. .gray-word {
  130. font-size: #{24upx};
  131. line-height: 1;
  132. }
  133. /*黑字*/
  134. .black-word {
  135. font-size: #{28upx};
  136. line-height: 1;
  137. }
  138. .black-word:before {
  139. content: '¥';
  140. font-size: 100%;
  141. }
  142. }
  143. </style>