Commit 966c08f6 authored by renjie's avatar renjie

扫脸

parent b85f10e6
......@@ -61,28 +61,35 @@
</u-waterfall>
</view>
</view>
<u-mask :show="showtip" >
<view class="mask">
<view class="img-box">
<image src="../../static/img/album/postcardTip.png" mode="aspectFit"></image>
<u-icon class="close" name="close-circle" @click="showtip = false"></u-icon>
</view>
<u-button type="primary" shape="circle" @click="showtip = false">知道了</u-button>
</view>
</u-mask>
</view>
</template>
<script>
import UWaterfall from '@/uview-ui/components/u-waterfall/u-waterfall.vue'
import ULazyLoad from '@/uview-ui/components/u-lazy-load/u-lazy-load.vue'
import UMask from '@/uview-ui/components/u-mask/u-mask.vue'
export default {
components: {
UWaterfall,
ULazyLoad
ULazyLoad,
UMask
},
data() {
return {
showtip: false,//领取提示
statusBarHeight: 0,
capsule: 0,
navHeight: 0,
tabList: [
{id: 1, url: '../../static/img/coupon/coupon.jpg'},
],
activeList: [],
flowList: [],
list: [
{
title: '精彩瞬间',
......@@ -137,8 +144,23 @@ export default {
},
methods: {
jumpToScanFaceClick() {//---跳转扫脸页面
uni.navigateTo({
url: './getPortrait'
const openid = uni.getStorageSync('openid')
this.$request('wechatUser/pdFace/checkScanFace',{openid}).then(res => {//创建任务
if (res.code === '00') {
if(res.data.isScanFace === 0) {//未扫脸
uni.navigateTo({
url: './getPortrait'
})
}else if(res.data.isScanFace === 1) {//已扫脸
this.jumpToCustomClick()
}
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
jumpToCustomClick() {//---跳转旅拍定制页面
......@@ -148,9 +170,7 @@ export default {
},
jumpToClick(title) {
if(title === '精彩瞬间') {
uni.navigateTo({
url: './getPortrait'
})
this.jumpToScanFaceClick()
}
if(title === '网红旅拍') {
uni.navigateTo({
......@@ -165,7 +185,7 @@ export default {
}
},
onLoad(option) {
console.log(option)
if(option.tip === 'true') this.showtip = true
this.recordDeviceInfo()
}
}
......@@ -187,6 +207,11 @@ export default {
z-index: -1;
background: linear-gradient(to top, #f7f7f7, #f7f7f7 80%, transparent 100%);
}
/deep/.u-mask {
display: flex;
justify-content: center;
align-items: center;
}
}
.nav-bar {
font-size: 36rpx;
......@@ -247,7 +272,6 @@ export default {
}
}
.demo-water {
// margin-bottom: 16rpx;
/deep/.u-wrap,
/deep/.u-lazy-item {
broder-radius: 16rpx 16rpx 0 0 !important;
......@@ -295,4 +319,33 @@ export default {
}
}
}
.mask {
.img-box {
position: relative;
margin-bottom: 32rpx;
.close {
position: absolute;
top: -54rpx;
right: 24rpx;
color: #fff;
&::after {
position: absolute;
content: '';
top: 24rpx;
left: 50%;
transform: translateX(-50%);
width: 0;
height: 32rpx;
border-left: 1px dashed #fff;
}
}
}
image {
width: 504rpx;
height: 720rpx;
}
/deep/.u-btn {
width: 304rpx ;
}
}
</style>
\ No newline at end of file
......@@ -41,7 +41,7 @@ export default {
imgArr: [],//图片
value: true,
location: {},//位置信息
selected: ''
option: {},//路由传参
}
},
methods: {
......@@ -88,9 +88,12 @@ export default {
this.$request('scenic/newMerchant/findAllMerchant').then(res => {//创建任务
if (res.code === '00') {
if(!res.data.length) return
const index = res.data.findIndex(item => item.id === nearbyId)
this.companyArr = res.data
const id = this.option.merchantId || nearbyId
let index = res.data.findIndex(item => item.id === id)
this.index = index === -1 ? 0 : index
this.companyArr = res.data
this.getPic(this.companyArr[this.index].id)
}else{
uni.showToast({
......@@ -138,22 +141,29 @@ export default {
})
}
},
onLoad() {
uni.getLocation({
onLoad(option) {
this.option = option
this.recordDeviceInfo()
uni.getLocation({//获取定位
type: 'wgs84',
success: res => {
this.location = res
uni.setStorageSync('location', JSON.stringify(res))
this.getNearByCompany()
if(this.option.merchantId) {//扫码进入则直接加载景区列表,默认显示传入的景区
this.getCompany()
}else {//否则获取并显示距离最近的景点
this.getNearByCompany()
}
},
fail() {
this.getCompany()
uni.showToast({
title: '获取经纬度失败',
icon: 'none'
})
}
})
this.recordDeviceInfo()
}
}
</script>
......
......@@ -55,6 +55,8 @@ export default {
base64: '', //照片base64
maskShow: false,//弹窗显示
maskCount: 3,//弹窗倒计时
queryData: {},//查询参数
defaultBrightness: 0.5,//屏幕亮度
}
},
methods: {
......@@ -68,7 +70,7 @@ export default {
scope: 'scope.camera',
success: (res) => {
console.log('已打开摄像头权限')
this.takePhoto()
this.getQueryField()
},
fail: (res) => {
uni.showModal({
......@@ -80,7 +82,7 @@ export default {
uni.openSetting({
success: (res) => {
console.log(res)
this.takePhoto()
this.getQueryField()
},
fail: (err) => {
console.log(err)
......@@ -125,31 +127,39 @@ export default {
}
})
},
getQueryField() {//---获取查询参数
const merchantId = uni.getStorageSync('merchantId')
this.$request('scenic/albumConfig/getAlbumConfig',{merchantId}).then(res => {//创建任务
if (res.code === '00') {
this.queryData = res.data
this.takePhoto()
}else{
uni.showToast({
title: '查询参数获取失败',
icon: 'none'
})
}
})
},
query() { //人脸查询
uni.showLoading({
title: '人脸识别中'
})
let data = {
openid: uni.getStorageSync('openid'), //openid
bucketName: 'a124Jj6IYiSzCjVV', //
dbName: uni.getStorageSync('openid'), //
uri: this.base64, //人脸图片base64编码
...this.queryData
}
this.$request('wechatUser/aliFace/faceSearch',data).then(res => {//创建任务
uni.hideLoading()
if (res.code === '00') {
uni.setScreenBrightness({
value: this.defaultBrightness, //屏幕亮度值,范围 0~1,0 最暗,1 最亮
})
uni.navigateTo({
url: './myPhotoAlbum/myPhotoAlbum'
})
uni.showModal({
title: '提示',
content: '视频合成中,请在1~2分钟后在我的VLOG视频集中查看',
showCancel:false,
success() {
// uni.navigateTo({
// url:'../vlogIndex/vlogIndex'
// })
}
})
}else{
this.maskShow = true
var loop = setInterval(() => {
......@@ -161,18 +171,11 @@ export default {
uni.navigateBack({
delta: 1
})
uni.setScreenBrightness({
value: this.defaultBrightness, //屏幕亮度值,范围 0~1,0 最暗,1 最亮
})
}
},1000)
// uni.showModal({
// title: '提示',
// content: '请先在打卡点录制素材',
// showCancel:false,
// success() {
// // uni.navigateTo({
// // url:'../vlogIndex/vlogIndex'
// // })
// }
// })
}
})
},
......@@ -194,7 +197,7 @@ export default {
filePath: res.tempImagePath, //选择图片返回的相对路径
encoding: 'base64', //编码格式
success: res => { //成功的回调
this.base64 = 'data:image/jpeg;base64,' + res.data
this.base64 = res.data
this.query()
}
})
......@@ -203,9 +206,6 @@ export default {
}
}, 1000)
},
initdone(){//相机初始化完成自动开始拍照
this.takePhoto()
},
error(e) { //相机报错
uni.showModal({
title: '提示',
......@@ -216,11 +216,16 @@ export default {
},
onLoad() {
this.recordDeviceInfo()
uni.getScreenBrightness({//获取屏幕亮度
success(res) {
this.defaultBrightness = res.value
},
fail() {
this.defaultBrightness = 0.5//如果获取失败设置亮度为中间值
}
})
uni.setScreenBrightness({
value: 1, //屏幕亮度值,范围 0~1,0 最暗,1 最亮
success: function() {
console.log('ScreenBrightness success')
}
})
this.openCamera()
}
......
static/img/album/face-screen.png

522 Bytes | W: | H:

static/img/album/face-screen.png

1.01 KB | W: | H:

static/img/album/face-screen.png
static/img/album/face-screen.png
static/img/album/face-screen.png
static/img/album/face-screen.png
  • 2-up
  • Swipe
  • Onion skin
static/img/album/no-shelter.png

1.6 KB | W: | H:

static/img/album/no-shelter.png

3.63 KB | W: | H:

static/img/album/no-shelter.png
static/img/album/no-shelter.png
static/img/album/no-shelter.png
static/img/album/no-shelter.png
  • 2-up
  • Swipe
  • Onion skin
static/img/album/will-lit.png

893 Bytes | W: | H:

static/img/album/will-lit.png

1.84 KB | W: | H:

static/img/album/will-lit.png
static/img/album/will-lit.png
static/img/album/will-lit.png
static/img/album/will-lit.png
  • 2-up
  • Swipe
  • Onion skin
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment