buy_record.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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">¥{{ item.paymentAmount }}</text>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="line"></view>
  50. <view class="font2 color-white paddingY9">
  51. <view class="order-no font2 flex-align-between">
  52. <view>订单号:{{ item.tradeNo }}</view>
  53. <view class="flex-align-end">
  54. <button
  55. class="btn-clear copy marginL5 flex-shrink0"
  56. @click.stop="$common.copy(item.tradeNo)"
  57. >
  58. 复制
  59. </button>
  60. </view>
  61. </view>
  62. <view class="font2 flex-align-between paddingT8">
  63. 下单时间: {{ item.createTime }}
  64. </view>
  65. <view v-if="item.paymentTime" class="font2 flex-align-between paddingT8">
  66. 付款时间: {{ item.paymentTime }}
  67. </view>
  68. </view>
  69. <image
  70. v-if="item.status === 99"
  71. :src="resource.sell_status_ok"
  72. class="status"
  73. />
  74. <image
  75. v-else-if="item.status === 0"
  76. :src="resource.sell_status_to_pay"
  77. class="status"
  78. />
  79. <image
  80. v-else-if="item.status === 10"
  81. :src="resource.sell_status_cancel"
  82. class="status"
  83. />
  84. <image
  85. v-else-if="item.status === 11"
  86. :src="resource.sell_status_timeout"
  87. class="status"
  88. style="width: 124rpx"
  89. />
  90. </view>
  91. </view>
  92. <empty v-if="isEmpty" :top="200" light />
  93. </scroll-view>
  94. </view>
  95. </template>
  96. <script>
  97. import { LEVEL_MAP } from '@/utils/config'
  98. import tabbar2 from '@/components/tabbar2'
  99. import empty from '@/components/empty'
  100. import pageMixin from './../../mixin/page'
  101. import resource from '@/utils/resource'
  102. const Tabs = [
  103. { title: '全部', value: '' },
  104. { title: '待支付', value: 'to_pay' },
  105. { title: '已完成', value: 'complete' }
  106. ]
  107. export default {
  108. mixins: [pageMixin],
  109. components: { empty, tabbar2 },
  110. data() {
  111. return {
  112. resource,
  113. LEVEL_MAP,
  114. tabs: Tabs,
  115. tab: Tabs[0],
  116. refreshing: false
  117. }
  118. },
  119. computed: {
  120. top() {
  121. let height = this.$store.state.systemInfo.statusBarHeight + 36 + 50
  122. return height
  123. }
  124. },
  125. mounted() {
  126. this.refresh(true)
  127. },
  128. methods: {
  129. pullRefresh() {
  130. this.refreshing = true
  131. this.refresh()
  132. },
  133. async loadData(loading) {
  134. const res = await this.$service.sell.buyList(
  135. this.pageNum,
  136. this.pageSize,
  137. this.tab.value,
  138. loading
  139. )
  140. setTimeout(() => {
  141. this.refreshing = false
  142. }, 1000)
  143. return res
  144. },
  145. clickTab(item) {
  146. this.tab = item
  147. this.refresh(true)
  148. }
  149. }
  150. }
  151. </script>
  152. <style lang="scss" scoped>
  153. .wrapper {
  154. position: fixed;
  155. left: 0;
  156. right: 0;
  157. bottom: 0;
  158. }
  159. .cell {
  160. background: rgba(0, 0, 0, 0.5);
  161. box-shadow: 0px 0px 5px 0px rgba(167, 110, 244, 0.5);
  162. border-radius: 8px;
  163. border: 1px solid rgba(255, 255, 255, 0.2);
  164. overflow: hidden;
  165. .line {
  166. height: 1px;
  167. opacity: 0.2;
  168. background: #e9d9ff;
  169. }
  170. .image {
  171. box-shadow: 0px 0px 5px 0px rgba(167, 110, 244, 0.5);
  172. border-radius: 8px;
  173. width: 180rpx;
  174. height: 180rpx;
  175. }
  176. .status {
  177. width: 100rpx;
  178. height: 40rpx;
  179. position: absolute;
  180. right: 0;
  181. top: 0;
  182. z-index: 100;
  183. }
  184. .order-no {
  185. .copy {
  186. padding: 0 6rpx;
  187. line-height: 32rpx;
  188. border-radius: 8rpx;
  189. text-align: center;
  190. font-size: 24rpx;
  191. border: 1px solid #4d6fff;
  192. color: #4d6fff;
  193. }
  194. }
  195. }
  196. </style>