order-list.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <view class="page-width">
  3. <view class="page-width order-list">
  4. <view @click="navigateTo(`/plugins/gift/detail/detail?gift_id=${item.id}&status=${tab_status}`)"
  5. class="order-item"
  6. v-for="(item, index) in order_list"
  7. :key="index"
  8. >
  9. <view class="page-width order-number-status main-between">
  10. <text>订单号 {{item.sendOrder[0].order_no}}</text>
  11. <text>{{item.status}}</text>
  12. </view>
  13. <view class="page-width item-content main-between cross-top">
  14. <!-- 商品图片 -->
  15. <image class="pic"
  16. :src="item.is_big_gift === 0 ? getPicUrl(item.sendOrder[0].detail[0].goods_info) : big_gift_pic"
  17. ></image>
  18. <view class="name-attr-price dir-top-nowrap main-between">
  19. <view>
  20. <!-- 商品名字 -->
  21. <view class="page-width name t-omit-two">
  22. {{item.is_big_gift === 0 ? item.sendOrder[0].detail[0].goods.goodsWarehouse.name : `大礼包`}}
  23. </view>
  24. <!-- 商品规格 -->
  25. <view class="attr t-omit">
  26. <template v-if="item.is_big_gift === 0">
  27. <block v-for="(a, k) in JSON.parse(item.sendOrder[0].detail[0].goods_info).attr_list" :key="k">
  28. {{a.attr_group_name}}:{{a.attr_name}}&nbsp;&nbsp;&nbsp;&nbsp;
  29. </block>
  30. </template>
  31. </view>
  32. </view>
  33. <!-- 商品价格数量 -->
  34. <view class="number-price main-between">
  35. <text class="number">{{item.is_big_gift === 0 ? `×${item.num}` : `共${item.sendOrder[0].detail.length}种商品`}}</text>
  36. <text class="price">{{item.sendOrder[0].total_pay_price}}</text>
  37. </view>
  38. </view>
  39. </view>
  40. <!-- 底部按钮 -->
  41. <view class="page-width nav main-between">
  42. <view class="status">
  43. {{item.type === `direct_open` ? `直接送礼` : item.type === `time_open` ? `定时开奖 ${item.open_time}` : item.type === `num_open` ? `满人开奖 满${item.open_num}人开奖` : ``}}
  44. </view>
  45. <view @click.stop="redirectTo" class="again-button" >
  46. 再送一份
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <template v-if="order_list.length === 0">
  52. <view class="order-empty page-width dir-top-nowrap cross-center">
  53. <image class="image" src="/static/image/order-empty.png"></image>
  54. <text>没有任何记录~</text>
  55. </view>
  56. </template>
  57. </view>
  58. </template>
  59. <script>
  60. export default {
  61. name: 'order-list',
  62. props: {
  63. theme: String,
  64. order_list: Array,
  65. tab_status: Number,
  66. big_gift_pic: String,
  67. },
  68. methods: {
  69. // 跳转到首页
  70. redirectTo() {
  71. uni.redirectTo({
  72. url: `/plugins/gift/index/index`
  73. })
  74. },
  75. // 跳转到详情
  76. navigateTo(data) {
  77. uni.navigateTo({
  78. url: data
  79. })
  80. },
  81. getPicUrl(data) {
  82. let goods_attr = JSON.parse(data).goods_attr;
  83. return goods_attr.pic_url ? goods_attr.pic_url : goods_attr.cover_pic;
  84. }
  85. }
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. @import "../../css/gift.scss";
  90. .order-empty {
  91. width: 100%;
  92. margin-top: #{200upx};
  93. .image {
  94. width: #{240upx};
  95. height: #{240upx};
  96. }
  97. text {
  98. font-size: #{22upx};
  99. color: #666666;
  100. text-align: center;
  101. margin-top: #{28upx};
  102. }
  103. }
  104. // 订单列表
  105. .order-list {
  106. padding: #{0 24upx 24upx 24upx};
  107. // 订单
  108. .order-item {
  109. border-radius: #{16upx};
  110. background-color: #ffffff;
  111. padding: #{24upx};
  112. margin-top: #{24upx};
  113. }
  114. }
  115. /*订单号状态值*/
  116. .order-number-status {
  117. font-size: #{24upx};
  118. color: #353535;
  119. padding: #{8upx 0 4upx 0};
  120. >text {
  121. line-height: 1;
  122. }
  123. }
  124. /*图片价格名字规格价格数量*/
  125. .item-content {
  126. padding: #{28upx 0};
  127. .pic-content {
  128. width: #{160upx};
  129. height: #{160upx};
  130. }
  131. /*照片*/
  132. .pic {
  133. width: #{160upx};
  134. height: #{160upx};
  135. border-radius: #{8upx};
  136. }
  137. /*名字规格价格*/
  138. .name-attr-price {
  139. width: calc(100% - #{160upx});
  140. min-height: #{160upx};
  141. padding-left: #{10upx};
  142. }
  143. /*名字*/
  144. .name {
  145. font-size: #{24upx};
  146. line-height: #{31upx};
  147. height: #{62upx};
  148. color: #353535;
  149. margin: #{8upx 0 17.6upx 0};
  150. }
  151. /*规格*/
  152. .attr {
  153. white-space: normal;
  154. color: #999999;
  155. font-size: #{24upx};
  156. height: #{24upx};
  157. line-height: 1;
  158. }
  159. /*价格数量*/
  160. .number-price {
  161. font-size: #{24upx};
  162. line-height: 1;
  163. margin-bottom: #{12upx};
  164. .number {
  165. color: #999999;
  166. }
  167. .price {
  168. color: #353535;
  169. }
  170. .price:before {
  171. content: "¥";
  172. }
  173. }
  174. }
  175. /*状态跳转*/
  176. .nav {
  177. height: #{48upx};
  178. .again-button {
  179. padding: #{12upx 20upx};
  180. font-size: #{24upx};
  181. color: #666666;
  182. line-height: 1;
  183. border-radius: #{28upx};
  184. border: #{1upx} solid #bbbbbb;
  185. }
  186. .status {
  187. font-size: #{24upx};
  188. line-height: 1;
  189. color: #353535;
  190. padding: #{12upx 0};
  191. }
  192. }
  193. </style>