edit.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. <template>
  2. <view class="edit-container">
  3. <scroll-view scroll-y class="scroll-content">
  4. <view class="form-wrapper">
  5. <uv-form :model="form" ref="formRef" labelWidth="100px" labelPosition="top" :borderBottom="false">
  6. <!-- 1. 项目信息 -->
  7. <view class="section-title">项目信息</view>
  8. <view class="group-card">
  9. <uv-form-item label="项目名称">
  10. <uv-input v-model="form.projectName" disabled placeholder="自动获取" border="none"/>
  11. </uv-form-item>
  12. <uv-form-item label="项目来源">
  13. <uv-input v-model="form.projectSource" disabled placeholder="自动获取" border="none"/>
  14. </uv-form-item>
  15. <uv-form-item label="项目负责人">
  16. <uv-input v-model="form.projectIncharge" disabled placeholder="自动获取" border="none"/>
  17. </uv-form-item>
  18. <uv-form-item label="所属科室">
  19. <uv-input v-model="form.deptName" disabled placeholder="自动获取" border="none"/>
  20. </uv-form-item>
  21. <uv-form-item label="费用科目">
  22. <uv-input v-model="form.subjName" disabled placeholder="自动获取" border="none"/>
  23. </uv-form-item>
  24. <uv-form-item label="费用类型">
  25. <uv-input v-model="form.subSubjName" disabled placeholder="自动获取" border="none"/>
  26. </uv-form-item>
  27. <uv-form-item label="入账金额(元)">
  28. <uv-input :value="showAmount ? amountUnitFormatter(showAmount) : '0.00'" disabled placeholder="自动获取" border="none" />
  29. </uv-form-item>
  30. <uv-form-item label="可用金额(元)">
  31. <uv-input :value="showBalanceAmount ? amountUnitFormatter(showBalanceAmount) : '0.00'" disabled placeholder="自动获取" border="none" />
  32. </uv-form-item>
  33. <uv-form-item label="事项" prop="purpose" required>
  34. <uv-textarea v-model="form.purpose" placeholder="请输入事项" autoHeight border="none" customStyle="background-color: #f8f8f8; padding: 20rpx; border-radius: 10rpx;" />
  35. </uv-form-item>
  36. </view>
  37. <!-- 2. 报销经费 -->
  38. <view class="section-title mt20">报销经费</view>
  39. <view class="group-card">
  40. <uv-form-item label="支出日期" prop="expendTime" required @click="openExpandTimePicker">
  41. <uv-input v-model="form.expendTime" disabled disabledColor="#ffffff" placeholder="请选择支出日期" suffixIcon="arrow-right" border="none"/>
  42. </uv-form-item>
  43. <uv-form-item label="申请人" prop="handle">
  44. <uv-input v-model="form.handle" placeholder="请输入申请人" border="none"/>
  45. </uv-form-item>
  46. <uv-form-item label="出纳" prop="expend">
  47. <uv-input v-model="form.expend" placeholder="请输入出纳" border="none"/>
  48. </uv-form-item>
  49. <uv-form-item label="支出金额(元)" prop="amount">
  50. <uv-input v-model="form.amount" type="digit" placeholder="请输入支出金额" border="none"/>
  51. </uv-form-item>
  52. </view>
  53. <!-- 3. 发票信息 -->
  54. <view class="section-title mt20 flex justify-between align-center">
  55. <text>发票信息</text>
  56. <uv-button type="primary" size="small" icon="plus" plain customStyle="height: 50rpx;" @click="addInvoice">添加</uv-button>
  57. </view>
  58. <view class="group-card mt10" v-for="(item, index) in form.invoice" :key="'invoice' + index">
  59. <view class="flex justify-between align-center mb10" v-if="Number(index) > 0">
  60. <text style="color: #999; font-size: 24rpx;">发票信息 {{ Number(index) + 1 }}</text>
  61. <text class="delete-text" @click="deleteInvoice(Number(index))">删除</text>
  62. </view>
  63. <uv-form-item label="发票号码" required>
  64. <uv-input v-model="item.invoiceNo" placeholder="请输入发票号码" border="none"/>
  65. </uv-form-item>
  66. <uv-form-item label="发票金额(元)" required>
  67. <uv-input v-model="item.amount" type="digit" placeholder="请输入金额" border="none"/>
  68. </uv-form-item>
  69. <uv-form-item label="开票日期" required @click="openInvoiceByPicker(Number(index), item.invoiceBy)">
  70. <uv-input v-model="item.invoiceBy" disabled disabledColor="#ffffff" placeholder="请选择开票日期" suffixIcon="arrow-right" border="none"/>
  71. </uv-form-item>
  72. <uv-form-item label="上传附件" required>
  73. <uv-upload
  74. :fileList="item.fileList"
  75. name="file"
  76. multiple
  77. :maxCount="3"
  78. @afterRead="afterReadInvoice($event, Number(index))"
  79. @delete="deleteInvoiceFile($event, Number(index))"
  80. ></uv-upload>
  81. </uv-form-item>
  82. </view>
  83. <!-- 4. 支付信息 -->
  84. <view class="section-title mt20 flex justify-between align-center">
  85. <text>支付信息</text>
  86. <uv-button type="primary" size="small" icon="plus" plain customStyle="height: 50rpx;" @click="addPayment">添加</uv-button>
  87. </view>
  88. <view class="group-card mt10" v-for="(item, index) in form.payment" :key="'payment' + index">
  89. <view class="flex justify-between align-center mb10" v-if="Number(index) > 0">
  90. <text style="color: #999; font-size: 24rpx;">支付信息 {{ Number(index) + 1 }}</text>
  91. <text class="delete-text" @click="deletePayment(Number(index))">删除</text>
  92. </view>
  93. <uv-form-item label="支付方式" @click="openPayTypePicker(Number(index))">
  94. <uv-input :value="formatPayType(item.payType)" disabled disabledColor="#ffffff" placeholder="请选择支付方式" suffixIcon="arrow-right" border="none"/>
  95. </uv-form-item>
  96. <uv-form-item label="收款人/单位" prop="receiver">
  97. <uv-input v-model="item.receiver" placeholder="请输入收款人或单位" border="none"/>
  98. </uv-form-item>
  99. <uv-form-item label="个人/单位类型" required>
  100. <view class="radio-group-wrap">
  101. <radio-group @change="item.receiverType = $event.detail.value">
  102. <label class="radio-label" v-for="ro in receiverTypeOptions" :key="ro.dictValue">
  103. <radio :value="ro.dictValue" :checked="item.receiverType === ro.dictValue" color="#1c9bfd" style="transform: scale(0.8)"/>
  104. <text>{{ ro.dictLabel }}</text>
  105. </label>
  106. </radio-group>
  107. </view>
  108. </uv-form-item>
  109. <uv-form-item label="金额(元)" required>
  110. <uv-input v-model="item.amount" type="digit" placeholder="请输入金额" border="none"/>
  111. </uv-form-item>
  112. </view>
  113. <!-- 5. 附件信息 -->
  114. <view class="section-title mt20">项目附件</view>
  115. <view class="group-card">
  116. <uv-form-item label="上传附件">
  117. <uv-upload
  118. :fileList="form.fileList"
  119. name="file"
  120. multiple
  121. :maxCount="5"
  122. @afterRead="afterReadGeneral"
  123. @delete="deleteGeneralFile"
  124. ></uv-upload>
  125. </uv-form-item>
  126. </view>
  127. </uv-form>
  128. </view>
  129. </scroll-view>
  130. <!-- 提交按钮 -->
  131. <view class="bottom-bar">
  132. <uv-button type="primary" text="提交报销" @click="submitForm" :loading="loading" customStyle="border-radius: 40rpx;"></uv-button>
  133. </view>
  134. <!-- 选择器容器 -->
  135. <uv-datetime-picker ref="expendTimePickerRef" mode="date" @confirm="onExpendTimeConfirm"></uv-datetime-picker>
  136. <uv-datetime-picker ref="invoicePickerRef" mode="date" @confirm="onInvoiceByConfirm"></uv-datetime-picker>
  137. <uv-picker ref="payTypePickerRef" :columns="[payTypeOptions]" keyName="label" @confirm="onPayTypeConfirm"></uv-picker>
  138. <uv-toast ref="toastRef"></uv-toast>
  139. </view>
  140. </template>
  141. <script lang="ts" setup>
  142. import { ref, reactive } from 'vue';
  143. import { onLoad } from '@dcloudio/uni-app';
  144. import { useUserStore } from '@/store/modules/user';
  145. import { storeToRefs } from 'pinia';
  146. import { useExpenseRemindApi, useRebateApi, useExpenseApi, useFundCardApi } from '@/api/fund/index';
  147. import { useSystemApi } from '@/api/system/index';
  148. import { CACHE_KEY } from '@/constants/index';
  149. const userStore = useUserStore();
  150. const { userInfo } = storeToRefs(userStore);
  151. const systemApi = useSystemApi();
  152. const expenseRemindApi = useExpenseRemindApi();
  153. const fundCardApi = useFundCardApi();
  154. const expenseApi = useExpenseApi();
  155. const toastRef = ref();
  156. const formRef = ref();
  157. const expendTimePickerRef = ref();
  158. const invoicePickerRef = ref();
  159. const payTypePickerRef = ref();
  160. const loading = ref(false);
  161. const receiverTypeOptions = ref<any[]>([]);
  162. const dictOptions = ref<any[]>([]);
  163. const subList = ref<any[]>([]);
  164. const payTypeOptions = [
  165. { label: '现金', value: '10' },
  166. { label: '银行转账', value: '20' },
  167. { label: '国库集中支付', value: '30' }
  168. ];
  169. const showAmount = ref(0);
  170. const showBalanceAmount = ref(0);
  171. const activeInvoiceIndex = ref(-1);
  172. const activePayIndex = ref(-1);
  173. const form = reactive<any>({
  174. id: 0,
  175. orderNo: '',
  176. price: 0,
  177. buyerName: '',
  178. createdTime: '',
  179. status: '',
  180. fileList: [],
  181. amount: 0,
  182. noticeId: null,
  183. projectType: '',
  184. allotId: null,
  185. handle: '',
  186. projectId: 0,
  187. projectIncharge: '',
  188. projectName: '',
  189. projectSource: '',
  190. deptName: '',
  191. purpose: '',
  192. invoice: [
  193. { fileList: [], invoiceNo: '', amount: null, invoiceBy: '' }
  194. ],
  195. payment: [
  196. { payType: '10', receiver: '', receiverType: '', amount: '' }
  197. ],
  198. subjCode: '',
  199. subjName: '',
  200. subSubjCode: '',
  201. subSubjName: '',
  202. expendTime: '',
  203. expend: ''
  204. });
  205. const formatPayType = (type: string) => {
  206. const item = payTypeOptions.find(o => o.value === type);
  207. return item ? item.label : '';
  208. };
  209. const amountUnitFormatter = (val: any) => {
  210. if (val === null || val === undefined || val === '') return '0.00';
  211. const num = Number(val);
  212. return isNaN(num) ? '0.00' : num.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
  213. };
  214. const getDict = async () => {
  215. try {
  216. const resTypes: any = await systemApi.getDictDataByType('sci_receiver_type');
  217. if (resTypes.success && resTypes.data) receiverTypeOptions.value = resTypes.data.values;
  218. // get subjects
  219. const resSubj: any = await expenseApi.GetListNoPage();
  220. if(resSubj.success) {
  221. subList.value = resSubj.data;
  222. }
  223. const resSys: any = await systemApi.getEntityMapByKeys({ configKeys: ['sci_fund_expense_notice_business_code', 'sci_fund_expense_notice_material_code'] });
  224. if(resSys.success && resSys.data) {
  225. const pConfig = resSys.data;
  226. const find = (subList.value || []).find((item: any) => item.subjCode == pConfig.sci_fund_expense_notice_business_code);
  227. form.subjCode = find?.subjCode || '';
  228. form.subjName = find?.subjName || '';
  229. const subChildrenList = find?.children || [];
  230. const subFind = subChildrenList.find((item: any) => item.subjCode == pConfig.sci_fund_expense_notice_material_code);
  231. form.subSubjCode = subFind?.subjCode || '';
  232. form.subSubjName = subFind?.subjName || '';
  233. }
  234. } catch (err) {
  235. console.error(err);
  236. }
  237. };
  238. const getAmountInfo = async () => {
  239. if (!form.projectId || !form.subjCode) return;
  240. const params = {
  241. projectId: form.projectId,
  242. projectType: form.projectType,
  243. subjCode: form.subjCode
  244. };
  245. try {
  246. const res: any = await fundCardApi.getSubjAmount(params);
  247. if (res.code == 200 && res.data) {
  248. showAmount.value = res.data.amount;
  249. showBalanceAmount.value = res.data.balanceAmount;
  250. }
  251. } catch (err) {
  252. console.error(err);
  253. }
  254. };
  255. const getFundDetail = async (id: number) => {
  256. try {
  257. const res: any = await expenseRemindApi.getDetails({ id });
  258. if (res.code == 200 && res.data) {
  259. Object.assign(form, res.data);
  260. form.noticeId = res.data.id;
  261. form.amount = res.data.price;
  262. form.deptName = res.data.projectDeptName;
  263. form.handle = userInfo.value?.nickName || '';
  264. if(form.invoice.length === 0) {
  265. form.invoice = [{ fileList: [], invoiceNo: '', amount: null, invoiceBy: '' }];
  266. }
  267. if(form.payment.length === 0) {
  268. form.payment = [{ payType: '10', receiver: '', receiverType: '', amount: '' }];
  269. }
  270. }
  271. } catch (err) {
  272. console.error(err);
  273. }
  274. };
  275. // ================= Add/Delete dynamic items =================
  276. const addInvoice = () => {
  277. form.invoice.push({ fileList: [], invoiceNo: '', amount: null, invoiceBy: '' });
  278. };
  279. const deleteInvoice = (idx: number) => {
  280. uni.showModal({
  281. title: '提示',
  282. content: '确认删除该发票信息吗?',
  283. success: (res) => {
  284. if(res.confirm) form.invoice.splice(idx, 1);
  285. }
  286. });
  287. };
  288. const addPayment = () => {
  289. form.payment.push({ payType: '10', receiver: '', receiverType: '', amount: '' });
  290. };
  291. const deletePayment = (idx: number) => {
  292. uni.showModal({
  293. title: '提示',
  294. content: '确认删除该支付信息吗?',
  295. success: (res) => {
  296. if(res.confirm) form.payment.splice(idx, 1);
  297. }
  298. });
  299. };
  300. // ================= Pickers =================
  301. const openExpandTimePicker = () => {
  302. expendTimePickerRef.value.open();
  303. };
  304. const onExpendTimeConfirm = (e: any) => {
  305. const d = new Date(e.value);
  306. form.expendTime = `${d.getFullYear()}-${String(d.getMonth()+1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;
  307. };
  308. const openInvoiceByPicker = (index: number, val: string) => {
  309. activeInvoiceIndex.value = index;
  310. invoicePickerRef.value.open();
  311. };
  312. const onInvoiceByConfirm = (e: any) => {
  313. const d = new Date(e.value);
  314. const dateStr = `${d.getFullYear()}-${String(d.getMonth()+1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;
  315. if(activeInvoiceIndex.value !== -1) {
  316. form.invoice[activeInvoiceIndex.value].invoiceBy = dateStr;
  317. }
  318. };
  319. const openPayTypePicker = (index: number) => {
  320. activePayIndex.value = index;
  321. payTypePickerRef.value.open();
  322. };
  323. const onPayTypeConfirm = (e: any) => {
  324. if (activePayIndex.value !== -1) {
  325. form.payment[activePayIndex.value].payType = e.value[0].value;
  326. }
  327. };
  328. // ================= Upload Logic =================
  329. const uploadFileApi = (file: any): Promise<string> => {
  330. return new Promise((resolve, reject) => {
  331. uni.uploadFile({
  332. url: import.meta.env.VITE_SCIENTIFIC.replace('/api/Scientific', '/api/System/File/UploadFile'), // Fallback guess for system upload API if specific one isn't known
  333. filePath: file.url,
  334. name: 'file',
  335. header: { Authorization: 'Bearer ' + uni.getStorageSync(CACHE_KEY.TOKEN) },
  336. success: (res) => {
  337. try {
  338. const data = JSON.parse(res.data);
  339. if (data.code === 200 || data.success) resolve(data.data.url || data.data);
  340. else reject(new Error('上传失败'));
  341. } catch {
  342. resolve(res.data); // in case it returns plain url
  343. }
  344. },
  345. fail: (err) => reject(err)
  346. });
  347. });
  348. };
  349. const afterReadGeneral = async (e: any) => {
  350. const fileList: any[] = [].concat(e.file);
  351. for (const file of fileList) {
  352. form.fileList.push({ ...file, status: 'uploading', message: '上传中' });
  353. try {
  354. const url = await uploadFileApi(file);
  355. const item = form.fileList[form.fileList.length - 1];
  356. item.status = 'success';
  357. item.message = '';
  358. item.url = url;
  359. item.fileUrl = url;
  360. item.fileName = file.name;
  361. } catch {
  362. form.fileList[form.fileList.length - 1].status = 'failed';
  363. }
  364. }
  365. };
  366. const deleteGeneralFile = (e: any) => {
  367. form.fileList.splice(e.index, 1);
  368. };
  369. const afterReadInvoice = async (e: any, invoiceIndex: number) => {
  370. const fileList: any[] = [].concat(e.file);
  371. const targetInvoice = form.invoice[invoiceIndex];
  372. for (const file of fileList) {
  373. targetInvoice.fileList.push({ ...file, status: 'uploading', message: '上传中' });
  374. try {
  375. const url = await uploadFileApi(file);
  376. const item = targetInvoice.fileList[targetInvoice.fileList.length - 1];
  377. item.status = 'success';
  378. item.message = '';
  379. item.url = url;
  380. item.fileUrl = url;
  381. item.fileName = file.name;
  382. } catch {
  383. targetInvoice.fileList[targetInvoice.fileList.length - 1].status = 'failed';
  384. }
  385. }
  386. };
  387. const deleteInvoiceFile = (e: any, invoiceIndex: number) => {
  388. form.invoice[invoiceIndex].fileList.splice(e.index, 1);
  389. };
  390. // ================= Submit =================
  391. const submitForm = async () => {
  392. if (!form.purpose) {
  393. toastRef.value.show({ message: '请输入事项', type: 'warning' });
  394. return;
  395. }
  396. if (!form.expendTime) {
  397. toastRef.value.show({ message: '请选择支出日期', type: 'warning' });
  398. return;
  399. }
  400. if (form.invoice.length === 0) {
  401. toastRef.value.show({ message: '发票信息不能为空', type: 'warning' });
  402. return;
  403. }
  404. if (form.payment.length === 0) {
  405. toastRef.value.show({ message: '支付信息不能为空', type: 'warning' });
  406. return;
  407. }
  408. // Basic validation loop for invoice and payment
  409. for (const inv of form.invoice) {
  410. if(!inv.invoiceNo || !inv.amount || !inv.invoiceBy || !inv.fileList.length) {
  411. toastRef.value.show({ message: '请完成发票信息的填写及附件上传', type: 'warning' });
  412. return;
  413. }
  414. }
  415. for (const pay of form.payment) {
  416. if(!pay.receiverType || !pay.amount) {
  417. toastRef.value.show({ message: '请完成支付信息的必填项', type: 'warning' });
  418. return;
  419. }
  420. }
  421. const params = JSON.parse(JSON.stringify(form));
  422. // MAP attachments to backend format
  423. params.fileList = params.fileList.map((item: any) => ({
  424. fileName: item.fileName || item.name,
  425. fileSize: item.size,
  426. fileUrl: item.fileUrl || item.url
  427. }));
  428. params.fileUrl = JSON.stringify(params.fileList);
  429. params.invoice = params.invoice.map((item: any) => ({
  430. amount: item.amount,
  431. invoiceBy: item.invoiceBy,
  432. invoiceNo: item.invoiceNo,
  433. fileName: item.fileList[0]?.fileName || item.fileList[0]?.name,
  434. fileUrl: item.fileList[0]?.fileUrl || item.fileList[0]?.url,
  435. invoiceType: item.fileList[0]?.type || ''
  436. }));
  437. loading.value = true;
  438. try {
  439. const res: any = await expenseRemindApi.create(params);
  440. if (res.code == 200) {
  441. toastRef.value.show({ message: '报销成功', type: 'success' });
  442. setTimeout(() => {
  443. uni.navigateBack();
  444. }, 1000);
  445. } else {
  446. toastRef.value.show({ message: res.msg || '提交失败', type: 'error' });
  447. }
  448. } catch (err) {
  449. console.error(err);
  450. } finally {
  451. loading.value = false;
  452. }
  453. };
  454. onLoad((options: any) => {
  455. const id = options.id ? Number(options.id) : 0;
  456. getDict().then(() => {
  457. if (id) {
  458. getFundDetail(id).then(() => {
  459. getAmountInfo();
  460. });
  461. }
  462. });
  463. });
  464. </script>
  465. <style lang="scss" scoped>
  466. .edit-container {
  467. height: calc(100vh - var(--window-top));
  468. display: flex;
  469. flex-direction: column;
  470. background-color: #f5f7fa;
  471. box-sizing: border-box;
  472. }
  473. .scroll-content {
  474. flex: 1;
  475. height: 100%;
  476. }
  477. .form-wrapper {
  478. margin: 30rpx;
  479. padding-bottom: calc(120rpx + env(safe-area-inset-bottom));
  480. }
  481. .section-title {
  482. font-size: 32rpx;
  483. font-weight: bold;
  484. color: #333;
  485. margin-bottom: 20rpx;
  486. padding-left: 20rpx;
  487. position: relative;
  488. &::before {
  489. content: '';
  490. position: absolute;
  491. left: 0;
  492. top: 50%;
  493. transform: translateY(-50%);
  494. width: 8rpx;
  495. height: 32rpx;
  496. background-color: #1c9bfd;
  497. border-radius: 4rpx;
  498. }
  499. }
  500. .group-card {
  501. background-color: #fff;
  502. border-radius: 16rpx;
  503. padding: 0 30rpx;
  504. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.03);
  505. margin-bottom: 30rpx;
  506. :deep(.uv-form-item) {
  507. padding: 10rpx 0;
  508. border-bottom: 1px solid #f5f5f5;
  509. &:last-child {
  510. border-bottom: none;
  511. }
  512. }
  513. }
  514. .flex {
  515. display: flex;
  516. }
  517. .justify-between {
  518. justify-content: space-between;
  519. }
  520. .align-center {
  521. align-items: center;
  522. }
  523. .mt20 {
  524. margin-top: 20rpx;
  525. }
  526. .mt10 {
  527. margin-top: 10rpx;
  528. }
  529. .mb10 {
  530. margin-bottom: 10rpx;
  531. }
  532. .delete-text {
  533. color: #ff4d4f;
  534. font-size: 26rpx;
  535. padding: 10rpx 20rpx;
  536. }
  537. .radio-group-wrap {
  538. display: flex;
  539. flex-wrap: wrap;
  540. gap: 20rpx;
  541. .radio-label {
  542. display: flex;
  543. align-items: center;
  544. font-size: 28rpx;
  545. color: #333;
  546. }
  547. }
  548. .bottom-bar {
  549. position: fixed;
  550. bottom: 0;
  551. left: 0;
  552. right: 0;
  553. background-color: #fff;
  554. padding: 20rpx 30rpx;
  555. box-sizing: border-box;
  556. box-shadow: 0 -4rpx 16rpx rgba(0, 0, 0, 0.05);
  557. padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
  558. z-index: 99;
  559. }
  560. </style>