app-clerk-historys.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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. status: {
  38. type: Number,
  39. default: 2
  40. },
  41. userCardId: {
  42. type: Number,
  43. default: 0,
  44. }
  45. },
  46. watch: {
  47. isShow(newVal) {
  48. if (!newVal) {
  49. this.visible = false;
  50. }
  51. if (newVal) {
  52. this.page = 1;
  53. this.list = [];
  54. this.getList();
  55. }
  56. }
  57. },
  58. data() {
  59. return {
  60. visible: false,
  61. list: [],
  62. page: 1,
  63. isMore: false,
  64. }
  65. },
  66. methods: {
  67. close() {
  68. this.$emit('update:isShow', false);
  69. },
  70. getList() {
  71. let that = this;
  72. that.$showLoading({
  73. text: '加载中...'
  74. });
  75. let url=that.$api.card.history;
  76. if(this.status==3){
  77. url=that.$api.card.sphistory;
  78. }
  79. that.$request({
  80. url: url,
  81. data: {
  82. user_card_id: that.userCardId,
  83. page: that.page,
  84. },
  85. }).then(response => {
  86. that.$hideLoading();
  87. that.visible = true;
  88. if (response.code === 0) {
  89. that.list = that.list.concat(response.data.list);
  90. that.page = response.data.list.length > 0 ? that.page + 1 : that.page;
  91. if (response.data.list.length === 0) {
  92. that.isMore = true;
  93. }
  94. } else {
  95. uni.showToast({
  96. title: response.msg,
  97. icon: 'none',
  98. duration: 2000,
  99. });
  100. }
  101. }).catch(() => {
  102. that.$hideLoading();
  103. });
  104. },
  105. lower() {
  106. this.getList();
  107. }
  108. }
  109. }
  110. </script>
  111. <style scoped lang="scss">
  112. .app-clerk-historys {
  113. width: 100%;
  114. height: 100vh;
  115. background: rgba(0, 0, 0, 0.5);
  116. position: fixed;
  117. top: 0;
  118. left: 0;
  119. .history-box {
  120. position: absolute;
  121. left: 0;
  122. bottom: 0;
  123. width: 100%;
  124. max-height: 920#{rpx};
  125. overflow: hidden;
  126. border-top-left-radius: 16#{rpx};
  127. border-top-right-radius: 16#{rpx};
  128. background: #f7f7f7;
  129. .top-box {
  130. width: 100%;
  131. height: 120#{rpx};
  132. display: flex;
  133. justify-content: center;
  134. align-items: center;
  135. position: relative;
  136. background: #ffffff;
  137. .text {
  138. font-size: 38#{rpx};
  139. color: #353535;
  140. }
  141. .close {
  142. width: 35#{rpx};
  143. height: 35#{rpx};
  144. position: absolute;
  145. right: 24#{rpx};
  146. top: 24#{rpx};
  147. }
  148. }
  149. .scroll-view {
  150. max-height: 800#{rpx};
  151. .item {
  152. display: flex;
  153. flex-direction: column;
  154. margin-top: 18#{rpx};
  155. background: #ffffff;
  156. max-height: 800#{rpx};
  157. .title {
  158. height: 80#{rpx};
  159. display: flex;
  160. align-items: center;
  161. font-size: 28#{rpx};
  162. color: #353535;
  163. border-bottom: 1#{rpx} solid #dcdcdc;
  164. padding-left: 24#{rpx};
  165. }
  166. .clerk-info {
  167. display: flex;
  168. flex-direction: column;
  169. padding: 25#{rpx} 24#{rpx};
  170. .list-item {
  171. margin-bottom: 20#{rpx};
  172. font-size: 28#{rpx};
  173. color: #353535;
  174. }
  175. .list-item:last-child {
  176. margin-bottom: 0;
  177. }
  178. }
  179. }
  180. .not-more {
  181. width: 100%;
  182. display: flex;
  183. justify-content:center;
  184. align-items: center;
  185. color: #353535;
  186. font-size:28#{rpx};
  187. padding:20#{rpx} 0;
  188. }
  189. }
  190. }
  191. }
  192. </style>