openDoorList.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <!-- 解锁记录 -->
  2. <!-- 一键开门 -->
  3. <template>
  4. <view class="">
  5. <image src="../../static/history_top_bgimage@2x.png" style="width: 100%;height: 278rpx;"></image>
  6. <view class="main">
  7. <view style="width:520rpx;margin: 0 auto;margin-top: 300rpx;" v-show="visible">
  8. <image src="../../static/notData.png" style="width:520rpx ;height: 520rpx;"></image>
  9. <view style="width:144rpx;height:50rpx;font-size:36rpx;margin: 0 auto;margin-top: 46rpx;">暂无数据</view>
  10. </view>
  11. <!-- <view class="infoBox" style="margin-top: 40rpx;"> -->
  12. <!-- <view class="title">
  13. 番茄小区
  14. </view> -->
  15. <view class="item" v-for="(item,index) in data" :key="index" v-show="!visible">
  16. <view class="leftIcon">
  17. <image src="../../static/open_icon@2x.png" style="width: 100%;height: 100%;"></image>
  18. </view>
  19. <view class="" style="position: absolute;left: 100rpx;">
  20. <view class="name">{{item.deviceName}}</view>
  21. <view class="dec">
  22. 解锁时间:{{item.createTime}}
  23. </view>
  24. </view>
  25. </view>
  26. <!-- </view> -->
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. data() {
  33. return {
  34. data:[],
  35. visible:true
  36. }
  37. },
  38. mounted() {
  39. this.getList()
  40. },
  41. onPullDownRefresh() {
  42. uni.showLoading({
  43. title: '加载中',
  44. mask: true
  45. })
  46. this.getList()
  47. },
  48. methods: {
  49. // 获取列表数据
  50. getList() {
  51. uni.showLoading({
  52. mask:true,
  53. title:'加载中'
  54. })
  55. this.http.httpRequest('/wxapplet/owner/openDoor/list', 'get', {
  56. phoneNum:uni.getStorageSync('phoneNumber')
  57. }, true).then((res) => {
  58. console.log(res)
  59. if (res.code == 0) {
  60. // 判断返回数据是否为空
  61. if(res.data.rows.length==0){
  62. this.visible=true
  63. }else{
  64. this.visible=false
  65. }
  66. this.data=res.data.rows
  67. setTimeout(() => {
  68. uni.hideLoading()
  69. uni.stopPullDownRefresh()
  70. }, 1000)
  71. } else {
  72. uni.hideLoading()
  73. uni.showToast({
  74. title: res.msg,
  75. 'icon': 'none'
  76. })
  77. }
  78. }).catch(()=>{
  79. uni.hideLoading()
  80. })
  81. },
  82. // 查看解锁记录
  83. seeList() {
  84. uni.navigateTo({
  85. url: ""
  86. })
  87. }
  88. }
  89. }
  90. </script>
  91. <style scoped>
  92. .notInfo {
  93. width: 100%;
  94. height: 50rpx;
  95. font-size: 36rpx;
  96. font-family: PingFang SC;
  97. font-weight: 400;
  98. line-height: 50rpx;
  99. color: rgba(36, 36, 36, 1);
  100. margin: 0 auto;
  101. margin-top: 40rpx;
  102. text-align: center;
  103. }
  104. .title {
  105. width: 100%;
  106. height: 44rpx;
  107. font-size: 32rpx;
  108. font-family: PingFang SC;
  109. font-weight: bold;
  110. color: rgba(41, 138, 253, 1);
  111. }
  112. .btn {
  113. width: 702rpx;
  114. height: 90rpx;
  115. background: rgba(41, 138, 253, 1);
  116. opacity: 1;
  117. border-radius: 18rpx;
  118. position: fixed;
  119. bottom: 56rpx;
  120. left: 24rpx;
  121. font-size: 32rpx;
  122. font-family: PingFang SC;
  123. font-weight: bold;
  124. color: rgba(255, 255, 255, 1);
  125. }
  126. .dec {
  127. width: 400rpx;
  128. height: 40rpx;
  129. font-size: 24rpx;
  130. font-family: PingFang SC;
  131. font-weight: 400;
  132. color: rgba(153, 153, 153, 1);
  133. margin-top: 12rpx;
  134. }
  135. .name {
  136. width: 262rpx;
  137. height: 44rpx;
  138. font-size: 30rpx;
  139. font-family: PingFang SC;
  140. font-weight: 400;
  141. color: rgba(51, 51, 51, 1);
  142. margin-top: 38rpx;
  143. }
  144. .item {
  145. width: 702rpx;
  146. height: 170rpx;
  147. border-bottom: 2px solid rgba(247, 247, 247, 1);
  148. ;
  149. display: flex;
  150. position: relative;
  151. }
  152. .infoBox {
  153. width: 702rpx;
  154. margin: 0 auto;
  155. }
  156. .leftIcon {
  157. width: 60rpx;
  158. height: 60rpx;
  159. position: absolute;
  160. left: 24rpx;
  161. bottom: 60rpx;
  162. }
  163. .rightIcon {
  164. width: 80rpx;
  165. height: 80rpx;
  166. position: absolute;
  167. right: 24rpx;
  168. bottom: 44rpx;
  169. }
  170. .main {
  171. width: 100%;
  172. position: absolute;
  173. top: 0rpx;
  174. }
  175. </style>