index.vue 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565
  1. <template>
  2. <view class="order-container">
  3. <erp-nav-bar title="ERP 下单" />
  4. <!-- 0. 全屏加载过渡 -->
  5. <view class="loading-state-full" v-if="isLoading">
  6. <view class="loading-anim-box">
  7. <view class="dot-spinner">
  8. <view class="dot"></view>
  9. <view class="dot"></view>
  10. <view class="dot"></view>
  11. </view>
  12. <text class="loading-text">正在同步 ERP 数据...</text>
  13. </view>
  14. </view>
  15. <!-- 1. 未登录状态 -->
  16. <view class="auth-waiting-full" v-else-if="!isLoggedIn">
  17. <view class="auth-card">
  18. <image class="auth-icon" src="https://img.icons8.com/color/192/hourglass-sand-top.png" mode="aspectFit">
  19. </image>
  20. <text class="auth-title">未登录</text>
  21. <text class="auth-desc">您还未登录账号,请先登录以后在进行下单操作</text>
  22. <button class="contact-btn" @click="goToLogin">前往登录</button>
  23. </view>
  24. </view>
  25. <!-- 2. 已登录但未分配授权客户 -->
  26. <view class="auth-waiting-full" v-else-if="!myInfo.authClientFRowIDs">
  27. <view class="auth-card">
  28. <image class="auth-icon" src="https://img.icons8.com/color/192/hourglass-sand-top.png" mode="aspectFit">
  29. </image>
  30. <text class="auth-title">待管理员授权</text>
  31. <text class="auth-desc">您的账户尚未获得下单权限,请联系管理员核准授权后即可进行下单操作。</text>
  32. <button class="contact-btn" @click="contactAdmin">联系管理员</button>
  33. </view>
  34. </view>
  35. <!-- 2.5 已授权但未选择客户:客户选择页 -->
  36. <view class="client-pick-full" v-else-if="waitingClientPick">
  37. <view class="pick-card">
  38. <text class="pick-title">选择下单客户</text>
  39. <text class="pick-desc">请选择本次下单的客户</text>
  40. <view class="pick-list">
  41. <view class="pick-item" v-for="(c, i) in myInfo.authClientList" :key="c.rowId || i"
  42. @click="selectClient(c)">
  43. <view class="pick-index">{{ i + 1 }}</view>
  44. <view class="pick-info">
  45. <text class="pick-name">{{ c.name || '-' }}</text>
  46. <text class="pick-code" v-if="c.num">{{ c.num }}</text>
  47. </view>
  48. <view class="pick-arrow">›</view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. <!-- 3. 已登录且已分配授权客户:显示下单页面 -->
  54. <template v-else>
  55. <scroll-view scroll-y class="order-scroll-list" :show-scrollbar="false" :enhanced="true">
  56. <view class="list-wrapper">
  57. <!-- 已选客户信息 -->
  58. <view class="client-info-bar" v-if="selectedClientName">
  59. <text class="client-label">下单客户:</text>
  60. <text class="client-name-text">{{ selectedClientName }}</text>
  61. </view>
  62. <!-- 列表头部:仅在有数据时显示 -->
  63. <view class="list-header" v-if="selectedModels.length > 0">
  64. <view class="header-left">
  65. <text class="header-text" v-if="!batchMode">已选型号列表:</text>
  66. <text class="header-text" v-else>批量修改({{ selectedIds.length }}/{{ selectedModels.length
  67. }})</text>
  68. <view class="select-all-toggle" v-if="batchMode" @click="toggleSelectAll">
  69. <text class="select-all-icon" :class="{ checked: isAllSelected }">☐</text>
  70. <text class="select-all-text">{{ isAllSelected ? '取消全选' : '全选' }}</text>
  71. </view>
  72. </view>
  73. <view class="batch-toggle" :class="{ active: batchMode }" @click="toggleBatchMode">
  74. <text>{{ batchMode ? '退出' : '批量修改' }}</text>
  75. </view>
  76. </view>
  77. <!-- 1. 列表渲染 (精品化设计) -->
  78. <view class="model-item-card" v-for="(item, index) in selectedModels" :key="index"
  79. v-if="selectedModels.length > 0"
  80. :class="{ 'batch-mode-card': batchMode, 'batch-selected': batchMode && isSelected(item.rowId) }">
  81. <view class="batch-checkbox" v-if="batchMode" @click.stop="toggleSelect(item.rowId)">
  82. <view class="checkbox-circle" :class="{ checked: isSelected(item.rowId) }">
  83. <text class="check-icon" v-if="isSelected(item.rowId)">✓</text>
  84. </view>
  85. </view>
  86. <view class="card-body" @click="batchMode ? toggleSelect(item.rowId) : editItem(index, item)">
  87. <view class="remove-icon" @click.stop="removeItem(index)">
  88. <text class="x-icon">×</text>
  89. </view>
  90. <view class="card-line">
  91. <view class="model-info">
  92. <text class="model-value">{{ item.modelNum }}</text>
  93. </view>
  94. <view class="count-tag">
  95. 支数<text class="count-num">{{ item.count }}</text>
  96. </view>
  97. </view>
  98. <view class="card-line secondary">
  99. <text class="surface-label">表面名称:</text>
  100. <text class="surface-text">{{ item.surfaceName }}</text>
  101. </view>
  102. </view>
  103. </view>
  104. <!-- 2. 全屏缺省状态:美化后的引导页 -->
  105. <view class="empty-state-full" v-else>
  106. <view class="empty-visual">
  107. <image class="empty-img" src="https://img.icons8.com/clouds/200/shopping-cart.png"
  108. mode="aspectFit"></image>
  109. <view class="empty-bg-glow"></view>
  110. </view>
  111. <text class="empty-title">暂无已选型号</text>
  112. <button class="empty-action-btn" @click="goToAddModel">选型下单</button>
  113. </view>
  114. <view class="bottom-safe-space"></view>
  115. </view>
  116. </scroll-view>
  117. <!-- 悬浮添加按钮 (仅在有数据时且非批量模式显示) -->
  118. <view class="floating-add-btn" @click="goToAddModel" v-if="selectedModels.length > 0 && !batchMode">
  119. <view class="plus-icon"></view>
  120. </view>
  121. <!-- 批量操作栏(批量模式下常驻) -->
  122. <view class="batch-action-bar" v-if="batchMode">
  123. <view class="batch-count" v-if="selectedIds.length > 0">已选 {{ selectedIds.length }} 项</view>
  124. <view class="batch-count placeholder" v-else>请勾选型号</view>
  125. <view class="batch-btns">
  126. <button class="batch-btn surface-btn" :disabled="selectedIds.length === 0"
  127. @click="openBatchSurfacePicker">批量修改表面</button>
  128. <button class="batch-btn pack-btn" :disabled="selectedIds.length === 0"
  129. @click="openBatchPackPicker">批量修改包装</button>
  130. </view>
  131. </view>
  132. <!-- 底部支付/下单汇总栏 (仅在有数据时且非批量模式显示) -->
  133. <view class="footer-summary-bar" v-if="selectedModels.length > 0 && !batchMode">
  134. <view class="summary-info">
  135. <text class="count-label">共计:</text>
  136. <text class="num-highlight">{{ selectedModels.length }}</text>
  137. <text class="unit">条</text>
  138. <view class="split-line"></view>
  139. <text class="num-highlight green">{{ totalCount }}</text>
  140. <text class="unit">支</text>
  141. </view>
  142. <button class="submit-order-btn" :disabled="selectedModels.length === 0"
  143. @click="submitFinalOrder">立即下单</button>
  144. </view>
  145. </template>
  146. <!-- 批量修改 - 表面处理选择弹层 -->
  147. <view class="custom-picker-mask" v-if="showBatchSurfacePicker" @click="showBatchSurfacePicker = false"
  148. @touchmove.stop.prevent>
  149. <view class="picker-popup" @click.stop>
  150. <view class="popup-header">
  151. <text class="cancel-text" @click="showBatchSurfacePicker = false">取消</text>
  152. <text class="popup-title">选择表面处理</text>
  153. <text class="confirm-text" @click="confirmBatchSurface">确定</text>
  154. </view>
  155. <!-- 搜索栏 -->
  156. <view class="search-bar">
  157. <view class="search-input-wrap">
  158. <text class="search-icon">🔍</text>
  159. <input class="search-input" type="text" v-model="batchSurfaceSearchKey" placeholder="输入名称检索"
  160. @input="onBatchSurfaceSearch" />
  161. </view>
  162. </view>
  163. <!-- 层级面包屑 -->
  164. <view class="breadcrumb-bar" v-if="batchSurfaceLevel > 1">
  165. <text class="back-btn" @click="goBackBatchSurfaceLevel">← 返回</text>
  166. <text class="breadcrumb-path">{{batchSurfaceBreadcrumbs.map(b => b.label).join(' / ')}}</text>
  167. </view>
  168. <!-- 列表区 -->
  169. <scroll-view scroll-y class="item-list">
  170. <view class="option-item kind-item" v-for="(item, index) in batchSurfaceKindList"
  171. :key="'bsk' + index" @click="drillDownBatchSurface(item)">
  172. <text class="option-text kind-text">{{ item.num }} - {{ item.name }}</text>
  173. <text class="arrow-right">›</text>
  174. </view>
  175. <view class="option-item" v-for="item in batchSurfaceItemList" :key="'bsi' + item.rowId"
  176. :class="{ active: batchSurfaceId === item.rowId }">
  177. <text class="option-text" @click="selectBatchSurfaceItem(item)">{{ item.num }} - {{ item.name
  178. }}</text>
  179. </view>
  180. </scroll-view>
  181. </view>
  182. </view>
  183. <!-- 批量修改 - 包装方式选择弹层 -->
  184. <view class="custom-picker-mask" v-if="showBatchPackPicker" @click="showBatchPackPicker = false"
  185. @touchmove.stop.prevent>
  186. <view class="picker-popup" @click.stop>
  187. <view class="popup-header">
  188. <text class="cancel-text" @click="showBatchPackPicker = false">取消</text>
  189. <text class="popup-title">选择包装方式</text>
  190. <text class="confirm-text" @click="confirmBatchPack">确定</text>
  191. </view>
  192. <view class="search-bar">
  193. <view class="search-input-wrap">
  194. <text class="search-icon">🔍</text>
  195. <input class="search-input" type="text" v-model="batchPackSearchKey" placeholder="输入名称检索"
  196. @input="onBatchPackSearch" />
  197. </view>
  198. </view>
  199. <scroll-view scroll-y class="item-list" @scrolltolower="loadMorePackBatch">
  200. <view class="option-item" v-for="item in batchPackList" :key="item.rowId"
  201. :class="{ active: batchPackId === item.rowId }"
  202. @click="batchPackId = item.rowId; batchPackName = item.name">
  203. <text>{{ item.num }} - {{ item.name }}</text>
  204. <icon type="success_no_circle" size="16" color="#C1001C" v-if="batchPackId === item.rowId">
  205. </icon>
  206. </view>
  207. </scroll-view>
  208. </view>
  209. </view>
  210. <order-confirm-popup :visible="showConfirmPopup" :models="selectedModels" :clientName="confirmClientName"
  211. :submitting="confirmSubmitting" @confirm="handleConfirmOrder" @close="showConfirmPopup = false" />
  212. </view>
  213. </template>
  214. <script>
  215. import ErpNavBar from '@/components/erp-nav-bar.vue';
  216. import OrderConfirmPopup from './components/order-confirm-popup.vue';
  217. import { getMyInfo } from '@/api/system/employee.js';
  218. import { getClientByIds } from '@/api/erp/client.js';
  219. import { listOrderDetail, batchUpdateOrderDetail } from '@/api/erp/orderDetail.js';
  220. import { listColor } from '@/api/erp/color.js';
  221. import { listColorKind } from '@/api/erp/colorKind.js';
  222. import { listPagePack } from '@/api/erp/pack.js';
  223. import { addOrder } from '@/api/erp/order.js';
  224. export default {
  225. components: { ErpNavBar, OrderConfirmPopup },
  226. data() {
  227. return {
  228. isLoggedIn: false,
  229. isLoading: true,
  230. myInfo: {},
  231. selectedModels: [],
  232. selectedClientId: '',
  233. selectedClientName: '',
  234. waitingClientPick: false,
  235. clientIdParam: '',
  236. clientNameParam: '',
  237. // 批量修改相关
  238. batchMode: false,
  239. selectedIds: [],
  240. // 表面处理选择器
  241. showBatchSurfacePicker: false,
  242. batchSurfaceId: '',
  243. batchSurfaceName: '',
  244. batchSurfaceSearchKey: '',
  245. batchSurfaceBreadcrumbs: [],
  246. batchSurfaceLevel: 1,
  247. batchSurfaceKindList: [],
  248. batchSurfaceItemList: [],
  249. // 包装方式选择器
  250. showBatchPackPicker: false,
  251. batchPackList: [],
  252. batchPackPageNum: 1,
  253. batchPackHasMore: true,
  254. batchPackLoading: false,
  255. batchPackId: '',
  256. batchPackName: '',
  257. batchPackSearchKey: '',
  258. batchPackSearchTimer: null,
  259. showConfirmPopup: false,
  260. confirmClientId: '',
  261. confirmClientName: '',
  262. confirmSubmitting: false
  263. }
  264. },
  265. computed: {
  266. totalCount() {
  267. return this.selectedModels.reduce((sum, item) => sum + parseInt(item.count || 0), 0);
  268. },
  269. isAllSelected() {
  270. return this.selectedModels.length > 0 && this.selectedIds.length === this.selectedModels.length;
  271. }
  272. },
  273. onLoad(options) {
  274. if (options.clientId) this.clientIdParam = options.clientId;
  275. if (options.clientName) this.clientNameParam = decodeURIComponent(options.clientName);
  276. uni.$on('add_order_item', (data) => {
  277. this.loadOrderItems(false);
  278. });
  279. uni.$on('update_order_item', (res) => {
  280. this.loadOrderItems(false);
  281. });
  282. },
  283. onShow() {
  284. this.checkLoginStatus();
  285. },
  286. onUnload() {
  287. uni.$off('add_order_item');
  288. uni.$off('update_order_item');
  289. },
  290. methods: {
  291. /**
  292. * 加载已选型号列表(OrderID 为空的草稿)
  293. * @Author: Antigravity
  294. */
  295. async loadOrderItems(showFullLoading = true) {
  296. if (showFullLoading) this.isLoading = true;
  297. try {
  298. const res = await listOrderDetail({ orderId: '' });
  299. this.selectedModels = res.data || [];
  300. } catch (e) {
  301. console.error('加载型号列表失败', e);
  302. uni.showToast({ title: e || '加载型号列表失败', icon: 'none' });
  303. } finally {
  304. this.isLoading = false;
  305. }
  306. },
  307. async checkLoginStatus() {
  308. const token = uni.getStorageSync('token');
  309. if (!token) {
  310. this.isLoggedIn = false;
  311. this.myInfo = {};
  312. this.selectedClientId = '';
  313. this.selectedClientName = '';
  314. this.waitingClientPick = false;
  315. this.isLoading = false;
  316. return;
  317. }
  318. try {
  319. const res = await getMyInfo();
  320. this.isLoggedIn = true;
  321. const info = res.data || {};
  322. if (info.authClientFRowIDs) {
  323. try {
  324. const clientRes = await getClientByIds(info.authClientFRowIDs);
  325. info.authClientList = clientRes.data || [];
  326. } catch (e) {
  327. console.error('加载授权客户失败', e);
  328. info.authClientList = [];
  329. }
  330. } else {
  331. info.authClientList = [];
  332. }
  333. this.myInfo = info;
  334. this.resolveClient();
  335. this.loadOrderItems();
  336. } catch (e) {
  337. uni.showToast({ title: e || '登录状态校验失败', icon: 'none' });
  338. uni.removeStorageSync('token');
  339. uni.removeStorageSync('isLogin');
  340. this.isLoggedIn = false;
  341. this.myInfo = {};
  342. this.selectedClientId = '';
  343. this.selectedClientName = '';
  344. this.waitingClientPick = false;
  345. this.isLoading = false;
  346. }
  347. },
  348. resolveClient() {
  349. const clientList = this.myInfo.authClientList || [];
  350. if (clientList.length === 0) {
  351. this.waitingClientPick = false;
  352. return;
  353. }
  354. if (this.clientIdParam) {
  355. const matched = clientList.find(c => c.rowId === this.clientIdParam);
  356. if (matched) {
  357. this.selectedClientId = matched.rowId;
  358. this.selectedClientName = matched.name;
  359. this.waitingClientPick = false;
  360. return;
  361. }
  362. }
  363. if (clientList.length === 1) {
  364. this.selectedClientId = clientList[0].rowId;
  365. this.selectedClientName = clientList[0].name;
  366. this.waitingClientPick = false;
  367. } else {
  368. this.waitingClientPick = true;
  369. }
  370. },
  371. selectClient(client) {
  372. this.selectedClientId = client.rowId;
  373. this.selectedClientName = client.name;
  374. this.waitingClientPick = false;
  375. },
  376. goToLogin() {
  377. uni.reLaunch({ url: '/pages/login/index' });
  378. },
  379. contactAdmin() { uni.showModal({ title: '联系管理员', content: '管理员电话:138-0000-0000', showCancel: false, confirmColor: '#C1001C' }); },
  380. goToAddModel() {
  381. uni.navigateTo({
  382. url: '/pages/order/add-model/index'
  383. });
  384. },
  385. editItem(index, item) {
  386. uni.navigateTo({
  387. url: `/pages/order/edit-model/index?index=${index}&data=${encodeURIComponent(JSON.stringify(item))}`
  388. });
  389. },
  390. removeItem(index) {
  391. const self = this;
  392. uni.showModal({
  393. title: '提示',
  394. content: '确定移除该型号吗?',
  395. success: (res) => {
  396. if (res.confirm) {
  397. self.selectedModels.splice(index, 1);
  398. }
  399. }
  400. });
  401. },
  402. /**
  403. * 切换全选 / 取消全选
  404. * @Author: Trae
  405. */
  406. toggleSelectAll() {
  407. if (this.isAllSelected) {
  408. this.selectedIds = [];
  409. } else {
  410. this.selectedIds = this.selectedModels.map(item => item.rowId);
  411. }
  412. },
  413. /**
  414. * 切换批量修改模式
  415. * @Author: Trae
  416. */
  417. toggleBatchMode() {
  418. this.batchMode = !this.batchMode;
  419. if (!this.batchMode) {
  420. this.selectedIds = [];
  421. }
  422. },
  423. /**
  424. * 切换选中状态
  425. * @Author: Trae
  426. */
  427. toggleSelect(rowId) {
  428. const idx = this.selectedIds.indexOf(rowId);
  429. if (idx > -1) {
  430. this.selectedIds.splice(idx, 1);
  431. } else {
  432. this.selectedIds.push(rowId);
  433. }
  434. },
  435. /**
  436. * 判断是否已选中
  437. * @Author: Trae
  438. */
  439. isSelected(rowId) {
  440. return this.selectedIds.indexOf(rowId) > -1;
  441. },
  442. /**
  443. * 打开批量修改表面处理选择器(二级级联)
  444. * @Author: Trae
  445. */
  446. openBatchSurfacePicker() {
  447. if (this.selectedIds.length === 0) {
  448. uni.showToast({ title: '请先选择型号', icon: 'none' });
  449. return;
  450. }
  451. this.showBatchSurfacePicker = true;
  452. this.batchSurfaceId = '';
  453. this.batchSurfaceName = '';
  454. this.batchSurfaceSearchKey = '';
  455. this.batchSurfaceLevel = 1;
  456. this.batchSurfaceBreadcrumbs = [];
  457. this.loadBatchSurfaceList('');
  458. },
  459. /**
  460. * 加载表面处理系列,点击系列后同时加载子系列和具体颜色(批量选择器)
  461. * @Author: Trae
  462. */
  463. async loadBatchSurfaceList(parentRowId) {
  464. try {
  465. const keyword = (this.batchSurfaceSearchKey || '').trim();
  466. const kindParams = { name: keyword || undefined };
  467. if (parentRowId) {
  468. kindParams.parentRowId = parentRowId;
  469. }
  470. const kindRes = await listColorKind(kindParams);
  471. this.batchSurfaceKindList = kindRes.data || [];
  472. if (parentRowId) {
  473. const colorParams = { name: keyword || undefined, parentRowId };
  474. const colorRes = await listColor(colorParams);
  475. this.batchSurfaceItemList = colorRes.data || [];
  476. } else {
  477. this.batchSurfaceItemList = [];
  478. }
  479. } catch (e) {
  480. uni.showToast({ title: e || '加载表面处理失败', icon: 'none' });
  481. }
  482. },
  483. /**
  484. * 表面处理搜索
  485. * @Author: Trae
  486. */
  487. onBatchSurfaceSearch() {
  488. const parentRowId = this.batchSurfaceBreadcrumbs.length > 0
  489. ? this.batchSurfaceBreadcrumbs[this.batchSurfaceBreadcrumbs.length - 1].rowId : '';
  490. this.loadBatchSurfaceList(parentRowId);
  491. },
  492. selectBatchSurfaceItem(item) {
  493. this.batchSurfaceId = item.rowId;
  494. this.batchSurfaceName = item.name;
  495. },
  496. drillDownBatchSurface(item) {
  497. this.batchSurfaceBreadcrumbs.push({ rowId: item.rowId, label: item.num });
  498. this.batchSurfaceId = '';
  499. this.batchSurfaceName = '';
  500. this.batchSurfaceLevel++;
  501. this.loadBatchSurfaceList(item.rowId);
  502. },
  503. goBackBatchSurfaceLevel() {
  504. this.batchSurfaceBreadcrumbs.pop();
  505. this.batchSurfaceLevel--;
  506. this.batchSurfaceId = '';
  507. this.batchSurfaceName = '';
  508. const parentRowId = this.batchSurfaceBreadcrumbs.length > 0
  509. ? this.batchSurfaceBreadcrumbs[this.batchSurfaceBreadcrumbs.length - 1].rowId : '';
  510. this.loadBatchSurfaceList(parentRowId);
  511. },
  512. /**
  513. * 确认批量修改表面处理
  514. * @Author: Trae
  515. */
  516. async confirmBatchSurface() {
  517. if (!this.batchSurfaceId) {
  518. uni.showToast({ title: '请选择表面处理', icon: 'none' });
  519. return;
  520. }
  521. this.showBatchSurfacePicker = false;
  522. uni.showLoading({ title: '修改中...', mask: true });
  523. try {
  524. await batchUpdateOrderDetail({
  525. rowIds: this.selectedIds,
  526. surfaceId: this.batchSurfaceId,
  527. surfaceName: this.batchSurfaceName
  528. });
  529. uni.hideLoading();
  530. uni.showToast({ title: '修改成功', icon: 'success' });
  531. this.selectedIds = [];
  532. this.loadOrderItems(false);
  533. } catch (e) {
  534. uni.hideLoading();
  535. uni.showToast({ title: e || '修改失败', icon: 'none' });
  536. }
  537. this.batchSurfaceLevel = 1;
  538. this.batchSurfaceBreadcrumbs = [];
  539. this.batchSurfaceId = '';
  540. this.batchSurfaceName = '';
  541. },
  542. /**
  543. * 打开批量修改包装方式选择器
  544. * @Author: Trae
  545. */
  546. openBatchPackPicker() {
  547. if (this.selectedIds.length === 0) {
  548. uni.showToast({ title: '请先选择型号', icon: 'none' });
  549. return;
  550. }
  551. this.showBatchPackPicker = true;
  552. this.batchPackId = '';
  553. this.batchPackName = '';
  554. this.batchPackSearchKey = '';
  555. this.batchPackPageNum = 1;
  556. if (this.batchPackList.length === 0) {
  557. this.loadBatchPackList();
  558. }
  559. },
  560. /**
  561. * 加载包装方式列表(批量选择器)
  562. * @Author: Trae
  563. */
  564. async loadBatchPackList(pageNum = 1, keyword = '') {
  565. if (this.batchPackLoading) return;
  566. this.batchPackLoading = true;
  567. try {
  568. const res = await listPagePack({
  569. pageNum,
  570. pageSize: 10,
  571. name: keyword || undefined
  572. });
  573. const rows = res.rows || [];
  574. if (pageNum === 1) {
  575. this.batchPackList = rows;
  576. } else {
  577. this.batchPackList = [...this.batchPackList, ...rows];
  578. }
  579. this.batchPackHasMore = rows.length >= 20;
  580. } catch (e) {
  581. uni.showToast({ title: e || '加载包装方式失败', icon: 'none' });
  582. } finally {
  583. this.batchPackLoading = false;
  584. }
  585. },
  586. /**
  587. * 加载更多包装方式列表
  588. * @Author: Trae
  589. */
  590. loadMorePackBatch() {
  591. if (!this.batchPackHasMore || this.batchPackLoading) return;
  592. this.batchPackPageNum++;
  593. this.loadBatchPackList(this.batchPackPageNum, this.batchPackSearchKey);
  594. },
  595. /**
  596. * 包装方式搜索(防抖)
  597. * @Author: Trae
  598. */
  599. onBatchPackSearch() {
  600. if (this.batchPackSearchTimer) clearTimeout(this.batchPackSearchTimer);
  601. this.batchPackSearchTimer = setTimeout(() => {
  602. this.batchPackPageNum = 1;
  603. this.loadBatchPackList(1, this.batchPackSearchKey);
  604. }, 300);
  605. },
  606. /**
  607. * 确认批量修改包装方式
  608. * @Author: Trae
  609. */
  610. async confirmBatchPack() {
  611. if (!this.batchPackId) {
  612. uni.showToast({ title: '请选择包装方式', icon: 'none' });
  613. return;
  614. }
  615. this.showBatchPackPicker = false;
  616. uni.showLoading({ title: '修改中...', mask: true });
  617. try {
  618. await batchUpdateOrderDetail({
  619. rowIds: this.selectedIds,
  620. packId: this.batchPackId,
  621. packName: this.batchPackName
  622. });
  623. uni.hideLoading();
  624. uni.showToast({ title: '修改成功', icon: 'success' });
  625. this.selectedIds = [];
  626. this.loadOrderItems(false);
  627. } catch (e) {
  628. uni.hideLoading();
  629. uni.showToast({ title: e || '修改失败', icon: 'none' });
  630. }
  631. },
  632. /**
  633. * 提交最终订单 - 选择客户后弹出确认弹窗
  634. * @Author: Antigravity
  635. */
  636. async submitFinalOrder() {
  637. if (this.selectedModels.length === 0) return;
  638. if (!this.selectedClientId) {
  639. uni.showToast({ title: '请先选择下单客户', icon: 'none' });
  640. return;
  641. }
  642. this.confirmClientId = this.selectedClientId;
  643. this.confirmClientName = this.selectedClientName;
  644. this.showConfirmPopup = true;
  645. },
  646. /**
  647. * 确认弹窗回调 - 正式执行下单
  648. * @Author: Trae
  649. */
  650. async handleConfirmOrder() {
  651. this.confirmSubmitting = true;
  652. uni.showLoading({ title: '正在提交订单', mask: true });
  653. try {
  654. const detailIds = this.selectedModels.map(item => item.rowId);
  655. const submitRes = await addOrder({
  656. detailIds,
  657. clientId: this.confirmClientId,
  658. clientName: this.confirmClientName
  659. });
  660. uni.hideLoading();
  661. this.confirmSubmitting = false;
  662. this.showConfirmPopup = false;
  663. const orderId = submitRes.data;
  664. uni.showToast({ title: '下单成功', icon: 'success' });
  665. setTimeout(() => {
  666. uni.navigateTo({
  667. url: '/pages/order/success/index?orderId=' + orderId
  668. });
  669. }, 1500);
  670. } catch (e) {
  671. uni.hideLoading();
  672. this.confirmSubmitting = false;
  673. uni.showToast({ title: e || '下单失败', icon: 'none' });
  674. }
  675. }
  676. }
  677. }
  678. </script>
  679. <style scoped>
  680. /deep/ ::-webkit-scrollbar {
  681. display: none !important;
  682. width: 0 !important;
  683. height: 0 !important;
  684. }
  685. .order-container {
  686. width: 100%;
  687. height: 100vh;
  688. background: #f8fafc;
  689. display: flex;
  690. flex-direction: column;
  691. overflow: hidden;
  692. }
  693. /* 授权等待样式保持一致 */
  694. .auth-waiting-full {
  695. flex: 1;
  696. display: flex;
  697. flex-direction: column;
  698. align-items: center;
  699. justify-content: flex-start;
  700. padding: 200rpx 40rpx 40rpx;
  701. background: linear-gradient(180deg, rgba(0, 122, 255, 0.08) 0%, rgba(247, 248, 250, 1) 100%);
  702. }
  703. .auth-card {
  704. display: flex;
  705. flex-direction: column;
  706. align-items: center;
  707. text-align: center;
  708. }
  709. .auth-icon {
  710. width: 200rpx;
  711. height: 200rpx;
  712. margin-bottom: 50rpx;
  713. }
  714. .auth-title {
  715. font-size: 44rpx;
  716. font-weight: bold;
  717. color: #1a1a1a;
  718. margin-bottom: 24rpx;
  719. }
  720. .auth-desc {
  721. font-size: 28rpx;
  722. color: #666;
  723. line-height: 1.8;
  724. margin-bottom: 80rpx;
  725. padding: 0 20rpx;
  726. }
  727. .contact-btn {
  728. width: 360rpx;
  729. height: 96rpx;
  730. background: linear-gradient(135deg, #C1001C 0%, #FF4D4F 100%);
  731. color: #fff;
  732. border-radius: 48rpx;
  733. display: flex;
  734. align-items: center;
  735. justify-content: center;
  736. font-size: 32rpx;
  737. font-weight: bold;
  738. border: none;
  739. box-shadow: 0 12rpx 30rpx rgba(193, 0, 28, 0.2);
  740. }
  741. .authorized-btn {
  742. width: 360rpx;
  743. height: 96rpx;
  744. background: #fff;
  745. color: #C1001C;
  746. border-radius: 48rpx;
  747. display: flex;
  748. align-items: center;
  749. justify-content: center;
  750. font-size: 32rpx;
  751. font-weight: bold;
  752. border: 2rpx solid #C1001C;
  753. margin-top: 30rpx;
  754. }
  755. /* 客户选择页 */
  756. .client-pick-full {
  757. flex: 1;
  758. display: flex;
  759. flex-direction: column;
  760. align-items: center;
  761. padding: 80rpx 40rpx;
  762. background: #f7f8fa;
  763. }
  764. .pick-card {
  765. width: 100%;
  766. max-width: 680rpx;
  767. background: #fff;
  768. border-radius: 24rpx;
  769. padding: 48rpx 36rpx 36rpx;
  770. box-shadow: 0 4rpx 24rpx rgba(0, 0, 0, 0.04);
  771. }
  772. .pick-title {
  773. display: block;
  774. font-size: 36rpx;
  775. font-weight: 700;
  776. color: #1a1a1a;
  777. text-align: center;
  778. margin-bottom: 12rpx;
  779. }
  780. .pick-desc {
  781. display: block;
  782. font-size: 26rpx;
  783. color: #999;
  784. text-align: center;
  785. margin-bottom: 36rpx;
  786. }
  787. .pick-list {
  788. display: flex;
  789. flex-direction: column;
  790. gap: 16rpx;
  791. }
  792. .pick-item {
  793. display: flex;
  794. align-items: center;
  795. padding: 28rpx 24rpx;
  796. border-radius: 16rpx;
  797. background: #f9fafb;
  798. transition: background 0.15s;
  799. }
  800. .pick-item:active {
  801. background: #f0f1f5;
  802. }
  803. .pick-index {
  804. width: 48rpx;
  805. height: 48rpx;
  806. border-radius: 12rpx;
  807. background: #eef0f4;
  808. color: #888;
  809. font-size: 24rpx;
  810. font-weight: 700;
  811. display: flex;
  812. align-items: center;
  813. justify-content: center;
  814. margin-right: 20rpx;
  815. flex-shrink: 0;
  816. }
  817. .pick-info {
  818. flex: 1;
  819. display: flex;
  820. flex-direction: column;
  821. min-width: 0;
  822. }
  823. .pick-name {
  824. font-size: 30rpx;
  825. font-weight: 600;
  826. color: #333;
  827. overflow: hidden;
  828. text-overflow: ellipsis;
  829. white-space: nowrap;
  830. }
  831. .pick-code {
  832. font-size: 24rpx;
  833. color: #bbb;
  834. margin-top: 4rpx;
  835. }
  836. .pick-arrow {
  837. font-size: 36rpx;
  838. color: #ccc;
  839. margin-left: 12rpx;
  840. }
  841. /* 已授权列表页样式 */
  842. .order-container {
  843. width: 100%;
  844. height: 100vh;
  845. background: #f7f8fa;
  846. display: flex;
  847. flex-direction: column;
  848. overflow: hidden;
  849. }
  850. .order-scroll-list {
  851. flex: 1;
  852. height: 0;
  853. }
  854. .list-wrapper {
  855. padding: 30rpx;
  856. padding-bottom: calc(170rpx + env(safe-area-inset-bottom));
  857. }
  858. .list-header {
  859. padding: 10rpx 0 20rpx;
  860. display: flex;
  861. align-items: center;
  862. justify-content: space-between;
  863. flex-wrap: wrap;
  864. gap: 10rpx;
  865. }
  866. .header-left {
  867. display: flex;
  868. align-items: center;
  869. gap: 16rpx;
  870. }
  871. .header-text {
  872. font-size: 34rpx;
  873. font-weight: bold;
  874. color: #1a1a1a;
  875. position: relative;
  876. padding-left: 24rpx;
  877. }
  878. .header-text::before {
  879. content: '';
  880. position: absolute;
  881. left: 0;
  882. top: 10%;
  883. height: 80%;
  884. width: 8rpx;
  885. background: #C1001C;
  886. border-radius: 4rpx;
  887. }
  888. .select-all-toggle {
  889. display: flex;
  890. align-items: center;
  891. gap: 6rpx;
  892. padding: 6rpx 16rpx;
  893. background: #f5f5f5;
  894. border-radius: 20rpx;
  895. }
  896. .select-all-icon {
  897. font-size: 28rpx;
  898. color: #999;
  899. }
  900. .select-all-icon.checked {
  901. color: #C1001C;
  902. }
  903. .select-all-text {
  904. font-size: 22rpx;
  905. color: #666;
  906. }
  907. /* 型号卡片:大幅升级美化 */
  908. .model-item-card {
  909. background: #fff;
  910. border-radius: 24rpx;
  911. padding: 36rpx;
  912. margin-bottom: 30rpx;
  913. position: relative;
  914. box-shadow: 0 8rpx 30rpx rgba(0, 0, 0, 0.04);
  915. border: 1rpx solid rgba(0, 0, 0, 0.02);
  916. display: flex;
  917. align-items: stretch;
  918. transition: border 0.25s, background 0.25s, transform 0.15s;
  919. }
  920. .model-item-card.batch-mode-card {
  921. padding-left: 20rpx;
  922. gap: 16rpx;
  923. }
  924. .batch-checkbox {
  925. display: flex;
  926. align-items: center;
  927. justify-content: center;
  928. padding-top: 6rpx;
  929. flex-shrink: 0;
  930. }
  931. .checkbox-circle {
  932. width: 44rpx;
  933. height: 44rpx;
  934. border-radius: 50%;
  935. border: 2rpx solid #ddd;
  936. display: flex;
  937. align-items: center;
  938. justify-content: center;
  939. background: #fff;
  940. transition: all 0.2s;
  941. }
  942. .checkbox-circle.checked {
  943. background: #C1001C;
  944. border-color: #C1001C;
  945. }
  946. .check-icon {
  947. font-size: 26rpx;
  948. color: #fff;
  949. font-weight: bold;
  950. }
  951. .card-body {
  952. flex: 1;
  953. min-width: 0;
  954. position: relative;
  955. }
  956. .remove-icon {
  957. position: absolute;
  958. right: -36rpx;
  959. top: -36rpx;
  960. width: 50rpx;
  961. height: 50rpx;
  962. background: rgba(255, 77, 79, 0.1);
  963. border-radius: 0 24rpx 0 24rpx;
  964. display: flex;
  965. align-items: center;
  966. justify-content: center;
  967. z-index: 5;
  968. }
  969. .x-icon {
  970. font-size: 32rpx;
  971. color: #ff4d4f;
  972. font-weight: bold;
  973. }
  974. .card-line {
  975. display: flex;
  976. align-items: center;
  977. margin-bottom: 20rpx;
  978. }
  979. .card-line.secondary {
  980. margin-bottom: 0;
  981. padding-top: 20rpx;
  982. border-top: 1rpx dashed #f0f0f0;
  983. }
  984. .model-value {
  985. font-size: 34rpx;
  986. font-weight: bold;
  987. color: #333;
  988. flex: 1;
  989. }
  990. .count-tag {
  991. background: #FFF1F2;
  992. color: #C1001C;
  993. padding: 4rpx 16rpx;
  994. border-radius: 8rpx;
  995. font-size: 24rpx;
  996. font-weight: bold;
  997. }
  998. .count-num {
  999. font-size: 30rpx;
  1000. margin-left: 8rpx;
  1001. }
  1002. .surface-label {
  1003. font-size: 26rpx;
  1004. color: #999;
  1005. }
  1006. .surface-text {
  1007. font-size: 28rpx;
  1008. color: #666;
  1009. }
  1010. /* 悬浮添加按钮:位置上移避免拥挤 */
  1011. .floating-add-btn {
  1012. position: fixed;
  1013. right: 40rpx;
  1014. bottom: calc(260rpx + env(safe-area-inset-bottom) + 40rpx);
  1015. width: 110rpx;
  1016. height: 110rpx;
  1017. background: #C1001C;
  1018. border-radius: 50%;
  1019. display: flex;
  1020. align-items: center;
  1021. justify-content: center;
  1022. box-shadow: 0 12rpx 40rpx rgba(193, 0, 28, 0.4);
  1023. z-index: 100;
  1024. transition: transform 0.2s;
  1025. }
  1026. .floating-add-btn:active {
  1027. transform: scale(0.9);
  1028. }
  1029. .plus-icon {
  1030. width: 40rpx;
  1031. height: 4rpx;
  1032. background: #fff;
  1033. border-radius: 2rpx;
  1034. position: relative;
  1035. }
  1036. .plus-icon::after {
  1037. content: '';
  1038. position: absolute;
  1039. top: 0;
  1040. left: 0;
  1041. width: 100%;
  1042. height: 100%;
  1043. background: #fff;
  1044. transform: rotate(90deg);
  1045. border-radius: 2rpx;
  1046. }
  1047. /* 底部汇总栏:微调间距与样式 */
  1048. .footer-summary-bar {
  1049. position: fixed;
  1050. bottom: 0;
  1051. left: 0;
  1052. width: 100%;
  1053. height: 130rpx;
  1054. background: #fff;
  1055. border-top: 1rpx solid #f0f0f0;
  1056. display: flex;
  1057. align-items: center;
  1058. justify-content: space-between;
  1059. padding: 0 40rpx;
  1060. padding-bottom: env(safe-area-inset-bottom);
  1061. box-sizing: border-box;
  1062. z-index: 99;
  1063. box-shadow: 0 -10rpx 40rpx rgba(0, 0, 0, 0.05);
  1064. }
  1065. .summary-info {
  1066. display: flex;
  1067. align-items: center;
  1068. }
  1069. .count-label {
  1070. font-size: 26rpx;
  1071. color: #999;
  1072. }
  1073. .num-highlight {
  1074. font-size: 36rpx;
  1075. font-weight: bold;
  1076. color: #1a1a1a;
  1077. margin: 0 4rpx;
  1078. }
  1079. .num-highlight.green {
  1080. color: #C1001C;
  1081. }
  1082. .unit {
  1083. font-size: 24rpx;
  1084. color: #999;
  1085. margin-left: 2rpx;
  1086. }
  1087. .split-line {
  1088. width: 1rpx;
  1089. height: 30rpx;
  1090. background: #eee;
  1091. margin: 0 20rpx;
  1092. }
  1093. .submit-order-btn {
  1094. width: 220rpx;
  1095. height: 80rpx;
  1096. background: #e0e0e0;
  1097. color: #666;
  1098. font-size: 28rpx;
  1099. border-radius: 40rpx;
  1100. display: flex;
  1101. align-items: center;
  1102. justify-content: center;
  1103. border: none;
  1104. margin: 0;
  1105. transition: all 0.3s;
  1106. }
  1107. .submit-order-btn:not([disabled]) {
  1108. background: #C1001C;
  1109. color: #fff;
  1110. font-weight: bold;
  1111. }
  1112. /* 全屏缺省页样式 */
  1113. .empty-state-full {
  1114. display: flex;
  1115. flex-direction: column;
  1116. align-items: center;
  1117. justify-content: center;
  1118. padding-top: 120rpx;
  1119. }
  1120. .empty-visual {
  1121. position: relative;
  1122. margin-bottom: 40rpx;
  1123. width: 400rpx;
  1124. height: 400rpx;
  1125. display: flex;
  1126. align-items: center;
  1127. justify-content: center;
  1128. }
  1129. .empty-img {
  1130. width: 320rpx;
  1131. height: 320rpx;
  1132. z-index: 2;
  1133. }
  1134. .empty-bg-glow {
  1135. position: absolute;
  1136. width: 240rpx;
  1137. height: 240rpx;
  1138. background: radial-gradient(circle, rgba(193, 0, 28, 0.15) 0%, rgba(248, 250, 252, 0) 70%);
  1139. z-index: 1;
  1140. border-radius: 50%;
  1141. }
  1142. .empty-title {
  1143. font-size: 36rpx;
  1144. font-weight: bold;
  1145. color: #1a1a1a;
  1146. margin-bottom: 80rpx;
  1147. }
  1148. .empty-desc {
  1149. font-size: 26rpx;
  1150. color: #999;
  1151. margin-bottom: 60rpx;
  1152. text-align: center;
  1153. padding: 0 80rpx;
  1154. line-height: 1.6;
  1155. }
  1156. .empty-action-btn {
  1157. width: 320rpx;
  1158. height: 90rpx;
  1159. background: #C1001C;
  1160. color: #fff;
  1161. border-radius: 45rpx;
  1162. font-size: 30rpx;
  1163. font-weight: bold;
  1164. display: flex;
  1165. align-items: center;
  1166. justify-content: center;
  1167. box-shadow: 0 10rpx 30rpx rgba(193, 0, 28, 0.2);
  1168. border: none;
  1169. }
  1170. .empty-action-btn:active {
  1171. opacity: 0.8;
  1172. transform: scale(0.96);
  1173. }
  1174. .bottom-safe-space {
  1175. height: 100rpx;
  1176. }
  1177. /* 加载动画样式 */
  1178. .loading-state-full {
  1179. flex: 1;
  1180. display: flex;
  1181. align-items: center;
  1182. justify-content: center;
  1183. padding-bottom: 200rpx;
  1184. }
  1185. .loading-anim-box {
  1186. display: flex;
  1187. flex-direction: column;
  1188. align-items: center;
  1189. }
  1190. .dot-spinner {
  1191. display: flex;
  1192. justify-content: center;
  1193. align-items: center;
  1194. margin-bottom: 30rpx;
  1195. }
  1196. .dot {
  1197. width: 16rpx;
  1198. height: 16rpx;
  1199. background-color: #C1001C;
  1200. border-radius: 50%;
  1201. margin: 0 8rpx;
  1202. animation: dot-pulse 1.4s infinite ease-in-out both;
  1203. }
  1204. .dot:nth-child(1) {
  1205. animation-delay: -0.32s;
  1206. }
  1207. .dot:nth-child(2) {
  1208. animation-delay: -0.16s;
  1209. }
  1210. @keyframes dot-pulse {
  1211. 0%,
  1212. 80%,
  1213. 100% {
  1214. transform: scale(0);
  1215. opacity: 0.3;
  1216. }
  1217. 40% {
  1218. transform: scale(1);
  1219. opacity: 1;
  1220. }
  1221. }
  1222. .loading-text {
  1223. font-size: 26rpx;
  1224. color: #999;
  1225. letter-spacing: 2rpx;
  1226. }
  1227. /* 已选客户信息栏 */
  1228. .client-info-bar {
  1229. display: flex;
  1230. align-items: center;
  1231. padding: 24rpx 32rpx;
  1232. margin-bottom: 20rpx;
  1233. background: linear-gradient(135deg, #FFF1F2 0%, #FFFFFF 100%);
  1234. border-radius: 16rpx;
  1235. border: 1rpx solid rgba(193, 0, 28, 0.1);
  1236. }
  1237. .client-label {
  1238. font-size: 26rpx;
  1239. color: #999;
  1240. }
  1241. .client-name-text {
  1242. font-size: 30rpx;
  1243. font-weight: bold;
  1244. color: #C1001C;
  1245. }
  1246. /* 批量修改按钮 */
  1247. .batch-toggle {
  1248. flex-shrink: 0;
  1249. padding: 8rpx 24rpx;
  1250. background: #C1001C;
  1251. border-radius: 40rpx;
  1252. font-size: 24rpx;
  1253. color: #fff;
  1254. display: flex;
  1255. align-items: center;
  1256. }
  1257. .batch-selected {
  1258. border-color: #C1001C !important;
  1259. background: #FFF1F2 !important;
  1260. }
  1261. /* 批量操作栏 */
  1262. .batch-action-bar {
  1263. position: fixed;
  1264. bottom: 0;
  1265. left: 0;
  1266. width: 100%;
  1267. height: 110rpx;
  1268. background: #fff;
  1269. border-top: 1rpx solid #f0f0f0;
  1270. display: flex;
  1271. align-items: center;
  1272. justify-content: space-between;
  1273. padding: 0 30rpx;
  1274. padding-bottom: env(safe-area-inset-bottom);
  1275. box-sizing: border-box;
  1276. z-index: 100;
  1277. box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.05);
  1278. }
  1279. .batch-count {
  1280. font-size: 28rpx;
  1281. color: #333;
  1282. font-weight: 500;
  1283. }
  1284. .batch-count.placeholder {
  1285. color: #ccc;
  1286. }
  1287. .batch-btns {
  1288. display: flex;
  1289. gap: 16rpx;
  1290. }
  1291. .batch-btn {
  1292. width: auto;
  1293. height: 64rpx;
  1294. padding: 0 28rpx;
  1295. border-radius: 32rpx;
  1296. font-size: 26rpx;
  1297. font-weight: 500;
  1298. display: flex;
  1299. align-items: center;
  1300. border: none;
  1301. line-height: 64rpx;
  1302. transition: opacity 0.2s;
  1303. }
  1304. .batch-btn[disabled] {
  1305. opacity: 0.4;
  1306. }
  1307. .surface-btn {
  1308. background: linear-gradient(135deg, #1890FF, #096DD9);
  1309. color: #fff;
  1310. }
  1311. .pack-btn {
  1312. background: linear-gradient(135deg, #52C41A, #389E0D);
  1313. color: #fff;
  1314. }
  1315. /* 选择器弹层(参照 edit-model 模式) */
  1316. .custom-picker-mask {
  1317. position: fixed;
  1318. top: 0;
  1319. left: 0;
  1320. right: 0;
  1321. bottom: 0;
  1322. background: rgba(0, 0, 0, 0.4);
  1323. z-index: 1000;
  1324. display: flex;
  1325. align-items: flex-end;
  1326. }
  1327. .picker-popup {
  1328. width: 100%;
  1329. background: #fff;
  1330. border-radius: 32rpx 32rpx 0 0;
  1331. padding-bottom: calc(env(safe-area-inset-bottom) + 20rpx);
  1332. animation: slideUp 0.15s ease-out;
  1333. }
  1334. @keyframes slideUp {
  1335. from {
  1336. transform: translateY(100%);
  1337. }
  1338. to {
  1339. transform: translateY(0);
  1340. }
  1341. }
  1342. .popup-header {
  1343. display: flex;
  1344. justify-content: space-between;
  1345. align-items: center;
  1346. padding: 30rpx 40rpx;
  1347. border-bottom: 1rpx solid #f0f0f0;
  1348. }
  1349. .popup-title {
  1350. font-size: 32rpx;
  1351. font-weight: bold;
  1352. color: #333;
  1353. }
  1354. .cancel-text,
  1355. .confirm-text {
  1356. font-size: 30rpx;
  1357. padding: 10rpx;
  1358. }
  1359. .confirm-text {
  1360. color: #C1001C;
  1361. font-weight: bold;
  1362. }
  1363. .item-list {
  1364. max-height: 50vh;
  1365. padding: 0 40rpx;
  1366. }
  1367. .option-item {
  1368. height: 110rpx;
  1369. display: flex;
  1370. align-items: center;
  1371. justify-content: space-between;
  1372. border-bottom: 1rpx solid #f8f8f8;
  1373. font-size: 32rpx;
  1374. color: #333;
  1375. }
  1376. .option-item.active {
  1377. color: #C1001C;
  1378. font-weight: bold;
  1379. }
  1380. .kind-item {
  1381. background: #fafbfc;
  1382. }
  1383. .kind-text {
  1384. color: #556;
  1385. }
  1386. .option-text {
  1387. flex: 1;
  1388. padding: 10rpx 0;
  1389. }
  1390. .arrow-right {
  1391. font-size: 56rpx;
  1392. color: #bbb;
  1393. padding: 10rpx 0 10rpx 20rpx;
  1394. font-weight: 300;
  1395. }
  1396. /* 级联面包屑 */
  1397. .breadcrumb-bar {
  1398. display: flex;
  1399. align-items: center;
  1400. padding: 16rpx 40rpx;
  1401. background: #fafafa;
  1402. border-bottom: 1rpx solid #f0f0f0;
  1403. }
  1404. .back-btn {
  1405. color: #C1001C;
  1406. font-size: 28rpx;
  1407. margin-right: 16rpx;
  1408. }
  1409. .breadcrumb-path {
  1410. font-size: 28rpx;
  1411. color: #666;
  1412. }
  1413. /* 搜索栏样式 */
  1414. .search-bar {
  1415. padding: 16rpx 40rpx;
  1416. border-bottom: 1rpx solid #f0f0f0;
  1417. }
  1418. .search-input-wrap {
  1419. display: flex;
  1420. align-items: center;
  1421. background: #f5f6f8;
  1422. border-radius: 32rpx;
  1423. padding: 12rpx 24rpx;
  1424. }
  1425. .search-icon {
  1426. font-size: 28rpx;
  1427. margin-right: 12rpx;
  1428. }
  1429. .search-input {
  1430. flex: 1;
  1431. font-size: 26rpx;
  1432. color: #333;
  1433. height: 56rpx;
  1434. }
  1435. </style>