<template>
	<view>
		<!-- 顶部操作条 -->
		<cu-custom :bgColor="'bg-main-color'" :isBack="true">
			<block slot="backText">返回</block>
			<block slot="content">个人信息</block>
		</cu-custom>
		<form @submit="submit">
			<view class="margin-top-sm bg-white">
				<view class="cu-form-group">
					<view class="title">用户昵称</view>
					<input name="name" :value="curUserInfo.name"></input>
				</view>
				<view class="cu-form-group">
					<view class="title">公司名称</view>
					<input name="companyName" :value="curUserInfo.companyName"></input>
				</view>
				<view class="cu-form-group">
					<view class="title">联系地址</view>
					<input name="addressName" :value="curUserInfo.addressName"></input>
				</view>
				<view class="cu-form-group">
					<view class="title">电子邮箱</view>
					<input name="email" :value="curUserInfo.email"></input>
				</view>
			</view>
			<view class="margin-top-sm bg-white">
				<view class="cu-form-group" @click="showAccountSecurity">
					<view class="title">帐号安全</view>
					<view class="text-lg"><text class="cuIcon-right"></text></view>
				</view>
			</view>
			<!-- 底部操作栏 -->
			<view class="cu-bar tabbar border shop fixed-bottom-bar">
				<button class="cu-btn bg-main-color long-btn margin-lr-sm shadow-blur" form-type="submit">保存</button>
			</view>
		</form>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				curUserInfo: {}
			}
		},
		onLoad() {
			this.loadData();
		},
		methods: {
			async loadData() {
				this.curUserInfo = await this.$request.getCurUserNoCache();
			},
			showAccountSecurity() {
				uni.navigateTo({
					url: '/pages/my/account-security'
				})
			}
		},
	}
</script>

<style>
</style>
