index.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <script setup lang="ts">
  2. import Tabbar from '../components/tabbar.vue'
  3. import { createGlobalLoadingMiddleware } from '@/api/core/middleware'
  4. import filmOrderList from '@/subPack-smqjh/components/film-orderList/film-orderList.vue?async'
  5. definePage({
  6. name: 'film-order',
  7. islogin: true,
  8. style: {
  9. navigationBarTitleText: '我的订单',
  10. backgroundColorBottom: '#fff',
  11. },
  12. })
  13. const orderStatus = ref('all')
  14. const tabList = reactive([
  15. { title: '全部', value: 'all' },
  16. { title: '待支付', value: 'paddingPay' },
  17. { title: '已支付', value: 'ing' },
  18. { title: '已完成', value: 'completed' },
  19. { title: '已退款', value: 'cancel' },
  20. ])
  21. const { data: orderList, refresh, isLastPage, page, error, reload } = usePagination((pageNum, pageSize) => Apis.xsb.orderList({
  22. data: {
  23. businessType: 'DYY',
  24. orderStatus: orderStatus.value,
  25. pageNum,
  26. pageSize,
  27. },
  28. }), {
  29. immediate: false,
  30. pageNum: 1,
  31. pageSize: 10,
  32. initialData: [],
  33. data: res => res.data?.list,
  34. append: true,
  35. middleware: createGlobalLoadingMiddleware(),
  36. })
  37. const state = computed(() => {
  38. return error.value ? 'error' : !isLastPage.value ? 'loading' : 'finished'
  39. })
  40. function handleItem(value: string) {
  41. orderStatus.value = value
  42. reload()
  43. }
  44. onReachBottom(() => {
  45. if (!isLastPage.value) {
  46. page.value++
  47. }
  48. })
  49. onLoad(() => {
  50. refresh()
  51. })
  52. </script>
  53. <template>
  54. <view class="film-order">
  55. <!-- 顶部切换 -->
  56. <view class="tabbar">
  57. <view v-for="(item, index) in tabList" :key="index" class="item" @click="handleItem(item.value)">
  58. <view class="title" :class="[orderStatus == item.value ? 'active' : '']">
  59. {{ item.title }}
  60. </view>
  61. </view>
  62. </view>
  63. <!-- 列表 -->
  64. <template v-for="(item, index) in orderList" :key="index">
  65. <filmOrderList :order="item" @refresh="refresh" />
  66. </template>
  67. <wd-loadmore :state="state" :loading-props="{ color: '#9ED605', size: 20 }" @reload="reload" />
  68. </view>
  69. <Tabbar :active="2" />
  70. </template>
  71. <style lang="scss" scoped>
  72. .film-order{
  73. background: #F9F9F9;
  74. padding: 80rpx 24rpx 300rpx;
  75. .tabbar {
  76. display: flex;
  77. justify-content: space-between;
  78. padding-top: 10rpx;
  79. background: #fff;
  80. position: fixed;
  81. top: 0;
  82. left: 0;
  83. width: 100%;
  84. height: 60rpx;
  85. box-sizing: border-box;
  86. .item {
  87. flex: 1;
  88. text-align: center;
  89. .title {
  90. font-size: 32rpx;
  91. color: #222222;
  92. &.active {
  93. color: #9ED605;
  94. }
  95. }
  96. }
  97. }
  98. .block {
  99. background: #FFFFFF;
  100. border-radius: 16rpx 16rpx 16rpx 16rpx;
  101. padding: 24rpx;
  102. margin-bottom: 20rpx;
  103. }
  104. .order-list{
  105. .order-item{
  106. .top-box{
  107. display: flex;
  108. justify-content: space-between;
  109. align-items: center;
  110. .title{
  111. font-size: 32rpx;
  112. color: #222222;
  113. font-weight: bold;
  114. }
  115. .status{
  116. font-size: 28rpx;
  117. color: #222222;
  118. }
  119. }
  120. .status-box{
  121. margin-top: 24rpx;
  122. background: #F9F9F9;
  123. border-radius: 16rpx 16rpx 16rpx 16rpx;
  124. padding: 24rpx;
  125. .reason-box{
  126. display: flex;
  127. align-items: center;
  128. .icon{
  129. width: 30rpx;
  130. height: 30rpx;
  131. }
  132. .reason{
  133. font-size: 28rpx;
  134. color: #999999;
  135. margin-left: 10rpx;
  136. }
  137. }
  138. .info{
  139. font-size: 24rpx;
  140. color: #AAAAAA;
  141. margin-top: 20rpx;
  142. line-height: 44rpx;
  143. }
  144. }
  145. .info-box{
  146. margin-top: 20rpx;
  147. display: flex;
  148. .img{
  149. width: 160rpx;
  150. height: 160rpx;
  151. border-radius: 16rpx 16rpx 16rpx 16rpx;
  152. background: #999999;
  153. margin-right: 20rpx;
  154. }
  155. .info{
  156. display: flex;
  157. flex-direction: column;
  158. justify-content: space-between;
  159. .info-item{
  160. font-size: 24rpx;
  161. color: #222222;
  162. }
  163. }
  164. }
  165. .btn-box{
  166. display: flex;
  167. align-items: center;
  168. justify-content: flex-end;
  169. margin-top: 20rpx;
  170. .btn{
  171. width: 128rpx;
  172. height: 48rpx;
  173. line-height: 48rpx;
  174. text-align: center;
  175. background: #FFFFFF;
  176. border-radius: 24rpx 24rpx 24rpx 24rpx;
  177. border: 1rpx solid #222222;
  178. font-size: 24rpx;
  179. color: #222222;
  180. }
  181. .btn.cancel{
  182. color: #AAAAAA;
  183. border: 1rpx solid #AAAAAA;
  184. margin-right: 20rpx;
  185. }
  186. }
  187. }
  188. }
  189. }
  190. </style>