【PT.SCC实名制管理系统】24.10.01 -30天,考勤打卡小程序
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.

148 lines
3.0 KiB

  1. <!-- 人脸识别 -->
  2. <template>
  3. <view class="human-face">
  4. <!-- 自定义导航栏 -->
  5. <uni-nav-bar dark :fixed="true" shadow background-color="var(--main-color)" status-bar left-icon="left"
  6. title="人脸识别" @clickLeft="toHome" />
  7. <!-- 人脸识别说明标题 -->
  8. <view class="human-face-title">为保证本人操作请进行人脸验证</view>
  9. <!-- 人脸识别图片 -->
  10. <view class="human-face-img">
  11. <image src="@/static/image/human/img.png" mode="widthFix"></image>
  12. </view>
  13. <!-- 人脸识别说明 -->
  14. <view class="human-face-desc">
  15. 人脸认证仅能由<text class="name">*</text>本人完成验证时请将镜头对准您的脸部
  16. </view>
  17. <!-- 说明 -->
  18. <view class="desc">
  19. <view class="desc-item">
  20. <image src="@/static/image/human/icon1.png" mode="widthFix"></image>
  21. <view class="text">避免遮挡</view>
  22. </view>
  23. <view class="desc-item">
  24. <image src="@/static/image/human/icon2.png" mode="widthFix"></image>
  25. <view class="text">光线充足</view>
  26. </view>
  27. <view class="desc-item">
  28. <image src="@/static/image/human/icon3.png" mode="widthFix"></image>
  29. <view class="text">正对充足</view>
  30. </view>
  31. </view>
  32. <!-- 立即核验 -->
  33. <div @click="photo" class="btn">
  34. 立即核验
  35. </div>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. name: "HumanFace",
  41. data() {
  42. return {
  43. }
  44. },
  45. methods: {
  46. //返回首页
  47. toHome() {
  48. uni.navigateTo({
  49. url: "/pages/index/index"
  50. })
  51. },
  52. // 人脸认证通过后拍照
  53. photo() {
  54. uni.chooseImage({
  55. count: 1, //默认9
  56. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  57. sourceType: ['camera '], //从相册选择
  58. success: function(res) {
  59. console.log(JSON.stringify(res.tempFilePaths));
  60. }
  61. });
  62. }
  63. }
  64. }
  65. </script>
  66. <style lang="scss" scoped>
  67. .human-face {
  68. min-height: 100vh;
  69. background: white;
  70. // 人脸识别说明标题
  71. .human-face-title {
  72. font-size: 35rpx;
  73. font-weight: bold;
  74. margin: 60rpx 0rpx;
  75. text-align: center;
  76. }
  77. // 人脸识别图片
  78. .human-face-img {
  79. display: flex;
  80. justify-content: center;
  81. image {
  82. width: 70%;
  83. }
  84. }
  85. // 人脸识别说明
  86. .human-face-desc {
  87. color: #707070;
  88. width: 55%;
  89. font-size: 30rpx;
  90. margin: 30rpx auto;
  91. text-align: center;
  92. .name {
  93. color: $main-color;
  94. }
  95. }
  96. // 说明
  97. .desc {
  98. width: 80%;
  99. display: flex;
  100. flex-wrap: wrap;
  101. margin: 100rpx auto;
  102. .desc-item {
  103. width: 33.33%;
  104. display: flex;
  105. flex-direction: column;
  106. align-items: center;
  107. justify-content: center;
  108. image {
  109. width: 50%;
  110. }
  111. .text {
  112. font-size: 30rpx;
  113. color: #707070;
  114. margin-top: 10rpx;
  115. }
  116. }
  117. }
  118. // 立即核验
  119. .btn {
  120. display: flex;
  121. align-items: center;
  122. justify-content: center;
  123. width: 83%;
  124. background: $main-color;
  125. color: white;
  126. height: 100rpx;
  127. border-radius: 50rpx;
  128. margin: 0rpx auto;
  129. }
  130. }
  131. </style>