index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945
  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="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. <uni-popup ref="qrcodePopup" type="center" :mask-click="false">
  147. <view class="qrcode-popup">
  148. <view class="qrcode-content">
  149. <view class="qrcode-title">扫描二维码关注公众号</view>
  150. <view class="qrcode-image" @click="previewQRCode">
  151. <image src="/static/images/qrcode.png" mode="aspectFit"></image>
  152. <view class="preview-tip">
  153. <uni-icons type="search" size="16" color="#fff"></uni-icons>
  154. <text>点击查看大图</text>
  155. </view>
  156. </view>
  157. <view class="qrcode-tip">扫描上方二维码,关注公众号获取审核结果</view>
  158. <button class="qrcode-close-btn" @click="closeQRCode">我知道了</button>
  159. </view>
  160. </view>
  161. </uni-popup>
  162. </view>
  163. </template>
  164. <script>
  165. import user from '../../store/modules/user';
  166. import {
  167. getDept,
  168. selectUser,
  169. addVisit
  170. } from '@/config/api.js';
  171. export default {
  172. data() {
  173. return {
  174. type: '', // 从上一页传递过来的参数
  175. tabbarHeight: 50, // tabbar高度,默认50px
  176. user: null, // 用户信息
  177. formData: {
  178. departmentId: '',
  179. department: '',
  180. employeeId: '',
  181. employeeName: '',
  182. visitReason: '',
  183. visitTime: '',
  184. visitorName: '',
  185. visitorCompany: '',
  186. visitorPhone: '',
  187. accompanyPersons: [{
  188. name: '',
  189. phone: ''
  190. }],
  191. useVehicle: false,
  192. pickupTime: '',
  193. pickupLocation: ''
  194. },
  195. // 部门数据
  196. departments: [],
  197. // 部门选项(格式化为uni-data-select所需格式)
  198. departmentOptions: [],
  199. // 员工选项
  200. employeeOptions: [],
  201. }
  202. },
  203. onLoad(options) {
  204. console.log(uni.getStorageSync("user"), "usususuus")
  205. // 获取传递过来的参数
  206. if (options.type) {
  207. this.type = options.type;
  208. }
  209. // 获取用户信息
  210. this.user = uni.getStorageSync("user")
  211. this.getTabbarHeight()
  212. this.getDeptList()
  213. },
  214. onReady() {
  215. // 页面渲染完成后再次获取,确保准确
  216. this.getTabbarHeight()
  217. },
  218. methods: {
  219. // 获取tabbar高度
  220. getTabbarHeight() {
  221. // 获取菜单按钮信息,用于计算真实的可用高度
  222. const systemInfo = uni.getSystemInfoSync()
  223. // 在微信小程序中,使用 windowHeight 和 screenHeight 的差值
  224. // windowHeight 是不包含 tabbar 的可用高度
  225. const windowHeight = systemInfo.windowHeight
  226. const screenHeight = systemInfo.screenHeight
  227. // 微信小程序 tabbar 高度通常是 50px,但在不同设备可能不同
  228. // 直接使用差值
  229. let tabbarHeight = screenHeight - windowHeight
  230. console.log('系统信息:', {
  231. screenHeight,
  232. windowHeight,
  233. 计算的tabbar高度: tabbarHeight,
  234. safeAreaBottom: systemInfo.safeAreaInsets?.bottom || systemInfo.safeArea?.bottom || 0
  235. })
  236. // 在小程序中通常是 50-80 之间
  237. // 如果是 H5,差值会包含地址栏等,会更大
  238. // #ifdef MP-WEIXIN
  239. if (tabbarHeight < 30 || tabbarHeight > 100) {
  240. tabbarHeight = 50 // 微信小程序默认 50px
  241. }
  242. // #endif
  243. // #ifdef H5
  244. tabbarHeight = 50 // H5 固定使用 50px
  245. // #endif
  246. this.tabbarHeight = tabbarHeight
  247. },
  248. async getDeptList() {
  249. console.log("获取DEPT")
  250. try {
  251. const res = await getDept({
  252. parentId: 100
  253. })
  254. console.log("部门API返回数据:", res)
  255. this.departments = res.data
  256. // 格式化部门数据为uni-data-select所需格式
  257. this.departmentOptions = res.data.map(item => ({
  258. value: item.dept_id,
  259. text: item.dept_name
  260. }))
  261. console.log("格式化后的部门选项:", this.departmentOptions)
  262. // 添加延时确保数据已经设置
  263. this.$nextTick(() => {
  264. console.log("nextTick后的部门选项:", this.departmentOptions)
  265. })
  266. } catch (error) {
  267. console.error("获取部门列表失败:", error)
  268. uni.showToast({
  269. title: '获取部门列表失败',
  270. icon: 'none'
  271. })
  272. }
  273. },
  274. // 部门选择改变
  275. async onDepartmentSelectChange(value) {
  276. console.log("选择的部门ID:", value)
  277. this.formData.departmentId = value
  278. // 找到选中的部门信息
  279. const selectedDept = this.departments.find(dept => dept.dept_id === value)
  280. if (selectedDept) {
  281. this.formData.department = selectedDept.dept_name
  282. // 根据部门ID获取员工列表
  283. try {
  284. const userRes = await selectUser({
  285. deptId: value
  286. })
  287. console.log("员工列表:", userRes)
  288. // 格式化员工数据为uni-data-select所需格式
  289. if (userRes && userRes.rows) {
  290. this.employeeOptions = userRes.rows.map(item => ({
  291. value: item.user_id,
  292. text: item.nick_name
  293. }))
  294. console.log("格式化后的员工选项:", this.employeeOptions)
  295. } else if (userRes && userRes.data && userRes.data.rows) {
  296. // 备用路径,以防数据结构不同
  297. this.employeeOptions = userRes.data.rows.map(item => ({
  298. value: item.user_id,
  299. text: item.nick_name
  300. }))
  301. console.log("格式化后的员工选项(备用路径):", this.employeeOptions)
  302. }
  303. // 清空之前选择的员工
  304. this.formData.employeeId = ''
  305. this.formData.employeeName = ''
  306. } catch (error) {
  307. console.error("获取员工列表失败:", error)
  308. uni.showToast({
  309. title: '获取员工列表失败',
  310. icon: 'none'
  311. })
  312. }
  313. }
  314. },
  315. // 员工选择改变
  316. onEmployeeSelectChange(value) {
  317. console.log("选择的员工ID:", value)
  318. this.formData.employeeId = value
  319. // 根据employeeOptions找到对应的员工名称
  320. const selectedEmployee = this.employeeOptions.find(emp => emp.value === value)
  321. if (selectedEmployee) {
  322. this.formData.employeeName = selectedEmployee.text
  323. console.log("选择的员工名称:", selectedEmployee.text)
  324. }
  325. },
  326. // 到访时间改变
  327. onVisitTimeChange(e) {
  328. this.formData.visitTime = e;
  329. },
  330. // 接客时间改变
  331. onPickupTimeChange(e) {
  332. this.formData.pickupTime = e;
  333. },
  334. // 获取当前日期时间
  335. getCurrentDatetime() {
  336. const now = new Date();
  337. const year = now.getFullYear();
  338. const month = String(now.getMonth() + 1).padStart(2, '0');
  339. const day = String(now.getDate()).padStart(2, '0');
  340. const hour = String(now.getHours()).padStart(2, '0');
  341. const minute = String(now.getMinutes()).padStart(2, '0');
  342. return `${year}-${month}-${day} ${hour}:${minute}`;
  343. },
  344. // 添加随行人员
  345. addAccompany() {
  346. this.formData.accompanyPersons.push({
  347. name: '',
  348. phone: ''
  349. });
  350. },
  351. // 删除随行人员
  352. removeAccompany(index) {
  353. if (this.formData.accompanyPersons.length > 1) {
  354. this.formData.accompanyPersons.splice(index, 1);
  355. }
  356. },
  357. // 车辆开关改变
  358. onVehicleChange(e) {
  359. this.formData.useVehicle = e.detail.value;
  360. if (!this.formData.useVehicle) {
  361. // 关闭车辆使用时清空相关信息
  362. this.formData.pickupTime = '';
  363. this.formData.pickupLocation = '';
  364. }
  365. },
  366. // 手机号格式校验
  367. validatePhone(phone) {
  368. const phoneRegex = /^1[3-9]\d{9}$/;
  369. return phoneRegex.test(phone);
  370. },
  371. // 表单验证
  372. validateForm() {
  373. if (!this.formData.department) {
  374. uni.showToast({
  375. title: '请选择所属部门',
  376. icon: 'none'
  377. });
  378. return false;
  379. }
  380. if (!this.formData.employeeName) {
  381. uni.showToast({
  382. title: '请输入员工姓名',
  383. icon: 'none'
  384. });
  385. return false;
  386. }
  387. if (!this.formData.visitReason) {
  388. uni.showToast({
  389. title: '请输入访问事由',
  390. icon: 'none'
  391. });
  392. return false;
  393. }
  394. if (!this.formData.visitTime) {
  395. uni.showToast({
  396. title: '请选择到访时间',
  397. icon: 'none'
  398. });
  399. return false;
  400. }
  401. if (!this.formData.visitorName) {
  402. uni.showToast({
  403. title: '请输入访客姓名',
  404. icon: 'none'
  405. });
  406. return false;
  407. }
  408. if (!this.formData.visitorCompany) {
  409. uni.showToast({
  410. title: '请输入访客单位',
  411. icon: 'none'
  412. });
  413. return false;
  414. }
  415. if (!this.formData.visitorPhone) {
  416. uni.showToast({
  417. title: '请输入手机号',
  418. icon: 'none'
  419. });
  420. return false;
  421. }
  422. // 校验访客手机号格式
  423. if (!this.validatePhone(this.formData.visitorPhone)) {
  424. uni.showToast({
  425. title: '请输入正确的手机号格式',
  426. icon: 'none'
  427. });
  428. return false;
  429. }
  430. // 验证随行人员信息
  431. for (let i = 0; i < this.formData.accompanyPersons.length; i++) {
  432. const person = this.formData.accompanyPersons[i];
  433. if (person.name && !person.phone) {
  434. uni.showToast({
  435. title: `请输入第${i + 1}个随行人员的手机号`,
  436. icon: 'none'
  437. });
  438. return false;
  439. }
  440. if (!person.name && person.phone) {
  441. uni.showToast({
  442. title: `请输入第${i + 1}个随行人员的姓名`,
  443. icon: 'none'
  444. });
  445. return false;
  446. }
  447. // 校验随行人员手机号格式
  448. if (person.phone && !this.validatePhone(person.phone)) {
  449. uni.showToast({
  450. title: `第${i + 1}个随行人员手机号格式不正确`,
  451. icon: 'none'
  452. });
  453. return false;
  454. }
  455. }
  456. // 验证车辆使用信息
  457. if (this.formData.useVehicle) {
  458. if (!this.formData.pickupTime) {
  459. uni.showToast({
  460. title: '请选择接客时间',
  461. icon: 'none'
  462. });
  463. return false;
  464. }
  465. if (!this.formData.pickupLocation) {
  466. uni.showToast({
  467. title: '请选择接客地点',
  468. icon: 'none'
  469. });
  470. return false;
  471. }
  472. }
  473. return true;
  474. },
  475. // 提交表单
  476. async submitForm() {
  477. if (!this.validateForm()) {
  478. return;
  479. }
  480. // 过滤空的随行人员
  481. const validAccompanyPersons = this.formData.accompanyPersons.filter(person =>
  482. person.name && person.phone
  483. );
  484. // 构建提交数据
  485. const submitData = {
  486. visitDate: this.formData.visitTime, // 访问时间
  487. // userId: this.user?.id || '', // 员工id
  488. empName: this.formData.employeeName, // 访问部门人(员工姓名)
  489. visDept: this.formData.visitorCompany, // 访客单位
  490. visitPerson: this.formData.visitorName, // 访客姓名
  491. visitorTel: this.formData.visitorPhone, // 访客手机
  492. visitorNum: (validAccompanyPersons.length + 1).toString(), // 访问人数(访客+随行人员)
  493. visitReson: this.formData.visitReason, // 访问事由
  494. accPerson: JSON.stringify(validAccompanyPersons) // 随行人员转为JSON字符串
  495. };
  496. console.log('提交数据:', submitData);
  497. try {
  498. // 调用后端接口提交数据
  499. const response = await addVisit(submitData);
  500. console.log('提交成功:', response);
  501. // 显示提交成功弹框
  502. this.$refs.successPopup.open();
  503. } catch (error) {
  504. console.error('提交失败:', error);
  505. uni.showToast({
  506. title: '提交失败,请重试',
  507. icon: 'none'
  508. });
  509. }
  510. },
  511. // 关闭成功弹框
  512. closeSuccessPopup() {
  513. this.$refs.successPopup.close();
  514. // 返回上一页
  515. uni.navigateBack();
  516. },
  517. // 显示二维码
  518. showQRCode() {
  519. this.$refs.successPopup.close();
  520. this.$refs.qrcodePopup.open();
  521. },
  522. // 关闭二维码弹框
  523. closeQRCode() {
  524. this.$refs.qrcodePopup.close();
  525. // 返回上一页
  526. uni.navigateBack();
  527. },
  528. // 预览二维码
  529. previewQRCode() {
  530. uni.previewImage({
  531. urls: ['/static/images/qrcode.png'],
  532. current: 0
  533. });
  534. },
  535. }
  536. }
  537. </script>
  538. <style lang="scss" scoped>
  539. .container {
  540. background-color: #f5f5f5;
  541. min-height: 100vh;
  542. }
  543. .form-container {
  544. padding: 20rpx;
  545. }
  546. .section {
  547. background-color: #fff;
  548. border-radius: 12rpx;
  549. margin-bottom: 20rpx;
  550. padding: 30rpx;
  551. }
  552. .section-title {
  553. font-size: 32rpx;
  554. font-weight: 600;
  555. color: #333;
  556. margin-bottom: 30rpx;
  557. display: flex;
  558. align-items: center;
  559. }
  560. .title-icon {
  561. width: 40rpx;
  562. height: 40rpx;
  563. margin-right: 15rpx;
  564. }
  565. .form-item {
  566. display: flex;
  567. align-items: center;
  568. margin-bottom: 30rpx;
  569. position: relative;
  570. &:last-child {
  571. margin-bottom: 0;
  572. }
  573. }
  574. .label {
  575. width: 160rpx;
  576. font-size: 28rpx;
  577. color: #666;
  578. flex-shrink: 0;
  579. }
  580. .input {
  581. flex: 1;
  582. height: 70rpx;
  583. padding: 0 20rpx;
  584. background-color: #f8f8f8;
  585. border-radius: 8rpx;
  586. font-size: 28rpx;
  587. color: #333;
  588. }
  589. .input-wrapper {
  590. flex: 1;
  591. height: 70rpx;
  592. padding: 0 20rpx;
  593. background-color: #f8f8f8;
  594. border-radius: 8rpx;
  595. display: flex;
  596. align-items: center;
  597. justify-content: space-between;
  598. }
  599. .placeholder {
  600. color: #c0c4cc;
  601. font-size: 28rpx;
  602. }
  603. .select-wrapper {
  604. flex: 1;
  605. ::v-deep .uni-stat__select {
  606. width: 100%;
  607. }
  608. ::v-deep .uni-stat-box {
  609. width: 100%;
  610. }
  611. ::v-deep .uni-select {
  612. width: 100%;
  613. border: none;
  614. }
  615. ::v-deep .uni-select__input-box {
  616. height: 70rpx;
  617. padding: 0 20rpx;
  618. background-color: #f8f8f8;
  619. border-radius: 8rpx;
  620. border: none;
  621. }
  622. ::v-deep .uni-select__input-text {
  623. font-size: 28rpx;
  624. color: #333;
  625. }
  626. ::v-deep .uni-select__input-placeholder {
  627. color: #c0c4cc;
  628. }
  629. ::v-deep .uni-select__selector {
  630. max-height: 400rpx;
  631. }
  632. }
  633. .accompany-list {
  634. .accompany-item {
  635. position: relative;
  636. padding: 20rpx;
  637. background-color: #f8f8f8;
  638. border-radius: 8rpx;
  639. margin-bottom: 20rpx;
  640. &:last-child {
  641. margin-bottom: 0;
  642. }
  643. }
  644. }
  645. .delete-btn {
  646. position: absolute;
  647. top: 10rpx;
  648. right: 10rpx;
  649. width: 60rpx;
  650. height: 60rpx;
  651. display: flex;
  652. align-items: center;
  653. justify-content: center;
  654. background-color: #fff;
  655. border-radius: 50%;
  656. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  657. }
  658. .add-accompany-btn {
  659. display: flex;
  660. align-items: center;
  661. justify-content: center;
  662. height: 80rpx;
  663. background-color: #f8f9fa;
  664. border: 2rpx dashed #c0c4cc;
  665. border-radius: 8rpx;
  666. color: #909399;
  667. font-size: 28rpx;
  668. text {
  669. margin-left: 10rpx;
  670. }
  671. }
  672. .vehicle-header {
  673. display: flex;
  674. align-items: center;
  675. margin-bottom: 30rpx;
  676. .section-title {
  677. flex: 1;
  678. margin-bottom: 0;
  679. margin-left: 15rpx;
  680. }
  681. }
  682. .vehicle-content {
  683. padding-top: 20rpx;
  684. border-top: 1rpx solid #eee;
  685. }
  686. .submit-container {
  687. padding: 20rpx;
  688. background-color: #fff;
  689. margin-top: 20rpx;
  690. }
  691. .submit-btn {
  692. width: 100%;
  693. height: 88rpx;
  694. background: linear-gradient(135deg, #ff6b35 0%, #ff9500 100%);
  695. border-radius: 44rpx;
  696. border: none;
  697. color: #fff;
  698. font-size: 32rpx;
  699. font-weight: 600;
  700. }
  701. .picker-container {
  702. background-color: #fff;
  703. border-radius: 20rpx 20rpx 0 0;
  704. }
  705. .picker-header {
  706. display: flex;
  707. align-items: center;
  708. justify-content: space-between;
  709. padding: 30rpx;
  710. border-bottom: 1rpx solid #eee;
  711. text {
  712. color: #007aff;
  713. font-size: 28rpx;
  714. }
  715. }
  716. .picker-title {
  717. font-size: 32rpx;
  718. font-weight: 600;
  719. color: #333 !important;
  720. }
  721. .picker-view {
  722. height: 400rpx;
  723. }
  724. .picker-item {
  725. display: flex;
  726. align-items: center;
  727. justify-content: center;
  728. height: 80rpx;
  729. font-size: 28rpx;
  730. color: #333;
  731. }
  732. // 提交成功弹框样式
  733. .success-popup {
  734. .popup-content {
  735. background-color: #fff;
  736. border-radius: 20rpx;
  737. padding: 60rpx 40rpx 40rpx;
  738. width: 560rpx;
  739. text-align: center;
  740. }
  741. .success-icon {
  742. margin-bottom: 30rpx;
  743. }
  744. .popup-title {
  745. font-size: 36rpx;
  746. font-weight: 600;
  747. color: #333;
  748. margin-bottom: 20rpx;
  749. }
  750. .popup-message {
  751. font-size: 28rpx;
  752. color: #666;
  753. line-height: 1.6;
  754. margin-bottom: 50rpx;
  755. }
  756. .popup-buttons {
  757. display: flex;
  758. gap: 20rpx;
  759. button {
  760. flex: 1;
  761. height: 80rpx;
  762. border-radius: 40rpx;
  763. font-size: 28rpx;
  764. border: none;
  765. }
  766. .cancel-btn {
  767. background-color: #f5f5f5;
  768. color: #666;
  769. }
  770. .follow-btn {
  771. background: linear-gradient(135deg, #ff6b35 0%, #ff9500 100%);
  772. color: #fff;
  773. }
  774. }
  775. }
  776. // 二维码弹框样式
  777. .qrcode-popup {
  778. .qrcode-content {
  779. background-color: #fff;
  780. border-radius: 20rpx;
  781. padding: 50rpx 40rpx;
  782. width: 560rpx;
  783. text-align: center;
  784. }
  785. .qrcode-title {
  786. font-size: 32rpx;
  787. font-weight: 600;
  788. color: #333;
  789. margin-bottom: 40rpx;
  790. }
  791. .qrcode-image {
  792. width: 400rpx;
  793. height: 400rpx;
  794. margin: 0 auto 30rpx;
  795. border: 1rpx solid #eee;
  796. border-radius: 12rpx;
  797. overflow: hidden;
  798. position: relative;
  799. image {
  800. width: 100%;
  801. height: 100%;
  802. }
  803. .preview-tip {
  804. position: absolute;
  805. left: 0;
  806. right: 0;
  807. bottom: 0;
  808. height: 60rpx;
  809. background: rgba(0, 0, 0, 0.5);
  810. display: flex;
  811. align-items: center;
  812. justify-content: center;
  813. color: #fff;
  814. font-size: 24rpx;
  815. text {
  816. margin-left: 10rpx;
  817. }
  818. }
  819. &:active {
  820. opacity: 0.8;
  821. }
  822. }
  823. .qrcode-tip {
  824. font-size: 26rpx;
  825. color: #999;
  826. margin-bottom: 40rpx;
  827. line-height: 1.5;
  828. }
  829. .qrcode-close-btn {
  830. width: 100%;
  831. height: 80rpx;
  832. background: linear-gradient(135deg, #ff6b35 0%, #ff9500 100%);
  833. border-radius: 40rpx;
  834. color: #fff;
  835. font-size: 28rpx;
  836. border: none;
  837. }
  838. }
  839. </style>