index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807
  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. <view class="search-bar">
  124. <view class="search-input-wrap">
  125. <text class="search-icon">🔍</text>
  126. <input class="search-input" type="text" v-model="typeSearchKey" placeholder="输入名称检索"
  127. @input="onTypeSearch" />
  128. </view>
  129. </view>
  130. <scroll-view scroll-y class="item-list" @scrolltolower="loadMoreType">
  131. <view class="option-item" v-for="(item, index) in typeList" :key="index"
  132. :class="{ active: tempSelectedIndex === index }" @click="selectTypeItem(index)">
  133. <text>{{ item.num }} - {{ item.name }}</text>
  134. <icon type="success_no_circle" size="16" color="#C1001C" v-if="tempSelectedIndex === index">
  135. </icon>
  136. </view>
  137. <view class="loading-tip" v-if="typeLoading && typeHasMore">
  138. <text class="loading-text">加载中...</text>
  139. </view>
  140. <view class="loading-tip" v-if="!typeHasMore && typeList.length > 0">
  141. <text class="loading-text">已加载全部</text>
  142. </view>
  143. </scroll-view>
  144. </view>
  145. </view>
  146. <!-- 表面处理选择 -->
  147. <view class="custom-picker-mask" v-if="showSurfacePicker" @click="closeSurfacePicker" @touchmove.stop.prevent>
  148. <view class="picker-popup" @click.stop>
  149. <view class="popup-header">
  150. <text class="cancel-text" @click="closeSurfacePicker">取消</text>
  151. <text class="popup-title">选择表面处理</text>
  152. <text class="confirm-text" @click="confirmSurfaceSelect">确定</text>
  153. </view>
  154. <view class="search-bar">
  155. <view class="search-input-wrap">
  156. <text class="search-icon">🔍</text>
  157. <input class="search-input" type="text" v-model="surfaceSearchKey" placeholder="输入名称检索"
  158. @input="onSurfaceSearch" />
  159. </view>
  160. </view>
  161. <scroll-view scroll-y class="item-list" @scrolltolower="loadMoreSurface">
  162. <view class="option-item" v-for="(item, index) in surfaceList" :key="index"
  163. :class="{ active: tempSurfaceIndex === index }" @click="selectSurfaceItem(index)">
  164. <text>{{ item.num }} - {{ item.name }}</text>
  165. <icon type="success_no_circle" size="16" color="#C1001C" v-if="tempSurfaceIndex === index">
  166. </icon>
  167. </view>
  168. <view class="loading-tip" v-if="surfaceLoading && surfaceHasMore">
  169. <text class="loading-text">加载中...</text>
  170. </view>
  171. <view class="loading-tip" v-if="!surfaceHasMore && surfaceList.length > 0">
  172. <text class="loading-text">已加载全部</text>
  173. </view>
  174. </scroll-view>
  175. </view>
  176. </view>
  177. <!-- 包装方式选择 -->
  178. <view class="custom-picker-mask" v-if="showPackagePicker" @click="closePackagePicker" @touchmove.stop.prevent>
  179. <view class="picker-popup" @click.stop>
  180. <view class="popup-header">
  181. <text class="cancel-text" @click="closePackagePicker">取消</text>
  182. <text class="popup-title">选择包装方式</text>
  183. <text class="confirm-text" @click="confirmPackageSelect">确定</text>
  184. </view>
  185. <view class="search-bar">
  186. <view class="search-input-wrap">
  187. <text class="search-icon">🔍</text>
  188. <input class="search-input" type="text" v-model="packageSearchKey" placeholder="输入名称检索"
  189. @input="onPackageSearch" />
  190. </view>
  191. </view>
  192. <scroll-view scroll-y class="item-list" @scrolltolower="loadMorePackage">
  193. <view class="option-item" v-for="(item, index) in packageList" :key="index"
  194. :class="{ active: tempPackageIndex === index }" @click="selectPackageItem(index)">
  195. <text>{{ item.num }} - {{ item.name }}</text>
  196. <icon type="success_no_circle" size="16" color="#C1001C" v-if="tempPackageIndex === index">
  197. </icon>
  198. </view>
  199. <view class="loading-tip" v-if="packageLoading && packageHasMore">
  200. <text class="loading-text">加载中...</text>
  201. </view>
  202. <view class="loading-tip" v-if="!packageHasMore && packageList.length > 0">
  203. <text class="loading-text">已加载全部</text>
  204. </view>
  205. </scroll-view>
  206. </view>
  207. </view>
  208. </view>
  209. </template>
  210. <script>
  211. import ErpNavBar from '@/components/erp-nav-bar.vue';
  212. import { listPageColor } from '@/api/erp/color.js';
  213. import { listPagePack } from '@/api/erp/pack.js';
  214. import { listPageModel } from '@/api/erp/model.js';
  215. import { addOrderDetail } from '@/api/erp/orderDetail.js';
  216. export default {
  217. components: { ErpNavBar },
  218. data() {
  219. return {
  220. showTypePicker: false, showSurfacePicker: false, showPackagePicker: false,
  221. tempSelectedIndex: -1, tempSurfaceIndex: -1, tempPackageIndex: -1,
  222. typeList: [],
  223. surfaceList: [],
  224. packageList: [],
  225. // 搜索关键词
  226. typeSearchKey: '', surfaceSearchKey: '', packageSearchKey: '',
  227. // 防抖定时器
  228. typeSearchTimer: null, surfaceSearchTimer: null, packageSearchTimer: null,
  229. // 分页参数
  230. typePageNum: 1, typePageSize: 20, typeHasMore: true, typeLoading: false,
  231. surfacePageNum: 1, surfacePageSize: 20, surfaceHasMore: true, surfaceLoading: false,
  232. packagePageNum: 1, packagePageSize: 20, packageHasMore: true, packageLoading: false,
  233. formData: {
  234. type: '', modelId: '', name: '', material: '',
  235. surfaceName: '', surfaceId: '', packageMethod: '', packageId: '', length: '',
  236. wallThickness: '', count: ''
  237. }
  238. }
  239. },
  240. async onLoad() {
  241. await Promise.all([
  242. this.loadModels(),
  243. this.loadSurfaceKinds(),
  244. this.loadPackageMethods()
  245. ]);
  246. },
  247. methods: {
  248. async loadModels(pageNum = 1, keyword = '') {
  249. if (this.typeLoading) return;
  250. this.typeLoading = true;
  251. try {
  252. const res = await listPageModel({
  253. pageNum: pageNum,
  254. pageSize: this.typePageSize,
  255. name: keyword
  256. });
  257. const rows = res.rows || [];
  258. const total = res.total || 0;
  259. if (pageNum === 1) {
  260. this.typeList = rows;
  261. } else {
  262. this.typeList = [...this.typeList, ...rows];
  263. }
  264. this.typeHasMore = this.typeList.length < total;
  265. } catch (e) {
  266. uni.showToast({ title: e || '加载型号失败', icon: 'none' });
  267. } finally {
  268. this.typeLoading = false;
  269. }
  270. },
  271. async loadSurfaceKinds(pageNum = 1, keyword = '') {
  272. if (this.surfaceLoading) return;
  273. this.surfaceLoading = true;
  274. try {
  275. const res = await listPageColor({
  276. pageNum: pageNum,
  277. pageSize: this.surfacePageSize,
  278. name: keyword
  279. });
  280. let rows = res.rows || [];
  281. const total = res.total || 0;
  282. rows = rows.filter(item => item.name);
  283. if (pageNum === 1) {
  284. this.surfaceList = rows;
  285. } else {
  286. this.surfaceList = [...this.surfaceList, ...rows];
  287. }
  288. this.surfaceHasMore = this.surfaceList.length < total;
  289. } catch (e) {
  290. uni.showToast({ title: e || '加载表面处理失败', icon: 'none' });
  291. } finally {
  292. this.surfaceLoading = false;
  293. }
  294. },
  295. async loadPackageMethods(pageNum = 1, keyword = '') {
  296. if (this.packageLoading) return;
  297. this.packageLoading = true;
  298. try {
  299. const res = await listPagePack({
  300. pageNum: pageNum,
  301. pageSize: this.packagePageSize,
  302. name: keyword
  303. });
  304. const rows = res.rows || [];
  305. const total = res.total || 0;
  306. if (pageNum === 1) {
  307. this.packageList = rows;
  308. } else {
  309. this.packageList = [...this.packageList, ...rows];
  310. }
  311. this.packageHasMore = this.packageList.length < total;
  312. } catch (e) {
  313. uni.showToast({ title: e || '加载包装方式失败', icon: 'none' });
  314. } finally {
  315. this.packageLoading = false;
  316. }
  317. },
  318. loadMoreType() {
  319. if (this.typeHasMore && !this.typeLoading) {
  320. this.typePageNum++;
  321. this.loadModels(this.typePageNum, this.typeSearchKey);
  322. }
  323. },
  324. loadMoreSurface() {
  325. if (this.surfaceHasMore && !this.surfaceLoading) {
  326. this.surfacePageNum++;
  327. this.loadSurfaceKinds(this.surfacePageNum, this.surfaceSearchKey);
  328. }
  329. },
  330. loadMorePackage() {
  331. if (this.packageHasMore && !this.packageLoading) {
  332. this.packagePageNum++;
  333. this.loadPackageMethods(this.packagePageNum, this.packageSearchKey);
  334. }
  335. },
  336. onScrollToLower() {
  337. // 主页面滚动触底,可根据需要添加更多逻辑
  338. },
  339. /**
  340. * 型号搜索(防抖)
  341. * @Author: Antigravity
  342. */
  343. onTypeSearch() {
  344. if (this.typeSearchTimer) clearTimeout(this.typeSearchTimer);
  345. this.typeSearchTimer = setTimeout(() => {
  346. this.typePageNum = 1;
  347. this.loadModels(1, this.typeSearchKey);
  348. }, 300);
  349. },
  350. /**
  351. * 表面处理搜索(防抖)
  352. * @Author: Antigravity
  353. */
  354. onSurfaceSearch() {
  355. if (this.surfaceSearchTimer) clearTimeout(this.surfaceSearchTimer);
  356. this.surfaceSearchTimer = setTimeout(() => {
  357. this.surfacePageNum = 1;
  358. this.loadSurfaceKinds(1, this.surfaceSearchKey);
  359. }, 300);
  360. },
  361. /**
  362. * 包装方式搜索(防抖)
  363. * @Author: Antigravity
  364. */
  365. onPackageSearch() {
  366. if (this.packageSearchTimer) clearTimeout(this.packageSearchTimer);
  367. this.packageSearchTimer = setTimeout(() => {
  368. this.packagePageNum = 1;
  369. this.loadPackageMethods(1, this.packageSearchKey);
  370. }, 300);
  371. },
  372. openTypePicker() {
  373. if (this.formData.type) {
  374. this.tempSelectedIndex = this.typeList.findIndex(item => item.num === this.formData.type);
  375. } else {
  376. this.tempSelectedIndex = -1;
  377. }
  378. this.showTypePicker = true;
  379. },
  380. closeTypePicker() {
  381. this.showTypePicker = false;
  382. this.typeSearchKey = '';
  383. this.typePageNum = 1;
  384. },
  385. selectTypeItem(index) { this.tempSelectedIndex = index; },
  386. confirmTypeSelect() {
  387. if (this.tempSelectedIndex === -1) return;
  388. const item = this.typeList[this.tempSelectedIndex];
  389. this.formData.type = item.num;
  390. this.formData.modelId = item.rowId;
  391. this.formData.name = item.name;
  392. this.formData.material = '6063-T5';
  393. this.closeTypePicker();
  394. },
  395. openSurfacePicker() {
  396. if (this.formData.surfaceName) {
  397. this.tempSurfaceIndex = this.surfaceList.findIndex(item => item.name === this.formData.surfaceName);
  398. } else {
  399. this.tempSurfaceIndex = -1;
  400. }
  401. this.showSurfacePicker = true;
  402. },
  403. closeSurfacePicker() {
  404. this.showSurfacePicker = false;
  405. this.surfaceSearchKey = '';
  406. this.surfacePageNum = 1;
  407. },
  408. selectSurfaceItem(index) { this.tempSurfaceIndex = index; },
  409. confirmSurfaceSelect() {
  410. if (this.tempSurfaceIndex === -1) return;
  411. const item = this.surfaceList[this.tempSurfaceIndex];
  412. this.formData.surfaceName = item.name;
  413. this.formData.surfaceId = item.rowId;
  414. this.closeSurfacePicker();
  415. },
  416. openPackagePicker() {
  417. if (this.formData.packageMethod) {
  418. this.tempPackageIndex = this.packageList.findIndex(item => item.name === this.formData.packageMethod);
  419. } else {
  420. this.tempPackageIndex = -1;
  421. }
  422. this.showPackagePicker = true;
  423. },
  424. closePackagePicker() {
  425. this.showPackagePicker = false;
  426. this.packageSearchKey = '';
  427. this.packagePageNum = 1;
  428. },
  429. selectPackageItem(index) { this.tempPackageIndex = index; },
  430. confirmPackageSelect() {
  431. if (this.tempPackageIndex === -1) return;
  432. const item = this.packageList[this.tempPackageIndex];
  433. this.formData.packageMethod = item.name;
  434. this.formData.packageId = item.rowId;
  435. this.closePackagePicker();
  436. },
  437. async confirmAddModel() {
  438. const fields = [
  439. { key: 'type', label: '型号' },
  440. { key: 'surfaceName', label: '表面名称' },
  441. { key: 'packageMethod', label: '包装方式' },
  442. { key: 'length', label: '长度' },
  443. { key: 'wallThickness', label: '壁厚' },
  444. { key: 'count', label: '支数' }
  445. ];
  446. for (let item of fields) {
  447. if (!this.formData[item.key]) {
  448. uni.showToast({ title: `请完善项目:${item.label}`, icon: 'none' });
  449. return;
  450. }
  451. }
  452. const finalData = {
  453. orderId: null,
  454. modelId: this.formData.modelId,
  455. modelNum: this.formData.type,
  456. modelName: this.formData.name,
  457. material: this.formData.material,
  458. surfaceId: this.formData.surfaceId,
  459. surfaceName: this.formData.surfaceName,
  460. packId: this.formData.packageId,
  461. packName: this.formData.packageMethod,
  462. length: parseFloat(this.formData.length || 0).toFixed(4),
  463. wallThickness: parseFloat(this.formData.wallThickness || 0).toFixed(4),
  464. count: parseInt(this.formData.count || 0)
  465. };
  466. uni.showLoading({ title: '正在保存...' });
  467. try {
  468. await addOrderDetail(finalData);
  469. uni.hideLoading();
  470. uni.showToast({ title: '添加成功', icon: 'success' });
  471. uni.$emit('add_order_item', finalData);
  472. setTimeout(() => {
  473. uni.navigateBack();
  474. }, 1000);
  475. } catch (e) {
  476. uni.hideLoading();
  477. uni.showToast({ title: e || '添加失败', icon: 'none' });
  478. }
  479. }
  480. }
  481. }
  482. </script>
  483. <style scoped>
  484. /deep/ ::-webkit-scrollbar {
  485. display: none !important;
  486. width: 0 !important;
  487. height: 0 !important;
  488. }
  489. .order-container {
  490. width: 100%;
  491. height: 100vh;
  492. background: #f7f8fa;
  493. display: flex;
  494. flex-direction: column;
  495. overflow: hidden;
  496. }
  497. .order-scroll {
  498. flex: 1;
  499. height: 0;
  500. }
  501. .form-content {
  502. padding: 30rpx;
  503. padding-bottom: calc(180rpx + env(safe-area-inset-bottom));
  504. }
  505. .section-card {
  506. background: #fff;
  507. border-radius: 24rpx;
  508. padding: 30rpx;
  509. margin-bottom: 30rpx;
  510. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.02);
  511. }
  512. .section-header {
  513. display: flex;
  514. align-items: center;
  515. margin-bottom: 40rpx;
  516. }
  517. .blue-bar {
  518. width: 8rpx;
  519. height: 32rpx;
  520. background: #C1001C;
  521. border-radius: 4rpx;
  522. margin-right: 16rpx;
  523. }
  524. .section-title {
  525. font-size: 32rpx;
  526. font-weight: bold;
  527. color: #333;
  528. }
  529. .form-item {
  530. margin-bottom: 40rpx;
  531. }
  532. .no-margin-bottom {
  533. margin-bottom: 0;
  534. }
  535. .row-flex {
  536. display: flex;
  537. justify-content: space-between;
  538. }
  539. .half-item {
  540. width: 48%;
  541. }
  542. .label {
  543. font-size: 28rpx;
  544. color: #333;
  545. margin-bottom: 20rpx;
  546. display: block;
  547. font-weight: 500;
  548. }
  549. .label.required::after {
  550. content: ' *';
  551. color: #ff4d4f;
  552. font-weight: bold;
  553. margin-left: 4rpx;
  554. }
  555. .picker-box {
  556. background: #f9fafc;
  557. border-radius: 12rpx;
  558. height: 100rpx;
  559. border: 1rpx solid #eee;
  560. display: flex;
  561. align-items: center;
  562. }
  563. .picker-inner {
  564. width: 100%;
  565. height: 100%;
  566. display: flex;
  567. align-items: center;
  568. justify-content: space-between;
  569. padding: 0 30rpx;
  570. box-sizing: border-box;
  571. }
  572. .picker-val {
  573. font-size: 30rpx;
  574. color: #333;
  575. }
  576. .picker-val.placeholder {
  577. color: #ccc;
  578. font-size: 28rpx;
  579. }
  580. .line-arrow-down {
  581. width: 14rpx;
  582. height: 14rpx;
  583. border-right: 3rpx solid #bbb;
  584. border-bottom: 3rpx solid #bbb;
  585. transform: rotate(45deg);
  586. margin-top: -8rpx;
  587. margin-right: 4rpx;
  588. }
  589. .input-wrap {
  590. position: relative;
  591. width: 100%;
  592. }
  593. .input-box {
  594. font-size: 30rpx;
  595. color: #333;
  596. width: 100%;
  597. height: 100rpx;
  598. background: #f9fafc;
  599. border-radius: 12rpx;
  600. padding: 0 80rpx 0 30rpx;
  601. box-sizing: border-box;
  602. border: 1rpx solid #eee;
  603. }
  604. .input-box.readonly {
  605. background: #f8f9fa;
  606. color: #666;
  607. border-color: #f0f0f0;
  608. }
  609. .input-box.full-width {
  610. padding: 0 30rpx;
  611. }
  612. .unit {
  613. position: absolute;
  614. right: 24rpx;
  615. top: 50%;
  616. transform: translateY(-50%);
  617. font-size: 26rpx;
  618. color: #999;
  619. font-weight: 500;
  620. }
  621. .small-font {
  622. font-size: 26rpx !important;
  623. }
  624. .fixed-submit-bar {
  625. position: fixed;
  626. bottom: 0;
  627. left: 0;
  628. width: 100%;
  629. background: #fff;
  630. padding: 20rpx 30rpx calc(env(safe-area-inset-bottom) + 20rpx);
  631. box-sizing: border-box;
  632. box-shadow: 0 -10rpx 30rpx rgba(0, 0, 0, 0.05);
  633. z-index: 100;
  634. }
  635. .submit-btn {
  636. background: #C1001C;
  637. color: #fff;
  638. height: 100rpx;
  639. border-radius: 50rpx;
  640. display: flex;
  641. align-items: center;
  642. justify-content: center;
  643. font-size: 34rpx;
  644. font-weight: bold;
  645. border: none;
  646. }
  647. .submit-btn:active {
  648. opacity: 0.9;
  649. transform: scale(0.98);
  650. }
  651. .custom-picker-mask {
  652. position: fixed;
  653. top: 0;
  654. left: 0;
  655. right: 0;
  656. bottom: 0;
  657. background: rgba(0, 0, 0, 0.4);
  658. z-index: 1000;
  659. display: flex;
  660. align-items: flex-end;
  661. }
  662. .picker-popup {
  663. width: 100%;
  664. background: #fff;
  665. border-radius: 32rpx 32rpx 0 0;
  666. padding-bottom: calc(env(safe-area-inset-bottom) + 20rpx);
  667. animation: slideUp 0.15s ease-out;
  668. }
  669. @keyframes slideUp {
  670. from {
  671. transform: translateY(100%);
  672. }
  673. to {
  674. transform: translateY(0);
  675. }
  676. }
  677. .popup-header {
  678. display: flex;
  679. justify-content: space-between;
  680. align-items: center;
  681. padding: 30rpx 40rpx;
  682. border-bottom: 1rpx solid #f0f0f0;
  683. }
  684. .popup-title {
  685. font-size: 32rpx;
  686. font-weight: bold;
  687. color: #333;
  688. }
  689. .cancel-text,
  690. .confirm-text {
  691. font-size: 30rpx;
  692. padding: 10rpx;
  693. }
  694. .confirm-text {
  695. color: #C1001C;
  696. font-weight: bold;
  697. }
  698. .item-list {
  699. max-height: 50vh;
  700. padding: 0 40rpx;
  701. }
  702. /* 搜索栏样式 */
  703. .search-bar {
  704. padding: 16rpx 40rpx;
  705. border-bottom: 1rpx solid #f0f0f0;
  706. }
  707. .search-input-wrap {
  708. display: flex;
  709. align-items: center;
  710. background: #f5f6f8;
  711. border-radius: 32rpx;
  712. padding: 12rpx 24rpx;
  713. }
  714. .search-icon {
  715. font-size: 28rpx;
  716. margin-right: 12rpx;
  717. }
  718. .search-input {
  719. flex: 1;
  720. font-size: 26rpx;
  721. color: #333;
  722. height: 56rpx;
  723. }
  724. .option-item {
  725. height: 110rpx;
  726. display: flex;
  727. align-items: center;
  728. justify-content: space-between;
  729. border-bottom: 1rpx solid #f8f8f8;
  730. font-size: 32rpx;
  731. color: #333;
  732. }
  733. .option-item.active {
  734. color: #C1001C;
  735. font-weight: bold;
  736. }
  737. .loading-tip {
  738. padding: 20rpx 0;
  739. text-align: center;
  740. }
  741. .loading-text {
  742. font-size: 26rpx;
  743. color: #999;
  744. }
  745. .bottom-placeholder {
  746. height: 60rpx;
  747. }
  748. </style>