页面添加显示特定的svg文件 #12

Closed
opened 2024-11-27 14:35:37 +08:00 by yunhorn · 2 comments
Owner

如果页面有请求参数show,那么就去使用对应的svg文件

例如 https://smartoilets.net/simplepage/KWH/F2/female?profile=cleaner

那么就去配置接口 (https://smartoilets.net/openapi/api/config/get/type/{pagetype} ) 下找到 files.cleaner 字段

页面主题显示的svg文件则为 files.cleaner 而不是 files.svg

如果页面有请求参数show,那么就去使用对应的svg文件 例如 https://smartoilets.net/simplepage/KWH/F2/female?profile=cleaner 那么就去配置接口 (https://smartoilets.net/openapi/api/config/get/type/{pagetype} ) 下找到 files.cleaner 字段 页面主题显示的svg文件则为 files.cleaner 而不是 files.svg
jeff was assigned by yunhorn 2024-11-27 14:35:51 +08:00
Author
Owner

files 数据结构更新:

{
    "code": 200,
    "msg": "success",
    "timestamp": 1732851375548,
    "data": {
        "schedule": 300,
        "files": {
            "svg": "https://s3.yunhorn.com/test2/TC_GF_01_mark.svg",
            "tmp": "none",
            "cleaner": {
                "type": "url",
                "url": "https://s3.yunhorn.com/test2/TC_GF_01_mark.svg",
                "base64": null,
                "compress": null
            }
        },
        "relation": {
            "1": "excellent",
            "2": "good",
            "3": "poor"
        }
    }
}

返回了一个对象而不仅仅是一个字段值了, 如果type为url,则前端可以直接使用, 如果type为 base64, 则应使用字段 base64 的内容,并且改内容为文件数据的base64串.

compress字段为压缩方式,仅适用于 type 为 base64 时使用,前端需要进行一次解压, 支持 gzip

files 数据结构更新: ```json { "code": 200, "msg": "success", "timestamp": 1732851375548, "data": { "schedule": 300, "files": { "svg": "https://s3.yunhorn.com/test2/TC_GF_01_mark.svg", "tmp": "none", "cleaner": { "type": "url", "url": "https://s3.yunhorn.com/test2/TC_GF_01_mark.svg", "base64": null, "compress": null } }, "relation": { "1": "excellent", "2": "good", "3": "poor" } } } ``` 返回了一个对象而不仅仅是一个字段值了, 如果type为url,则前端可以直接使用, 如果type为 base64, 则应使用字段 base64 的内容,并且改内容为文件数据的base64串. compress字段为压缩方式,仅适用于 type 为 base64 时使用,前端需要进行一次解压, 支持 gzip
Author
Owner
https://smartoilets.net/openapi/api/config/get/type/simplepage/KWH/F2/
jeff added the
done-waiting-confirmed
label 2024-12-08 23:07:05 +08:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: smartoilets-front/projects#12
No description provided.