index.vue 24 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015
  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. uni.showToast({
  510. title: response.msg || '操作成功',
  511. icon: 'success',
  512. duration: 2000
  513. });
  514. // 延迟返回上一页
  515. setTimeout(() => {
  516. uni.navigateBack({
  517. fail: () => {
  518. // 如果返回失败,跳转到访客页面
  519. uni.switchTab({
  520. url: '/pages/tabbar/visitor'
  521. });
  522. }
  523. });
  524. }, 2000);
  525. } else {
  526. // 提交失败
  527. uni.showToast({
  528. title: response.msg || response.message || '提交失败,请重试',
  529. icon: 'none',
  530. duration: 2000
  531. });
  532. }
  533. } catch (error) {
  534. console.error('提交异常:', error);
  535. // 优先使用后端返回的错误信息
  536. const errorMsg = error.data?.msg || error.msg || error.message || '提交失败,请重试';
  537. uni.showToast({
  538. title: errorMsg,
  539. icon: 'none',
  540. duration: 2000
  541. });
  542. }
  543. },
  544. // 关闭成功弹框
  545. closeSuccessPopup() {
  546. this.$refs.successPopup.close();
  547. // 返回上一页
  548. uni.navigateBack();
  549. },
  550. // 显示二维码
  551. showQRCode() {
  552. this.$refs.successPopup.close();
  553. // this.$refs.qrcodePopup.open();
  554. },
  555. // 关闭二维码弹框
  556. closeQRCode() {
  557. this.$refs.qrcodePopup.close();
  558. // 返回上一页
  559. uni.navigateBack();
  560. },
  561. // 跳转到隐私政策
  562. goToPrivacy() {
  563. uni.navigateTo({
  564. url: '/pagesA/public/richtext'
  565. });
  566. },
  567. // 跳转到服务协议
  568. goToService() {
  569. uni.navigateTo({
  570. url: '/pagesA/public/richtext'
  571. });
  572. },
  573. // 预览二维码
  574. previewQRCode() {
  575. uni.previewImage({
  576. urls: ['/static/images/qrcode.png'],
  577. current: 0
  578. });
  579. },
  580. // 登录成功回调
  581. onLoginSuccess(userInfo) {
  582. console.log('登录成功,用户信息:', userInfo);
  583. // 更新当前页面的用户信息
  584. this.user = userInfo;
  585. },
  586. // 登录弹窗关闭回调
  587. onLoginClose() {
  588. console.log('用户关闭了登录弹窗');
  589. },
  590. }
  591. }
  592. </script>
  593. <style lang="scss" scoped>
  594. .container {
  595. background-color: #f5f5f5;
  596. min-height: 100vh;
  597. }
  598. .form-container {
  599. padding: 20rpx;
  600. }
  601. .section {
  602. background-color: #fff;
  603. border-radius: 12rpx;
  604. margin-bottom: 20rpx;
  605. padding: 30rpx;
  606. }
  607. .section-title {
  608. font-size: 32rpx;
  609. font-weight: 600;
  610. color: #333;
  611. margin-bottom: 30rpx;
  612. display: flex;
  613. align-items: center;
  614. }
  615. .title-icon {
  616. width: 40rpx;
  617. height: 40rpx;
  618. margin-right: 15rpx;
  619. }
  620. .form-item {
  621. display: flex;
  622. align-items: center;
  623. margin-bottom: 30rpx;
  624. position: relative;
  625. &:last-child {
  626. margin-bottom: 0;
  627. }
  628. }
  629. .label {
  630. width: 160rpx;
  631. font-size: 28rpx;
  632. color: #666;
  633. flex-shrink: 0;
  634. }
  635. .input {
  636. flex: 1;
  637. height: 70rpx;
  638. padding: 0 20rpx;
  639. background-color: #f8f8f8;
  640. border-radius: 8rpx;
  641. font-size: 28rpx;
  642. color: #333;
  643. }
  644. .input-wrapper {
  645. flex: 1;
  646. height: 70rpx;
  647. padding: 0 20rpx;
  648. background-color: #f8f8f8;
  649. border-radius: 8rpx;
  650. display: flex;
  651. align-items: center;
  652. justify-content: space-between;
  653. }
  654. .placeholder {
  655. color: #c0c4cc;
  656. font-size: 28rpx;
  657. }
  658. .select-wrapper {
  659. flex: 1;
  660. ::v-deep .uni-stat__select {
  661. width: 100%;
  662. }
  663. ::v-deep .uni-stat-box {
  664. width: 100%;
  665. }
  666. ::v-deep .uni-select {
  667. width: 100%;
  668. border: none;
  669. }
  670. ::v-deep .uni-select__input-box {
  671. height: 70rpx;
  672. padding: 0 20rpx;
  673. background-color: #f8f8f8;
  674. border-radius: 8rpx;
  675. border: none;
  676. }
  677. ::v-deep .uni-select__input-text {
  678. font-size: 28rpx;
  679. color: #333;
  680. }
  681. ::v-deep .uni-select__input-placeholder {
  682. color: #c0c4cc;
  683. }
  684. ::v-deep .uni-select__selector {
  685. max-height: 400rpx;
  686. }
  687. }
  688. .accompany-list {
  689. .accompany-item {
  690. position: relative;
  691. padding: 20rpx;
  692. background-color: #f8f8f8;
  693. border-radius: 8rpx;
  694. margin-bottom: 20rpx;
  695. &:last-child {
  696. margin-bottom: 0;
  697. }
  698. }
  699. }
  700. .delete-btn {
  701. position: absolute;
  702. top: 10rpx;
  703. right: 10rpx;
  704. width: 70rpx;
  705. height: 70rpx;
  706. display: flex;
  707. align-items: center;
  708. justify-content: center;
  709. background-color: #fff;
  710. border-radius: 50%;
  711. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  712. z-index: 10;
  713. cursor: pointer;
  714. &:active {
  715. opacity: 0.7;
  716. transform: scale(0.95);
  717. }
  718. }
  719. .add-accompany-btn {
  720. display: flex;
  721. align-items: center;
  722. justify-content: center;
  723. height: 80rpx;
  724. background-color: #f8f9fa;
  725. border: 2rpx dashed #c0c4cc;
  726. border-radius: 8rpx;
  727. color: #909399;
  728. font-size: 28rpx;
  729. text {
  730. margin-left: 10rpx;
  731. }
  732. }
  733. .vehicle-header {
  734. display: flex;
  735. align-items: center;
  736. margin-bottom: 30rpx;
  737. .section-title {
  738. flex: 1;
  739. margin-bottom: 0;
  740. margin-left: 15rpx;
  741. }
  742. }
  743. .vehicle-content {
  744. padding-top: 20rpx;
  745. border-top: 1rpx solid #eee;
  746. }
  747. .submit-container {
  748. padding: 20rpx;
  749. background-color: #fff;
  750. margin-top: 20rpx;
  751. }
  752. .submit-btn {
  753. width: 100%;
  754. height: 88rpx;
  755. background: linear-gradient(135deg, #ff6b35 0%, #ff9500 100%);
  756. border-radius: 44rpx;
  757. border: none;
  758. color: #fff;
  759. font-size: 32rpx;
  760. font-weight: 600;
  761. }
  762. .picker-container {
  763. background-color: #fff;
  764. border-radius: 20rpx 20rpx 0 0;
  765. }
  766. .picker-header {
  767. display: flex;
  768. align-items: center;
  769. justify-content: space-between;
  770. padding: 30rpx;
  771. border-bottom: 1rpx solid #eee;
  772. text {
  773. color: #007aff;
  774. font-size: 28rpx;
  775. }
  776. }
  777. .picker-title {
  778. font-size: 32rpx;
  779. font-weight: 600;
  780. color: #333 !important;
  781. }
  782. .picker-view {
  783. height: 400rpx;
  784. }
  785. .picker-item {
  786. display: flex;
  787. align-items: center;
  788. justify-content: center;
  789. height: 80rpx;
  790. font-size: 28rpx;
  791. color: #333;
  792. }
  793. // 提交成功弹框样式
  794. .success-popup {
  795. .popup-content {
  796. background-color: #fff;
  797. border-radius: 20rpx;
  798. padding: 60rpx 40rpx 40rpx;
  799. width: 560rpx;
  800. text-align: center;
  801. }
  802. .success-icon {
  803. margin-bottom: 30rpx;
  804. }
  805. .popup-title {
  806. font-size: 36rpx;
  807. font-weight: 600;
  808. color: #333;
  809. margin-bottom: 20rpx;
  810. }
  811. .popup-message {
  812. font-size: 28rpx;
  813. color: #666;
  814. line-height: 1.6;
  815. margin-bottom: 50rpx;
  816. }
  817. .popup-buttons {
  818. display: flex;
  819. gap: 20rpx;
  820. button {
  821. flex: 1;
  822. height: 80rpx;
  823. border-radius: 40rpx;
  824. font-size: 28rpx;
  825. border: none;
  826. }
  827. .cancel-btn {
  828. background-color: #f5f5f5;
  829. color: #666;
  830. }
  831. .follow-btn {
  832. background: linear-gradient(135deg, #ff6b35 0%, #ff9500 100%);
  833. color: #fff;
  834. }
  835. }
  836. }
  837. // 二维码弹框样式
  838. .qrcode-popup {
  839. .qrcode-content {
  840. background-color: #fff;
  841. border-radius: 20rpx;
  842. padding: 50rpx 40rpx;
  843. width: 560rpx;
  844. text-align: center;
  845. }
  846. .qrcode-title {
  847. font-size: 32rpx;
  848. font-weight: 600;
  849. color: #333;
  850. margin-bottom: 40rpx;
  851. }
  852. .qrcode-image {
  853. width: 400rpx;
  854. height: 400rpx;
  855. margin: 0 auto 30rpx;
  856. border: 1rpx solid #eee;
  857. border-radius: 12rpx;
  858. overflow: hidden;
  859. position: relative;
  860. image {
  861. width: 100%;
  862. height: 100%;
  863. }
  864. .preview-tip {
  865. position: absolute;
  866. left: 0;
  867. right: 0;
  868. bottom: 0;
  869. height: 60rpx;
  870. background: rgba(0, 0, 0, 0.5);
  871. display: flex;
  872. align-items: center;
  873. justify-content: center;
  874. color: #fff;
  875. font-size: 24rpx;
  876. text {
  877. margin-left: 10rpx;
  878. }
  879. }
  880. &:active {
  881. opacity: 0.8;
  882. }
  883. }
  884. .qrcode-tip {
  885. font-size: 26rpx;
  886. color: #999;
  887. margin-bottom: 40rpx;
  888. line-height: 1.5;
  889. }
  890. .qrcode-close-btn {
  891. width: 100%;
  892. height: 80rpx;
  893. background: linear-gradient(135deg, #ff6b35 0%, #ff9500 100%);
  894. border-radius: 40rpx;
  895. color: #fff;
  896. font-size: 28rpx;
  897. border: none;
  898. }
  899. }
  900. </style>