常熟
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.
 
 
 
 

94 lines
1.6 KiB

<template>
<view class="bg">
<view class="nickname-box">
<!-- <span>姓名</span> -->
<input v-model="nickname" type="text" placeholder="请输入内容" />
</view>
<view class="btn" @click="save">保存</view>
</view>
</template>
<script>
export default {
name: "changeNickname",
data: function() {
return {
nickname: ""
}
},
onLoad(options) {
if (options.nickname) {
this.nickname = options.nickname
}
},
methods: {
save: function() {
if (!this.nickname) {
uni.showToast({
title: '请输入昵称',
icon: 'none'
})
return;
}
this.Post({
nickname: this.nickname
}, '/api/user/profile').then(res => {
console.log(res)
if (res.code == 1 || res.code==200) {
uni.showModal({
title: '提示',
content: '保存成功!',
success: res => {
if (res.confirm) {
this.goBack()
}
}
})
}
})
}
}
}
</script>
<style scoped>
.bg {
min-height: 100vh;
}
.nickname-box {
display: flex;
padding: 10rpx 30rpx;
align-items: center;
/* background: white; */
margin: 60rpx 30rpx;
font-size: 30rpx;
height: 70rpx;
border-bottom: 1px solid #D8D8D8;
}
.nickname-box span {
flex-shrink: 0;
}
.nickname-box input {
flex: 1;
font-size: 30rpx;
display: block;
}
.btn {
color: black;
margin: 0 auto;
line-height: 80rpx;
position: relative;
font-size: 34rpx;
text-align: center;
width: 333rpx;
height: 80rpx;
background: #00AEA0;
border-radius: 40rpx;
color: #FFFFFF;
}
</style>