You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
1.7 KiB

  1. <template>
  2. <view class="loginRecord">
  3. <navbar :leftClick="leftClick" :title="$t('page.loginRecord.title')"></navbar>
  4. <u-list
  5. @scrolltolower="scrolltolower"
  6. height="calc(100vh - 90rpx)">
  7. <u-cell color="#fff"
  8. v-for="(item, index) in loginRecord">
  9. <view slot="title" class="title">
  10. <view>
  11. {{ $t('page.loginRecord.login_time') }}
  12. </view>
  13. <view>
  14. {{ $t('page.loginRecord.login_address') }}
  15. </view>
  16. </view>
  17. <view slot="value" class="value">
  18. <view>
  19. {{ item.createTime }}
  20. </view>
  21. <view>
  22. {{ item.loginIp }}
  23. </view>
  24. </view>
  25. </u-cell>
  26. </u-list>
  27. <view v-if="!loginRecord.length" class="noFans">
  28. {{ $t('page.loginRecord.Norecord') }}
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. import navbar from '@/components/base/m-navbar.vue'
  34. export default {
  35. components : { navbar },
  36. data() {
  37. return {
  38. loginRecord : [],
  39. total : 0,
  40. queryParams: {
  41. pageNo: 1,
  42. pageSize: 10
  43. },
  44. };
  45. },
  46. onShow(){
  47. this.getIpLogPage()
  48. },
  49. methods : {
  50. leftClick() {
  51. uni.navigateTo({
  52. url: '/pages/home/home'
  53. })
  54. },
  55. //登录记录
  56. getIpLogPage(){
  57. this.request('getIpLogPage', {}, this.queryParams)
  58. .then(res => {
  59. if (res.code == 200) {
  60. this.loginRecord = res.result.records
  61. this.total = res.result.total
  62. }
  63. })
  64. },
  65. scrolltolower(){
  66. this.queryParams.pageSize += 10
  67. this.getIpLogPage()
  68. },
  69. }
  70. }
  71. </script>
  72. <style lang="scss" scoped>
  73. .loginRecord{
  74. .title,
  75. .value{
  76. color: #fff;
  77. &>view{
  78. padding: 10rpx;
  79. }
  80. }
  81. .noFans{
  82. height: 100vh;
  83. display: flex;
  84. align-items: center;
  85. justify-content: center;
  86. color: #ffffff80;
  87. }
  88. }
  89. </style>