<style scoped lang="scss">
	.brandInformation{
		width: 100%;
		.slot-btn{
			width: 220rpx;
			height: 220rpx;
			background: #F5F5F5;
			border-radius: 17rpx;
			display: flex;
			align-items: center;
			justify-content: center;
		}
		.slot-btn .image{
			width: 54rpx;
			height: auto;
		}
		#myVideo2{
			width: 150px; height: 200px;
		}
		.bottom-border{
			border-bottom: 3rpx #DADCE6 solid;
			margin-top: 10px;
			.bottom-border_r{
				height: 42px;
				display: flex;
				align-items: center;
			}
			.con6 {
				display: flex;
				flex-wrap: wrap;
			
				.goodsTypeImg {
					width: 278rpx;
					height: 144rpx;
					background-color: #232323;
					opacity: 0.6;
					border-radius: 18rpx;
					margin-bottom: 30rpx;
				}
			}
			.u-action-sheet-item {
				display: flex;
				line-height: 1;
				justify-content: center;
				align-items: center;
				font-size: 14px;
				padding: 34rpx 0;
				
			}
			 .pubox{
				width: 100%;
				
			}
			 .pubox-top{
				width: 100%;
				height: 45px;
				display: flex;
				align-items: center;
				justify-content: space-between;
				font-size: 14px;
				color: #111;
			}
			.u-gab {
				height: 12rpx;
				background-color: rgb(234, 234, 236);
			}
			.u-actionsheet-cancel {
				color: $u-main-color;
			}
			
		}
		.butBox2 {
			margin: 10rpx auto;
			width: 300rpx;
			height: 80rpx;
			background-color: #F70027;
			box-shadow: 0rpx 4rpx 40rpx 0rpx rgba(249, 54, 85, 0.58);
			border-radius: 20rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			font-size: 28rpx;
			font-weight: bold;
			color: #FFFFFF;
		
			.next {
				width: 100%;
				height: auto;
			}
		}
	}
</style>

<template>
	<view class="brandInformation">
		<view class="bottom-border">
			<view class="label-text">企业分类<span style='color: #E54D42;' >*</span></view>
			<view class="bottom-border_r" style="padding: 10px 0;height: 42px;display: flex;" @click="disabled || disabled3?'':(showTypeStatus= true,showType=1)">
				<input type="text" v-model="ETypeName" :disabled="true" style="padding: 10px 0;width: 1px;flex:1" placeholder="请选择企业分类"  placeholder-style="color:#CECECE;">
				<u-icon name="arrow" color="#A5A4AC" size="30" ></u-icon>
			</view>
			<u-popup v-model="showTypeStatus" mode="bottom" >
				<view class="pubox" >
					<scroll-view scroll-y="true" style="max-height: calc(100vh * 0.7 - 65px) ;">
						<view >
							<template v-if="showType==1">
								<view v-for="(x,y) in BrandClassList" :key="y" class="u-action-sheet-item u-border-bottom" 
								@click="clickItem(x)" 
								:style="{color:x.ID == model.EType?'#2979ff':'#111',}">
									{{x.ClassName}}
								</view>
							</template>
							<template v-if="showType==2">
								<view v-for="(x,y) in goodsType" :key="y" class="u-action-sheet-item u-border-bottom" 
								@click="clickItem(x)" 
								:style="{color:x.ID == model.CategoryId?'#2979ff':'#111',}">
									{{x.ClassName}}
								</view>
							</template>
							<template v-if="showType==3">
								<view v-for="(x,y) in GetYBConfig.zhuangXiuList" :key="y" class="u-action-sheet-item u-border-bottom" 
								@click="clickItem(x)" 
								:style="{color:x.Name == model.Renovation?'#2979ff':'#111',}">
									{{x.Name}}
								</view>
							</template>
							<template v-if="showType==4">
								<view v-for="(x,y) in GetYBConfig.fukuanList" :key="y" class="u-action-sheet-item u-border-bottom" 
								@click="clickItem(x)" 
								:style="{color:x.Name == model.Payment?'#2979ff':'#111',}">
									{{x.Name}}
								</view>
							</template>
						</view>
					</scroll-view>
					<view class="u-gab" ></view>
					<view  class="u-actionsheet-cancel u-action-sheet-item" hover-class="u-hover-class"
					 :hover-stay-time="150" @click="showTypeStatus=false">取消</view>
				</view>
			</u-popup>
		</view>
		
		<view class="bottom-border">
			<view class="label-text">企业名称<span style='color: #E54D42;' >*</span></view>
			<input type="text" v-model="model.Name" style="padding: 10px 0;" placeholder="请填写企业名称" :disabled="disabled|| disabled2?true:false"  placeholder-style="color:#CECECE;">
		</view>
		<view class="label-text" style="margin-top:20px;margin-bottom: 30rpx;">
			<text>Logo</text>
			<span style='color: #E54D42;' >*</span>
		</view>
		<view @click="disabled?'':uploadcard()">
			<view slot="addBtn" class="slot-btn" v-if="model.Logo==''" > 
				<image class="image" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1616498310000_18.png" mode="widthFix"></image>
			</view>
			<view class="slot-btn" v-if="model.Logo!=''" @click="disabled?previewImage([model.Logo],1):''">
				<image style="width: 220rpx;height: 220rpx;"  :src="model.Logo" mode="aspectFill"></image>
			</view>
			
		</view>
		<view class="label-text" style="margin-top:20px;margin-bottom: 30rpx;">
			<text>介绍图</text>
			<span style='color: #E54D42;' >*</span>
			<text style="color:#999;font-weight: 400;">（最多9张,第一张为封面图）</text>
		</view>
		<view>
			<u-upload  :action="action" :max-count="9" :max-size="2*1024*1024" :deletable='!disabled' :file-list="fileList" @on-remove="onRemove1"  :custom-btn="true" @on-success="uploadSuccessHandler">
				<view slot="addBtn" class="slot-btn" v-if='disabled==false'> 
					<image class="image" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1616498310000_18.png" mode="widthFix"></image>
				</view>
			</u-upload>
		</view>
		<view class="bottom-border">
			<view class="label-text"
			  >楼宇位置<span style="color: #e54d42">*</span></view
			>
			<view
			  class="bottom-border_r"
			  style="padding: 10px 0; height: 42px; display: flex"
			  @click="disabled ? '' : getAddress()"
			>
			  <u-icon name="location" :color="mainColor" size="30"></u-icon>
			  <text
				style="
				  width: 1px;
				  flex: 1;
				  white-space: nowrap;
				  text-overflow: ellipsis;
				  overflow: hidden;
				  margin-right: 5px;
				"
				v-if="model.Address != ''"
				>{{ model.Address }}</text
			  >
			  <text
				style="width: 1px; flex: 1; color: #cecece"
				v-if="model.Address == ''"
				>请选择地址</text
			  >
			  <u-icon name="arrow" color="#A5A4AC" size="30"></u-icon>
			</view>
		  </view>
		  <view class="bottom-border">
			<view class="label-text"
			  >投运时间<span style="color: #e54d42">*</span></view
			>
			<input
			  type="text"
			  @click="disabled ? '' : (showOpenTime = true,TimeType=1)"
			  v-model="model.OperationTime"
			  :disabled="true"
			  style="padding: 10px 0"
			  placeholder="请选择投运时间"
			  placeholder-style="color:#CECECE;"
			/>
			<u-picker
			  mode="time"
			  v-model="showOpenTime"
			  :params="params"
			  @confirm="confirmOpenTime"
			></u-picker>
		  </view>
		  <view class="bottom-border">
			<view class="label-text">楼宇等级<span style='color: #E54D42;' >*</span></view>
			<view class="bottom-border_r" style="padding: 10px 0;height: 42px;display: flex;" @click="disabled || disabled3?'':(showTypeStatus= true,showType=2)">
				<input type="text" v-model="CategoryName" :disabled="true" style="padding: 10px 0;width: 1px;flex:1" placeholder="请选择企业分类"  placeholder-style="color:#CECECE;">
				<u-icon name="arrow" color="#A5A4AC" size="30" ></u-icon>
			</view>
		</view>
		<view class="bottom-border">
			<view class="label-text">楼宇装修</view>
			<view class="bottom-border_r" style="padding: 10px 0;height: 42px;display: flex;" 
			@click="disabled || disabled3?'':(showTypeStatus= true,showType=3)">
				<view v-if="model.Renovation" style="padding: 10px 0;flex:1;display: flex;overflow: hidden;text-overflow: ellipsis;">
					{{model.Renovation}}
				</view>
				<text v-else style="padding: 10px 0;flex:1;color:#CECECE;">请选择楼宇装修</text>
				<u-icon name="arrow" color="#A5A4AC" size="30" ></u-icon>
			</view>
		</view>
		<view class="bottom-border">
			<view class="label-text">支付方式</view>
			<view class="bottom-border_r" style="padding: 10px 0;height: 42px;display: flex;" 
			@click="disabled || disabled3?'':(showTypeStatus= true,showType=4)">
				<view v-if="model.Payment" style="padding: 10px 0;flex:1;display: flex;overflow: hidden;text-overflow: ellipsis;">
					{{model.Payment}}
				</view>
				<text v-else style="padding: 10px 0;flex:1;color:#CECECE;">请选择支付方式</text>
				<u-icon name="arrow" color="#A5A4AC" size="30" ></u-icon>
			</view>
		</view>
		<view class="bottom-border">
			<view class="label-text"
			  >交房日期<span style="color: #e54d42">*</span></view
			>
			<input
			  type="text"
			  @click="disabled ? '' : (showOpenTime = true,TimeType=2)"
			  v-model="model.HandoverDate"
			  :disabled="true"
			  style="padding: 10px 0"
			  placeholder="请选择交房日期"
			  placeholder-style="color:#CECECE;"
			/>
		  </view>
		  <view class="bottom-border">
			<view class="label-text">意向楼层</view>
				<input
				type="text"
				v-model="model.IntentionalFloor"
				:disabled="disabled"
				style="padding: 10px 0"
				placeholder="请填写意向楼层"
				placeholder-style="color:#CECECE;"
			/>
		</view>
		<view class="bottom-border">
			<view class="label-text">电梯数</view>
				<input
				type="text"
				v-model="model.ElevatorNum"
				:disabled="disabled"
				style="padding: 10px 0"
				placeholder="请填写电梯数"
				placeholder-style="color:#CECECE;"
			/>
		</view>
		<view class="bottom-border">
			<view class="label-text">物业费(元/㎡)</view>
				<input
				type="number"
				v-model="model.PropertyFee"
				:disabled="disabled"
				style="padding: 10px 0"
				placeholder="请填写物业费"
				placeholder-style="color:#CECECE;"
			/>
		</view>
		<view class="bottom-border">
			<view class="label-text">月租金(元/㎡)</view>
				<input
				type="number"
				v-model="model.RentFee"
				:disabled="disabled"
				style="padding: 10px 0"
				placeholder="请填写月租金"
				placeholder-style="color:#CECECE;"
			/>
		</view>
		<view class="bottom-border">
			<view class="label-text">企业简介</view>
			<textarea
			  style="height: 60px;padding: 10px 0;"
			  v-model="model.Introduction"
			  placeholder="请填写企业简介"
			  :disabled="disabled"
			  maxlength="500"
			  placeholder-style="color:#CECECE;"
			/>
		</view>
		<view class="bottom-border">
			<view class="label-text">企业发展意向</view>
			<textarea
			  style="height: 60px;padding: 10px 0;"
			  v-model="model.DevIntention"
			  placeholder="请填写企业发展意向"
			  :disabled="disabled"
			  maxlength="500"
			  placeholder-style="color:#CECECE;"
			/>
		</view>
		<view class="bottom-border">
			<view class="label-text">联系人</view>
				<input
				type="text"
				v-model="model.ContactName"
				:disabled="disabled"
				style="padding: 10px 0"
				placeholder="请填写联系人"
				placeholder-style="color:#CECECE;"
			/>
		</view>
		<view class="bottom-border">
			<view class="label-text">联系人电话</view>
				<input
				type="number"
				v-model="model.ContactPhone"
				:disabled="disabled"
				style="padding: 10px 0"
				placeholder="请填写联系人电话"
				placeholder-style="color:#CECECE;"
			/>
		</view>
		
		<view style="margin-top: 30px;">
			<view class="butBox2" @click="brandSubmit" v-if='!disabled'>
				<text v-if='datas.CompanyStatus && datas.CompanyStatus==1'>确定修改</text>
				<text v-else>完成</text>
			</view>
			<view class="butBox2" @click="goback" v-else>
				<text >返回</text>
			</view>
		</view>
	</view>
</template>

<script>
	
	export default{
		props: {
		    datas: {
		    	type: Object,
		    },
		},
		data(){
			return{
				mainColor:'',
				action: this.host2 + "/api/File/UploadTencent",
				fileList:[],
				controls:true,
				params: {
					year: true,
					month: true,
					day: true,
					hour: false,
					minute: false,
					second: false
				},
				model:{
					ID:"",//	企业服务主键Id
					Name:"",//	企业名称
					BannerList:"",//	企业图片
					Introduction:"",//	企业简介
					DevIntention:"",//	企业发展意向
					Address:"",//	楼宇位置
					LatAndLon:"",//	经纬度
					OperationTime:"",//	投运时间
					CategoryId:"",//	楼宇等级
					EType:"",//	企业类别
					Renovation:"",//	楼宇装修
					Payment:"",//	支付方式
					HandoverDate:"",//	交房日期
					IntentionalFloor:"",//	意向楼层
					ElevatorNum:"",//	电梯数
					PropertyFee:"",//	物业费(元/㎡)
					RentFee:"",//	月租金(元/㎡)
					ContactName:"",//	联系人
					ContactPhone:"",//	联系电话
					BrandEnterpriseType:"",//
					CompanyId:"",//	认证id
				},
				ShopWish:1,//开店意愿
				CategoryName:'',
				ETypeName: '',
				showOpenTime:false,
				goodsType:[],//载体类型
				goodsTypeImg: {
					1: "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/goodstype-baihuo.png",
					2: "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/goodstype-shappingmall.png",
					3: "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/goodstype-center.png",
					4: "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/goodstype-other.png"
				},
				radiolist:[{Id:1,name:'是'},{Id:0,name:'否'},],
				brandList:[
					{name: "上下水",field: "Plumbing",},
					{name: "管径",field: "Caliber",},
					{name: "排污",field: "Sewage",},
					{name: "空调",field: "KongTiao",},
					{name: "新风",field: "XinFeng",},
					{name: "是否已在成都落地",field: "IsInChengdu",},
				],
				BrandClassList:[],
				showTypeStatus:false,
				disabled:false,
				disabled2:false,
				disabled3:false,//控制分类不能修改
				glBrandName:'',
				showOpenTime: false,
				TimeType: 1,
				GetYBConfig: null,
      			showType: 1,
			}
		},
		onLoad(options){
			let MallBaseId = uni.getStorageSync("mall_UserInfo").MallBaseId ? uni.getStorageSync("mall_UserInfo").MallBaseId : 1;
			this.action = this.host2 + '/api/File/UploadTencent?MallBaseId=' + MallBaseId
			this.mainColor = this.$uiConfig.mainColor;
			
		},
		created() {
			this.GetProjectTypeEnumList()//载体性质
			this.getbrandList()
			this.model.CompanyId = this.datas.CompanyId
			
			if(this.datas.CompanyStatus!=undefined && this.datas.IsComplete != undefined){//判断是否填写过了
				this.model = this.datas.BrandModel
				this.model.CompanyId = this.datas.CompanyId
		
				
				this.glBrandName = data.BrandName
				if(this.model.BannerList && this.model.BannerList.length>0){
					this.model.BannerList.forEach(x=>{
						let obj ={
							url:x
						}
						this.fileList.push(obj)
					})
				}else{
					this.model.BannerList = [];
					this.fileList= []
				}
				if(!this.model.Logo){
					this.model.Logo = ''
				}
				
				
				if(this.datas.CompanyStatus==0 &&  this.datas.IsComplete==1){//审核中
					this.disabled = true
					
				}
				if(this.datas.CompanyStatus==1){
					this.disabled2 = true
				}
				if(this.model.ExistBrandId>0){
					
					this.disabled2 = true
					this.disabled3 = true
				}
				this.CategoryName = data.ClassName;
			}
			
			
			
		},
		methods:{
			confirmOpenTime(r) {
				if(this.TimeType==1) this.model.OperationTime = r.year + "-" + r.month + "-" + r.day;
				else this.model.HandoverDate = r.year + "-" + r.month + "-" + r.day;
			},
			//打开地图
			getAddress() {
				let that = this;
				uni.chooseLocation({
					success: function (res) {
					console.log(res);
					that.model.Address = res.name;
					that.model.LatAndLon = res.latitude + "," + res.longitude;
					},
					fail: function (err) {
					that.fetchAgainLocation();
					},
				});
			},
			//重新提示用户打开设置对地图授权
			fetchAgainLocation() {
				let that = this;
				wx.getSetting({
					success: (res) => {
					var statu = res.authSetting;
					if (!statu["scope.userLocation"]) {
						wx.showModal({
						title: "是否授权当前位置",
						content:
							"需要获取您的地理位置，请确认授权，否则地图功能将无法使用",
						success: (tip) => {
							if (tip.confirm) {
							console.log(tip);
							wx.openSetting({
								success: (data) => {
								console.log(data);
								if (data.authSetting["scope.userLocation"] === true) {
									wx.showToast({
									title: "授权成功",
									icon: "success",
									duration: 1000,
									});
									if (that.latitude != "" && that.longitude != "") {
									that.getAddress();
									} else {
									that.getAddress();
									}
								} else {
									wx.showToast({
									title: "授权失败",
									duration: 1000,
									});
								}
								},
								fail: (err) => {
								console.log(err);
								},
								complete: () => {},
							});
							}
						},
						});
					}
					},
					fail: () => {},
					complete: () => {},
				});
			},
    
			GetProjectTypeEnumList(){
				// let parms = {
				// 	url: "/api/AppletTrade/GetProjectTypeEnumList",
				// }
				// this.request2(parms, (res) => {
				// 	if (res.resultCode == 1) {
				// 		this.goodsType = res.data
				// 	}
				// })
			},
			getbrandList(){
				this.request2({
						url: "/api/AppletTrade/GetBrandClassList",
						data: {
							BrandCategory: 4
						},
					},
					(res) => {
						if (res.resultCode == 1) {
							this.BrandClassList =  res.data
							
						}
					}
				);
				this.request2({
						url: "/api/AppletTrade/GetBrandClassList",
						data: {
							BrandCategory: 2
						},
					},
					(res) => {
						if (res.resultCode == 1) {
							this.goodsType =  res.data
							
						}
					}
				);
				this.request2({
						url: "/api/AppletTrade/GetYBConfig",
						data: {},
					},
					(res) => {
						if (res.resultCode == 1) {
							this.GetYBConfig =  res.data
						}
					}
				);
			},
			onRemove1(index) {
				this.model.BannerList.splice(index, 1);
			},
			uploadSuccessHandler(data, index, lists) {
				let r = JSON.parse(data);
				this.model.BannerList.push(r.data);
			},
			uploadcard(){
				uni.chooseImage({
					count: 1, //默认9
					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
					sourceType: ['album', 'camera'], //从相册选择
					success: async(res) => {
						var tempFilePaths = res.tempFilePaths;
						uni.showLoading({
							title: '正在上传中...'
						})
						for (let temp of tempFilePaths) {
							// 图片上传服务器
							await uni.uploadFile({
								url: this.action,
								filePath: temp,
								name: 'file',
								formData: {
									user: 'test'
								},
								
								success: res => {
									let data = JSON.parse(res.data)
									// 上传完成后处理
									this.model.Logo = data.data
									uni.hideLoading()
								},
								
							});
						}
					}
				});
			},
			enlarge(file) {
				
				// 全屏
				this.videoContext = uni.createVideoContext('myVideo2');
				this.videoContext.requestFullScreen({
					direction:0
				})
				
				
			},
			videoControl(e){
				console.log(e)
				if(e.detail.fullScreen==false){
					this.videoContext.stop()
					// this.controls=false
				}else{
					this.videoContext.play()
					// this.controls=true
				}
			},
			upvideo() {
				let that = this
				uni.chooseVideo({
					count: 1,
					sourceType: ['camera', 'album'],
					success: function(res) {
						console.log(res)
						that.upFile(res.tempFilePath, 1)
						uni.showLoading({
							title: '上传中...'
						})
			
					},
					fail(err) {
						console.log(err, )
					}
				});
			},
			upFile(filePath, type) {
				
				
				let that = this
				uni.uploadFile({
					url: that.action,
					filePath: filePath,
					name: 'file',
					formData: {
						user: 'tesdt'
					},
					success: (uploadFileRes) => {
						uni.hideLoading()
						if (uploadFileRes.statusCode == 200) {
							let data = JSON.parse(uploadFileRes.data)
							that.model.VideoUrl=data.data
							
						}
			
					},
					fail: function(res) {
						console.log(res)
						wx.showToast({
							title: '上传失败!',
							icon: 'none',
							duration: 1000
						})
					}
				});
			},
			previewImage(imgs,i) {
				uni.previewImage({
					urls: imgs,
					current: i,
					longPressActions: {
						itemList: ["发送给朋友", "保存图片", "收藏"],
						success: function(data) {},
						fail: function(err) {
							console.log(err.errMsg);
						},
					},
				});
			},
			radioChange(e,name){
				this.model[name] = e.detail.value
			},
			radioChange2(e){
				this.ShopWish = e.detail.value
				if(this.ShopWish == 0){
					this.model.OpenShopWish = -1
				}else{
					this.model.OpenShopWish = 5
				}
			},
			clickItem(x) {//类型选择
				if(this.showType==1){
					this.ETypeName = x.ClassName;
					this.model.EType = x.ID;
				}else if(this.showType==2){
					this.CategoryName = x.ClassName;
					this.model.CategoryId = x.ID;
				}else if(this.showType==3){
					this.model.Renovation = x.Name
				}else{
					this.model.Payment = x.Name
				}
				this.showTypeStatus=false
			},
			gobrandsearch(){//跳转到企业搜索页面
				uni.navigateTo({
					url: '/pages/kotra/brandSearch?type=1' 
				})
			},
			brandchildren(Id){//主页面调取方法
				
				this.request2({
						url: "/api/AppletTrade/GetBrandDetailsForCompany",
						data: {ID:Id},
					},
					(res) => {
						if (res.resultCode == 1) {
							let data = res.data
							this.model.ExistBrandId = data.ID;
							this.model.Logo = data.Logo;
							this.model.BannerList = data.BannerList;
							this.model.VideoUrl = data.VideoUrl;
							this.model.FullBrandName = data.FullBrandName;
							this.model.BrandName = data.BrandName;
							this.model.ShopNum = data.ShopNum;
							this.model.BuiltUpArea = data.BuiltUpArea;
							this.model.EndBuiltUpArea = data.EndBuiltUpArea;
							this.model.CustomerType = data.CustomerType;
							this.model.BrandType = data.BrandType;
							this.model.StoreExpansion = data.StoreExpansion;
							this.model.ProjectType = data.ProjectType;
							this.model.AreaRequirement = data.AreaRequirement;
							this.model.EndAreaRequirement = data.EndAreaRequirement;
							this.model.Advertising = data.Advertising;
							this.model.Other = data.Other;
							this.model.ShopSize = data.ShopSize;
							this.model.Plumbing = data.Plumbing;
							this.model.Caliber = data.Caliber;
							this.model.Sewage = data.Sewage;
							this.model.RanQi = data.RanQi;
							this.model.DianLiang = data.DianLiang;
							this.model.PaiYan = data.PaiYan;
							this.model.KongTiao = data.KongTiao;
							this.model.XinFeng = data.XinFeng;
							this.model.IsInChengdu = data.IsInChengdu;
							this.model.BrandClassId = data.BrandClassId;
							this.model.RanQiBZ = data.RanQiBZ;
							this.model.IsDianLiang = data.IsDianLiang;
							this.model.PaiYanBZ = data.PaiYanBZ;
							this.model.ShopSize = data.ShopSize;
							this.model.IsShopSize = data.IsShopSize;
							this.model.OpenShopWish = data.OpenShopWish?data.OpenShopWish:5;
							
							this.glBrandName = data.BrandName
							this.disabled2 = true
							this.disabled3 = true
							if(this.model.BannerList.length>0){
								this.model.BannerList.forEach(x=>{
									let obj ={
										url:x
									}
									this.fileList.push(obj)
								})
							}
							this.BrandClassList.forEach(x=>{
								if(this.model.BrandClassId == x.ID){
									this.CategoryName = x.ClassName;
								}
							})
						}
					}
				);
			},
			brandSubmit(){
				if(!this.model.EType){
					uni.showToast({title: '请选择企业类别',icon: 'none',})
					return
				}
				if(this.model.Name == ''){
					uni.showToast({title: '请输入企业名称',icon: 'none',})
					return
				}
				if(this.model.Logo == ''){
					uni.showToast({title: '请上传Logo',icon: 'none',})
					return
				}
				if(this.model.BannerList.length == 0){
					uni.showToast({title: '请上传企业介绍图',icon: 'none',})
					return
				}
				if(!this.model.CategoryId){
					uni.showToast({title: '请选择楼宇等级',icon: 'none',})
					return
				}
				
				if( this.model.ElevatorNum==''){
					this.model.ElevatorNum = 0
				
				}
				if(this.model.PropertyFee=='' ){//设为默认值
					this.model.PropertyFee = 0
				}
				if( this.model.RentFee==''){
					this.model.RentFee = 0
				}
				if(!this.model.ContactName){
					uni.showToast({title: '请填写联系人',icon: 'none',})
					return
				}
				if(!this.model.ContactPhone){
					uni.showToast({title: '请填写联系人电话',icon: 'none',})
					return
				}
				
				console.log(this.model,'保存')
				uni.showLoading({
					title:'提交中...'
				})
				let parms = {
					url: "/api/AppletTrade/SetEnterpriseServicesApply",
					data: this.model
				}
				if(this.datas.CompanyStatus && this.datas.CompanyStatus==1){
					parms = {
						url: "/api/AppletTrade/SetEnterpriseServicesUpdate",
						data: this.model
					}
				}
				this.request2(parms, (res) => {//认证 - 保存企业信息
					if (res.resultCode == 1) {
						uni.hideLoading()
						uni.showToast({title: res.message,icon: 'none',})
						setTimeout(()=>{
							uni.navigateBack()
						},1500)
					}
				})
			},
			goback(){
				uni.navigateBack()
			},
			score(e){
				this.model.OpenShopWish = e
			}
			
		}
	}
</script>
