优化 门禁钥匙绑定

This commit is contained in:
wuxw 2020-01-02 12:01:50 +08:00
parent 1af09dd304
commit bcc9d11005
3 changed files with 63 additions and 8 deletions

View File

@ -14,18 +14,22 @@ Page({
communityId:'',
showTypeCd:false,
typeCdList: ['业主', '家庭成员','租客'],
typeCd:0,
typeCdName:'业主',
age:null,
sex:'男',
sexList:['男','女'],
showSex:false,
showExpiry: false,
expiryList:['一个月','半年','一年'],
photoList:[],
name:'',
age: null,
sex: '男',
typeCd: 0,
idCard:'',
startTime: null,
photos:[],
photoList:[]
endTime:null,
tel:'',
photos: [],
},
/**
@ -33,6 +37,16 @@ Page({
*/
onLoad: function (options) {
let _that = this;
context.getOwner(function(_owner){
_that.setData({
name:_owner.appUserName,
idCard:_owner.idCard,
tel:_owner.link
});
});
this.setData({
locations: JSON.parse(options.locations),
communityId: options.communityId
@ -206,5 +220,38 @@ Page({
},
removePhoto:function(e){
console.log(e.detail.index);
},
saveApplicationKey:function(){
//保存钥匙信息
console.log(this.data);
let _objData = {
name: this.data.name,
age: this.data.age,
sex: this.data.sex,
typeCd: this.data.typeCd,
idCard: this.data.idCard,
startTime: this.data.startTime,
endTime: this.data.endTime,
tel: this.data.tel,
photos: this.data.photos,
};
let msg = '';
if(_objData.name == ''){
msg = '请填写名称';
}
if (_objData.age == null){
msg = "请填写年龄"
}
if (_objData.sex == null) {
msg = "请选择性别"
}
if (_objData.typeCd == null) {
msg = "请选择身份"
}
if (_objData.idCard == null) {
msg = "请填写身份证"
}
}
})

View File

@ -25,13 +25,16 @@
<view class="aku_photo_view">
<van-uploader file-list="{{ photoList }}" max-count="2" bind:after-read="afterRead" bind:delete="removePhoto" />
<view>
<text>请上传身份证正反面</text>
</view>
</view>
<view class="button_up_blank"></view>
<van-button type="primary" size="large" catchtap="bindOwner">提交申请</van-button>
<van-button type="primary" size="large" catchtap="saveApplicationKey">提交申请</van-button>
<view class="button_up_blank"></view>
<van-popup show="{{ showTypeCd }}" position="bottom" custom-style="height: 40%;">

View File

@ -12,6 +12,11 @@
.aku_photo_view{
background-color: #FFF;
height: 200rpx;
height: 250rpx;
padding: 40rpx 0 40rpx 40rpx;
}
.aku_photo_view text{
font-size: 30rpx;
color: #8a8a8a
}