<template>
	<view class="pb100">
		<view class="agreement-box d-c d-c-c">
			<view class="agreement-content">{{ $t('CK_KS_97') }}</view>
			<button class="agreement-btn"
				@click="dowloadPDF('https://hzs-in.oss-cn-beijing.aliyuncs.com/agreement.pdf',`${$t('CK_KS_96')}.pdf`)">{{ $t('CK_KS_96') }}</button>
		</view>
		<view class="form-title">{{ $t('CK_KS_27') }}</view>
		<view class="form-group">
			<view class="form-item">
				<view class="form-label">
					<text class="domation mr10">*</text>
					{{ $t('MN_T_1') }}
				</view>
				<view class="disabled-input">{{memberCode}}</view>
			</view>
			<view class="form-item">
				<view class="form-label">
					<text class="domation mr10">*</text>
					{{ $t('CK_KS_14') }}
				</view>
				<view class="disabled-input">{{ memberName }}</view>
			</view>
			<view class="form-item">
				<view class="form-label">
					<text class="domation mr10">*</text>
					{{ $t('CK_KS_98') }}
				</view>
				<input class="form-input" type="text" value="" v-model="form.storeName" :placeholder="$t('S_C_70')" />
			</view>
			<view class="form-item">
				<view class="form-label">
					<text class="domation mr10">*</text>
					{{ $t('CK_KS_32') }}
				</view>
				<input class="form-input" type="text" value="" v-model="form.licenseName" :placeholder="$t('S_C_70')" />
			</view>
			<view class="form-item">
				<view class="form-label">
					<text class="domation mr10">*</text>
					{{ $t('CK_KS_33') }}
				</view>
				<input class="form-input" type="text" v-model="form.creditCode" value="" :placeholder="$t('S_C_70')" />
			</view>
			<view class="form-item">
				<view class="form-label">
					<text class="domation mr10">*</text>
					{{ $t('CK_KS_34') }}
				</view>
				<input class="form-input" type="text" value="" v-model="form.legalName" :placeholder="$t('S_C_70')" />
			</view>
			<view class="form-item">
				<view class="form-label">
					<text class="domation mr10">*</text>
					{{ $t('CK_KS_35') }}
				</view>
				<input class="form-input" type="text" value="" v-model="form.legalIdCard" :placeholder="$t('S_C_70')" />
			</view>
			<view class="form-item">
				<view class="form-tips">
					<text class="domation mr10">*</text>
					{{ $t('CK_KS_36') }}
				</view>
			</view>
			<view class="form-item">
				<view class="form-label">
					<text class="domation mr10">*</text>
					{{ $t('CK_KS_37') }}
				</view>
				<input class="form-input" disabled type="text" :value="getAddName('license')"
					@click="showMulLinkageThreePicker('license')" />
				<text class="icon iconfont icon-jiantou"></text>
			</view>
			<view class="form-item">
				<view class="form-label">
					<text class="domation mr10">*</text>
					{{ $t('S_C_27') }}
				</view>
				<textarea auto-height class="form-textarea" value="" v-model="form.licenseAddress" placeholder="" />
			</view>
			<view class="form-item">
				<view class="form-label">
					<text class="domation mr10">*</text>
					{{ $t('S_C_86') }}
				</view>
				<input class="form-input" type="text" value="" v-model="form.storePerson" :placeholder="$t('S_C_70')" />
			</view>
			<view class="form-item">
				<view class="form-label">
					<text class="domation mr10">*</text>
					{{ $t('w_0052') }}
				</view>
				<input class="form-input" type="text" value="" v-model="form.storePhone" :placeholder="$t('S_C_70')" />
			</view>
			<view class="form-item">
				<view class="form-label">
					<text class="domation mr10">*</text>
					{{ $t('S_C_86') }}{{ $t('S_C_88') }}
				</view>
				<input class="form-input" disabled type="text" :value="getAddName('store')"
					@click="showMulLinkageThreePicker('store')" placeholder="省市区" />
				<text class="icon iconfont icon-jiantou"></text>
			</view>
			<view class="form-item">
				<view class="form-label">
					<text class="domation mr10">*</text>
					{{ $t('S_C_86') }}{{ $t('S_C_27') }}
				</view>
				<textarea auto-height class="form-textarea" value="" v-model="form.storeAddress" placeholder="" />
			</view>
			<picker :range="accountList" :value="bank_index" @change="bindPickerChange" range-key="bankName">
				<view class="form-item">
					<view class="form-label">
						<text class="domation mr10">*</text>
						{{ $t('CK_KS_41') }}
					</view>
					<input class="form-input" disabled type="text"
						:value="bank_index == -1 ? $t('CK_KS_38') : accountList[bank_index].bankName" placeholder="" />
					<text class="icon iconfont icon-jiantou"></text>
				</view>
			</picker>
			<view class="form-item">
				<view class="form-label">
					<text class="domation mr10">*</text>
					{{ $t('CK_KS_42') }}
				</view>
				<input class="form-input" type="text" value="" v-model="form.bankAccount" :placeholder="$t('S_C_70')+$t('CK_KS_42')" />
			</view>
			<!-- 		<view class="form-item">
				<view class="form-label">
					<text class="domation mr10">*</text>
					联系方式
				</view>
				<input class="form-input" type="text" value="" placeholder="请输入联系方式" />
			</view> -->
			<view class="form-item">
				<view class="form-label">
					<text class="domation mr10">*</text>
					{{ $t('CK_KS_43') }}
				</view>
				<input class="form-input" type="text" value="" v-model="form.bankBranch" :placeholder="$t('w_0272')" />
			</view>
			<view class="form-upload">
				<view class="form-upload-name">
					<text class="domation mr10">*</text>
					{{ $t('CK_KS_99') }}
				</view>
				<view class="form-upload-tips">{{ $t('CK_KS_45') }}</view>
				<view class="d-s-c f-w">
					<view>
						<image @click="clearImage('storeSign',10)" v-if="form.storeSign" class="upload-add"
							:src="form.storeSign || '/static/default.png' " mode=""></image>
						<image @click="openUpload('storeSign', 10)" v-else class="upload-add"
							src="/static/icon/upload-add.png" mode=""></image>
					</view>
				</view>
				<view class="form-upload-tips2">
					<view>{{ $t('CK_KS_91') }}</view>
					<view>{{ $t('CK_KS_49') }}</view>
					<view>{{ $t('CK_KS_50') }}</view>
				</view>
			</view>
		</view>
		<view class="form-title">{{ $t('CK_KS_53') }}</view>
		<view class="form-group">
			<view class="form-upload">
				<view class="form-upload-name">
					<text class="domation mr10">*</text>
					{{ $t('CK_KS_54') }}
				</view>
				<view class="form-upload-tips">{{ $t('CK_KS_55') }}</view>
				<view class="d-s-c f-w">
					<view>
						<image @click="clearImage('legalCardFront',11)" v-if="form.legalCardFront" class="upload-add"
							:src="form.legalCardFront || '/static/default.png'" mode=""></image>
						<image @click="openUpload('legalCardFront', 11)" v-else class="upload-add"
							src="/static/icon/upload-add.png" mode=""></image>
					</view>
					<view>
						<image @click="clearImage('legalCardBack',12)" v-if="form.legalCardBack" class="upload-add"
							:src="form.legalCardBack || '/static/default.png'" mode=""></image>
						<image @click="openUpload('legalCardBack', 12)" v-else class="upload-add"
							src="/static/icon/upload-add.png" mode=""></image>
					</view>
				</view>
				<view class="form-upload-tips2">
					<view>{{ $t('CK_KS_91') }}</view>
					<view>{{ $t('CK_KS_49') }}</view>
					<view>{{ $t('CK_KS_50') }}</view>
				</view>
			</view>
		</view>
		<view class="form-group">
			<view class="form-upload">
				<view class="form-upload-name">
					<text class="domation mr10">*</text>
					{{ $t('CK_KS_56') }}
				</view>
				<view class="form-upload-tips">{{ $t('CK_KS_45') }}</view>
				<view class="d-s-c f-w">
					<view>
						<image @click="clearImage('license',13)" v-if="form.license" class="upload-add"
							:src="form.license || '/static/default.png'" mode=""></image>
						<image @click="openUpload('license', 13)" v-else class="upload-add"
							src="/static/icon/upload-add.png" mode=""></image>
					</view>
				</view>
				<view class="form-upload-tips2">
					<view>{{ $t('CK_KS_91') }}</view>
					<view>{{ $t('CK_KS_49') }}</view>
					<view>{{ $t('CK_KS_50') }}</view>
				</view>
			</view>
		</view>
		<view class="form-group">
			<view class="form-upload">
				<view class="form-upload-name">
					<text class="domation mr10">*</text>
					{{ $t('CK_KS_100') }}
				</view>
				<view class="form-upload-tips">{{ $t('CK_KS_45') }}</view>
				<view class="d-s-c f-w">
					<view v-for="(item, index) in form.storeAgreementList" :key="index">
						<image @click="clearImage('storeAgreementList',14, index)" class="upload-add"
							:src="item || '/static/default.png'" mode="aspectFill"></image>
					</view>
					<view>
						<image @click="openUpload('storeAgreementList', 14)" class="upload-add"
							src="/static/icon/upload-add.png" mode=""></image>
					</view>
				</view>
				<view class="form-upload-tips2">
					<view>{{ $t('CK_KS_91') }}</view>
					<view>{{ $t('CK_KS_49') }}</view>
					<view>{{ $t('CK_KS_50') }}</view>
				</view>
			</view>
		</view>
		<view class="form-group">
			<view class="form-upload">
				<view class="form-upload-name">
					<text class="domation mr10">*</text>
					{{ $t('CK_KS_60') }}
				</view>
				<view class="form-upload-tips">{{ $t('CK_KS_93') }}</view>
				<view class="d-s-s f-w">
					<view class="" style="margin-right: 16rpx;width: 142rpx;">
						<image @click="clearImage('videoDoorhead',1)" v-if="form.videoDoorhead"
							:src="form.videoDoorhead+'?x-oss-process=video/snapshot,t_0,m_fast,f_jpg,w_0,h_0,ar_auto' || '/static/default.png'"
							style="margin-right: 0;" class="upload-add" mode="">
						</image>
						<image @click="openUpload('videoDoorhead', 1)" v-else style="margin-right: 0;"
							class="upload-add" src="/static/icon/upload-add.png" mode="">
						</image>
						<view class="text-ellipsis-2 tc f20 gray9">{{ $t('CK_KS_62') }}</view>
					</view>
					<view class="" style="margin-right: 16rpx;width: 142rpx;">
						<image @click="clearImage('videoStore',2)" v-if="form.videoStore"
							:src="form.videoStore+'?x-oss-process=video/snapshot,t_0,m_fast,f_jpg,w_0,h_0,ar_auto' || '/static/default.png'"
							style="margin-right: 0;" class="upload-add" mode="">
						</image>
						<image @click="openUpload('videoStore', 2)" v-else style="margin-right: 0;" class="upload-add"
							src="/static/icon/upload-add.png" mode="">
						</image>
						<view class="text-ellipsis-2 tc f20 gray9">{{ $t('CK_KS_64') }}</view>
					</view>
					<view class="" style="margin-right: 16rpx;width: 142rpx;">
						<image @click="clearImage('videoProduct',3)" v-if="form.videoProduct"
							:src="form.videoProduct+'?x-oss-process=video/snapshot,t_0,m_fast,f_jpg,w_0,h_0,ar_auto' || '/static/default.png'"
							style="margin-right: 0;" class="upload-add" mode="">
						</image>
						<image @click="openUpload('videoProduct', 3)" v-else style="margin-right: 0;" class="upload-add"
							src="/static/icon/upload-add.png" mode="">
						</image>
						<view class="text-ellipsis-2 tc f20 gray9">{{ $t('CK_KS_65') }}</view>
					</view>
				</view>
				<view class="form-upload-tips2">
					<view>{{ $t('CK_KS_92') }}</view>
					<view>{{ $t('CK_KS_66') }}</view>
				</view>
			</view>
		</view>
		<view class="form-group">
			<view class="form-upload">
				<view class="form-upload-name">
					<text class="domation mr10">*</text>
					{{ $t('CK_KS_67') }}
				</view>
				<view class="form-upload-tips">{{ $t('CK_KS_45') }}</view>
				<view class="d-s-s f-w">
					<view class="mb20" style="margin-right: 16rpx;width: 142rpx;">
						<view>
							<image @click="clearImage('imageDoorhead1',21)" v-if="form.imageDoorhead1"
								style="margin-right: 0;" class="upload-add"
								:src="form.imageDoorhead1 || '/static/default.png'" mode=""></image>
							<image @click="openUpload('imageDoorhead1', 21)" v-else class="upload-add"
								src="/static/icon/upload-add.png" mode=""></image>
						</view>
						<view class="text-ellipsis-2 tc f20 gray9">{{ $t('CK_KS_62') }}</view>
					</view>
					<view class="mb20" style="margin-right: 16rpx;width: 142rpx;">
						<view>
							<image @click="clearImage('imageExperience1',23)" v-if="form.imageExperience1"
								style="margin-right: 0;" class="upload-add"
								:src="form.imageExperience1 || '/static/default.png'" mode="">
							</image>
							<image @click="openUpload('imageExperience1', 23)" v-else class="upload-add"
								src="/static/icon/upload-add.png" mode=""></image>
						</view>
						<view class="text-ellipsis-2 tc f20 gray9">{{ $t('CK_KS_68') }}</view>
					</view>
					<view class="mb20" style="margin-right: 16rpx;width: 142rpx;">
						<image @click="clearImage('imageMeeting1',25)" v-if="form.imageMeeting1"
							style="margin-right: 0;" class="upload-add"
							:src="form.imageMeeting1 || '/static/default.png'" mode=""></image>
						<image @click="openUpload('imageMeeting1', 25)" v-else class="upload-add"
							src="/static/icon/upload-add.png" mode=""></image>
						<view class="text-ellipsis-2 tc f20 gray9">{{ $t('CK_KS_69') }}</view>
					</view>
					<view class="mb20" style="margin-right: 16rpx;width: 142rpx;">
						<image @click="clearImage('imageProduct1',27)" v-if="form.imageProduct1"
							style="margin-right: 0;" class="upload-add"
							:src="form.imageProduct1 || '/static/default.png'" mode=""></image>
						<image @click="openUpload('imageProduct1', 27)" v-else class="upload-add"
							src="/static/icon/upload-add.png" mode=""></image>
						<view class="text-ellipsis-2 tc f20 gray9">{{ $t('CK_KS_70') }}</view>
					</view>
					<view class="mb20" style="margin-right: 16rpx;width: 142rpx;">
						<image @click="clearImage('imageDoorhead2',22)" v-if="form.imageDoorhead2"
							style="margin-right: 0;" class="upload-add"
							:src="form.imageDoorhead2 || '/static/default.png'" mode=""></image>
						<image @click="openUpload('imageDoorhead2', 22)" v-else class="upload-add"
							src="/static/icon/upload-add.png" mode=""></image>
						<view class="text-ellipsis-2 tc f20 gray9">{{ $t('CK_KS_62') }}</view>
					</view>
					<view class="mb20" style="margin-right: 16rpx;width: 142rpx;">
						<image @click="clearImage('imageExperience2',24)" v-if="form.imageExperience2"
							style="margin-right: 0;" class="upload-add"
							:src="form.imageExperience2 || '/static/default.png'" mode=""></image>
						<image @click="openUpload('imageExperience2', 24)" v-else class="upload-add"
							src="/static/icon/upload-add.png" mode=""></image>
						<view class="text-ellipsis-2 tc f20 gray9">{{ $t('CK_KS_68') }}</view>
					</view>
					<view class="mb20" style="margin-right: 16rpx;width: 142rpx;">
						<image @click="clearImage('imageMeeting2',26)" v-if="form.imageMeeting2"
							style="margin-right: 0;" class="upload-add"
							:src="form.imageMeeting2 || '/static/default.png'" mode=""></image>
						<image @click="openUpload('imageMeeting2', 26)" v-else class="upload-add"
							src="/static/icon/upload-add.png" mode=""></image>
						<view class="text-ellipsis-2 tc f20 gray9">{{ $t('CK_KS_69') }}</view>
					</view>
					<view class="mb20" style="margin-right: 16rpx;width: 142rpx;">
						<image @click="clearImage('imageProduct2',28)" v-if="form.imageProduct2"
							style="margin-right: 0;" class="upload-add"
							:src="form.imageProduct2 || '/static/default.png'" mode=""></image>
						<image @click="openUpload('imageProduct2', 28)" v-else class="upload-add"
							src="/static/icon/upload-add.png" mode=""></image>
						<view class="text-ellipsis-2 tc f20 gray9">{{ $t('CK_KS_70') }}</view>
					</view>
					<view class="mb20" style="margin-right: 16rpx;width: 142rpx;">
						<image @click="clearImage('imageLounge1',29)" v-if="form.imageLounge1" style="margin-right: 0;"
							class="upload-add" :src="form.imageLounge1 || '/static/default.png'" mode=""></image>
						<image @click="openUpload('imageLounge1', 29)" v-else class="upload-add"
							src="/static/icon/upload-add.png" mode=""></image>
						<view class="text-ellipsis-2 tc f20 gray9">{{ $t('CK_KS_71') }}</view>
					</view>
					<view class="mb20" style="margin-right: 16rpx;width: 142rpx;">
						<image @click="clearImage('imageLounge2',30)" v-if="form.imageLounge2" style="margin-right: 0;"
							class="upload-add" :src="form.imageLounge2 || '/static/default.png'" mode=""></image>
						<image @click="openUpload('imageLounge2', 30)" v-else class="upload-add"
							src="/static/icon/upload-add.png" mode=""></image>
						<view class="text-ellipsis-2 tc f20 gray9">{{ $t('CK_KS_71') }}</view>
					</view>
				</view>
				<view class="form-upload-tips2">
					<view>{{ $t('CK_KS_91') }}</view>
					<view>{{ $t('CK_KS_49') }}</view>
					<view>{{ $t('CK_KS_50') }}</view>
				</view>
			</view>
		</view>
		<button class="normal-sub-btn" style="margin-top: 37rpx;" v-if="type == 'apply'" @click="subFunc">{{ $t('CK_KS_72') }}</button>
		<button class="normal-sub-btn" style="margin-top: 37rpx;" v-if="type == 'edit'" @click="subFunc">{{ $t('CK_KS_20') }}</button>
		<mpvue-city-picker v-if="is_load" ref="mpvueCityPicker" :province="province" :city="city" :area="area"
			:pickerValueDefault="cityPickerValueDefault" @onConfirm="onConfirm"></mpvue-city-picker>
		<!--上传图片-->
		<!-- storeType = 3经销商  fileType -->
		<!-- fileType 1=门头展示，2=店内视频，3=产品视频，10=标志，11=法人正面，12=法人反面，13=营业执照，14=协议，21=门头展示1，22=门头展示2，23=体验区1，24=体验区2，25=会议室1, 26=会议室2, 27=产品展示1, 28=产品展示2, 29=休息室1, 30=休息室2 -->
		<Upload :isVideo="isVideo" :num="1" v-if="isUpload" :storeType="form.storeType" :fileType="fileType"
			@getImgs="getImgsFunc">
		</Upload>
	</view>
</template>

<script>
	import mpvueCityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue';
	import Upload from '@/components/upload/upload-maker.vue';
	import utils from '@/common/utils.js';
	export default {
		components: {
			mpvueCityPicker,
			Upload
		},
		data() {
			return {
				isVideo: false,
				type: 'apply',
				memberCode: '',
				memberName: '',
				form: {
					storeType: 2, //店铺类型（1=创客空间，2=超级工作室）
					storeName: '', //名称
					licenseName: '', //营业执照名称
					creditCode: '', //统一社会信用代码
					legalName: '', //法人姓名
					legalIdCard: '', //法人身份证号
					licenseProvince: '', //营业执照省
					licenseCity: 2, //营业执照市
					licenseCounty: 3, //营业执照县
					licenseAddress: '', //营业执照详细地址
					storePerson: '', //联系人
					storePhone: '', //联系方式
					storeProvince: '', //详细地址省
					storeCity: 2, //详细地址市
					storeCounty: 3, //详细地址县
					storeAddress: '', //详细地址
					pkBank: '', //银行
					bankAccount: '', //银行账号
					bankBranch: '', //开启运行
					storeSign: '', //标志
					legalCardFront: '', //法人身份证正面
					legalCardBack: '', //法人身份证反面
					license: '', //营业执照
					storeAgreementList: [], //店铺协议列表
					videoDoorhead: '', //门店门头视频
					videoStore: '', //门店店内视频
					videoProduct: '', //门店产品视频
					imageDoorhead1: '', //门店门头图片1
					imageDoorhead2: '', //门店门头图片2
					imageExperience1: '', //门店{{ $t('CK_KS_68') }}图片1
					imageExperience2: '', //门店{{ $t('CK_KS_68') }}图片2
					imageMeeting1: '', //门店{{ $t('CK_KS_69') }}图片1
					imageMeeting2: '', //门店{{ $t('CK_KS_69') }}图片2
					imageProduct1: '', //门店产品图片1
					imageProduct2: '', //门店产品图片2
					imageLounge1: '', //门店{{ $t('CK_KS_71') }}图片1
					imageLounge2: '' //门店{{ $t('CK_KS_71') }}图片2
				},
				isUpload: false,
				upload_type: '',
				bankloading: false,
				is_load: false,
				addressName: '',
				licenseValue: [0, 0, 0],
				storeValue: [0, 0, 0],
				cityPickerValueDefault: [0, 0, 0],
				province: [],
				city: [],
				area: [],
				bank_index: -1,
				accountList: [],
				/*是否已发验证码*/
				// is_send: false,
				/*发送按钮文本*/
				// send_btn_txt: '获取验证码',
				/*当前秒数*/
				// second: 60,
				fileType: 0
			};
		},
		onLoad(e) {
			this.type = e.type || 'detail';
		},
		mounted() {
			this.getBankData();
			this.getAreaData();
			this.getData();
		},
		methods: {
			// 获取省市区
			getAreaData() {
				let self = this;
				self._get('system/api/area/tree', {}, function(res) {
					self.province = res.data;
					self.is_load = true;
				});
			},
			/*三级联动选择*/
			showMulLinkageThreePicker(name) {
				this.addressName = name;
				this.cityPickerValueDefault = this[name + 'Value'];
				this.$refs.mpvueCityPicker.show();
			},

			/*确定选择的省市区*/
			onConfirm(e) {
				let self = this;
				self.form[self.addressName + 'Province'] = e.cityCode[0];
				self.form[self.addressName + 'City'] = e.cityCode[1];
				self.form[self.addressName + 'County'] = e.cityCode[2];
			},
			getAddName: function(type) {
				let self = this;
				let pid = 0;
				let cid = 0;
				let aid = 0;
				let defaultValue = [0, 0, 0];
				pid = self.form[type + 'Province'];
				cid = self.form[type + 'City'];
				aid = self.form[type + 'County'];
				defaultValue = self[type + 'Value'];
				let address = self.getAddressName(pid, cid, aid, defaultValue);
				return address;
			},
			/* 省市区回显 */
			getAddressName(pid, cid, aid, piker) {
				let self = this;
				/* 省市区列表 */
				if (!self.province) {
					return;
				}
				let add = '';
				let citydata = [];
				let areadata = [];
				self.province.forEach((item, index) => {
					if (item['id'] == pid) {
						add += item['name'];
						citydata = item['children'];
						piker[0] = index;
						citydata.forEach((citem, cindex) => {
							if (citem['id'] == cid) {
								add += citem['name'];
								areadata = citem['children'] ? citem['children'] : [];
								piker[1] = cindex;
								if (areadata) {
									areadata.forEach((aitem, aindex) => {
										if (aitem['id'] == aid) {
											add += aitem['name'];
											piker[2] = aindex;
											return;
										}
									});
								}
							}
						});
					}
				});
				return add;
			},
			/*获取银行数据*/
			getBankData() {
				let self = this;
				self.bankloading = true;
				self._get('system/api/bank/list', {}, function(res) {
					self.accountList = res.data;
					self.bankloading = false;
					uni.hideLoading();
				});
			},
			bindPickerChange: function(e) {
				if (this.type == 'detail') {
					return;
				}
				this.bank_index = e.detail.value;
				// console.log(this.bank_index);
				this.account_info = this.accountList[this.bank_index];
				this.form.pkBank = this.account_info.pkId;
			},
			getData() {
				let self = this;
				self._get(
					'member/api/maker-space/detail', {
						storeType: self.form.storeType
					},
					res => {
						self.memberCode = res.data.memberCode;
						self.memberName = res.data.memberName;
						utils.objForEach(self.form, (value, key) => {
							if (res.data[key]) {
								self.form[key] = res.data[key];
								console.log(self.form[key]);
							}
						});
					}
				);
			},
			subFunc() {
				let self = this;
				if (this.type == 'detail') {
					return;
				}
				let params = self.form;
				let flag = false;
				let values = [{
						name: `${this.$t('S_C_70')}${this.$t('CK_KS_30')}`,
						value: 'storeName',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: `${this.$t('S_C_70')}${this.$t('CK_KS_32')}`,
						value: 'licenseName',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: `${this.$t('S_C_70')}${this.$t('CK_KS_33')}`,
						value: 'creditCode',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: `${this.$t('S_C_70')}${this.$t('CK_KS_34')}`,
						value: 'legalName',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: `${this.$t('S_C_70')}${this.$t('CK_KS_35')}`,
						value: 'legalIdCard',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: `${this.$t('S_C_70')}${this.$t('CK_KS_37')}`,
						value: 'licenseProvince',
						callback: function(e) {
							return e > 0;
						}
					},
					{
						name: `${this.$t('S_C_70')}${this.$t('CK_KS_37')}`,
						value: 'licenseAddress',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: `${this.$t('S_C_70')}${this.$t('S_C_86')}`,
						value: 'storePerson',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: this.$t('w_0053'),
						value: 'storePhone',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: `${this.$t('CK_KS_38')}${this.$t('S_C_86')}${this.$t('S_C_88')}`,
						value: 'storeProvince',
						callback: function(e) {
							return e > 0;
						}
					},
					{
						name: `${this.$t('CK_KS_38')}${this.$t('S_C_86')}${this.$t('S_C_27')}`,
						value: 'storeAddress',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: this.$t('w_0270'),
						value: 'pkBank',
						callback: function(e) {
							return e > 0;
						}
					},
					{
						name: `${this.$t('CK_KS_38')}${this.$t('S_C_70')}${this.$t('CK_KS_42')}`,  
						value: 'bankAccount',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: this.$t('w_0272'),
						value: 'bankBranch',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: this.$t('CK_KS_76'),
						value: 'storeSign',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: this.$t('CK_KS_77'),
						value: 'legalCardFront',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: this.$t('CK_KS_78'),
						value: 'legalCardBack',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: this.$t('CK_KS_79'),
						value: 'license',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: this.$t('CK_KS_80'),
						value: 'storeAgreementList',
						callback: function(e) {
							return e.length > 0;
						}
					},
					{
						name: `${this.$t('MY_CK_16')}${this.$t('CK_KS_60')}${this.$t('CK_KS_62')}`,
						value: 'videoDoorhead',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: `${this.$t('MY_CK_16')}${this.$t('CK_KS_60')}${this.$t('CK_KS_64')}`,
						value: 'videoStore',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name:  `${this.$t('MY_CK_16')}${this.$t('CK_KS_60')}${this.$t('CK_KS_65')}`,
						value: 'videoProduct',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: `${this.$t('MY_CK_16')}${this.$t('CK_KS_67')}${this.$t('CK_KS_62')}1`,
						value: 'imageDoorhead1',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: `${this.$t('MY_CK_16')}${this.$t('CK_KS_67')}${this.$t('CK_KS_68')}1`,
						value: 'imageExperience1',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: `${this.$t('MY_CK_16')}${this.$t('CK_KS_67')}${this.$t('CK_KS_69')}1`,
						value: 'imageMeeting1',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: `${this.$t('MY_CK_16')}${this.$t('CK_KS_67')}${this.$t('CK_KS_70')}1`,
						value: 'imageProduct1',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: `${this.$t('MY_CK_16')}${this.$t('CK_KS_67')}${this.$t('CK_KS_62')}2`,
						value: 'imageDoorhead2',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: `${this.$t('MY_CK_16')}${this.$t('CK_KS_67')}${this.$t('CK_KS_68')}2`,
						value: 'imageExperience2',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: `${this.$t('MY_CK_16')}${this.$t('CK_KS_67')}${this.$t('CK_KS_69')}2`,
						value: 'imageMeeting2',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: `${this.$t('MY_CK_16')}${this.$t('CK_KS_67')}${this.$t('CK_KS_70')}2`,
						value: 'imageProduct2',
						callback: function(e) {
							return e != '';
						}
					},

					{
						name: `${this.$t('MY_CK_16')}${this.$t('CK_KS_67')}${this.$t('CK_KS_71')}1`,
						value: 'imageLounge1',
						callback: function(e) {
							return e != '';
						}
					},
					{
						name: `${this.$t('MY_CK_16')}${this.$t('CK_KS_67')}${this.$t('CK_KS_71')}2`,
						value: 'imageLounge2',
						callback: function(e) {
							return e != '';
						}
					},
				];
				values.forEach((item, index) => {
					if (!flag && !item.callback(params[item.value])) {
						flag = item.name;
						return;
					}
				});
				if (flag) {
					uni.showToast({
						title: flag,
						duration: 1000,
						icon: 'none'
					});
					return false;
				}
				self._post('member/api/maker-space/submit', params, res => {
					uni.showModal({
						content: res.msg,
						showCancel: false,
						success() {
							self.gotoPage('pages/self-service/super-studio/status');
						}
					});
				});
			},
			/*获取上传的图片*/
			getImgsFunc(e) {
				let self = this;
				self.isUpload = false;
				if (e && typeof e != 'undefined') {
					if (self.upload_type == 'storeAgreementList') {
						self.form.storeAgreementList.push(e[0].url);
					} else {
						self.form[self.upload_type] = e[0].url;
					}
				}
			},
			/*打开上传图片*/
			openUpload(type, fileType) {
				if (this.type == 'detail') {
					return;
				}
				if (fileType <= 3) {
					this.isVideo = true;
				} else {
					this.isVideo = false;
				}
				this.upload_type = type;
				this.fileType = fileType;
				this.isUpload = true;
			},
			clearImage(name, fileType, n) {
				let self = this;
				if (self.type == 'detail') {
					return;
				}
				let filePath = '';
				if (n || n === 0) {
					filePath = self.form[name][n];
				} else {
					filePath = self.form[name];
				}
				let url = 'member/api/maker-space/delete-file?storeType=2&fileType=' + fileType + '&filePath=' +
					filePath;
				self._delete(url, {}, res => {
					if (n || n === 0) {
						self.form[name].splice(n, 1);
					} else {
						self.form[name] = '';
					}
				})

			},
			dowloadPDF(e, name) {
				let self = this;
				uni.showLoading({
					title: '下载中..'
				});
				uni.downloadFile({
					url: e, //调接口返给的url
					success: function(res) {
						console.log(res);
						if (res.statusCode == 200) {
							var Path = res.tempFilePath; //调 uni.downloadFile成功之后，会返给tempFilePath
							uni.saveFile({
								tempFilePath: Path,
								success: function(result) {
									var savedFilePath = result.savedFilePath;
									self.fSetFileName(savedFilePath, name, e);
								},
								fail: err => {
									uni.showToast({
										title: '保存文件失败请重试',
										icon: 'none'
									});
									uni.hideLoading();
								}
							});
						} else {
							uni.showToast({
								title: '打开文件失败请重试',
								icon: 'none'
							});
						}
						uni.hideLoading();
					},
					fail: err => {
						uni.hideLoading();
						uni.showToast({
							title: '加载失败请重试',
							icon: 'none'
						});
					}
				});
			},
			// 获取已下载列表
			fGetSavedFileList() {
				uni.getSavedFileList({
					success: res => {
						res.fileList.forEach(oData => {
							let aRray = oData.filePath.split('/');
							let sFileName = aRray[aRray.length - 1].split('.')[0];
							if (parseFloat(sFileName).toString() == 'NaN') {
								//这里是过滤掉文件名是时间戳的文件
								console.log(res.fileList);
							} else {
								//这里是把时间戳的文件删掉
								plus.io.resolveLocalFileSystemURL(oData.filePath, entry => {
									//获取文件对象
									entry.remove(
										entry => {
											console.log('Remove succeeded');
										},
										e => {
											alert(e.message);
										}
									);
								});
							}
						});
					}
				});
			},
			fSetFileName(sFilePath, sFileName, e) {
				let self = this;
				var sFileName = sFileName.split('/')[sFileName.split('/').length - 1]; //原来的文件名
				var aFileUrl = sFilePath.split('/').splice(0, sFilePath.split('/').length - 1); //saveFile API保存的本地地址
				var url = e; //请求地址
				let dtask = plus.downloader.createDownload(
					url, {
						filename: '_downloads' + aFileUrl.join('/') + '/' + sFileName //利用保存路径，实现文件的重命名
					},
					(d, status) => {
						if (status == 200) {
							let fileSaveUrl = plus.io.convertLocalFileSystemURL(d.filename);
							self.fGetSavedFileList();
							console.log('-----------------');
							console.log(fileSaveUrl);
							// uni.openDocument({
							// 		filePath: escape(fileSaveUrl),
							// 		fail: e => {
							// 			console.log(JSON.stringify(e));
							// 			console.log(escape(fileSaveUrl));
							// 			console.log(e);
							// 			uni.showToast({
							// 				title: `打开失败`
							// 			});
							// 		}
							// 	});
							setTimeout(
								() =>
								uni.openDocument({
									filePath: fileSaveUrl,
									showMenu: false,
									success: function() {
										console.log('打开文档成功');
									},
									fail: function(e) {
										console.log(e);
										uni.showToast({
											title: '暂不支持此类型',
											duration: 2000,
											icon: 'none'
										});
									}
								}),
								1000
							);
						} else {
							//下载失败
							plus.downloader.clear(); //清除下载任务
						}
					}
				);
				dtask.setRequestHeader('Authorization', 'Bearer ' + uni.getStorageSync('SET_TOKEN'));
				dtask.start();
			},
		}
	};
</script>

<style lang="scss">
	.agreement-box {
		width: 750rpx;
		background: #ffffff;
		padding: 28rpx 22rpx;
		box-sizing: border-box;
		margin-top: 2rpx;
		margin-bottom: 20rpx;

		.agreement-content {
			font-size: 24rpx;
			font-family: SourceHanSansCN;
			font-weight: 400;
			color: #999999;
			line-height: 32rpx;
			word-break: break-all;
			margin-bottom: 32rpx;
		}

		.agreement-btn {
			min-width: 320rpx;
			height: 76rpx;
			line-height: 1.5;
			display: flex;
			justify-content: center;
			align-items: center;
			padding: 0 20rpx;
			box-sizing: border-box;
			background: #282828;
			border-radius: 38rpx;
			color: #ffffff;
			font-size: 24rpx;
		}
	}

	.form-title {
		width: 750rpx;
		height: 106rpx;
		background: #fb3024;
		padding-left: 44rpx;
		position: relative;
		box-sizing: border-box;
		font-size: 28rpx;
		color: #fff;
		line-height: 106rpx;
		font-weight: bold;
		z-index: 1;
	}

	.form-title::before {
		content: '';
		position: absolute;
		top: 0;
		bottom: 0;
		margin: auto;
		left: 25rpx;
		width: 6rpx;
		height: 24rpx;
		background-color: #fb3024;
		z-index: 1;
	}

	.form-group {
		padding: 0 22rpx;
		background: #ffffff;

		.form-item {
			min-height: 104rpx;
			box-sizing: border-box;
			padding: 15rpx 0;
			line-height: 1.5;
			display: flex;
			justify-content: center;
			align-items: center;
			border-bottom: 1rpx solid #eee;

			.icon-jiantou {
				font-size: 32rpx;
				color: 090000;
			}

			.form-tips {
				font-size: 24rpx;
				color: #999;
			}

			.form-label {
				width: 255rpx;
				flex-shrink: 0;
				word-break: break-all;
				margin-right: 20rpx;
			}

			.disabled-input {
				width: 450rpx;
				height: 78rpx;
				padding: 0 18rpx;
				line-height: 78rpx;
				background: #eee;
				font-size: 28rpx;
				color: #333;
				flex: 1;
			}

			.form-textarea {
				width: 450rpx;
				padding: 0 18rpx;
				line-height: 1.5;
				font-size: 28rpx;
				color: #333;
				flex: 1;
				background: #fff;
			}

			.form-input {
				width: 450rpx;
				height: 78rpx;
				padding: 0 18rpx;
				line-height: 78rpx;
				background: #fff;
				font-size: 28rpx;
				color: #333;
				flex: 1;
			}

			.form-item:last-child {
				border: none;
			}
		}
	}

	.form-upload {
		padding: 30rpx 23rpx;
	}

	.form-upload-name {
		font-size: 28rpx;
		color: #333;
		margin-bottom: 20rpx;
	}

	.form-upload-tips {
		font-size: 24rpx;
		color: #999;
		margin-bottom: 20rpx;
	}

	.form-upload-tips2 {
		font-size: 24rpx;
		color: #fb3024;
		line-height: 1.5;
	}

	.upload-add {
		width: 142rpx;
		height: 142rpx;
		margin-right: 18rpx;
		margin-bottom: 18rpx;
	}
	
</style>