Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gaoding/editor-miniprogram-sdk

Package Overview
Dependencies
Maintainers
22
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gaoding/editor-miniprogram-sdk

稿定小程序编辑器对外 SDK

  • 0.0.8
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-81.82%
Maintainers
22
Weekly downloads
 
Created
Source

小程序 SDK 使用指南

安装 SDK

npm安装,微信官方 npm 文档

npm i @gaoding/editor-miniprogram-sdk

在你的页面 page.json 中添加

{
  "usingComponents": {
    "editor-miniprogram-sdk": "@gaoding/editor-miniprogram-sdk"
  }
}

不使用构建工具序安装,拷贝仓库中 components 下的文件到项目中的放组件的目录,同样需要在页面配置json中声明

{
  "usingComponents": {
    "editor-miniprogram-sdk": "../../components/editor-miniprogram-sdk/editor-miniprogram-sdk"
  }
}

其他第三方框架引用

参数

字段类型说明示例
currentPageString当前访问页面templates/design/complete
thirdPartyUserCodeString授权信息,第三方账号接入, 详情见下方文档5e0818ee84d9453db6b4a4c3895a269c
thirdCateIdString分发渠道 ID(数据源)112
templatesPage?String模板中心路由(用于在 webview 跳转)wx.miniprogram.navigateTo('/pages/templates/templates')
designPage?String编辑页路由wx.miniprogram.navigateTo('/pages/design/design')
completePage?String完成页路由wx.miniprogram.navigateTo('/pages/complete/complete')

访问模板中心

currentPage = templates 时

<editor-miniprogram-sdk
    templatesPage="/pages/index/index"
    designPage="/pages/design/design"
    completePage="/pages/complete/complete"

    thirdPartyUserCode="{{thirdPartyUserCode}}"
    thirdCateId="112"
    currentPage="templates"></editor-miniprogram-sdk>

访问编辑页

currentPage = design 时

字段类型说明示例
templateIdString模板ID/作品ID124567
modeStringid 为作品 ID 时值必须为 user
id 为分发渠道模板时值必须为 company
company/user
<editor-miniprogram-sdk
    templatesPage="/pages/index/index"
    designPage="/pages/design/design"
    completePage="/pages/complete/complete"

    thirdPartyUserCode="{{thirdPartyUserCode}}"
    thirdCateId="112"
    currentPage="design"
    mode="{{query.mode}}"
    templateId="{{query.id}}"></editor-miniprogram-sdk>

访问完成页

currentPage = complete 时

且该页面接收编辑页完成后的结果

字段类型说明示例
templateIdString作图记录ID1234567
sourceIdString原模板ID7654321
imageString图片地址https://gd-filems-fat.my-static.dancf.com/saas/4149m9/-1813-453b-a91d-b263bb2901a02435.png

若要支持分享等其他能力,建议自定义完成页

  <editor-miniprogram-sdk
    templatesPage="/pages/index/index"
    designPage="/pages/design/design"
    completePage="/pages/complete/complete"
    currentPage="complete"

    thirdPartyUserCode="{{thirdPartyUserCode}}"
    image="{{query.image}}"
    templateId="{{query.id}}"
    sourceId="{{query.sourceId}}"></editor-miniprogram-sdk>

FAQs

Package last updated on 11 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc