Browse Source

居民编辑回填,验证密码功能实现

work_tab_bar
mk 2 years ago
parent
commit
144da9eb21
  1. 23
      subpages/addResi/pages/addResi/addResi.js
  2. 10
      subpages/addResi/pages/addResi/addResi.wxml
  3. 49
      subpages/searchResult/pages/punchCard/punchCard.js
  4. 4
      subpages/searchResult/pages/punchCard/punchCard.json
  5. 17
      subpages/searchResult/pages/punchCard/punchCard.wxml
  6. 4
      subpages/searchResult/pages/punchCard/punchCard.wxss
  7. 11
      utils/api.js

23
subpages/addResi/pages/addResi/addResi.js

@ -697,6 +697,12 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: async function (options) {
if(options.type === 'edit'){
this.setData({
resiId:options.resiId
})
this.userXiangQ(options)
}
this.setData({
agencyId: app.globalData.user.agencyId,
'form.resideInfoDtos[0].agencyId': app.globalData.user.agencyId,
@ -1165,7 +1171,7 @@ Page({
const selectedIndex = e.detail.value;
const selectedVillage = this.data.dicts.nationalityList[selectedIndex]
this.setData({
nationalityName: selectedVillage.label,
'form.baseInfoDto.nationalityName': selectedVillage.label,
'form.baseInfoDto.nationality': selectedVillage.value
})
},
@ -1176,7 +1182,7 @@ Page({
},
bindPickerChangeGender(e) {
this.setData({
genderName: this.data.dicts.genderList[e.detail.value].label,
'form.baseInfoDto.genderName': this.data.dicts.genderList[e.detail.value].label,
"form.baseInfoDto.gender": this.data.dicts.genderList[e.detail.value].value
})
},
@ -1449,5 +1455,18 @@ Page({
}
})
console.log(this.data.form);
},
//**编辑回填逻辑 start*/
userXiangQ(option){
api.userXiangQ(this.data.resiId).then(res=>{
this.setData({
form:res.data,
"form.baseInfoDto.name":option.name,
"form.baseInfoDto.idNum":option.idNum,
"form.baseInfoDto.mobile":option.mobile,
})
}).catch(err=>{
console.log(err);
})
}
})

10
subpages/addResi/pages/addResi/addResi.wxml

@ -208,8 +208,8 @@
</view>
<view class="input">
<picker bindchange="bindPickerChangeNationality" range-key="label" value="{{index}}" range="{{dicts.nationalityList}}">
<view class="{{nationalityName?'':'gray'}}">
{{nationalityName ? nationalityName : '请选择'}}
<view class="{{form.baseInfoDto.nationalityName?'':'gray'}}">
{{form.baseInfoDto.nationalityName ? form.baseInfoDto.nationalityName : '请选择'}}
</view>
</picker>
<image src="../../../../images/right.png" mode="" />
@ -223,7 +223,7 @@
<view class="title">联系电话</view>
</view>
<view class="input">
<input confirm-type="next" bindblur="bindMobileInput" bindinput="bindmobileInput" value="{{form.mobile}}" placeholder-class="gray" placeholder="请输入" />
<input confirm-type="next" bindblur="bindMobileInput" bindinput="bindmobileInput" value="{{form.baseInfoDto.mobile}}" placeholder-class="gray" placeholder="请输入" />
</view>
</view>
@ -235,8 +235,8 @@
</view>
<view class="input">
<picker bindchange="bindPickerChangeGender" range-key="label" value="{{index}}" range="{{dicts.genderList}}">
<view class="{{genderName?'':'gray'}}">
{{genderName ? genderName : '请选择'}}
<view class="{{form.baseInfoDto.genderName?'':'gray'}}">
{{form.baseInfoDto.genderName ? form.baseInfoDto.genderName : '请选择'}}
</view>
</picker>
<image src="../../../../images/right.png" mode="" />

49
subpages/searchResult/pages/punchCard/punchCard.js

@ -2,6 +2,7 @@
import api from "../../../../utils/api"
var http = require('../../../../utils/request.js')
const QQMapWX = require('../../../../utils/qqmap-wx-jssdk')
import { $wuxDialog } from '../../../../components/dist/index'
const app = getApp()
var timerId = null;
Page({
@ -10,6 +11,7 @@ Page({
* 页面的初始数据
*/
data: {
checkPassword:true,
form: {},
resiId: "",
punchFlag: null,
@ -555,20 +557,23 @@ Page({
label:"复婚",
value:'fuhun'
}
]
],
password:'Makui240345'
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log(options);
this.updateTime();
timerId = setInterval(this.updateTime, 1000);
console.log(timerId);
if (options.resiId) {
this.setData({
resiId: options.resiId
resiId: options.resiId,
'form.baseInfoDto.name':options.name,
'form.baseInfoDto.idNum':options.idNum,
'form.baseInfoDto.mobile':options.mobile,
})
this.getResiInfo()
}
@ -753,8 +758,40 @@ Page({
})
},
toAddResi() {
wx.navigateTo({
url: `/subpages/addResi/pages/editResi/editResi?type=edit&resiId=${this.data.resiId}`,
this.setData({
checkPassword:true
})
},
bindPassword(e){
this.setData({
password:e.detail.value
})
},
onClosePassword(){
this.setData({
checkPassword:false
})
},
onConfirmassword(){
let parm = {
password:this.data.password
}
api.getResiUserInfo(this.data.resiId,parm).then(res=>{
if(res.code === 0){
wx.navigateTo({
url: `/subpages/addResi/pages/addResi/addResi?type=edit&resiId=${this.data.resiId}&name=${res.data.name}&mobile=${res.data.mobile}&idNum=${res.data.idNum}`,
})
this.setData({
password:null
})
}else{
this.setData({
password:null
})
this.showToast(res.msg)
}
}).catch(err=>{
console.log(err);
})
},
toWebView() {

4
subpages/searchResult/pages/punchCard/punchCard.json

@ -1,4 +1,6 @@
{
"usingComponents": {},
"usingComponents": {
"van-dialog": "@vant/weapp/dialog/index"
},
"navigationBarTitleText": "详情"
}

17
subpages/searchResult/pages/punchCard/punchCard.wxml

@ -1,6 +1,6 @@
<!--subpages/searchResult/pages/punchCard/punchCard.wxml-->
<!-- 基本信息 -->
<view class="card">
<view class="card">
<view class="top">
<view class="left">
<view class="name">
@ -31,7 +31,7 @@
</view>
<view class="tabs">
<view class="tab_item {{activeType === index ? 'border_bto' : ''}}" wx:for="{{tabList}}" bind:tap="handelClickTab" data-item="{{item}}" data-index="{{index}}" wx:key="index" wx:if="{{item.filledQty!=0}}">
{{item.name}} <text style="color:{{item.filledQty!==item.totalQty?'#f27225':'#1ebfb5'}}">({{ item.filledQty }}/{{ item.totalQty }})</text>
{{item.name}} <text style="color:{{item.filledQty!==item.totalQty?'#f27225':'#1ebfb5'}}">({{ item.filledQty }}/{{ item.totalQty }})</text>
</view>
</view>
</view>
@ -59,7 +59,7 @@
<view class="label">文化程度:</view>
<View class="value">{{form.eduInfoDto.cultureLevelName}}</View>
</view>
<view class="item">
<view class="label">性别:</view>
<View class="value">{{form.baseInfoDto.genderName}}</View>
@ -75,7 +75,7 @@
<view class="item">
<view class="label">婚姻状况:</view>
<View class="value"> {{marriageName}}</View>
</view>
<view class="item">
<view class="label">籍贯:</view>
@ -110,7 +110,12 @@
<view class="bto_btn">
<button class="btn" hover-class="blue" bind:tap="toEvent">上报诉求</button>
<button class="btn" hover-class="blue" bind:tap="toWebView" wx:if="{{agencyLevel!=='street'}}">
满意度调查</button>
满意度调查</button>
<!-- -->
<button class="btn blue">走访打卡</button>
</view>
</view>
<van-dialog use-slot title="密码验证" show="{{ checkPassword }}" show-cancel-button bind:close="onClosePassword" bind:confirm="onConfirmassword" custom-class="dialog" confirm-button-color="#3974f6">
<view>
<input type="text" bind:input="bindPassword" bind:blur="bindPassword" value="{{password}}" placeholder="请输入密码" password />
</view>
</van-dialog>

4
subpages/searchResult/pages/punchCard/punchCard.wxss

@ -232,4 +232,8 @@ page {
background: #fff;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
.dialog{
padding: 0 20rpx;
box-sizing: border-box;
}

11
utils/api.js

@ -64,7 +64,8 @@ module.exports = {
updateEvent,
submitResi,
getAllOrgCategoryCount,
getResiInfo
getResiInfo,
userXiangQ
}
// 获取公钥
@ -266,12 +267,11 @@ function getCheckLogList(parm) {
function getLastLog(parm) {
return fly.get(`actual/base/clockRecords/lastLog`, parm)
}
// 获取居民敏信息
function getResiUserInfo(id) {
return fly.post(`actual/base/residentBaseInfo/getResiUserInfo/${id}`)
// 获取居民敏信息
function getResiUserInfo(id,parm) {
return fly.post(`actual/base/residentBaseInfo/getResiUserInfo/${id}`,parm)
}
/// 获取居民档案
function getPersonalFile(parm) {
return fly.post(`actual/base/peopleRoomOverview/getPersonalFile?resid=` + parm.resid)
@ -343,3 +343,4 @@ function getAllOrgCategoryCount(parm) {
return fly.get(`actual/base/streetOverview/allOrgCategoryCount`,parm)
}

Loading…
Cancel
Save