sell-list.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <view>
  3. <scroll-view
  4. class="wrapper"
  5. :style="{ top: top + 'px' }"
  6. scroll-y
  7. refresher-enabled
  8. refresher-default-style="white"
  9. @refresherrefresh="pullRefresh"
  10. :refresher-triggered="refreshing"
  11. @scrolltolower="loadMore"
  12. >
  13. <tabbar2 custom-class="marginX14 marginY10" :tabs="tabs" @change="clickTab" />
  14. <view v-if="tableData" class="paddingX14">
  15. <view
  16. v-for="(item, index) in tableData"
  17. :key="item.id"
  18. class="cell marginB12 paddingX15 relative"
  19. >
  20. <view class="paddingT15 paddingB10 flex-align">
  21. <image
  22. :src="item.itemList[0].cover"
  23. class="image flex-shrink0"
  24. mode="aspectFit"
  25. />
  26. <view
  27. class="flex1 self-stretch paddingY5 flex-column-between paddingL12 color-white"
  28. >
  29. <view class="flex-align">
  30. <view class="font4 line-ellipsis flex1 bold" style="width: 0">
  31. {{ item.itemList[0].name }}
  32. </view>
  33. </view>
  34. <view class="flex-align font4">
  35. <view>售价:¥</view>
  36. <view class="bold flex1">{{ item.totalAmount }}</view>
  37. <image
  38. v-if="item.level"
  39. style="width: 110rpx; height: 32rpx"
  40. :src="LEVEL_MAP[item.level].titleText"
  41. />
  42. </view>
  43. <view class="color-theme">
  44. <text class="font2">实收款:</text>
  45. <text class="font8 bold">
  46. ¥{{ (item.paymentAmount - item.feeAmount).toFixed(2) }}
  47. </text>
  48. <text v-if="item.feeAmount > 0" class="font3 marginL8">
  49. ( 交易服务费: ¥{{ item.feeAmount }} )
  50. </text>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="line"></view>
  55. <view class="font2 color-white paddingY9">
  56. <view class="order-no font2 flex-align-between">
  57. <view>订单号:{{ item.tradeNo }}</view>
  58. <view class="flex-align-end">
  59. <button
  60. class="btn-clear copy marginL5 flex-shrink0"
  61. @click.stop="$common.copy(item.tradeNo)"
  62. >
  63. 复制
  64. </button>
  65. </view>
  66. </view>
  67. <view class="font2 flex-align-between paddingT8">
  68. 下单时间: {{ item.createTime }}
  69. </view>
  70. <!-- <view v-if="item.paymentTime" class="font2 flex-align-between paddingT8">
  71. 付款时间: {{item.paymentTime}}
  72. </view> -->
  73. </view>
  74. <image
  75. v-if="item.status === 99"
  76. :src="resource.sell_status_ok"
  77. class="status"
  78. />
  79. <image
  80. v-else-if="item.status === 0"
  81. :src="resource.sell_status_to_pay"
  82. class="status"
  83. />
  84. <image
  85. v-else-if="item.status === 10"
  86. :src="resource.sell_status_cancel"
  87. class="status"
  88. />
  89. <image
  90. v-else-if="item.status === 11"
  91. :src="resource.sell_status_timeout"
  92. class="status"
  93. style="width: 124rpx"
  94. />
  95. </view>
  96. </view>
  97. <empty v-if="isEmpty" :top="200" light />
  98. </scroll-view>
  99. </view>
  100. </template>
  101. <script>
  102. import { LEVEL_MAP } from '@/utils/config'
  103. import tabbar2 from '@/components/tabbar2'
  104. import empty from '@/components/empty'
  105. import pageMixin from './../../mixin/page'
  106. import resource from '@/utils/resource'
  107. const Tabs = [
  108. { title: '全部', value: '' },
  109. { title: '待支付', value: 'to_pay' },
  110. { title: '已完成', value: 'complete' }
  111. ]
  112. export default {
  113. mixins: [pageMixin],
  114. components: { empty, tabbar2 },
  115. data() {
  116. return {
  117. resource,
  118. LEVEL_MAP,
  119. tabs: Tabs,
  120. tab: Tabs[0],
  121. refreshing: false
  122. }
  123. },
  124. computed: {
  125. top() {
  126. let height = this.$store.state.systemInfo.statusBarHeight + 36 + 50
  127. return height
  128. }
  129. },
  130. mounted() {
  131. this.refresh(true)
  132. },
  133. methods: {
  134. pullRefresh() {
  135. this.refreshing = true
  136. this.refresh()
  137. },
  138. async loadData(loading) {
  139. const res = await this.$service.sell.sellList(
  140. this.pageNum,
  141. this.pageSize,
  142. this.tab.value,
  143. loading
  144. )
  145. setTimeout(() => {
  146. this.refreshing = false
  147. }, 1000)
  148. return res
  149. },
  150. clickTab(item) {
  151. this.tab = item
  152. this.refresh(true)
  153. }
  154. }
  155. }
  156. </script>
  157. <style lang="scss" scoped>
  158. .wrapper {
  159. position: fixed;
  160. left: 0;
  161. right: 0;
  162. bottom: 0;
  163. }
  164. .cell {
  165. background: rgba(0, 0, 0, 0.5);
  166. box-shadow: 0px 0px 5px 0px rgba(167, 110, 244, 0.5);
  167. border-radius: 8px;
  168. border: 1px solid rgba(255, 255, 255, 0.2);
  169. overflow: hidden;
  170. .line {
  171. height: 1px;
  172. opacity: 0.2;
  173. background: #e9d9ff;
  174. }
  175. .image {
  176. box-shadow: 0px 0px 5px 0px rgba(167, 110, 244, 0.5);
  177. border-radius: 8px;
  178. width: 180rpx;
  179. height: 180rpx;
  180. }
  181. .status {
  182. width: 100rpx;
  183. height: 40rpx;
  184. position: absolute;
  185. right: 0;
  186. top: 0;
  187. z-index: 100;
  188. }
  189. .order-no {
  190. .copy {
  191. padding: 0 6rpx;
  192. line-height: 32rpx;
  193. border-radius: 8rpx;
  194. text-align: center;
  195. font-size: 24rpx;
  196. border: 1px solid #4d6fff;
  197. color: #4d6fff;
  198. }
  199. }
  200. }
  201. </style>