<!--编辑客户-->
<template>
	<view class="assemble">
		<fui-segmented-control style="padding-top: 30rpx;" :values="optionTable" :current="(Number(optionTableId))"
			type="text" activeColor="#29d3b4" color="#fff" @click="segmented">
		</fui-segmented-control>

		<!-- 基础信息 -->
		<view v-if="optionTableId == 0" style="margin-top: 20rpx;">
			<view class="form-style">
				<fui-form ref="form" top="0" :model="formData" :show="false">
					<view class="title" style="margin-top: 20rpx; display: flex; justify-content: space-between; align-items: center;">
						<text>基础信息</text>
						<view @click="viewEditLog" style="color: #29d3b4; font-size: 28rpx;">
							查看修改记录
						</view>
					</view>
					<view class="input-style">
						<!-- 校区 -->
						<fui-form-item label="校区" labelSize='32' prop="campus" background='#434544' labelColor='#fff' :bottomBorder='false'>
							<view class="input-title" style="margin-right:14rpx;">
								<view class="input-title" style="margin-right:14rpx;" @click="openCicker('campus')">
									{{ formData.campus ? picker_config.campus.text : '点击选择' }}
								</view>
							</view>
						</fui-form-item>
						<!-- 来源 -->
						<fui-form-item label="来源" labelSize='26' prop="source" background='#434544' labelColor='#fff' :bottomBorder='false'>
							<view class="input-title" style="margin-right:14rpx;">
								<view class="input-title" style="margin-right:14rpx;" @click="openCicker('source')">
									{{ formData.source ? picker_config.source.text : '点击选择' }}
								</view>
							</view>
						</fui-form-item>
						<!-- 来源渠道 -->
						<fui-form-item 
							v-if="formData.source == 1"
							label="来源渠道" 
							labelSize='26' 
							prop="source_channel" 
							background='#434544' 
							labelColor='#fff' 
							:bottomBorder='false'>
							<view class="input-title" style="margin-right:14rpx;">
								<view class="input-title" style="margin-right:14rpx;" @click="openCicker('source_channel')">
									{{ formData.source_channel ? picker_config.source_channel.text : '点击选择' }}
								</view>
							</view>
						</fui-form-item>
						<!-- 姓名 -->
						<fui-form-item label="姓名" labelSize='26' prop="name" background='#434544' labelColor='#fff' :bottomBorder='false'>
							<view class="input-title" style="margin-right:14rpx;">
								<fui-input :borderBottom="false" :padding="[0]" placeholder="点击填写" v-model="formData.name" backgroundColor="#434544" size="26" color="#fff"></fui-input>
							</view>
						</fui-form-item>
						<!-- 性别 -->
						<fui-form-item label="性别" labelSize='26' prop="gender" background='#434544' labelColor='#fff' :bottomBorder='false'>
							<view class="input-title" style="margin-right:14rpx;">
								<fui-radio-group name="radio" v-model="formData.gender" @change="changeSex">
									<view class="fui-list__item" style="display: flex;justify-content: flex-end;">
										<fui-label>
											<view class="fui-align__center">
												<fui-radio value="male" checked></fui-radio>
												<text class="fui-text">男</text>
											</view>
										</fui-label>
										<fui-label :margin="['0','0','0','40rpx']">
											<view class="fui-align__center">
												<fui-radio value="female"></fui-radio>
												<text class="fui-text">女</text>
											</view>
										</fui-label>
									</view>
								</fui-radio-group>
							</view>
						</fui-form-item>
						<!-- 电话 -->
						<fui-form-item label="电话" labelSize='26' prop="phone_number" background='#434544' labelColor='#fff' :bottomBorder='false'>
							<view class="input-title" style="margin-right:14rpx;">
								<fui-input :borderBottom="false" :padding="[0]" placeholder="点击填写" v-model="formData.phone_number" backgroundColor="#434544" size="26" color="#fff" @blur="handlePhoneBlur"></fui-input>
							</view>
						</fui-form-item>
						<!-- 资源是否有效 -->
						 <fui-form-item label="资源是否有效" labelSize='26' prop="is_valid" background='#434544' labelColor='#fff' :bottomBorder='false'>
							<view class="input-title" style="margin-right:14rpx;">
								<fui-radio-group name="radio" v-model="formData.efficacious">
									<view class="fui-list__item" style="display: flex;justify-content: flex-end;">
										<fui-label>
											<view class="fui-align__center">
												<fui-radio :value="1" checked></fui-radio>
												<text class="fui-text">是</text>
											</view>
										</fui-label>
										<fui-label :margin="['0','0','0','40rpx']">
											<view class="fui-align__center">
												<fui-radio :value="0"></fui-radio>
												<text class="fui-text">否</text>
											</view>
										</fui-label>
									</view>
								</fui-radio-group>
							</view>
						</fui-form-item>
					</view>
					<!-- 添加底部安全区 -->
					<view class="safe-area-bottom"></view>
				</fui-form>
			</view>
		</view>

		<!-- 电话六要素 -->
		<view v-if="optionTableId == 1" style="margin-top: 20rpx;">
			<view class="form-style">
				<fui-form ref="form" top="0" :model="formData" :show="false">
					<view class="title" style="margin-top: 20rpx; display: flex; justify-content: space-between; align-items: center;">
						<text>六要素信息</text>
						<view @click="viewEditLog" style="color: #29d3b4; font-size: 28rpx;">
							查看修改记录
						</view>
					</view>
					<view class="input-style">
						<!-- 购买力 -->
						<fui-form-item label="购买力" labelSize='26' prop="purchasing_power" background='#434544' labelColor='#fff' :bottomBorder='false'>
							<view class="input-title" style="margin-right:14rpx;">
								<view class="input-title" style="margin-right:14rpx;" @click="openCicker('purchasing_power')">
									{{ formData.purchasing_power ? picker_config.purchasing_power.text : '点击选择' }}
								</view>
							</view>
						</fui-form-item>
						
						<fui-form-item label="需求" labelSize='26' prop="demand" background='#434544' labelColor='#fff' :bottomBorder='false'>
							<view class="input-title" style="margin-right:14rpx;">
								<fui-input :borderBottom="false" :padding="[0]" placeholder="点击填写" v-model="formData.demand" backgroundColor="#434544" size="26" color="#fff" ></fui-input>
							</view>
						</fui-form-item>
						
						<!-- 理念 -->
						<fui-form-item label="理念" labelSize='26' prop="cognitive_idea" background='#434544' labelColor='#fff' :bottomBorder='false'>
							<view class="input-title" style="margin-right:14rpx;">
								<view class="input-title" style="margin-right:14rpx;" @click="openCicker('cognitive_idea')">
									{{ formData.cognitive_idea ? picker_config.cognitive_idea.text : '点击选择' }}
								</view>
							</view>
						</fui-form-item>
						<!-- 可选上课时间 -->
						<fui-form-item labelWidth=“200” label="可选上课时间" labelSize='26' prop="optional_class_time" background='#434544' labelColor='#fff' :bottomBorder='false'>
							<view class="input-title" style="margin-right:14rpx;">
								<view class="input-title" style="margin-right:14rpx;" @click="openDate('optional_class_time')">
									{{ formData.optional_class_time ? formData.optional_class_time : '点击选择' }}
								</view>
							</view>
						</fui-form-item>
						<!-- 承诺到访时间 -->
						<fui-form-item labelWidth=“200” label="承诺到访时间" labelSize='26' prop="promised_visit_time" background='#434544' labelColor='#fff' :bottomBorder='false'>
							<view class="input-title" style="margin-right:14rpx;">
								<view class="input-title" style="margin-right:14rpx;" @click="openDate('promised_visit_time')">
									{{ formData.promised_visit_time ? formData.promised_visit_time : '点击选择' }}
								</view>
							</view>
						</fui-form-item>
						<!-- 距离 -->
						<fui-form-item label="距离" labelSize='26' prop="distance" background='#434544' labelColor='#fff' :bottomBorder='false'>
							<view class="input-title" style="margin-right:14rpx;">
								<view class="input-title" style="margin-right:14rpx;" @click="openCicker('distance')">
									{{ formData.distance ? picker_config.distance.text : '点击选择' }}
								</view>
							</view>
						</fui-form-item>
						<!-- 决策人 -->
						<fui-form-item label="决策人" labelSize='26' prop="decision_maker" background='#434544' labelColor='#fff' :bottomBorder='false'>
							<view class="input-title" style="margin-right:14rpx;">
								<view class="input-title" style="margin-right:14rpx;" @click="openCicker('decision_maker')">
									{{ formData.decision_maker ? picker_config.decision_maker.text : '点击选择' }}
								</view>
							</view>
						</fui-form-item>
						<!-- 是否加微信 -->
						<fui-form-item label="是否加微信" labelSize='26' prop="call_intent" background='#434544' labelColor='#fff' :bottomBorder='false'>
							<view class="input-title" style="margin-right:14rpx;">
								<fui-radio-group name="radio" v-model="formData.call_intent">
									<view class="fui-list__item" style="display: flex;justify-content: flex-end;">
										<fui-label>
											<view class="fui-align__center">
												<fui-radio value="1" checked></fui-radio>
												<text class="fui-text">是</text>
											</view>
										</fui-label>
										<fui-label :margin="['0','0','0','40rpx']">
											<view class="fui-align__center">
												<fui-radio value="2"></fui-radio>
												<text class="fui-text">否</text>
											</view>
										</fui-label>
									</view>
								</fui-radio-group>
							</view>
						</fui-form-item>
						
						<!-- 备注 -->
						<fui-form-item label="备注" labelSize='26' prop="remark" background='#434544' labelColor='#fff' :bottomBorder='false'>
							<view class="input-title" style="margin-right:14rpx;">
								<fui-textarea v-model="formData.remark" placeholder="点击填写" backgroundColor="#434544" size="26" color="#fff" :borderTop="false" :isCounter="true" :maxlength="500" :minHeight="250" :isAutoHeight="true"></fui-textarea>
							</view>
						</fui-form-item>
					</view>
					<!-- 添加底部安全区 -->
					<view class="safe-area-bottom"></view>
				</fui-form>
			</view>
		</view>

		<!-- 面咨记录 -->
		<view v-if="optionTableId == 2" style="margin-top: 20rpx;">
			<view class="form-style">
				<fui-form ref="form" top="0" :model="formData" :show="false">
					<view class="title" style="margin-top: 20rpx;">跟进与面咨</view>
					<view class="input-style">
						<!-- 一访时间 -->
						<fui-form-item label="一访时间" labelSize='26' prop="first_visit_time" background='#434544' labelColor='#fff'  :bottomBorder='false'>
							<view class="input-title" style="margin-right:14rpx;" @click="openDate('first_visit_time')">
									{{ formData.first_visit_time ? formData.first_visit_time : '点击选择' }}
								</view>
						</fui-form-item>
						<!-- 一访情况 -->
						<fui-form-item label="一访情况" labelSize='26' prop="first_visit_status" background='#434544' labelColor='#fff'  :bottomBorder='false'>
							<view class="textarea-container">
								<fui-textarea v-model="formData.first_visit_status" placeholder="点击填写" backgroundColor="#434544" size="26" color="#fff" :textareaBorder="false" :isCounter="true" :maxlength="500" :minHeight="120" :isAutoHeight="true" :borderTop="false"></fui-textarea>
							</view>
						</fui-form-item>
						
						<!-- 二访时间 -->
						<fui-form-item label="二访时间" labelSize='26' prop="second_visit_time" background='#434544' labelColor='#fff'  :bottomBorder='false'>
							<view class="input-title" style="margin-right:14rpx;" @click="openDate('second_visit_time')">
									{{ formData.second_visit_time ? formData.second_visit_time : '点击选择' }}
								</view>
						</fui-form-item>
						<!-- 二访情况 -->
						<fui-form-item label="二访情况" labelSize='26' prop="second_visit_status" background='#434544' labelColor='#fff'  :bottomBorder='false'>
							<view class="textarea-container">
								<fui-textarea v-model="formData.second_visit_status" placeholder="点击填写" backgroundColor="#434544" size="26" color="#fff" :textareaBorder="false" :isCounter="true" :maxlength="500" :minHeight="120" :isAutoHeight="true" :borderTop="false"></fui-textarea>
							</view>
						</fui-form-item>
						
						<fui-form-item label="追单标注" labelSize='26' prop="chasing_orders" background='#434544' labelColor='#fff'  :bottomBorder='false'>
							<view class="textarea-container">
								<fui-textarea v-model="formData.chasing_orders" placeholder="点击填写" backgroundColor="#434544" size="26" color="#fff" :textareaBorder="false" :isCounter="true" :maxlength="500" :minHeight="120" :isAutoHeight="true" :borderTop="false"></fui-textarea>
							</view>
						</fui-form-item>
						
						<fui-form-item label="是否报名" labelSize='26' prop="is_bm" background='#434544' labelColor='#fff'  :bottomBorder='false'>
							<view class="input-title" style="margin-right:14rpx;">
								<fui-radio-group name="radio" v-model="formData.is_bm" :disabled="true">
									<view class="fui-list__item" style="display: flex;justify-content: flex-end;">
										<fui-label>
											<view class="fui-align__center">
												<fui-radio :value="1" :disabled="true"></fui-radio>
												<text class="fui-text">报名</text>
											</view>
										</fui-label>
										<fui-label :margin="['0','0','0','40rpx']">
											<view class="fui-align__center">
												<fui-radio :value="2" :disabled="true"></fui-radio>
												<text class="fui-text">未报名</text>
											</view>
										</fui-label>
									</view>
								</fui-radio-group>
							</view>
						</fui-form-item>
						
						<!-- 面咨备注 -->
						<fui-form-item label="面咨备注" labelSize='26' prop="consultation_remark" background='#434544' labelColor='#fff'  :bottomBorder='false'>
							<view class="textarea-container">
								<fui-textarea v-model="formData.consultation_remark" placeholder="点击填写" backgroundColor="#434544" size="26" color="#fff"  :maxlength="500" :minHeight="120" :isAutoHeight="true" :borderTop="false"></fui-textarea>
							</view>
						</fui-form-item>
						<!-- 标识 -->

					</view>
					<!-- 添加底部安全区 -->
					<view class="safe-area-bottom"></view>
				</fui-form>
			</view>
		</view>

		<!-- 选择器、日期选择等控件保留原有 -->
		<fui-date-picker :show="date_picker_show" type="3" @change="change_date" @cancel="cancel_date" :value="default_date_value"></fui-date-picker>
		<fui-picker :linkage='picker_linkage' :options="picker_options" :layer="1" :show="picker_show" @change="changeCicker" @cancel="cancelCicker"></fui-picker>

		<!-- 快速填写弹窗 -->
		<view v-if="showQuickFill" class="quick-fill-mask" @tap="showQuickFill=false">
			<view class="quick-fill-content" @tap.stop>
				<view class="quick-fill-header">
					<view class="quick-fill-title">快速填写</view>
					<view class="quick-fill-close" @tap="showQuickFill=false">
						<text class="close-text">✕</text>
					</view>
				</view>
				<view class="quick-fill-body">
					<view class="quick-fill-tip">
						<text>请粘贴包含客户信息的文本，支持格式：</text>
						<text>姓名：张三，电话：13800138000，校区：测试校区</text>
					</view>
					<textarea 
						class="quick-fill-textarea" 
						placeholder="请粘贴客户信息文本..."
						v-model="quickFillText"
						:maxlength="1000"
					></textarea>
				</view>
				<view class="quick-fill-buttons">
					<view class="quick-fill-btn cancel-btn" @click="showQuickFill=false">取消</view>
					<view class="quick-fill-btn confirm-btn" @click="parseQuickFillText">解析并填写</view>
				</view>
			</view>
		</view>

		<!-- 底部保存按钮 -->
		<view class="save-btn-box">
			<fui-button background="#434544" color="#24BA9F" borderColor="#24BA9F" @click="submit">保存</fui-button>
		</view>
	</view>
</template>

<script>
	import apiRoute from '@/api/apiRoute.js';
	import commonApi from '@/api/common.js';
	import marketApi from '@/api/market.js';
	import memberApi from '@/api/member.js';


	export default {
		data() {
			return {
				is_submit: true, //是否提交(防止重复提交)|true=可提交,false=不可提交

				resource_sharing_id: '', //resource_sharing_id(资源共享表id)
				
				// 快速填写相关
				showQuickFill: false, // 是否显示快速填写弹窗
				quickFillText: '', // 快速填写文本内容
				
				//表单
				formData: {
					// 客户基础信息
					source_channel: '', //来源渠道
					source: '', //来源
					consultant: '', //顾问
					name: '', //姓名
					age: '', //年龄
					birthday: '', //生日
					gender: 'male', //性别|male-男性, female-女性, other-其他
					phone_number: '', //联系电话
					demand: '', //需求
					decision_maker: '', //决策人
					initial_intent: '', //客户初步意向度: high-高, medium-中, low-低
					status: '', //客户状态: active-活跃, inactive-不活跃, pending-待定

					//六要素信息
					purchasing_power: '', //购买力
					cognitive_idea: '', //认知理念
					communication: '', //沟通备注
					promised_visit_time: '', //承诺到访时间
					staff_id: '', //人员ID
					distance: '', //距离
					optional_class_time: '', //可选上课时间
					first_visit_status: '', //一访情况
					second_visit_status: '', //二访情况
					efficacious:'1',
					call_intent:'2'
				},

				//下拉选择器相关
				picker_input_name: '', //下拉组件的input_name
				picker_show: false, //下拉组件是否展示
				picker_linkage: true, //选择器是否为联动选择
				picker_options: [
					// {
					//   text:'张三',
					//   value:'1'
					// },
				], //选择器可选值列表
				picker_config: {
					//来源渠道
					source_channel: {
						text: '', //回显中文名字
						options: [
							// {
							//   text:'张三',
							//   value:'1'
							// }
						], //可选值列表
					},
					//来源
					source: {
						text: '',
						options: [],
					},
					//顾问
					consultant: {
						text: '',
						options: [],
					},
					//购买力
					purchasing_power: {
						text: '',
						options: [],
					},
					//认知理念
					cognitive_idea: {
						text: '',
						options: [],
					},
					//客户初步意向度
					initial_intent: {
						text: '',
						options: [],
					},
					//所属校区
					campus: {
						text: '',
						options: [],
					},
					//是否加微信
					call_intent: {
						text: '',
						options: [
							{
								text:'是',
								value:'1'
							},
							{
								text:'否',
								value:'2'
							}
						],
					},
					//客户状态
					status: {
						text: '',
						options: [],
					},
					//决策人
					decision_maker: {
						text: '',
						options: [],
					},
					//距离
					distance: {
						text: '',
						options: [],
					},
				}, //选择器选项配置

				// 年月日选择组件
				data_picker_input_name: '', //时间组件的input_name
				date_picker_show: false, //时间选择器是否展示
				default_date_value: '', // 添加默认日期值



				// 查重相关  
				clientUserList: [], //查重用户列表
				showDuplicateCheck: false, //是否显示查重弹出层

				campus_list:[],
				//tab切换
				optionTableId: 0,
				optionTable: [{
						id: 0,
						name: '基础信息'
					},
					{
						id: 1,
						name: '电话六要素'
					},{
						id: 2,
						name: '面咨记录'
					}
				],
			}
		},
		onLoad(options) {
			console.log('onLoad - 接收到参数:', options);
			if (!options || !options.resource_sharing_id) {
				console.error('缺少必要参数 resource_sharing_id');
				uni.showToast({
					title: '缺少必要参数',
					icon: 'none'
				});
				setTimeout(() => {
					uni.navigateBack();
				}, 1500);
				return;
			}
			this.resource_sharing_id = options.resource_sharing_id; //共享资源表id
			console.log('设置 resource_sharing_id:', this.resource_sharing_id);
		},
		onShow() {
			console.log('onShow - 开始初始化');
			this.init();
		},
		methods: {
			//初始化
			async init() {
				try {
					console.log('init - 开始初始化流程');
					
					if (!this.resource_sharing_id) {
						console.error('resource_sharing_id 为空，无法初始化');
						uni.showToast({
							title: '缺少必要参数',
							icon: 'none'
						});
						setTimeout(() => {
							uni.navigateBack();
						}, 1500);
						return;
					}
					
					uni.showLoading({
						title: '加载中...',
						mask: true
					});
					
					console.log('init - 开始加载字典数据');
					
					// 批量加载所有字典数据
					await this.getBatchDictData();
					console.log('init - 字典数据加载完成');
					
					// 加载校区列表
					console.log('init - 开始加载校区列表');
					await this.get_campus_list();
					console.log('init - 校区列表加载完成');
					
					// 获取资源共享详情并回显数据
					console.log('init - 开始获取客户详情');
					await this.getInfo();
					console.log('init - 客户详情获取完成');
					
				} catch (error) {
					console.error('初始化失败:', error);
					uni.showToast({
						title: '加载数据失败，请重试',
						icon: 'none'
					});
				} finally {
					uni.hideLoading();
				}
			},
			
			// 批量获取字典数据
			async getBatchDictData() {
				try {
					console.log('开始批量获取字典数据');
					
					// 定义需要的字典keys和对应的本地键名
					const dictKeys = [
						'SourceChannel',
						'source', 
						'customer_purchasing_power',
						'preliminarycustomerintention',
						'cognitive_concept',
						'kh_status',
						'decision_maker',
						'distance'
					];
					
					const dictMapping = {
						'SourceChannel': 'source_channel',
						'source': 'source',
						'customer_purchasing_power': 'purchasing_power',
						'preliminarycustomerintention': 'initial_intent',
						'cognitive_concept': 'cognitive_idea',
						'kh_status': 'status',
						'decision_maker': 'decision_maker',
						'distance': 'distance'
					};
					
					try {
						// 使用批量接口一次性获取所有字典
						console.log('调用批量字典接口，keys:', dictKeys);
						const batchResult = await apiRoute.common_getBatchDict(dictKeys);
						
						if (batchResult && batchResult.code === 1 && batchResult.data) {
							console.log('批量字典接口响应成功:', batchResult.data);
							
							// 处理批量返回的字典数据
							Object.keys(batchResult.data).forEach(key => {
								const localKey = dictMapping[key];
								if (localKey && Array.isArray(batchResult.data[key])) {
									this.processDictData(localKey, batchResult.data[key]);
								}
							});
							
							console.log('批量字典数据处理完成');
							return;
						} else {
							console.warn('批量字典接口返回数据格式异常:', batchResult);
						}
					} catch (batchError) {
						console.error('批量字典接口调用失败:', batchError);
					}
					
					// 如果批量接口失败，回退到单个获取
					console.log('批量接口失败，使用回退方案');
					await this.fallbackGetDict();
					
				} catch (error) {
					console.error('批量获取字典数据失败:', error);
					// 如果批量获取失败，回退到单个获取
					await this.fallbackGetDict();
				}
			},

			// 加载单个字典数据
			async loadDictData(key, localKey) {
				try {
					// 检查缓存
					if (window._dictCache[key]) {
						// 使用缓存数据
						const dictData = window._dictCache[key];
						this.processDictData(localKey, dictData);
						return dictData;
					}
					
					// 加载字典数据
					const dictData = await this.$util.getDict(key);
					
					// 缓存数据
					if (Array.isArray(dictData) && dictData.length > 0) {
						window._dictCache[key] = dictData;
						this.processDictData(localKey, dictData);
					}
					
					return dictData;
				} catch (error) {
					console.error(`加载字典 ${key} 失败:`, error);
					return [];
				}
			},

			// 处理字典数据
			processDictData(localKey, dictData) {
				if (!Array.isArray(dictData) || dictData.length === 0) return;
				
				let formattedOptions = dictData.map(item => ({
					text: item.name || '',
					value: item.value || ''
				}));
				
				// 特殊处理来源渠道，添加线下选项
				if (localKey === 'source_channel') {
					formattedOptions.unshift({
						text: '线下',
						value: '0'
					});
				}
				
				// 确保 picker_config 存在
				if (!this.picker_config[localKey]) {
					this.picker_config[localKey] = { options: [], text: '点击选择' };
				}
				
				this.picker_config[localKey].options = formattedOptions;
			},

			// 回退方案：单个获取字典
			async fallbackGetDict() {
				console.log('使用回退方案获取字典数据');
				try {
					// 优先获取关键字典
					await Promise.all([
						this.getDict('source_channel'),
						this.getDict('source')
					]);
					
					// 延迟加载其他字典
					setTimeout(async () => {
						try {
							await Promise.all([
								this.getDict('purchasing_power'),
								this.getDict('initial_intent'),
								this.getDict('cognitive_idea'),
								this.getDict('status'),
								this.getDict('decision_maker'),
								this.getDict('distance')
							]);
						} catch (error) {
							console.error('回退方案第二阶段失败:', error);
						}
					}, 100);
				} catch (error) {
					console.error('回退方案也失败了:', error);
				}
			},
			
			async get_campus_list(){
			
				let res = await apiRoute.common_getCampusesList({})
				if (res.code != 1) {
				  uni.showToast({
				    title: res.msg,
				    icon: 'none'
				  })
				  return
				}
				
				this.campus_list = res.data
				
				
				let arr = []
				this.campus_list.forEach((v,k)=>{
				  arr.push({
				    text: v.campus_name,
				    value: v.id,
				  })
				})
				
				this.picker_config['campus'].options = arr
				
			},

			//获取资源共享-详情(客户资源详情)
			async getInfo() {
				try {
					console.log('getInfo - 开始获取客户详情, resource_sharing_id:', this.resource_sharing_id);
					
					if (!this.resource_sharing_id) {
						console.error('getInfo - resource_sharing_id 为空，无法获取客户详情');
						return;
					}
					
					let params = {
						resource_sharing_id: this.resource_sharing_id
					};

					console.log('getInfo - 发起请求:', params);
					let res = await apiRoute.xs_resourceSharingInfo(params); //资源共享-详情(客户资源详情)
					console.log('getInfo - 请求响应:', res);
					
					if (res.code != 1) {
						console.error('getInfo - 请求失败:', res.msg);
						uni.showToast({
							title: res.msg,
							icon: 'none'
						});
						return;
					}

					let customerResource = res.data.customerResource || {}; //客户资源详情
					let sixSpeed = res.data.customerResource.sixSpeed || {}; //六要素详情
					console.log('getInfo - 客户资源详情:', customerResource);
					console.log('getInfo - 六要素详情:', sixSpeed);

					// 存储原始数据，用于后续回显
					this._resourceDetail = res.data;

					this.formData = {
						resource_sharing_id: this.resource_sharing_id, //资源共享表id
						// 客户基础信息
						id: customerResource.id || '', //客户资源表id
						source_channel: customerResource.source_channel || '', //来源渠道
						source: customerResource.source || '', //来源
						name: customerResource.name || '', //姓名
						age: customerResource.age || '', //年龄
						birthday: customerResource.birthday || '', //生日
						gender: customerResource.gender || 'male', //性别|male-男性, female-女性, other-其他
						phone_number: customerResource.phone_number || '', //联系电话
						demand: customerResource.demand || '', //需求
						decision_maker: customerResource.decision_maker || '', //决策人
						initial_intent: customerResource.initial_intent || '', //客户初步意向度: high-高, medium-中, low-低
						status: customerResource.status || '', //客户状态: active-活跃, inactive-不活跃, pending-待定
						campus: customerResource.campus || '', // 校区
						customer_type: customerResource.customer_type || '', // 客户分类

						//六要素信息
						purchasing_power: sixSpeed.purchase_power || '', //购买力
						cognitive_idea: sixSpeed.concept_awareness || '', //认知理念
						communication: sixSpeed.communication || '', //沟通备注
						staff_id: sixSpeed.staff_id || '', //人员ID
						distance: sixSpeed.distance || '', //距离
						promised_visit_time: sixSpeed.promised_visit_time || '', //承诺到访时间
						optional_class_time: sixSpeed.preferred_class_time || '', //可选上课时间
						first_visit_time: sixSpeed.first_visit_time || '', // 一访时间
						first_visit_status: sixSpeed.first_visit_status || '', //一访情况
						second_visit_time: sixSpeed.second_visit_time || '', // 二访时间
						second_visit_status: sixSpeed.second_visit_status || '', //二访情况
						remark: sixSpeed.consultation_remark || '', // 备注
						consultation_remark: sixSpeed.consultation_remark || '', // 面咨备注
						chasing_orders: sixSpeed.chasing_orders || '', // 追单标注
						is_bm: sixSpeed.is_bm || 2, // 是否报名，默认未报名
						efficacious: sixSpeed.efficacious || '',
						call_intent: sixSpeed.call_intent || '', // 是否加微信
					};
					
					console.log('getInfo - 表单数据设置完成:', this.formData);

					// 格式化日期时间
					if (sixSpeed.promised_visit_time) {
						this.formData.promised_visit_time = this.$util.formatToDateTime(sixSpeed.promised_visit_time, 'Y-m-d');
					}
					
					if (sixSpeed.preferred_class_time) {
						this.formData.optional_class_time = this.$util.formatToDateTime(sixSpeed.preferred_class_time, 'Y-m-d');
					}
					
					if (sixSpeed.first_visit_time) {
						this.formData.first_visit_time = this.$util.formatToDateTime(sixSpeed.first_visit_time, 'Y-m-d');
					}
					
					if (sixSpeed.second_visit_time) {
						this.formData.second_visit_time = this.$util.formatToDateTime(sixSpeed.second_visit_time, 'Y-m-d');
					}
					
					console.log('getInfo - 日期格式化完成');
					
					// 设置选择器文本回显
					console.log('getInfo - 开始设置选择器文本回显');
					await this.setPickerText();
					console.log('getInfo - 选择器文本回显完成');
					
				} catch (error) {
					console.error('获取客户详情失败:', error);
					uni.showToast({
						title: '获取客户详情失败，请重试',
						icon: 'none'
					});
				}
			},

			// 设置选择器文本回显
			async setPickerText() {
				try {
					const { customerResource = {}, sixSpeed = {} } = await this.getResourceDetail() || {};
					
					// 设置选择器文本回显
					this.setPickerTextByValue('source_channel', this.formData.source_channel, customerResource.source_channel_name);
					this.setPickerTextByValue('source', this.formData.source, customerResource.source_name);
					this.setPickerTextByValue('consultant', this.formData.consultant, customerResource.consultant_name);
					this.setPickerTextByValue('initial_intent', this.formData.initial_intent, customerResource.initial_intent_name);
					this.setPickerTextByValue('status', this.formData.status, customerResource.status_name);
					this.setPickerTextByValue('decision_maker', this.formData.decision_maker, customerResource.decision_maker_name);
					this.setPickerTextByValue('campus', this.formData.campus, customerResource.campus_name);
					this.setPickerTextByValue('customer_type', this.formData.customer_type, customerResource.customer_type_name);
					
					// 六要素相关
					this.setPickerTextByValue('purchasing_power', this.formData.purchasing_power, sixSpeed.purchase_power_name);
					this.setPickerTextByValue('cognitive_idea', this.formData.cognitive_idea, sixSpeed.concept_awareness_name);
					this.setPickerTextByValue('distance', this.formData.distance, sixSpeed.distance_name);
					// 不再需要设置call_intent的选择器文本，因为已改为单选组件
					
					console.log('选择器文本回显完成');
				} catch (error) {
					console.error('设置选择器文本回显失败:', error);
				}
			},

			// 根据值设置选择器文本
			setPickerTextByValue(pickerName, value, defaultText) {
				// 使用空值缓存加速处理
				if (!value) {
					this.picker_config[pickerName] = this.picker_config[pickerName] || {};
					this.picker_config[pickerName].text = '点击选择';
					return;
				}
				
				// 创建映射缓存，避免重复查找
				if (!this._valueTextMapping) {
					this._valueTextMapping = {};
				}
				
				// 检查缓存
				const cacheKey = `${pickerName}_${value}`;
				if (this._valueTextMapping[cacheKey]) {
					this.picker_config[pickerName] = this.picker_config[pickerName] || {};
					this.picker_config[pickerName].text = this._valueTextMapping[cacheKey];
					return;
				}
				
				// 确保 picker_config[pickerName] 存在
				if (!this.picker_config[pickerName]) {
					this.picker_config[pickerName] = { options: [] };
				}
				
				// 先尝试从选项中找到匹配的文本
				const options = this.picker_config[pickerName].options || [];
				const option = options.find(opt => String(opt.value) === String(value));
				
				let textValue;
				if (option) {
					textValue = option.text;
				} else if (defaultText) {
					// 如果找不到匹配的选项但有默认文本，则使用默认文本
					textValue = defaultText;
				} else {
					textValue = '点击选择';
				}
				
				// 保存到缓存
				this._valueTextMapping[cacheKey] = textValue;
				this.picker_config[pickerName].text = textValue;
			},

			// 获取资源详情（缓存数据，避免重复请求）
			async getResourceDetail() {
				if (this._resourceDetail) {
					return this._resourceDetail
				}
				
				let params = {
					resource_sharing_id: this.resource_sharing_id
				}
				
				let res = await apiRoute.xs_resourceSharingInfo(params)
				if (res.code == 1) {
					this._resourceDetail = res.data
					return res.data
				}
				return null
			},






			//获取字典
			async getDict(inputName) {
				try {
					console.log(`getDict - 开始获取字典数据: ${inputName}`);
					
					let key = '';
					switch (inputName) {
						//来源渠道
						case 'source_channel':
							key = 'SourceChannel';
							break;
						//来源
						case 'source':
							key = 'source';
							break;
						//购买力
						case 'purchasing_power':
							key = 'customer_purchasing_power';
							break;
						//认知理念
						case 'cognitive_idea':
							key = 'cognitive_concept';
							break;
						//是否加微信 - 已改为单选组件，不再需要从字典获取
						case 'call_intent':
							return Promise.resolve();
							break;
						//决策人
						case 'decision_maker':
							key = 'decision_maker';
							break;
						//客户初步意向度
						case 'initial_intent':
							key = 'preliminarycustomerintention';
							break;
						//客户状态
						case 'status':
							key = 'kh_status';
							break;
						//距离
						case 'distance':
							key = 'distance';
							break;
						//客户分类
						case 'customer_type':
							key = 'customer_type';
							break;
						default:
							console.warn(`未知的字典类型: ${inputName}`);
							return;
					}
					
					console.log(`getDict - 字典键值映射: ${inputName} -> ${key}`);
					
					// 确保 picker_config[inputName] 存在
					if (!this.picker_config[inputName]) {
						this.picker_config[inputName] = { options: [], text: '点击选择' };
					}

					// 使用 util.getDict 获取并缓存字典
					console.log(`getDict - 调用 $util.getDict('${key}')`);
					let dictionary = await this.$util.getDict(key);
					console.log(`getDict - 字典数据获取结果:`, dictionary);
					
					if(!dictionary || !Array.isArray(dictionary) || dictionary.length === 0){
						console.warn(`字典 ${key} 数据为空`);
						return;
					}
					
					let arr = [];
					// 处理接口返回的数据结构 [{name: "抖音", value: "1", sort: 0, memo: ""}, ...]
					dictionary.forEach((v) => {
						arr.push({ text: v.name, value: v.value });
					});

					if (inputName == 'source_channel') {
						// 插入到arr的头部
						arr.unshift({
							text: '线下',
							value: '0',
						});
					}

					this.picker_config[inputName].options = arr;
					
					console.log(`getDict - 字典 ${inputName} 加载完成，选项数: ${arr.length}`);
					return arr;
				} catch (error) {
					console.error(`获取字典 ${inputName} 失败:`, error);
					return [];
				}
			},

			//打开结果列表
			openDuplicateCheck() {
				this.showDuplicateCheck = true
			},
			//关闭结果列表
			closeDuplicateCheck(e) {
				this.showDuplicateCheck = false
			},





			//联系电话失去焦点时间
			async handlePhoneBlur() {
				if (!this.formData.phone_number) {
					return
				}

				this.clientUserList = []

				let param = {
					phone_number: this.formData.phone_number
				}
				let res = await apiRoute.xs_getAllCustomerResources(param)
				if (res.code != 1) {
					if (res.msg == '暂无数据') {
						return
					}
					uni.showToast({
						title: res.msg,
						icon: 'none'
					})
					return
				}
				console.log('查重', res)



				this.clientUserList = res.data

				if (this.clientUserList.length == 1) {
					if (this.clientUserList[0].id == this.formData.id) {
						//查重后的手机号是自己,就不展示查重结果了
						return
					}
				}

				this.openDuplicateCheck()
			},






			//性别选择器
			changeSex(e) {
				this.formData.gender = e.detail.value
			},



			//切换tag列表
			async segmented(e) {
				console.log(e)
				//e.id|0=基础信息 1=六要素
				let status = e.id
				this.optionTableId = String(status)
			},

			//查看修改记录
			viewEditLog() {
				if (!this.resource_sharing_id) {
					uni.showToast({
						title: '客户信息不存在',
						icon: 'none'
					});
					return;
				}

				uni.navigateTo({
					url: `/pages-market/clue/edit_clues_log?customer_resource_id=${this.resource_sharing_id}`
				});
			},

			// 快速填写相关方法
			// 打开快速填写弹窗
			openQuickFill() {
				this.showQuickFill = true
				this.quickFillText = ''
			},
			
			// 解析快速填写文本
			parseQuickFillText() {
				if (!this.quickFillText.trim()) {
					uni.showToast({
						title: '请输入要解析的文本',
						icon: 'none'
					})
					return
				}
				
				try {
					// 定义字段映射规则
					const fieldRules = [
						{ key: 'name', patterns: ['姓名', '客户姓名', '用户姓名', '学员姓名', '学生姓名'] },
						{ key: 'phone_number', patterns: ['电话', '手机', '联系电话', '手机号', '电话号码', '联系方式'] },
						{ key: 'campus', patterns: ['校区', '所属校区', '校区名称'] },
						{ key: 'age', patterns: ['年龄'] },
						{ key: 'birthday', patterns: ['生日', '出生日期', '生日日期'] }
					]
					
					// 用于存储解析结果
					const parsedData = {}
					const text = this.quickFillText.trim()
					
					// 对每个字段规则进行匹配
					fieldRules.forEach(rule => {
						rule.patterns.forEach(pattern => {
							// 匹配模式：字段名 + 冒号/等号 + 数据内容
							const regex = new RegExp(`${pattern}\\s*[：:=]\\s*([^，,\\n\\s]+)`, 'g')
							const match = regex.exec(text)
							if (match && match[1]) {
								parsedData[rule.key] = match[1].trim()
							}
						})
					})
					
					console.log('解析结果:', parsedData)
					
					// 填写到表单中
					let fillCount = 0
					if (parsedData.name) {
						this.formData.name = parsedData.name
						fillCount++
					}
					if (parsedData.phone_number) {
						this.formData.phone_number = parsedData.phone_number
						fillCount++
					}
					if (parsedData.campus) {
						// 需要在校区选项中查找匹配的项
						this.findAndSetCampus(parsedData.campus)
						fillCount++
					}
					if (parsedData.age) {
						const age = parseInt(parsedData.age)
						if (!isNaN(age) && age > 0 && age < 150) {
							this.formData.age = age
							fillCount++
						}
					}
					if (parsedData.birthday) {
						this.formData.birthday = parsedData.birthday
						fillCount++
					}
					
					if (fillCount > 0) {
						uni.showToast({
							title: `成功填写${fillCount}个字段`,
							icon: 'success'
						})
						this.showQuickFill = false
					} else {
						uni.showToast({
							title: '未能识别到有效信息，请检查格式',
							icon: 'none'
						})
					}
					
				} catch (error) {
					console.error('解析失败:', error)
					uni.showToast({
						title: '解析失败，请检查格式',
						icon: 'none'
					})
				}
			},
			
			// 查找并设置校区
			findAndSetCampus(campusText) {
				const campusOptions = this.picker_config.campus?.options || []
				const matchedCampus = campusOptions.find(option => 
					option.text.includes(campusText) || campusText.includes(option.text)
				)
				
				if (matchedCampus) {
					this.formData.campus = matchedCampus.value
					this.picker_config.campus.text = matchedCampus.text
				}
			},


			//######-----下拉选择器组件相关-----######
			//打开下拉选择器
			openCicker(input_name, linkage = true) {
				this.picker_options = []

				this.picker_input_name = input_name

				let arr = this.picker_config[input_name]?.options || []

				if (!arr.length) {
					uni.showToast({
						title: '暂无选项',
						icon: 'none'
					})
					return
				}

				this.picker_options = arr
				this.picker_linkage = linkage
				// 使用 nextTick 确保数据更新后再打开 picker
				this.$nextTick(() => {
					this.picker_show = true
				})
			},
			//监听-下拉选择器
			changeCicker(e) {
				console.log('监听-下拉选择器', this.picker_input_name, e);
				let input_name = this.picker_input_name;
				
				// 更新表单数据
				this.formData[input_name] = e.value;
				
				// 更新选择器文本
				this.picker_config[input_name].text = e.text;
				
				// 特殊处理：来源选择
				if (input_name === 'source') {
					// 如果选择了线上(1)，则需要选择来源渠道
					if (e.value === '1' || e.value === 1) {
						// 清空来源渠道，等待用户选择
						this.formData.source_channel = '';
						this.picker_config.source_channel.text = '点击选择';
					} else {
						// 如果选择了其他来源，则设置来源渠道为线下
						this.formData.source_channel = '0'; // 0=线下
						this.picker_config.source_channel.text = '线下';
					}
				}
				
				this.cancelCicker();
			},
			//关闭下拉选择器
			cancelCicker() {
				this.picker_show = false
				this.picker_input_name = ''
				this.picker_options = []
			},


			//######-----时间选择器组件相关-----######
			//打开下拉选择器
			openDate(input_name) {
				this.date_picker_show = true
				this.data_picker_input_name = input_name
				
				// 设置默认日期值
				if (this.formData[input_name]) {
					// 如果有值，使用当前值
					this.default_date_value = this.formData[input_name]
				} else {
					// 如果没有值，使用当天日期
					const today = new Date()
					const year = today.getFullYear()
					const month = String(today.getMonth() + 1).padStart(2, '0')
					const day = String(today.getDate()).padStart(2, '0')
					this.default_date_value = `${year}-${month}-${day}`
				}
			},
			//选择跟进时间
			change_date(e) {
				//跟进时间
				let val = (e.result ?? '')
				if (val) {
					val = val
				}

				let input_name = this.data_picker_input_name
				this.formData[input_name] = val

				this.cancel_date()
			},
			//关闭选择跟进时间
			cancel_date() {
				this.date_picker_show = false
			},

			//下一步 index|0=添加客户,1六要素
			async nextStep(index) {
				this.optionTableId = String(index)
			},
			//表单验证
			async validatorForm(data) {
				//姓名
				if(!data.name){
				  uni.showToast({
				    title: '学生姓名必填',
				    icon: 'none'
				  })
				  this.nextStep('0')
				  return false
				}
				//电话
				if(!data.phone_number){
				  uni.showToast({
				    title: '电话必填',
				    icon: 'none'
				  })
				  this.nextStep('0')
				  return false
				}
				//校区必填
				if(!data.campus){
				  uni.showToast({
				    title: '校区必填',
				    icon: 'none'
				  })
				  this.nextStep('0')
				  return false
				}
				return true
			},
			//提交
			async submit() {
				console.log('提交', this.formData)
				let data = {
					...this.formData
				}
				//表单验证
				let validatorForm = await this.validatorForm(data)
				console.log('验证结果', validatorForm)
				if (!validatorForm) {
					return
				}

				//防止重复提交
				if (!this.is_submit) {
					return
				}
				this.is_submit = false

				let res = await apiRoute.xs_editCustomerResources(data)

				this.is_submit = true

				if (res.code != 1) {
					uni.showToast({
						title: res.msg,
						icon: 'none'
					})
					return
				}
				uni.showToast({
					title: res.msg,
					icon: 'success'
				})
				//延迟1s执行
				setTimeout(() => {
					//跳转页面-客户详情列表
					//关闭当前页跳转新页面
					uni.redirectTo({
						url: `/pages-market/clue/clue_info?resource_sharing_id=${this.resource_sharing_id}`
					})
				}, 1000)
			},
		}
	}
</script>

<style lang="less" scoped>
	.search_box {
		padding: 20rpx 40rpx;
		border-bottom: 1px solid #333333;
		display: flex;
		justify-content: space-between;
		align-items: center;

		.input_box {
			width: 70%;

			input {
				width: 100%;
				height: 60rpx;
				color: #fff;
				font-size: 28rpx;
			}
		}

		.btn {
			font-size: 28rpx;
			color: #24BA9F;
		}
	}

	.assemble {
		width: 100%;
		height: 100vh;
		background: #292929;
		overflow: auto;
		
		:deep(.fui-form__item-bottom) {
			background: transparent !important;
			left: 0 !important;
			right: 0 !important;
			display: none !important;
		}
	}

	.title {
		font-size: 26rpx;
		color: #fff;
		padding: 26rpx 0 26rpx 32rpx;
	}

	.input-title {
		font-size: 26rpx;
		color: #fff;
	}

	.form-style {
		width: 100%;
		// background: #434544;
		
		:deep(.fui-form__item-bottom) {
			background: transparent !important;
			left: 0 !important;
			right: 0 !important;
			display: none !important;
		}
	}

	.form-style-vid {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 12rpx 0;
	}

	.input-style {
		text-align: right !important;
		
		:deep(.fui-label__text) {
			margin-top: 10rpx;
		}
		
		:deep(.fui-form__item-flex) {
			align-items: flex-start !important;
		}
		
		:deep(.fui-form__item-flex-start) {
			align-items: flex-start !important;
		}
		
		:deep(.fui-textarea__wrap) {
			border: none !important;
			padding: 0 !important;
		}
		
		:deep(.fui-textarea__counter) {
			padding-right: 0 !important;
		}
	}
	
	.textarea-container {
		width: 100%;
		padding: 0 0 20rpx 0;
		
		:deep(.fui-textarea__wrap) {
			border: none !important;
			padding: 0 !important;
			background-color: #434544;
		}
		
		:deep(.fui-textarea__placeholder) {
			text-align: left;
		}
		
		:deep(.fui-textarea__inner) {
			text-align: left;
		}
		
		:deep(.fui-form__item-bottom) {
			display: none !important;
		}
	}

	.fui-btn__box {
		margin: 50rpx auto 120rpx;
		width: 92%;
	}

	//查重结构弹出层
	.fui-scroll__wrap {
		height: 60vh;

		.title_box {
			padding: 10rpx 20rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;

			.title {
				font-size: 28rpx;
				color: #101010;
			}
		}

		.section_ul {
			margin-bottom: 100rpx;
			height: 98%;

			.not_list {
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;

				.img {
					width: 112rpx;
					height: 112rpx;
				}

				.title {
					padding: 0;
					margin-top: 10rpx;
					color: #101010;
					font-size: 28rpx;
					text-align: center;
				}
			}

			.ul {
				padding: 26rpx;
				padding-bottom: 100rpx;
				display: flex;
				flex-direction: column;

				.li {
					margin-bottom: 26rpx;
					padding: 26rpx;
					display: flex;
					justify-content: space-between;
					gap: 10rpx;

					border-radius: 18rpx;
					background-color: rgba(67, 69, 68, 1);
					color: #fff;
					font-size: 28rpx;
					border: 0rpx solid rgba(121, 121, 121, 1);

					.left_box {
						width: 80%;
						display: flex;
						flex-direction: column;
						gap: 20rpx;

						.box_1 {
							display: flex;
							align-items: center;

							.img {
								width: 48rpx;
								height: 48rpx;
								border-right: 50%;
							}

							.name {
								margin-left: 20rpx;
							}

							.tag {
								margin-left: 20rpx;
								width: 84rpx;
								height: 32rpx;
								line-height: 28rpx;
								border-radius: 0rpx 20rpx 20rpx 20rpx;
								background-color: rgba(236, 128, 141, 0.3);
								color: rgba(240, 90, 90, 1);
								font-size: 20rpx;
								text-align: center;
								border: 0rpx solid rgba(121, 121, 121, 1);
							}
						}

						.box_2 {
							display: flex;
							justify-content: space-between;
							align-items: center;

							.left {
								display: flex;
								align-items: flex-end;

								.name {
									font-size: 28rpx;
								}

								.call {
									margin-left: 10rpx;
									font-size: 24rpx;
									color: #ba7b30;
								}
							}
						}

						.box_3 {
							display: flex;
							gap: 30rpx;

							.left {}

							.right {
								display: flex;
								align-items: center;
								gap: 10rpx;

								.img {
									width: 16rpx;
									height: 16rpx;
									border-right: 50%;
								}
							}
						}
					}

					.right_box {
						width: 25%;
						display: flex;
						justify-content: space-between;
						align-items: center;

						.img {
							width: 70rpx;
							height: 70rpx;
							border-radius: 50%;
						}
					}
				}
			}
		}

	}

	.save-btn-box {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 100;
		background: #292929;
		padding: 20rpx 40rpx 40rpx 40rpx;
		box-shadow: 0 -2rpx 8rpx rgba(0,0,0,0.12);
	}
	
	.safe-area-bottom {
		width: 100%;
		height: 180rpx; /* 增加高度，确保有足够的空间 */
	}
	
	// 快速填写弹窗样式
	.quick-fill-mask {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background: rgba(0, 0, 0, 0.6);
		z-index: 1500;
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 40rpx;
	}
	
	.quick-fill-content {
		background: #fff;
		border-radius: 16rpx;
		width: 100%;
		max-width: 600rpx;
		max-height: 80vh;
		display: flex;
		flex-direction: column;
	}
	
	.quick-fill-header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 32rpx;
		border-bottom: 1px solid #f0f0f0;
	}
	
	.quick-fill-title {
		font-size: 32rpx;
		font-weight: 600;
		color: #333;
	}
	
	.quick-fill-close {
		width: 60rpx;
		height: 60rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		
		.close-text {
			font-size: 32rpx;
			color: #999;
		}
	}
	
	.quick-fill-body {
		padding: 32rpx;
		flex: 1;
		overflow-y: auto;
	}
	
	.quick-fill-tip {
		margin-bottom: 24rpx;
		font-size: 24rpx;
		color: #666;
		line-height: 1.5;
		
		text:first-child {
			display: block;
			margin-bottom: 8rpx;
		}
		
		text:last-child {
			display: block;
			color: #29d3b4;
			font-weight: 500;
		}
	}
	
	.quick-fill-textarea {
		width: 100%;
		height: 300rpx;
		border: 1px solid #ddd;
		border-radius: 8rpx;
		padding: 16rpx;
		font-size: 28rpx;
		line-height: 1.5;
		background: #fafafa;
		box-sizing: border-box;
	}
	
	.quick-fill-buttons {
		display: flex;
		gap: 20rpx;
		padding: 32rpx;
		border-top: 1px solid #f0f0f0;
	}
	
	.quick-fill-btn {
		flex: 1;
		height: 72rpx;
		line-height: 72rpx;
		text-align: center;
		border-radius: 8rpx;
		font-size: 28rpx;
		font-weight: 600;
		
		&.cancel-btn {
			background: #f5f5f5;
			color: #666;
			border: 1px solid #ddd;
		}
		
		&.confirm-btn {
			background: #29d3b4;
			color: #fff;
		}
	}
	
	.quick-fill-btn {
		padding: 0 32rpx;
		background: #f5f5f5;
		border: 1px solid #ddd;
		border-radius: 8rpx;
	}
</style>