index.vue 6.6 KB

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