当前位置: 首页 > news >正文

美业医疗美容院小程序,预约会员管理养生馆诊所肌护肤理疗系统,附源码交付

预约会员小程序代码示例

前端页面代码 (WXML)

<view class="container"> <picker mode="selector" range="{{services}}" range-key="name" bindchange="selectService"> <view class="picker">选择服务:{{selectedService.name || '请选择'}}</view> </picker> <picker mode="date" start="{{today}}" end="{{maxDate}}" bindchange="selectDate"> <view class="picker">选择日期:{{selectedDate || '请选择'}}</view> </picker> <picker mode="time" start="09:00" end="21:00" bindchange="selectTime"> <view class="picker">选择时间:{{selectedTime || '请选择'}}</view> </picker> <input type="text" placeholder="请输入姓名" bindinput="inputName"/> <input type="number" placeholder="请输入手机号" bindinput="inputPhone"/> <button type="primary" bindtap="submitReservation" disabled="{{!formValid}}">提交预约</button> </view>

逻辑层代码 (JS)

Page({ data: { services: [ { id: 1, name: '基础护理' }, { id: 2, name: '深度清洁' }, { id: 3, name: '专业理疗' } ], selectedService: {}, today: new Date().toISOString().split('T')[0], maxDate: new Date(Date.now() + 30*24*60*60*1000).toISOString().split('T')[0], selectedDate: '', selectedTime: '', name: '', phone: '', formValid: false }, selectService(e) { const index = e.detail.value this.setData({ selectedService: this.data.services[index] }) this.checkForm() }, selectDate(e) { this.setData({ selectedDate: e.detail.value }) this.checkForm() }, selectTime(e) { this.setData({ selectedTime: e.detail.value }) this.checkForm() }, inputName(e) { this.setData({ name: e.detail.value }) this.checkForm() }, inputPhone(e) { this.setData({ phone: e.detail.value }) this.checkForm() }, checkForm() { const valid = this.data.selectedService.id && this.data.selectedDate && this.data.selectedTime && this.data.name && /^1[3-9]\d{9}$/.test(this.data.phone) this.setData({ formValid: valid }) }, submitReservation() { wx.request({ url: 'https://your-api-domain.com/reservations', method: 'POST', data: { serviceId: this.data.selectedService.id, date: this.data.selectedDate, time: this.data.selectedTime, name: this.data.name, phone: this.data.phone }, success(res) { wx.showToast({ title: '预约成功', icon: 'success' }) }, fail() { wx.showToast({ title: '预约失败', icon: 'none' }) } }) } })

样式代码 (WXSS)

.container { padding: 20px; } .picker { margin: 15px 0; padding: 10px; border: 1px solid #ddd; border-radius: 4px; } input { margin: 15px 0; padding: 10px; border: 1px solid #ddd; border-radius: 4px; } button { margin-top: 20px; }

功能说明

  1. 服务选择:通过picker组件提供可选择的会员服务列表
  2. 时间选择:限制可预约日期范围为当天至30天后,时间限制在9:00-21:00
  3. 表单验证:实时检查表单完整性,包括手机号格式验证
  4. 数据提交:通过wx.request将预约信息提交至后端API

后端接口建议

需要配套的后端接口支持,建议包含以下功能:

  • 接收预约请求并存储到数据库
  • 检查时间冲突
  • 发送预约确认通知
  • 会员积分管理

代码可根据实际需求进行调整,如增加会员等级判断、优惠券使用等功能。

http://www.jsqmd.com/news/81637/

相关文章:

  • 27、Linux X Window System 全面解析
  • 2025年12月社区银发经济,社区亲子经济,社区智慧化经济推荐:适老服务与场景覆盖测评 - 品牌鉴赏师
  • 3D生成效率提升终极指南:从技术瓶颈到商业突破
  • 2025年12月社区经济,社区小店经济,便民生活经济最新推荐,即时服务能力与口碑盘点 - 品牌鉴赏师
  • 5个关键场景揭秘:双栈网络配置实战指南
  • NoFences:免费的终极桌面图标管理解决方案
  • C++ VS python
  • Vetur代码补全终极指南:8个高效方法提升Vue开发效率
  • 5分钟玩转NotchDrop:让你的MacBook刘海变身智能交互中心
  • MotionGPT完整指南:5分钟掌握AI运动生成技术
  • Negroni分布式限流架构设计:3步构建高性能微服务保护系统
  • 小程序开发定制,团购商城点餐外卖跑腿系统,附源码
  • Noise-suppression-for-voice语音降噪工具:从技术原理到实战应用的全方位指南
  • OkDownload终极指南:5分钟掌握强大的Android下载引擎
  • C# 基于halcon的视觉工作流-章68 深度学习-对象检测
  • 采购部经理绩效考核量表设计与采购管理效能提升方案 - 详解
  • Ender3V2S1专业固件完整配置指南:从入门到精通
  • Rust二进制优化指南:三步突破体积瓶颈
  • 家政老板必读指南:简点到家“数字化+轻资产”双轮驱动,快速探索家政市场
  • 贪吃蛇小游戏
  • 分子预测新突破:图语言融合模型的技术解析与实践指南
  • OSCC开源汽车控制系统终极指南:从零构建自动驾驶平台
  • 13、Apache服务器安全配置与管理全解析
  • 终极指南:用Marp轻松创建专业级幻灯片
  • Shell脚本入门:让重复工作自动化
  • 14、深入解析 Apache 服务器安全、功能与故障排查
  • 河南实验家具实力厂商TOP5权威推荐:甄选优肯家具等实力厂家 - 工业品牌热点
  • 2025年浙江尺寸精度高的冷拉异型钢生产厂家推荐,看哪家实力 - mypinpai
  • Kubernetes多容器Pod日志收集实战:高效管理与深度解析
  • VDA 6.3标准:汽车行业质量审核的核心指南