本组件实现了服务时间的选择功能,通过弹窗的形式让用户能够选择不同的时间段及其对应的服务时间。
功能实现
- 时间段切换:用户可以通过点击不同的标签来切换上午和下午的时间段。
- 时间列表展示:根据所选时间段展示对应的服务时间列表。
- 数据获取:通过 API 请求获取服务时间数据,并将其按照时间段分类展示。
技术要点
- Vue 组件: 使用 Vue.js 构建可复用的 UI 组件。
- 状态管理: 利用
ref
来管理组件内部的状态。 - API 调用: 通过
ApiGetStaffServiceTimeByStaffId
方法获取服务时间数据。 - 样式定制: 使用 SCSS 定制组件的样式,提升用户体验。
示例代码
以上为组件的基本实现和使用说明,可以根据具体需求进行扩展和优化。