myMessage.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <template>
  2. <view>
  3. <u-navbar title="我的消息" ></u-navbar>
  4. <view class="main" v-if="0">
  5. <view class="line">
  6. <view class="imgc img1">
  7. <img class="img" src="@/assets/img/myTab/message1.svg">
  8. </view>
  9. <view class="text">
  10. <view class="info">
  11. <view class="title">
  12. 故障告警
  13. </view>
  14. <view class="date">
  15. 02-02
  16. </view>
  17. </view>
  18. <view class="message">
  19. A01车位地锁于2025-02-02 23:00:01离线断网...
  20. </view>
  21. </view>
  22. </view>
  23. <view class="line">
  24. <view class="imgc img2">
  25. <img class="img" src="@/assets/img/myTab/message2.svg">
  26. </view>
  27. <view class="text">
  28. <view class="info">
  29. <view class="title">
  30. 故障告警
  31. </view>
  32. <view class="date">
  33. 02-02
  34. </view>
  35. </view>
  36. <view class="message">
  37. A01车位地锁于2025-02-02 23:00:01离线断网...
  38. </view>
  39. </view>
  40. </view>
  41. <view class="line">
  42. <view class="imgc img3">
  43. <img class="img" src="@/assets/img/myTab/message3.svg">
  44. </view>
  45. <view class="text">
  46. <view class="info">
  47. <view class="title">
  48. 故障告警
  49. </view>
  50. <view class="date">
  51. 02-02
  52. </view>
  53. </view>
  54. <view class="message">
  55. A01车位地锁于2025-02-02 23:00:01离线断网...
  56. </view>
  57. </view>
  58. </view>
  59. <view class="line">
  60. <view class="imgc img4">
  61. <img class="img" src="@/assets/img/myTab/message4.svg">
  62. </view>
  63. <view class="text">
  64. <view class="info">
  65. <view class="title">
  66. 故障告警
  67. </view>
  68. <view class="date">
  69. 02-02
  70. </view>
  71. </view>
  72. <view class="message">
  73. A01车位地锁于2025-02-02 23:00:01离线断网...
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. <u-divider :isnone="list.length==0" nonetext="没有找到相关内容" border-color="#CFD2D5">已经到底了</u-divider>
  79. </view>
  80. </template>
  81. <script>
  82. export default {
  83. data() {
  84. return {
  85. list: [],
  86. listForm: {
  87. pageIndex: 1,
  88. pageSize: 20,
  89. recordsTotal: 1,
  90. },
  91. };
  92. },
  93. onLoad(op) {
  94. this.getList()
  95. },
  96. onReachBottom() {
  97. if (this.list.length < this.listForm.recordsTotal) {
  98. this.myLoadmore();
  99. }
  100. },
  101. methods: {
  102. myLoadmore() {
  103. this.listForm.pageIndex += 1;
  104. this.getList()
  105. },
  106. getList() {
  107. return
  108. uni.showLoading({
  109. title: "加载中",
  110. mask: true,
  111. })
  112. API.floorlockList(this.listForm).then((res) => {
  113. var list = []
  114. if (this.listForm.pageIndex == 1) {
  115. list = res.data.data;
  116. } else {
  117. list = [
  118. ...list,
  119. ...res.data.data
  120. ];
  121. }
  122. this.list = list
  123. this.listForm.recordsTotal=res.data.recordsTotal
  124. uni.hideLoading();
  125. }).catch(error => {
  126. uni.hideLoading();
  127. uni.showToast({
  128. title: error,
  129. icon: "none"
  130. })
  131. })
  132. },
  133. }
  134. }
  135. </script>
  136. <style lang="scss">
  137. .main{
  138. .line{
  139. background-color: rgba(255,255,255,1);
  140. border-top: 1px solid rgba(232,232,232,1);
  141. display: flex;
  142. align-items: center;
  143. padding:16px;
  144. .text{
  145. .info{
  146. display: flex;
  147. justify-content: space-between;
  148. .title{
  149. color: rgba(16,16,16,1);
  150. font-size: 16px;
  151. font-weight: bold;
  152. }
  153. .date{
  154. color: rgb(140,140,140);
  155. font-size: 12px;
  156. }
  157. margin-bottom: 4px;
  158. }
  159. }
  160. .message{
  161. color: rgba(51,51,51,1);
  162. font-size: 12px;
  163. }
  164. .imgc{
  165. display: flex;
  166. align-items: center;
  167. justify-content: center;
  168. border-radius: 12px;
  169. margin-right: 8px;
  170. width: 48px;
  171. height: 48px;
  172. .img{
  173. width: 28px;
  174. height: 28px;
  175. }
  176. }
  177. .img1{
  178. background: linear-gradient(180.29deg, rgba(255,214,125,1) 0.9%,rgba(255,150,0,1) 100.4%);
  179. }
  180. .img2{
  181. background: linear-gradient(180.29deg, rgba(255,124,112,1) 0.9%,rgba(255,79,63,1) 100.4%);}
  182. .img3{
  183. background: linear-gradient(179.2deg, rgba(168,178,238,1) 6.28%,rgba(123,123,240,1) 96.94%);}
  184. .img4{
  185. background: linear-gradient(180deg, rgba(121,172,255,1) 0%,rgba(57,132,255,1) 100%);}
  186. }
  187. }
  188. </style>