index.vue 8.5 KB

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