order.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view class="share-order">
  3. <view
  4. v-for="(item, index) in order"
  5. :key="index"
  6. class="order-box"
  7. >
  8. <view class="order-num">
  9. 订单号: {{ item.order_id }}
  10. </view>
  11. <view class="child-info main-between cross-center">
  12. <view class="base main-left cross-center">
  13. <view class="head-img">
  14. <image :src="item.order.user.avatar" />
  15. </view>
  16. <view class="nickname main-left cross-center">
  17. <view class="nickname">
  18. <u-text :text="item.order.user.nickname" :lines="1" color="#ffffff" size="28rpx" />
  19. </view>
  20. <view class="level">1级</view>
  21. </view>
  22. </view>
  23. <view class="income-info main-left cross-center">
  24. <text>已得佣金:{{ item.income }}元</text>
  25. <u-icon :name="item.showDetail?'arrow-up':'arrow-down'" top="1" @click="handleShow(item)" />
  26. </view>
  27. </view>
  28. <view v-show="item.showDetail" class="detail main-between cross-center">
  29. <view class="goods-info main-left cross-center">
  30. <view class="cover-img">
  31. <image />
  32. </view>
  33. <view class="combo dir-top-wrap main-center">
  34. <text class="type">{{ item.type_name }}</text>
  35. <text>{{ item.order.combo.name }}</text>
  36. </view>
  37. </view>
  38. <view class="income dir-top-wrap">
  39. <view class="num">x1</view>
  40. <view class="price">¥{{ item.order.combo.price }}</view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. name: 'ShareOrder',
  49. components: {},
  50. data() {
  51. return {
  52. limit: 10,
  53. page: 1,
  54. isMore: true,
  55. order: []
  56. }
  57. },
  58. computed: {},
  59. methods: {
  60. handleShow(item) {
  61. item.showDetail = !item.showDetail
  62. },
  63. getOrder() {
  64. this.$loading()
  65. this.$api.share.order.lists({ limit: this.limit, page: this.page }).then(res => {
  66. this.$hideLoading()
  67. if (res.data.length) {
  68. res.data.forEach(obj => {
  69. obj.showDetail = false
  70. })
  71. this.order = this.order.concat(res.data)
  72. } else {
  73. this.isMore = false
  74. }
  75. })
  76. }
  77. },
  78. onLoad() {
  79. this.getOrder()
  80. },
  81. onReachBottom(e) {
  82. if (!this.isMore) return
  83. this.page += 1
  84. this.getOrder()
  85. }
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. .share-order {
  90. padding: 40rpx 30rpx;
  91. font-size: 28rpx;
  92. .order-box{
  93. background: $bg-op-color;
  94. color: #ffffff;
  95. padding: 30rpx 0;
  96. border-radius: 20rpx;
  97. margin-bottom: 30px;
  98. .order-num{
  99. padding: 0 30rpx 30rpx;
  100. border-bottom: 1rpx $border-op-color solid;
  101. }
  102. .child-info{
  103. padding: 30rpx 30rpx;
  104. .base{
  105. .head-img{
  106. width: 70rpx;
  107. height: 70rpx;
  108. border-radius: 50%;
  109. overflow: hidden;
  110. background: #ccc;
  111. image{
  112. width: 100%;
  113. height: 100%;
  114. }
  115. }
  116. .nickname{
  117. margin-left: 10rpx;
  118. flex: 1;
  119. .level{
  120. color: #6eebe8;
  121. }
  122. }
  123. }
  124. .income-info{
  125. text{
  126. margin-right: 18rpx;
  127. }
  128. }
  129. }
  130. .detail{
  131. padding: 30rpx 30rpx 0;
  132. border-top: 1rpx $border-op-color solid;
  133. .goods-info{
  134. .cover-img{
  135. width: 80rpx;
  136. height: 80rpx;
  137. border-radius: 8rpx;
  138. overflow: hidden;
  139. background: #ccc;
  140. image{
  141. width: 100%;
  142. height: 100%;
  143. }
  144. }
  145. .combo{
  146. margin-left: 20rpx;
  147. .type{
  148. margin-bottom: 6rpx;
  149. }
  150. }
  151. }
  152. .income{
  153. color: #6eebe8;
  154. text-align: right;
  155. .num{
  156. font-size: 24rpx;
  157. margin-bottom: 6rpx;
  158. }
  159. }
  160. }
  161. }
  162. }
  163. </style>