39 lines
1.5 KiB
Markdown
39 lines
1.5 KiB
Markdown
### 任务目标
|
|
pages/scan/result/index 页面增加核销功能和显示核销状态功能
|
|
|
|
### 详细要求
|
|
pages/scan/result/index 最下面增加一个核销按钮,显示check_status,未核销时候可以点击按钮
|
|
调用/visitor/notify-host 进行通知被访人和核销预约记录。分析项目信息,编码必须符合项目架构和风格。
|
|
同时考虑用户体验与交互优化。
|
|
### api数据
|
|
后端接口文件
|
|
I:\code\xxc\minispringboot\src\main\java\com\example\mini_program\controller\AppointmentController.java
|
|
I:\code\xxc\minispringboot\src\main\java\com\example\mini_program\controller\VisitorApprovalController.java
|
|
参考两个文件中的接口信息和项目中的数据结构
|
|
```
|
|
@GetMapping("/detail")
|
|
public Result<VisitApplication> getDetail(@RequestParam String id) {
|
|
if (id == null || id.trim().isEmpty()) {
|
|
return Result.error("id不能为空");
|
|
}
|
|
return Result.success(appointmentService.getDetail(id));
|
|
}
|
|
```
|
|
和
|
|
```
|
|
@GetMapping("/notify-host")
|
|
public Result<String> notifyHostArrival(@RequestParam String id) {
|
|
log.info("通知受访者访客已到达, id={}", id);
|
|
if (id == null || id.trim().isEmpty()) {
|
|
return Result.error("预约记录ID不能为空");
|
|
}
|
|
try {
|
|
visitorApprovalService.notifyHostArrival(id);
|
|
return Result.success("通知发送成功");
|
|
} catch (Exception e) {
|
|
log.error("通知发送失败, id={}", id, e);
|
|
return Result.error("通知发送失败: " + e.getMessage());
|
|
}
|
|
}
|
|
``
|