修改手机号和密码

This commit is contained in:
闫晓茹 2023-10-24 17:04:23 +08:00
parent 0caee43f6d
commit 6d06545d9e
4 changed files with 80 additions and 19 deletions

View File

@ -0,0 +1,17 @@
import request from "../request.js"
//修改手机号
export function update(data) {
return request({
url: '/system/hospitalPerson/update',
method: 'post',
data:data,
})
}
// export function createMobileToken() {
// return request({
// url: `/nurseApplet/authorization/createMobileToken`,
// method: 'GET'
// })
// }

View File

@ -2,23 +2,25 @@
<view class="app"> <view class="app">
<view class="name"> <view class="name">
密码 密码
<u-input v-model="list.personPassword" :type="type" :border="border" placeholder="请输入密码" /> <u-input v-model="list.personPassword" type="password" placeholder="请输入密码" />
</view> </view>
<view class="submit">提交 <view class="submit" @tap="submit">提交
</view> </view>
<u-toast ref="uToast" />
</view> </view>
</template> </template>
<script> <script>
import {
update,
} from '@/api/Modifyphonenumber/Modifyphonenumber.js'
export default { export default {
data() { data() {
return { return {
list: [{ list: [],
personPassword: '',
}],
} }
}, },
onLoad(e) { onLoad(e) {
@ -27,7 +29,26 @@
console.log(this.list) console.log(this.list)
} }
}, },
methods: {}, methods: {
submit() {
update(this.list).then(res => {
console.log(res)
if (res.code == 200) {
this.$refs.uToast.show({
title: '修改成功',
type: 'success',
duration: '1500'
})
} else {
this.$refs.uToast.show({
title: res.msg,
type: 'error',
duration: '1500'
})
}
})
},
},
} }
</script> </script>

View File

@ -2,20 +2,23 @@
<view class="app"> <view class="app">
<view class="name"> <view class="name">
手机号 手机号
<u-input v-model="list.personPhone" type="number" placeholder="请输入手机号" /> <u-input v-model="list.personPhone" type="number" maxlength="11" placeholder="请输入手机号" />
</view> </view>
<view class="submit">提交 <view class="submit" @tap="submit">提交
</view> </view>
<u-toast ref="uToast" />
</view> </view>
</template> </template>
<script> <script>
import {
update,
} from '@/api/Modifyphonenumber/Modifyphonenumber.js'
export default { export default {
data() { data() {
return { return {
list: [], list: [],
} }
}, },
@ -25,7 +28,27 @@
console.log(this.list) console.log(this.list)
} }
}, },
methods: {}, methods: {
submit() {
// this.list.id = uni.getStorageSync("id")
update(this.list).then(res => {
console.log(res)
if(res.code==200){
this.$refs.uToast.show({
title: '修改成功',
type: 'success',
duration: '1500'
})
}else{
this.$refs.uToast.show({
title: res.msg,
type: 'error',
duration: '1500'
})
}
})
},
},
} }
</script> </script>

View File

@ -46,7 +46,7 @@
</view> </view>
</view> </view>
<!-- 泉医 --> <!-- 泉医 -->
<view class="Quanyi" v-if="status=='2'"> <view class="Quanyi" v-if="status=='2'">
<div class="imgs"> <div class="imgs">
</div> </div>
@ -100,8 +100,8 @@
name: '' name: ''
}, },
status: '', status: '',
id:'', id: '',
list:[], list: [],
} }
}, },
onLoad() { onLoad() {
@ -112,10 +112,10 @@
this.info() this.info()
}, },
methods: { methods: {
info(){ info() {
this.id=uni.getStorageSync("id") this.id = uni.getStorageSync("id")
hospitalPerson(this.id).then(res=>{ hospitalPerson(this.id).then(res => {
this.list=res.data this.list = res.data
}) })
}, },
gopassword() { gopassword() {
@ -130,7 +130,7 @@
}, },
// //
personlinfo() { personlinfo() {
console.log(this.list,'66') console.log(this.list, '66')
uni.navigateTo({ uni.navigateTo({
url: `/pages/Personalinfo/Personalinfo?list=${JSON.stringify(this.list)}` url: `/pages/Personalinfo/Personalinfo?list=${JSON.stringify(this.list)}`
}) })
@ -367,4 +367,4 @@
} }
} }
} }
</style> </style>