优化代码

This commit is contained in:
Your Name 2023-01-11 00:10:45 +08:00
parent b8b4fd6c54
commit 34cc6bb6da
7 changed files with 144 additions and 1 deletions

View File

@ -133,6 +133,8 @@ export function getUserAddress(_data) {
}) })
} }
/** /**
* add by wuxw * add by wuxw
* @param {Object} _data 保存 用户地址 * @param {Object} _data 保存 用户地址
@ -280,3 +282,25 @@ export function hasOwner() {
throw new Error('业主不存在'); throw new Error('业主不存在');
} }
} }
export function loadLoginOwner(_data) {
return new Promise((resolve, reject) => {
let moreRooms = [];
request({
url: url.queryCurrentOwner,
method: "GET",
data: _data, //动态数据
success: function(res) {
let _data = res.data;
if (_data.code == 0) {
resolve(_data.data);
return;
}
reject(_data.msg);
},
fail: function(e) {
reject(e);
}
});
})
}

View File

@ -134,6 +134,11 @@
src: this.imgUrl + '/h5/images/serve/8.png', src: this.imgUrl + '/h5/images/serve/8.png',
href: '/pages/machine/openDoor' href: '/pages/machine/openDoor'
}, },
// {
// name: '',
// src: this.imgUrl + '/h5/images/serve/8.png',
// href: '/pages/machine/faceRecognition'
// },
] ]
}, },
to: function(v) { to: function(v) {

View File

@ -187,7 +187,7 @@ export default {
listProductSeckill: baseUrl + "app/productSeckill.listProductSeckill", listProductSeckill: baseUrl + "app/productSeckill.listProductSeckill",
listProductGroup: baseUrl + "app/productGroup.listProductGroup", listProductGroup: baseUrl + "app/productGroup.listProductGroup",
listRegisterProtocol: baseUrl + "app/system.listRegisterProtocol", listRegisterProtocol: baseUrl + "app/system.listRegisterProtocol",
queryCurrentOwner: baseUrl + "app/owner.queryCurrentOwner",
NEED_NOT_LOGIN_PAGE: [ NEED_NOT_LOGIN_PAGE: [
'pages/login/login', 'pages/login/login',

View File

@ -712,6 +712,15 @@
} }
} }
,{
"path" : "pages/machine/faceRecognition",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
], ],
"tabBar": { "tabBar": {
"color": "#272636", "color": "#272636",

View File

@ -0,0 +1,105 @@
<template>
<view>
<view class="face-top" v-if="hasFace == 'N'">
<view>
<image src="/static/images/noface.png"></image>
</view>
<view class="face-desc">
<text>您尚未进行人脸识别认证请联系物业公司</text>
</view>
</view>
<view class="face-top" v-else>
<view>
<image src="/static/images/hasface.png"></image>
</view>
<view class="face-desc">
<text>您已通过人脸识别认证请放心使用</text>
</view>
</view>
<view class="face-tel">
<view v-if="property.communityQrCode"><image class="call-qrcode" :src="property.communityQrCode"></image></view>
<view class="bg-white face-tel-text">您确认拨打,{{property.communityName}}物业客服电话<br />{{property.sCommunityTel}}</view>
</view>
</view>
</template>
<script>
import {
getProperty
} from '../../api/property/propertyApi.js';
import {
hasOwner,
loadLoginOwner
} from '../../api/owner/ownerApi.js';
import{
getCommunityId
} from '../../api/community/communityApi.js'
export default {
data() {
return {
property: {},
hasFace:'N',
faceSpecCd:'1234567'
}
},
onLoad() {
hasOwner();
let _that = this;
uni.getStorage({
key: 'ownerInfo',
success: function(res) {
_that.property = res.data;
}
});
this._loadCurrentOwner();
},
methods: {
_loadCurrentOwner:function(){
let _that = this;
loadLoginOwner({
communityId:getCommunityId()
}).then(_owner=>{
let _attrs = _owner.ownerAttrDtos;
_attrs.forEach(item=>{
if(item.specCd == _that.faceSpecCd){
_that.hasFace = item.value;
}
})
})
}
}
}
</script>
<style lang="scss">
.face-top{
padding:10upx;
image{
height: 380upx;
}
.face-desc{
font-size: 32upx;
text-align: center;
color: orangered;
line-height: 90upx;
}
}
.face-tel{
padding-left:10upx;
padding-right:10upx;
text-align: center;
image{
height: 500upx;
width: 500upx;
}
.face-tel-text{
margin-top:20upx;
padding-top: 40upx;
padding-bottom: 40upx;
font-size: 32upx;
}
}
</style>

BIN
static/images/hasface.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
static/images/noface.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB