access-record.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  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="history">
  18. <u-time-line>
  19. <u-time-line-item nodeTop="2" v-for="(item,index) in dataList" :key="index">
  20. <template v-slot:node>
  21. <view class="u-node bg-white" >
  22. <u-icon name="clock-fill" color="#59a5f0" :size="28"></u-icon>
  23. </view>
  24. </template>
  25. <template v-slot:content>
  26. <view>
  27. <view class="">{{item.time}}</view>
  28. <view style="width: 636rpx;">
  29. <view class="content">
  30. <view class="flex justify-between">
  31. <view class="">
  32. <view class="nav-title">
  33. <text class="">人员姓名:</text>
  34. <text class="">{{item.name}}</text>
  35. </view>
  36. <view class="nav-title">
  37. <text >所属企业:</text>
  38. <text>{{item.enterpriseName}}</text>
  39. </view>
  40. <view class="nav-title">
  41. <text >开门设备:</text>
  42. <text>{{item.device}}</text>
  43. </view>
  44. </view>
  45. <view class="" v-if="item.faceImg">
  46. <image @click="preViewImg(item.faceImg)" :src="item.faceImg" style="width: 110rpx;height: 110rpx;border-radius: 10rpx;" mode=""></image>
  47. </view>
  48. </view>
  49. <view class="nav-title">
  50. <text >开门方式:</text>
  51. <text>{{item.openType}}</text>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </template>
  57. </u-time-line-item>
  58. </u-time-line>
  59. </view>
  60. <u-divider height="80">到底了</u-divider>
  61. </scroll-view>
  62. </swiper-item>
  63. <swiper-item >
  64. <scroll-view scroll-y style="height: 100%;">
  65. <view class="history">
  66. <u-time-line>
  67. <u-time-line-item v-if="index==1" nodeTop="2" v-for="(item,index) in dataList" :key="index">
  68. <template v-slot:node>
  69. <view class="u-node bg-white" >
  70. <u-icon name="clock-fill" color="#59a5f0" :size="28"></u-icon>
  71. </view>
  72. </template>
  73. <template v-slot:content>
  74. <view>
  75. <view >{{item.time}}</view>
  76. <view style="width: 636rpx;">
  77. <view class="content">
  78. <view class="flex justify-between">
  79. <view class="">
  80. <view class="nav-title">
  81. <text class="">人员姓名:</text>
  82. <text class="">{{item.name}}</text>
  83. </view>
  84. <view class="nav-title">
  85. <text >所属企业:</text>
  86. <text>{{item.enterpriseName}}</text>
  87. </view>
  88. <view class="nav-title">
  89. <text >开门设备:</text>
  90. <text>{{item.device}}</text>
  91. </view>
  92. </view>
  93. <view class="" v-if="item.faceImg">
  94. <image @click="preViewImg(item.faceImg)" :src="item.faceImg" style="width: 110rpx;height: 110rpx;border-radius: 10rpx;" mode=""></image>
  95. </view>
  96. </view>
  97. <view class="nav-title">
  98. <text >开门方式:</text>
  99. <text>{{item.openType}}</text>
  100. </view>
  101. </view>
  102. </view>
  103. </view>
  104. </template>
  105. </u-time-line-item>
  106. </u-time-line>
  107. </view>
  108. <u-divider height="80">到底了</u-divider>
  109. </scroll-view>
  110. </swiper-item>
  111. </swiper>
  112. </view>
  113. </view>
  114. </template>
  115. <script>
  116. export default {
  117. components:{
  118. },
  119. data() {
  120. return {
  121. dateShow:false,
  122. dataList:[],
  123. subsectionCurrent:0,
  124. swiperCurrent:0,
  125. subsectionList:[
  126. {
  127. name: '全部记录'
  128. },
  129. {
  130. name: '迟到记录'
  131. }
  132. ]
  133. }
  134. },
  135. onLoad() {
  136. this.fetchStaticData()
  137. },
  138. methods: {
  139. subsectionChange(index){
  140. this.subsectionCurrent=index
  141. },
  142. swiperChange(e) {
  143. uni.pageScrollTo({
  144. scrollTop: 0,
  145. duration: 0
  146. });
  147. this.subsectionCurrent = e.detail.current
  148. },
  149. animationfinish({detail: { current }}) {
  150. this.swiperCurrent = current;
  151. this.subsectionCurrent = current;
  152. },
  153. preViewImg(img){
  154. let urls=[img]
  155. uni.previewImage({
  156. urls:urls
  157. })
  158. },
  159. fetchStaticData(){
  160. this.dataList=[
  161. {
  162. name:'李德希',
  163. enterpriseName:'宁夏新金凰印刷有限公司',
  164. device:'园区大门',
  165. openType:'小程序一键开门',
  166. time:'2020-12-19 17:02:45'
  167. },
  168. {
  169. name:'李德希',
  170. enterpriseName:'宁夏新金凰印刷有限公司',
  171. device:'园区大门',
  172. openType:'面部识别开门',
  173. faceImg:'http://139.9.103.171:1888/miniofile/xlyq/del/ldx.png',
  174. time:'2020-12-19 17:02:45'
  175. },
  176. {
  177. name:'李德希',
  178. enterpriseName:'宁夏新金凰印刷有限公司',
  179. device:'园区大门',
  180. openType:'小程序一键开门',
  181. time:'2020-12-19 17:02:45'
  182. },
  183. ]
  184. }
  185. }
  186. }
  187. </script>
  188. <style lang="scss">
  189. page{
  190. background-color: #FFFFFF;
  191. }
  192. .nav .cu-item {
  193. height: 70rpx;
  194. display: inline-block;
  195. line-height: 70rpx;
  196. margin: 0 10rpx;
  197. padding: 0 20rpx;
  198. }
  199. .nav-title {
  200. font-size: 28upx;
  201. font-weight: 300;
  202. padding-top: 20rpx;
  203. }
  204. .history{
  205. box-sizing: border-box;
  206. padding: 40rpx 20rpx 20rpx 50rpx;
  207. }
  208. .content{
  209. box-shadow: 0 8rpx 10rpx rgba(234, 234, 234, 0.5),8rpx 0rpx 10rpx rgba(234, 234, 234,.5),-8rpx 0rpx 10rpx rgba(234, 234, 234,.5);
  210. background-color: #FFFFFF;
  211. padding: 20rpx;
  212. border-radius: 10rpx;
  213. margin: 20rpx 0;
  214. }
  215. .nav-checked{
  216. background-color: #59a5f0;
  217. color: #FFFFFF;
  218. font-weight: 800;
  219. }
  220. .nav-unchecked{
  221. background-color: #FFFFFF;
  222. color: #59a5f0;
  223. }
  224. .text-checked{
  225. font-weight: 800;
  226. background-color: #FFFFFF;
  227. color: #2f7ff5;
  228. font-size: 800;
  229. }
  230. view{
  231. box-sizing: border-box;
  232. }
  233. .container {
  234. height: calc(100vh);
  235. padding: 120rpx 0rpx 0rpx;
  236. .tabs {
  237. height: 120rpx;
  238. position: fixed;
  239. top: 0rpx;
  240. left: 0;
  241. right: 0;
  242. width: 100%;
  243. z-index: 3;
  244. }
  245. }
  246. .scroll-view {
  247. height: 150rpx;
  248. white-space: nowrap;
  249. width: 100%;
  250. position: relative;
  251. top: -30rpx;
  252. }
  253. .scroll-view-item {
  254. color: #FFFFFF;
  255. background-image: linear-gradient(to right, #2f7ff5, #2f7ff5);
  256. display: inline-block;
  257. text-align: left;
  258. padding: 20rpx 40rpx;
  259. margin:0 8rpx;
  260. width:24%;
  261. border-radius: 12rpx;
  262. }
  263. .scroll-view-item:first-child{
  264. margin-left: 30rpx;
  265. }
  266. .scroll-view-item:last-child{
  267. margin-right: 30rpx;
  268. }
  269. </style>