2 Commits

Author SHA1 Message Date
  longjieli 19845825dc 新增人脸识别页面 4 months ago
  longjieli a1b5d7b370 新增人脸识别页面 4 months ago
8 changed files with 233 additions and 6 deletions
Split View
  1. +1
    -1
      manifest.json
  2. +23
    -0
      pages.json
  3. +149
    -0
      pages/human/human.vue
  4. +60
    -5
      pages/index/index.vue
  5. BIN
      static/image/human/icon1.png
  6. BIN
      static/image/human/icon2.png
  7. BIN
      static/image/human/icon3.png
  8. BIN
      static/image/human/img.png

+ 1
- 1
manifest.json View File

@ -52,7 +52,7 @@
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "wxe7ae8cbe1673834c",
"appid" : "wxf7152f59d366236b",
"setting" : {
"urlCheck" : false
},


+ 23
- 0
pages.json View File

@ -11,6 +11,29 @@
"style": {
"navigationBarTitleText": "我的"
}
<<<<<<< HEAD
},
{
"path": "pages/record/record",
"style": {
"navigationBarTitleText": "打卡记录"
}
},
{
"path" : "pages/autonym/autonym",
"style" :
{
"navigationBarTitleText" : ""
}
},
{
"path" : "pages/human/human",
"style" :
{
"navigationBarTitleText" : ""
}
=======
>>>>>>> 260f70e59eebfa09281d5d57173337efd210e7dc
}
],
"preloadRule": {


+ 149
- 0
pages/human/human.vue View File

@ -0,0 +1,149 @@
<!-- 人脸识别 -->
<template>
<view class="human-face">
<!-- 自定义导航栏 -->
<uni-nav-bar dark :fixed="true" shadow background-color="var(--main-color)" status-bar left-icon="left"
title="人脸识别" @clickLeft="toHome" />
<!-- 人脸识别说明标题 -->
<view class="human-face-title">为保证本人操作请进行人脸验证</view>
<!-- 人脸识别图片 -->
<view class="human-face-img">
<image src="@/static/image/human/img.png" mode="widthFix"></image>
</view>
<!-- 人脸识别说明 -->
<view class="human-face-desc">
人脸认证仅能由<text class="name">*</text>本人完成验证时请将镜头对准您的脸部
</view>
<!-- 说明 -->
<view class="desc">
<view class="desc-item">
<image src="@/static/image/human/icon1.png" mode="widthFix"></image>
<view class="text">避免遮挡</view>
</view>
<view class="desc-item">
<image src="@/static/image/human/icon2.png" mode="widthFix"></image>
<view class="text">光线充足</view>
</view>
<view class="desc-item">
<image src="@/static/image/human/icon3.png" mode="widthFix"></image>
<view class="text">正对充足</view>
</view>
</view>
<!-- 立即核验 -->
<div @click="photo" class="btn">
立即核验
</div>
</view>
</template>
<script>
export default {
name: "HumanFace",
data() {
return {
}
},
methods: {
//
toHome() {
uni.navigateTo({
url: "/pages/index/index"
})
},
//
photo() {
uni.chooseImage({
count: 1, //9
sizeType: ['original', 'compressed'], //
sourceType: ['camera '], //
success: function(res) {
console.log(JSON.stringify(res.tempFilePaths));
}
});
}
}
}
</script>
<style lang="scss" scoped>
.human-face {
min-height: 100vh;
background: white;
//
.human-face-title {
font-size: 35rpx;
font-weight: bold;
margin: 60rpx 0rpx;
text-align: center;
}
//
.human-face-img {
display: flex;
justify-content: center;
image {
width: 70%;
}
}
//
.human-face-desc {
color: #707070;
width: 55%;
font-size: 30rpx;
margin: 30rpx auto;
text-align: center;
.name {
color: $main-color;
}
}
//
.desc {
width: 80%;
display: flex;
flex-wrap: wrap;
margin: 100rpx auto;
.desc-item {
width: 33.33%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
image {
width: 50%;
}
.text {
font-size: 30rpx;
color: #707070;
margin-top: 10rpx;
}
}
}
//
.btn {
display: flex;
align-items: center;
justify-content: center;
width: 83%;
background: $main-color;
color: white;
height: 100rpx;
border-radius: 50rpx;
margin: 0rpx auto;
}
}
</style>

+ 60
- 5
pages/index/index.vue View File

@ -16,14 +16,14 @@
</view>
</view>
<view class="map">
<map style="width: 100%; height: 100%" :latitude="latitude" :longitude="longitude" :markers="covers">
<map style="width: 100%; height: 100%" :latitude="latitude" :longitude="longitude" :markers="covers" :scale="18">
</map>
</view>
</view>
<!-- 打卡按钮 -->
<view class="punch-card">
<view class="circle">
<view @click="callCard" class="circle">
<view class="title">拍照打卡</view>
<view class="time">2021-10-10 10:00:00</view>
</view>
@ -91,18 +91,73 @@
self.longitude = res.longitude;
self.latitude = res.latitude;
self.covers.push({
id : 1,
id: 1,
latitude: res.latitude,
longitude: res.longitude,
iconPath: '/static/image/home/location.png',
<<<<<<< HEAD
width: 30,
height: 30
=======
width : 38,
height : 30,
>>>>>>> 260f70e59eebfa09281d5d57173337efd210e7dc
})
console.log('当前位置的经度:' + res.longitude);
console.log('当前位置的纬度:' + res.latitude);
},
fail() {
self.checkAndRequestLocationPermission()
}
});
},
checkAndRequestLocationPermission() {
let self = this;
uni.getSetting({
success: function(res) {
if (!res.authSetting['scope.userLocation']) {
//
uni.showModal({
title: '提示',
content: '当前定位未开启,请点击确定手动开启定位',
success: function(modalRes) {
if (modalRes.confirm) {
//
uni.openSetting({
success: function(settingRes) {
if (settingRes.authSetting[
'scope.userLocation']) {
//
self.getLocation();
} else {
//
console.log('用户未开启定位权限');
}
},
fail: function(err) {
console.log('打开设置页面失败:', err);
}
});
} else {
//
self.getLocation()
}
}
});
} else {
//
console.log('用户已授权定位权限,但获取位置失败');
//
}
}
});
},
//()
callCard(){
uni.navigateTo({
url: "/pages/human/human"
})
}
}
}


BIN
static/image/human/icon1.png View File

Before After
Width: 276  |  Height: 276  |  Size: 14 KiB

BIN
static/image/human/icon2.png View File

Before After
Width: 274  |  Height: 274  |  Size: 14 KiB

BIN
static/image/human/icon3.png View File

Before After
Width: 273  |  Height: 273  |  Size: 12 KiB

BIN
static/image/human/img.png View File

Before After
Width: 1338  |  Height: 1338  |  Size: 124 KiB

Loading…
Cancel
Save