<template>
    <view>
        <cu-custom bgColor="bg-white" :isBack="true">
			<block slot="content">
				个人简介
			</block>
            <block slot="right"></block>
            <block slot="right">
				<view class="text-main font-32" style="padding-right:35rpx;" @tap="save()">完成</view>
			</block>
 		</cu-custom>
        <view style="background:#F6F6F6;height:15rpx;width:100%;"></view>
         <view class="box">
             <view class="name flex align-end ">
                 <u-input v-model="profile" type="textarea" height="280" placeholder="请输入简介" class="flex-sub" maxlength="200" :clearable="false"/>
                 <view style="padding-left:4rpx;margin-top:25rpx;" class="color-99 text-sm"><span class="color-11">{{profile.length}}</span>/200</view>
             </view>
             
         </view>
    </view>
</template>
<script>
export default {
components: {},
   data() {
      return {
          profile: "",
          id: "",
      }
   },
 watch: {
},
// 接收 上个页面传递过来的参数
onLoad(option) {
    if(option.profile != 'null' && option.profile != 'undefined' && option.profile != null && option.profile != undefined && option.profile != ''){
      this.profile = option.profile;
    }
    this.id = option.id;
    // this.id = option.id;
},
created(){
},
mounted(){
},
methods:{
    save() {
      this.$u.api.updateUserInfo({serverId: this.id,desc:this.profile}).then(res => {
        if (res.code === 200) {
          uni.navigateTo({
            url: '../main/main'
          })
        }
      })

    }
}


}
</script>
<style lang='scss' scoped>
page {
    background: #fff;
}
.box {
    padding: 0 35rpx;
    padding-top: 30rpx;
    border-top: 2rpx solid #eee;
}
.name {
    border: 2rpx solid #eee;
    background: #FAFAFA;
    border-radius: 10rpx;
    padding: 20rpx 20rpx 15rpx 30rpx;
}
/deep/ .uni-input-input {
    font-weight: bold;
}
</style>

