home.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <template>
  2. <view class="container">
  3. <!-- 头部筛选区域 -->
  4. <view class="search">
  5. <picker style="width: 50%" :value="typeIndex" :range="typeList" range-key="text" @change="bindTypeChange">
  6. <view class="search-left">
  7. {{ typeList[typeIndex].text }}
  8. <view class="search-img">
  9. <img class="img" src="@/static/images/bottom2.png" />
  10. </view>
  11. </view>
  12. </picker>
  13. <picker style="width: 50%" mode="date" :value="date" @change="bindDateChange">
  14. <view class="search-right">
  15. {{ date }}
  16. <view class="search-img">
  17. <img class="img" src="@/static/images/bottom2.png" />
  18. </view>
  19. </view>
  20. </picker>
  21. </view>
  22. <!-- 每一个预警信息 -->
  23. <view class="container-item" v-for="item in listData" :key="item.id">
  24. <!-- 标题区域 -->
  25. <view class="item-title">
  26. <view class="title-info">{{ item.warningType }}</view>
  27. <view class="title-state">待处理</view>
  28. </view>
  29. <!-- 告警时间区域 -->
  30. <view class="item-box">
  31. <view class="box-key">告警时间</view>
  32. <view class="box-value">{{ time_format(item.dateTime) }}</view>
  33. </view>
  34. <!-- 姓名区域 -->
  35. <view class="item-box">
  36. <view class="box-key">姓名</view>
  37. <view v-if="item.name" class="box-value">{{ item.name }}</view>
  38. <view v-else class="box-value">陌生人</view>
  39. </view>
  40. <!-- 地点区域 -->
  41. <view class="item-box">
  42. <view class="box-key">地点</view>
  43. <view class="box-value">{{ item.address }}</view>
  44. </view>
  45. <!-- 图片区域 -->
  46. <view class="item-box2">
  47. <view class="box-key">图片</view>
  48. <view class="box-img" @click="handleBigImg(item.pictureUrl)"><img :src="item.pictureUrl" /></view>
  49. </view>
  50. <!-- 按钮区域 -->
  51. <view class="item-button">
  52. <view class="button-finish" @click="handleFinish(item.id)">处理完成</view>
  53. <view class="button-err" @click="handleErr(item.id)">误报</view>
  54. </view>
  55. </view>
  56. <!-- 无数据时展示的区域 -->
  57. <view class="list-noData" v-if="listData.length === 0">
  58. <img mode="aspetcFill" class="img" src="@/static/images/noData.png" />
  59. <view>暂无数据</view>
  60. </view>
  61. </view>
  62. </template>
  63. <script setup>
  64. import { ref } from 'vue'
  65. import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
  66. // 导入时间相关函数
  67. import { time_format, getNowDate } from '@/utils/formatTime.js'
  68. // 状态筛选框数组当前索引
  69. const typeIndex = ref(0)
  70. // 状态筛选框数组
  71. const typeList = ref([
  72. {
  73. text: '全部',
  74. value: 0
  75. },
  76. {
  77. text: '越界预警',
  78. value: 1
  79. },
  80. {
  81. text: '区域入侵预警',
  82. value: 2
  83. },
  84. {
  85. text: '进入区域',
  86. value: 3
  87. },
  88. {
  89. text: '离开区域',
  90. value: 4
  91. }
  92. ])
  93. // 状态筛选框改变数据时的回调
  94. const bindTypeChange = (e) => {
  95. typeIndex.value = e.detail.value
  96. }
  97. // 日期筛选框绑定日期
  98. const date = ref(getNowDate())
  99. // 日期筛选框改变数据时的回调
  100. const bindDateChange = (e) => {
  101. date.value = e.detail.value
  102. }
  103. // 预警列表数据
  104. const listData = ref([])
  105. onLoad(() => {})
  106. // 点击图片回调
  107. const handleBigImg = (imgUrl) => {
  108. console.log(imgUrl)
  109. }
  110. // 处理完成按钮回调
  111. const handleFinish = () => {}
  112. // 误报按钮回调
  113. const handleErr = () => {}
  114. </script>
  115. <style lang="scss" scoped>
  116. .container {
  117. background-color: #f2f2f2;
  118. .search {
  119. margin-bottom: 20rpx;
  120. display: flex;
  121. align-items: center;
  122. height: 100rpx;
  123. background-color: #fff;
  124. .search-left {
  125. display: flex;
  126. justify-content: center;
  127. border-right: 1rpx solid #ccc;
  128. .search-img {
  129. margin-left: 27rpx;
  130. margin-top: -5rpx;
  131. width: 17rpx;
  132. height: 12rpx;
  133. .img {
  134. width: 100%;
  135. height: 100%;
  136. }
  137. }
  138. }
  139. .search-right {
  140. display: flex;
  141. justify-content: center;
  142. .search-img {
  143. margin-left: 27rpx;
  144. margin-top: -5rpx;
  145. width: 17rpx;
  146. height: 12rpx;
  147. .img {
  148. width: 100%;
  149. height: 100%;
  150. }
  151. }
  152. }
  153. }
  154. .container-item {
  155. padding: 0 30rpx;
  156. margin-bottom: 20rpx;
  157. height: 601rpx;
  158. background-color: #fff;
  159. .item-title {
  160. display: flex;
  161. justify-content: space-between;
  162. align-items: center;
  163. height: 92rpx;
  164. border-bottom: 1rpx solid #e6e6e6;
  165. .title-info {
  166. font-size: 34rpx;
  167. font-weight: bold;
  168. }
  169. .title-state {
  170. font-size: 28rpx;
  171. color: #5a61f4;
  172. }
  173. }
  174. .item-box {
  175. display: flex;
  176. align-items: center;
  177. height: 80rpx;
  178. font-size: 28rpx;
  179. .box-key {
  180. margin-right: 60rpx;
  181. width: 120rpx;
  182. color: #999999;
  183. text-align-last: justify;
  184. }
  185. .box-value {
  186. }
  187. }
  188. .item-box2 {
  189. display: flex;
  190. align-items: center;
  191. height: 98rpx;
  192. font-size: 28rpx;
  193. .box-key {
  194. margin-right: 60rpx;
  195. width: 120rpx;
  196. color: #999999;
  197. text-align-last: justify;
  198. }
  199. .box-img {
  200. height: 100%;
  201. img {
  202. height: 100%;
  203. }
  204. }
  205. }
  206. .item-button {
  207. display: flex;
  208. justify-content: flex-end;
  209. align-items: center;
  210. height: 170rpx;
  211. .button-finish {
  212. display: flex;
  213. justify-content: center;
  214. align-items: center;
  215. width: 170rpx;
  216. height: 70rpx;
  217. color: #fff;
  218. font-size: 32rpx;
  219. border-radius: 15rpx;
  220. background: linear-gradient(180deg, #8684ff 0%, #3c50e8 100%);
  221. }
  222. .button-err {
  223. margin-left: 30rpx;
  224. display: flex;
  225. justify-content: center;
  226. align-items: center;
  227. width: 170rpx;
  228. height: 70rpx;
  229. color: #d43030;
  230. font-size: 32rpx;
  231. border-radius: 15rpx;
  232. background-color: #e6e6e6;
  233. }
  234. }
  235. }
  236. .list-noData {
  237. padding-top: 150rpx;
  238. background-color: #fff;
  239. text-align: center;
  240. color: #999999;
  241. .img {
  242. width: 600rpx;
  243. }
  244. }
  245. }
  246. </style>