<template>
	<view>
		<view class="width100 mart10 backcorfff">
			<view class="storelis">
				<view class="namecont">门店名称</view>
				<view class="font14 fcor333 text2 width75 fotrt">{{storeDesInfo.name}}</view>
			</view>
			<view class="storelis">
				<view class="namecont">门店ID</view>
				<view class="font14 fcor333 text2 width75 fotrt">{{storeDesInfo.storeNo}}</view>
			</view>
			<view class="storelis">
				<view class="namecont">所在城市</view>
				<view class="font14 fcor333 text2 width75 fotrt">
					{{storeDesInfo.storeRegion.provinceName}}-{{storeDesInfo.storeRegion.cityName}}-{{storeDesInfo.storeRegion.areaName}}
				</view>
			</view>
			<view class="storelis">
				<view class="namecont">门店地址</view>
				<view class="font14 fcor333 text2 width75 fotrt">{{storeDesInfo.storeRegion.address}}</view>
			</view>
			<view class="storelis">
				<view class="namecont">门店电话</view>
				<view class="font14 fcor333 text2 width75 fotrt">{{storeDesInfo.telephone}}</view>
			</view>
			<view class="storelis">
				<view class="namecont">经营品类</view>
				<view class="font14 fcor333 text2 width75 fotrt">
					{{storeDesInfo.storeIndustry.parentName}}-{{storeDesInfo.storeIndustry.childName}}
				</view>
			</view>
			<!-- <view class="width100 line10"></view> -->
			<view class="storelis">
				<view class="namecont">创建时间</view>
				<view class="font14 fcor333 text2 width75 fotrt">
					{{storeDesInfo.updateTime | timeFormat('yyyy-mm-dd')}}
					{{storeDesInfo.updateTime | timeFormat('hh:mm')}}
				</view>
			</view>
			<!-- <view class="storelis">
				<view class="namecont">公司名称</view>
				<view class="font14 fcor333 text2 width75 fotrt">{{storeDesInfo.blisName}}</view>
			</view>
			<view class="storelis">
				<view class="namecont">营业执照号</view>
				<view class="font14 fcor333 text2 width75 fotrt">{{storeDesInfo.blisNo}}</view>
			</view>
			<view class="storelis">
				<view class="namecont">营业期限</view>
				<view class="font14 fcor333 text2 width75 fotrt">{{storeDesInfo.blisPeriodEnd}}</view>
			</view> -->
			<view class="width100 line10"></view>
			<view class="storelis" style="border-bottom: 0px;">
				<view class="namecont">门店照片</view>
			</view>
			<view class="width94 displ">
				<image :src="storeimg" mode="widthFix" class="width30"
					@click="perImage(storeimg)" style="margin-left: 3%;"></image>
				<image :src="storeimg1" mode="widthFix" class="width30"
					@click="perImage(storeimg1)" style="margin-left: 3%;"></image>
				<image :src="storeimg2" mode="widthFix" class="width30"
					@click="perImage(storeimg2)" style="margin-left: 3%;"></image>
			</view>
			<!-- <view class="storelis" style="border-bottom: 0px;">
				<view class="namecont">其他凭证</view>
			</view>
			<view class="width94 displ marb15">
				<image src="../../../static/img/businesslic1.png" mode="widthFix" class="width30"
					@click="perImage('../../../static/img/businesslic1.png')" style="margin-left: 3%;"></image>
			</view> -->
		</view>
	</view>
</template>

<script>
	import {
		getStoreDetailById,
		getImgSignedUrl
	} from '../../../Utils/Api.js';
	let app = getApp();
	export default {
		data() {
			return {
				desId: '', //门店详情id
				storeDesInfo: '', //门店详情内容
				imageUrl: app.globalData.imgUrl,
				storeimg: '',
				storeimg1: '',
				storeimg2: ''
			}
		},
		onLoad(options) {
			this.desId = options.id;
			this.getStoreDetailById();
		},
		methods: {
			//查询门店详情
			getStoreDetailById() {
				uni.showLoading({
					title: '加载中...'
				})
				let datas = {
					storeId: this.desId
				}
				getStoreDetailById(datas).then(res => {
					uni.hideLoading();
					if (res.return_code == '000000') {
						this.storeDesInfo = res.return_data;
						this.getImgSignedUrl(1,res.return_data.doorHeadImg);
						this.getImgSignedUrl(2,res.return_data.cashRegisterImg);
						this.getImgSignedUrl(3,res.return_data.internalImg);
					} else {
						uni.showToast({
							title: res.return_msg,
							duration: 2000,
							icon: 'none'
						})
					}
				})
			},
			//查看临时图片路径
			getImgSignedUrl(item, item1) {
				let datas = {
					"fileUrl": item1
				}
				getImgSignedUrl(datas).then(res => {
					if (res.return_code == '000000') {
						if (item == 1) {
							this.storeimg = res.return_data;
						}
						if (item == 2) {
							this.storeimg1 = res.return_data;
						}
						if (item == 3) {
							this.storeimg2 = res.return_data;
						}

					}
				})
			},
			/**
			 * @param {Object} item 放大图片
			 */
			perImage(item) {
				uni.previewImage({
					current: 0, //预览图片的下标
					urls: [item] //预览图片的地址，必须要数组形式，如果不是数组形式就转换成数组形式就可以
				})
			},
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f6f6f6;
	}

	.storelis {
		width: calc(100% - 90upx);
		height: 100upx;
		display: flex;
		align-items: center;
		background-color: #FFFFFF;
		border-bottom: 1px solid #f6f6f6;
		padding: 8upx 45upx;

		.namecont {
			color: #666666;
			width: 25%;
		}
	}
</style>
