幼教产品B2B生态平台小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.3 KiB

12 months ago
<template>
<view class="page">
<view class="input">
11 months ago
<uni-easyinput v-model.trim="info.userName" placeholder="请输入姓名"></uni-easyinput>
12 months ago
</view>
<button type="primary" @click="submit">确认</button>
</view>
</template>
<script>
11 months ago
import { viewUserDetails, updateAvatars } from '@/apis/modules/user.js'
12 months ago
export default {
data() {
return {
11 months ago
platformId: uni.getStorageSync('platformId'),
11 months ago
info: {
userName: ''
},
openId: uni.getStorageSync('openId'),
12 months ago
}
},
onShow() {
11 months ago
this.getInfo()
12 months ago
},
methods: {
11 months ago
// 个人信息
async getInfo() {
const { result } = await viewUserDetails({
openId: this.openId
})
if (result.hrUserInfo) {
this.info = result.hrUserInfo
}
},
async submit() {
const { userName } = this.info
if(!userName) return this.$util.errMsg('请输入姓名')
await updateAvatars({
url: '',
userName,
11 months ago
openId: this.openId,
platformId: this.platformId,
11 months ago
})
this.$util.sucMsg('修改成功!')
setTimeout(() => {
uni.navigateBack()
}, 1000)
12 months ago
}
}
}
</script>
<style scoped lang="scss">
.page {
padding: 20px;
background-color: #fff;
}
/deep/.input {
margin-bottom: 15px;
.is-input-border {
border-color: #dedede !important;
}
}
</style>