index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822
  1. <template>
  2. <view class="order-list-page">
  3. <nav-bar title="订单列表" :showBack="false"></nav-bar>
  4. <!-- 顶部状态栏 -->
  5. <view class="sticky-header">
  6. <scroll-view scroll-x class="tabs-scroll" :show-scrollbar="false">
  7. <view class="tabs-row">
  8. <view v-for="tab in tabList" :key="tab.value"
  9. :class="['tab-item', { active: activeStatus === tab.value }]" @click="onTabClick(tab.value)">
  10. <text>{{ tab.title }}</text>
  11. </view>
  12. </view>
  13. </scroll-view>
  14. <!-- 搜索和过滤 -->
  15. <view class="filter-row">
  16. <picker :range="typeOptions" range-key="text" @change="onTypeChange">
  17. <view class="dropdown-btn">
  18. <text>{{ currentTypeName }}</text>
  19. <uni-icons type="bottom" size="12" color="#333"></uni-icons>
  20. </view>
  21. </picker>
  22. <view class="search-wrap">
  23. <uni-icons type="search" size="14" color="#999"></uni-icons>
  24. <input class="search-input" v-model="searchValue" placeholder="订单号/商户/宠主/手机号"
  25. placeholder-class="placeholder-style" @confirm="onSearch" />
  26. </view>
  27. </view>
  28. </view>
  29. <!-- 订单列表内容 -->
  30. <view class="list-container">
  31. <view class="order-card" v-for="order in orders" :key="order.id" @click="goToDetail(order)">
  32. <!-- 头部:订单号与状态 -->
  33. <view class="order-head">
  34. <text class="order-no">{{ order.id }}</text>
  35. <text :class="['status-text', order.statusClass]">{{ order.statusText }}</text>
  36. </view>
  37. <!-- 主体信息 -->
  38. <view class="order-body">
  39. <view class="service-row">
  40. <text class="service-name">{{ order.serviceType }}</text>
  41. <text class="service-tag tag-orange" v-if="order.serviceTags[0]">{{ order.serviceTags[0]
  42. }}</text>
  43. <text class="service-tag tag-blue" v-if="order.serviceTags[1] === '接'">接</text>
  44. <text class="service-tag tag-green" v-if="order.serviceTags[1] === '送'">送</text>
  45. </view>
  46. <view class="pet-row">
  47. <view class="pet-avatar-text">
  48. <text>{{ order.petName.substring(0, 1).toUpperCase() }}</text>
  49. </view>
  50. <view class="pet-desc">
  51. <text class="bold">{{ order.petName }}</text>
  52. <text class="sub">{{ order.petBreed }}</text>
  53. </view>
  54. <text class="user-desc">{{ order.userName }}</text>
  55. </view>
  56. <view class="info-list">
  57. <view class="info-item">
  58. <uni-icons type="location" size="14" color="#999"></uni-icons>
  59. <text>{{ order.address }}</text>
  60. </view>
  61. <view class="info-item">
  62. <uni-icons type="shop" size="14" color="#999"></uni-icons>
  63. <text>{{ order.shopName }} {{ order.userPhone }}</text>
  64. </view>
  65. <view class="info-item">
  66. <uni-icons type="calendar" size="14" color="#999"></uni-icons>
  67. <text>预约: {{ order.bookTime }}</text>
  68. </view>
  69. </view>
  70. <!-- 时间与履约信息 -->
  71. <view class="time-info-block">
  72. <text class="create-time">下单: {{ order.createTime }}</text>
  73. <view class="assign-info">
  74. <text class="assign-label">履约信息:</text>
  75. <text class="assign-name" v-if="order.assigneeName">{{ order.assigneeName }}</text>
  76. <text class="assign-none" v-else>暂未指派</text>
  77. </view>
  78. <text class="cancel-time" v-if="order.statusText === '已取消' && order.cancelTime">取消: {{
  79. order.cancelTime }}</text>
  80. </view>
  81. </view>
  82. <!-- 操作栏 (带分割线) -->
  83. <view class="order-foot">
  84. <view class="actions">
  85. <template v-if="order.statusText === '待派单' || order.statusText === '待接单'">
  86. <button size="mini" class="action-btn btn-cancel"
  87. @click.stop="onCancelOrder(order)">取消订单</button>
  88. <button size="mini" class="action-btn btn-primary"
  89. @click.stop="goToDetail(order)">查看详情</button>
  90. </template>
  91. <template v-else-if="['服务中', '待商家确认', '已完成'].includes(order.statusText)">
  92. <button v-if="['服务中', '已完成'].includes(order.statusText)" size="mini"
  93. class="action-btn btn-cancel" @click.stop="onComplaint(order)">投诉订单</button>
  94. <button size="mini" class="action-btn btn-primary"
  95. @click.stop="goToDetail(order)">查看详情</button>
  96. </template>
  97. <template v-else>
  98. <button size="mini" class="action-btn btn-primary"
  99. @click.stop="goToDetail(order)">查看详情</button>
  100. </template>
  101. </view>
  102. </view>
  103. </view>
  104. <!-- 空状态 -->
  105. <view class="empty-state" v-if="!loading && orders.length === 0">
  106. <text class="empty-text">暂无相关订单</text>
  107. </view>
  108. <!-- 加载状态 -->
  109. <view class="loading-state" v-if="loading">
  110. <text class="loading-text">加载中...</text>
  111. </view>
  112. </view>
  113. <!-- 自定义取消订单弹窗 -->
  114. <view class="custom-modal" v-if="showCancelModal">
  115. <view class="modal-mask" @click="closeCancelModal"></view>
  116. <view class="modal-content">
  117. <view class="modal-title">提示</view>
  118. <view class="modal-body">
  119. <view style="margin-bottom: 20rpx; font-size: 28rpx; color: #666;">确定要取消订单 [{{ currentCancelOrder?.id }}] 吗?</view>
  120. <textarea class="cancel-input" v-model="cancelReason" placeholder="必填,请输入取消原因" placeholder-class="ph-color" :show-confirm-bar="false"></textarea>
  121. </view>
  122. <view class="modal-footer">
  123. <view class="modal-btn btn-cancel" @click="closeCancelModal">取消</view>
  124. <view class="modal-btn btn-confirm" @click="confirmCancelOrder">确定</view>
  125. </view>
  126. </view>
  127. </view>
  128. <custom-tabbar></custom-tabbar>
  129. </view>
  130. </template>
  131. <script setup>
  132. import { ref, computed, onMounted } from 'vue'
  133. import { onLoad } from '@dcloudio/uni-app'
  134. import navBar from '@/components/nav-bar/index.vue'
  135. import customTabbar from '@/components/custom-tabbar/index.vue'
  136. import orderStatusData from '@/json/orderStatus.json'
  137. import { listAll } from '@/api/service/list'
  138. import { listSubOrder, cancelSubOrder } from '@/api/order/subOrder'
  139. import { listAreaStation } from '@/api/system/areaStation'
  140. // 加载状态
  141. const loading = ref(false)
  142. // 筛选与搜索
  143. const activeStatus = ref(-1) // -1 表示全部,其他值为枚举值
  144. const filterType = ref(0)
  145. const searchValue = ref('')
  146. // 分页参数
  147. const pagination = ref({
  148. current: 1,
  149. size: 10,
  150. total: 0
  151. })
  152. // 从 orderStatus.json 生成 tabList
  153. const tabList = ref([
  154. { title: '全部订单', value: -1 },
  155. ...orderStatusData.map(item => ({
  156. title: item.label,
  157. value: item.value,
  158. color: item.color
  159. }))
  160. ])
  161. const typeOptions = ref([{ text: '全部类型', value: 0 }])
  162. const serviceList = ref([])
  163. const areaStationList = ref([])
  164. const areaStationMap = ref({})
  165. // 加载服务类型列表
  166. const loadServiceTypes = async () => {
  167. try {
  168. const services = await listAll()
  169. if (services && services.length > 0) {
  170. serviceList.value = services
  171. const serviceTypes = services.map((service, index) => ({
  172. text: service.name,
  173. value: index + 1,
  174. id: service.id
  175. }))
  176. typeOptions.value = [
  177. { text: '全部类型', value: 0 },
  178. ...serviceTypes
  179. ]
  180. }
  181. } catch (error) {
  182. console.error('加载服务类型失败:', error)
  183. }
  184. }
  185. // 加载区域站点列表
  186. const loadAreaStations = async () => {
  187. try {
  188. const res = await listAreaStation()
  189. if (res && res.data) {
  190. areaStationList.value = res.data
  191. const map = {}
  192. for (const item of res.data) {
  193. if (item && item.id !== undefined && item.id !== null) {
  194. map[item.id] = item
  195. }
  196. }
  197. areaStationMap.value = map
  198. }
  199. } catch (error) {
  200. console.error('加载区域站点失败:', error)
  201. }
  202. }
  203. onMounted(() => {
  204. loadServiceTypes()
  205. loadAreaStations()
  206. loadOrders()
  207. })
  208. const currentTypeName = computed(() => {
  209. const option = typeOptions.value.find(opt => opt.value === filterType.value)
  210. return option ? option.text : '全部类型'
  211. })
  212. // 根据枚举值获取状态信息
  213. const getStatusInfo = (value) => {
  214. return orderStatusData.find(item => item.value === value)
  215. }
  216. // 根据服务ID获取服务名称
  217. const getServiceName = (serviceId) => {
  218. const service = serviceList.value.find(s => s.id === serviceId)
  219. return service ? service.name : '未知服务'
  220. }
  221. // 获取城市/区域文本
  222. const getCityDistrictText = (row) => {
  223. if (!row || !row.site) return ''
  224. const station = areaStationMap.value[row.site]
  225. if (!station) return ''
  226. const parent = station.parentId ? areaStationMap.value[station.parentId] : undefined
  227. if (!parent) return station.name || ''
  228. if (parent.type === 0) return parent.name || ''
  229. if (parent.type === 1) {
  230. const city = parent.parentId ? areaStationMap.value[parent.parentId] : undefined
  231. return `${city?.name || ''}/${parent.name || ''}`
  232. }
  233. return parent.name || ''
  234. }
  235. // 获取服务模式标签
  236. const getServiceModeTag = (row) => {
  237. const t = row?.type
  238. if (t === 0 || t === '0' || t === 1 || t === '1') return '往返'
  239. return ''
  240. }
  241. // 获取服务订单类型标签
  242. const getServiceOrderTypeTag = (row) => {
  243. const t = row?.type
  244. if (t === 0 || t === '0') return { label: '接', type: 'blue' }
  245. if (t === 1 || t === '1') return { label: '送', type: 'green' }
  246. if (t === 2 || t === '2') return { label: '单程接', type: 'blue' }
  247. if (t === 3 || t === '3') return { label: '单程送', type: 'green' }
  248. return null
  249. }
  250. const onTabClick = (value) => {
  251. activeStatus.value = value
  252. pagination.value.current = 1
  253. loadOrders()
  254. }
  255. const onTypeChange = (e) => {
  256. const index = Number(e.detail.value)
  257. filterType.value = index
  258. pagination.value.current = 1
  259. loadOrders()
  260. }
  261. // 订单列表数据
  262. const orders = ref([])
  263. // 加载订单列表
  264. const loadOrders = async () => {
  265. loading.value = true
  266. try {
  267. const selectedType = typeOptions.value.find(opt => opt.value === filterType.value)
  268. const params = {
  269. pageNum: pagination.value.current,
  270. pageSize: pagination.value.size,
  271. status: activeStatus.value !== -1 ? activeStatus.value : undefined,
  272. service: selectedType && selectedType.id ? selectedType.id : undefined,
  273. content: searchValue.value || undefined
  274. }
  275. const res = await listSubOrder(params)
  276. console.log('后端返回数据:', res)
  277. if (res) {
  278. const rows = res.rows || []
  279. console.log('rows:', rows)
  280. orders.value = rows.map(row => transformOrder(row))
  281. console.log('转换后的orders:', orders.value)
  282. pagination.value.total = res.total || 0
  283. }
  284. } catch (error) {
  285. console.error('加载订单列表失败:', error)
  286. } finally {
  287. loading.value = false
  288. }
  289. }
  290. // 转换订单数据格式
  291. const transformOrder = (row) => {
  292. const statusInfo = getStatusInfo(row.status)
  293. const serviceName = getServiceName(row.service)
  294. const modeTag = getServiceModeTag(row)
  295. const typeTag = getServiceOrderTypeTag(row)
  296. const serviceTags = []
  297. if (modeTag) serviceTags.push(modeTag)
  298. if (typeTag) serviceTags.push(typeTag.label)
  299. return {
  300. // 先展开原始字段,后面的手动赋值具有更高优先级
  301. ...row,
  302. // 显示用的单号(优先用业务编号 code,否则用数据库 ID)
  303. id: row.code || row.id,
  304. rawId: row.id,
  305. serviceType: serviceName,
  306. serviceTags: serviceTags,
  307. petName: row.petName || '未知',
  308. petBreed: row.petBreed || '未知',
  309. userName: row.customerName || '未知',
  310. address: row.toAddress || row.fromAddress || getCityDistrictText(row),
  311. shopName: row.storeName || '未知',
  312. userPhone: row.contactPhoneNumber || '',
  313. bookTime: row.serviceTime || '',
  314. createTime: row.createTime || '',
  315. statusText: statusInfo ? statusInfo.label : '未知',
  316. statusClass: statusInfo ? `text-${statusInfo.color.replace('#', '')}` : 'text-gray',
  317. assigneeName: row.fulfillerName || '',
  318. cancelTime: row.cancelTime || ''
  319. }
  320. }
  321. // 搜索订单
  322. const onSearch = () => {
  323. pagination.value.current = 1
  324. loadOrders()
  325. }
  326. const showCancelModal = ref(false)
  327. const cancelReason = ref('')
  328. const currentCancelOrder = ref(null)
  329. // 取消订单
  330. const onCancelOrder = (order) => {
  331. currentCancelOrder.value = order
  332. cancelReason.value = ''
  333. showCancelModal.value = true
  334. }
  335. const closeCancelModal = () => {
  336. showCancelModal.value = false
  337. }
  338. const confirmCancelOrder = async () => {
  339. const reason = cancelReason.value.trim()
  340. if (!reason) {
  341. uni.showToast({ title: '取消原因不能为空', icon: 'none' })
  342. return
  343. }
  344. try {
  345. uni.showLoading({ title: '处理中' })
  346. await cancelSubOrder({ orderId: currentCancelOrder.value.rawId, reason })
  347. uni.hideLoading()
  348. uni.showToast({ title: '订单已取消', icon: 'success' })
  349. showCancelModal.value = false
  350. loadOrders()
  351. } catch (error) {
  352. uni.hideLoading()
  353. console.error('取消订单失败:', error)
  354. uni.showToast({ title: '取消失败', icon: 'none' })
  355. }
  356. }
  357. // 跳转到订单详情
  358. const goToDetail = (order) => {
  359. uni.navigateTo({
  360. url: `/pages/order/detail/index?id=${order.rawId}`
  361. })
  362. }
  363. // 投诉
  364. const onComplaint = (order) => {
  365. uni.navigateTo({
  366. url: `/pages/my/complaint/submit/index?orderId=${order.rawId}&fulfillerId=${order.fulfiller}&orderCode=${order.id}`
  367. })
  368. }
  369. </script>
  370. <style lang="scss" scoped>
  371. .order-list-page {
  372. background-color: #f2f2f2;
  373. min-height: 100vh;
  374. padding-bottom: 120rpx;
  375. }
  376. .sticky-header {
  377. position: sticky;
  378. top: calc(44px + var(--status-bar-height, 44px));
  379. z-index: 99;
  380. background-color: #fff;
  381. }
  382. .tabs-scroll {
  383. white-space: nowrap;
  384. border-bottom: 2rpx solid #EEEEEE;
  385. }
  386. .tabs-row {
  387. display: flex;
  388. padding: 0 16rpx;
  389. }
  390. .tab-item {
  391. padding: 32rpx 24rpx;
  392. font-size: 30rpx;
  393. color: #666;
  394. position: relative;
  395. flex-shrink: 0;
  396. }
  397. .tab-item.active {
  398. color: #333;
  399. font-weight: bold;
  400. }
  401. .tab-item.active::after {
  402. content: '';
  403. position: absolute;
  404. bottom: 0;
  405. left: 50%;
  406. transform: translateX(-50%);
  407. width: 48rpx;
  408. height: 6rpx;
  409. background-color: #f7ca3e;
  410. border-radius: 6rpx;
  411. }
  412. .filter-row {
  413. display: flex;
  414. align-items: center;
  415. padding: 12rpx 16rpx;
  416. background-color: #fff;
  417. border-top: 2rpx solid #EEEEEE;
  418. gap: 16rpx;
  419. }
  420. .dropdown-btn {
  421. display: flex;
  422. align-items: center;
  423. gap: 8rpx;
  424. background: #f5f5f5;
  425. border-radius: 40rpx;
  426. padding: 24rpx 28rpx;
  427. font-size: 28rpx;
  428. color: #333;
  429. }
  430. .search-wrap {
  431. flex: 1;
  432. display: flex;
  433. align-items: center;
  434. background: #f5f5f5;
  435. border-radius: 40rpx;
  436. padding: 24rpx 24rpx;
  437. gap: 12rpx;
  438. }
  439. .search-input {
  440. flex: 1;
  441. font-size: 26rpx;
  442. }
  443. .placeholder-style {
  444. color: #999;
  445. font-size: 26rpx;
  446. }
  447. .list-container {
  448. padding: 24rpx;
  449. }
  450. .order-card {
  451. padding: 28rpx;
  452. margin-bottom: 24rpx;
  453. background: #fff;
  454. border-radius: 24rpx;
  455. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.04);
  456. }
  457. .order-head {
  458. display: flex;
  459. justify-content: space-between;
  460. align-items: center;
  461. border-bottom: 2rpx solid #EEEEEE;
  462. padding-bottom: 20rpx;
  463. margin-bottom: 20rpx;
  464. }
  465. .order-no {
  466. font-size: 28rpx;
  467. color: #333333;
  468. }
  469. .status-text {
  470. font-size: 28rpx;
  471. font-weight: bold;
  472. }
  473. .text-red {
  474. color: #f44336;
  475. }
  476. .text-orange {
  477. color: #ff9800;
  478. }
  479. .text-blue {
  480. color: #2196f3;
  481. }
  482. .text-green {
  483. color: #4caf50;
  484. }
  485. .text-gray {
  486. color: #999;
  487. }
  488. .service-row {
  489. display: flex;
  490. align-items: center;
  491. margin-bottom: 20rpx;
  492. gap: 12rpx;
  493. }
  494. .service-name {
  495. font-size: 30rpx;
  496. font-weight: bold;
  497. color: #333;
  498. }
  499. .service-tag {
  500. font-size: 20rpx;
  501. padding: 2rpx 8rpx;
  502. border-radius: 8rpx;
  503. border: 1rpx solid;
  504. }
  505. .tag-orange {
  506. color: #ff9800;
  507. border-color: #ff9800;
  508. background: #fff3e0;
  509. }
  510. .tag-blue {
  511. color: #2196f3;
  512. border-color: #2196f3;
  513. background: #e3f2fd;
  514. }
  515. .tag-green {
  516. color: #4caf50;
  517. border-color: #4caf50;
  518. background: #e8f5e9;
  519. }
  520. .pet-row {
  521. display: flex;
  522. align-items: center;
  523. margin-bottom: 20rpx;
  524. background: #f7f8fa;
  525. padding: 16rpx 20rpx;
  526. border-radius: 16rpx;
  527. }
  528. .pet-avatar-text {
  529. width: 64rpx;
  530. height: 64rpx;
  531. border-radius: 50%;
  532. background-color: #e3f2fd;
  533. color: #2196f3;
  534. display: flex;
  535. align-items: center;
  536. justify-content: center;
  537. font-weight: bold;
  538. font-size: 32rpx;
  539. margin-right: 20rpx;
  540. }
  541. .pet-desc {
  542. display: flex;
  543. align-items: baseline;
  544. gap: 12rpx;
  545. flex: 1;
  546. }
  547. .pet-desc .bold {
  548. font-size: 30rpx;
  549. font-weight: bold;
  550. color: #333;
  551. }
  552. .pet-desc .sub {
  553. font-size: 26rpx;
  554. color: #666;
  555. }
  556. .user-desc {
  557. font-size: 28rpx;
  558. color: #333;
  559. }
  560. .info-list {
  561. display: flex;
  562. flex-direction: column;
  563. gap: 12rpx;
  564. }
  565. .info-item {
  566. display: flex;
  567. align-items: center;
  568. font-size: 26rpx;
  569. color: #666;
  570. gap: 12rpx;
  571. }
  572. .time-info-block {
  573. margin-top: 24rpx;
  574. display: flex;
  575. flex-direction: column;
  576. gap: 12rpx;
  577. }
  578. .order-foot {
  579. display: flex;
  580. justify-content: flex-end;
  581. align-items: center;
  582. margin-top: 24rpx;
  583. padding-top: 24rpx;
  584. border-top: 2rpx solid #EEEEEE;
  585. }
  586. .foot-left {
  587. display: flex;
  588. flex-direction: column;
  589. gap: 12rpx;
  590. }
  591. .create-time,
  592. .cancel-time {
  593. font-size: 24rpx;
  594. color: #999;
  595. }
  596. .assign-info {
  597. display: flex;
  598. align-items: center;
  599. font-size: 24rpx;
  600. gap: 12rpx;
  601. }
  602. .assign-label {
  603. color: #999;
  604. }
  605. .assign-none {
  606. color: #ccc;
  607. }
  608. .assign-name {
  609. color: #333;
  610. font-weight: bold;
  611. }
  612. .actions {
  613. display: flex;
  614. gap: 16rpx;
  615. }
  616. .action-btn {
  617. height: 60rpx;
  618. line-height: 60rpx;
  619. min-width: 140rpx;
  620. font-size: 26rpx;
  621. font-weight: 600;
  622. padding: 0 32rpx;
  623. border-radius: 30rpx;
  624. display: inline-flex;
  625. align-items: center;
  626. justify-content: center;
  627. &::after { border: none; }
  628. }
  629. .btn-cancel {
  630. border: 2rpx solid #EEEEEE;
  631. color: #666;
  632. background: transparent;
  633. }
  634. .btn-primary {
  635. background: linear-gradient(90deg, #ffd53f, #ff9500);
  636. border: none;
  637. color: #fff;
  638. box-shadow: 0 6rpx 16rpx rgba(255, 149, 0, 0.3);
  639. }
  640. .empty-state {
  641. text-align: center;
  642. padding: 100rpx 0;
  643. }
  644. .empty-text {
  645. font-size: 28rpx;
  646. color: #999;
  647. }
  648. .loading-state {
  649. text-align: center;
  650. padding: 100rpx 0;
  651. }
  652. .loading-text {
  653. font-size: 28rpx;
  654. color: #999;
  655. }
  656. /* 自定义弹窗样式 */
  657. .custom-modal {
  658. position: fixed;
  659. top: 0;
  660. left: 0;
  661. width: 100%;
  662. height: 100%;
  663. z-index: 999;
  664. display: flex;
  665. align-items: center;
  666. justify-content: center;
  667. }
  668. .modal-mask {
  669. position: absolute;
  670. top: 0;
  671. left: 0;
  672. width: 100%;
  673. height: 100%;
  674. background-color: rgba(0, 0, 0, 0.5);
  675. }
  676. .modal-content {
  677. position: relative;
  678. width: 80%;
  679. background-color: #fff;
  680. border-radius: 16rpx;
  681. overflow: hidden;
  682. z-index: 1000;
  683. }
  684. .modal-title {
  685. padding: 30rpx 0 20rpx;
  686. text-align: center;
  687. font-size: 32rpx;
  688. font-weight: bold;
  689. color: #333;
  690. }
  691. .modal-body {
  692. padding: 10rpx 40rpx 30rpx;
  693. }
  694. .cancel-input {
  695. width: 100%;
  696. height: 160rpx;
  697. background-color: #f8f8f8;
  698. border-radius: 8rpx;
  699. padding: 20rpx;
  700. font-size: 28rpx;
  701. box-sizing: border-box;
  702. color: #333;
  703. }
  704. .ph-color {
  705. color: #999;
  706. }
  707. .modal-footer {
  708. display: flex;
  709. border-top: 1rpx solid #CCCCCC;
  710. }
  711. .modal-btn {
  712. flex: 1;
  713. height: 90rpx;
  714. line-height: 90rpx;
  715. text-align: center;
  716. font-size: 30rpx;
  717. font-weight: 500;
  718. }
  719. .btn-cancel {
  720. color: #666;
  721. border-right: 1rpx solid #eee;
  722. }
  723. .btn-confirm {
  724. color: #2196f3;
  725. }
  726. </style>