fingerprint.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. <!-- 指纹 -->
  2. <template>
  3. <view id="fingerprint">
  4. <view class="fingerprint_one" v-if="pageType==1">
  5. <view class="fingerprint_one_li" @click="goPage('add')">
  6. <view class="fingerprint_one_li_l">指纹</view>
  7. <view :class="!checked?'colorA':'colorB'">{{!checked?'无':'已配置'}}</view>
  8. <img class="fingerprint_one_li_r" src="@/images/icon_04.png">
  9. </view>
  10. <view class="fingerprint_one_li" @click="goPage('add')">
  11. <view class="fingerprint_one_li_l">指纹</view>
  12. <view :class="!checked?'colorA':'colorB'">{{!checked?'无':'已配置'}}</view>
  13. <img class="fingerprint_one_li_r" src="@/images/icon_04.png">
  14. </view>
  15. </view>
  16. <view class="tip_tow" v-if="pageType==2">
  17. <view class="tip_tow_l">提醒</view>
  18. <view class="tip_tow_l">请选中门禁点击【指纹采集】并在当前门禁上录入指纹</view>
  19. </view>
  20. <view class="fingerprint_tow" v-if="pageType==2">
  21. <view class="input_tip">请选择可采集的指纹门禁:</view>
  22. <input class="input_search" type="text" v-model="name" placeholder="请输入门禁名称" />
  23. <view class="fingerprint_tow_border_li">
  24. <view :class="checked?'colorC':'colorD'">实验室名称+门禁名称</view>
  25. <img class="fingerprint_tow_border_li_r" src="@/images/Version2.2/icon_xzwt_xz.png">
  26. </view>
  27. </view>
  28. <view v-if="pageType==1" class="tip_one">至少添加一个指纹才可以通过指纹开锁</view>
  29. <view v-if="pageType==1" class="out-button" @click="clickOut">确定</view>
  30. <view v-if="pageType==2" class="out-button" @click="gather">指纹采集</view>
  31. <!-- 指纹采集遮罩-->
  32. <view class="shade-outfire" v-if="dialogVisible">
  33. <view class="null-box" @click="dialogClose()"></view>
  34. <view class="shade-outfire-n">
  35. <view class="shade-outfire-n-t">门禁名称</view>
  36. <img class="shade-outfire-n-t2" src="@/images/icon_zw_bk.png" />
  37. <img class="shade-outfire-n-m" src="@/images/icon_wd_zw2.png" />
  38. <view class="shade-outfire-n-b">指纹采集中...</view>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. import { config } from '@/api/request/config.js'
  45. import { } from '@/api/index.js'
  46. export default {
  47. data() {
  48. return {
  49. //页面状态
  50. pageType:1,
  51. //签名
  52. checked:true,
  53. name:'',
  54. dialogVisible:false,
  55. }
  56. },
  57. onLoad() {
  58. },
  59. onShow(){
  60. },
  61. methods: {
  62. gather(){
  63. this.dialogVisible=true;
  64. },
  65. dialogClose(){
  66. this.dialogVisible=false;
  67. },
  68. //退出按钮
  69. clickOut(){
  70. let self = this;
  71. uni.showModal({
  72. // title: '确认要退出吗?',
  73. content: '确认要退出吗',
  74. cancelColor:"#999",
  75. confirmColor:"#0183FA",
  76. success: function (res) {
  77. if (res.confirm) {
  78. self.logout();
  79. console.log('用户点击确定');
  80. } else if (res.cancel) {
  81. console.log('用户点击取消');
  82. }
  83. }
  84. });
  85. },
  86. //退出登录
  87. async logout() {
  88. let self = this;
  89. const {data} = await logout();
  90. if(data.code == 200){
  91. uni.removeStorageSync('token');
  92. uni.removeStorageSync('userId');
  93. uni.removeStorageSync('userType');
  94. uni.redirectTo({
  95. url: '/pages/login',
  96. });
  97. }
  98. },
  99. //页面跳转
  100. goPage(type){
  101. if(type == 'add'){//学生卡上传
  102. this.pageType=2;
  103. }
  104. },
  105. },
  106. }
  107. </script>
  108. <style lang="stylus" scoped>
  109. #fingerprint{
  110. height: 100%;
  111. width: 100%;
  112. display: flex;
  113. flex-direction: column;
  114. overflow-y: scroll;
  115. .fingerprint_one{
  116. width: 710rpx;
  117. height: 507rpx;
  118. background: #FFFFFF;
  119. border-radius: 20rpx;
  120. margin: 20rpx;
  121. .fingerprint_one_li{
  122. display: flex;
  123. justify-content: flex-start;
  124. align-items: center;
  125. height: 100rpx;
  126. margin: 0 20rpx;
  127. border-bottom: 1px solid #E0E0E0;
  128. .fingerprint_one_li_l{
  129. font-size: 30rpx;
  130. font-family: PingFang SC;
  131. font-weight: 500;
  132. color: #333333;
  133. text-align: left;
  134. flex: 1;
  135. }
  136. .fingerprint_one_li_r{
  137. width: 12rpx;
  138. height: 24rpx;
  139. }
  140. .colorA{
  141. font-size: 26rpx;
  142. font-family: PingFang SC;
  143. font-weight: 500;
  144. color: #999999;
  145. text-align: right;
  146. margin-right: 40rpx;
  147. flex: 1;
  148. }
  149. .colorB{
  150. font-size: 26rpx;
  151. font-family: PingFang SC;
  152. font-weight: 500;
  153. color: #0183FA;
  154. text-align: right;
  155. margin-right: 40rpx;
  156. flex: 1;
  157. }
  158. }
  159. }
  160. .tip_tow{
  161. margin: 10rpx 0;
  162. .tip_tow_l{
  163. font-size: 24rpx;
  164. font-family: PingFang SC;
  165. font-weight: 500;
  166. color: #FF0000;
  167. line-height: 36rpx;
  168. text-align: left;
  169. margin-left: 36rpx;
  170. }
  171. }
  172. .fingerprint_tow{
  173. width: 710rpx;
  174. background: #FFFFFF;
  175. border-radius: 10px;
  176. margin: 0 20rpx;
  177. padding: 0 20rpx;
  178. box-sizing: border-box;
  179. overflow: hidden;
  180. .input_tip{
  181. font-size: 30rpx;
  182. font-family: PingFang SC;
  183. font-weight: 500;
  184. color: #333333;
  185. line-height: 30rpx;
  186. margin: 34rpx 0;
  187. }
  188. .input_search{
  189. width: 670rpx;
  190. height: 80rpx;
  191. background: #FFFFFF;
  192. border: 1px solid #E0E0E0;
  193. border-radius: 10rpx;
  194. padding-left: 20rpx;
  195. box-sizing: border-box;
  196. margin-bottom: 32rpx;
  197. }
  198. .fingerprint_tow_border_li{
  199. height: 100rpx;
  200. display: flex;
  201. justify-content: space-between;
  202. align-items: center;
  203. margin: 0 20rpx;
  204. border-bottom: 1px solid #E0E0E0;
  205. .fingerprint_tow_border_li_l{}
  206. .fingerprint_tow_border_li_r{
  207. width: 30rpx;
  208. height: 20rpx;
  209. }
  210. .colorC{
  211. font-size: 30rpx;
  212. font-family: PingFang SC;
  213. font-weight: 500;
  214. color: #333333;
  215. }
  216. .colorD{
  217. font-size: 30rpx;
  218. font-family: PingFang SC;
  219. font-weight: 500;
  220. color: #0183FA;
  221. }
  222. }
  223. }
  224. .tip_one{
  225. font-size: 28rpx;
  226. font-family: PingFang SC;
  227. font-weight: 500;
  228. color: #FF0000;
  229. line-height: 30rpx;
  230. margin-top: 36rpx;
  231. text-align: center;
  232. }
  233. .out-button{
  234. position absolute
  235. bottom:140rpx;
  236. left:25rpx;
  237. width:700rpx;
  238. height:100rpx;
  239. line-height:100rpx;
  240. border-radius:10rpx;
  241. text-align center
  242. background #0183FA;
  243. color:#FFFFFF;
  244. font-size: 30rpx;
  245. margin:0 auto;
  246. }
  247. /* 指纹采集 */
  248. .shade-outfire {
  249. height: 100%;
  250. width: 100%;
  251. position: fixed;
  252. display: flex;
  253. flex-direction: column;
  254. z-index: 10;
  255. background: rgba(0, 0, 0, 0.2);
  256. .null-box {
  257. flex: 1;
  258. }
  259. .shade-outfire-n {
  260. width: 625rpx;
  261. height: 550rpx;
  262. background: #FFFFFF;
  263. border-radius: 20rpx;
  264. position: absolute;
  265. top: 370rpx;
  266. left: 62rpx;
  267. .shade-outfire-n-t {
  268. font-size: 30rpx;
  269. font-family: PingFang SC;
  270. font-weight: 500;
  271. color: #333333;
  272. text-align: center;
  273. margin-top: 32rpx;
  274. }
  275. .shade-outfire-n-t2 {
  276. width: 182rpx;
  277. height: 202rpx;
  278. position: absolute;
  279. left: 222rpx;
  280. top: 106rpx;
  281. }
  282. .shade-outfire-n-m {
  283. width: 84rpx;
  284. height: 108rpx;
  285. position: absolute;
  286. left: 266rpx;
  287. top: 150rpx;
  288. }
  289. .shade-outfire-n-b {
  290. width: 100%;
  291. font-size: 30rpx;
  292. font-family: PingFang SC;
  293. font-weight: 500;
  294. color: #0183FA;
  295. text-align: center;
  296. position: absolute;
  297. top: 358rpx;
  298. }
  299. }
  300. }
  301. }
  302. </style>