<style lang="scss" scoped>
	
.entercerdetails{
	width: 100%;
	height: 100vh;
	background: #FFF;
	.box{
		width: calc(100vw - 30px);
		margin-top: 10px;
		margin-left: 15px;
		margin-bottom: 80px;
		background: #FFF;
		border-radius: 15px;
		box-shadow: 0px 5px 25px 0px rgba(218, 220, 230, 0.85);
		padding: 15px;
		
		.box_title{
			width: 67px;
			height: 17px;
			margin-bottom: 10px;
			image{
				width: 100%;
				height: 100%;
			}
		}
		.box_item{
			width: 100%;
			padding: 15px 0 ;
			display: flex;
			align-items: flex-start;
			justify-content: space-between;
			border-bottom: 1px solid #E2E2E2;
			.box_item_l{
				width: 120rpx;
				font-size: 13px;
				color: #999999;
				margin-right: 15px;
				
			}
			.box_item_r{
				width: 1px ;
				flex:1;
				font-size: 13px;
				color: #111111;
				font-weight: 500;
				font-family: PingFang SC;
				text-align: right;
			}
		}
	}
	.page_bottom{
		position: fixed;
		left: 0;
		bottom: 0;
		width: 100%;
		height: 70px;
		background: #FFF;
		display: flex;
		align-items: center;
		padding: 0 15px;
		z-index: 9999999;
		justify-content: space-between;
		.page_bottom_item{
			width: 330rpx;
			height: 40px;
			border-radius: 10px;
			font-size: 14px;
			display: flex;
			align-items: center;
			justify-content: center;
			
		}
		.page_bl{
			color: #FFFFFF;
		}
		.page_br{
			border: 1px solid #111111;
			color: #111111;
		}
	}
}
</style>

<template>
	<view class="entercerdetails" v-if="data">
		<view class="page_bottom" v-if="data.CompanyStatus==0">
			<view class="page_bottom_item page_bl" :style="{background:mainColor}" @click="adopt(1)">
				审核通过
			</view>
			<view class="page_bottom_item page_br" @click="adopt(2)">
				审核拒绝
			</view>
		</view>
		<view class="box" >
			<view class="box_title">
				<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Companyinformation.png" ></image>
			</view>
			<view class="box_item">
				<view class="box_item_l">企业名称</view>
				<view class="box_item_r">{{data.CompanyName}}</view>
			</view>
			<view class="box_item">
				<view class="box_item_l">法人</view>
				<view class="box_item_r">{{data.LegalPerson}}</view>
			</view>
			<view class="box_item">
				<view class="box_item_l" style="width: 220rpx;">统一社会信用代码</view>
				<view class="box_item_r">{{data.UnifiedCode}}</view>
			</view>
			<view class="box_item">
				<view class="box_item_l">公司状态</view>
				<span v-if="data.CompanyStatus==0">审核中</span>
				<span v-if="data.CompanyStatus==1" style="color: #00DFB8;">审核通过</span>
				<span v-if="data.CompanyStatus==2" style="color: #F70027;">审核失败</span>
			</view>
			<view class="box_item" v-if="data.CompanyStatus==2">
				<view class="box_item_l">拒绝理由</view>
				<span >{{data.RejectRemark}}</span>
				
			</view>
			<view class="box_item">
				<view class="box_item_l">联系电话</view>
				<view class="box_item_r">{{data.Mobile}}</view>
			</view>
			<view class="box_item" style="border-bottom: none;">
				<view class="box_item_l">营业执照</view>
				<view class="box_item_r">
					<image :src="data.BusinessLicense" style="width: 210rpx;height: auto;" mode="widthFix" @click="previewImage([data.BusinessLicense],1)"></image>
				</view>
			</view>
			<!-- 品牌 -->
			<view v-if="data.FirstShopType==1">
				<view class="box_title">
					<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Brandinformation.png" ></image>
				</view>
				<view class="box_item">
					<view class="box_item_l">品牌分类</view>
					<view class="box_item_r">{{data.BrandModel.ClassName?data.BrandModel.ClassName:''}}</view>
				</view>
				<view class="box_item">
					<view class="box_item_l">品牌全名</view>
					<view class="box_item_r">{{data.BrandModel.FullBrandName?data.BrandModel.FullBrandName:''}}</view>
				</view>
				<view class="box_item">
					<view class="box_item_l">品牌名</view>
					<view class="box_item_r">{{data.BrandModel.BrandName?data.BrandModel.BrandName:''}}</view>
				</view>
				<view class="box_item">
					<view class="box_item_l">Logo</view>
					<view class="box_item_r" v-if="data.BrandModel.Logo && data.BrandModel.Logo!=''">
						<image :src="data.BrandModel.Logo" style="width: 120rpx;height: 120rpx;" mode="aspectFill" @click="previewImage([data.BrandModel.Logo],1)"></image>
					</view>
					<view class="box_item_r" v-else></view>
				</view>
				<view class="box_item">
					<view class="box_item_l">介绍图</view>
					<view class="box_item_r" style="display: flex;flex-wrap: wrap;">
						<view style="width: 100%;" v-if="data.BrandModel.BannerList &&data.BrandModel.BannerList.length>0">
							<image v-for="(x,y) in data.BrandModel.BannerList" :src="x" style="width: 120rpx;height: 120rpx;border-radius: 4px;margin-left: 5px;" @click="previewImage(data.BrandModel.BannerList,y)"></image>
						</view>
						<view v-else>无</view>
					</view>
				</view>
				<view class="box_item">
					<view class="box_item_l">品牌视频</view>
					<view class="box_item_r" style="display: flex;justify-content: flex-end;">
						
						
						<span v-if="!data.BrandModel.VideoUrl && data.BrandModel.VideoUrl==''">无</span>
						<view style="width: 150px; height: 200px;position: relative;" v-else>
							<video id="myVideo1" :src="data.BrandModel.VideoUrl"
								style="width: 100%;height: 100%;"
								:controls='controls'
								:show-center-play-btn='false'
								:show-fullscreen-btn='false' 
								@fullscreenchange='videoControl' ></video>
								<view style="width: 100%;height: 100%;position: absolute;left: 0;top: 0;display: flex;align-items: center;justify-content: center;" @click="enlarge(1)">
									<u-icon name="play-circle-o" :size="70" color="#FFF"></u-icon>
								</view>
								
						</view>
					</view>
				</view>
				
				<view class="box_item">
					<view class="box_item_l">店铺数量</view>
					<view class="box_item_r">{{data.BrandModel.ShopNum?data.BrandModel.ShopNum:0}}</view>
				</view>
				<view class="box_item">
					<view class="box_item_l">开店意愿</view>
					<view class="box_item_r">
						<u-rate
							:disabled="true"
							v-model="data.BrandModel.OpenShopWish"
							:current="data.BrandModel.OpenShopWish?data.BrandModel.OpenShopWish:'5'"
							:active-color="mainColor" inactive-color="#DDDDDD"
							active-icon="star"
							inactive-icon="star-o"
							size="40"
						></u-rate>
					</view>
				</view>
				
				<view class="box_item">
					<view class="box_item_l">建筑面积</view>
					<view class="box_item_r">{{data.BrandModel.BuiltUpArea}}~{{data.BrandModel.EndBuiltUpArea}}</view>
				</view>
				<view class="box_item">
					<view class="box_item_l">需求面积</view>
					<view class="box_item_r">{{data.BrandModel.AreaRequirement}}~{{data.BrandModel.EndAreaRequirement}}</view>
				</view>
				<view class="box_item">
					<view class="box_item_l">客群定位</view>
					<view class="box_item_r">{{data.BrandModel.CustomerType?data.BrandModel.CustomerType:''}}</view>
				</view>
				<view class="box_item">
					<view class="box_item_l">品牌定位</view>
					<view class="box_item_r">{{data.BrandModel.BrandType?data.BrandModel.BrandType:''}}</view>
				</view>
				<view class="box_item">
					<view class="box_item_l">拓展区域</view>
					<view class="box_item_r">{{data.BrandModel.StoreExpansion?data.BrandModel.StoreExpansion:''}}</view>
				</view>
				<view class="box_item">
					<view class="box_item_l">品牌性质</view>
					<view class="box_item_r">{{data.BrandModel.ProjectName?data.BrandModel.ProjectName:''}}</view>
				</view>
				
				<view class="box_item" v-for="(x,y) in brandList" :key="y">
					<view class="box_item_l" :style="{width: x.name=='店铺开口尺寸'?'80px':'60px'}" >{{x.name}}</view>
					<view class="box_item_r" style="display: flex;align-items: center;justify-content: flex-end;">
						<!-- 前面4个并且选择中是的情况显示 -->
						<view v-if="y<4 && data.BrandModel[x.field]==1" style="width: 1px;flex:1;text-align: right;margin-right: 10px;">
							{{data.BrandModel[x.value]?data.BrandModel[x.value]:''}}
						</view>
					<!-- 	<u-radio-group v-model="data.BrandModel[x.field]" >
							<u-radio 
								shape="circle"
								v-for="(item, index) in radiolist" :key="index" 
								:name="item.Id"
								:disabled="true"
							>
								{{item.name}}
							</u-radio>
						</u-radio-group> -->
						<radio-group  style="display: flex;">
							<label v-for="(item, index) in radiolist" :key="index" style="display: flex;margin-right: 10px;align-items: center;">
								<view style="transform:scale(0.7)">
									<radio :value="item.Id" :checked="item.Id == data.BrandModel[x.field]" color='#2979ff' :disabled="true"/>
								</view>
								<view>{{item.name}}</view>
							</label>
						</radio-group>
						
					</view>
				</view>
				<view class="box_item" @click="gobrand" v-if="data.BrandModel.ExistBrandId>0">
					<view class="box_item_l">关联品牌</view>
					<view class="box_item_r" style="display: flex;align-items: center;justify-content: flex-end;">
						<span style="color: #F70027;font-size: 13px;">查看详情</span>
						<u-icon name="arrow" color="#A5A4AC" size="30" ></u-icon>
					</view>
				</view>
			</view>
			<!-- 载体 -->
			<view v-if="data.FirstShopType==2">
				<view class="box_title">
					<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/carrierinformation.png" ></image>
				</view>
				<view class="box_item">
					<view class="box_item_l">载体名称</view>
					<view class="box_item_r">{{data.CarrierModel.CarrierName?data.CarrierModel.CarrierName:''}}</view>
				</view>
				<view class="box_item">
					<view class="box_item_l">开发商</view>
					<view class="box_item_r">{{data.CarrierModel.Developers?data.CarrierModel.Developers:''}}</view>
				</view>
			
				<view class="box_item">
					<view class="box_item_l">Logo</view>
					<view class="box_item_r" v-if="data.CarrierModel.Logo && data.CarrierModel.Logo!=''">
						<image :src="data.CarrierModel.Logo" style="width: 120rpx;height: 120rpx;" mode="aspectFill" @click="previewImage([data.CarrierModel.Logo],1)"></image>
					</view>
					<view class="box_item_r" v-else></view>
				</view>
				<view class="box_item">
					<view class="box_item_l">介绍图</view>
					<view class="box_item_r" style="display: flex;flex-wrap: wrap;">
						<view style="width: 100%;" v-if="data.CarrierModel.BannerList &&data.CarrierModel.BannerList.length>0">
							<image v-for="(x,y) in data.CarrierModel.BannerList" :src="x" style="width: 120rpx;height: 120rpx;border-radius: 4px;margin-left: 10px;" @click="previewImage(data.CarrierModel.BannerList,y)"></image>
						</view>
						<view v-else>无</view>
					</view>
				</view>
				<view class="box_item">
					<view class="box_item_l">载体视频</view>
					<view class="box_item_r" style="display: flex;justify-content: flex-end;">
						<span v-if="!data.CarrierModel.VideoUrl && data.CarrierModel.VideoUrl==''">无</span>
					
						<view style="width: 150px; height: 200px;position: relative;" v-else>
							<video id="myVideo2" :src="data.CarrierModel.VideoUrl"
								style="width: 100%;height: 100%;"
								:controls='controls'
								:show-center-play-btn='false'
								:show-fullscreen-btn='false' 
								@fullscreenchange='videoControl' ></video>
								<view style="width: 100%;height: 100%;position: absolute;left: 0;top: 0;display: flex;align-items: center;justify-content: center;" @click="enlarge(2)">
									<u-icon name="play-circle-o" :size="70" color="#FFF"></u-icon>
								</view>
								
						</view>
					</view>
				</view>
				
				<view class="box_item" @click="goMap()">
					<view class="box_item_l">项目地址</view>
					
					<view class="box_item_r" style="display: flex;align-items: center;justify-content: flex-end;">
						{{data.CarrierModel.Address?data.CarrierModel.Address:''}}
						<u-icon name="arrow" color="#A5A4AC" size="30" ></u-icon>
					</view>
				</view>
				
				<view class="box_item">
					<view class="box_item_l">经纬度</view>
					<view class="box_item_r">{{data.CarrierModel.LatAndLon?data.CarrierModel.LatAndLon:''}}</view>
				</view>
				<view class="box_item">
					<view class="box_item_l">开业时间</view>
					<view class="box_item_r">{{data.CarrierModel.OpenTime?data.CarrierModel.OpenTime.split('T')[0]:''}}</view>
				</view>
				<view class="box_item">
					<view class="box_item_l">项目类型</view>
					<view class="box_item_r">{{data.CarrierModel.ProjectName?data.CarrierModel.ProjectName:''}}</view>
				</view>
				<view class="box_item">
					<view class="box_item_l">商业体量</view>
					<view class="box_item_r">{{data.CarrierModel.CarrierSize?data.CarrierModel.CarrierSize+'万平方米':''}}</view>
				</view>
				<view class="box_item">
					<view class="box_item_l">商业层数</view>
					<view class="box_item_r">{{data.CarrierModel.LayersNum?data.CarrierModel.LayersNum:''}}</view>
				</view>
				<view class="box_item">
					<view class="box_item_l">车位数量</view>
					<view class="box_item_r">{{data.CarrierModel.CarNum?data.CarrierModel.CarNum:0}}</view>
				</view>
				<view class="box_item">
					<view class="box_item_l">业态规则</view>
					<view class="box_item_r">{{data.CarrierModel.CarrierPlan?data.CarrierModel.CarrierPlan:''}}</view>
				</view>
				<view class="box_item">
					<view class="box_item_l">招引目标</view>
					<view class="box_item_r">{{data.CarrierModel.CarrierTarget?data.CarrierModel.CarrierTarget:''}}</view>
				</view>
				<view class="box_item">
					<view class="box_item_l">总体定位</view>
					<view class="box_item_r">{{data.CarrierModel.Location?data.CarrierModel.Location:''}}</view>
				</view>
				<view class="box_item">
					<view class="box_item_l">目标人群</view>
					<view class="box_item_r">{{data.CarrierModel.Crowd?data.CarrierModel.Crowd:''}}</view>
				</view>
				<view class="box_item">
					<view class="box_item_l">地铁信息</view>
					<view class="box_item_r" v-if="data.CarrierModel.CarrierMetroList && data.CarrierModel.CarrierMetroList.length>0">
						<view v-for="(x,y) in data.CarrierModel.CarrierMetroList" :key='y'>
							{{x.MetroNum}}号线{{x.MetroName}},{{x.Distance}}
						</view>
					</view>
					<view class="box_item_r" v-else>
						无
					</view>
				</view>
				<view class="box_item" @click="gozaiti" v-if="data.CarrierModel.ExistCarrierId>0">
					<view class="box_item_l">关联详情</view>
					<view class="box_item_r" style="display: flex;align-items: center;justify-content: flex-end;">
						<span style="color: #F70027;font-size: 13px;">查看详情</span>
						<u-icon name="arrow" color="#A5A4AC" size="30" ></u-icon>
					</view>
				</view>
			
			</view>
		</view>
		<u-popup v-model="showModal" mode="center" length="80%">
			<view style='display: flex;flex-direction: column;align-items: center;background: #fff;'>
				<view style="display: flex;align-items: center;justify-content: center;height:70px ;" v-if="examineMsg.CompanyStatus==1">
					<Text >是否同意审核？</Text>
				</view>
				<view style="display: flex;flex-direction: column;height:100px ;width: 100%;padding: 15px;" v-if='examineMsg.CompanyStatus==2'>
					<Text style='margin-top: 5px;margin-bottom: 10px;font-size: 16px;'>拒绝理由</Text>
					<view>
						<input type="text" placeholder="输入理由"
						  v-model="examineMsg.Remark">
					</view>
				
					
				</view>
				<view style="display: flex;flex-direction: row;align-items: center;height: 50px;border-top: 1px solid #F5F5F5;width: 100%;">
					<view style="width: 50%;display: flex;align-items: center;justify-content: center" @click="showModal=false">
						<Text>取消</Text>
					</view>
					<view style="width: 50%;color: #a0cfff;display: flex;align-items: center;justify-content: center" @click="confirm">
						<Text>确定</Text>
					</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	
	export default {
		
		data() {
			return {
				mainColor: '',
				loading:false,
				CompanyId:0,
				data:null,
				radiolist:[{Id:1,name:'是'},{Id:0,name:'否'},],
				brandList:[
					{name: "店铺开口尺寸",field: "IsShopSize",value:'ShopSize'},
					{name: "燃气",field: "RanQi",value:'RanQiBZ'},
					{name: "排烟量",field: "PaiYan",value:'PaiYanBZ'},
					{name: "电量",field: "IsDianLiang",value:'DianLiang'},
					{name: "上下水",field: "Plumbing",},
					{name: "管径",field: "Caliber",},
					{name: "排污",field: "Sewage",},
					{name: "空调",field: "KongTiao",},
					{name: "新风",field: "XinFeng",},
				],
				showModal:false,
				examineMsg:{
					CompanyId:0,
					CompanyStatus:1,
					Remark:'',
				},
				controls:false,//显示默认控件
			};
		},
		onLoad(options) {
			if(options && options.CompanyId){
				this.CompanyId = options.CompanyId
			}
			this.getdetails()
		},
		created() {
			this.mainColor = this.$uiConfig.mainColor;
		},
		mounted() {
			uni.setNavigationBarTitle({
				title: '认证详情',
			});
			
			
		},
		methods: {
			getdetails(){
				this.request2(
					{
						url: '/api/AppletTrade/GetAdminCompany',
						data: {CompanyId:this.CompanyId}
					},
					res => {
						if(res.resultCode==1){
							this.data = res.data;
							this.examineMsg.CompanyId = this.data.CompanyId;
						}
					}
				);
			},
			previewImage(imgs,i) {
				uni.previewImage({
					urls: imgs,
					current: i,
				});
			},
			adopt(type){
				this.showModal= true;
				this.examineMsg.CompanyStatus = type;
				this.examineMsg.Remark = '';
			},
			
			confirm(){//调取审核接口
				
				if(this.examineMsg.CompanyStatus==2 && this.examineMsg.Remark=='' ){
					uni.showToast({
						title:'请输入拒绝理由',
						icon:'none'
					})
				}
				uni.showLoading({
					title:'提交中...'
				})
				let pages = getCurrentPages(); // 当前页面
				let beforePage = pages[pages.length - 2]; // 前一个页面
				let that = this
				this.request2(
					{
						url: '/api/AppletTrade/UpdateAdminCompanyStatus',
						data: that.examineMsg
					},
					res => {
						if(res.resultCode==1){
							uni.showToast({
								title:res.message,
								icon:'none'
							})
							setTimeout(()=>{
								 uni.navigateBack({
									 success: function() {
										beforePage.$vm.getchildren(); // 执行前一个页面的方法
									 }
								 });
							},1000)
							
						}
						this.showModal= false;
						uni.hideLoading()
					},
					failed=>{
						this.showModal= false;
						uni.hideLoading()
					}
				);
				
			},
			goMap() {
				let lat= parseFloat(this.data.CarrierModel.LatAndLon.split(',')[0])
				let lon= parseFloat(this.data.CarrierModel.LatAndLon.split(',')[1])
				wx.openLocation({
				  latitude:lat,
				  longitude:lon,
				  scale: 18,
				  
				  // address:"武侯区科华中路 2 号",
				  success:(res)=>{
					  console.log(res)
				  },
				  fail: (err) => {
				  	console.log(err)
				  }
				})
			},
			enlarge(type) {
				// 全屏
				
				this.videoContext = uni.createVideoContext('myVideo'+type);
				this.videoContext.requestFullScreen({
					direction:0
				})
				
			},
			videoControl(e){
				if(e.detail.fullScreen==false){
					this.videoContext.stop()
					this.controls=false
				}else{
					this.videoContext.play()
					this.controls=true
				}
			},
			gozaiti(){//查看载体详情
				uni.navigateTo({
					url: '/pages/kotra/carrier/detail?id=' + this.data.CarrierModel.ExistCarrierId+'&type='+this.data.CarrierModel.ProjectName
				})
			},
			gobrand(){
				uni.navigateTo({
					
					url: '/pages/kotra/brand/detail?id=' +  this.data.BrandModel.ExistBrandId,
				})
				
			}
		
		
			
		}
	};
</script>

