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

240 lines
5.5 KiB

  1. <template>
  2. <view class="seat-booking">
  3. <!-- 顶部横幅 -->
  4. <view class="banner">
  5. <image class="banner-bg" src="@/static/images/mingqi-beij@2x.png" mode="aspectFill"></image>
  6. <view class="banner-overlay">
  7. <text class="banner-text">葛店经济开发区图书馆预约</text>
  8. </view>
  9. </view>
  10. <view class="content">
  11. <!-- 场馆选择下拉框 -->
  12. <!-- <view class="venue-select">
  13. <picker :value="venueIndex" :range="venues" @change="onVenueChange">
  14. <view class="picker-content">
  15. <text>{{ venues[venueIndex] }}</text>
  16. <uni-icons type="down" size="16" color="#666" />
  17. </view>
  18. </picker>
  19. </view> -->
  20. <!-- 楼层/区域卡片列表 -->
  21. <view class="floor-list">
  22. <view class="floor-item" v-for="floor in floorList" :key="floor.id">
  23. <text class="floor-name">{{ floor.floor }}</text>
  24. <div class="floor-info">
  25. <view class="floor-left">
  26. <text class="floor-title">{{ floor.title }}</text>
  27. <image class="banner-bg" src="@/static/images/lib.png" mode="aspectFill"></image>
  28. </view>
  29. <view class="floor-right">
  30. <text class="floor-desc">{{ floor.desc }}</text>
  31. <view style="display: flex; justify-content: flex-end; width: 100%; text-align: end;">
  32. <button class="booking-btn" @click="bookingFloor(floor)">预约</button>
  33. </view>
  34. </view>
  35. </div>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. export default {
  43. data() {
  44. return {
  45. venueIndex: 0,
  46. venues: ['所有场馆', '东馆', '西馆', '南馆'],
  47. floorList: [
  48. {
  49. id: 1,
  50. floor: '3楼',
  51. title: '综合阅览一',
  52. desc: '葛店图书馆三楼阅读广场共有464个座位,为读者提供备电源,读者可预约选择心仪的座位。区域采光良好,环境优美,读者可在休息时一览楼下的风景。',
  53. image: '@/static/images/lib.png'
  54. },
  55. {
  56. id: 2,
  57. floor: '3楼',
  58. title: '少儿阅览室',
  59. desc: '少儿阅览室共有464个座位,为读者提供备电源、读者可自助选择位置,各个区采光良好,环境优美,读者可在休息时一览楼下的风景。',
  60. image: '@/static/images/lib.png'
  61. },
  62. {
  63. id: 3,
  64. floor: '3楼',
  65. title: '专题阅览室',
  66. desc: '专题阅览室共有464个座位,为读者提供备电源、读者可自助选择位置,各个区采光良好,环境优美,读者可在休息时一览楼下的风景。',
  67. image: '@/static/images/lib.png'
  68. }
  69. ]
  70. };
  71. },
  72. onLoad() {
  73. this.loadSeatInfo();
  74. },
  75. methods: {
  76. loadSeatInfo() {
  77. console.log('加载座位信息');
  78. },
  79. onVenueChange(e) {
  80. this.venueIndex = e.detail.value;
  81. console.log('切换场馆:', this.venues[this.venueIndex]);
  82. },
  83. bookingFloor(floor) {
  84. uni.navigateTo({
  85. url: `/subpkg/pages/booking-detail/booking-detail?floor=${floor.floor}&title=${floor.title}`
  86. });
  87. }
  88. }
  89. };
  90. </script>
  91. <style lang="scss" scoped>
  92. .seat-booking {
  93. min-height: 100vh;
  94. background-color: #f5f7fa;
  95. }
  96. /* 顶部横幅 */
  97. .banner {
  98. position: relative;
  99. height: 140px;
  100. }
  101. .banner-bg {
  102. width: 100%;
  103. height: 100%;
  104. }
  105. .banner-overlay {
  106. position: absolute;
  107. top: 0;
  108. left: 0;
  109. right: 0;
  110. bottom: 0;
  111. background-color: rgba(0, 0, 0, 0.2);
  112. display: flex;
  113. align-items: center;
  114. justify-content: center;
  115. }
  116. .banner-text {
  117. color: #fff;
  118. font-size: 20px;
  119. font-weight: 500;
  120. }
  121. .content {
  122. padding: 16px;
  123. // margin-top: -20px;
  124. position: relative;
  125. z-index: 10;
  126. }
  127. /* 场馆选择下拉框 */
  128. .venue-select {
  129. display: flex;
  130. justify-content: flex-end;
  131. margin-bottom: 16px;
  132. }
  133. .picker-content {
  134. display: flex;
  135. align-items: center;
  136. gap: 4px;
  137. padding: 8px 16px;
  138. background-color: #fff;
  139. border: 1px solid #ddd;
  140. border-radius: 4px;
  141. font-size: 14px;
  142. color: #333;
  143. }
  144. /* 楼层卡片 */
  145. .floor-list {
  146. background-color: #fff;
  147. border-radius: 12px;
  148. padding: 16px;
  149. box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  150. }
  151. .floor-item {
  152. margin-bottom: 16px;
  153. padding-bottom: 16px;
  154. border-bottom: 1px solid #eee;
  155. &:last-child {
  156. margin-bottom: 0;
  157. padding-bottom: 0;
  158. border-bottom: none;
  159. }
  160. }
  161. .floor-name {
  162. display: block;
  163. font-size: 16px;
  164. font-weight: bold;
  165. padding-bottom: 8px;
  166. }
  167. .floor-info{
  168. display: inline-flex;
  169. align-items: flex-start;
  170. justify-content: space-between;
  171. }
  172. .floor-left {
  173. position: relative;
  174. width: 90px;
  175. height: 100px;
  176. border-radius: 8px;
  177. margin-right: 12px;
  178. }
  179. .floor-image {
  180. width: 90px;
  181. height: 100px;
  182. object-fit: cover;
  183. }
  184. .floor-title {
  185. position: absolute;
  186. bottom: 0;
  187. left: 0;
  188. width: 100%;
  189. text-align: center;
  190. padding: 4px 0;
  191. background-color: rgba(0, 0, 0, 0.5);
  192. color: #fff;
  193. // font-weight: bold;
  194. font-size: 12px;
  195. // font-weight: bold;
  196. }
  197. .floor-right {
  198. flex: 1;
  199. display: flex;
  200. flex-direction: column;
  201. justify-content: space-between;
  202. }
  203. .floor-desc {
  204. font-size: 13px;
  205. color: #666;
  206. line-height: 1.5;
  207. margin-bottom: 8px;
  208. overflow: hidden;
  209. text-overflow: ellipsis;
  210. display: -webkit-box;
  211. -webkit-box-orient: vertical;
  212. -webkit-line-clamp: 3;
  213. }
  214. .booking-btn {
  215. background-color: #01a4fe;
  216. color: #fff;
  217. font-size: 14px;
  218. padding: 0 20px;
  219. border: none;
  220. margin: 6px 0 0 0;
  221. height: 30px;
  222. line-height: 30px;
  223. }
  224. .booking-btn::after {
  225. border: none;
  226. }
  227. </style>