图书馆小程序
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.

843 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
4 weeks ago
1 month ago
1 month ago
4 weeks 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
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
4 weeks ago
1 month 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
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
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
4 weeks 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
1 month ago
1 month ago
4 weeks 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
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
4 weeks 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
4 weeks 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
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
1 month ago
1 month ago
4 weeks 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
4 weeks ago
1 month ago
4 weeks 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. <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: config.LIB_CODE,
  197. openId: openId
  198. })
  199. console.log('初始化我的预约',res)
  200. if(res.code === 200 && res.data){
  201. // 闭馆
  202. this.tempCloseDateList = []
  203. this.tempCloseNoticeMap = {}
  204. // 处理闭馆公告 vxLibraryClosureNotices
  205. const closureList = Array.isArray(res.data.vxLibraryClosureNotices) ? res.data.vxLibraryClosureNotices : []
  206. closureList.forEach(notice=>{
  207. const dayArr = this.expandClosureRange(notice.closureStartDate, notice.closureEndDate)
  208. dayArr.forEach(dateStr=>{
  209. if(!this.tempCloseDateList.includes(dateStr)){
  210. this.tempCloseDateList.push(dateStr)
  211. }
  212. // 同一个日期多条公告,用换行拼接;覆盖也可以看业务需求
  213. if(this.tempCloseNoticeMap[dateStr]){
  214. this.tempCloseNoticeMap[dateStr] += '\n\n' + notice.content
  215. }else{
  216. this.tempCloseNoticeMap[dateStr] = notice.content
  217. }
  218. })
  219. })
  220. // ==========处理用户预约 myReservation==========
  221. this.userBookedDateList = []
  222. this.userBookedMap = {}
  223. const myRes = Array.isArray(res.data.myReservation) ? res.data.myReservation : []
  224. myRes.forEach(item=>{
  225. // specificDate 毫秒时间戳
  226. const dateStr = this.formatTsToDate(item.specificDate)
  227. const startHm = this.formatTimeHm(item.startTime)
  228. const endHm = this.formatTimeHm(item.endTime)
  229. const timeSlotText = `${startHm} - ${endHm}`
  230. if(!this.userBookedMap[dateStr]){
  231. this.userBookedMap[dateStr] = []
  232. }
  233. this.userBookedMap[dateStr].push(timeSlotText)
  234. })
  235. // 收集已预约日期
  236. this.userBookedDateList = Object.keys(this.userBookedMap)
  237. }
  238. } catch (e) {
  239. console.error('获取我的预约异常', e)
  240. }
  241. },
  242. transformReserveConfig(apiData){
  243. const { baseSetting, weekJson } = apiData;
  244. const weekKeyMap = {
  245. 1: 'monday',
  246. 2: 'tuesday',
  247. 3: 'wednesday',
  248. 4: 'thursday',
  249. 5: 'friday',
  250. 6: 'saturday',
  251. 7: 'sunday'
  252. };
  253. const weekDays = [];
  254. for(let wId=1;wId<=7;wId++){
  255. const propName = weekKeyMap[wId];
  256. const checked = !!baseSetting[propName];
  257. const timeArr = weekJson[wId] || [];
  258. // 把startTime[h,m], endTime[h,m]转 "HH:mm - HH:mm"
  259. const times = timeArr.map(item=>{
  260. const sh = String(item.startTime[0]).padStart(2,'0');
  261. const sm = String(item.startTime[1]).padStart(2,'0');
  262. const eh = String(item.endTime[0]).padStart(2,'0');
  263. const em = String(item.endTime[1]).padStart(2,'0');
  264. return `${sh}:${sm} - ${eh}:${em}`;
  265. })
  266. weekDays.push({
  267. id:wId,
  268. name:this.getWeekText(wId),
  269. checked: checked,
  270. times: times,
  271. showPicker: false,
  272. newTime: ""
  273. })
  274. }
  275. return {
  276. frequency: String(baseSetting.advanceBookingDays),
  277. weekDays
  278. }
  279. },
  280. // 初始化预约设置
  281. async initReservationSettings() {
  282. try {
  283. const res = await FetchInitLibraryReservationSettings({
  284. libcode: config.LIB_CODE
  285. })
  286. if (res && res.code === 200 && res.data) {
  287. this.reserveConfig = this.transformReserveConfig(res.data);
  288. }else{
  289. console.error('初始化预约设置失败',res)
  290. }
  291. } catch (e) {
  292. console.error('获取预约设置异常', e)
  293. }
  294. },
  295. getWeekNum(dateStr) {
  296. const d = new Date(dateStr);
  297. const day = d.getDay();
  298. return day === 0 ? 7 : day
  299. },
  300. getWeekText(weekNo){
  301. const map = {1:'周一',2:'周二',3:'周三',4:'周四',5:'周五',6:'周六',7:'周日'}
  302. return map[weekNo]
  303. },
  304. generateCalendar() {
  305. if(!this.reserveConfig) return;
  306. const today = new Date();
  307. const todayStr = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, '0')}-${String(today.getDate()).padStart(2, '0')}`;
  308. const freq = Number(this.reserveConfig.frequency);
  309. const allowDateList = [];
  310. for(let i = 0; i < freq; i++){
  311. const temp = new Date(today);
  312. temp.setDate(today.getDate() + i);
  313. const ds = `${temp.getFullYear()}-${String(temp.getMonth()+1).padStart(2,'0')}-${String(temp.getDate()).padStart(2,'0')}`
  314. allowDateList.push(ds)
  315. }
  316. const list = []
  317. allowDateList.forEach(dateStr=>{
  318. const weekNo = this.getWeekNum(dateStr)
  319. const weekCfg = this.reserveConfig.weekDays.find(w => w.id === weekNo)
  320. const available = !!weekCfg?.checked
  321. const d = new Date(dateStr)
  322. const tempClose = this.tempCloseDateList.includes(dateStr)
  323. const userHasBooked = this.userBookedDateList.includes(dateStr)
  324. list.push({
  325. day: d.getDate(),
  326. date: dateStr,
  327. weekText: this.getWeekText(weekNo),
  328. available: available,
  329. isToday: dateStr === todayStr,
  330. tempClose: tempClose,
  331. userHasBooked: userHasBooked
  332. })
  333. })
  334. this.calendarDays = list
  335. // 找第一个不是闭馆的有效日期作为初始选中
  336. const firstAvail = this.calendarDays.find(d => d.available && !d.tempClose);
  337. if(firstAvail){
  338. this.selectedDate = firstAvail.date
  339. this.refreshTimeSlots(this.selectedDate)
  340. }else{
  341. this.selectedDate = ''
  342. this.timeSlots = []
  343. }
  344. },
  345. refreshTimeSlots(dateStr){
  346. if(!dateStr) {
  347. this.timeSlots = []
  348. return
  349. }
  350. const weekNo = this.getWeekNum(dateStr)
  351. const weekCfg = this.reserveConfig.weekDays.find(w => w.id === weekNo)
  352. if(!weekCfg || !weekCfg.checked){
  353. this.timeSlots = []
  354. return
  355. }
  356. // 当前日期已经预约的时间段
  357. const bookedTimeArr = this.userBookedMap[dateStr] || []
  358. this.timeSlots = weekCfg.times.map((t, idx)=>{
  359. // 判断是否全天
  360. const displayText = t === '00:00 - 23:59' ? '全天' : t
  361. return {
  362. id: idx + 1,
  363. time: t, // 原始时间字符串,用于选中判断、提交,不变
  364. displayText, // 页面渲染展示文本
  365. available: true,
  366. isUserBooked: bookedTimeArr.includes(t)
  367. }
  368. })
  369. // 回填历史已预约时间段,不能取消
  370. this.selectedTimeList = [...bookedTimeArr]
  371. },
  372. selectDate(day) {
  373. // 普通不可选(非临时闭馆):弹提示,禁止选中
  374. if (!day.available && !day.tempClose) {
  375. uni.showToast({
  376. title: '超出可选的时间范围,请选择其他日期',
  377. icon: 'none'
  378. })
  379. return;
  380. }
  381. // 临时闭馆 || 正常可预约:允许选中
  382. this.selectedDate = day.date;
  383. this.refreshTimeSlots(day.date);
  384. },
  385. selectTime(slot) {
  386. if(this.isSelectCloseDay) return
  387. if (!slot.available) return;
  388. // 已预约时间段禁止取消
  389. if(slot.isUserBooked){
  390. uni.showToast({
  391. title:"该时间段已预约,不可操作取消",
  392. icon:"none"
  393. })
  394. return
  395. }
  396. const idx = this.selectedTimeList.indexOf(slot.time)
  397. if(idx > -1){
  398. // 本次新增的,可以取消
  399. this.selectedTimeList.splice(idx,1)
  400. }else{
  401. this.selectedTimeList.push(slot.time)
  402. }
  403. },
  404. async confirmBooking() {
  405. if(this.isSelectCloseDay){
  406. uni.showToast({title:"该日期闭馆,无法预约",icon:"none"})
  407. return
  408. }
  409. if (!this.selectedDate) {
  410. uni.showToast({ title: '请选择日期', icon: 'none' });
  411. return;
  412. }
  413. const bookedTimeArr = this.userBookedMap[this.selectedDate] || []
  414. // 过滤:只取本次新增勾选的时间段
  415. const newSelectTimes = this.selectedTimeList.filter(item=> !bookedTimeArr.includes(item))
  416. if (!newSelectTimes || newSelectTimes.length === 0) {
  417. uni.showToast({ title: '请选择需要新增预约的时间段', icon: 'none' });
  418. return;
  419. }
  420. uni.showLoading({ title: '预约中...' });
  421. const openId = await getOpenId();
  422. if (!openId) {
  423. uni.hideLoading();
  424. uni.showToast({ title: '获取用户openid失败', icon: 'none' });
  425. return;
  426. }
  427. // 组装数组参数,后端接收对象数组
  428. const param = newSelectTimes.map(timeStr => {
  429. const [startPart, endPart] = timeStr.split(' - ');
  430. const startTime = startPart.trim() + ':00';
  431. const endTime = endPart.trim() + ':00';
  432. return {
  433. libcode: config.LIB_CODE, // 馆代码
  434. openid: openId, // 用户微信OpenID
  435. specificDate: this.selectedDate, // 预约日期
  436. startTime: startTime, // 预约开始时间
  437. endTime: endTime // 预约结束时间
  438. }
  439. })
  440. try {
  441. const res = await FetchReserve(param);
  442. uni.hideLoading();
  443. if(res.code === 200){
  444. // 更新本地预约状态
  445. if(!this.userBookedDateList.includes(this.selectedDate)){
  446. this.userBookedDateList.push(this.selectedDate)
  447. }
  448. const old = this.userBookedMap[this.selectedDate] || []
  449. this.userBookedMap[this.selectedDate] = [...new Set([...old,...newSelectTimes])]
  450. const timeText = newSelectTimes.map(t=>this.formatShowTime(t)).join('\n');
  451. uni.showModal({
  452. title: '预约成功',
  453. content: `您已新增预约\n日期:${this.selectedDate}\n时间段:${timeText}`,
  454. showCancel: false,
  455. confirmText: '确定',
  456. success: async () => {
  457. // 重新拉取我的预约数据(里面同时拉闭馆公告)
  458. await this.initMyReservation();
  459. // 重新生成日历
  460. this.generateCalendar();
  461. // 重新刷新当前选中日期的时间段
  462. if(this.selectedDate){
  463. this.refreshTimeSlots(this.selectedDate);
  464. }
  465. }
  466. })
  467. }else{
  468. uni.showToast({ title: res.msg || '预约失败,请重试', icon: 'none' })
  469. }
  470. } catch (err) {
  471. uni.hideLoading();
  472. console.error('预约接口异常', err);
  473. uni.showToast({ title: '预约失败,请重试', icon: 'none' })
  474. }
  475. }
  476. }
  477. };
  478. </script>
  479. <style lang="scss" scoped>
  480. .booking-detail {
  481. min-height: 100vh;
  482. background-color: #f5f5f5;
  483. padding-bottom: 70px;
  484. }
  485. .section {
  486. background-color: #fff;
  487. margin: 10px;
  488. border-radius: 12px;
  489. padding: 16px;
  490. }
  491. // 闭馆公告板块
  492. .notice-section{
  493. background:#FCECE9;
  494. .notice-title{
  495. font-size:15px;
  496. font-weight:bold;
  497. color:#FD7359;
  498. margin-bottom:8px;
  499. }
  500. .notice-content{
  501. font-size:14px;
  502. color:#595959;
  503. line-height:1.6;
  504. }
  505. }
  506. // 时间板块整体置灰
  507. .section.disabled{
  508. opacity:0.55;
  509. pointer-events:none;
  510. }
  511. .disable-tip{
  512. margin-top:12px;
  513. font-size:13px;
  514. color:#999;
  515. text-align:center;
  516. }
  517. .calendar-wrap{
  518. background:#ffffff;
  519. border-radius:16px;
  520. }
  521. .calendar-top{
  522. display:flex;
  523. justify-content:space-between;
  524. align-items:center;
  525. margin-bottom:12px;
  526. }
  527. .calendar-title{
  528. font-size:17px;
  529. font-weight:bold;
  530. color:#222;
  531. }
  532. .calendar-month{
  533. font-size:16px;
  534. color:#333;
  535. font-weight:bold;
  536. }
  537. .calendar-days-grid{
  538. display:flex;
  539. flex-wrap:wrap;
  540. gap:8px;
  541. }
  542. .day-card{
  543. width: calc((100% - 48px) / 7);
  544. background:#f7f8fa;
  545. border-radius: 4px;
  546. padding: 4px 0;
  547. display:flex;
  548. flex-direction:column;
  549. align-items:center;
  550. justify-content:flex-start;
  551. position:relative;
  552. overflow: hidden;
  553. }
  554. /* 今天左上角蓝色三角 */
  555. .corner-block-today{
  556. position:absolute;
  557. top:0;
  558. left:0;
  559. width: 0;
  560. height: 0;
  561. border-top: 12px solid #01a4fe;
  562. border-right: 12px solid transparent;
  563. }
  564. /* 已预约 橙色三角角标 */
  565. .corner-block-booked{
  566. position:absolute;
  567. top:0;
  568. left:0;
  569. width: 0;
  570. height: 0;
  571. border-top: 12px solid #ff7800;
  572. border-right: 12px solid transparent;
  573. }
  574. .card-week{
  575. font-size:12px;
  576. color:#666;
  577. margin-bottom:4px;
  578. }
  579. .card-num{
  580. font-size:18px;
  581. font-weight:bold;
  582. color:#333;
  583. }
  584. .card-status{
  585. font-size:11px;
  586. margin-top:4px;
  587. }
  588. /* 可预约 */
  589. .day-card.card-available{
  590. background:#e8f4fd;
  591. }
  592. .day-card.card-available .card-status{
  593. color:#01a4fe;
  594. }
  595. /* 闭馆/不可选 */
  596. .day-card.card-disabled{
  597. background:#f7f8fa;
  598. }
  599. .day-card.card-disabled .card-week,
  600. .day-card.card-disabled .card-num,
  601. .day-card.card-disabled .card-status{
  602. color:#999;
  603. }
  604. /* 选中状态 */
  605. .day-card.card-selected{
  606. background:#01a4fe;
  607. }
  608. .day-card.card-selected .card-week,
  609. .day-card.card-selected .card-num,
  610. .day-card.card-selected .card-status{
  611. color:#ffffff;
  612. }
  613. .day-card.card-user-booked{
  614. background:#FFF3E5;
  615. }
  616. .day-card.card-user-booked .card-week,
  617. .day-card.card-user-booked .card-num,
  618. .day-card.card-user-booked .card-status{
  619. color:#ff7800;
  620. }
  621. .day-card.card-user-booked.card-selected{
  622. background:#ff7800;
  623. }
  624. .day-card.card-user-booked.card-selected .card-week,
  625. .day-card.card-user-booked.card-selected .card-num,
  626. .day-card.card-user-booked.card-selected .card-status{
  627. color:#fff;
  628. }
  629. .day-card.card-temp-close .card-status{
  630. color:#999;
  631. }
  632. .day-card.card-temp-close.card-selected {
  633. background:#888;
  634. }
  635. .day-card.card-temp-close.card-selected .card-week,
  636. .day-card.card-temp-close.card-selected .card-num,
  637. .day-card.card-temp-close.card-selected .card-status{
  638. color:#fff;
  639. }
  640. /* 时间选择 */
  641. .section-title {
  642. font-size: 16px;
  643. font-weight: bold;
  644. color: #333;
  645. margin-bottom: 16px;
  646. }
  647. .time-slots {
  648. display: flex;
  649. flex-wrap: wrap;
  650. gap: 10px;
  651. }
  652. .time-item {
  653. position: relative;
  654. width: calc(50% - 5px);
  655. display: flex;
  656. align-items: center;
  657. justify-content: space-between;
  658. padding: 12px;
  659. background-color: #f8f8f8;
  660. border-radius: 8px;
  661. border: 1px solid transparent;
  662. }
  663. .time-item.selected {
  664. background-color: #e8f4fd;
  665. border-color: #01a4fe;
  666. }
  667. .time-item.disabled{
  668. pointer-events:none;
  669. }
  670. .time-item.booked-item{
  671. background: #fff3e5;
  672. border:1px solid #ffb870;
  673. .time-text{
  674. color:#ff7800;
  675. }
  676. }
  677. .booked-tag{
  678. font-size:11px;
  679. color:#ff7800;
  680. }
  681. .time-text {
  682. font-size: 14px;
  683. color: #333;
  684. }
  685. .available-badge {
  686. font-size: 12px;
  687. color: #01a4fe;
  688. background-color: #e8f4fd;
  689. padding: 2px 8px;
  690. border-radius: 10px;
  691. }
  692. .unavailable-badge {
  693. font-size: 12px;
  694. color: #999;
  695. background-color: #f0f0f0;
  696. padding: 2px 8px;
  697. border-radius: 10px;
  698. }
  699. /* 底部按钮 */
  700. .bottom-bar {
  701. position: fixed;
  702. bottom: 0;
  703. left: 0;
  704. right: 0;
  705. padding: 10px;
  706. background-color: #fff;
  707. box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.1);
  708. }
  709. .btn-primary {
  710. width: 100%;
  711. height: 44px;
  712. line-height: 44px;
  713. background-color: #01a4fe;
  714. color: #fff;
  715. border-radius: 22px;
  716. font-size: 15px;
  717. border: none;
  718. }
  719. .btn-primary::after {
  720. border: none;
  721. }
  722. .btn-primary[disabled]{
  723. background:#b8d8f5 !important;
  724. }
  725. .operate-desc{
  726. margin:10px;
  727. padding:16px;
  728. border-radius:12px;
  729. background:#fff;
  730. .section-title{
  731. margin-bottom:10px !important;
  732. }
  733. .desc-item{
  734. line-height:2;
  735. font-size:13px;
  736. }
  737. .color-blue{
  738. text{
  739. color:#01a4fe;
  740. }
  741. }
  742. .color-orange{
  743. text{
  744. color:#ff7800;
  745. }
  746. }
  747. .color-gray{
  748. text{
  749. color:#999;
  750. }
  751. }
  752. .color-close{
  753. text{
  754. color:#FD7359;
  755. font-weight:500;
  756. }
  757. }
  758. }
  759. </style>