图书馆小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

790 lines
23 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
4 weeks ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
4 weeks ago
1 month ago
1 month ago
4 weeks ago
1 month ago
1 month ago
1 month ago
4 weeks ago
4 weeks ago
1 month ago
4 weeks ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
4 weeks ago
1 month ago
1 month ago
4 weeks ago
4 weeks ago
4 weeks ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
4 weeks ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
4 weeks ago
1 month ago
4 weeks ago
1 month ago
4 weeks ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
4 weeks ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
4 weeks ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
4 weeks ago
1 month ago
4 weeks ago
1 month ago
4 weeks ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
4 weeks ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <template>
  2. <view class="booking-detail">
  3. <view class="section">
  4. <view class="calendar-wrap">
  5. <view class="calendar-top">
  6. <text class="calendar-title">选择入馆日期</text>
  7. <text class="calendar-month">{{ displayYear }}.{{ String(displayMonth).padStart(2,'0') }}</text>
  8. </view>
  9. <view class="calendar-days-grid">
  10. <view
  11. v-for="(day, index) in calendarDays"
  12. :key="index"
  13. class="day-card"
  14. :class="{
  15. 'card-selected': day.date === selectedDate,
  16. 'card-available': day.available && !day.tempClose && !day.userHasBooked,
  17. 'card-disabled': !day.available || day.tempClose,
  18. 'card-today': day.isToday,
  19. 'card-user-booked': day.userHasBooked,
  20. 'card-temp-close': day.tempClose
  21. }"
  22. @click="selectDate(day)"
  23. >
  24. <!-- 今天蓝色角标 -->
  25. <view v-if="day.isToday" class="corner-block-today"></view>
  26. <!-- 用户已预约 橙色角标 -->
  27. <view v-if="day.userHasBooked" class="corner-block-booked"></view>
  28. <text class="card-week">{{ day.isToday ? '今天' : day.weekText }}</text>
  29. <text class="card-num">{{ day.day }}</text>
  30. <text class="card-status">
  31. {{ day.tempClose ? '闭馆' : (day.userHasBooked ? '已预约' : (day.available ? '可预约' : '')) }}
  32. </text>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <!-- 时间选择闭馆时整体禁用 -->
  38. <view class="section" :class="{disabled: isSelectCloseDay}">
  39. <view class="section-title">时间选择</view>
  40. <view class="time-slots">
  41. <view
  42. v-for="slot in timeSlots"
  43. :key="slot.id"
  44. class="time-item"
  45. :class="{
  46. 'selected': selectedTimeList.includes(slot.time),
  47. disabled: isSelectCloseDay,
  48. 'booked-item': slot.isUserBooked
  49. }"
  50. @click="selectTime(slot)"
  51. >
  52. <!-- 这里由 slot.time 改为 slot.displayText -->
  53. <text class="time-text">{{ slot.displayText }}</text>
  54. <text v-if="slot.isUserBooked" class="booked-tag">已预约</text>
  55. <uni-icons
  56. v-if="selectedTimeList.includes(slot.time) && !slot.isUserBooked"
  57. style="position: absolute; right: 5px; top: 50%; transform: translateY(-50%);"
  58. custom-prefix="iconfont"
  59. type="icon-xuanze"
  60. size="20"
  61. color="#01a4fe"
  62. ></uni-icons>
  63. </view>
  64. </view>
  65. <view v-if="isSelectCloseDay" class="disable-tip">该日期闭馆不可选择时间段</view>
  66. </view>
  67. <!-- 闭馆公告板块仅选中闭馆日期显示 -->
  68. <view v-if="isSelectCloseDay" class="section notice-section">
  69. <view class="notice-title">闭馆公告</view>
  70. <view class="notice-content">{{ closeNoticeText }}</view>
  71. </view>
  72. <view class="section operate-desc">
  73. <view class="section-title" style="font-size: 14px;">预约说明</view>
  74. <view class="desc-item">
  75. <text class="color-blue">1<text>蓝色</text>日期 可预约</text>
  76. </view>
  77. <view class="desc-item">
  78. <text class="color-orange">2<text>橙色</text>日期 已有预约</text>
  79. </view>
  80. <view class="desc-item">
  81. <text class="color-gray">3<text>灰色</text>日期 超出可选范围不可点击预约</text>
  82. </view>
  83. <view class="desc-item">
  84. <text class="color-close">4<text>闭馆</text>日期 可查看公告但无法预约或入馆</text>
  85. </view>
  86. <view class="desc-item">
  87. <text>5已预约时间段仅可查看不可取消可新增其他时间段</text>
  88. </view>
  89. </view>
  90. <view class="bottom-bar">
  91. <button class="btn-primary" :disabled="isSelectCloseDay" @click="confirmBooking">确认预约</button>
  92. </view>
  93. </view>
  94. </template>
  95. <script>
  96. import { FetchInitLibraryReservationSettings, FetchInitMyReservation,FetchReserve } from '@/api/reservation';
  97. import { getOpenId } from '@/utils/storage';
  98. // import config from '@/utils/config';
  99. export default {
  100. data() {
  101. return {
  102. selectedDate: '',
  103. selectedTimeList: [], // 多选时间段数组
  104. calendarDays: [],
  105. timeSlots: [],
  106. reserveConfig: null,
  107. // 馆员临时闭馆日期列表,格式'2026-08-20',后台接口返回
  108. tempCloseDateList: [],
  109. // 闭馆公告映射 key:日期 value:公告内容
  110. tempCloseNoticeMap: {},
  111. // 用户已经预约过的日期列表,后台接口返回
  112. userBookedDateList: [],
  113. // key:日期字符串,value:已预约时间段,后端返回
  114. userBookedMap:{}
  115. };
  116. },
  117. computed: {
  118. // 是否选中闭馆日期
  119. isSelectCloseDay(){
  120. if(!this.selectedDate) return false
  121. return this.tempCloseDateList.includes(this.selectedDate)
  122. },
  123. // 获取当前闭馆公告文本
  124. closeNoticeText(){
  125. return this.tempCloseNoticeMap[this.selectedDate] || "本日场馆闭馆,暂不支持预约。"
  126. },
  127. displayYear() {
  128. let targetDateStr = this.selectedDate;
  129. if (!targetDateStr && this.calendarDays.length > 0) {
  130. const firstValid = this.calendarDays.find(d => d.available && !d.tempClose) || this.calendarDays[0];
  131. targetDateStr = firstValid.date;
  132. }
  133. if (!targetDateStr) return new Date().getFullYear();
  134. const d = new Date(targetDateStr);
  135. return d.getFullYear();
  136. },
  137. displayMonth() {
  138. let targetDateStr = this.selectedDate;
  139. if (!targetDateStr && this.calendarDays.length > 0) {
  140. const firstValid = this.calendarDays.find(d => d.available && !d.tempClose) || this.calendarDays[0];
  141. targetDateStr = firstValid.date;
  142. }
  143. if (!targetDateStr) return new Date().getMonth() + 1;
  144. const d = new Date(targetDateStr);
  145. return d.getMonth() + 1;
  146. }
  147. },
  148. async onLoad(options) {
  149. await this.initReservationSettings();
  150. await this.initMyReservation();
  151. if(this.reserveConfig){
  152. this.generateCalendar();
  153. }
  154. },
  155. methods: {
  156. formatShowTime(timeStr){
  157. return timeStr === '00:00 - 23:59' ? '全天' : timeStr
  158. },
  159. // 时间戳转 YYYY‑MM‑DD
  160. formatTsToDate(ts) {
  161. const d = new Date(ts);
  162. const y = d.getFullYear();
  163. const m = String(d.getMonth() + 1).padStart(2, '0');
  164. const day = String(d.getDate()).padStart(2, '0');
  165. return `${y}-${m}-${day}`;
  166. },
  167. /**
  168. * 将闭馆起止毫秒时间戳展开成每一天日期字符串数组
  169. * @param {number} startTs closureStartDate
  170. * @param {number} endTs closureEndDate
  171. * @returns string[] ['2026‑08‑01','2026‑08‑02']
  172. */
  173. expandClosureRange(startTs, endTs){
  174. const result = []
  175. let cur = new Date(startTs)
  176. const end = new Date(endTs)
  177. // 只比对日期,去掉时分秒干扰
  178. cur.setHours(0,0,0,0)
  179. end.setHours(0,0,0,0)
  180. while(cur <= end){
  181. result.push(this.formatTsToDate(cur.getTime()))
  182. cur.setDate(cur.getDate() + 1)
  183. }
  184. return result
  185. },
  186. // 把 HH:mm:ss 截取为 HH:mm
  187. formatTimeHm(timeStr) {
  188. if(!timeStr) return ''
  189. return timeStr.substring(0,5)
  190. },
  191. // 初始化我的预约
  192. async initMyReservation() {
  193. try {
  194. const openId = await getOpenId();
  195. const res = await FetchInitMyReservation({
  196. libcode: getApp().globalData.libcode,
  197. openId: openId
  198. })
  199. if(res.code === 200 && res.data){
  200. // 闭馆
  201. this.tempCloseDateList = []
  202. this.tempCloseNoticeMap = {}
  203. // 处理闭馆公告 vxLibraryClosureNotices
  204. const closureList = Array.isArray(res.data.vxLibraryClosureNotices) ? res.data.vxLibraryClosureNotices : []
  205. closureList.forEach(notice=>{
  206. const dayArr = this.expandClosureRange(notice.closureStartDate, notice.closureEndDate)
  207. dayArr.forEach(dateStr=>{
  208. if(!this.tempCloseDateList.includes(dateStr)){
  209. this.tempCloseDateList.push(dateStr)
  210. }
  211. // 同一个日期多条公告,用换行拼接;覆盖也可以看业务需求
  212. if(this.tempCloseNoticeMap[dateStr]){
  213. this.tempCloseNoticeMap[dateStr] += '\n\n' + notice.content
  214. }else{
  215. this.tempCloseNoticeMap[dateStr] = notice.content
  216. }
  217. })
  218. })
  219. // ==========处理用户预约 myReservation==========
  220. this.userBookedDateList = []
  221. this.userBookedMap = {}
  222. const myRes = Array.isArray(res.data.myReservation) ? res.data.myReservation : []
  223. myRes.forEach(item=>{
  224. // specificDate 毫秒时间戳
  225. const dateStr = this.formatTsToDate(item.specificDate)
  226. const startHm = this.formatTimeHm(item.startTime)
  227. const endHm = this.formatTimeHm(item.endTime)
  228. const timeSlotText = `${startHm} - ${endHm}`
  229. if(!this.userBookedMap[dateStr]){
  230. this.userBookedMap[dateStr] = []
  231. }
  232. this.userBookedMap[dateStr].push(timeSlotText)
  233. })
  234. // 收集已预约日期
  235. this.userBookedDateList = Object.keys(this.userBookedMap)
  236. }
  237. } catch (e) {
  238. console.error('获取我的预约异常', e)
  239. }
  240. },
  241. transformReserveConfig(apiData){
  242. const { baseSetting, weekJson } = apiData;
  243. const weekKeyMap = {
  244. 1: 'monday',
  245. 2: 'tuesday',
  246. 3: 'wednesday',
  247. 4: 'thursday',
  248. 5: 'friday',
  249. 6: 'saturday',
  250. 7: 'sunday'
  251. };
  252. const weekDays = [];
  253. for(let wId=1;wId<=7;wId++){
  254. const propName = weekKeyMap[wId];
  255. const checked = !!baseSetting[propName];
  256. const timeArr = weekJson[wId] || [];
  257. // 把startTime[h,m], endTime[h,m]转 "HH:mm - HH:mm"
  258. const times = timeArr.map(item=>{
  259. const sh = String(item.startTime[0]).padStart(2,'0');
  260. const sm = String(item.startTime[1]).padStart(2,'0');
  261. const eh = String(item.endTime[0]).padStart(2,'0');
  262. const em = String(item.endTime[1]).padStart(2,'0');
  263. return `${sh}:${sm} - ${eh}:${em}`;
  264. })
  265. weekDays.push({
  266. id:wId,
  267. name:this.getWeekText(wId),
  268. checked: checked,
  269. times: times,
  270. showPicker: false,
  271. newTime: ""
  272. })
  273. }
  274. return {
  275. frequency: String(baseSetting.advanceBookingDays),
  276. weekDays
  277. }
  278. },
  279. // 初始化预约设置
  280. async initReservationSettings() {
  281. try {
  282. const res = await FetchInitLibraryReservationSettings({
  283. libcode: getApp().globalData.libcode
  284. })
  285. if (res && res.code === 200 && res.data) {
  286. this.reserveConfig = this.transformReserveConfig(res.data);
  287. }else{
  288. console.error('初始化预约设置失败',res)
  289. }
  290. } catch (e) {
  291. console.error('获取预约设置异常', e)
  292. }
  293. },
  294. getWeekNum(dateStr) {
  295. const d = new Date(dateStr);
  296. const day = d.getDay();
  297. return day === 0 ? 7 : day
  298. },
  299. getWeekText(weekNo){
  300. const map = {1:'周一',2:'周二',3:'周三',4:'周四',5:'周五',6:'周六',7:'周日'}
  301. return map[weekNo]
  302. },
  303. generateCalendar() {
  304. if(!this.reserveConfig) return;
  305. const today = new Date();
  306. const todayStr = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, '0')}-${String(today.getDate()).padStart(2, '0')}`;
  307. const freq = Number(this.reserveConfig.frequency);
  308. const allowDateList = [];
  309. for(let i = 0; i < freq; i++){
  310. const temp = new Date(today);
  311. temp.setDate(today.getDate() + i);
  312. const ds = `${temp.getFullYear()}-${String(temp.getMonth()+1).padStart(2,'0')}-${String(temp.getDate()).padStart(2,'0')}`
  313. allowDateList.push(ds)
  314. }
  315. const list = []
  316. allowDateList.forEach(dateStr=>{
  317. const weekNo = this.getWeekNum(dateStr)
  318. const weekCfg = this.reserveConfig.weekDays.find(w => w.id === weekNo)
  319. const available = !!weekCfg?.checked
  320. const d = new Date(dateStr)
  321. const tempClose = this.tempCloseDateList.includes(dateStr)
  322. const userHasBooked = this.userBookedDateList.includes(dateStr)
  323. list.push({
  324. day: d.getDate(),
  325. date: dateStr,
  326. weekText: this.getWeekText(weekNo),
  327. available: available,
  328. isToday: dateStr === todayStr,
  329. tempClose: tempClose,
  330. userHasBooked: userHasBooked
  331. })
  332. })
  333. this.calendarDays = list
  334. // 找第一个不是闭馆的有效日期作为初始选中
  335. const firstAvail = this.calendarDays.find(d => d.available && !d.tempClose);
  336. if(firstAvail){
  337. this.selectedDate = firstAvail.date
  338. this.refreshTimeSlots(this.selectedDate)
  339. }else{
  340. this.selectedDate = ''
  341. this.timeSlots = []
  342. }
  343. },
  344. refreshTimeSlots(dateStr){
  345. if(!dateStr) {
  346. this.timeSlots = []
  347. return
  348. }
  349. const weekNo = this.getWeekNum(dateStr)
  350. const weekCfg = this.reserveConfig.weekDays.find(w => w.id === weekNo)
  351. if(!weekCfg || !weekCfg.checked){
  352. this.timeSlots = []
  353. return
  354. }
  355. // 当前日期已经预约的时间段
  356. const bookedTimeArr = this.userBookedMap[dateStr] || []
  357. this.timeSlots = weekCfg.times.map((t, idx)=>{
  358. // 判断是否全天
  359. const displayText = t === '00:00 - 23:59' ? '全天' : t
  360. return {
  361. id: idx + 1,
  362. time: t, // 原始时间字符串,用于选中判断、提交,不变
  363. displayText, // 页面渲染展示文本
  364. available: true,
  365. isUserBooked: bookedTimeArr.includes(t)
  366. }
  367. })
  368. // 回填历史已预约时间段,不能取消
  369. this.selectedTimeList = [...bookedTimeArr]
  370. },
  371. selectDate(day) {
  372. // 普通不可选(非临时闭馆):弹提示,禁止选中
  373. if (!day.available && !day.tempClose) {
  374. uni.showToast({
  375. title: '超出可选的时间范围,请选择其他日期',
  376. icon: 'none'
  377. })
  378. return;
  379. }
  380. // 临时闭馆 || 正常可预约:允许选中
  381. this.selectedDate = day.date;
  382. this.refreshTimeSlots(day.date);
  383. },
  384. selectTime(slot) {
  385. if(this.isSelectCloseDay) return
  386. if (!slot.available) return;
  387. // 已预约时间段禁止取消
  388. if(slot.isUserBooked){
  389. uni.showToast({
  390. title:"该时间段已预约,不可操作取消",
  391. icon:"none"
  392. })
  393. return
  394. }
  395. const idx = this.selectedTimeList.indexOf(slot.time)
  396. if(idx > -1){
  397. // 本次新增的,可以取消
  398. this.selectedTimeList.splice(idx,1)
  399. }else{
  400. this.selectedTimeList.push(slot.time)
  401. }
  402. },
  403. async confirmBooking() {
  404. if(this.isSelectCloseDay){
  405. uni.showToast({title:"该日期闭馆,无法预约",icon:"none"})
  406. return
  407. }
  408. if (!this.selectedDate) {
  409. uni.showToast({ title: '请选择日期', icon: 'none' });
  410. return;
  411. }
  412. const bookedTimeArr = this.userBookedMap[this.selectedDate] || []
  413. // 过滤:只取本次新增勾选的时间段
  414. const newSelectTimes = this.selectedTimeList.filter(item=> !bookedTimeArr.includes(item))
  415. if (!newSelectTimes || newSelectTimes.length === 0) {
  416. uni.showToast({ title: '请选择需要新增预约的时间段', icon: 'none' });
  417. return;
  418. }
  419. uni.showLoading({ title: '预约中...' });
  420. const openId = await getOpenId();
  421. if (!openId) {
  422. uni.hideLoading();
  423. uni.showToast({ title: '获取用户openid失败', icon: 'none' });
  424. return;
  425. }
  426. // 组装数组参数,后端接收对象数组
  427. const param = newSelectTimes.map(timeStr => {
  428. const [startPart, endPart] = timeStr.split(' - ');
  429. const startTime = startPart.trim() + ':00';
  430. const endTime = endPart.trim() + ':00';
  431. return {
  432. libcode: getApp().globalData.libcode, // 馆代码
  433. openid: openId, // 用户微信OpenID
  434. specificDate: this.selectedDate, // 预约日期
  435. startTime: startTime, // 预约开始时间
  436. endTime: endTime // 预约结束时间
  437. }
  438. })
  439. try {
  440. const res = await FetchReserve(param);
  441. uni.hideLoading();
  442. if(res.code === 200){
  443. // 更新本地预约状态
  444. if(!this.userBookedDateList.includes(this.selectedDate)){
  445. this.userBookedDateList.push(this.selectedDate)
  446. }
  447. const old = this.userBookedMap[this.selectedDate] || []
  448. this.userBookedMap[this.selectedDate] = [...new Set([...old,...newSelectTimes])]
  449. const timeText = newSelectTimes.map(t=>this.formatShowTime(t)).join('\n');
  450. uni.showModal({
  451. title: '预约成功',
  452. content: `您已新增预约\n日期:${this.selectedDate}\n时间段:${timeText}`,
  453. showCancel: false,
  454. confirmText: '确定',
  455. success: async () => {
  456. // 重新拉取我的预约数据(里面同时拉闭馆公告)
  457. await this.initMyReservation();
  458. // 重新生成日历
  459. this.generateCalendar();
  460. // 重新刷新当前选中日期的时间段
  461. if(this.selectedDate){
  462. this.refreshTimeSlots(this.selectedDate);
  463. }
  464. }
  465. })
  466. }else{
  467. uni.showToast({ title: res.msg || '预约失败,请重试', icon: 'none' })
  468. }
  469. } catch (err) {
  470. uni.hideLoading();
  471. console.error('预约接口异常', err);
  472. uni.showToast({ title: '预约失败,请重试', icon: 'none' })
  473. }
  474. }
  475. }
  476. };
  477. </script>
  478. <style lang="scss" scoped>
  479. .booking-detail {
  480. min-height: 100vh;
  481. background-color: #f5f5f5;
  482. padding-bottom: 70px;
  483. }
  484. .section {
  485. background-color: #fff;
  486. margin: 10px;
  487. border-radius: 12px;
  488. padding: 16px;
  489. }
  490. // 闭馆公告板块
  491. .notice-section{
  492. background:#FCECE9;
  493. .notice-title{
  494. font-size:15px;
  495. font-weight:bold;
  496. color:#FD7359;
  497. margin-bottom:8px;
  498. }
  499. .notice-content{
  500. font-size:14px;
  501. color:#595959;
  502. line-height:1.6;
  503. }
  504. }
  505. // 时间板块整体置灰
  506. .section.disabled{
  507. opacity:0.55;
  508. pointer-events:none;
  509. }
  510. .disable-tip{
  511. margin-top:12px;
  512. font-size:13px;
  513. color:#999;
  514. text-align:center;
  515. }
  516. .calendar-wrap{
  517. background:#ffffff;
  518. border-radius:16px;
  519. }
  520. .calendar-top{
  521. display:flex;
  522. justify-content:space-between;
  523. align-items:center;
  524. margin-bottom:12px;
  525. }
  526. .calendar-title{
  527. font-size:17px;
  528. font-weight:bold;
  529. color:#222;
  530. }
  531. .calendar-month{
  532. font-size:16px;
  533. color:#333;
  534. font-weight:bold;
  535. }
  536. .calendar-days-grid{
  537. display:flex;
  538. flex-wrap:wrap;
  539. gap:8px;
  540. }
  541. .day-card{
  542. width: calc((100% - 48px) / 7);
  543. background:#f7f8fa;
  544. border-radius: 4px;
  545. padding: 4px 0;
  546. display:flex;
  547. flex-direction:column;
  548. align-items:center;
  549. justify-content:flex-start;
  550. position:relative;
  551. overflow: hidden;
  552. }
  553. /* 今天左上角蓝色三角 */
  554. .corner-block-today{
  555. position:absolute;
  556. top:0;
  557. left:0;
  558. width: 0;
  559. height: 0;
  560. border-top: 12px solid #01a4fe;
  561. border-right: 12px solid transparent;
  562. }
  563. /* 已预约 橙色三角角标 */
  564. .corner-block-booked{
  565. position:absolute;
  566. top:0;
  567. left:0;
  568. width: 0;
  569. height: 0;
  570. border-top: 12px solid #ff7800;
  571. border-right: 12px solid transparent;
  572. }
  573. .card-week{
  574. font-size:12px;
  575. color:#666;
  576. margin-bottom:4px;
  577. }
  578. .card-num{
  579. font-size:18px;
  580. font-weight:bold;
  581. color:#333;
  582. }
  583. .card-status{
  584. font-size:11px;
  585. margin-top:4px;
  586. }
  587. /* 可预约 */
  588. .day-card.card-available{
  589. background:#e8f4fd;
  590. }
  591. .day-card.card-available .card-status{
  592. color:#01a4fe;
  593. }
  594. /* 闭馆/不可选 */
  595. .day-card.card-disabled{
  596. background:#f7f8fa;
  597. }
  598. .day-card.card-disabled .card-week,
  599. .day-card.card-disabled .card-num,
  600. .day-card.card-disabled .card-status{
  601. color:#999;
  602. }
  603. /* 选中状态 */
  604. .day-card.card-selected{
  605. background:#01a4fe;
  606. }
  607. .day-card.card-selected .card-week,
  608. .day-card.card-selected .card-num,
  609. .day-card.card-selected .card-status{
  610. color:#ffffff;
  611. }
  612. .day-card.card-user-booked{
  613. background:#FFF3E5;
  614. }
  615. .day-card.card-user-booked .card-week,
  616. .day-card.card-user-booked .card-num,
  617. .day-card.card-user-booked .card-status{
  618. color:#ff7800;
  619. }
  620. .day-card.card-user-booked.card-selected{
  621. background:#ff7800;
  622. }
  623. .day-card.card-user-booked.card-selected .card-week,
  624. .day-card.card-user-booked.card-selected .card-num,
  625. .day-card.card-user-booked.card-selected .card-status{
  626. color:#fff;
  627. }
  628. .day-card.card-temp-close .card-status{
  629. color:#999;
  630. }
  631. .day-card.card-temp-close.card-selected {
  632. background:#888;
  633. }
  634. .day-card.card-temp-close.card-selected .card-week,
  635. .day-card.card-temp-close.card-selected .card-num,
  636. .day-card.card-temp-close.card-selected .card-status{
  637. color:#fff;
  638. }
  639. /* 时间选择 */
  640. .section-title {
  641. font-size: 16px;
  642. font-weight: bold;
  643. color: #333;
  644. margin-bottom: 16px;
  645. }
  646. .time-slots {
  647. display: flex;
  648. flex-wrap: wrap;
  649. gap: 10px;
  650. }
  651. .time-item {
  652. position: relative;
  653. width: calc(50% - 5px);
  654. display: flex;
  655. align-items: center;
  656. justify-content: space-between;
  657. padding: 12px;
  658. background-color: #f8f8f8;
  659. border-radius: 8px;
  660. border: 1px solid transparent;
  661. }
  662. .time-item.selected {
  663. background-color: #e8f4fd;
  664. border-color: #01a4fe;
  665. }
  666. .time-item.disabled{
  667. pointer-events:none;
  668. }
  669. .time-item.booked-item{
  670. background: #fff3e5;
  671. border:1px solid #ffb870;
  672. .time-text{
  673. color:#ff7800;
  674. }
  675. }
  676. .booked-tag{
  677. font-size:11px;
  678. color:#ff7800;
  679. }
  680. .time-text {
  681. font-size: 14px;
  682. color: #333;
  683. }
  684. .available-badge {
  685. font-size: 12px;
  686. color: #01a4fe;
  687. background-color: #e8f4fd;
  688. padding: 2px 8px;
  689. border-radius: 10px;
  690. }
  691. .unavailable-badge {
  692. font-size: 12px;
  693. color: #999;
  694. background-color: #f0f0f0;
  695. padding: 2px 8px;
  696. border-radius: 10px;
  697. }
  698. /* 底部按钮 */
  699. .bottom-bar {
  700. position: fixed;
  701. bottom: 0;
  702. left: 0;
  703. right: 0;
  704. padding: 10px;
  705. background-color: #fff;
  706. box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.1);
  707. }
  708. .btn-primary {
  709. width: 100%;
  710. height: 44px;
  711. line-height: 44px;
  712. background-color: #01a4fe;
  713. color: #fff;
  714. border-radius: 22px;
  715. font-size: 15px;
  716. border: none;
  717. }
  718. .btn-primary::after {
  719. border: none;
  720. }
  721. .btn-primary[disabled]{
  722. background:#b8d8f5 !important;
  723. }
  724. .operate-desc{
  725. margin:10px;
  726. padding:16px;
  727. border-radius:12px;
  728. background:#fff;
  729. .section-title{
  730. margin-bottom:10px !important;
  731. }
  732. .desc-item{
  733. line-height:2;
  734. font-size:13px;
  735. }
  736. .color-blue{
  737. text{
  738. color:#01a4fe;
  739. }
  740. }
  741. .color-orange{
  742. text{
  743. color:#ff7800;
  744. }
  745. }
  746. .color-gray{
  747. text{
  748. color:#999;
  749. }
  750. }
  751. .color-close{
  752. text{
  753. color:#FD7359;
  754. font-weight:500;
  755. }
  756. }
  757. }
  758. </style>