record.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <view style="background-color: #FFFFFF;height: 100vh;">
  3. <view class="nav_section" v-if="list.length>0">
  4. <view>
  5. <view v-for="(item, index) in list" :key="index" class="nav_section_items">
  6. <view class="section_cont" data-aid="undefined">
  7. <view class="section_cont_tel">
  8. <text>访客类型:</text>
  9. <text class="fr classify" v-if="item.accessUserType==0">朋友</text>
  10. <text class="fr classify" v-else-if="item.accessUserType==1">外卖</text>
  11. <text class="fr classify" v-else-if="item.accessUserType==2">快递</text>
  12. <text class="fr classify" v-else-if="item.accessUserType==3">其他</text>
  13. <text class="fr classify" v-else>其他</text>
  14. </view>
  15. <view class="section_cont_tel">
  16. <text>开门密码:</text>
  17. <text class="fr">{{item.accessCardNo}}</text>
  18. </view>
  19. <view class="section_cont_tel"> <text>开门时间:</text> <text class="fr">{{item.accessDate}}</text></view>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="default" v-if="list==null || list.length==0">
  25. <image src="/static/empty.png" mode="heightFix"></image>
  26. <view>
  27. <text>没有获取到访客记录</text>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. //获取app实例
  34. var app = getApp();
  35. var util = require("../../utils/util.js");
  36. export default {
  37. data() {
  38. return {
  39. list: null
  40. };
  41. },
  42. components: {},
  43. props: {},
  44. /**
  45. * 生命周期函数--监听页面加载
  46. */
  47. onLoad: function (options) {
  48. this.getPwdOpenRecord();
  49. },
  50. methods: {
  51. //获取访客记录
  52. getPwdOpenRecord: function () {
  53. let that = this;
  54. let params = {};
  55. params['member_id'] = app.globalData.member.id;
  56. let operation = 'accessRecords/getListByMemberId';
  57. app.globalData.postRequest(params, operation, function (res) {
  58. console.info("获取结果:" + res.data.result_msg); //获取成功
  59. if (res.data.result_code == 1) {
  60. let list = res.data.list;
  61. for (let i in list) {
  62. list[i].accessDate = util.formatTime(list[i].accessDate);
  63. }
  64. that.setData({
  65. list: list
  66. });
  67. }
  68. });
  69. }
  70. }
  71. };
  72. </script>
  73. <style>
  74. /* pages/myHome/myHome.wxss */
  75. page{
  76. overflow-y: scroll;
  77. }
  78. .nav_section {
  79. width: 100%;
  80. overflow-y: scroll;
  81. }
  82. .nav_section_items {
  83. display: flex;
  84. flex-direction: row;
  85. justify-content: space-between;
  86. padding: 30rpx;
  87. border-bottom: 2rpx solid #ddd;
  88. position: relative;
  89. background: #fff;
  90. margin: 30rpx;
  91. border-radius: 10rpx;
  92. }
  93. .nav_section_items .section_image {
  94. width: 170rpx;
  95. height: 158rpx;
  96. position: relative;
  97. }
  98. .nav_section_items .identity {
  99. padding: 4rpx;
  100. top: 0;
  101. right: 0;
  102. background: #29afec;
  103. color: #fff;
  104. font-size: 24rpx;
  105. position: absolute;
  106. }
  107. .nav_section_items .section_image image {
  108. width: 100%;
  109. height: 100%;
  110. }
  111. .nav_section_items .section_cont {
  112. width: 100%;
  113. font-size: 26rpx;
  114. color: #a9a9a9;
  115. }
  116. .nav_section_items .section_cont view {
  117. overflow: hidden;
  118. text-overflow: ellipsis;
  119. white-space: nowrap;
  120. display: block;
  121. }
  122. .nav_section_items .section_cont .section_cont_intro {
  123. white-space: normal;
  124. display: -webkit-box;
  125. -webkit-line-clamp: 2;
  126. -webkit-box-orient: vertical;
  127. }
  128. .nav_section_items .section_cont .section_cont_tel {
  129. font-size: 28rpx;
  130. color: #666;
  131. line-height: 80rpx;
  132. margin-bottom: 10rpx;
  133. width: 100%;
  134. border-bottom: 1px dashed #a9a9a9;
  135. }
  136. .nav_section_items .section_cont .section_cont_tel .classify{
  137. color: #d24a58;
  138. }
  139. .section_cont_tel .fr {
  140. float: right;
  141. }
  142. .default { text-align: center; position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); } .default text{ color: #AAAAAA; } .default image { height: 250rpx; display: inline-block; } </style>