<!--
临时页面

-->
<template>
	<view class="box">
		<u-navbar :autoBack="true" title="志愿报名" bgColor="rgba(255,255,255,0)" :placeholder="true" titleStyle="font-weight:bold;color:#000000"></u-navbar>
		<view class="ban_box">
			<view class="ban_item2">
				<image class="top_img" src="https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/bm_top.png"></image>
			</view>
			<view class="ban_item1">
				<image class="top_img" src="https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/dt_ban2.png"></image>
			</view>
		</view>
		<!-- 表单 -->
		<view class="example">
			<uni-forms style="padding: 0 20rpx 0 20rpx" label-position="top" ref="valiForm" :rules="rules" :modelValue="valiFormData">
				<uni-forms-item v-if="shouldShowCrSelector" label="服务区域" label-width="100px" required>
					<view v-if="isDistrictEntry" class="service-area-trigger" @click="openServiceAreaPicker">
						<text :class="selectedServiceAreaTitle ? 'service-area-value' : 'service-area-placeholder'">
							{{ selectedServiceAreaTitle || `请选择服务区域` }}
						</text>
						<uni-icons type="bottom" size="16" color="#6a412c"></uni-icons>
					</view>
					<view v-else class="service-area-readonly">
						{{ selectedServiceAreaTitle || '暂无文物信息' }}
					</view>
				</uni-forms-item>
				<uni-forms-item label="您的姓名" label-width="80px" required name="name">
					<uni-easyinput v-model="valiFormData.name" placeholder="请输入姓名" />
				</uni-forms-item>
				<uni-forms-item label="您的联系电话" label-width="100px" required name="mobile">
					<uni-easyinput type="number" v-model="valiFormData.mobile" placeholder="请输入联系电话" />
				</uni-forms-item>

				<uni-forms-item label="您的身份证" label-width="100px" required name="id_card">
					<uni-easyinput type="idcard" v-model="valiFormData.id_card" placeholder="请输入身份证号" />
				</uni-forms-item>
				
				<uni-forms-item label="住址" label-width="100px" required name="address">
					<uni-easyinput v-model="valiFormData.address" placeholder="请输入住址" />
				</uni-forms-item>
				<uni-forms-item label="单位" label-width="80px" required name="unit_name">
					<uni-easyinput v-model="valiFormData.unit_name" placeholder="请输入单位名称" />
				</uni-forms-item>
				<!-- 		<uni-forms-item label="备注" label-width="80px" required name="notesVal">
					<uni-easyinput v-model="valiFormData.notesVal" placeholder="请输入申请类型(个人、家庭、机构)" />
				</uni-forms-item> -->

				<uni-forms-item label="相关特长" label-width="80px" required name="intro">
					<uni-easyinput type="textarea" v-model="valiFormData.intro" placeholder="请输入相关特长或个人介绍(可上传个人优秀证明、奖项)" />
					<view @click="chooseFile" class="scfj">
						<view>上传文件</view>
						<view>
							<uni-icons type="wallet" size="18"></uni-icons>
						</view>
					</view>
				</uni-forms-item>
				
				<!-- 政治面貌 -->
				<uni-forms-item label="政治面貌" label-width="100px" required name="political_status">
					<uni-data-select v-model="valiFormData.political_status" :localdata="politicalStatusList" placeholder="请选择政治面貌" />
				</uni-forms-item>
				
				<!-- 联系邮箱 -->
			<uni-forms-item label="联系邮箱" label-width="100px" name="email">
				<uni-easyinput type="email" v-model="valiFormData.email" placeholder="请输入联系邮箱" />
			</uni-forms-item>
			
			<uni-forms-item label="您的选择" label-width="100px" required v-if="valiFormData.type === 'volunteer'">
				<uni-data-picker v-model="region_id" :localdata="regionList" placeholder="请选择地区" popup-title="请选择所在地区" @change="onchange" @nodeclick="onnodeclick"></uni-data-picker>
			</uni-forms-item>
			<!-- 本人承诺 -->
				<uni-forms-item label="本人承诺" label-width="100px" required name="commitment" >
					<view class="commitment-text">
						本人保证以上所填信息真实、有效，如有虚假，由此产生的一切后果由本人承担。
					</view>
				  <view style="background-color: #fdfaf6;">
					<uni-data-checkbox v-model="valiFormData.commitment" :localdata="[
					  {value: 1, text: '我已阅读并同意以上承诺'},
					  {value: 0, text: '不同意'}
					]" />
				  </view>
				</uni-forms-item>
			</uni-forms>
		</view>
		<view class="text-wrapper_3" @click="submit('valiForm')">
      <view class="bm_tit">报名</view>
    </view>

		<u-picker
			keyName="title"
			:show="showServiceAreaPicker"
			:columns="serviceAreaColumns"
			:defaultIndex="serviceAreaDefaultIndex"
			@cancel="showServiceAreaPicker = false"
			@close="closeServiceAreaPicker"
			:closeOnClickOverlay="true"
			@confirm="confirmServiceArea"
		></u-picker>

    
    <!-- 对话框 -->
    <uni-popup ref="popup" type="center">
      <view class="modal-container">
        <text class="modal-title">{{ modalTitle }}</text>
        <view class="modal-content">
          <u-parse :content="modalContent"></u-parse>
        </view>
        <view class="modal-footer">
          <view class="modal-btn" @click="$refs.popup.close()">关闭</view>
        </view>
      </view>
    </uni-popup>
  </view>
</template>

<script>
import { mapGetters } from 'vuex';

let that;
export default {
	data() {
			return {
				regionList: [],
				region_id: null,
				entryRegionId: '',
				pendingRegionId: '',
				pendingRegionName: '',
				volunteerCrInfo: {},
				showServiceAreaPicker: false,
				selectedServiceAreaTitle: '',
				cr_id: '' /* 文物id */,
				modifyId: '' /* 修改资料的文物id */,
				volunteer_id: '' /* 志愿者id */,
				
				// 对话框相关变量
				showModal: false,
				modalContent: '' /* 对话框富文本内容 */,
        modalTitle: '' /* 对话框标题 */,
				
				// 性别列表
				genderList: [
				{ value: '男', text: '男' },
				{ value: '女', text: '女' }
			],
			
			// 政治面貌列表
			politicalStatusList: [
				{ value: '中共党员', text: '中共党员' },
				{ value: '中共预备党员', text: '中共预备党员' },
				{ value: '共青团员', text: '共青团员' },
				{ value: '民主党派', text: '民主党派' },
				{ value: '群众', text: '群众' }
			],
			typeOptions: [
				{ value: 'volunteer', text: '巡查守护' },
				{ value: 'xuanjiang', text: '宣讲' },
				{ value: 'publicize', text: '传播' }
			],
			
			
			/* 表单数据 */
			valiFormData: {
				name: '',
				mobile: '',
				address: '',
				id_card: '',
				unit_name: '',
				fullurl: '',
				intro: '',
				political_status: '',
				email: '',
				type: '',
			},

			/* 校验规则 */
			rules: {
				
				// 对name字段进行必填验证
				name: {
					// name 字段的校验规则
					rules: [
						// 校验 name 不能为空
						{
							required: true,
							errorMessage: '请输入姓名'
						},
						// 对name字段进行长度验证
						{
							minLength: 1,
							maxLength: 6,
							errorMessage: '{label}长度在 {minLength} 到 {maxLength} 个字符'
						}
					],
					// 当前表单域的字段中文名，可不输入
					label: '姓名',
					validateTrigger: 'submit'
				},
				/* 手机号校验 */
				mobile: {
					// mobile 字段的校验规则
					rules: [
						// 校验 mobile 不能为空
						{
							required: true,
							errorMessage: '请输入联系电话'
						},
						// 对mobile字段进行长度验证
						{
							minLength: 11,
							maxLength: 11,
							errorMessage: '{label}长度为 {minLength}  个字符'
						}
					],
					// 当前表单域的字段中文名，可不输入
					label: '手机号',
					validateTrigger: 'submit'
				},
				/* 身份证校验 */
				id_card: {
					// idCard 字段的校验规则
					rules: [
						// 校验 idCard 不能为空
						{
							required: true,
							errorMessage: '请输入身份证号'
						}
						// 对idCard字段进行长度验证
						// {
						// 	minLength: 18,
						// 	maxLength: 18,
						// 	errorMessage: '{label}长度为 {minLength}  个字符'
						// }
					],
					// 当前表单域的字段中文名，可不输入
					label: '身份证号',
					validateTrigger: 'submit'
				},

				/* 单位 */
				unit_name: {
					rules: [
						// 校验 unit 不能为空
						{
							required: true,
							errorMessage: '请输入单位名称'
						}
					]
				},

				address: {
					rules: [
						// 校验 住址 不能为空
						{
							required: true,
							errorMessage: '请输入单位名称'
						}
					]
				},
				// notesVal: {
				// 	rules: [
				// 		// 校验 申请类型 不能为空
				// 		{
				// 			required: true,
				// 			errorMessage: '请输入申请类型'
				// 		}
				// 	]
				// },
				intro: {
					rules: [
						{
							required: true,
							errorMessage: '请输入认领原因或个人介绍'
						}
					]
				},
				
				// 政治面貌校验
				political_status: {
					rules: [
						{
							required: true,
							errorMessage: '请选择政治面貌'
						}
					],
					label: '政治面貌',
					validateTrigger: 'submit'
				},
				
				// 联系邮箱校验
				email: {
					rules: [
						{
							required: false,
							errorMessage: '请输入联系邮箱'
						},
						{
							pattern: /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/,
							errorMessage: '请输入正确的邮箱格式'
						}
					],
					label: '联系邮箱',
					validateTrigger: 'submit'
				},
				
				// 本人承诺校验
				commitment: {
					rules: [
						{
							required: true,
							errorMessage: '请阅读并同意本人承诺'
						},
						{
							type: 'boolean',
							enum: [true],
							errorMessage: '请阅读并同意本人承诺'
						}
					],
					label: '本人承诺',
					validateTrigger: 'submit'
				}
			}
		};
	},
	onLoad(o) {
			that = this;
		  this.user = this.$common.userInfo();
			this.cr_id = o.id;
			this.volunteer_id = o.volunteer_id;
			this.modifyId = o.modifyId;
			this.pendingRegionId = o.region_id ? decodeURIComponent(o.region_id) : '';
			this.entryRegionId = this.pendingRegionId;
			this.pendingRegionName = o.regionName ? decodeURIComponent(o.regionName) : '';
			if (o.type && this.typeOptions.some((item) => item.value === o.type)) {
				this.valiFormData.type = o.type;
			}
			this.initSelectedCrInfo();
			this.fetchVolunteerCrInfo();
			this.getCategoryCascadeList();

			if (this.isLogin) {
        setTimeout(() => {
          // 调用API获取对话框内容并显示
          this.$api.getVolunteerNotify({}, function (res) {
            if (res.data.status === 1) {
              that.modalContent = res.data.introduce;
              that.modalTitle = res.data.title;
              that.$refs.popup.open();
            }
          });
        }, 200);
			}
		},
  computed: {
    ...mapGetters(['isLogin']),
		isDistrictEntry() {
			return !!this.entryRegionId;
		},
		isVolunteerType() {
			return this.valiFormData.type === 'volunteer';
		},
		serviceAreaOptions() {
			const serviceAreas = this.volunteerCrInfo && Array.isArray(this.volunteerCrInfo.service_areas)
				? this.volunteerCrInfo.service_areas
				: [];
			const optionMap = {};
			const optionList = [];
			serviceAreas.forEach((item, index) => {
				const optionId = item && item.id !== undefined && item.id !== null ? item.id : '';
				const optionTitle = item && item.title ? item.title : '';
				const optionKey = `${optionId}_${optionTitle}`;
				if (!optionMap[optionKey]) {
					const optionItem = {
						...item,
						optionKey: `service_area_${index}`
					};
					optionMap[optionKey] = optionItem;
					optionList.push(optionItem);
				}
			});
			return optionList;
		},
		serviceAreaColumns() {
			return [this.serviceAreaOptions];
		},
		serviceAreaDefaultIndex() {
			const matchedIndex = this.serviceAreaOptions.findIndex((item) => String(item.id) === String(this.cr_id));
			return [matchedIndex >= 0 ? matchedIndex : 0];
		},
		shouldShowCrSelector() {
			return this.isDistrictEntry || (!this.isDistrictEntry && !!this.cr_id);
		}
  },
	methods: {
		onchange(e) {
			const value = e.detail.value;
		},
		onnodeclick(node) {
			this.region_id = node.value;
			console.log(node);
		},
		openServiceAreaPicker() {
			if (!this.serviceAreaOptions.length) {
				this.$common.errorToShow('暂无可选文物');
				return;
			}
			this.showServiceAreaPicker = true;
		},
		closeServiceAreaPicker() {
			this.showServiceAreaPicker = false;
		},
		confirmServiceArea(e) {
			const selectedItem = e && Array.isArray(e.value) ? e.value[0] : null;
			this.showServiceAreaPicker = false;
			if (!selectedItem) {
				return;
			}
			this.cr_id = selectedItem.id !== undefined && selectedItem.id !== null ? selectedItem.id : '';
			this.selectedServiceAreaTitle = selectedItem.title || '';
		},
		initSelectedCrInfo() {
			if (this.isDistrictEntry || !this.cr_id) {
				return;
			}
			this.$api.getContentDetail(
				{
					main_body_id: 1,
					id: this.cr_id
				},
				(res) => {
					const detail = res && res.data ? res.data : {};
					this.selectedServiceAreaTitle = detail.title || detail.name || '';
				}
			);
		},
		getRegionValue(item = {}) {
			if (item.value !== undefined && item.value !== null && item.value !== '') {
				return item.value;
			}
			if (item.id !== undefined && item.id !== null && item.id !== '') {
				return item.id;
			}
			return '';
		},
		getRegionText(item = {}) {
			return item.text || item.title || item.label || item.name || '';
		},
		findRegionById(list = [], regionId = '') {
			for (let index = 0; index < list.length; index++) {
				const item = list[index];
				if (String(this.getRegionValue(item)) === String(regionId)) {
					return item;
				}
				if (Array.isArray(item.children) && item.children.length) {
					const matchedChild = this.findRegionById(item.children, regionId);
					if (matchedChild) {
						return matchedChild;
					}
				}
			}
			return null;
		},
		findRegionByName(list = [], regionName = '') {
			for (let index = 0; index < list.length; index++) {
				const item = list[index];
				if (this.getRegionText(item) === regionName) {
					return item;
				}
				if (Array.isArray(item.children) && item.children.length) {
					const matchedChild = this.findRegionByName(item.children, regionName);
					if (matchedChild) {
						return matchedChild;
					}
				}
			}
			return null;
		},
		applyPendingRegion() {
			if (!Array.isArray(this.regionList) || !this.regionList.length) {
				return;
			}
			let matchedRegion = null;
			if (this.pendingRegionId !== '' && this.pendingRegionId !== null && this.pendingRegionId !== undefined) {
				matchedRegion = this.findRegionById(this.regionList, this.pendingRegionId);
			}
			if (!matchedRegion && this.pendingRegionName) {
				matchedRegion = this.findRegionByName(this.regionList, this.pendingRegionName);
			}
			if (matchedRegion) {
				this.region_id = this.getRegionValue(matchedRegion);
			}
		},
		getVolunteerCrInfoParams() {
			if (!this.entryRegionId || !this.valiFormData.type) {
				return null;
			}
			return {
				main_body_id: 1,
				id: this.entryRegionId,
				type: this.valiFormData.type
			};
		},
		fetchVolunteerCrInfo() {
			const params = this.getVolunteerCrInfoParams();
			if (!params) {
				return;
			}
			this.$api.getVolunteerCrInfo(params, (res) => {
				this.volunteerCrInfo = res && res.data ? res.data : {};
				const matchedItem = this.serviceAreaOptions.find((item) => String(item.id) === String(this.cr_id));
				if (matchedItem) {
					this.selectedServiceAreaTitle = matchedItem.title || '';
				}
			});
		},
		validateSelectedCr() {
			if (!this.cr_id) {
				this.$common.errorToShow(`请选择${this.volunteerCrLabel}`);
				return false;
			}
			return true;
		},
		// 区域
		getCategoryCascadeList() {
			this.$api.getCategoryCascadeList({ main_body_id: 1, pid: 5, level: 2 }, function (res) {
				that.regionList = res.data;
				that.applyPendingRegion();
			});
		},

		// 测试上传文件
		chooseFile() {
			let userToken = '';
			let auth = this.$db.get('auth');
			userToken = auth.token;
			wx.chooseMessageFile({
				count: 1,
				type: 'file', // 修改为支持的文档类型
				// 配置后导致读取不到聊天文件
				// extension: ['.doc', '.xlsx', '.docx', '.ppt'],
				success(res) {
					const tempFilePaths = res.tempFiles;
					uni.uploadFile({
						url: that.$config.baseUrl + 'api/common/upload?token=' + userToken,
						filePath: tempFilePaths[0].path,
						name: 'file',
						header: {
							'content-type': 'multipart/form-data' // 根据实际情况设置请求头
						},
						formData: {}, // 如果需要，添加额外的form数据
						success: (res) => {
							console.log('上传成功，服务器响应数据:', res.data);

							let url = JSON.parse(res.data);
							that.valiFormData.fullurl = url.data.fullurl;
							// console.log('生成的链接', that.valiFormData.fullurl);
							that.$common.errorToShow('上传成功');
						},
						fail: (err) => {
							console.error('文件上传失败:', err);
						}
					});
				}
			});
		},

		submit() {
			this.$refs.valiForm.validate(['id'], async (err, valiFormData) => {
				console.log('this.valiFormData.commitment', this.valiFormData.commitment);
        
        if (this.valiFormData.commitment !== 1) {
					that.$common.errorToShow('请先阅读并同意本人承诺');
					return;
				}
				if (!this.valiFormData.type) {
					that.$common.errorToShow('缺少报名类型，请从对应入口重新进入');
					return;
				}
				if (!this.validateSelectedCr()) {
					return;
				}
        if (!err) {
					console.log('校验成功');
					/* 检验成功 */
					const { 
						name, mobile, address, id_card, 
            political_status,
            unit_name, intro, fullurl,
            email,
					} = this.valiFormData;
					const params = {
						main_body_id: 1,
						name: name,
						mobile: mobile,
						address: address,
						unit_name: unit_name,
						id_card: id_card,
						intro: intro,
						file: fullurl,
						politics_status: political_status,
						email: email,
						type: this.valiFormData.type,
						region_id: this.region_id,
					};
					if (this.cr_id) {
						params.cr_id = this.cr_id;
					}
					if (this.isDistrictEntry && this.selectedServiceAreaTitle) {
						params.service_area = this.selectedServiceAreaTitle;
					}
					this.$api.scanApplyVolunteer(
						params,
						function (res) {
							if (res.code === 1) {
								that.$common.errorToShow(res.msg);
								setTimeout(() => {
									uni.switchTab({
										url: '/pages/shouhu/shouhu'
									});
								}, 1000);
							} else {
                if (res.data) {
                  setTimeout(() => {
                    uni.switchTab({
                      url: '/pages/shouhu/shouhu'
                    });
                  }, 1000);
                }
								that.$common.errorToShow(res.msg);
							}
						}
					);
				} else {
					that.$common.errorToShow('请完善信息');
				}
			});
		},
	}
};
</script>

<style>
.box {
	width: 100%;
	padding-bottom: 50rpx;
	background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/xy_bgt.png');
	background-size: 100% 100%;
	background-repeat: repeat-y;
	height: auto;
}
.ban_box {
	position: relative;
	margin-top: 40rpx;
}

.top_img {
	width: 100%;
	height: 100%;
}
.ban_item1 {
	position: absolute;
	top: -20rpx;
	left: 233rpx;
	width: 290rpx;
	height: 290rpx;
	margin: auto;
}
.ban_item2 {
	width: 250rpx;
	height: 250rpx;
	margin: auto;
}
::v-deep .uni-forms-item__error {
	color: red !important;
}
::v-deep .uni-stat__select {
  padding: 0!important;
}
.is-input-border {
	background-color: #f7dfc0 !important;
}
.uni-forms-item__label {
	color: #000000 !important;
}

.text-wrapper_3 {
	margin: auto;
	margin-top: 50rpx;
	height: 80rpx;
	flex-direction: column;
	width: 240rpx;
	background: url('/static/img/dt_bg2.png') no-repeat;
	background-size: 100% 100%;
}
.bm_tit {
	text-align: center;
	font-size: 36rpx;
	line-height: 80rpx;
	letter-spacing: 6rpx;
	text-align: center;
	font-weight: 700;
	background: linear-gradient(180deg, #af7e44 0%, #934b36 100%);
	background-clip: text;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}
.example {
	height: 87%;
	margin: 20rpx 32rpx 0 32rpx;
}
.uni-forms {
	padding: 0 20rpx 0 20rpx;
}
.uni-forms-item {
	margin-bottom: 30rpx !important;
}
.active {
	border: 6rpx solid #efb57a;
	border-radius: 10rpx;
}
.img {
	width: 230rpx;
	height: 250rpx;
	border: 6rpx solid #efb57a;
	border-radius: 10rpx;
}
.map_tit {
	display: flex;
	align-items: center;
	margin-left: 60rpx;
	margin-top: 40rpx;
	font-size: 40rpx;
	font-family: Songti SC, Songti SC;
	font-weight: 900;
	line-height: 52rpx;
	color: #444444;
}
.scarch_box {
	width: 430rpx;
	height: 82rpx;
	padding: 15rpx 0 0 30rpx;
	/* background-image: url('/static/img/search_bg1.png');
	background-size: 100% 100%; */
}
.rl_box {
	width: 90%;
	margin: auto;
	margin-top: 40rpx;
	display: flex;
	justify-content: space-between;
}
.rl_item {
	width: 188rpx;
	height: 102rpx;
	background-image: url('/static/img/rl_bg.png');
	background-size: 100% 100%;
}
.tit {
	text-align: center;
	line-height: 102rpx;
	font-weight: 700;
	font-size: 36rpx;
	letter-spacing: 6rpx;
	background: linear-gradient(180deg, #af7e44 0%, #934b36 100%);
	background-clip: text;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.scfj {
	width: 170rpx;
	height: 50rpc;
	line-height: 50rpx;
	align-items: center;
	display: flex;
	background-color: #f7dfc0;
	position: absolute;
	top: -60rpx;
	right: 2rpx;
	border-radius: 5rpx;
	justify-content: space-around;
}
.tit2 {
	text-align: center;
	line-height: 66rpx;
	font-weight: 700;
	font-size: 32rpx;
	letter-spacing: 6rpx;
	background: linear-gradient(180deg, #af7e44 0%, #934b36 100%);
	background-clip: text;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}
.is-input-error-border {
	border: none !important;
}

.xx_box {
	padding: 20rpx;
	background-color: #e1bf9a;
	width: 660rpx;
	height: 560rpx;
	padding-top: 80rpx;
}
.xx_tit {
	height: 360rpx;
	font-size: 30rpx;
	padding: 20rpx;
	text-indent: 2em;
	background-color: #f3e3d3;
	overflow: scroll;
}

/* 性别选择样式 */
.gender-select {
	display: flex;
	align-items: center;
}

/* 政治面貌选择样式 */
.political-status-select {
	width: 100%;
}

/* 报名选项多选框样式 */
.checkbox-group {
	display: flex;
	flex-direction: column;
	gap: 20rpx;
}

.checkbox-item {
	display: flex;
	align-items: center;
	gap: 10rpx;
}

.checkbox-item text {
	font-size: 32rpx;
	color: #333;
}

.service-area-readonly {
	display: flex;
	align-items: center;
	box-sizing: border-box;
	height: 70rpx;
	padding: 0 20rpx;
	background-color: #f7dfc0;
	border-radius: 8rpx;
	color: #6a412c;
	font-size: 28rpx;
	line-height: 1;
}

.service-area-trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	box-sizing: border-box;
	height: 70rpx;
	padding: 0 20rpx;
	background-color: #f7dfc0;
	border-radius: 8rpx;
}

.service-area-placeholder {
	font-size: 24rpx;
	color: #999999;
	line-height: 1;
}

.service-area-value {
	font-size: 24rpx;
	line-height: 1;
}

/* 本人承诺样式 */
.commitment-text {
	font-size: 28rpx;
	color: #666;
	line-height: 44rpx;
	padding-bottom: 20rpx;
	text-indent: 2em;
  background-color: #fdfaf6;
}

.commitment-agree {
			font-size: 30rpx;
			color: #333;
			margin-left: 10rpx;
		}
		
		/* 对话框样式 */
		.modal-container {
			width: 80%;
			background-color: #ffffff;
			border-radius: 12rpx;
			overflow: hidden;
      margin-left: 10%;
		}
		
		
		.modal-title {
      display: block;
			font-size: 36rpx;
			font-weight: 700;
			color: #444444;
			text-align: center;
			padding: 20rpx 0;
		}
		.modal-content {
			padding: 30rpx;
			max-height: 500rpx;
			overflow-y: auto;
		}
		
		.modal-footer {
			padding: 20rpx;
			text-align: center;
			border-top: 1rpx solid #e5e5e5;
		}
		
		.modal-btn {
			width: 200rpx;
			height: 70rpx;
			line-height: 70rpx;
			background-color: #af7e44;
			color: #ffffff;
			border-radius: 35rpx;
			text-align: center;
			margin: 0 auto;
			font-size: 30rpx;
			font-weight: 500;
		}
	</style>