<template>
	<view class="autograph white_style">
		<Nav className="nav_F6" :backVisible="true" :saveVisible="true" @savePick="save" :notNull="222" :scroll="scroll">
			<block slot="content" class="omit">{{ $t('me.autograph.signature') }}</block>
		</Nav>
		<view class="body_scroll clearfix" :style="getHeight">
			<view class="autograph_form">
				<textarea :show-confirm-bar="false" class="uni-textarea" placeholder-class="uni-placeholder__class" v-model.trim="form.value" :maxlength="30" placeholder="请输入个性签名" auto-height />
			</view>
		</view>
	</view>
</template>

<script>
	import mixins from '@/utils/mixins'

	export default {
		mixins: [mixins],
		data() {
			return {}
		},
		onLoad (e) {
			if (e) {
				this.form = e
			}
		},
		methods: {
			// 保存
			async save () {
				this.loading = true
				const result = await this.$axios.put(this.API.updateUserInfo, {
					signature: this.form.value
				})
				this.loading = false
				if (result) {
					uni.$emit('me')
					uni.navigateBack()
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.autograph {
		min-height: calc(100vh);
		.body_scroll {
			.autograph_form {
				border-radius: 18rpx;
				background: $white;
				margin: 26rpx;
				.uni-textarea {
					min-height: 200rpx;
					padding: 16rpx;
					color: $bg-0;
					/deep/ .uni-placeholder__class {
						color: $J49494;
					}
				}
			}
		}
	}
</style>
