history.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <template>
  2. <view class="order">
  3. <view class="tab-box">
  4. <view class="tab" :class="[query.orderType == null ? 'active' : '']"
  5. v-if="appAuth.includes(0) || appAuth.includes(2)" @click="handleTab(null)">
  6. 已邀请
  7. </view>
  8. <view class="tab" :class="[query.orderType == 'USED' ? 'active' : '']"
  9. v-if="appAuth.includes(0) || appAuth.includes(3)" @click="handleTab('USED')">
  10. 成功邀请
  11. </view>
  12. <view class="tab" v-if="appAuth.includes(0) || appAuth.includes(4)"
  13. :class="[query.orderType == 'APPLY_REFUND' ? 'active' : '']" @click="handleTab('APPLY_REFUND')">
  14. 已失效
  15. </view>
  16. </view>
  17. <zs-list class="store-box" mt="0" @load="loadMore" :status="status">
  18. <view style="border-radius: 16rpx;overflow: hidden;">
  19. <view class="item" v-for="(item, index) in list" :key="index" @click="goDetail(item)">
  20. <view class="user-card">
  21. <view class="avatar">
  22. <u-avatar :src="item.headImgUrl" size="80rpx"></u-avatar>
  23. </view>
  24. <view class="info">
  25. <view class="phone">1233232378</view>
  26. <view class="time">{{ item.createTime }}</view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </zs-list>
  32. <u-empty v-if="list.length == 0">
  33. </u-empty>
  34. </view>
  35. </template>
  36. <script>
  37. import { details } from "@/api/invite"
  38. export default {
  39. data() {
  40. return {
  41. query: {
  42. page: 0,
  43. size: 10,
  44. orderType: null,
  45. "endTime": "",
  46. "noOrGName": "",
  47. "sort": "",
  48. "startTime": ""
  49. },
  50. status: 'more',
  51. list: [],
  52. appAuth: []
  53. }
  54. },
  55. filters: {
  56. filterType: function (val) {
  57. if (val.refundLog && val.refundLog.refund == 'REFUSAL_REFUND') {
  58. return '拒绝退款'
  59. }
  60. else if (val.jobFlowMap == 'Hotel' && JSON.parse(val.extend).orderInfo) {
  61. return JSON.parse(val.extend).orderInfo.orderStatus
  62. }
  63. else if (val.goodsState == 'APPLY_REFUND') {
  64. return '申请退款'
  65. } else if (val.goodsState == 'CLOSE') {
  66. return '关闭订单'
  67. } else if (val.goodsState == 'REFUNDED') {
  68. return '已退款'
  69. } else if (val.goodsState == 'REFUSAL_REFUND') {
  70. return '拒绝退款'
  71. } else if (val.goodsState == 'APPLY_REFUNDING') {
  72. return '退款中'
  73. } else if (val.goodsState == 'USED') {
  74. return '已核销'
  75. } else if (val.goodsState == 'WAIT_PAYMENT') {
  76. return '待付款'
  77. } else if (val.goodsState == 'WAIT_USE') {
  78. return '待使用'
  79. } else {
  80. return ''
  81. }
  82. }
  83. },
  84. methods: {
  85. handleTab(val) {
  86. this.query.orderType = val
  87. this.query.page = 0
  88. this.list = []
  89. this.details()
  90. },
  91. goDetail(item) {
  92. uni.setStorageSync('order', JSON.stringify(item))
  93. uni.navigateTo({
  94. url: './detail?id=' + item.orderNo
  95. })
  96. },
  97. details() {
  98. this.status = 'loading'
  99. details(this.query).then(res => {
  100. if (res.state == 'Success') {
  101. this.total = res.content.totalElements
  102. this.list = this.list.concat(res.content.content)
  103. this.list.length >= this.total ? this.status = 'noMore' : this.status = 'more'
  104. this.query.page++
  105. uni.stopPullDownRefresh()
  106. }
  107. })
  108. },
  109. onPullDownRefresh() {
  110. this.query.page = 0
  111. this.list = []
  112. this.status = 'more'
  113. this.details()
  114. },
  115. loadMore() {
  116. this.details()
  117. },
  118. },
  119. onLoad() {
  120. let epid = uni.getStorageSync('epid')
  121. let shopList = JSON.parse(uni.getStorageSync('shopList'))
  122. shopList.map(item => {
  123. if (item.shopId == epid) {
  124. this.appAuth = item.appAuth.split(',').map(Number)
  125. }
  126. })
  127. if (this.appAuth.includes(2)) {
  128. this.query.orderType = null
  129. } else if (this.appAuth.includes(3)) {
  130. this.query.orderType = 'USED'
  131. } else if (this.appAuth.includes(4)) {
  132. this.query.orderType = 'APPLY_REFUND'
  133. }
  134. }
  135. }
  136. </script>
  137. <style lang="scss" scoped>
  138. .order {
  139. padding: 90rpx 32rpx 24rpx;
  140. background: #F9F9F9;
  141. min-height: 100vh;
  142. .tab-box {
  143. display: flex;
  144. position: fixed;
  145. width: 750rpx;
  146. height: 70rpx;
  147. left: 0%;
  148. top: 0%;
  149. z-index: 9;
  150. background: #fff;
  151. .tab {
  152. flex: 1;
  153. text-align: center;
  154. padding: 15rpx 0;
  155. font-size: 28rpx;
  156. color: #999999;
  157. }
  158. .tab.active {
  159. font-size: 32rpx;
  160. color: #222222;
  161. position: relative;
  162. &::after {
  163. content: '';
  164. width: 40rpx;
  165. height: 8rpx;
  166. box-shadow: inset 0rpx 6rpx 12rpx 2rpx rgba(255, 255, 255, 0.16);
  167. border-radius: 46rpx 46rpx 46rpx 46rpx;
  168. background: $uni-color-primary;
  169. position: absolute;
  170. bottom: 0%;
  171. left: 50%;
  172. transform: translateX(-50%);
  173. }
  174. }
  175. }
  176. .item {
  177. background: #FFFFFF;
  178. position: relative;
  179. padding: 24rpx;
  180. border-top: 1px solid #F0F0F0;
  181. &:first-child {
  182. border-top: none;
  183. }
  184. .user-card {
  185. display: flex;
  186. align-items: center;
  187. .avatar {
  188. margin-right: 20rpx;
  189. }
  190. .info {
  191. .phone {
  192. color: #181818;
  193. font-size: 28rpx;
  194. margin-bottom: 8rpx;
  195. }
  196. .time {
  197. color: #999999;
  198. font-size: 22rpx;
  199. }
  200. }
  201. }
  202. }
  203. }
  204. </style>