{"id":18583184,"url":"https://github.com/gaoding-inc/editor-miniprogram-sdk","last_synced_at":"2025-07-19T04:32:07.560Z","repository":{"id":51151358,"uuid":"321291789","full_name":"gaoding-inc/editor-miniprogram-sdk","owner":"gaoding-inc","description":"稿定小程序 SDK","archived":false,"fork":false,"pushed_at":"2021-05-21T05:48:42.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-16T04:37:07.493Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/gaoding-inc.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}},"created_at":"2020-12-14T09:08:53.000Z","updated_at":"2021-05-21T05:48:44.000Z","dependencies_parsed_at":"2022-09-10T18:40:47.741Z","dependency_job_id":null,"html_url":"https://github.com/gaoding-inc/editor-miniprogram-sdk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gaoding-inc/editor-miniprogram-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaoding-inc%2Feditor-miniprogram-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaoding-inc%2Feditor-miniprogram-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaoding-inc%2Feditor-miniprogram-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaoding-inc%2Feditor-miniprogram-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gaoding-inc","download_url":"https://codeload.github.com/gaoding-inc/editor-miniprogram-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaoding-inc%2Feditor-miniprogram-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265888899,"owners_count":23844527,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-07T00:20:55.497Z","updated_at":"2025-07-19T04:32:07.509Z","avatar_url":"https://github.com/gaoding-inc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 小程序 SDK 使用指南\n\n[支付宝/淘宝小程序文档 ](./aliapp.md)\n\n## 安装 SDK\nnpm安装，[微信官方 npm 文档](https://developers.weixin.qq.com/miniprogram/dev/devtools/npm.html)\n```\nnpm i @gaoding/editor-miniprogram-sdk\n```\n\n在你的页面 `page.json` 中添加\n\n```json\n{\n  \"usingComponents\": {\n    \"editor-miniprogram-sdk\": \"@gaoding/editor-miniprogram-sdk\"\n  }\n}\n```\n\n不使用构建工具序安装，拷贝[仓库中](https://developers.weixin.qq.com/miniprogram/dev/devtools/npm.html) `components` 下的文件到项目中的放组件的目录，同样需要在页面配置json中声明\n\n```json\n{\n  \"usingComponents\": {\n    \"editor-miniprogram-sdk\": \"../../components/editor-miniprogram-sdk/editor-miniprogram-sdk\"\n  }\n}\n```\n\n其他第三方框架引用\n- [mpvue 参考](https://github.com/mpvue/examples/tree/master/echarts)\n- [taro  参考](http://taro-docs.jd.com/taro/docs/mini-third-party)\n\n\n### 参数\n| 字段 | 类型 | 说明 | 示例 |\n| --- | --- | --- | --- |\n| currentPage | String | 当前访问页面 | templates/design/complete |\n| thirdPartyUserCode | String | 授权信息，第三方账号接入, 详情见下方文档 | 5e0818ee84d9453db6b4a4c3895a269c\n| thirdCateId | String | 分发渠道 ID(数据源) | 112 |\n| templatesPage? | String | 模板中心路由(用于在 webview 跳转) | wx.miniprogram.navigateTo('/pages/templates/templates') |\n| designPage? | String | 编辑页路由 | wx.miniprogram.navigateTo('/pages/design/design') |\n| completePage? | String | 完成页路由 | wx.miniprogram.navigateTo('/pages/complete/complete') |\n\n### 访问模板中心\ncurrentPage = templates 时\n```\n\u003ceditor-miniprogram-sdk\n    templatesPage=\"/pages/index/index\"\n    designPage=\"/pages/design/design\"\n    completePage=\"/pages/complete/complete\"\n\n    thirdPartyUserCode=\"{{thirdPartyUserCode}}\"\n    thirdCateId=\"112\"\n    currentPage=\"templates\"\u003e\u003c/editor-miniprogram-sdk\u003e\n```\n\n### 访问编辑页\ncurrentPage = design 时\n| 字段 | 类型 | 说明 | 示例 |\n| --- | --- | --- | --- |\n| templateId | String | 模板ID/作品ID | 124567 |\n| mode | String | id 为作品 ID 时值必须为 `user`\u003cbr\u003e id 为分发渠道模板时值必须为 `company` | company/user |\n\n```\n\u003ceditor-miniprogram-sdk\n    templatesPage=\"/pages/index/index\"\n    designPage=\"/pages/design/design\"\n    completePage=\"/pages/complete/complete\"\n\n    thirdPartyUserCode=\"{{thirdPartyUserCode}}\"\n    thirdCateId=\"112\"\n    currentPage=\"design\"\n    mode=\"{{query.mode}}\"\n    templateId=\"{{query.id}}\"\u003e\u003c/editor-miniprogram-sdk\u003e\n```\n\n### 访问完成页\ncurrentPage = complete 时\n\n且该页面接收编辑页完成后的结果\n\n| 字段 | 类型 | 说明 | 示例 |\n| --- | --- | --- | --- |\n| templateId | String | 作图记录ID | 1234567 |\n| sourceId | String | 原模板ID | 7654321 |\n| image | String | 图片地址 | https://gd-filems-fat.my-static.dancf.com/saas/4149m9/-1813-453b-a91d-b263bb2901a02435.png |\n\n\u003e 若要支持分享等其他能力，建议自定义完成页\n\n```\n  \u003ceditor-miniprogram-sdk\n    templatesPage=\"/pages/index/index\"\n    designPage=\"/pages/design/design\"\n    completePage=\"/pages/complete/complete\"\n    currentPage=\"complete\"\n\n    thirdPartyUserCode=\"{{thirdPartyUserCode}}\"\n    image=\"{{query.image}}\"\n    templateId=\"{{query.id}}\"\n    sourceId=\"{{query.sourceId}}\"\u003e\u003c/editor-miniprogram-sdk\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaoding-inc%2Feditor-miniprogram-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaoding-inc%2Feditor-miniprogram-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaoding-inc%2Feditor-miniprogram-sdk/lists"}