<style>
	.companyInfo {
		background-color: #fff;
		margin-bottom:80px;
	}

	.companyInfo .compInfoList {
		width: 100%;
		display: flex;
		height: 60px;
		align-items: center;
		padding: 0 20px;
		border-bottom: 1px solid #F2F3F6;
	}

	.companyInfo .comInfoName {
		width: 26%;
		color: #000;
	}

	.companyInfo .comInfoName text {
		color: red;
		margin-left:3px;
	}

	.companyInfo .comInfoInput {
		width: 75%;
		margin-top: 2px;
		font-size: 13px;
		color:#808080;
		text-align: right;
	}
	.companyInfo .comInBtn{
		position: fixed;
		bottom:0;
		width:100%;
		height:50px;
		color:#fff;
		z-index:99;
		font-size: 16px;
		text-align: center;
		line-height: 50px;
		background-color: #0b0052;
	}
</style>
<template>
	<view class="companyInfo">
		<view class="compInfoList">
			<view class="comInfoName">
				参会人<text>*</text>
			</view>
			<input class="uni-input comInfoInput" v-model="msg.Principal" placeholder="请输入公司联系人" />
		</view>
		<view class="compInfoList">
			<view class="comInfoName">
				手机号码<text>*</text>
			</view>
			<input class="uni-input comInfoInput" v-model="msg.Mobile" type="number" placeholder="请输入公司联系电话" />
		</view>
		<view class="compInfoList">
			<view class="comInfoName">
				邮箱地址<text>*</text>
			</view>
			<input class="uni-input comInfoInput" v-model="msg.EMail" placeholder="请输入公司邮箱" />
		</view>
		<view class="compInfoList">
			<view class="comInfoName">
				公司名(中文)<text>*</text>
			</view>
			<input class="uni-input comInfoInput" v-model="msg.CompanyName" placeholder="请输入公司中文名称" />
		</view>	
		<view class="comInBtn" @click="saveInfo()">提交</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pageTitle: "完善企业信息",
				dataList: [],
			
				msg: {
					CompanyId: 0, //编号
					CompanyName: "", //公司名称
					CompanyEnName: "", //公司英文名称
					Principal: "", //联系人
					Mobile: "", //联系电话
					EMail: "", //邮箱
					LegalPerson: "", //法人
					WechatNo: "", //公司微信
					CompanyIntro: "", //公司介绍
					DomainUrl: "", //官网
					FoundingTime: "", //成立时间
					EmployeeNum: "", //员工人数
					AnnualSales: "", //年销售(万元)
					AnnualImport: "", //年进口额
					Address: "", //详细地址
					EnAddress: "", //详细地址(英文)
					Industry: "", //行业
					ExportCountry: "", //主要出口国
					ImportCountry: "", //主要进口国家
					ImportCategory: "", //主要进口类目
					OtherInfo: "" //其他内容
				}
			};
		},
		mounted() {
			uni.setNavigationBarTitle({
				title: this.pageTitle,
			});
		},
		onLoad(options) {
			
		},
		created() {
			this.getList();
		},
		onShow() {

		},
		methods: {
			//获取数据
			getList() {
				uni.showLoading({
					title: '加载中'
				});
				this.request2({
						url: "/api/AppletTrade/GetUserCompany",
						data: {},
					},
					(res) => {
						uni.hideLoading();
						if (res.resultCode == 1) {
							this.msg=res.data;
						}
					}
				);
			},
			//保存数据
			saveInfo(){
				if(this.msg.CompanyName==''){
					uni.showToast({
					  title: "请输入公司中文名称",
					  icon:'none'
					});
					return;
				}
				if(this.msg.Principal==''){
					uni.showToast({
					  title: "请输入联系人",
					  icon:'none'
					});
					return;
				}
				if(this.msg.Mobile==''){
					uni.showToast({
					  title: "请输入联系电话",
					  icon:'none'
					});
					return;
				}
				if(this.msg.EMail==''){
					uni.showToast({
					  title: "请输入公司邮箱",
					  icon:'none'
					});
					return;
				}
				this.request2({
						url: "/api/AppletTrade/SetCompany",
						data: this.msg,
					},
					(res) => {
						if (res.resultCode == 1) {
							uni.showToast({
							  title: "保存成功",
							});
							this.getList();
							uni.navigateTo({
								url: '/pages/index/index'
							});
						}
					}
				);
			}
		},
	}
</script>

<style>
</style>
