index.vue 24 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018
  1. <template>
  2. <!-- 访客申请 -->
  3. <view class="container">
  4. <!-- 导航栏 -->
  5. <custom-navbar title="访客申请" :showBack="true"></custom-navbar>
  6. <!-- 表单内容 -->
  7. <view class="form-container">
  8. <!-- 第一块:对接人信息 -->
  9. <view class="section">
  10. <view class="section-title">
  11. <image class="title-icon" src="/static/images/person.png" mode="aspectFit"></image>
  12. 对接人信息
  13. </view>
  14. <view class="mar-b-16">
  15. <text class="label">所属部门:</text>
  16. <view class="select-wrapper">
  17. <!-- 调试信息 -->
  18. <uni-data-select v-model="formData.departmentId" :localdata="departmentOptions"
  19. placeholder="请选择所属部门" @change="onDepartmentSelectChange" :clear="false">
  20. </uni-data-select>
  21. </view>
  22. </view>
  23. <view class="form-item1">
  24. <text class="label">员工姓名:</text>
  25. <view class="select-wrapper">
  26. <uni-data-select v-model="formData.employeeId" :localdata="employeeOptions" placeholder="请选择员工"
  27. @change="onEmployeeSelectChange" :clear="false">
  28. </uni-data-select>
  29. </view>
  30. </view>
  31. </view>
  32. <!-- 第二块:访问信息 -->
  33. <view class="section">
  34. <view class="section-title">
  35. <image class="title-icon" src="/static/images/calendar.png" mode="aspectFit"></image>
  36. 访问信息
  37. </view>
  38. <view class="form-item">
  39. <text class="label">访问事由</text>
  40. <input class="input" v-model="formData.visitReason" placeholder="请输入访问事由"
  41. placeholder-style="color: #c0c4cc" />
  42. </view>
  43. <view class="form-item">
  44. <text class="label">到访时间</text>
  45. <uni-datetime-picker type="datetime" v-model="formData.visitTime" @change="onVisitTimeChange"
  46. :clear-icon="false" placeholder="请选择到访时间" format="YYYY-MM-DD HH:mm" :hide-second="true">
  47. <view class="input-wrapper">
  48. <text class="placeholder" v-if="!formData.visitTime">请选择到访时间</text>
  49. <text v-else>{{ formData.visitTime }}</text>
  50. <uni-icons type="calendar" size="16" color="#c0c4cc"></uni-icons>
  51. </view>
  52. </uni-datetime-picker>
  53. </view>
  54. <view class="form-item">
  55. <text class="label">访客姓名</text>
  56. <input class="input" v-model="formData.visitorName" placeholder="请输入访客姓名"
  57. placeholder-style="color: #c0c4cc" />
  58. </view>
  59. <view class="form-item">
  60. <text class="label">访客单位</text>
  61. <input class="input" v-model="formData.visitorCompany" placeholder="请输入访客单位"
  62. placeholder-style="color: #c0c4cc" />
  63. </view>
  64. <view class="form-item">
  65. <text class="label">手机号</text>
  66. <input class="input" v-model="formData.visitorPhone" placeholder="请输入手机号"
  67. placeholder-style="color: #c0c4cc" type="number" />
  68. </view>
  69. </view>
  70. <!-- 第三块:随行人员 -->
  71. <view class="section">
  72. <view class="section-title">随行人员</view>
  73. <view class="accompany-list">
  74. <view class="accompany-item" v-for="(item, index) in formData.accompanyPersons" :key="index">
  75. <view class="form-item">
  76. <text class="label">随行人员</text>
  77. <input class="input" v-model="item.name" placeholder="请输入随行人员姓名"
  78. placeholder-style="color: #c0c4cc" />
  79. </view>
  80. <view class="form-item">
  81. <text class="label">手机号</text>
  82. <input class="input" v-model="item.phone" placeholder="请输入手机号"
  83. placeholder-style="color: #c0c4cc" type="number" />
  84. </view>
  85. <view class="delete-btn" v-if="formData.accompanyPersons.length > 1"
  86. @click.stop="removeAccompany(index)">
  87. <uni-icons type="trash" size="18" color="#ff4757"></uni-icons>
  88. </view>
  89. </view>
  90. </view>
  91. <view class="add-accompany-btn" @click="addAccompany">
  92. <uni-icons type="plus" size="16" color="#007aff"></uni-icons>
  93. <text>添加随行人员</text>
  94. </view>
  95. </view>
  96. <!-- 第四块:使用车辆 -->
  97. <view class="section">
  98. <view class="vehicle-header">
  99. <view class="section-title">
  100. <image class="title-icon" src="/static/images/cart.png" mode="aspectFit"></image>
  101. 使用车辆
  102. </view>
  103. <switch :checked="formData.useVehicle" @change="onVehicleChange" color="#007aff" />
  104. </view>
  105. <view v-if="formData.useVehicle" class="vehicle-content">
  106. <view class="form-item">
  107. <text class="label">接客时间</text>
  108. <uni-datetime-picker type="datetime" v-model="formData.pickupTime" @change="onPickupTimeChange"
  109. :clear-icon="false" placeholder="请选择接客时间" format="YYYY-MM-DD HH:mm" :hide-second="true">
  110. <view class="input-wrapper">
  111. <text class="placeholder" v-if="!formData.pickupTime">请选择接客时间</text>
  112. <text v-else>{{ formData.pickupTime }}</text>
  113. <uni-icons type="calendar" size="16" color="#c0c4cc"></uni-icons>
  114. </view>
  115. </uni-datetime-picker>
  116. </view>
  117. <view class="form-item">
  118. <text class="label">接客地点</text>
  119. <input class="input" v-model="formData.pickupLocation" placeholder="请输入接客地点"
  120. placeholder-style="color: #c0c4cc" />
  121. </view>
  122. </view>
  123. </view>
  124. </view>
  125. <!-- 提交按钮 -->
  126. <view class="submit-container">
  127. <button class="submit-btn" @click="submitForm">提交</button>
  128. </view>
  129. <!-- 提交成功弹框 -->
  130. <uni-popup ref="successPopup" type="center" :mask-click="false">
  131. <view class="success-popup">
  132. <view class="popup-content">
  133. <view class="success-icon">
  134. <uni-icons type="checkmarkempty" size="60" color="#52c41a"></uni-icons>
  135. </view>
  136. <view class="popup-title">申请提交成功</view>
  137. <view class="popup-message">您的申请已成功提交,请关注公众号即时查询审核结果</view>
  138. <view class="popup-buttons">
  139. <button class="cancel-btn" @click="closeSuccessPopup">取消</button>
  140. <button class="follow-btn" @click="showQRCode">关注</button>
  141. </view>
  142. </view>
  143. </view>
  144. </uni-popup>
  145. <!-- 授权登录组件 -->
  146. <auth-login-popup ref="authLoginPopup" @success="onLoginSuccess" @close="onLoginClose"></auth-login-popup>
  147. </view>
  148. </template>
  149. <script>
  150. import user from '../../store/modules/user';
  151. import {
  152. getDept,
  153. selectUser,
  154. addVisit
  155. } from '@/config/api.js';
  156. import AuthLoginPopup from '@/components/auth-login-popup/auth-login-popup.vue';
  157. export default {
  158. components: {
  159. AuthLoginPopup
  160. },
  161. data() {
  162. return {
  163. type: '', // 从上一页传递过来的参数
  164. tabbarHeight: 50, // tabbar高度,默认50px
  165. user: null, // 用户信息
  166. formData: {
  167. departmentId: '',
  168. department: '',
  169. employeeId: '',
  170. employeeName: '',
  171. visitReason: '',
  172. visitTime: '',
  173. visitorName: '',
  174. visitorCompany: '',
  175. visitorPhone: '',
  176. accompanyPersons: [{
  177. name: '',
  178. phone: ''
  179. }],
  180. useVehicle: false,
  181. pickupTime: '',
  182. pickupLocation: ''
  183. },
  184. // 部门数据
  185. departments: [],
  186. // 部门选项(格式化为uni-data-select所需格式)
  187. departmentOptions: [],
  188. // 员工选项
  189. employeeOptions: []
  190. }
  191. },
  192. onLoad(options) {
  193. console.log(uni.getStorageSync("user"), "usususuus")
  194. // 获取传递过来的参数
  195. if (options.type) {
  196. this.type = options.type;
  197. }
  198. // 获取用户信息
  199. this.user = uni.getStorageSync("user")
  200. this.getTabbarHeight()
  201. this.getDeptList()
  202. },
  203. onReady() {
  204. // 页面渲染完成后再次获取,确保准确
  205. this.getTabbarHeight()
  206. // 打开授权登录弹窗
  207. // this.$refs.authLoginPopup.open()
  208. },
  209. methods: {
  210. // 获取tabbar高度
  211. getTabbarHeight() {
  212. // 获取菜单按钮信息,用于计算真实的可用高度
  213. const systemInfo = uni.getSystemInfoSync()
  214. // 在微信小程序中,使用 windowHeight 和 screenHeight 的差值
  215. // windowHeight 是不包含 tabbar 的可用高度
  216. const windowHeight = systemInfo.windowHeight
  217. const screenHeight = systemInfo.screenHeight
  218. // 微信小程序 tabbar 高度通常是 50px,但在不同设备可能不同
  219. // 直接使用差值
  220. let tabbarHeight = screenHeight - windowHeight
  221. console.log('系统信息:', {
  222. screenHeight,
  223. windowHeight,
  224. 计算的tabbar高度: tabbarHeight,
  225. safeAreaBottom: systemInfo.safeAreaInsets?.bottom || systemInfo.safeArea?.bottom || 0
  226. })
  227. // 在小程序中通常是 50-80 之间
  228. // 如果是 H5,差值会包含地址栏等,会更大
  229. // #ifdef MP-WEIXIN
  230. if (tabbarHeight < 30 || tabbarHeight > 100) {
  231. tabbarHeight = 50 // 微信小程序默认 50px
  232. }
  233. // #endif
  234. // #ifdef H5
  235. tabbarHeight = 50 // H5 固定使用 50px
  236. // #endif
  237. this.tabbarHeight = tabbarHeight
  238. },
  239. async getDeptList() {
  240. console.log("获取DEPT")
  241. try {
  242. const res = await getDept({
  243. parentId: 100
  244. })
  245. console.log("部门API返回数据:", res)
  246. this.departments = res.data
  247. // 格式化部门数据为uni-data-select所需格式
  248. this.departmentOptions = res.data.map(item => ({
  249. value: item.dept_id,
  250. text: item.dept_name
  251. }))
  252. console.log("格式化后的部门选项:", this.departmentOptions)
  253. // 添加延时确保数据已经设置
  254. this.$nextTick(() => {
  255. console.log("nextTick后的部门选项:", this.departmentOptions)
  256. })
  257. } catch (error) {
  258. console.error("获取部门列表失败:", error)
  259. uni.showToast({
  260. title: '获取部门列表失败',
  261. icon: 'none'
  262. })
  263. }
  264. },
  265. // 部门选择改变
  266. async onDepartmentSelectChange(value) {
  267. console.log("选择的部门ID:", value)
  268. this.formData.departmentId = value
  269. // 找到选中的部门信息
  270. const selectedDept = this.departments.find(dept => dept.dept_id === value)
  271. if (selectedDept) {
  272. this.formData.department = selectedDept.dept_name
  273. // 根据部门ID获取员工列表
  274. try {
  275. const userRes = await selectUser({
  276. deptId: value
  277. })
  278. console.log("员工列表:", userRes)
  279. // 格式化员工数据为uni-data-select所需格式
  280. if (userRes && userRes.rows) {
  281. this.employeeOptions = userRes.rows.map(item => ({
  282. value: item.user_id,
  283. text: item.nick_name
  284. }))
  285. console.log("格式化后的员工选项:", this.employeeOptions)
  286. } else if (userRes && userRes.data && userRes.data.rows) {
  287. // 备用路径,以防数据结构不同
  288. this.employeeOptions = userRes.data.rows.map(item => ({
  289. value: item.user_id,
  290. text: item.nick_name
  291. }))
  292. console.log("格式化后的员工选项(备用路径):", this.employeeOptions)
  293. }
  294. // 清空之前选择的员工
  295. this.formData.employeeId = ''
  296. this.formData.employeeName = ''
  297. } catch (error) {
  298. console.error("获取员工列表失败:", error)
  299. uni.showToast({
  300. title: '获取员工列表失败',
  301. icon: 'none'
  302. })
  303. }
  304. }
  305. },
  306. // 员工选择改变
  307. onEmployeeSelectChange(value) {
  308. console.log("选择的员工ID:", value)
  309. this.formData.employeeId = value
  310. // 根据employeeOptions找到对应的员工名称
  311. const selectedEmployee = this.employeeOptions.find(emp => emp.value === value)
  312. if (selectedEmployee) {
  313. this.formData.employeeName = selectedEmployee.text
  314. console.log("选择的员工名称:", selectedEmployee.text)
  315. }
  316. },
  317. // 到访时间改变
  318. onVisitTimeChange(e) {
  319. this.formData.visitTime = e;
  320. },
  321. // 接客时间改变
  322. onPickupTimeChange(e) {
  323. this.formData.pickupTime = e;
  324. },
  325. // 获取当前日期时间
  326. getCurrentDatetime() {
  327. const now = new Date();
  328. const year = now.getFullYear();
  329. const month = String(now.getMonth() + 1).padStart(2, '0');
  330. const day = String(now.getDate()).padStart(2, '0');
  331. const hour = String(now.getHours()).padStart(2, '0');
  332. const minute = String(now.getMinutes()).padStart(2, '0');
  333. return `${year}-${month}-${day} ${hour}:${minute}`;
  334. },
  335. // 添加随行人员
  336. addAccompany() {
  337. this.formData.accompanyPersons.push({
  338. name: '',
  339. phone: ''
  340. });
  341. },
  342. // 删除随行人员
  343. removeAccompany(index) {
  344. console.log('删除随行人员,索引:', index, '当前数量:', this.formData.accompanyPersons.length);
  345. if (this.formData.accompanyPersons.length > 1) {
  346. uni.showModal({
  347. title: '确认删除',
  348. content: '确定要删除这个随行人员吗?',
  349. success: (res) => {
  350. if (res.confirm) {
  351. this.formData.accompanyPersons.splice(index, 1);
  352. console.log('删除成功,剩余数量:', this.formData.accompanyPersons.length);
  353. }
  354. }
  355. });
  356. } else {
  357. uni.showToast({
  358. title: '至少保留一个随行人员',
  359. icon: 'none'
  360. });
  361. }
  362. },
  363. // 车辆开关改变
  364. onVehicleChange(e) {
  365. this.formData.useVehicle = e.detail.value;
  366. if (!this.formData.useVehicle) {
  367. // 关闭车辆使用时清空相关信息
  368. this.formData.pickupTime = '';
  369. this.formData.pickupLocation = '';
  370. }
  371. },
  372. // 手机号格式校验
  373. validatePhone(phone) {
  374. const phoneRegex = /^1[3-9]\d{9}$/;
  375. return phoneRegex.test(phone);
  376. },
  377. // 表单验证
  378. validateForm() {
  379. if (!this.formData.department) {
  380. uni.showToast({
  381. title: '请选择所属部门',
  382. icon: 'none'
  383. });
  384. return false;
  385. }
  386. if (!this.formData.employeeName) {
  387. uni.showToast({
  388. title: '请输入员工姓名',
  389. icon: 'none'
  390. });
  391. return false;
  392. }
  393. if (!this.formData.visitReason) {
  394. uni.showToast({
  395. title: '请输入访问事由',
  396. icon: 'none'
  397. });
  398. return false;
  399. }
  400. if (!this.formData.visitTime) {
  401. uni.showToast({
  402. title: '请选择到访时间',
  403. icon: 'none'
  404. });
  405. return false;
  406. }
  407. if (!this.formData.visitorName) {
  408. uni.showToast({
  409. title: '请输入访客姓名',
  410. icon: 'none'
  411. });
  412. return false;
  413. }
  414. // if (!this.formData.visitorCompany) {
  415. // uni.showToast({
  416. // title: '请输入访客单位',
  417. // icon: 'none'
  418. // });
  419. // return false;
  420. // }
  421. if (!this.formData.visitorPhone) {
  422. uni.showToast({
  423. title: '请输入手机号',
  424. icon: 'none'
  425. });
  426. return false;
  427. }
  428. // 校验访客手机号格式
  429. if (!this.validatePhone(this.formData.visitorPhone)) {
  430. uni.showToast({
  431. title: '请输入正确的手机号格式',
  432. icon: 'none'
  433. });
  434. return false;
  435. }
  436. // 验证随行人员信息
  437. for (let i = 0; i < this.formData.accompanyPersons.length; i++) {
  438. const person = this.formData.accompanyPersons[i];
  439. if (person.name && !person.phone) {
  440. uni.showToast({
  441. title: `请输入第${i + 1}个随行人员的手机号`,
  442. icon: 'none'
  443. });
  444. return false;
  445. }
  446. if (!person.name && person.phone) {
  447. uni.showToast({
  448. title: `请输入第${i + 1}个随行人员的姓名`,
  449. icon: 'none'
  450. });
  451. return false;
  452. }
  453. // 校验随行人员手机号格式
  454. if (person.phone && !this.validatePhone(person.phone)) {
  455. uni.showToast({
  456. title: `第${i + 1}个随行人员手机号格式不正确`,
  457. icon: 'none'
  458. });
  459. return false;
  460. }
  461. }
  462. // 验证车辆使用信息
  463. if (this.formData.useVehicle) {
  464. if (!this.formData.pickupTime) {
  465. uni.showToast({
  466. title: '请选择接客时间',
  467. icon: 'none'
  468. });
  469. return false;
  470. }
  471. if (!this.formData.pickupLocation) {
  472. uni.showToast({
  473. title: '请选择接客地点',
  474. icon: 'none'
  475. });
  476. return false;
  477. }
  478. }
  479. return true;
  480. },
  481. // 提交表单
  482. async submitForm() {
  483. if (!this.validateForm()) {
  484. return;
  485. }
  486. // 过滤空的随行人员
  487. const validAccompanyPersons = this.formData.accompanyPersons.filter(person =>
  488. person.name && person.phone
  489. );
  490. // 构建提交数据
  491. const submitData = {
  492. visitDate: this.formData.visitTime, // 访问时间
  493. userId: this.formData.employeeId, // 员工id(从选择的员工中获取user_id)
  494. empName: this.formData.employeeName, // 访问部门人(员工姓名)
  495. visDept: this.formData.visitorCompany, // 访客单位
  496. visitPerson: this.formData.visitorName, // 访客姓名
  497. visitorTel: this.formData.visitorPhone, // 访客手机
  498. visitorNum: (validAccompanyPersons.length + 1).toString(), // 访问人数(访客+随行人员)
  499. visitReson: this.formData.visitReason, // 访问事由
  500. accPerson: JSON.stringify(validAccompanyPersons) // 随行人员转为JSON字符串
  501. };
  502. console.log('提交数据:', submitData);
  503. try {
  504. // 调用后端接口提交数据
  505. const response = await addVisit(submitData);
  506. console.log('提交响应:', response);
  507. // 检查返回结果(支持 code === 200 或 code === "200")
  508. if (response && (response.code === 200 || response.code === "200")) {
  509. this.$refs.authLoginPopup.open()
  510. uni.showToast({
  511. title: response.msg || '操作成功',
  512. icon: 'success',
  513. duration: 2000
  514. });
  515. this.$refs.successPopup.open();
  516. // 延迟返回上一页
  517. // setTimeout(() => {
  518. // uni.navigateBack({
  519. // fail: () => {
  520. // // 如果返回失败,跳转到访客页面
  521. // uni.switchTab({
  522. // url: '/pages/tabbar/visitor'
  523. // });
  524. // }
  525. // });
  526. // }, 2000);
  527. } else {
  528. // 提交失败
  529. uni.showToast({
  530. title: response.msg || response.message || '提交失败,请重试',
  531. icon: 'none',
  532. duration: 2000
  533. });
  534. }
  535. } catch (error) {
  536. console.error('提交异常:', error);
  537. // 优先使用后端返回的错误信息
  538. const errorMsg = error.data?.msg || error.msg || error.message || '提交失败,请重试';
  539. uni.showToast({
  540. title: errorMsg,
  541. icon: 'none',
  542. duration: 2000
  543. });
  544. }
  545. },
  546. // 关闭成功弹框
  547. closeSuccessPopup() {
  548. this.$refs.successPopup.close();
  549. // 返回上一页
  550. uni.navigateBack();
  551. },
  552. // 显示二维码
  553. showQRCode() {
  554. this.$refs.successPopup.close();
  555. // this.$refs.qrcodePopup.open();
  556. },
  557. // 关闭二维码弹框
  558. closeQRCode() {
  559. this.$refs.qrcodePopup.close();
  560. // 返回上一页
  561. uni.navigateBack();
  562. },
  563. // 跳转到隐私政策
  564. goToPrivacy() {
  565. uni.navigateTo({
  566. url: '/pagesA/public/richtext'
  567. });
  568. },
  569. // 跳转到服务协议
  570. goToService() {
  571. uni.navigateTo({
  572. url: '/pagesA/public/richtext'
  573. });
  574. },
  575. // 预览二维码
  576. previewQRCode() {
  577. uni.previewImage({
  578. urls: ['/static/images/qrcode.png'],
  579. current: 0
  580. });
  581. },
  582. // 登录成功回调
  583. onLoginSuccess(userInfo) {
  584. console.log('登录成功,用户信息:', userInfo);
  585. // 更新当前页面的用户信息
  586. this.user = userInfo;
  587. },
  588. // 登录弹窗关闭回调
  589. onLoginClose() {
  590. console.log('用户关闭了登录弹窗');
  591. },
  592. }
  593. }
  594. </script>
  595. <style lang="scss" scoped>
  596. .container {
  597. background-color: #f5f5f5;
  598. min-height: 100vh;
  599. }
  600. .form-container {
  601. padding: 20rpx;
  602. }
  603. .section {
  604. background-color: #fff;
  605. border-radius: 12rpx;
  606. margin-bottom: 20rpx;
  607. padding: 30rpx;
  608. }
  609. .section-title {
  610. font-size: 32rpx;
  611. font-weight: 600;
  612. color: #333;
  613. margin-bottom: 30rpx;
  614. display: flex;
  615. align-items: center;
  616. }
  617. .title-icon {
  618. width: 40rpx;
  619. height: 40rpx;
  620. margin-right: 15rpx;
  621. }
  622. .form-item {
  623. display: flex;
  624. align-items: center;
  625. margin-bottom: 30rpx;
  626. position: relative;
  627. &:last-child {
  628. margin-bottom: 0;
  629. }
  630. }
  631. .label {
  632. width: 160rpx;
  633. font-size: 28rpx;
  634. color: #666;
  635. flex-shrink: 0;
  636. }
  637. .input {
  638. flex: 1;
  639. height: 70rpx;
  640. padding: 0 20rpx;
  641. background-color: #f8f8f8;
  642. border-radius: 8rpx;
  643. font-size: 28rpx;
  644. color: #333;
  645. }
  646. .input-wrapper {
  647. flex: 1;
  648. height: 70rpx;
  649. padding: 0 20rpx;
  650. background-color: #f8f8f8;
  651. border-radius: 8rpx;
  652. display: flex;
  653. align-items: center;
  654. justify-content: space-between;
  655. }
  656. .placeholder {
  657. color: #c0c4cc;
  658. font-size: 28rpx;
  659. }
  660. .select-wrapper {
  661. flex: 1;
  662. ::v-deep .uni-stat__select {
  663. width: 100%;
  664. }
  665. ::v-deep .uni-stat-box {
  666. width: 100%;
  667. }
  668. ::v-deep .uni-select {
  669. width: 100%;
  670. border: none;
  671. }
  672. ::v-deep .uni-select__input-box {
  673. height: 70rpx;
  674. padding: 0 20rpx;
  675. background-color: #f8f8f8;
  676. border-radius: 8rpx;
  677. border: none;
  678. }
  679. ::v-deep .uni-select__input-text {
  680. font-size: 28rpx;
  681. color: #333;
  682. }
  683. ::v-deep .uni-select__input-placeholder {
  684. color: #c0c4cc;
  685. }
  686. ::v-deep .uni-select__selector {
  687. max-height: 400rpx;
  688. }
  689. }
  690. .accompany-list {
  691. .accompany-item {
  692. position: relative;
  693. padding: 20rpx;
  694. background-color: #f8f8f8;
  695. border-radius: 8rpx;
  696. margin-bottom: 20rpx;
  697. &:last-child {
  698. margin-bottom: 0;
  699. }
  700. }
  701. }
  702. .delete-btn {
  703. position: absolute;
  704. top: 10rpx;
  705. right: 10rpx;
  706. width: 70rpx;
  707. height: 70rpx;
  708. display: flex;
  709. align-items: center;
  710. justify-content: center;
  711. background-color: #fff;
  712. border-radius: 50%;
  713. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  714. z-index: 10;
  715. cursor: pointer;
  716. &:active {
  717. opacity: 0.7;
  718. transform: scale(0.95);
  719. }
  720. }
  721. .add-accompany-btn {
  722. display: flex;
  723. align-items: center;
  724. justify-content: center;
  725. height: 80rpx;
  726. background-color: #f8f9fa;
  727. border: 2rpx dashed #c0c4cc;
  728. border-radius: 8rpx;
  729. color: #909399;
  730. font-size: 28rpx;
  731. text {
  732. margin-left: 10rpx;
  733. }
  734. }
  735. .vehicle-header {
  736. display: flex;
  737. align-items: center;
  738. margin-bottom: 30rpx;
  739. .section-title {
  740. flex: 1;
  741. margin-bottom: 0;
  742. margin-left: 15rpx;
  743. }
  744. }
  745. .vehicle-content {
  746. padding-top: 20rpx;
  747. border-top: 1rpx solid #eee;
  748. }
  749. .submit-container {
  750. padding: 20rpx;
  751. background-color: #fff;
  752. margin-top: 20rpx;
  753. }
  754. .submit-btn {
  755. width: 100%;
  756. height: 88rpx;
  757. background: linear-gradient(135deg, #ff6b35 0%, #ff9500 100%);
  758. border-radius: 44rpx;
  759. border: none;
  760. color: #fff;
  761. font-size: 32rpx;
  762. font-weight: 600;
  763. }
  764. .picker-container {
  765. background-color: #fff;
  766. border-radius: 20rpx 20rpx 0 0;
  767. }
  768. .picker-header {
  769. display: flex;
  770. align-items: center;
  771. justify-content: space-between;
  772. padding: 30rpx;
  773. border-bottom: 1rpx solid #eee;
  774. text {
  775. color: #007aff;
  776. font-size: 28rpx;
  777. }
  778. }
  779. .picker-title {
  780. font-size: 32rpx;
  781. font-weight: 600;
  782. color: #333 !important;
  783. }
  784. .picker-view {
  785. height: 400rpx;
  786. }
  787. .picker-item {
  788. display: flex;
  789. align-items: center;
  790. justify-content: center;
  791. height: 80rpx;
  792. font-size: 28rpx;
  793. color: #333;
  794. }
  795. // 提交成功弹框样式
  796. .success-popup {
  797. .popup-content {
  798. background-color: #fff;
  799. border-radius: 20rpx;
  800. padding: 60rpx 40rpx 40rpx;
  801. width: 560rpx;
  802. text-align: center;
  803. }
  804. .success-icon {
  805. margin-bottom: 30rpx;
  806. }
  807. .popup-title {
  808. font-size: 36rpx;
  809. font-weight: 600;
  810. color: #333;
  811. margin-bottom: 20rpx;
  812. }
  813. .popup-message {
  814. font-size: 28rpx;
  815. color: #666;
  816. line-height: 1.6;
  817. margin-bottom: 50rpx;
  818. }
  819. .popup-buttons {
  820. display: flex;
  821. gap: 20rpx;
  822. button {
  823. flex: 1;
  824. height: 80rpx;
  825. border-radius: 40rpx;
  826. font-size: 28rpx;
  827. border: none;
  828. }
  829. .cancel-btn {
  830. background-color: #f5f5f5;
  831. color: #666;
  832. }
  833. .follow-btn {
  834. background: linear-gradient(135deg, #ff6b35 0%, #ff9500 100%);
  835. color: #fff;
  836. }
  837. }
  838. }
  839. // 二维码弹框样式
  840. .qrcode-popup {
  841. .qrcode-content {
  842. background-color: #fff;
  843. border-radius: 20rpx;
  844. padding: 50rpx 40rpx;
  845. width: 560rpx;
  846. text-align: center;
  847. }
  848. .qrcode-title {
  849. font-size: 32rpx;
  850. font-weight: 600;
  851. color: #333;
  852. margin-bottom: 40rpx;
  853. }
  854. .qrcode-image {
  855. width: 400rpx;
  856. height: 400rpx;
  857. margin: 0 auto 30rpx;
  858. border: 1rpx solid #eee;
  859. border-radius: 12rpx;
  860. overflow: hidden;
  861. position: relative;
  862. image {
  863. width: 100%;
  864. height: 100%;
  865. }
  866. .preview-tip {
  867. position: absolute;
  868. left: 0;
  869. right: 0;
  870. bottom: 0;
  871. height: 60rpx;
  872. background: rgba(0, 0, 0, 0.5);
  873. display: flex;
  874. align-items: center;
  875. justify-content: center;
  876. color: #fff;
  877. font-size: 24rpx;
  878. text {
  879. margin-left: 10rpx;
  880. }
  881. }
  882. &:active {
  883. opacity: 0.8;
  884. }
  885. }
  886. .qrcode-tip {
  887. font-size: 26rpx;
  888. color: #999;
  889. margin-bottom: 40rpx;
  890. line-height: 1.5;
  891. }
  892. .qrcode-close-btn {
  893. width: 100%;
  894. height: 80rpx;
  895. background: linear-gradient(135deg, #ff6b35 0%, #ff9500 100%);
  896. border-radius: 40rpx;
  897. color: #fff;
  898. font-size: 28rpx;
  899. border: none;
  900. }
  901. }
  902. </style>