This commit is contained in:
曹辉 2022-11-11 17:37:41 +08:00
parent f91a5d2612
commit 16859e855b
3 changed files with 82 additions and 51 deletions

View File

@ -3,7 +3,7 @@
<view class="centercontent">
<view class="Commodity" @tap="uploadImag()">
头像
<image class="picture" :src="appPersonallist.avatar" mode=""></image>
<image class="picture" :src="img" mode=""></image>
<image class="pictureA" src="../../static/jiantou.png" mode=""></image>
</view>
<view class="content">
@ -11,15 +11,15 @@
<span class="">
昵称
</span>
<input type="text" placeholder="请填写" v-model="appPersonallist.userName" />
<input type="text" maxlength="10" placeholder="请填写" v-model="appPersonallist.userName" />
</view>
<view class="name">
<span>姓名:</span>
<input type="text" placeholder="请输入" v-model="appPersonallist.nickName" />
<input type="text" maxlength="10" placeholder="请输入" v-model="appPersonallist.nickName" />
</view>
<view class="name">
<span>电话</span>
<input type="text" placeholder="请输入" v-model="appPersonallist.phonenumber" />
<input type="text" maxlength="11" placeholder="请输入" v-model="appPersonallist.phonenumber" />
</view>
<!-- <view class="nursetype name" style="border: none;" @tap='show=true'>
护理站:{{getNurseStationName(appPersonallist)}}
@ -47,6 +47,8 @@
return {
show: false,
baseurl: '', //url
img: null,
image: null,
NurseStationList: [], //list
appPersonallist: {
userId: '',
@ -56,6 +58,7 @@
avatar: '',
File: '',
},
timer: null,
}
},
computed: {
@ -64,11 +67,11 @@
},
},
onShow() {
this.info();
this.baseurl = baseurl;
},
onLoad(options) {
let that = this
// try {
// const value = uni.getStorageSync('nursePersonId');
// if (value) {} else {}
// } catch (e) {}
try {
const value = uni.getStorageSync('phonenumber');
if (value) {
@ -82,10 +85,7 @@
}
} catch (e) {}
this.myInfo()
this.info();
this.baseurl = baseurl;
},
onLoad(options) {},
methods: {
//
uploadImag() {
@ -96,48 +96,79 @@
sourceType: ['album'],
success(res) {
that.appPersonallist.avatar = res.tempFilePaths[0]
that.img = res.tempFilePaths[0]
that.image = res.tempFilePaths[0]
}
})
},
myInfo() {
nursePerson(this.phonenumber, this.password).then(res => {
res.data.avatar = baseurl + res.data.avatar
this.img = baseurl + res.data.avatar
this.appPersonallist = res.data
})
},
gofinish() {
var that = this
uni.uploadFile({
url: baseurl + '/nurseApp/personLogin/updateHeadAvatarHead',
filePath: that.appPersonallist.avatar, //file: (filePath)
name: 'file',
formData: { //
'userId': that.appPersonallist.userId,
},
timeout: 5000,
success(res) {
that.appPersonallist.avatar = JSON.parse(res.data).imgUrl
userPassWord(that.appPersonallist).then(res => {
if (res.code == 200) {
that.$refs.uToast.show({
title: '修改成功',
type: 'success',
duration: '1500',
})
setTimeout(e => {
uni.navigateBack({
delta: 1
if (this.image) {
uni.uploadFile({
url: baseurl + '/nurseApp/personLogin/updateHeadAvatarHead',
filePath: that.image, //file: (filePath)
name: 'file',
formData: { //
'userId': that.appPersonallist.userId,
},
timeout: 5000,
success(res) {
that.appPersonallist.avatar = JSON.parse(res.data).imgUrl
userPassWord(that.appPersonallist).then(res => {
if (res.code == 200) {
that.$refs.uToast.show({
title: '修改成功',
type: 'success',
duration: '1500',
})
}, 1500)
} else {
that.$refs.uToast.show({
title: res.msg,
type: 'error'
})
if (that.timer) {
clearTimeout(that.timer)
}
that.timer = setTimeout(e => {
uni.navigateBack({
delta: 1
})
}, 1500)
} else {
that.$refs.uToast.show({
title: res.msg,
type: 'error'
})
}
})
}
})
} else {
userPassWord(that.appPersonallist).then(res => {
console.log(res)
if (res.code == 200) {
that.$refs.uToast.show({
title: '修改成功',
type: 'success',
duration: '1500',
})
if (that.timer) {
clearTimeout(that.timer)
}
})
}
})
that.timer = setTimeout(e => {
uni.navigateBack({
delta: 1
})
}, 1500)
} else {
that.$refs.uToast.show({
title: res.msg,
type: 'error'
})
}
})
}
},
confirm(e) {
this.appPersonallist.nurseStationSysUserVOList[0].nurseStationId = e[0].value
@ -197,13 +228,15 @@
line-height: 100rpx;
border-bottom: 1rpx solid #D8D4D4;
position: relative;
span{
span {
display: inline-block;
width: 20%;
}
input {
position: absolute;
top:50%;
top: 50%;
transform: translateY(-50%);
line-height: 100rpx;
display: inline-block;

View File

@ -30,7 +30,7 @@
</view>
</view> -->
<view class="loginbtn" @tap='pwdlogin'>
登录
确定
</view>
<u-toast ref="uToast" />
</view>
@ -42,8 +42,8 @@
export default {
data() {
return {
phonenumber: '18963146613',
password: '23456',
phonenumber: '',
password: '',
newpassword: '',
getCodeText: '获取验证码', //
getCodeBtnColor: "#4C7BC9", //color

View File

@ -24,20 +24,17 @@
</view>
<view class="item">
电话{{appPersonallist.phonenumber }}
</view>
<view class="item" style="height:100%">
</view>
<view class="item" style="border:none;" v-if="appPersonallist.nurseStationSysUserVOList">
护理站: {{appPersonallist.nurseStationSysUserVOList[0].nurseStationName}}
</view>
</view>
<view class="External" style="margin: 100rpx auto 0;">
<!-- <view class="External" style="margin: 100rpx auto 0;">
<view class="lefttext">
我的设备
</view>
<image src="../../static/jiantou.png" mode=""></image>
</view>
</view> -->
<!-- <view class="External">
<view class="lefttext">
修改密码
@ -87,6 +84,7 @@
myInfo() {
nursePerson(this.phonenumber, this.password).then(res => {
this.appPersonallist = res.data
console.log(this.appPersonallist)
})
},
updatainfo() {