{
  "openapi": "3.0.0",
  "info": {
    "title": "小袋鼠绿通服务 · 陪诊用户端 API",
    "description": "陪诊用户端小程序接口文档（与 `陪诊用户端/api/*.js` 一一对应）。\n\n当前工程处于 Mock 模式（`api/request.js` 中 `USE_MOCK = true`），所有接口数据由前端 `mock/` 层返回，页面无感知。\n\n## 统一返回格式\n\n所有接口返回统一结构：\n\n```json\n{ \"code\": 200, \"message\": \"ok\", \"data\": { ... } }\n```\n\n- `code`：200 表示成功，非 200 为业务失败（由 request 层 Toast 提示并 reject）。\n- `message`：提示信息。\n- `data`：业务数据，即本文档中各接口的 `Response` 结构。\n\n## 通用枚举\n\n- 订单状态 `status`：`unpaid`（待支付）/ `pending`（待分配）/ `assigned`（已分配，待开始服务）/ `serving`（服务中）/ `done`（已完成）/ `cancel`（已取消）/ `refunded`（已退款）\n- 券包购买记录状态 `status`：`done`（已支付）/ `unpaid`（待支付）/ `cancel`（已取消）\n\n## 计费规则\n\n- 会员折扣：开通会员后按服务 `memberPrice` 计价（默认黄金 9 折）。\n- 夜间服务费：预约时段 22:00 之后下单，额外 +¥100（`nightFee`）。\n- 包车费：单趟接送 +¥75，往返接送 +¥150（`carFee`）。\n- 优惠券：每笔订单限用 1 张，按 `amount` 抵扣（`couponDiscount`）。\n- 赠送服务：随单赠送平安保险（`value-added`），不参与实付金额计算。",
    "version": "1.0.0",
    "contact": {
      "name": "小袋鼠绿通服务"
    }
  },
  "servers": [
    {
      "url": "https://api.example.com",
      "description": "Mock 模式占位地址（USE_MOCK = true 时实际数据由前端 mock 层返回）"
    }
  ],
  "tags": [
    {
      "name": "首页",
      "description": "定位城市、运营轮播、品类入口、服务商品"
    },
    {
      "name": "服务",
      "description": "服务商品列表、详情、搜索"
    },
    {
      "name": "订单",
      "description": "订单列表、创建、支付、取消、追加服务"
    },
    {
      "name": "优惠券",
      "description": "用户券、兑换、优惠中心、购买记录"
    },
    {
      "name": "地址",
      "description": "地址簿管理、演示定位"
    },
    {
      "name": "会员",
      "description": "会员套餐与权益对比、开通"
    },
    {
      "name": "区域",
      "description": "省市数据、加入陪诊报名"
    },
    {
      "name": "登录",
      "description": "微信授权登录、退出"
    }
  ],
  "paths": {
    "/user/home": {
      "get": {
        "tags": [
          "首页"
        ],
        "summary": "获取首页数据",
        "description": "返回定位城市、运营轮播图、品类快捷入口、服务商品列表。",
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "$ref": "#/components/schemas/HomeData"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/services": {
      "get": {
        "tags": [
          "服务"
        ],
        "summary": "获取服务商品列表",
        "description": "返回全部服务商品（8 款，覆盖陪诊各场景）。",
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "services": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Service"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/services/search": {
      "get": {
        "tags": [
          "服务"
        ],
        "summary": "搜索服务商品",
        "description": "按名称 / 适用人群 / 时长 / 简介模糊搜索。keyword 为空时返回全部。",
        "parameters": [
          {
            "name": "keyword",
            "in": "query",
            "required": false,
            "description": "搜索关键词",
            "schema": {
              "type": "string",
              "example": "儿童"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "services": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Service"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/services/{id}": {
      "get": {
        "tags": [
          "服务"
        ],
        "summary": "获取服务详情",
        "description": "按 id 获取服务完整信息（含项目介绍、服务保障、下单须知）。服务不存在时 data 为 null。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "服务 id",
            "schema": {
              "type": "integer",
              "example": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/Service"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/orders": {
      "get": {
        "tags": [
          "订单"
        ],
        "summary": "获取订单列表",
        "description": "返回当前用户全部订单（覆盖各状态）。",
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "orders": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Order"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "订单"
        ],
        "summary": "创建订单（提交订单）",
        "description": "提交确认订单页的预约信息与费用快照，创建后订单状态为 `unpaid`（待支付）。",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "serviceId",
                  "date",
                  "hospital",
                  "price"
                ],
                "properties": {
                  "serviceId": {
                    "type": "integer",
                    "description": "服务 id",
                    "example": 0
                  },
                  "date": {
                    "type": "string",
                    "description": "预约时间 yyyy-MM-dd HH:mm",
                    "example": "2026-08-19 10:00"
                  },
                  "hospital": {
                    "type": "string",
                    "description": "预约地点",
                    "example": "北京协和医院"
                  },
                  "price": {
                    "type": "number",
                    "description": "实付金额（含夜间费/包车费，已扣券）",
                    "example": 198
                  },
                  "nightFee": {
                    "type": "number",
                    "description": "夜间服务费（22 点后 +100）",
                    "example": 0
                  },
                  "carFee": {
                    "type": "number",
                    "description": "包车费（单趟 75 / 接送 150）",
                    "example": 0
                  },
                  "couponDiscount": {
                    "type": "number",
                    "description": "优惠券抵扣金额",
                    "example": 0
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Order"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/orders/{id}": {
      "get": {
        "tags": [
          "订单"
        ],
        "summary": "获取订单详情",
        "description": "按订单号获取订单完整信息（含陪诊师、服务进度时间线、追加服务）。订单不存在时 data 为 null。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "订单号",
            "schema": {
              "type": "string",
              "example": "PZ20260807001"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/Order"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/orders/{id}/pay": {
      "post": {
        "tags": [
          "订单"
        ],
        "summary": "支付成功（模拟支付回调）",
        "description": "模拟微信支付成功回调：订单状态 `unpaid` → `pending`（待分配），记录支付时间。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "订单号",
            "schema": {
              "type": "string",
              "example": "PZ20260805023"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Order"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/orders/{id}/cancel": {
      "post": {
        "tags": [
          "订单"
        ],
        "summary": "取消订单",
        "description": "取消订单，状态置为 `cancel`。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "订单号",
            "schema": {
              "type": "string",
              "example": "PZ20260805023"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Order"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/orders/addons": {
      "get": {
        "tags": [
          "订单"
        ],
        "summary": "获取追加服务商品",
        "description": "返回可追加的服务商品（延长服务时长）。",
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "addons": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/AddonProduct"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/orders/{id}/addon": {
      "post": {
        "tags": [
          "订单"
        ],
        "summary": "追加服务（购买成功）",
        "description": "模拟追加服务支付成功：向订单追加一条服务项（按支付时间从旧到新展示）。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "订单号",
            "schema": {
              "type": "string",
              "example": "PZ20260807001"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "price"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "追加服务名称",
                    "example": "延长服务 1小时"
                  },
                  "price": {
                    "type": "number",
                    "description": "追加价格（元）",
                    "example": 68
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Order"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/orders/value-added": {
      "get": {
        "tags": [
          "订单"
        ],
        "summary": "获取赠送服务列表",
        "description": "返回随单赠送的增值服务（平安保险，不参与实付金额计算）。",
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "list": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/ValueAdded"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/coupons": {
      "get": {
        "tags": [
          "优惠券"
        ],
        "summary": "获取用户优惠券",
        "description": "返回用户持有的全部优惠券（含已过期券，过期券置灰不可用）。",
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "coupons": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Coupon"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/coupons/exchange": {
      "post": {
        "tags": [
          "优惠券"
        ],
        "summary": "兑换优惠券",
        "description": "输入兑换码兑换代金券（demo 不校验兑换码），成功后发放 10 元代金券并返回。",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "code"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "兑换码",
                    "example": "KDS8888"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Coupon"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/coupon-products": {
      "get": {
        "tags": [
          "优惠券"
        ],
        "summary": "获取优惠中心券包列表",
        "description": "返回优惠中心在售的券包商品。",
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "products": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/CouponProduct"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/coupon-products/{id}": {
      "get": {
        "tags": [
          "优惠券"
        ],
        "summary": "获取券包详情",
        "description": "按券包 id 获取详情（含所含优惠券与使用须知）。券包不存在时 data 为 null。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "券包 id",
            "schema": {
              "type": "string",
              "example": "cp1"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/CouponProduct"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/coupon-products/{id}/buy": {
      "post": {
        "tags": [
          "优惠券"
        ],
        "summary": "购买券包（支付成功发放优惠券）",
        "description": "模拟支付成功后按券包所含优惠券发放到用户券列表，并写入购买记录。",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "券包 id",
            "schema": {
              "type": "string",
              "example": "cp1"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "$ref": "#/components/schemas/CouponProduct"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/coupon-orders": {
      "get": {
        "tags": [
          "优惠券"
        ],
        "summary": "获取券包购买记录",
        "description": "返回优惠券购买历史记录。",
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "records": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/CouponOrder"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/addresses": {
      "get": {
        "tags": [
          "地址"
        ],
        "summary": "获取地址列表",
        "description": "返回地址簿（默认地址置顶，其余按添加时间倒序）。",
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "addresses": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Address"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "地址"
        ],
        "summary": "保存地址（新增 / 编辑）",
        "description": "新增或编辑地址。勾选默认时自动取消其它默认地址；首个地址强制默认。",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "detail",
                  "contact",
                  "phone",
                  "isDefault"
                ],
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "地址 id（编辑时必传，新增可不传）",
                    "example": 1
                  },
                  "name": {
                    "type": "string",
                    "description": "地点名称",
                    "example": "北京协和医院"
                  },
                  "detail": {
                    "type": "string",
                    "description": "详细地址",
                    "example": "东城区帅府园1号"
                  },
                  "contact": {
                    "type": "string",
                    "description": "联系人",
                    "example": "张先生"
                  },
                  "phone": {
                    "type": "string",
                    "description": "联系电话（脱敏存储）",
                    "example": "138****8888"
                  },
                  "isDefault": {
                    "type": "boolean",
                    "description": "是否设为默认地址",
                    "example": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Address"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/addresses/locate": {
      "get": {
        "tags": [
          "地址"
        ],
        "summary": "演示定位",
        "description": "模拟当前定位，随机返回一个演示地点名称。",
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "type": "string",
                      "description": "定位地点名称",
                      "example": "北京协和医院"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/member/plans": {
      "get": {
        "tags": [
          "会员"
        ],
        "summary": "获取会员套餐与权益对比",
        "description": "返回四档会员套餐（白银/黄金/铂金/钻石）、权益对比表与即将上线功能。",
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "$ref": "#/components/schemas/MemberPlans"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/member/open": {
      "post": {
        "tags": [
          "会员"
        ],
        "summary": "开通会员（演示）",
        "description": "模拟支付成功开通会员（demo 直接成功）。",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "planId",
                  "mode"
                ],
                "properties": {
                  "planId": {
                    "type": "string",
                    "description": "会员档位 id",
                    "enum": [
                      "silver",
                      "gold",
                      "platinum",
                      "diamond"
                    ],
                    "example": "gold"
                  },
                  "mode": {
                    "type": "string",
                    "description": "开通方式",
                    "enum": [
                      "monthly",
                      "yearly"
                    ],
                    "example": "monthly"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "success": {
                          "type": "boolean",
                          "example": true
                        },
                        "planId": {
                          "type": "string",
                          "example": "gold"
                        },
                        "mode": {
                          "type": "string",
                          "example": "monthly"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/region/cities": {
      "get": {
        "tags": [
          "区域"
        ],
        "summary": "获取省市级数据",
        "description": "返回全国省市映射（省份 → 城市数组），用于加入陪诊报名表单的省-市选择。",
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "type": "object",
                      "description": "省份 → 城市数组",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "example": {
                        "福建省": [
                          "福州市",
                          "厦门市",
                          "泉州市"
                        ],
                        "广东省": [
                          "广州市",
                          "深圳市",
                          "珠海市"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/join-escort": {
      "post": {
        "tags": [
          "区域"
        ],
        "summary": "提交陪诊师报名",
        "description": "提交姓名、手机号与所在城市，报名加入陪诊师（demo 直接成功）。",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "phone",
                  "city"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "姓名",
                    "example": "王小明"
                  },
                  "phone": {
                    "type": "string",
                    "description": "手机号",
                    "example": "13800001234"
                  },
                  "city": {
                    "type": "string",
                    "description": "所在城市（省 市）",
                    "example": "福建省 福州市"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "success": {
                          "type": "boolean",
                          "example": true
                        },
                        "payload": {
                          "type": "object",
                          "description": "回显提交内容",
                          "properties": {
                            "name": {
                              "type": "string",
                              "example": "王小明"
                            },
                            "phone": {
                              "type": "string",
                              "example": "13800001234"
                            },
                            "city": {
                              "type": "string",
                              "example": "福建省 福州市"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/auth/state": {
      "get": {
        "tags": [
          "登录"
        ],
        "summary": "获取登录态",
        "description": "返回当前是否已登录与用户信息。",
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "$ref": "#/components/schemas/LoginState"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/auth/login": {
      "post": {
        "tags": [
          "登录"
        ],
        "summary": "微信授权登录（模拟）",
        "description": "模拟微信授权登录，返回登录后状态与用户信息。",
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "$ref": "#/components/schemas/LoginState"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/user/auth/logout": {
      "post": {
        "tags": [
          "登录"
        ],
        "summary": "退出登录",
        "description": "清除登录态，返回退出后的状态。",
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "ok"
                    },
                    "data": {
                      "$ref": "#/components/schemas/LoginState"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "HomeData": {
        "type": "object",
        "description": "首页数据",
        "properties": {
          "city": {
            "type": "string",
            "description": "当前定位城市",
            "example": "北京市"
          },
          "banners": {
            "type": "array",
            "description": "运营轮播图",
            "items": {
              "$ref": "#/components/schemas/Banner"
            }
          },
          "categories": {
            "type": "array",
            "description": "品类快捷入口",
            "items": {
              "$ref": "#/components/schemas/Category"
            }
          },
          "services": {
            "type": "array",
            "description": "服务商品列表",
            "items": {
              "$ref": "#/components/schemas/Service"
            }
          }
        }
      },
      "Banner": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "example": 1
          },
          "tag": {
            "type": "string",
            "example": "限时特惠"
          },
          "title": {
            "type": "string",
            "example": "开通黄金会员"
          },
          "sub": {
            "type": "string",
            "example": "全年享 9 折优惠"
          },
          "emoji": {
            "type": "string",
            "example": "👑"
          },
          "bg": {
            "type": "string",
            "description": "渐变色背景",
            "example": "linear-gradient(135deg,#F39C12,#E74C3C)"
          }
        }
      },
      "Category": {
        "type": "object",
        "description": "品类快捷入口",
        "properties": {
          "id": {
            "type": [
              "integer",
              "string"
            ],
            "description": "入口 id（coupon / join 为业务入口）",
            "example": 0
          },
          "name": {
            "type": "string",
            "example": "就医陪诊"
          },
          "emoji": {
            "type": "string",
            "example": "🏥"
          },
          "bg": {
            "type": "string",
            "description": "图标圆底颜色",
            "example": "rgba(62,180,137,0.1)"
          },
          "action": {
            "type": "string",
            "description": "点击行为：service（服务列表）/ toast（开发中提示）/ coupon-center（优惠中心）",
            "example": "service"
          },
          "toast": {
            "type": "string",
            "description": "点击提示文案（action=toast 时有效）",
            "example": "功能开发中，尽请期待"
          }
        }
      },
      "Service": {
        "type": "object",
        "description": "服务商品",
        "required": [
          "id",
          "name",
          "brief",
          "price",
          "memberPrice"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "example": 0
          },
          "name": {
            "type": "string",
            "example": "2小时基础陪诊"
          },
          "brief": {
            "type": "string",
            "description": "一句话简介",
            "example": "专业陪诊师全程陪同，协助挂号候诊取药"
          },
          "price": {
            "type": "number",
            "description": "原价（元）",
            "example": 198
          },
          "memberPrice": {
            "type": "number",
            "description": "会员价（元）",
            "example": 178.2
          },
          "rating": {
            "type": "number",
            "description": "评分",
            "example": 4.9
          },
          "sold": {
            "type": "integer",
            "description": "已服务人次",
            "example": 2341
          },
          "tags": {
            "type": "array",
            "description": "标签",
            "items": {
              "type": "string"
            },
            "example": [
              "热门",
              "优选"
            ]
          },
          "duration": {
            "type": "string",
            "description": "服务时长",
            "example": "2小时"
          },
          "crowd": {
            "type": "string",
            "description": "适用人群",
            "example": "通用"
          },
          "icon": {
            "type": "string",
            "description": "图标 emoji",
            "example": "🏥"
          },
          "color": {
            "type": "string",
            "description": "渐变主题色",
            "example": "linear-gradient(135deg,#3EB489,#2D9CDB)"
          },
          "intro": {
            "type": "string",
            "description": "项目介绍",
            "example": "专业陪诊师全程陪同……"
          },
          "guarantee": {
            "type": "string",
            "description": "服务保障",
            "example": "✅ 陪诊师均持有专业资质证书"
          },
          "notice": {
            "type": "string",
            "description": "下单须知",
            "example": "• 服务开始前2小时可免费取消"
          }
        }
      },
      "Order": {
        "type": "object",
        "description": "订单",
        "required": [
          "id",
          "serviceId",
          "status",
          "date",
          "hospital",
          "price"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "订单号",
            "example": "PZ20260807001"
          },
          "serviceId": {
            "type": "integer",
            "description": "服务 id",
            "example": 0
          },
          "status": {
            "type": "string",
            "enum": [
              "unpaid",
              "pending",
              "assigned",
              "serving",
              "done",
              "cancel",
              "refunded"
            ],
            "description": "订单状态"
          },
          "date": {
            "type": "string",
            "description": "预约时间 yyyy-MM-dd HH:mm",
            "example": "2026-08-07 10:00"
          },
          "paidAt": {
            "type": "string",
            "description": "支付时间（已支付订单）",
            "example": "2026-08-06 19:42"
          },
          "hospital": {
            "type": "string",
            "description": "预约地点",
            "example": "北京协和医院"
          },
          "price": {
            "type": "number",
            "description": "实付金额（元）",
            "example": 178.2
          },
          "nightFee": {
            "type": "number",
            "description": "夜间服务费（22 点后 +100）",
            "example": 0
          },
          "carFee": {
            "type": "number",
            "description": "包车费（单趟 75 / 接送 150）",
            "example": 0
          },
          "couponDiscount": {
            "type": "number",
            "description": "优惠券抵扣（元）",
            "example": 0
          },
          "completeDate": {
            "type": "string",
            "description": "服务完成日期（done 订单，用于分享链接有效期）",
            "example": "2026-08-11"
          },
          "companion": {
            "type": [
              "object",
              "null"
            ],
            "description": "陪诊师信息（未分配时为 null）",
            "$ref": "#/components/schemas/Companion"
          },
          "progress": {
            "type": "array",
            "description": "服务进度时间线",
            "items": {
              "$ref": "#/components/schemas/ProgressItem"
            }
          },
          "addOns": {
            "type": "array",
            "description": "追加服务项（按支付时间从旧到新）",
            "items": {
              "$ref": "#/components/schemas/Addon"
            }
          }
        }
      },
      "Companion": {
        "type": "object",
        "description": "陪诊师信息",
        "properties": {
          "name": {
            "type": "string",
            "example": "李护士"
          },
          "avatar": {
            "type": "string",
            "example": "👩"
          },
          "rating": {
            "type": "number",
            "example": 4.9
          },
          "count": {
            "type": "integer",
            "description": "服务次数",
            "example": 328
          },
          "phone": {
            "type": "string",
            "description": "联系电话",
            "example": "13800138001"
          }
        }
      },
      "ProgressItem": {
        "type": "object",
        "description": "服务进度记录",
        "properties": {
          "time": {
            "type": "string",
            "description": "进度时间 yyyy-MM-dd HH:mm",
            "example": "2026-08-07 09:00"
          },
          "text": {
            "type": "string",
            "description": "进度说明",
            "example": "陪诊师已出发前往医院"
          },
          "img": {
            "type": [
              "string",
              "null"
            ],
            "description": "现场图片路径（可为空）",
            "example": "/static/progress-doctor.png"
          }
        }
      },
      "Addon": {
        "type": "object",
        "description": "追加服务项",
        "properties": {
          "name": {
            "type": "string",
            "example": "延长服务 1小时"
          },
          "price": {
            "type": "number",
            "example": 68
          },
          "paidAt": {
            "type": "string",
            "description": "支付时间",
            "example": "2026-08-07 11:00"
          }
        }
      },
      "AddonProduct": {
        "type": "object",
        "description": "追加服务商品",
        "properties": {
          "id": {
            "type": "string",
            "example": "add1"
          },
          "name": {
            "type": "string",
            "example": "延长服务 1小时"
          },
          "price": {
            "type": "number",
            "example": 68
          }
        }
      },
      "ValueAdded": {
        "type": "object",
        "description": "赠送服务",
        "properties": {
          "name": {
            "type": "string",
            "example": "平安保险50万意外保障"
          },
          "qty": {
            "type": "integer",
            "example": 1
          },
          "unit": {
            "type": "string",
            "example": "份"
          },
          "price": {
            "type": "number",
            "example": 0
          }
        }
      },
      "Coupon": {
        "type": "object",
        "description": "用户优惠券",
        "properties": {
          "id": {
            "type": "integer",
            "example": 1
          },
          "name": {
            "type": "string",
            "example": "首单立减30元"
          },
          "amount": {
            "type": "number",
            "description": "抵扣金额（元）",
            "example": 30
          },
          "expire": {
            "type": "string",
            "description": "有效期至 yyyy-MM-dd（过期后置灰不可用）",
            "example": "2026-08-31"
          }
        }
      },
      "CouponProduct": {
        "type": "object",
        "description": "优惠中心券包",
        "properties": {
          "id": {
            "type": "string",
            "example": "cp1"
          },
          "title": {
            "type": "string",
            "example": "新人专享券包"
          },
          "subtitle": {
            "type": "string",
            "example": "4张实用券，覆盖陪诊全流程"
          },
          "price": {
            "type": "number",
            "example": 9.9
          },
          "icon": {
            "type": "string",
            "example": "🎁"
          },
          "color": {
            "type": "string",
            "description": "渐变色背景",
            "example": "linear-gradient(135deg,#3EB489,#2D9CDB)"
          },
          "coupons": {
            "type": "array",
            "description": "所含优惠券",
            "items": {
              "$ref": "#/components/schemas/CouponSpec"
            }
          },
          "notice": {
            "type": "string",
            "description": "使用须知",
            "example": "• 券包内优惠券自购买之日起30天内有效"
          }
        }
      },
      "CouponSpec": {
        "type": "object",
        "description": "券包内优惠券规格",
        "properties": {
          "name": {
            "type": "string",
            "example": "满100减20元"
          },
          "amount": {
            "type": "number",
            "example": 20
          },
          "qty": {
            "type": "integer",
            "description": "数量",
            "example": 1
          },
          "expire": {
            "type": "string",
            "example": "2026-12-31"
          }
        }
      },
      "CouponOrder": {
        "type": "object",
        "description": "券包购买记录",
        "properties": {
          "id": {
            "type": "string",
            "example": "CPO20260815001"
          },
          "productId": {
            "type": "string",
            "example": "cp1"
          },
          "title": {
            "type": "string",
            "example": "新人专享券包"
          },
          "amount": {
            "type": "number",
            "example": 9.9
          },
          "buyTime": {
            "type": "string",
            "example": "2026-08-15 14:32"
          },
          "status": {
            "type": "string",
            "enum": [
              "done",
              "unpaid",
              "cancel"
            ],
            "example": "done"
          }
        }
      },
      "Address": {
        "type": "object",
        "description": "预约地址",
        "properties": {
          "id": {
            "type": "integer",
            "example": 1
          },
          "name": {
            "type": "string",
            "description": "地点名称",
            "example": "北京协和医院"
          },
          "detail": {
            "type": "string",
            "description": "详细地址",
            "example": "东城区帅府园1号"
          },
          "contact": {
            "type": "string",
            "description": "联系人",
            "example": "张先生"
          },
          "phone": {
            "type": "string",
            "description": "联系电话（脱敏）",
            "example": "138****8888"
          },
          "isDefault": {
            "type": "boolean",
            "description": "是否默认地址",
            "example": true
          },
          "addedAt": {
            "type": "integer",
            "description": "添加时间戳（ms）",
            "example": 3000
          }
        }
      },
      "MemberPlans": {
        "type": "object",
        "description": "会员套餐与权益",
        "properties": {
          "plans": {
            "type": "array",
            "description": "四档会员套餐",
            "items": {
              "$ref": "#/components/schemas/MemberPlan"
            }
          },
          "rows": {
            "type": "array",
            "description": "权益对比表",
            "items": {
              "$ref": "#/components/schemas/BenefitRow"
            }
          },
          "comingSoon": {
            "type": "array",
            "description": "即将上线功能",
            "items": {
              "$ref": "#/components/schemas/ComingSoon"
            }
          }
        }
      },
      "MemberPlan": {
        "type": "object",
        "description": "会员套餐",
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "silver",
              "gold",
              "platinum",
              "diamond"
            ],
            "example": "gold"
          },
          "name": {
            "type": "string",
            "example": "黄金会员"
          },
          "icon": {
            "type": "string",
            "example": "🥇"
          },
          "color": {
            "type": "string",
            "example": "#F39C12"
          },
          "benefits": {
            "type": "array",
            "description": "权益列表",
            "items": {
              "type": "string"
            },
            "example": [
              "全单9折优惠"
            ]
          },
          "monthly": {
            "type": "number",
            "description": "连续包月价（元/月）",
            "example": 39
          },
          "yearly": {
            "type": "number",
            "description": "单月价（元/月）",
            "example": 399
          },
          "recommended": {
            "type": "boolean",
            "description": "是否推荐（黄金为推荐）",
            "example": true
          }
        }
      },
      "BenefitRow": {
        "type": "object",
        "description": "权益对比行",
        "properties": {
          "name": {
            "type": "string",
            "example": "服务折扣"
          },
          "silver": {
            "type": "string",
            "example": "9.5折"
          },
          "gold": {
            "type": "string",
            "example": "9折"
          },
          "platinum": {
            "type": "string",
            "example": "8.5折"
          },
          "diamond": {
            "type": "string",
            "example": "8折"
          },
          "highlight": {
            "type": "array",
            "description": "高亮列",
            "items": {
              "type": "string"
            },
            "example": [
              "gold"
            ]
          }
        }
      },
      "ComingSoon": {
        "type": "object",
        "description": "即将上线功能",
        "properties": {
          "icon": {
            "type": "string",
            "example": "🩺"
          },
          "name": {
            "type": "string",
            "example": "健康咨询"
          }
        }
      },
      "LoginState": {
        "type": "object",
        "description": "登录态",
        "properties": {
          "isLoggedIn": {
            "type": "boolean",
            "example": true
          },
          "profile": {
            "type": [
              "object",
              "null"
            ],
            "description": "用户信息（未登录为 null）",
            "properties": {
              "nickname": {
                "type": "string",
                "example": "小袋鼠用户"
              },
              "phone": {
                "type": "string",
                "example": "138****8888"
              }
            }
          }
        }
      }
    }
  }
}
