app-clerk-historys.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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. console.log(that.isMore)
  87. } else {
  88. uni.showToast({
  89. title: response.msg,
  90. icon: 'none',
  91. duration: 2000,
  92. });
  93. }
  94. }).catch(() => {
  95. that.$hideLoading();
  96. });
  97. },
  98. lower() {
  99. this.getList();
  100. }
  101. },
  102. created() {
  103. }
  104. }
  105. </script>
  106. <style scoped lang="scss">
  107. .app-clerk-historys {
  108. width: 100%;
  109. height: 100vh;
  110. background: rgba(0, 0, 0, 0.5);
  111. position: fixed;
  112. top: 0;
  113. left: 0;
  114. .history-box {
  115. position: absolute;
  116. left: 0;
  117. bottom: 0;
  118. width: 100%;
  119. max-height: 920#{rpx};
  120. overflow: hidden;
  121. border-top-left-radius: 16#{rpx};
  122. border-top-right-radius: 16#{rpx};
  123. background: #f7f7f7;
  124. .top-box {
  125. width: 100%;
  126. height: 120#{rpx};
  127. display: flex;
  128. justify-content: center;
  129. align-items: center;
  130. position: relative;
  131. background: #ffffff;
  132. .text {
  133. font-size: 38#{rpx};
  134. color: #353535;
  135. }
  136. .close {
  137. width: 35#{rpx};
  138. height: 35#{rpx};
  139. position: absolute;
  140. right: 24#{rpx};
  141. top: 24#{rpx};
  142. }
  143. }
  144. .scroll-view {
  145. max-height: 800#{rpx};
  146. .item {
  147. display: flex;
  148. flex-direction: column;
  149. margin-top: 18#{rpx};
  150. background: #ffffff;
  151. max-height: 800#{rpx};
  152. .title {
  153. height: 80#{rpx};
  154. display: flex;
  155. align-items: center;
  156. font-size: 28#{rpx};
  157. color: #353535;
  158. border-bottom: 1#{rpx} solid #dcdcdc;
  159. padding-left: 24#{rpx};
  160. }
  161. .clerk-info {
  162. display: flex;
  163. flex-direction: column;
  164. padding: 25#{rpx} 24#{rpx};
  165. .list-item {
  166. margin-bottom: 20#{rpx};
  167. font-size: 28#{rpx};
  168. color: #353535;
  169. }
  170. .list-item:last-child {
  171. margin-bottom: 0;
  172. }
  173. }
  174. }
  175. .not-more {
  176. width: 100%;
  177. display: flex;
  178. justify-content:center;
  179. align-items: center;
  180. color: #353535;
  181. font-size:28#{rpx};
  182. padding:20#{rpx} 0;
  183. }
  184. }
  185. }
  186. }
  187. </style>