index.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <template>
  2. <view class="order">
  3. <view class="tab-box">
  4. <view class="tab" :class="[query.orderType == null?'active':'']" @click="handleTab(null)">
  5. 全部
  6. </view>
  7. <!-- <view class="tab" :class="[query.orderType == 'USED'?'active':'']" @click="handleTab('USED')">
  8. 已使用
  9. </view> -->
  10. <view class="tab" :class="[query.orderType == 'WAIT_PAYMENT'?'active':'']" @click="handleTab('WAIT_PAYMENT')">
  11. 待付款
  12. </view>
  13. <view class="tab" :class="[query.orderType == 'WAIT_USE'?'active':'']" @click="handleTab('WAIT_USE')">
  14. 待使用
  15. </view>
  16. <view class="tab" :class="[query.orderType == 'APPLY_REFUND'?'active':'']" @click="handleTab('APPLY_REFUND')">
  17. 退款
  18. </view>
  19. </view>
  20. <u-empty v-if="!list.length && status == 'noMore'" mode="order" iconSize="200rpx" textSize="28rpx">
  21. </u-empty>
  22. <zs-list mt="0" @load="loadMore" :status="status">
  23. <view class="order-item" v-for="(item,index) in list" :key="index" @click="jump(item)">
  24. <view class="top-box">
  25. <view class="label">
  26. {{item.shopInfo.shopName}}
  27. </view>
  28. <view class="status">
  29. {{ item.goodsModelList[0] |filterType}}
  30. </view>
  31. </view>
  32. <view class="order-box">
  33. <zs-img radius="full" :src="item.goodsModelList[0].goodsInfo.activityCover || item.goodsModelList[0].goodsInfo.goodsPath" width="164rpx" height="164rpx"></zs-img>
  34. <view class="info">
  35. <view class="title">
  36. {{item.goodsModelList[0].goodsInfo.activityName||item.goodsModelList[0].goodsInfo.goodsName}}
  37. </view>
  38. <view class="time">
  39. {{$u.timeFormat(item.createTime,'yyyy-mm-dd hh:MM:ss')}}
  40. </view>
  41. <view class="price">
  42. ¥{{item.payAmount}}
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </zs-list>
  48. </view>
  49. </template>
  50. <script>
  51. import {getOrderList} from '@/api/order.js'
  52. export default {
  53. data() {
  54. return {
  55. status: 'more',
  56. loading: false,
  57. query:{
  58. orderType:null,
  59. channel:'ZhongShu',
  60. page:0,
  61. size:10,
  62. userId:JSON.parse(uni.getStorageSync('userInfo')).userId
  63. },
  64. total:0,
  65. list: [],
  66. requestTask:null
  67. }
  68. },
  69. filters: {
  70. filterType: function(val) {
  71. if(val.refundLog&&val.refundLog.refund == 'REFUSAL_REFUND'){
  72. return '拒绝退款'
  73. }
  74. else if(val.jobFlowMap == 'Hotel'&&JSON.parse(val.extend).orderInfo){
  75. return JSON.parse(val.extend).orderInfo.orderStatus
  76. }
  77. else if(val.goodsState == 'APPLY_REFUND'){
  78. return '退款审核中'
  79. }else if(val.goodsState == 'CLOSE'){
  80. return '关闭订单'
  81. }else if(val.goodsState == 'REFUNDED'){
  82. return '已退款'
  83. }else if(val.goodsState == 'REFUSAL_REFUND'){
  84. return '拒绝退款'
  85. }else if(val.goodsState == 'APPLY_REFUNDING'){
  86. return '退款中'
  87. }else if(val.goodsState == 'USED'){
  88. return '订单已完成'
  89. }else if(val.goodsState == 'WAIT_PAYMENT'){
  90. return '待付款'
  91. }else if(val.goodsState == 'WAIT_USE'){
  92. return '待使用'
  93. }else{
  94. return ''
  95. }
  96. }
  97. },
  98. methods: {
  99. handleTab(val){
  100. this.query.orderType = val
  101. this.query.page = 0
  102. this.list = []
  103. this.getOrderList()
  104. },
  105. loadMore() {
  106. this.getOrderList()
  107. },
  108. jump(item) {
  109. // uni.setStorageSync('order',JSON.stringify(item))
  110. if(item.goodsModelList[0].jobFlowMap == 'Ticket'){
  111. uni.navigateTo({
  112. url: '/my/order/scenic/detail?id='+item.orderNo
  113. })
  114. }
  115. else if(item.goodsModelList[0].jobFlowMap == 'Hotel'){
  116. uni.navigateTo({
  117. url: '/my/order/hotel/detail?id='+item.orderNo
  118. })
  119. }
  120. else if(item.goodsModelList[0].jobFlowMap == 'YPP'){
  121. uni.navigateTo({
  122. url: '/my/order/movie/detail?id='+item.orderNo
  123. })
  124. }
  125. else if(item.goodsModelList[0].goodsInfo.activityName){
  126. uni.navigateTo({
  127. url: '/my/order/signUp/signUpDetail?id='+item.orderNo
  128. })
  129. }else{
  130. uni.navigateTo({
  131. url: './detail?id='+item.orderNo
  132. })
  133. }
  134. },
  135. getOrderList(){
  136. this.requestTask&&this.requestTask.abort()
  137. this.status = 'loading'
  138. getOrderList(this.query).then(res=>{
  139. this.requestTask =res.task
  140. if(res.state == 'Success'){
  141. this.total = res.content.totalElements
  142. this.list = this.list.concat(res.content.content)
  143. this.list.length>=this.total?this.status = 'noMore':this.status = 'more'
  144. this.query.page++
  145. uni.stopPullDownRefresh()
  146. }
  147. })
  148. }
  149. },
  150. onPullDownRefresh() {
  151. this.query.page = 0
  152. this.list = []
  153. this.status = 'more'
  154. this.getOrderList()
  155. },
  156. onLoad(option) {
  157. this.query.orderType = option.type || null
  158. }
  159. }
  160. </script>
  161. <style lang="scss">
  162. .order {
  163. background: #efefef;
  164. padding: 90rpx 30rpx 0;
  165. min-height: 100vh;
  166. .tab-box{
  167. display: flex;
  168. position: fixed;
  169. width: 750rpx;
  170. height: 70rpx;
  171. left: 0%;
  172. top: 0%;
  173. z-index: 9;
  174. background: #fff;
  175. .tab{
  176. flex: 1;
  177. text-align: center;
  178. padding: 15rpx 0;
  179. font-size: 28rpx;
  180. color: #999999;
  181. }
  182. .tab.active{
  183. font-size: 32rpx;
  184. color: #222222;
  185. position: relative;
  186. &::after{
  187. content: '';
  188. width: 40rpx;
  189. height: 8rpx;
  190. box-shadow: inset 0rpx 6rpx 12rpx 2rpx rgba(255,255,255,0.16);
  191. border-radius: 46rpx 46rpx 46rpx 46rpx;
  192. background: $uni-color-primary;
  193. position: absolute;
  194. bottom: 0%;
  195. left: 50%;
  196. transform: translateX(-50%);
  197. }
  198. }
  199. }
  200. .zs-list {
  201. .order-item {
  202. background-color: #fff;
  203. border-radius: 8px;
  204. margin-bottom: 20rpx;
  205. .top-box{
  206. display: flex;
  207. justify-content: space-between;
  208. align-items: center;
  209. padding: 20rpx;
  210. border-bottom:2rpx solid #F3F3F3;
  211. .label{
  212. font-weight: bold;
  213. color: #222222;
  214. font-size: 32rpx;
  215. width: 500rpx;
  216. white-space: nowrap;
  217. overflow: hidden;
  218. text-overflow: ellipsis;
  219. }
  220. .status{
  221. font-size: 28rpx;
  222. color: #999999;
  223. }
  224. }
  225. .order-box {
  226. padding: 25rpx;
  227. display: flex;
  228. .icon {
  229. width: 164rpx;
  230. height: 164rpx;
  231. border-radius: 16rpx;
  232. background-color: #999;
  233. }
  234. .info {
  235. margin-left: 25rpx;
  236. display: flex;
  237. flex-direction: column;
  238. justify-content: space-between;
  239. .title {
  240. color: #0F0F0F;
  241. font-size: 28rpx;
  242. }
  243. .time {
  244. font-size: 26rpx;
  245. color: #999999;
  246. }
  247. .price{
  248. font-weight: bold;
  249. color: #181818;
  250. }
  251. }
  252. }
  253. }
  254. }
  255. }
  256. </style>