Institutional_visits.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. type: options.type
  33. })
  34. this.visitsList = data
  35. this.accDateTime = data[0].accessDate
  36. console.log('options', options, 'visitsList', data)
  37. },
  38. onReachBottom() {
  39. },
  40. onPullDownRefresh() {
  41. //下拉刷新
  42. this.getVisitesClubList()
  43. uni.stopPullDownRefresh()
  44. },
  45. methods: {
  46. handlerVisits($event) {
  47. this.$api.navigateTo(
  48. '/pages/seller/notice/service/visits_details?spId=' +
  49. this.spId +
  50. '&clubId=' +
  51. $event.clubId +
  52. '&accessTime=' +
  53. $event.accessTime.substr(0, 10)
  54. )
  55. },
  56. async getVisitesClubList() {
  57. const { data } = await this.SellerService.getVisitesClubList({
  58. spId: options.spId,
  59. accDateTime: options.accDateTime
  60. })
  61. this.visitsList = data
  62. console.log('visitsList', this.visitsList)
  63. }
  64. }
  65. }
  66. </script>
  67. <style lang="scss">
  68. page {
  69. background-color: #f7f7f7;
  70. }
  71. .visitor {
  72. .visits-time {
  73. font-size: 32rpx;
  74. font-weight: bold;
  75. color: #333333;
  76. padding: 40rpx 0 24rpx 16rpx;
  77. }
  78. }
  79. </style>