partner-order-item.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <view class="order-item">
  3. <view class="order-no">
  4. 订单编号:{{ order.orderId }}
  5. <text class="status">{{ statusList[order.status] }}</text>
  6. </view>
  7. <view class="book-list">
  8. <image v-for="(book, index) in order.detailCoverList" :key="index" :src="book" mode="aspectFill"
  9. class="book-cover" />
  10. </view>
  11. <view class="order-info">
  12. <view class="info-row">
  13. <text>{{ isBuy ? '买书' : '卖书' }}订单状态</text>
  14. <text>{{ currentOrderStatusText || "-" }}</text>
  15. </view>
  16. <view class="info-row">
  17. <text>{{ isBuy ? '买书' : '卖书' }}订单预估金额</text>
  18. <text class="amount">¥{{ order.orderExpectMoney }}</text>
  19. </view>
  20. <view class="info-row">
  21. <text>我的预估佣金</text>
  22. <text class="commission">¥{{ order.expectSettlementMoney }}</text>
  23. </view>
  24. <view class="info-row" v-if="order.status == 2 || order.status == 3">
  25. <text>{{ isBuy ? '买书' : '卖书' }}订单核算金额</text>
  26. <text class="amount">¥{{ order.orderFinalMoney || "-" }}</text>
  27. </view>
  28. <view class="info-row" v-if="order.status == 2 || order.status == 3">
  29. <text>我的结算佣金</text>
  30. <text class="commission">¥{{ order.settlementMoney || "-" }}</text>
  31. </view>
  32. </view>
  33. <view class="order-time">创建时间:{{ order.createTime }}</view>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. name: "partner-order-item",
  39. props: {
  40. order: {
  41. type: Object,
  42. default: () => ({}),
  43. },
  44. type: {
  45. type: [String, Number],
  46. default: 0
  47. }
  48. },
  49. data() {
  50. return {
  51. statusList: {
  52. "1": "未结算",
  53. "2": "已结算",
  54. "3": "已到账",
  55. "4": "已失效",
  56. },
  57. //-1-已取消 0-待提交 1-已删除 2-待初审 3-待取件 4-初审未通过 5-待签收 6-待收货 7-待收货 8-待审核 9-审核中 10-待到款 11-已完成
  58. sellStatusList: {
  59. "-1": "已取消",
  60. "0": "待提交",
  61. "1": "已删除",
  62. "2": "待初审",
  63. "3": "待取件",
  64. "4": "初审未通过",
  65. "5": "待签收",
  66. "6": "待收货",
  67. "7": "待收货",
  68. "8": "待审核",
  69. "9": "审核中",
  70. "10": "待到款",
  71. "11": "已完成",
  72. },
  73. // 1-待付款 2-待发货 3-待收货 4-用户已签收 5-已完成 6-已取消
  74. buyStatusList: {
  75. "1": "待付款",
  76. "2": "待发货",
  77. "3": "待收货",
  78. "4": "用户已签收",
  79. "5": "已完成",
  80. "6": "已取消",
  81. }
  82. };
  83. },
  84. computed: {
  85. isBuy() {
  86. return this.type == 1 || this.order.type == '2';
  87. },
  88. currentOrderStatusText() {
  89. if (this.isBuy) {
  90. return this.buyStatusList[this.order.orderStatus] || "-";
  91. } else {
  92. return this.sellStatusList[this.order.orderStatus] || "-";
  93. }
  94. }
  95. }
  96. };
  97. </script>
  98. <style lang="scss" scoped>
  99. .order-item {
  100. background: #ffffff;
  101. border-radius: 8px;
  102. padding: 16px;
  103. margin-bottom: 12px;
  104. .order-no {
  105. display: flex;
  106. justify-content: space-between;
  107. margin-bottom: 12px;
  108. font-size: 28rpx;
  109. color: #333333;
  110. line-height: 36rpx;
  111. font-family: PingFang SC;
  112. font-weight: bold;
  113. .status {
  114. color: #ff0000;
  115. }
  116. }
  117. .book-list {
  118. width: 100%;
  119. display: flex;
  120. gap: 16rpx;
  121. margin-bottom: 20rpx;
  122. overflow-x: auto;
  123. .book-cover {
  124. min-width: 132rpx;
  125. width: 132rpx;
  126. height: 185rpx;
  127. border-radius: 10rpx;
  128. }
  129. }
  130. .order-info {
  131. background: #f8f8f8;
  132. border-radius: 4px;
  133. width: 630rpx;
  134. border: 1px solid #ebebeb;
  135. .info-row {
  136. display: flex;
  137. justify-content: space-between;
  138. font-size: 14px;
  139. height: 60rpx;
  140. line-height: 60rpx;
  141. border-bottom: 1px solid #ebebeb;
  142. color: #666;
  143. &:last-child {
  144. border-bottom: none;
  145. }
  146. &:last-child {
  147. margin-bottom: 0;
  148. }
  149. text {
  150. flex: 1;
  151. padding-left: 20rpx;
  152. }
  153. text:last-child {
  154. border-left: 1px solid #ebebeb;
  155. background-color: #ffffff;
  156. }
  157. .amount {
  158. color: #333;
  159. }
  160. .commission {
  161. color: #ff0000;
  162. }
  163. }
  164. }
  165. .order-time {
  166. margin-top: 12px;
  167. font-size: 13px;
  168. color: #999;
  169. }
  170. }
  171. </style>