平安校园
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.

index.vue 3.8 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <view style="height: 100%;">
  3. <view class="topBox">
  4. <SelectRadio v-model="search.departCalss" placeholder="请选择摄像头" :options="[{value:1,label:'走廊尽头(海康)'},{value:2,label:'厨房(海康)'},{value:3,label:'走廊尽头(海康)'},{value:4,label:'厨房(海康)'}]" />
  5. </view>
  6. <u-empty marginTop="100rpx" :show="false" mode="list" text="暂无数据"></u-empty>
  7. <u-list @scrolltolower="scrolltolower" style="height: calc(100% - 150rpx);">
  8. <u-list-item v-for="(item, index) in list" :key="index">
  9. <u-checkbox v-if="isManage" :name="item.name" shape="circle" label=""></u-checkbox>
  10. <view :class="{whiteCard:true,active:checkboxValue.includes(item.name)}">
  11. <view class="left">
  12. <view class="row1">
  13. 教室(海康)
  14. </view>
  15. <view class="row2">
  16. <view class="">
  17. 持续时间:20
  18. </view>
  19. <view class="">
  20. 相似度:0.5
  21. </view>
  22. </view>
  23. </view>
  24. <view class="right" v-show="!isManage">
  25. <view class="btn" @click="NAV_TO('./detail')">
  26. <view>
  27. <image src="@/static/image/seeBlue.png" mode="aspectFill"></image>
  28. </view>
  29. <text>查看</text>
  30. </view>
  31. </view>
  32. </view>
  33. </u-list-item>
  34. <u-loadmore :status="status" />
  35. </u-list>
  36. </view>
  37. </template>
  38. <script>
  39. import SelectRadio from "@/components/selectRadio.vue"
  40. export default {
  41. components: {
  42. SelectRadio
  43. },
  44. data() {
  45. return {
  46. list: [{
  47. name: 1
  48. }, {
  49. name: 2
  50. }, {
  51. name: 3
  52. }, {
  53. name: 4
  54. }, {
  55. name: 5
  56. }, {
  57. name: 6
  58. }, {
  59. name: 7
  60. }, {
  61. name: 8
  62. }, {
  63. name: 9
  64. }],
  65. isLoading: false,
  66. status: 'loadmore', //loading正在加载 loadmore加载更多 nomore没有更多了
  67. search: {
  68. class: '',
  69. },
  70. page: {
  71. size: 8,
  72. page: 8,
  73. },
  74. checkboxValue: [],
  75. isManage: false,
  76. }
  77. },
  78. methods: {
  79. scrolltolower() {
  80. this.loadmore()
  81. },
  82. loadmore() {
  83. if (this.status != 'loadmore') return
  84. this.status = 'loading'
  85. setTimeout(() => {
  86. for (let i = 0; i < 1; i++) {
  87. this.list.push({}, {}, {}, {}, {}, {})
  88. }
  89. // 获取到的总条数>=接口总条数 || 接口总条数为0
  90. if (this.list.length >= 14) {
  91. this.status = 'nomore'
  92. } else {
  93. this.status = 'loadmore'
  94. }
  95. }, 2000)
  96. },
  97. refresh() {
  98. this.status = 'loadmore'
  99. this.list = []
  100. this.page.page = 1
  101. this.loadmore()
  102. },
  103. manageClick() {
  104. this.checkboxValue = []
  105. this.isManage = this.isManage ? false : true
  106. },
  107. radioChange(e) {
  108. if (e) {
  109. let ids = this.list.map(e => e.name)
  110. this.checkboxValue = ids
  111. } else {
  112. this.checkboxValue = []
  113. }
  114. },
  115. pullDownRefresh() {
  116. this.refresh()
  117. }
  118. },
  119. onLoad() {
  120. this.loadmore()
  121. },
  122. }
  123. </script>
  124. <style lang="scss" scoped>
  125. .topBox {
  126. padding: 26rpx 30rpx;
  127. }
  128. .u-list-item {
  129. display: flex;
  130. align-items: center;
  131. flex-direction: unset;
  132. margin: 12rpx 30rpx;
  133. &:first-child {
  134. margin-top: 0rpx;
  135. }
  136. .whiteCard {
  137. flex: 1;
  138. &.active {
  139. border: 1rpx solid #2388FF;
  140. background-color: #F2F8FF;
  141. }
  142. }
  143. .u-checkbox {
  144. margin-right: 12rpx;
  145. }
  146. }
  147. .whiteCard {
  148. background-color: #fff;
  149. border-radius: 18rpx;
  150. padding: 30rpx;
  151. color: #333333;
  152. display: flex;
  153. .left{
  154. width: 76%;
  155. }
  156. .row1 {
  157. font-size: 32rpx;
  158. font-weight: 700;
  159. }
  160. .row2 {
  161. font-size: 26rpx;
  162. margin-top: 24rpx;
  163. display: flex;
  164. justify-content: space-between;
  165. }
  166. .right {
  167. display: flex;
  168. justify-content: right;
  169. flex: 1;
  170. padding-top: 12rpx;
  171. .btn {
  172. text-align: center;
  173. uni-image {
  174. width: 40rpx;
  175. height: 40rpx;
  176. }
  177. uni-text {
  178. font-size: 26rpx;
  179. color: #2388FF;
  180. position: relative;
  181. bottom: 12rpx;
  182. }
  183. }
  184. }
  185. }
  186. </style>