Institutional_visits.vue 2.1 KB

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