| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <template>
- <view class="flex-common-css bgc-f">
- <Nav title="昵称" titleColor="#333" bgckgroundBox='#fff'></Nav>
- <scroll-view :scroll-y="true" class="scroll-view-css">
- <view class="content-box box-border-box">
- <input v-model="fromData.nickname" class="uni-input mb-16 fs-28" type="nickname" placeholder="请输入昵称" maxlength="20" @change="getNickname" />
- <view class="fs-24 fc-9 mb-80">
- 昵称由中文、英文、数字、组合
- </view>
- <view class="but fs-32 fc-f fw-600 b-rad-200 bgc-41ABF5 text-align-center" @click="save()">
- 保存
- </view>
- </view>
- </scroll-view>
- </view>
- </template>
- <script>
- import {userInfo,userUpdate} from '@/api/member.js';
- import tools from '@/service/tools';
- export default {
- data() {
- return {
- fromData:{
- nickname:'',
- head_img:'',
- sex:'',
- },
- isAJAX:false,
- };
- },
- onShow() {
- this.getUserInfo();
- },
- methods: {
- getUserInfo(){
- userInfo().then((res)=>{
- if(res.code === 1){
- this.fromData = res.data;
- }
- })
- },
- getNickname(e) {
- this.fromData.nickname = e.detail.value
- },
- save(){
- if(this.isAJAX){
- return
- }
- this.isAJAX = true;
- userUpdate(this.fromData).then((res)=>{
- if(res.code === 1){
- this.isAJAX = false;
- tools.success(res.msg)
- }else{
- this.isAJAX = false;
- tools.error(res.msg)
- }
- })
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- .content-box{
- padding: 40rpx 32rpx 0;
- }
- .uni-input{
- // width: 100%;
- height: 92rpx;
- line-height: 92rpx;
- background: #F6F6F6;
- border-radius: 12rpx;
- padding: 0 0 0 26rpx;
- }
- .but{
- width: 100%;
- height: 92rpx;
- line-height: 92rpx;
- }
- </style>
|