This commit is contained in:
shidongli 2023-10-27 10:54:45 +08:00
parent ffa823345d
commit 6f3a696575
3 changed files with 11 additions and 9 deletions

View File

@ -37,12 +37,12 @@ export function registerdata(data) {
}) })
} }
// 获取当前注册居民 // 获取当前注册居民
export function getCurrentUser(openid) { export function getCurrentUser(openid, cityCode) {
return request({ return request({
url: `/applet/register/getList/${openid}`, url: `/applet/register/getCurrentResident/${openid}/${cityCode}`,
method: 'GET', method: 'GET',
header: { header: {
// Authorization: 'Bearer' + ' ' + uni.getStorageSync('token') Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
}, },
}) })
} }

View File

@ -211,13 +211,12 @@
familyList: {}, // familyList: {}, //
userinfo: {}, // userinfo: {}, //
valueopenid: '', valueopenid: '',
cityCode:'',
}; };
}, },
onShow() { onShow() {
// this.bjimg = baseurl + '/profile/appletPicture/inviteFriendsOne.png' // this.bjimg = baseurl + '/profile/appletPicture/inviteFriendsOne.png'
let that = this let that = this
that.userinfo = uni.getStorageSync('userinfo') that.userinfo = uni.getStorageSync('userinfo')
@ -225,6 +224,7 @@
that.baseurl = baseurl that.baseurl = baseurl
const value = uni.getStorageSync('patientId'); const value = uni.getStorageSync('patientId');
this.valueopenid = uni.getStorageSync('openid'); this.valueopenid = uni.getStorageSync('openid');
this.cityCode=uni.getStorageSync('region');
if (value) { if (value) {
that.myInfo() that.myInfo()
} else { } else {
@ -268,7 +268,7 @@
}, },
// //
getpersnoal() { getpersnoal() {
getCurrentUser(this.valueopenid).then(res => { getCurrentUser(this.valueopenid,this.cityCode).then(res => {
console.log(res) console.log(res)
this.familyList = res.data this.familyList = res.data
@ -538,4 +538,4 @@
<style lang="scss"> <style lang="scss">
@import './myinformation.scss' @import './myinformation.scss'
</style> </style>

View File

@ -285,7 +285,7 @@
sex: '', sex: '',
sexname: '', sexname: '',
birthDate: '', birthDate: '',
cityCode: '1', cityCode: '',
householdCardNo:'', householdCardNo:'',
householdRelationship:'', householdRelationship:'',
}, },
@ -374,6 +374,8 @@
console.log(this.query) console.log(this.query)
var that = this var that = this
that.query.openid = uni.getStorageSync('openid'); that.query.openid = uni.getStorageSync('openid');
that.query.cityCode = uni.getStorageSync('region');
if (that.query.sexname == '男') { if (that.query.sexname == '男') {
that.query.sex = 'MALE'; that.query.sex = 'MALE';
} else if (that.query.sexname == '女') { } else if (that.query.sexname == '女') {
@ -407,7 +409,7 @@
} else { } else {
registerdata(that.query).then(res => { registerdata(that.query).then(res => {
if (res.code == 200) { if (res.code == 200) {
getCurrentUser(that.query.openid, '1').then(res => { getCurrentUser(that.query.openid,that.query.cityCode).then(res => {
uni.setStorageSync('patientId', res.data.id); uni.setStorageSync('patientId', res.data.id);
uni.setStorageSync('patientName', res.data.patientName); uni.setStorageSync('patientName', res.data.patientName);
uni.setStorageSync("userinfo", res.data) uni.setStorageSync("userinfo", res.data)