开发完成钥匙申请功能

This commit is contained in:
wuxw 2020-01-02 23:53:20 +08:00
parent 2f9de6a7a5
commit a727f90eaf
5 changed files with 106 additions and 18 deletions

View File

@ -75,8 +75,7 @@
"van-uploader": "lib/uploader/index",
"van-row": "lib/row/index",
"van-col": "lib/col/index",
"van-datetime-picker": "lib/datetime-picker/index",
"van-image": "lib/image/index"
"van-datetime-picker": "lib/datetime-picker/index"
},
"sitemapLocation": "sitemap.json"

View File

@ -39,8 +39,12 @@ const queryAppUserBindingOwner = baseUrl + 'app/owner.listAppUserBindingOwners';
//查询业主门禁
const listOwnerMachines = baseUrl + 'app/owner.listOwnerMachines';
// 申请钥匙
const applyApplicationKey = baseUrl +"app/applicationKey.applyApplicationKey";
//查询钥匙
const listApplicationKeys = baseUrl +"applicationKey.listApplicationKeys";
module.exports = {
baseUrl: baseUrl,
@ -56,5 +60,6 @@ module.exports = {
listComplaints: listComplaints,
appUserUnBindingOwner: appUserUnBindingOwner,
listOwnerMachines: listOwnerMachines,
applyApplicationKey: applyApplicationKey
applyApplicationKey: applyApplicationKey,
listApplicationKeys: listApplicationKeys
};

View File

@ -3,6 +3,7 @@
const context = require('../../context/Java110Context.js');
const util = context.util;
const factory = context.factory;
const constant = context.constant;
Page({
@ -234,9 +235,17 @@ Page({
startTime: this.data.startTime,
endTime: this.data.endTime,
tel: this.data.tel,
photos: this.data.photos,
msgCode: this.data.msgCode
photos: [],
msgCode: this.data.msgCode,
communityId: this.data.communityId,
machineIds:[],
typeFlag:'1100102'
};
let _photos = this.data.photos;
_photos.forEach(function (_item) {
_objData.photos.push({ "photo": _item });
});
let msg = '';
if(_objData.name == ''){
msg = '请填写名称';
@ -271,6 +280,10 @@ Page({
msg = "请填写验证码"
}
if (this.data.locations == null || this.data.locations.length <1){
msg = "没有设备可申请钥匙";
}
if(msg != ''){
wx.showToast({
title: msg,
@ -279,6 +292,12 @@ Page({
});
return ;
}
this.data.locations.forEach(function(_item){
_objData.machineIds.push({"machineId":_item.machineId});
});
console.log(_objData);
@ -292,7 +311,7 @@ Page({
if(res.resultCode == 200){
//成功情况下跳转
wx.redirectTo({
url: "/pages/viewApplicationKeyUser/viewApplicationKeyUser"
url: "/pages/viewApplicationKeyUser/viewApplicationKeyUser?idCard=" + _objData.idCard
});
return ;
}

View File

@ -22,20 +22,26 @@ Page({
desc: ''
}
],
active:0,
applicationKeyId:'',
name:'',
age:0,
sex:'',
typeCdName:'',
idCard:'',
expiry:'',
startTime:null,
endTime: null,
tel:'',
photoList:[]
stateName:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
idCard: options.idCard
});
},
@ -86,5 +92,70 @@ Page({
*/
onShareAppMessage: function () {
},
loadApplicationKey:function(){
let _that = this;
let _objData = {
page : 1,
row : 1,
idCard : this.data.idCard
}
context.request({
url: constant.url.listApplicationKeys,
header: context.getHeaders(),
method: "GET",
data: _objData, //动态数据
success: function (res) {
console.log(res);
if (res.resultCode == 200) {
//成功情况下跳转
let _applicationKeys = res.data.applicationKeys;
if (_applicationKeys.length == 0){
wx.showToast({
title: "未查询到钥匙",
icon: 'none',
duration: 2000
});
return ;
}
let _applicationKey = _applicationKeys[0];
let _active = '0';
if (_applicationKey.state == '10001'){
_active = '2';
} else if (_applicationKey.state == '10002') {
_active = '2';
}else{
_active = '1';
}
_that.setData({
applicationKeyId: _applicationKey.applicationKeyId,
name: _applicationKey.name,
age: _applicationKey.age,
sex: _applicationKey.sex,
typeCdName: _applicationKey.typeCd,
idCard: _applicationKey.idCard,
startTime: _applicationKey.startTime,
endTime: _applicationKey.endTime,
tel: _applicationKey.tel,
active: _active,
stateName: stateName
});
}
},
fail: function (e) {
wx.showToast({
title: "服务器异常了",
icon: 'none',
duration: 2000
})
}
});
}
})

View File

@ -5,6 +5,8 @@
/>
<view class="block__title">业主信息</view>
<van-cell-group>
<van-cell title="申请编码" value="{{applicationKeyId}}" />
<van-cell title="状态" value="{{stateName}}" />
<van-cell title="姓名" value="{{name}}" />
<van-cell title="年龄" value="{{age}}" />
<van-cell title="性别" value="{{sex}}" />
@ -14,17 +16,9 @@
<van-cell-group>
<van-cell title="身份" value="{{typeCdName}}" />
<van-cell title="身份证" value="{{idCard}}" />
<van-cell title="有效期" value="{{expiry}}" />
<van-cell title="开始时间" value="{{startTime}}" />
<van-cell title="结束时间" value="{{endTime}}" />
<van-cell title="手机号" value="{{tel}}" />
</van-cell-group>
<view class="block__title">证件照片</view>
<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>
</text>