{"id":25393619,"url":"https://github.com/xd-tayde/wepy-upload","last_synced_at":"2026-01-20T09:02:13.533Z","repository":{"id":86978411,"uuid":"131118809","full_name":"xd-tayde/wepy-upload","owner":"xd-tayde","description":"the upload module of wepy.","archived":false,"fork":false,"pushed_at":"2018-07-11T07:03:11.000Z","size":11,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T02:48:42.713Z","etag":null,"topics":["compress","image","image-upload","wepy","wepy-upload"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xd-tayde.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-26T07:42:25.000Z","updated_at":"2023-03-05T01:43:53.000Z","dependencies_parsed_at":"2023-05-30T01:34:50.469Z","dependency_job_id":null,"html_url":"https://github.com/xd-tayde/wepy-upload","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xd-tayde/wepy-upload","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xd-tayde%2Fwepy-upload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xd-tayde%2Fwepy-upload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xd-tayde%2Fwepy-upload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xd-tayde%2Fwepy-upload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xd-tayde","download_url":"https://codeload.github.com/xd-tayde/wepy-upload/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xd-tayde%2Fwepy-upload/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28599834,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T08:51:33.170Z","status":"ssl_error","status_checked_at":"2026-01-20T08:51:10.855Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compress","image","image-upload","wepy","wepy-upload"],"created_at":"2025-02-15T18:08:47.025Z","updated_at":"2026-01-20T09:02:13.527Z","avatar_url":"https://github.com/xd-tayde.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# wepy-upload -- 小程序上传组件\n\n## 简介:\n\n包含功能：\n\n1. 安卓/IOS统一图片选择控件(样式/功能)；\n2. 自定义相机功能： 使用前置摄像头，前置拍照后图片翻转；\n3. 图片压缩功能并可自定义尺寸；\n4. 图片上传；\n\n## 更新\n\n- 1.0.3\n    - 修复错误提示语法错误;\n    - 优化文档说明；\n\n## 使用姿势：\n\n1. 引用:\n\n`import MTUpload from 'wepy-upload'`;\n\n2. 添加 `components`:\n\n`components = { MTUpload }`; \n\n3. `template` 中使用:\n\n```html\n\u003cMTUpload class=\"index-upload\"\n    text=\"上传图片\"\n    modelAlbumText=\"请从相册中选择正脸照\"\n    :useCustomizedCamera=\"useCustomizedCamera\"\n    :uploadConfig=\"uploadConfig\"\n    @start.user=\"uploadStart\"\n    @compress.user=\"uploadCompress\"\n    @success.user=\"uploadSuccess\"\n    @fail.user=\"uploadFail\"\n\u003e\u003c/MTUpload\u003e\n```\n\n## 详细属性与事件\n\n- uploadConfig: 图片上传配置，缺省时不进行上传\n    - type: Object\n    - default: {}\n```js\n    uploadConfig: {\n        // 上传地址；\n        api: {\n            token: 'url',\n            upload: 'url',\n        },\n        // 上传地址拼接；\n        dataToImageUrl(data) {\n            return imageUrl;\n        },\n    }\n```\n\n- useCustomizedCamera: 是否使用自定义相机；\n\n    - type: Boolean\n    - default: false\n\n- uploadId: 组件id，会在success中原样传出，可用于标识\n\n    - type: Number\n    - default: 0\n\n- bg: 按钮背景\n\n    - type: String\n    - default: ''\n\n- text: 按钮文案；\n\n    - type: String,\n    - default: '',\n\n- imageSpaceLimit: 上传图片大小限制；\n\n    - type: String,\n    - default: '10mb',\n\n- imageSizeLimit: 上传图片压缩尺寸；\n\n    - type: Number,\n    - default: 800,\n\n- imageQuality: 图片压缩比例；\n\n    - type: Number,\n    - default: 0.9,\n\n- modelPhotoText:  底部弹窗相机文案；\n\n    - type: String,\n    - default: '拍照',\n\n- modelAlbumText: 底部弹窗相册文案；\n\n    - type: String,\n    - default: '从手机相册选择',\n\n- modelHideText: 底部弹窗取消文案；\n\n    - type: String,\n    - default: '取消',\n\n### 事件\n\n- @tap.user: 按钮点击时触发；\n    - params: 无\n\n- @start.user: 上传开始\n    - filePath: 图片临时路径\n\n- @compress.user: \b压缩后的图片\n    - \bpath: 图片临时路径\n    - width: 图片宽度\n    - height: 图片高度\n    - compressTime: 压缩耗时\n\n- @success.user: 图片选择成功；\n    - data: 服务端接口返回数据；\n    - image: 图片路径\n    - width: 图片宽度\n    - height: 图片高度\n    - uploadId: 组件id\n    - uploadTime: 上传耗时\n\n- @fail.user: 图片选择失败；\n    - error: 错误对象；\n    - type: 错误类型；\n    - msg: 错误提示语；\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxd-tayde%2Fwepy-upload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxd-tayde%2Fwepy-upload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxd-tayde%2Fwepy-upload/lists"}