Institutional_visits.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <view class="visitor">
  3. <view class="visits-time">{{ accDateTime }}</view>
  4. <template>
  5. <visits-cell
  6. @handlerVisits="handlerVisits"
  7. :visits-info="visitsInfo"
  8. v-for="visitsInfo in visitsList"
  9. :key="visitsInfo.userID"
  10. />
  11. </template>
  12. </view>
  13. </template>
  14. <script>
  15. import VisitsCell from '../components/visits-cell.vue'
  16. export default {
  17. components: {
  18. VisitsCell
  19. },
  20. data() {
  21. return {
  22. visitsList: [],
  23. accDateTime: '',
  24. spId: ''
  25. }
  26. },
  27. async onLoad(options) {
  28. this.spId = options.spId
  29. const { data } = await this.SellerService.getVisitesClubList({
  30. spId: options.spId,
  31. accDateTime: options.accDateTime
  32. })
  33. this.visitsList = data
  34. this.accDateTime = data[0].accessDate
  35. console.log('options', options, 'visitsList', data)
  36. },
  37. onReachBottom() {
  38. },
  39. onPullDownRefresh() {
  40. //下拉刷新
  41. this.getVisitesClubList()
  42. uni.stopPullDownRefresh()
  43. },
  44. methods: {
  45. handlerVisits($event) {
  46. this.$api.navigateTo(
  47. '/pages/seller/notice/service/visits_details?spId=' +
  48. this.spId +
  49. '&clubId=' +
  50. $event.clubId +
  51. '&accessTime=' +
  52. $event.accessTime.substr(0, 10)
  53. )
  54. },
  55. async getVisitesClubList() {
  56. const { data } = await this.SellerService.getVisitesClubList({
  57. spId: options.spId,
  58. accDateTime: options.accDateTime
  59. })
  60. this.visitsList = data
  61. console.log('visitsList', this.visitsList)
  62. }
  63. }
  64. }
  65. </script>
  66. <style lang="scss">
  67. page {
  68. background-color: #f7f7f7;
  69. }
  70. .visitor {
  71. .visits-time {
  72. font-size: 32rpx;
  73. font-weight: bold;
  74. color: #333333;
  75. padding: 40rpx 0 24rpx 16rpx;
  76. }
  77. }
  78. </style>