index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913
  1. <template>
  2. <view class="order-container">
  3. <erp-nav-bar title="添加型号" />
  4. <scroll-view :scroll-y="!showTypePicker && !showSurfacePicker && !showPackagePicker" class="order-scroll"
  5. :show-scrollbar="false" :enhanced="true" @scrolltolower="onScrollToLower">
  6. <view class="form-content">
  7. <!-- 模块 1:型材 -->
  8. <view class="section-card">
  9. <view class="section-header">
  10. <view class="blue-bar"></view>
  11. <text class="section-title">型材</text>
  12. </view>
  13. <view class="form-item">
  14. <text class="label required">型号</text>
  15. <view class="picker-box" @click="openTypePicker">
  16. <view class="picker-inner">
  17. <view class="picker-val" :class="{ placeholder: !formData.type }">
  18. {{ formData.type || '请选择型号' }}
  19. </view>
  20. <view class="line-arrow-down"></view>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="row-flex">
  25. <view class="half-item">
  26. <text class="label">名称</text>
  27. <input class="input-box readonly small-font" v-model="formData.name" disabled
  28. placeholder="型号名称" />
  29. </view>
  30. <view class="half-item">
  31. <text class="label">材质</text>
  32. <input class="input-box readonly small-font" v-model="formData.material" disabled
  33. placeholder="材质" />
  34. </view>
  35. </view>
  36. </view>
  37. <!-- 模块 2:表面处理 -->
  38. <view class="section-card">
  39. <view class="section-header">
  40. <view class="blue-bar"></view>
  41. <text class="section-title">表面处理</text>
  42. </view>
  43. <view class="form-item">
  44. <text class="label required">表面名称</text>
  45. <view class="picker-box" @click="openSurfacePicker">
  46. <view class="picker-inner">
  47. <view class="picker-val" :class="{ placeholder: !formData.surfaceName }">
  48. {{ formData.surfaceName || '请选择表面名称' }}
  49. </view>
  50. <view class="line-arrow-down"></view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. <!-- 模块 3:包装 -->
  56. <view class="section-card">
  57. <view class="section-header">
  58. <view class="blue-bar"></view>
  59. <text class="section-title">包装</text>
  60. </view>
  61. <view class="form-item">
  62. <text class="label required">包装方式</text>
  63. <view class="picker-box" @click="openPackagePicker">
  64. <view class="picker-inner">
  65. <view class="picker-val" :class="{ placeholder: !formData.packageMethod }">
  66. {{ formData.packageMethod || '请选择包装方式' }}
  67. </view>
  68. <view class="line-arrow-down"></view>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. <!-- 模块 4:壁厚 -->
  74. <view class="section-card">
  75. <view class="section-header">
  76. <view class="blue-bar"></view>
  77. <text class="section-title">壁厚</text>
  78. </view>
  79. <view class="row-flex">
  80. <view class="half-item">
  81. <text class="label required">长度</text>
  82. <view class="input-wrap">
  83. <input class="input-box" type="digit" v-model="formData.length" placeholder="请输入" />
  84. <text class="unit">mm</text>
  85. </view>
  86. </view>
  87. <view class="half-item">
  88. <text class="label required">壁厚</text>
  89. <view class="input-wrap">
  90. <input class="input-box" type="digit" v-model="formData.wallThickness"
  91. placeholder="请输入" />
  92. <text class="unit">mm</text>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. <!-- 模块 5:数量 -->
  98. <view class="section-card">
  99. <view class="section-header">
  100. <view class="blue-bar"></view>
  101. <text class="section-title">数量</text>
  102. </view>
  103. <view class="form-item no-margin-bottom">
  104. <text class="label required">支数</text>
  105. <input class="input-box full-width" type="number" v-model="formData.count"
  106. placeholder="请输入支数" />
  107. </view>
  108. </view>
  109. <view class="bottom-placeholder"></view>
  110. </view>
  111. </scroll-view>
  112. <view class="fixed-submit-bar">
  113. <button class="submit-btn" @click="confirmAddModel">确认并添加</button>
  114. </view>
  115. <!-- 型号选择 -->
  116. <view class="custom-picker-mask" v-if="showTypePicker" @click="closeTypePicker" @touchmove.stop.prevent>
  117. <view class="picker-popup" @click.stop>
  118. <view class="popup-header">
  119. <text class="cancel-text" @click="closeTypePicker">取消</text>
  120. <text class="popup-title">选择产品型号</text>
  121. <text class="confirm-text" @click="confirmTypeSelect">确定</text>
  122. </view>
  123. <!-- 搜索栏 -->
  124. <view class="search-bar">
  125. <view class="search-input-wrap">
  126. <text class="search-icon">🔍</text>
  127. <input class="search-input" type="text" v-model="typeSearchKey" placeholder="输入名称检索"
  128. @input="onTypeSearch" />
  129. </view>
  130. </view>
  131. <!-- 层级面包屑 -->
  132. <view class="breadcrumb-bar" v-if="typePickerLevel > 1">
  133. <text class="back-btn" @click="goBackModelLevel">← 返回</text>
  134. <text class="breadcrumb-path">
  135. {{typeBreadcrumbs.map(b => b.label).join(' / ')}}
  136. </text>
  137. </view>
  138. <!-- 列表区 -->
  139. <scroll-view scroll-y class="item-list">
  140. <view class="option-item kind-item" v-for="(item, index) in modelKindList" :key="'mk'+index"
  141. @click="drillDownType(item)">
  142. <text class="option-text kind-text">{{ item.num }} - {{ item.name }}</text>
  143. <text class="arrow-right">›</text>
  144. </view>
  145. <view class="option-item" v-for="(item, index) in modelItemList" :key="'mi'+index"
  146. :class="{ active: tempSelectedIndex === index }">
  147. <text class="option-text" @click="selectTypeItem(index)">{{ item.num }} - {{ item.name }}</text>
  148. </view>
  149. </scroll-view>
  150. </view>
  151. </view>
  152. <!-- 表面处理选择 -->
  153. <view class="custom-picker-mask" v-if="showSurfacePicker" @click="closeSurfacePicker" @touchmove.stop.prevent>
  154. <view class="picker-popup" @click.stop>
  155. <view class="popup-header">
  156. <text class="cancel-text" @click="closeSurfacePicker">取消</text>
  157. <text class="popup-title">选择表面处理</text>
  158. <text class="confirm-text" @click="confirmSurfaceSelect">确定</text>
  159. </view>
  160. <!-- 搜索栏 -->
  161. <view class="search-bar">
  162. <view class="search-input-wrap">
  163. <text class="search-icon">🔍</text>
  164. <input class="search-input" type="text" v-model="surfaceSearchKey" placeholder="输入名称检索"
  165. @input="onSurfaceSearch" />
  166. </view>
  167. </view>
  168. <!-- 层级面包屑 -->
  169. <view class="breadcrumb-bar" v-if="surfacePickerLevel > 1">
  170. <text class="back-btn" @click="goBackSurfaceLevel">← 返回</text>
  171. <text class="breadcrumb-path">{{surfaceBreadcrumbs.map(b => b.label).join(' / ')}}</text>
  172. </view>
  173. <!-- 列表区 -->
  174. <scroll-view scroll-y class="item-list">
  175. <view class="option-item kind-item" v-for="(item, index) in colorKindList" :key="'ck'+index"
  176. @click="drillDownSurface(item)">
  177. <text class="option-text kind-text">{{ item.num }} - {{ item.name }}</text>
  178. <text class="arrow-right">›</text>
  179. </view>
  180. <view class="option-item" v-for="(item, index) in colorItemList" :key="'ci'+index"
  181. :class="{ active: tempSurfaceIndex === index }">
  182. <text class="option-text" @click="selectSurfaceItem(index)">{{ item.num }} - {{ item.name
  183. }}</text>
  184. </view>
  185. </scroll-view>
  186. </view>
  187. </view>
  188. <!-- 包装方式选择 -->
  189. <view class="custom-picker-mask" v-if="showPackagePicker" @click="closePackagePicker" @touchmove.stop.prevent>
  190. <view class="picker-popup" @click.stop>
  191. <view class="popup-header">
  192. <text class="cancel-text" @click="closePackagePicker">取消</text>
  193. <text class="popup-title">选择包装方式</text>
  194. <text class="confirm-text" @click="confirmPackageSelect">确定</text>
  195. </view>
  196. <view class="search-bar">
  197. <view class="search-input-wrap">
  198. <text class="search-icon">🔍</text>
  199. <input class="search-input" type="text" v-model="packageSearchKey" placeholder="输入名称检索"
  200. @input="onPackageSearch" />
  201. </view>
  202. </view>
  203. <scroll-view scroll-y class="item-list" @scrolltolower="loadMorePackage">
  204. <view class="option-item" v-for="(item, index) in packageList" :key="index"
  205. :class="{ active: tempPackageIndex === index }" @click="selectPackageItem(index)">
  206. <text>{{ item.num }} - {{ item.name }}</text>
  207. <icon type="success_no_circle" size="16" color="#C1001C" v-if="tempPackageIndex === index">
  208. </icon>
  209. </view>
  210. <view class="loading-tip" v-if="packageLoading && packageHasMore">
  211. <text class="loading-text">加载中...</text>
  212. </view>
  213. <view class="loading-tip" v-if="!packageHasMore && packageList.length > 0">
  214. <text class="loading-text">已加载全部</text>
  215. </view>
  216. </scroll-view>
  217. </view>
  218. </view>
  219. </view>
  220. </template>
  221. <script>
  222. import ErpNavBar from '@/components/erp-nav-bar.vue';
  223. import { listModel } from '@/api/erp/model.js';
  224. import { listModelKind } from '@/api/erp/modelKind.js';
  225. import { listColor } from '@/api/erp/color.js';
  226. import { listColorKind } from '@/api/erp/colorKind.js';
  227. import { listPagePack } from '@/api/erp/pack.js';
  228. import { addOrderDetail } from '@/api/erp/orderDetail.js';
  229. export default {
  230. components: { ErpNavBar },
  231. data() {
  232. return {
  233. showTypePicker: false, showSurfacePicker: false, showPackagePicker: false,
  234. tempSelectedIndex: -1, tempSurfaceIndex: -1, tempPackageIndex: -1,
  235. modelKindList: [],
  236. modelItemList: [],
  237. colorKindList: [],
  238. colorItemList: [],
  239. packageList: [],
  240. typeSearchKey: '', surfaceSearchKey: '', packageSearchKey: '',
  241. typeBreadcrumbs: [],
  242. typePickerLevel: 1,
  243. surfaceBreadcrumbs: [],
  244. surfacePickerLevel: 1,
  245. packagePageNum: 1, packagePageSize: 10, packageHasMore: true, packageLoading: false,
  246. formData: {
  247. type: '', modelId: '', name: '', material: '',
  248. surfaceName: '', surfaceId: '', packageMethod: '', packageId: '', length: '',
  249. wallThickness: '', count: '', meterWeight: ''
  250. }
  251. }
  252. },
  253. async onLoad() {
  254. await this.loadPackageMethods();
  255. },
  256. methods: {
  257. async loadPackageMethods(pageNum = 1, keyword = '') {
  258. if (this.packageLoading) return;
  259. this.packageLoading = true;
  260. try {
  261. const res = await listPagePack({
  262. pageNum: pageNum,
  263. pageSize: this.packagePageSize,
  264. name: keyword
  265. });
  266. const rows = res.rows || [];
  267. const total = res.total || 0;
  268. if (pageNum === 1) {
  269. this.packageList = rows;
  270. } else {
  271. this.packageList = [...this.packageList, ...rows];
  272. }
  273. this.packageHasMore = this.packageList.length < total;
  274. } catch (e) {
  275. uni.showToast({ title: e || '加载包装方式失败', icon: 'none' });
  276. } finally {
  277. this.packageLoading = false;
  278. }
  279. },
  280. loadMorePackage() {
  281. if (this.packageHasMore && !this.packageLoading) {
  282. this.packagePageNum++;
  283. this.loadPackageMethods(this.packagePageNum, this.packageSearchKey);
  284. }
  285. },
  286. /**
  287. * 包装方式搜索(防抖)
  288. * @Author: Antigravity
  289. */
  290. onPackageSearch() {
  291. if (this.packageSearchTimer) clearTimeout(this.packageSearchTimer);
  292. this.packageSearchTimer = setTimeout(() => {
  293. this.packagePageNum = 1;
  294. this.loadPackageMethods(1, this.packageSearchKey);
  295. }, 300);
  296. },
  297. /**
  298. * 加载型材系列,点击系列后同时加载子系列和具体型号
  299. * @Author: Trae
  300. */
  301. async loadTypes(parentRowId) {
  302. try {
  303. const keyword = (this.typeSearchKey || '').trim();
  304. const kindParams = { name: keyword || undefined };
  305. if (parentRowId) {
  306. kindParams.parentRowId = parentRowId;
  307. }
  308. const kindRes = await listModelKind(kindParams);
  309. this.modelKindList = kindRes.data || [];
  310. if (parentRowId) {
  311. const modelParams = { name: keyword || undefined, parentRowId };
  312. const modelRes = await listModel(modelParams);
  313. this.modelItemList = modelRes.data || [];
  314. } else {
  315. this.modelItemList = [];
  316. }
  317. } catch (e) {
  318. uni.showToast({ title: e || '加载型号失败', icon: 'none' });
  319. }
  320. },
  321. /**
  322. * 型号搜索
  323. * @Author: Trae
  324. */
  325. onTypeSearch() {
  326. const parentRowId = this.typeBreadcrumbs.length > 0
  327. ? this.typeBreadcrumbs[this.typeBreadcrumbs.length - 1].rowId : '';
  328. this.loadTypes(parentRowId);
  329. },
  330. /**
  331. * 加载表面处理系列,点击系列后同时加载子系列和具体颜色
  332. * @Author: Trae
  333. */
  334. async loadSurfaces(parentRowId) {
  335. try {
  336. const keyword = (this.surfaceSearchKey || '').trim();
  337. const kindParams = { name: keyword || undefined };
  338. if (parentRowId) {
  339. kindParams.parentRowId = parentRowId;
  340. }
  341. const kindRes = await listColorKind(kindParams);
  342. this.colorKindList = kindRes.data || [];
  343. if (parentRowId) {
  344. const colorParams = { name: keyword || undefined, parentRowId };
  345. const colorRes = await listColor(colorParams);
  346. this.colorItemList = colorRes.data || [];
  347. } else {
  348. this.colorItemList = [];
  349. }
  350. } catch (e) {
  351. uni.showToast({ title: e || '加载表面处理失败', icon: 'none' });
  352. }
  353. },
  354. /**
  355. * 表面处理搜索
  356. * @Author: Trae
  357. */
  358. onSurfaceSearch() {
  359. const parentRowId = this.surfaceBreadcrumbs.length > 0
  360. ? this.surfaceBreadcrumbs[this.surfaceBreadcrumbs.length - 1].rowId : '';
  361. this.loadSurfaces(parentRowId);
  362. },
  363. /**
  364. * 打开型号选择器
  365. * @Author: Trae
  366. */
  367. openTypePicker() {
  368. this.typePickerLevel = 1;
  369. this.typeBreadcrumbs = [];
  370. this.tempSelectedIndex = -1;
  371. this.showTypePicker = true;
  372. this.loadTypes('');
  373. },
  374. /**
  375. * 钻取到子级
  376. * @Author: Trae
  377. */
  378. drillDownType(item) {
  379. this.typeBreadcrumbs.push({ rowId: item.rowId, label: item.num });
  380. this.typePickerLevel++;
  381. this.tempSelectedIndex = -1;
  382. this.loadTypes(item.rowId);
  383. },
  384. /**
  385. * 返回上一级
  386. * @Author: Trae
  387. */
  388. goBackModelLevel() {
  389. this.typeBreadcrumbs.pop();
  390. this.typePickerLevel--;
  391. this.tempSelectedIndex = -1;
  392. const parentRowId = this.typeBreadcrumbs.length > 0
  393. ? this.typeBreadcrumbs[this.typeBreadcrumbs.length - 1].rowId : '';
  394. this.loadTypes(parentRowId);
  395. },
  396. closeTypePicker() {
  397. this.showTypePicker = false;
  398. this.typeSearchKey = '';
  399. this.typePickerLevel = 1;
  400. this.typeBreadcrumbs = [];
  401. this.tempSelectedIndex = -1;
  402. },
  403. selectTypeItem(index) { this.tempSelectedIndex = index; },
  404. /**
  405. * 确认选择型材
  406. * @Author: Trae
  407. */
  408. confirmTypeSelect() {
  409. if (this.tempSelectedIndex === -1) {
  410. uni.showToast({ title: '请先选择一个选项', icon: 'none' });
  411. return;
  412. }
  413. const item = this.modelItemList[this.tempSelectedIndex];
  414. this.formData.type = item.num;
  415. this.formData.modelId = item.rowId;
  416. this.formData.name = item.name;
  417. this.formData.material = '6063-T5';
  418. this.formData.meterWeight = item.meterWt || '';
  419. this.closeTypePicker();
  420. },
  421. /**
  422. * 打开表面处理选择器
  423. * @Author: Trae
  424. */
  425. openSurfacePicker() {
  426. this.surfacePickerLevel = 1;
  427. this.surfaceBreadcrumbs = [];
  428. this.tempSurfaceIndex = -1;
  429. this.showSurfacePicker = true;
  430. this.loadSurfaces('');
  431. },
  432. /**
  433. * 钻取到子级
  434. * @Author: Trae
  435. */
  436. drillDownSurface(item) {
  437. this.surfaceBreadcrumbs.push({ rowId: item.rowId, label: item.num });
  438. this.surfacePickerLevel++;
  439. this.tempSurfaceIndex = -1;
  440. this.loadSurfaces(item.rowId);
  441. },
  442. /**
  443. * 返回上一级
  444. * @Author: Trae
  445. */
  446. goBackSurfaceLevel() {
  447. this.surfaceBreadcrumbs.pop();
  448. this.surfacePickerLevel--;
  449. this.tempSurfaceIndex = -1;
  450. const parentRowId = this.surfaceBreadcrumbs.length > 0
  451. ? this.surfaceBreadcrumbs[this.surfaceBreadcrumbs.length - 1].rowId : '';
  452. this.loadSurfaces(parentRowId);
  453. },
  454. closeSurfacePicker() {
  455. this.showSurfacePicker = false;
  456. this.surfaceSearchKey = '';
  457. this.surfacePickerLevel = 1;
  458. this.surfaceBreadcrumbs = [];
  459. this.tempSurfaceIndex = -1;
  460. },
  461. selectSurfaceItem(index) { this.tempSurfaceIndex = index; },
  462. /**
  463. * 确认选择表面处理
  464. * @Author: Trae
  465. */
  466. confirmSurfaceSelect() {
  467. if (this.tempSurfaceIndex === -1) {
  468. uni.showToast({ title: '请先选择一个选项', icon: 'none' });
  469. return;
  470. }
  471. const item = this.colorItemList[this.tempSurfaceIndex];
  472. this.formData.surfaceName = item.name;
  473. this.formData.surfaceId = item.rowId;
  474. this.closeSurfacePicker();
  475. },
  476. openPackagePicker() {
  477. if (this.formData.packageMethod) {
  478. this.tempPackageIndex = this.packageList.findIndex(item => item.name === this.formData.packageMethod);
  479. } else {
  480. this.tempPackageIndex = -1;
  481. }
  482. this.showPackagePicker = true;
  483. },
  484. closePackagePicker() {
  485. this.showPackagePicker = false;
  486. this.packageSearchKey = '';
  487. this.packagePageNum = 1;
  488. },
  489. selectPackageItem(index) { this.tempPackageIndex = index; },
  490. confirmPackageSelect() {
  491. if (this.tempPackageIndex === -1) return;
  492. const item = this.packageList[this.tempPackageIndex];
  493. this.formData.packageMethod = item.name;
  494. this.formData.packageId = item.rowId;
  495. this.closePackagePicker();
  496. },
  497. async confirmAddModel() {
  498. const fields = [
  499. { key: 'type', label: '型号' },
  500. { key: 'surfaceName', label: '表面名称' },
  501. { key: 'packageMethod', label: '包装方式' },
  502. { key: 'length', label: '长度' },
  503. { key: 'wallThickness', label: '壁厚' },
  504. { key: 'count', label: '支数' }
  505. ];
  506. for (let item of fields) {
  507. if (!this.formData[item.key]) {
  508. uni.showToast({ title: `请完善项目:${item.label}`, icon: 'none' });
  509. return;
  510. }
  511. }
  512. const finalData = {
  513. orderId: null,
  514. modelId: this.formData.modelId,
  515. modelNum: this.formData.type,
  516. modelName: this.formData.name,
  517. material: this.formData.material,
  518. surfaceId: this.formData.surfaceId,
  519. surfaceName: this.formData.surfaceName,
  520. packId: this.formData.packageId,
  521. packName: this.formData.packageMethod,
  522. length: parseFloat(this.formData.length || 0).toFixed(4),
  523. wallThickness: parseFloat(this.formData.wallThickness || 0).toFixed(4),
  524. meterWeight: this.formData.meterWeight ? parseFloat(this.formData.meterWeight || 0).toFixed(4) : null,
  525. count: parseInt(this.formData.count || 0)
  526. };
  527. uni.showLoading({ title: '正在保存...' });
  528. try {
  529. await addOrderDetail(finalData);
  530. uni.hideLoading();
  531. uni.showToast({ title: '添加成功', icon: 'success' });
  532. uni.$emit('add_order_item', finalData);
  533. setTimeout(() => {
  534. uni.navigateBack();
  535. }, 1000);
  536. } catch (e) {
  537. uni.hideLoading();
  538. uni.showToast({ title: e || '添加失败', icon: 'none' });
  539. }
  540. }
  541. }
  542. }
  543. </script>
  544. <style scoped>
  545. /deep/ ::-webkit-scrollbar {
  546. display: none !important;
  547. width: 0 !important;
  548. height: 0 !important;
  549. }
  550. .order-container {
  551. width: 100%;
  552. height: 100vh;
  553. background: #f7f8fa;
  554. display: flex;
  555. flex-direction: column;
  556. overflow: hidden;
  557. }
  558. .order-scroll {
  559. flex: 1;
  560. height: 0;
  561. }
  562. .form-content {
  563. padding: 30rpx;
  564. padding-bottom: calc(180rpx + env(safe-area-inset-bottom));
  565. }
  566. .section-card {
  567. background: #fff;
  568. border-radius: 24rpx;
  569. padding: 30rpx;
  570. margin-bottom: 30rpx;
  571. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.02);
  572. }
  573. .section-header {
  574. display: flex;
  575. align-items: center;
  576. margin-bottom: 40rpx;
  577. }
  578. .blue-bar {
  579. width: 8rpx;
  580. height: 32rpx;
  581. background: #C1001C;
  582. border-radius: 4rpx;
  583. margin-right: 16rpx;
  584. }
  585. .section-title {
  586. font-size: 32rpx;
  587. font-weight: bold;
  588. color: #333;
  589. }
  590. .form-item {
  591. margin-bottom: 40rpx;
  592. }
  593. .no-margin-bottom {
  594. margin-bottom: 0;
  595. }
  596. .row-flex {
  597. display: flex;
  598. justify-content: space-between;
  599. }
  600. .half-item {
  601. width: 48%;
  602. }
  603. .label {
  604. font-size: 28rpx;
  605. color: #333;
  606. margin-bottom: 20rpx;
  607. display: block;
  608. font-weight: 500;
  609. }
  610. .label.required::after {
  611. content: ' *';
  612. color: #ff4d4f;
  613. font-weight: bold;
  614. margin-left: 4rpx;
  615. }
  616. .picker-box {
  617. background: #f9fafc;
  618. border-radius: 12rpx;
  619. height: 100rpx;
  620. border: 1rpx solid #eee;
  621. display: flex;
  622. align-items: center;
  623. }
  624. .picker-inner {
  625. width: 100%;
  626. height: 100%;
  627. display: flex;
  628. align-items: center;
  629. justify-content: space-between;
  630. padding: 0 30rpx;
  631. box-sizing: border-box;
  632. }
  633. .picker-val {
  634. font-size: 30rpx;
  635. color: #333;
  636. }
  637. .picker-val.placeholder {
  638. color: #ccc;
  639. font-size: 28rpx;
  640. }
  641. .line-arrow-down {
  642. width: 14rpx;
  643. height: 14rpx;
  644. border-right: 3rpx solid #bbb;
  645. border-bottom: 3rpx solid #bbb;
  646. transform: rotate(45deg);
  647. margin-top: -8rpx;
  648. margin-right: 4rpx;
  649. }
  650. .input-wrap {
  651. position: relative;
  652. width: 100%;
  653. }
  654. .input-box {
  655. font-size: 30rpx;
  656. color: #333;
  657. width: 100%;
  658. height: 100rpx;
  659. background: #f9fafc;
  660. border-radius: 12rpx;
  661. padding: 0 80rpx 0 30rpx;
  662. box-sizing: border-box;
  663. border: 1rpx solid #eee;
  664. }
  665. .input-box.readonly {
  666. background: #f8f9fa;
  667. color: #666;
  668. border-color: #f0f0f0;
  669. }
  670. .input-box.full-width {
  671. padding: 0 30rpx;
  672. }
  673. .unit {
  674. position: absolute;
  675. right: 24rpx;
  676. top: 50%;
  677. transform: translateY(-50%);
  678. font-size: 26rpx;
  679. color: #999;
  680. font-weight: 500;
  681. }
  682. .small-font {
  683. font-size: 26rpx !important;
  684. }
  685. .fixed-submit-bar {
  686. position: fixed;
  687. bottom: 0;
  688. left: 0;
  689. width: 100%;
  690. background: #fff;
  691. padding: 20rpx 30rpx calc(env(safe-area-inset-bottom) + 20rpx);
  692. box-sizing: border-box;
  693. box-shadow: 0 -10rpx 30rpx rgba(0, 0, 0, 0.05);
  694. z-index: 100;
  695. }
  696. .submit-btn {
  697. background: #C1001C;
  698. color: #fff;
  699. height: 100rpx;
  700. border-radius: 50rpx;
  701. display: flex;
  702. align-items: center;
  703. justify-content: center;
  704. font-size: 34rpx;
  705. font-weight: bold;
  706. border: none;
  707. }
  708. .submit-btn:active {
  709. opacity: 0.9;
  710. transform: scale(0.98);
  711. }
  712. .custom-picker-mask {
  713. position: fixed;
  714. top: 0;
  715. left: 0;
  716. right: 0;
  717. bottom: 0;
  718. background: rgba(0, 0, 0, 0.4);
  719. z-index: 1000;
  720. display: flex;
  721. align-items: flex-end;
  722. }
  723. .picker-popup {
  724. width: 100%;
  725. background: #fff;
  726. border-radius: 32rpx 32rpx 0 0;
  727. padding-bottom: calc(env(safe-area-inset-bottom) + 20rpx);
  728. animation: slideUp 0.15s ease-out;
  729. }
  730. @keyframes slideUp {
  731. from {
  732. transform: translateY(100%);
  733. }
  734. to {
  735. transform: translateY(0);
  736. }
  737. }
  738. .popup-header {
  739. display: flex;
  740. justify-content: space-between;
  741. align-items: center;
  742. padding: 30rpx 40rpx;
  743. border-bottom: 1rpx solid #f0f0f0;
  744. }
  745. .popup-title {
  746. font-size: 32rpx;
  747. font-weight: bold;
  748. color: #333;
  749. }
  750. .cancel-text,
  751. .confirm-text {
  752. font-size: 30rpx;
  753. padding: 10rpx;
  754. }
  755. .confirm-text {
  756. color: #C1001C;
  757. font-weight: bold;
  758. }
  759. .item-list {
  760. max-height: 50vh;
  761. padding: 0 40rpx;
  762. }
  763. /* 搜索栏样式 */
  764. .search-bar {
  765. padding: 16rpx 40rpx;
  766. border-bottom: 1rpx solid #f0f0f0;
  767. }
  768. .search-input-wrap {
  769. display: flex;
  770. align-items: center;
  771. background: #f5f6f8;
  772. border-radius: 32rpx;
  773. padding: 12rpx 24rpx;
  774. }
  775. .search-icon {
  776. font-size: 28rpx;
  777. margin-right: 12rpx;
  778. }
  779. .search-input {
  780. flex: 1;
  781. font-size: 26rpx;
  782. color: #333;
  783. height: 56rpx;
  784. }
  785. .option-item {
  786. height: 110rpx;
  787. display: flex;
  788. align-items: center;
  789. justify-content: space-between;
  790. border-bottom: 1rpx solid #f8f8f8;
  791. font-size: 32rpx;
  792. color: #333;
  793. }
  794. .option-item.active {
  795. color: #C1001C;
  796. font-weight: bold;
  797. }
  798. .kind-item {
  799. background: #fafbfc;
  800. }
  801. .kind-text {
  802. color: #556;
  803. }
  804. .option-text {
  805. flex: 1;
  806. padding: 10rpx 0;
  807. }
  808. .loading-tip {
  809. padding: 20rpx 0;
  810. text-align: center;
  811. }
  812. .loading-text {
  813. font-size: 26rpx;
  814. color: #999;
  815. }
  816. /* 级联面包屑 */
  817. .breadcrumb-bar {
  818. display: flex;
  819. align-items: center;
  820. padding: 16rpx 40rpx;
  821. background: #fafafa;
  822. border-bottom: 1rpx solid #f0f0f0;
  823. }
  824. .back-btn {
  825. font-size: 28rpx;
  826. color: #C1001C;
  827. padding-right: 20rpx;
  828. flex-shrink: 0;
  829. }
  830. .breadcrumb-path {
  831. font-size: 26rpx;
  832. color: #666;
  833. flex: 1;
  834. overflow: hidden;
  835. text-overflow: ellipsis;
  836. white-space: nowrap;
  837. }
  838. .arrow-right {
  839. font-size: 56rpx;
  840. color: #bbb;
  841. padding: 10rpx 0 10rpx 20rpx;
  842. font-weight: 300;
  843. }
  844. .bottom-placeholder {
  845. height: 60rpx;
  846. }
  847. </style>