userCard.vue 23 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039
  1. <template>
  2. <view v-if="show" class="mask" @click="onMaskClick">
  3. <!-- 弹窗容器(阻止冒泡,避免点击内容关闭弹窗) -->
  4. <view class="popup-container" @click.stop>
  5. <!-- 弹窗头部 -->
  6. <view class="popup-header">
  7. <text class="popup-title">{{ isEdit ? '编辑用户' : title }}</text>
  8. <view class="close-btn" @click="onClose">
  9. <image src="/static/image/device/close_icon32.png" mode="widthFix"></image>
  10. </view>
  11. </view>
  12. <!-- 弹窗主体内容 -->
  13. <view class="popup-content">
  14. <view class="card-box">
  15. <view class="card-title">用户基本信息</view>
  16. <view class="form-item2">
  17. <view class="x-f">
  18. <text class="label">姓名:</text>
  19. <input type="text" v-model="form.username" class="form-input" placeholder="请输入姓名"
  20. placeholder-class="text-input" />
  21. </view>
  22. <view class="x-f">
  23. <text class="label">年龄:</text>
  24. <input type="number" v-model="form.age" class="form-input" placeholder="请输入年龄"
  25. placeholder-class="text-input" />
  26. </view>
  27. </view>
  28. <view class="form-item2">
  29. <text class="label">性别:</text>
  30. <radio-group class="r-box">
  31. <label style="margin-right: 30px;">
  32. <radio color="#8F6726" value="1" :checked="form.sex === 1" @click="genderChange(1)"
  33. style="margin-right: 12px;" />
  34. <text class="option-text">男</text>
  35. </label>
  36. <label>
  37. <radio color="#8F6726" value="0" :checked="form.sex === 0" @click="genderChange(0)"
  38. style="margin-right: 12px;" />
  39. <text class="option-text">女</text>
  40. </label>
  41. </radio-group>
  42. </view>
  43. <view class="form-item2">
  44. <view class="x-f">
  45. <text class="label">身高(cm):</text>
  46. <input type="digit" v-model="form.height" class="form-input" placeholder="请输入身高"
  47. placeholder-class="text-input" />
  48. </view>
  49. <view class="x-f">
  50. <text class="label">体重(kg):</text>
  51. <input type="digit" v-model="form.weight" class="form-input" placeholder="请输入体重"
  52. placeholder-class="text-input" />
  53. </view>
  54. </view>
  55. <view class="form-item">
  56. <text class="label">手机号:</text>
  57. <input type="number" v-model="form.phone" maxlength="11" class="form-input" placeholder="请输入手机号"
  58. placeholder-class="text-input" />
  59. </view>
  60. </view>
  61. <view class="card-box">
  62. <view class="card-title">既往病史(多选)</view>
  63. <view class="form-item3">
  64. <view class="card-list">
  65. <view v-for="(item,index) in qw" :key="item.id"
  66. :class="selectedIds.includes(item.id)?'card-btn active':'card-btn'"
  67. @click="changeQw(item)" :title="item.name">
  68. {{item.name}}
  69. </view>
  70. <view class="card-btn" style="padding: 0;border: 0;"></view>
  71. <view class="card-btn" style="padding: 0;border: 0;"></view>
  72. </view>
  73. <input v-if="isQw" type="text" v-model="otherQw" class="other-input" placeholder="请输入相关描述"
  74. placeholder-class="text-input" />
  75. </view>
  76. </view>
  77. <view class="card-box">
  78. <view class="card-title">过敏史</view>
  79. <view class="form-item3">
  80. <view class="card-list">
  81. <view v-for="(item,index) in all" :key="item.id"
  82. :class="aIndex==item.id?'card-btn active':'card-btn'" @click="changeAll(item)"
  83. :title="item.name">
  84. {{item.name}}
  85. </view>
  86. <view class="card-btn" style="padding: 0;border: 0;"></view>
  87. <view class="card-btn" style="padding: 0;border: 0;"></view>
  88. </view>
  89. <input v-if="isAll" type="text" v-model="otherAll" class="other-input" placeholder="请输入相关描述"
  90. placeholder-class="text-input" />
  91. </view>
  92. </view>
  93. <view class="card-box">
  94. <view class="card-title">生活习惯</view>
  95. <view class="form-item3">
  96. <!-- <text class="label">既往病史:</text> -->
  97. <view class="card-list">
  98. <view v-for="(item,index) in habits" :key="item.qId" class="card-text">
  99. {{index+1}}、{{item.typeName}}
  100. <view class="card-text-box">
  101. <view v-for="(it,idx) in item.option" :key="it.id" class="card-btn2"
  102. @click="changeH(it,item)" :class="{ 'active': item.selectedId == it.id}"
  103. :title="it.name">
  104. {{it.name}}
  105. </view>
  106. <view class="card-btn2" style="padding: 0;border: 0;"></view>
  107. <view class="card-btn2" style="padding: 0;border: 0;"></view>
  108. </view>
  109. </view>
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. <!-- 弹窗底部按钮 -->
  115. <view class="popup-footer">
  116. <view class="btn2 cancel-btn2" @click="onClose">
  117. <text>取消</text>
  118. </view>
  119. <!-- <view class="btn2 confirm-btn2" @click="onConfirm">
  120. <text>下一步</text>
  121. </view> -->
  122. <view class="btn2 confirm-btn2" @click="onConfirm">
  123. <text>确认</text>
  124. </view>
  125. </view>
  126. </view>
  127. </view>
  128. </template>
  129. <script>
  130. import {
  131. el
  132. } from 'date-fns/locale';
  133. export default {
  134. name: 'UserFormPopup',
  135. props: {
  136. // 控制弹窗显示/隐藏
  137. show: {
  138. type: Boolean,
  139. default: false
  140. },
  141. // 弹窗标题(默认“新建用户”,可自定义)
  142. title: {
  143. type: String,
  144. default: '新建用户'
  145. },
  146. // 初始表单数据(用于编辑场景)
  147. initialForm: {
  148. type: Object,
  149. default: () => ({})
  150. }
  151. },
  152. data() {
  153. return {
  154. form: {
  155. username: '', // 姓名
  156. phone: '', // 手机号
  157. sex: 1, // 性别(1-男,0-女)
  158. age: '', // 年龄
  159. height: '', // 身高
  160. weight: '', // 体重
  161. previousMedicalHistory: '', // 既往病史
  162. habitList: [], //饮食习惯
  163. historyOfAllergies: '' //过敏史
  164. },
  165. isEdit: false,
  166. qIndex: null,
  167. aIndex: null,
  168. isAll: false,
  169. isQw: false,
  170. otherAll: null,
  171. otherQw: null,
  172. selectedIds: [],
  173. initialFormKeys:[],
  174. qw: [{
  175. name: '无',
  176. id: 1
  177. },
  178. {
  179. name: '糖尿病',
  180. id: 2
  181. },
  182. {
  183. name: '高血压',
  184. id: 3
  185. },
  186. {
  187. name: '心脑血管疾病',
  188. id: 4
  189. },
  190. {
  191. name: '胃病',
  192. id: 5
  193. },
  194. {
  195. name: '排便异常',
  196. id: 6
  197. },
  198. {
  199. name: '肝病',
  200. id: 7
  201. },
  202. {
  203. name: '肾病',
  204. id: 8
  205. },
  206. {
  207. name: '其他',
  208. id: 9,
  209. isQw: true
  210. },
  211. ],
  212. all: [{
  213. name: '无',
  214. id: 1
  215. },
  216. {
  217. name: '药物',
  218. id: 2
  219. },
  220. {
  221. name: '食物',
  222. id: 3
  223. },
  224. {
  225. name: '花粉',
  226. id: 4
  227. },
  228. {
  229. name: '其他',
  230. id: 5,
  231. isAll: true
  232. },
  233. ],
  234. habits: [{
  235. typeName: '睡眠状况',
  236. qId: 1,
  237. option: [{
  238. name: '很差',
  239. id: 1,
  240. }, {
  241. name: '差',
  242. id: 2
  243. }, {
  244. name: '一般',
  245. id: 3
  246. }, {
  247. name: '良好',
  248. id: 4
  249. }, ],
  250. selectedId: null // 存储选中的选项ID
  251. },
  252. {
  253. typeName: '睡眠时间',
  254. qId: 2,
  255. option: [{
  256. name: '<6小时',
  257. id: 1,
  258. }, {
  259. name: '6-8小时',
  260. id: 2
  261. }, {
  262. name: '9-10小时',
  263. id: 3
  264. }, {
  265. name: '>10小时',
  266. id: 4
  267. }, ],
  268. selectedId: null // 存储选中的选项ID
  269. },
  270. {
  271. typeName: '是否经常熬夜',
  272. qId: 3,
  273. option: [{
  274. name: '经常',
  275. id: 1,
  276. }, {
  277. name: '偶尔',
  278. id: 2
  279. }, {
  280. name: '很少',
  281. id: 3
  282. }, {
  283. name: '无',
  284. id: 4
  285. }, ],
  286. selectedId: null // 存储选中的选项ID
  287. },
  288. {
  289. typeName: '饮食习惯',
  290. qId: 4,
  291. option: [{
  292. name: '正常就餐',
  293. id: 1,
  294. },
  295. {
  296. name: '暴饮暴食',
  297. id: 2,
  298. },
  299. {
  300. name: '压力大进食',
  301. id: 3
  302. },
  303. {
  304. name: '就外就餐多',
  305. id: 4
  306. },
  307. {
  308. name: '不吃早餐',
  309. id: 5
  310. },
  311. ],
  312. selectedId: null // 存储选中的选项ID
  313. },
  314. {
  315. typeName: '日常运动量',
  316. qId: 5,
  317. option: [{
  318. name: '久坐不动',
  319. id: 1,
  320. },
  321. {
  322. name: '轻度运动',
  323. id: 2
  324. },
  325. {
  326. name: '中度运动',
  327. id: 3
  328. },
  329. {
  330. name: '大量运动',
  331. id: 4
  332. },
  333. ],
  334. selectedId: null // 存储选中的选项ID
  335. },
  336. {
  337. typeName: '每周锻炼次数',
  338. qId: 6,
  339. option: [{
  340. name: '≤2次',
  341. id: 1,
  342. },
  343. {
  344. name: '3-5次',
  345. id: 2
  346. },
  347. {
  348. name: '>5次',
  349. id: 3
  350. },
  351. ],
  352. selectedId: null // 存储选中的选项ID
  353. },
  354. {
  355. typeName: '每次锻炼时间多少分钟',
  356. qId: 7,
  357. option: [{
  358. name: '≤20分钟',
  359. id: 1,
  360. },
  361. {
  362. name: '20-40分钟',
  363. id: 2
  364. },
  365. {
  366. name: '41-60分钟',
  367. id: 3
  368. },
  369. {
  370. name: '>60分钟',
  371. id: 4
  372. },
  373. ],
  374. selectedId: null // 存储选中的选项ID
  375. },
  376. ]
  377. };
  378. },
  379. watch: {
  380. // 监听初始数据变化(用于编辑时回显)
  381. initialForm: {
  382. immediate: true,
  383. handler(val) {
  384. if (val && Object.keys(val).length > 0) {
  385. this.form = {
  386. ...val
  387. };
  388. this.isEdit = true
  389. this.init()
  390. //console.log(this.form,'---')
  391. } else {
  392. this.isEdit = false
  393. }
  394. }
  395. },
  396. // 监听弹窗显示状态,每次显示时重置表单(可选)
  397. show(newVal) {
  398. //console.log(newVal)
  399. if (!newVal) {
  400. this.resetForm();
  401. }
  402. }
  403. },
  404. created() {
  405. // 初始化时记录form的所有初始键(只执行一次)
  406. const formKeys = Object.keys(this.form);
  407. const extraKeys = ['userId','id','username','fsUserId'];
  408. // 3. 合并并去重(避免重复字段)
  409. this.initialFormKeys = [...new Set([...formKeys, ...extraKeys])];
  410. if (!Array.isArray(this.form.habitList)) {
  411. this.form.habitList = [];
  412. }
  413. },
  414. methods: {
  415. //回显数据处理
  416. init() {
  417. // 1. 既往病史回显
  418. if (this.form.previousMedicalHistory !== '') {
  419. const historyArr = this.form.previousMedicalHistory.split(',');
  420. const presetNames = this.qw.map(item => item.name);
  421. // 1. 筛选出属于预设选项的内容,回显到选中状态
  422. const selectedPresetIds = this.qw
  423. .filter(option => historyArr.includes(option.name))
  424. .map(option => option.id);
  425. this.selectedIds = selectedPresetIds;
  426. // 2. 筛选出不属于预设选项的内容(归为“其他”)
  427. const otherTexts = historyArr.filter(text =>
  428. !presetNames.includes(text) // 排除预设选项名称
  429. );
  430. // 3. 处理“其他”选项的回显
  431. if (otherTexts.length > 0) {
  432. // 自动勾选“其他”选项
  433. if (!this.selectedIds.includes(9)) {
  434. this.selectedIds.push(9);
  435. }
  436. // 合并所有非预设内容到“其他”输入框
  437. this.isQw = true;
  438. this.otherQw = otherTexts.join(','); // 多个非预设内容用逗号拼接
  439. }
  440. }
  441. // 2. 过敏史回显
  442. if (this.form.historyOfAllergies !== '') {
  443. const allergyItem = this.all.find(item => item.name === this.form.historyOfAllergies);
  444. this.aIndex = allergyItem ? allergyItem.id : 5; // 找不到则默认“其他”
  445. if (this.aIndex === 5) {
  446. this.isAll = true;
  447. this.otherAll = this.form.historyOfAllergies;
  448. }
  449. }
  450. // 3. 生活习惯回显
  451. if (Array.isArray(this.form.habitList) && this.form.habitList.length > 0) {
  452. this.habits.forEach(habit => {
  453. const matched = this.form.habitList.find(item => item.qId === habit.qId);
  454. if (matched) {
  455. habit.selectedId = matched.optionId; // 回显选中状态
  456. }else {
  457. // 可选:无匹配数据时,强制清空选中状态(避免残留旧数据)
  458. habit.selectedId = null;
  459. }
  460. });
  461. }
  462. },
  463. // 重置表单
  464. resetForm() {
  465. this.form = {
  466. username: '',
  467. phone: '',
  468. sex: 1,
  469. age: '',
  470. height: '',
  471. weight: '',
  472. previousMedicalHistory: '',
  473. habitList: [],
  474. historyOfAllergies: ''
  475. };
  476. this.selectedIds = [],
  477. this.habits.forEach(item => {
  478. item.selectedId = null; // 遍历每个问题,清空选中ID
  479. });
  480. this.isEdit = false,
  481. this.qIndex = null,
  482. this.aIndex = null,
  483. this.isAll = null,
  484. this.isQw = null,
  485. this.otherAll = null,
  486. this.otherQw = null
  487. },
  488. // 性别切换
  489. genderChange(sex) {
  490. this.form.sex = sex;
  491. },
  492. changeQw(item) {
  493. this.qIndex = item.id
  494. // 检查当前项是否已选中
  495. const index = this.selectedIds.indexOf(item.id);
  496. if (item.id === 1) { // 选中“无”
  497. this.selectedIds = [1];
  498. this.isQw = false;
  499. this.otherQw = '';
  500. return;
  501. }
  502. if (index > -1) {
  503. // 如果已选中,则移除
  504. this.selectedIds.splice(index, 1);
  505. // 如果移除的是"其他"选项,隐藏输入框
  506. if (item.isQw) {
  507. this.isQw = false;
  508. this.otherQw = '';
  509. }
  510. } else {
  511. this.selectedIds = this.selectedIds.filter(id => id !== 1);
  512. // 如果未选中,则添加
  513. this.selectedIds.push(item.id);
  514. // 如果选中的是"其他"选项,显示输入框
  515. if (item.isQw) {
  516. this.isQw = true;
  517. }
  518. }
  519. },
  520. // 拼接选中的病史为字符串
  521. getSelectedHistoryString() {
  522. // 收集所有选中项的名称
  523. const selectedNames = [];
  524. this.selectedIds.forEach(id => {
  525. const item = this.qw.find(item => item.id === id);
  526. if (item) {
  527. //console.log(item,'item')
  528. // 如果是"其他"选项且有输入内容,使用输入的内容
  529. if (item.id === 9 ) {
  530. const otherVal = (this.otherQw || '').trim();
  531. if (otherVal) { // 仅当有有效内容时才添加
  532. selectedNames.push(otherVal);
  533. }
  534. }
  535. // 排除没有输入内容的"其他"选项
  536. else if (item.id !== 9) {
  537. selectedNames.push(item.name);
  538. }
  539. }
  540. });
  541. // 将数组拼接为逗号分隔的字符串
  542. return selectedNames.join(','); // 使用中文逗号分隔
  543. },
  544. //拼接选中的过敏史名称为字符串
  545. getAllergyString() {
  546. if (!this.aIndex) return '';
  547. const selectedItem = this.all.find(item => item.id === this.aIndex);
  548. if (!selectedItem) return '';
  549. // 处理"其他"选项
  550. if (this.aIndex === 5) {
  551. const otherVal = this.otherAll || ''; // 若为null/undefined,转为空字符串
  552. if (otherVal.trim()) { // 此时调用trim()不会报错
  553. return otherVal.trim();
  554. }
  555. }
  556. return selectedItem.name;
  557. },
  558. changeAll(item) {
  559. this.aIndex = item.id
  560. if (item.isAll) {
  561. this.isAll = true
  562. } else {
  563. this.isAll = false
  564. }
  565. },
  566. changeH(option, question) {
  567. //console.log(question,'question')
  568. // 单选逻辑:设置当前问题的选中ID为点击的选项ID
  569. question.selectedId = option.id
  570. this.updateHabitList(question, option)
  571. },
  572. // 更新生活习惯列表
  573. updateHabitList(question, selectedOption) {
  574. if (!Array.isArray(this.form.habitList)) {
  575. this.form.habitList = []; // 强制转为空数组
  576. }
  577. // 查找当前问题在habitList中的索引
  578. const index = this.form.habitList.findIndex(item => item.qId === question.qId);
  579. // 构建生活习惯数据对象
  580. const habitData = {
  581. qId: question.qId,
  582. typeName: question.typeName,
  583. optionId: selectedOption.id,
  584. optionName: selectedOption.name,
  585. };
  586. // 如果已存在则更新,否则添加
  587. if (index > -1) {
  588. this.form.habitList.splice(index, 1, habitData);
  589. } else {
  590. this.form.habitList.push(habitData);
  591. }
  592. //console.log(this.form.habitList)
  593. },
  594. // 关闭弹窗
  595. onClose() {
  596. this.$emit('close');
  597. },
  598. // 点击遮罩层关闭(可选)
  599. onMaskClick() {
  600. this.$emit('close');
  601. },
  602. // 确认提交
  603. onConfirm() {
  604. // 表单校验
  605. if (this.form.username == null || this.form.username == '') {
  606. uni.showToast({
  607. title: "姓名不能为空",
  608. icon: "none"
  609. })
  610. return
  611. }
  612. if (this.form.age == null || this.form.age == '') {
  613. uni.showToast({
  614. title: "年龄不能为空",
  615. icon: "none"
  616. })
  617. return
  618. }
  619. if (this.form.height == null || this.form.height == '') {
  620. uni.showToast({
  621. title: "身高不能为空",
  622. icon: "none"
  623. })
  624. return
  625. }
  626. if (this.form.weight == null || this.form.weight == '') {
  627. uni.showToast({
  628. title: "体重不能为空",
  629. icon: "none"
  630. })
  631. return
  632. }
  633. const phoneError = this.checkPhone(this.form.phone);
  634. if (phoneError) {
  635. uni.showToast({
  636. title: phoneError, // 直接显示具体错误
  637. icon: "none"
  638. });
  639. return;
  640. }
  641. const isOtherSelected = this.selectedIds.includes(9);
  642. if (isOtherSelected && (this.otherQw==null || this.otherQw=='')) {
  643. uni.showToast({
  644. title: "请输入其他描述",
  645. icon: "none"
  646. })
  647. return
  648. }
  649. this.form.previousMedicalHistory = this.getSelectedHistoryString();
  650. if (this.form.previousMedicalHistory == '') {
  651. uni.showToast({
  652. title: "既往病史不能为空",
  653. icon: "none"
  654. })
  655. return;
  656. }
  657. this.form.historyOfAllergies = this.getAllergyString();
  658. if (this.form.historyOfAllergies=='') {
  659. uni.showToast({
  660. title: "过敏史不能为空",
  661. icon: "none"
  662. })
  663. return;
  664. }
  665. if (this.aIndex == 5 && (this.otherAll==null || this.otherAll=='')) {
  666. uni.showToast({
  667. title: "请输入其他描述",
  668. icon: "none"
  669. })
  670. return
  671. }
  672. const unselected = this.habits.find(question => question.selectedId === null);
  673. if (unselected) {
  674. uni.showToast({
  675. title: `请选择${unselected.typeName}`,
  676. icon: "none"
  677. })
  678. return;
  679. }
  680. // 校验通过,提交表单数据
  681. if (this.isEdit) {
  682. const submitData = {};
  683. this.initialFormKeys.forEach(key => {
  684. submitData[key] = this.form[key]; // 即使值为空也保留键
  685. });
  686. submitData.habitList = this.form.habitList.filter(item => !item.option);
  687. // 修改逻辑:通常需要携带唯一标识(如id)
  688. this.$emit('update', {
  689. ...submitData
  690. });
  691. } else {
  692. this.$emit('confirm', {
  693. ...this.form
  694. });
  695. }
  696. },
  697. // 手机号校验函数
  698. checkPhone(val) {
  699. const phone = val?.trim(); // 去除首尾空格
  700. // 1. 非空校验
  701. if (!phone) {
  702. uni.showToast({
  703. title: "手机号不能为空",
  704. icon: "none"
  705. });
  706. return "请输入正确的手机号";
  707. }
  708. // 2. 格式校验(中国大陆手机号规则:11位数字,以1开头)
  709. const phoneReg = /^1[3-9]\d{9}$/; // 正则表达式
  710. if (!phoneReg.test(phone)) {
  711. uni.showToast({
  712. title: "请输入正确的手机号",
  713. icon: "none"
  714. });
  715. return "请输入正确的手机号";
  716. }
  717. // 校验通过
  718. return '';
  719. }
  720. }
  721. };
  722. </script>
  723. <style scoped lang="scss">
  724. /* 遮罩层 */
  725. .mask {
  726. position: fixed;
  727. top: 0;
  728. left: 0;
  729. right: 0;
  730. bottom: 0;
  731. background-color: rgba(0, 0, 0, 0.5);
  732. display: flex;
  733. justify-content: center;
  734. align-items: center;
  735. z-index: 999;
  736. }
  737. /* 弹窗容器 */
  738. .popup-container {
  739. width: 85%;
  740. height: 85%;
  741. /* max-width: 500px; */
  742. background-color: #fff;
  743. border-radius: 12px;
  744. overflow: hidden;
  745. }
  746. /* 弹窗头部 */
  747. .popup-header {
  748. display: flex;
  749. justify-content: space-between;
  750. align-items: center;
  751. padding: 20px;
  752. border-bottom: 1px solid #eee;
  753. background: #E9DDCD;
  754. }
  755. .popup-title {
  756. flex: 1;
  757. font-family: Source Han Serif CN, Source Han Serif CN;
  758. font-weight: bold;
  759. font-size: 24px;
  760. color: #8F6726;
  761. text-align: center;
  762. }
  763. .close-btn {
  764. width: 24px;
  765. height: 24px;
  766. }
  767. .close-btn image {
  768. width: 100%;
  769. height: 100%;
  770. }
  771. /* 弹窗内容 */
  772. .popup-content {
  773. padding: 30px;
  774. height: 80%;
  775. overflow-y: auto;
  776. }
  777. .popup-content::-webkit-scrollbar {
  778. display: block !important;
  779. width: 10px !important;
  780. /* 滚动条宽度 */
  781. }
  782. .popup-content::-webkit-scrollbar-thumb {
  783. background: #8F6726 !important;
  784. /* 滚动条滑块颜色 */
  785. border-radius: 5px !important;
  786. /* 滑块圆角 */
  787. }
  788. .card-box {
  789. border-radius: 12px;
  790. border: 1px solid #8F6726;
  791. padding: 20px;
  792. margin-bottom: 20px;
  793. }
  794. .card-title {
  795. font-size: 24px;
  796. color: #222;
  797. /* margin-bottom: 20px; */
  798. }
  799. .card-list {
  800. width: 100%;
  801. display: flex;
  802. align-items: center;
  803. flex-direction: row;
  804. justify-content: space-between;
  805. flex-wrap: wrap;
  806. gap: 15px;
  807. margin-top: 20px;
  808. }
  809. .card-text {
  810. display: flex;
  811. align-items: flex-start;
  812. flex-direction: column;
  813. width: 100%;
  814. font-size: 20px;
  815. color: #8F6726;
  816. padding-bottom: 20px;
  817. // border-bottom: 1px solid #E9DDCD;
  818. // margin-bottom: 10px;
  819. &:last-child {
  820. border-bottom: 0;
  821. }
  822. }
  823. .card-text-box {
  824. display: flex;
  825. align-items: center;
  826. flex-direction: row;
  827. justify-content: space-between;
  828. flex-wrap: wrap;
  829. width: 100%;
  830. gap: 15px;
  831. margin-top: 10px;
  832. }
  833. .card-btn2 {
  834. width: calc(100% /3.5);
  835. color: #8F6726;
  836. border: 1px solid #8F6726;
  837. border-radius: 6px;
  838. padding: 10px;
  839. text-align: center;
  840. white-space: nowrap;
  841. /* 强制文字不换行 */
  842. overflow: hidden;
  843. /* 隐藏溢出的文字 */
  844. text-overflow: ellipsis;
  845. /* 溢出部分显示省略号 */
  846. &.active {
  847. background: #8F6726;
  848. color: #fff;
  849. }
  850. /* margin-top: 20px; */
  851. }
  852. .card-btn3 {
  853. width: calc(100% /3.5);
  854. white-space: nowrap;
  855. /* 强制文字不换行 */
  856. overflow: hidden;
  857. /* 隐藏溢出的文字 */
  858. text-overflow: ellipsis;
  859. /* 溢出部分显示省略号 */
  860. }
  861. .card-btn {
  862. // flex:1;
  863. width: calc(100% / 3.5);
  864. color: #8F6726;
  865. font-size: 20px;
  866. border: 1px solid #8F6726;
  867. border-radius: 6px;
  868. padding: 10px;
  869. text-align: center;
  870. white-space: nowrap;
  871. /* 强制文字不换行 */
  872. overflow: hidden;
  873. /* 隐藏溢出的文字 */
  874. text-overflow: ellipsis;
  875. /* 溢出部分显示省略号 */
  876. &.active {
  877. background: #8F6726;
  878. color: #fff;
  879. }
  880. }
  881. .form-item {
  882. display: flex;
  883. align-items: center;
  884. margin-top: 20px;
  885. }
  886. .form-item2 {
  887. display: flex;
  888. justify-content: space-between;
  889. margin-top: 20px;
  890. }
  891. .form-item3 {
  892. display: flex;
  893. align-items: flex-start;
  894. flex-direction: column;
  895. }
  896. .x-f {
  897. display: flex;
  898. align-items: center;
  899. width: 48%;
  900. }
  901. .x-c {
  902. display: flex;
  903. align-items: center;
  904. width: 30%;
  905. }
  906. .label {
  907. font-family: PingFang SC, PingFang SC;
  908. font-weight: 500;
  909. font-size: 20px;
  910. color: #222;
  911. }
  912. .form-input {
  913. flex: 1;
  914. height: 47px;
  915. line-height: 47px;
  916. padding: 0px 15px;
  917. box-sizing: border-box;
  918. border: 1px solid #E9DDCD;
  919. border-radius: 6px;
  920. font-size: 18px;
  921. }
  922. .other-input {
  923. width: 100%;
  924. margin-top: 20px;
  925. height: 47px;
  926. line-height: 47px;
  927. box-sizing: border-box;
  928. padding: 0 15px;
  929. border: 1px solid #E9DDCD;
  930. border-radius: 6px;
  931. font-size: 18px;
  932. }
  933. .text-input {
  934. color: #ccc;
  935. }
  936. .r-box {
  937. flex: 1;
  938. display: flex;
  939. align-items: center;
  940. // justify-content: space-between;
  941. }
  942. .option-text {
  943. font-size: 18px;
  944. color: #333;
  945. }
  946. .uni-label-pointer {
  947. display: flex;
  948. align-items: center;
  949. }
  950. /* 弹窗底部 */
  951. .popup-footer {
  952. display: flex;
  953. padding: 20upx 30upx;
  954. border-top: 1px solid #eee;
  955. }
  956. .btn2 {
  957. flex: 1;
  958. height: 53px;
  959. line-height: 53px;
  960. text-align: center;
  961. border-radius: 12px;
  962. font-size: 20px;
  963. margin: 0 10px;
  964. }
  965. .cancel-btn2 {
  966. background-color: #f5f5f5;
  967. color: #666;
  968. }
  969. .confirm-btn2 {
  970. background-color: #8F6726;
  971. color: #fff;
  972. }
  973. </style>