app-clerk-historys.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <view @touchmove.stop.prevent="" class="app-clerk-historys" v-show="visible">
  3. <view class="history-box">
  4. <view class="top-box">
  5. <span class="text">历史核销记录</span>
  6. <image @click="close" class="close" src="/static/image/icon/icon-close.png"></image>
  7. </view>
  8. <scroll-view class="scroll-view" scroll-y="true" @scrolltolower="lower">
  9. <view class="item" v-for="item in list" :key="item.id">
  10. <view class="title">已核销({{item.use_number}}次)</view>
  11. <view class="clerk-info">
  12. <view class="list-item">
  13. 核销时间:{{item.clerked_at}}
  14. </view>
  15. <view class="list-item">
  16. 核销门店:{{item.store_name}}
  17. </view>
  18. <view class="list-item">
  19. 核销员:{{item.clerk_user}}
  20. </view>
  21. </view>
  22. </view>
  23. <view class="not-more" v-if="isMore">没有更多数据!</view>
  24. </scroll-view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. name: 'app-clerk-historys',
  31. components: {},
  32. props: {
  33. isShow: {
  34. type: Boolean,
  35. default: false
  36. },
  37. userCardId: {
  38. type: Number,
  39. default: 0,
  40. }
  41. },
  42. watch: {
  43. isShow(newVal) {
  44. if (!newVal) {
  45. this.visible = false;
  46. }
  47. if (newVal) {
  48. this.page = 1;
  49. this.list = [];
  50. this.getList();
  51. }
  52. }
  53. },
  54. data() {
  55. return {
  56. visible: false,
  57. list: [],
  58. page: 1,
  59. isMore: false,
  60. }
  61. },
  62. methods: {
  63. close() {
  64. this.$emit('update:isShow', false);
  65. },
  66. getList() {
  67. let that = this;
  68. that.$showLoading({
  69. text: '加载中...'
  70. });
  71. that.$request({
  72. url: that.$api.card.history,
  73. data: {
  74. user_card_id: that.userCardId,
  75. page: that.page,
  76. },
  77. }).then(response => {
  78. that.$hideLoading();
  79. that.visible = true;
  80. if (response.code === 0) {
  81. that.list = that.list.concat(response.data.list);
  82. that.page = response.data.list.length > 0 ? that.page + 1 : that.page;
  83. if (response.data.list.length === 0) {
  84. that.isMore = true;
  85. }
  86. } else {
  87. uni.showToast({
  88. title: response.msg,
  89. icon: 'none',
  90. duration: 2000,
  91. });
  92. }
  93. }).catch(() => {
  94. that.$hideLoading();
  95. });
  96. },
  97. lower() {
  98. this.getList();
  99. }
  100. }
  101. }
  102. </script>
  103. <style scoped lang="scss">
  104. .app-clerk-historys {
  105. width: 100%;
  106. height: 100vh;
  107. background: rgba(0, 0, 0, 0.5);
  108. position: fixed;
  109. top: 0;
  110. left: 0;
  111. .history-box {
  112. position: absolute;
  113. left: 0;
  114. bottom: 0;
  115. width: 100%;
  116. max-height: 920#{rpx};
  117. overflow: hidden;
  118. border-top-left-radius: 16#{rpx};
  119. border-top-right-radius: 16#{rpx};
  120. background: #f7f7f7;
  121. .top-box {
  122. width: 100%;
  123. height: 120#{rpx};
  124. display: flex;
  125. justify-content: center;
  126. align-items: center;
  127. position: relative;
  128. background: #ffffff;
  129. .text {
  130. font-size: 38#{rpx};
  131. color: #353535;
  132. }
  133. .close {
  134. width: 35#{rpx};
  135. height: 35#{rpx};
  136. position: absolute;
  137. right: 24#{rpx};
  138. top: 24#{rpx};
  139. }
  140. }
  141. .scroll-view {
  142. max-height: 800#{rpx};
  143. .item {
  144. display: flex;
  145. flex-direction: column;
  146. margin-top: 18#{rpx};
  147. background: #ffffff;
  148. max-height: 800#{rpx};
  149. .title {
  150. height: 80#{rpx};
  151. display: flex;
  152. align-items: center;
  153. font-size: 28#{rpx};
  154. color: #353535;
  155. border-bottom: 1#{rpx} solid #dcdcdc;
  156. padding-left: 24#{rpx};
  157. }
  158. .clerk-info {
  159. display: flex;
  160. flex-direction: column;
  161. padding: 25#{rpx} 24#{rpx};
  162. .list-item {
  163. margin-bottom: 20#{rpx};
  164. font-size: 28#{rpx};
  165. color: #353535;
  166. }
  167. .list-item:last-child {
  168. margin-bottom: 0;
  169. }
  170. }
  171. }
  172. .not-more {
  173. width: 100%;
  174. display: flex;
  175. justify-content:center;
  176. align-items: center;
  177. color: #353535;
  178. font-size:28#{rpx};
  179. padding:20#{rpx} 0;
  180. }
  181. }
  182. }
  183. }
  184. </style>