staff-temperature.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <view class="container">
  3. <view class="tabs" style="width: 420rpx;margin: 0rpx auto;padding-top: 20rpx;">
  4. <scroll-view scroll-x class="nav" >
  5. <view class="flex text-center">
  6. <view style="border: 1rpx solid #59a5f0;padding:15rpx 20rpx;" class="flex-sub" :class="index==subsectionCurrent?'nav-checked':'nav-unchecked'" v-for="(item,index) in subsectionList" :key="index" @tap="subsectionChange(index)" >
  7. {{item.name}}
  8. </view>
  9. </view>
  10. </scroll-view>
  11. </view>
  12. <view style="height: 100%;">
  13. <swiper style="height: 100%;" :current="subsectionCurrent" @change="swiperChange"
  14. @animationfinish="animationfinish">
  15. <swiper-item >
  16. <scroll-view scroll-y style="height: 100%;">
  17. <view class="" v-if="!this.$isEmpty(dataList)">
  18. <view v-for="(item,index) in dataList" :key="index" @click="goDetail(item)" class="mine_order_statue" >
  19. <view class="flex justify-between" style="padding: 10rpx 0 10rpx 10rpx ;">
  20. <view class="flex">
  21. <image :src="item.faceUrl" ></image>
  22. <view class="flex flex-direction justify-around padding-left-30">
  23. <view class="">
  24. <text class="text-bold">姓名:</text>
  25. <text>{{item.personName}}</text>
  26. </view>
  27. <view class="">
  28. <text class="text-bold">温度:</text>
  29. <text>{{item.temperature}} ℃ </text>
  30. </view>
  31. <view class="">
  32. <text class="text-bold">测温时间:</text>
  33. <text>{{item.recogTime}}</text>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="flex align-center justify-center">
  38. <text class="cuIcon-right"></text>
  39. </view>
  40. </view>
  41. </view>
  42. <u-divider bgColor="#f1f1f1" height="80">到底了</u-divider>
  43. </view>
  44. <u-empty v-else marginTop="-100" text="暂无记录" src="http://139.9.103.171:1888/miniofile/xlyq/empty/empty.png"></u-empty>
  45. </scroll-view>
  46. </swiper-item>
  47. <swiper-item >
  48. <scroll-view scroll-y style="height: 100%;">
  49. <u-empty marginTop="-100" text="暂无异常记录" src="http://139.9.103.171:1888/miniofile/xlyq/empty/empty.png"></u-empty>
  50. </scroll-view>
  51. </swiper-item>
  52. </swiper>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. export default {
  58. components:{
  59. },
  60. data() {
  61. return {
  62. subsectionCurrent:0,
  63. swiperCurrent:0,
  64. subsectionList:[
  65. {
  66. name: '全部记录'
  67. },
  68. {
  69. name: '异常记录'
  70. }
  71. ],
  72. dataList:[]
  73. }
  74. },
  75. onLoad() {
  76. this.fetchStaffTemperature()
  77. },
  78. methods: {
  79. fetchStaffTemperature(){
  80. let creditCode=this.$cache.get('creditCode')
  81. if (this.$isEmpty(creditCode)) {
  82. this.$showModel('系统异常').then(res=>{
  83. uni.navigateBack({
  84. delta:1
  85. })
  86. })
  87. }
  88. this.$api.temperatureRecord.page({enterpriseCreditCode:creditCode,size:300}).then(res=>{
  89. this.dataList=res.data.records
  90. })
  91. },
  92. goDetail(item){
  93. getApp().globalData.staffTemperature=item
  94. uni.navigateTo({
  95. url:"/pages/index/staff-temperature/detail"
  96. })
  97. },
  98. subsectionChange(index){
  99. this.subsectionCurrent=index
  100. },
  101. swiperChange(e) {
  102. uni.pageScrollTo({
  103. scrollTop: 0,
  104. duration: 0
  105. });
  106. this.subsectionCurrent = e.detail.current
  107. },
  108. animationfinish({detail: { current }}) {
  109. this.swiperCurrent = current;
  110. this.subsectionCurrent = current;
  111. },
  112. }
  113. }
  114. </script>
  115. <style lang="scss">
  116. .container {
  117. height: calc(100vh);
  118. background-color: #F6F6F6;
  119. padding: 90rpx 0rpx 0rpx;
  120. .tabs {
  121. height: 90rpx;
  122. position: fixed;
  123. top: 0rpx;
  124. left: 0;
  125. right: 0;
  126. width: 100%;
  127. z-index: 3;
  128. }
  129. }
  130. .nav-checked{
  131. background-color: #59a5f0;
  132. color: #FFFFFF;
  133. font-weight: 800;
  134. }
  135. .nav-unchecked{
  136. background-color: #FFFFFF;
  137. color: #59a5f0;
  138. }
  139. .text-checked{
  140. font-weight: 800;
  141. background-color: #FFFFFF;
  142. color: #2f7ff5;
  143. font-size: 800;
  144. }
  145. view{
  146. box-sizing: border-box;
  147. }
  148. .scroll-view {
  149. height: 150rpx;
  150. white-space: nowrap;
  151. width: 100%;
  152. position: relative;
  153. top: -30rpx;
  154. }
  155. .scroll-view-item {
  156. color: #FFFFFF;
  157. background-image: linear-gradient(to right, #2f7ff5, #2f7ff5);
  158. display: inline-block;
  159. text-align: left;
  160. padding: 20rpx 40rpx;
  161. margin:0 8rpx;
  162. width:24%;
  163. border-radius: 12rpx;
  164. }
  165. .scroll-view-item:first-child{
  166. margin-left: 30rpx;
  167. }
  168. .scroll-view-item:last-child{
  169. margin-right: 30rpx;
  170. }
  171. .mine_order_statue {
  172. margin: 18upx 14upx 0;
  173. background: #fff;
  174. padding: 10upx 20upx;
  175. border-radius: 20rpx;
  176. image{
  177. background-color: #FFFFFF;
  178. width: 160rpx;
  179. height: 160rpx;
  180. }
  181. }
  182. </style>