index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  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="formatImg(item.goodsModelList[0])" 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. imgUrl:{
  68. Kfc:'https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/xgJrwD0vChsW012ac1e138a0aa5a970e8f8c59dab926.png/1.png',
  69. MDL:'https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/K64jffEqRIDr487e8cab971c3b890d4066a26f5856d2.png/1.png',
  70. XBK:'https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/xMwtPkICBcam5513c4ac644054e60009cb8b1eb52e8f.png/1.png',
  71. NXDC:'https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/U9j6fgVmKeAt522ed50aa1a72f798260e0e30138d4c6.png/1.png',
  72. RXKF:'https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/zS5Q8sC9AAQca76eef36da2bd5a2ec234d75d8dcc044.png/1.png',
  73. XC:'https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/fA95my16Qunf967a9d992fc41134332926bcb5665881.png/1.png',
  74. KD:'https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/wk5eyuvhighG206a7ea081e3f0b783ff2a9555375e85.png/1.png',
  75. }
  76. }
  77. },
  78. filters: {
  79. filterType: function(val) {
  80. if(val.refundLog&&val.refundLog.refund == 'REFUSAL_REFUND'){
  81. return '拒绝退款'
  82. }
  83. else if(val.jobFlowMap == 'Hotel'&&val.extend.orderInfo){
  84. return val.extend.orderInfo.orderStatus
  85. }
  86. else if(val.goodsState == 'APPLY_REFUND'){
  87. return '退款审核中'
  88. }else if(val.goodsState == 'CLOSE'){
  89. return '关闭订单'
  90. }else if(val.goodsState == 'REFUNDED'){
  91. return '已退款'
  92. }else if(val.goodsState == 'REFUSAL_REFUND'){
  93. return '拒绝退款'
  94. }else if(val.goodsState == 'APPLY_REFUNDING'){
  95. return '退款中'
  96. }else if(val.goodsState == 'USED'){
  97. if(val.jobFlowMap == 'YPP'){
  98. return '已出票'
  99. }else{
  100. return '订单已完成'
  101. }
  102. }else if(val.goodsState == 'WAIT_PAYMENT'){
  103. return '待付款'
  104. }else if(val.goodsState == 'WAIT_USE'){
  105. if(val.jobFlowMap == 'YPP'){
  106. return '出票中'
  107. }else{
  108. return '待使用'
  109. }
  110. }else{
  111. return ''
  112. }
  113. }
  114. },
  115. methods: {
  116. formatImg(item){
  117. if(item.jobFlowMap == 'Kfc'){
  118. return this.imgUrl[item.goodsInfo.ot]
  119. }else if(item.jobFlowMap == 'Activity'){
  120. return item.goodsInfo.activityCover
  121. }else{
  122. return item.goodsInfo.goodsPath
  123. }
  124. },
  125. handleTab(val){
  126. this.query.orderType = val
  127. this.query.page = 0
  128. this.list = []
  129. this.getOrderList()
  130. },
  131. loadMore() {
  132. this.getOrderList()
  133. },
  134. jump(item) {
  135. // uni.setStorageSync('order',JSON.stringify(item))
  136. // 研学类型商品统一走研学订单详情
  137. if(item.goodsModelList[0].goodsInfo.isStudy){
  138. uni.navigateTo({
  139. url: '/study/pay/orderPay?id='+item.orderNo
  140. })
  141. return
  142. }
  143. if(item.goodsModelList[0].jobFlowMap == 'Ticket'){
  144. uni.navigateTo({
  145. url: '/my/order/scenic/detail?id='+item.orderNo
  146. })
  147. }
  148. else if(item.goodsModelList[0].jobFlowMap == 'Hotel'){
  149. uni.navigateTo({
  150. url: '/my/order/hotel/detail?id='+item.orderNo
  151. })
  152. }
  153. else if(item.goodsModelList[0].jobFlowMap == 'YPP'){
  154. uni.navigateTo({
  155. url: '/my/order/movie/detail?id='+item.orderNo
  156. })
  157. }
  158. else if(item.goodsModelList[0].jobFlowMap == 'Kfc'){
  159. uni.navigateTo({
  160. url: '/my/order/foodOrder/detail?id='+item.orderNo
  161. })
  162. }
  163. else if(item.goodsModelList[0].goodsInfo.activityName){
  164. uni.navigateTo({
  165. url: '/my/order/signUp/signUpDetail?id='+item.orderNo
  166. })
  167. }else if(item.goodsModelList[0].jobFlowMap == 'QiuXiang'){
  168. uni.navigateTo({
  169. url: '/my/order/trip/detail?id='+item.orderNo
  170. })
  171. }else{
  172. uni.navigateTo({
  173. url: './detail?id='+item.orderNo
  174. })
  175. }
  176. },
  177. getOrderList(){
  178. this.requestTask&&this.requestTask.abort()
  179. this.status = 'loading'
  180. getOrderList(this.query).then(res=>{
  181. this.requestTask =res.task
  182. if(res.state == 'Success'){
  183. this.total = res.content.totalElements
  184. this.list = this.list.concat(res.content.content)
  185. this.list.length>=this.total?this.status = 'noMore':this.status = 'more'
  186. this.query.page++
  187. uni.stopPullDownRefresh()
  188. }
  189. })
  190. }
  191. },
  192. onPullDownRefresh() {
  193. this.query.page = 0
  194. this.list = []
  195. this.status = 'more'
  196. this.getOrderList()
  197. },
  198. onLoad(option) {
  199. this.query.orderType = option.type || null
  200. }
  201. }
  202. </script>
  203. <style lang="scss">
  204. .order {
  205. background: #efefef;
  206. padding: 90rpx 30rpx 0;
  207. min-height: 100vh;
  208. .tab-box{
  209. display: flex;
  210. position: fixed;
  211. width: 750rpx;
  212. height: 70rpx;
  213. left: 0%;
  214. top: 0%;
  215. z-index: 9;
  216. background: #fff;
  217. .tab{
  218. flex: 1;
  219. text-align: center;
  220. padding: 15rpx 0;
  221. font-size: 28rpx;
  222. color: #999999;
  223. }
  224. .tab.active{
  225. font-size: 32rpx;
  226. color: #222222;
  227. position: relative;
  228. &::after{
  229. content: '';
  230. width: 40rpx;
  231. height: 8rpx;
  232. box-shadow: inset 0rpx 6rpx 12rpx 2rpx rgba(255,255,255,0.16);
  233. border-radius: 46rpx 46rpx 46rpx 46rpx;
  234. background: $uni-color-primary;
  235. position: absolute;
  236. bottom: 0%;
  237. left: 50%;
  238. transform: translateX(-50%);
  239. }
  240. }
  241. }
  242. .zs-list {
  243. .order-item {
  244. background-color: #fff;
  245. border-radius: 8px;
  246. margin-bottom: 20rpx;
  247. .top-box{
  248. display: flex;
  249. justify-content: space-between;
  250. align-items: center;
  251. padding: 20rpx;
  252. border-bottom:2rpx solid #F3F3F3;
  253. .label{
  254. font-weight: bold;
  255. color: #222222;
  256. font-size: 32rpx;
  257. width: 500rpx;
  258. white-space: nowrap;
  259. overflow: hidden;
  260. text-overflow: ellipsis;
  261. }
  262. .status{
  263. font-size: 28rpx;
  264. color: #999999;
  265. }
  266. }
  267. .order-box {
  268. padding: 25rpx;
  269. display: flex;
  270. .icon {
  271. width: 164rpx;
  272. height: 164rpx;
  273. border-radius: 16rpx;
  274. background-color: #999;
  275. }
  276. .info {
  277. margin-left: 25rpx;
  278. display: flex;
  279. flex-direction: column;
  280. justify-content: space-between;
  281. .title {
  282. color: #0F0F0F;
  283. font-size: 28rpx;
  284. }
  285. .time {
  286. font-size: 26rpx;
  287. color: #999999;
  288. }
  289. .price{
  290. font-weight: bold;
  291. color: #181818;
  292. }
  293. }
  294. }
  295. }
  296. }
  297. }
  298. </style>