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

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