<template>
|
|
<view class="edit-name flex-1">
|
|
<view class="edit-name-box m-b-60">
|
|
<u-input v-model="name" placeholder="请输入新的名称" />
|
|
</view>
|
|
|
|
<u-button type="primary" @click="confirm">完成</u-button>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data () {
|
|
return {
|
|
name: ''
|
|
}
|
|
},
|
|
onLoad(options) {
|
|
this.name = options?.name
|
|
},
|
|
methods: {
|
|
confirm () {
|
|
uni.$emit('EDITNAME', this.name)
|
|
this.editUserInfo({name: this.name})
|
|
uni.navigateBack({
|
|
delta: 1
|
|
})
|
|
},
|
|
editUserInfo (params = {},status= 0) {
|
|
uni.showLoading();
|
|
this.$api('editUserInfo', params)
|
|
.then(res => {
|
|
uni.hideLoading();
|
|
this.$Toast(res.message)
|
|
|
|
}).catch(err => {
|
|
uni.hideLoading();
|
|
this.$Toast(err.message)
|
|
})
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.edit-name{
|
|
background: #F5F6F8;
|
|
padding: 34rpx;
|
|
&-box {
|
|
border-bottom: 2rpx solid #ccc;
|
|
padding: 0 20rpx;
|
|
}
|
|
}
|
|
</style>
|