index.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  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. // 研学类型商品统一走研学订单详情
  111. if(item.goodsModelList[0].goodsInfo.isStudy){
  112. uni.navigateTo({
  113. url: '/study/pay/orderPay?id='+item.orderNo
  114. })
  115. return
  116. }
  117. if(item.goodsModelList[0].jobFlowMap == 'Ticket'){
  118. uni.navigateTo({
  119. url: '/my/order/scenic/detail?id='+item.orderNo
  120. })
  121. }
  122. else if(item.goodsModelList[0].jobFlowMap == 'Hotel'){
  123. uni.navigateTo({
  124. url: '/my/order/hotel/detail?id='+item.orderNo
  125. })
  126. }
  127. else if(item.goodsModelList[0].jobFlowMap == 'YPP'){
  128. uni.navigateTo({
  129. url: '/my/order/movie/detail?id='+item.orderNo
  130. })
  131. }
  132. else if(item.goodsModelList[0].goodsInfo.activityName){
  133. uni.navigateTo({
  134. url: '/my/order/signUp/signUpDetail?id='+item.orderNo
  135. })
  136. }else if(item.goodsModelList[0].jobFlowMap == 'QiuXiang'){
  137. uni.navigateTo({
  138. url: '/my/order/trip/detail?id='+item.orderNo
  139. })
  140. }else{
  141. uni.navigateTo({
  142. url: './detail?id='+item.orderNo
  143. })
  144. }
  145. },
  146. getOrderList(){
  147. this.requestTask&&this.requestTask.abort()
  148. this.status = 'loading'
  149. getOrderList(this.query).then(res=>{
  150. this.requestTask =res.task
  151. if(res.state == 'Success'){
  152. this.total = res.content.totalElements
  153. this.list = this.list.concat(res.content.content)
  154. this.list.length>=this.total?this.status = 'noMore':this.status = 'more'
  155. this.query.page++
  156. uni.stopPullDownRefresh()
  157. }
  158. })
  159. }
  160. },
  161. onPullDownRefresh() {
  162. this.query.page = 0
  163. this.list = []
  164. this.status = 'more'
  165. this.getOrderList()
  166. },
  167. onLoad(option) {
  168. this.query.orderType = option.type || null
  169. }
  170. }
  171. </script>
  172. <style lang="scss">
  173. .order {
  174. background: #efefef;
  175. padding: 90rpx 30rpx 0;
  176. min-height: 100vh;
  177. .tab-box{
  178. display: flex;
  179. position: fixed;
  180. width: 750rpx;
  181. height: 70rpx;
  182. left: 0%;
  183. top: 0%;
  184. z-index: 9;
  185. background: #fff;
  186. .tab{
  187. flex: 1;
  188. text-align: center;
  189. padding: 15rpx 0;
  190. font-size: 28rpx;
  191. color: #999999;
  192. }
  193. .tab.active{
  194. font-size: 32rpx;
  195. color: #222222;
  196. position: relative;
  197. &::after{
  198. content: '';
  199. width: 40rpx;
  200. height: 8rpx;
  201. box-shadow: inset 0rpx 6rpx 12rpx 2rpx rgba(255,255,255,0.16);
  202. border-radius: 46rpx 46rpx 46rpx 46rpx;
  203. background: $uni-color-primary;
  204. position: absolute;
  205. bottom: 0%;
  206. left: 50%;
  207. transform: translateX(-50%);
  208. }
  209. }
  210. }
  211. .zs-list {
  212. .order-item {
  213. background-color: #fff;
  214. border-radius: 8px;
  215. margin-bottom: 20rpx;
  216. .top-box{
  217. display: flex;
  218. justify-content: space-between;
  219. align-items: center;
  220. padding: 20rpx;
  221. border-bottom:2rpx solid #F3F3F3;
  222. .label{
  223. font-weight: bold;
  224. color: #222222;
  225. font-size: 32rpx;
  226. width: 500rpx;
  227. white-space: nowrap;
  228. overflow: hidden;
  229. text-overflow: ellipsis;
  230. }
  231. .status{
  232. font-size: 28rpx;
  233. color: #999999;
  234. }
  235. }
  236. .order-box {
  237. padding: 25rpx;
  238. display: flex;
  239. .icon {
  240. width: 164rpx;
  241. height: 164rpx;
  242. border-radius: 16rpx;
  243. background-color: #999;
  244. }
  245. .info {
  246. margin-left: 25rpx;
  247. display: flex;
  248. flex-direction: column;
  249. justify-content: space-between;
  250. .title {
  251. color: #0F0F0F;
  252. font-size: 28rpx;
  253. }
  254. .time {
  255. font-size: 26rpx;
  256. color: #999999;
  257. }
  258. .price{
  259. font-weight: bold;
  260. color: #181818;
  261. }
  262. }
  263. }
  264. }
  265. }
  266. }
  267. </style>