Coder Social home page Coder Social logo

miniprogramsample's Introduction

开始

本示例代码将展示企业微信小程序特有的 jsapi 能力接口,关于企业微信小程序相关的更多信息请查阅 小程序开发

小程序示例代码

接口列表

在本示例代码中,主要涉及到以下场景和接口:

  • 登录接口
    • wx.qy.login
    • code2session
    • wx.qy.checkSession
  • 用户信息
    • wx.qy.getEnterpriseUserInfo
    • wx.qy.getAvatar
    • wx.qy.getQrCode
    • wx.qy.getMobile
    • wx.qy.getEmail
  • 企业通讯录与会话
    • wx.qy.selectEnterpriseContact
    • wx.qy.openEnterpriseChat
    • wx.qy.selectExternalContact
    • wx.qy.getCurExternalContact
    • wx.qy.openUserProfile
  • NFC接口
    • wx.qy.getNFCReaderState
    • wx.qy.startNFCReader
    • wx.qy.stopNFCReader
  • 系统设置
    • wx.qy.getSystemInfo
    • wx.getSystemInfoSync
    • wx.getSystemInfo
    • wx.qy.version

使用指南

1. 下载本示例代码

推荐使用 git 将代码包下载到本地

git clone https://github.com/WecomTeam/MiniProgramSample.git

2. 导入小程序开发者工具

打开微信小程序开发者工具,将本示例代码导入工程,请注意须填写有效的 appid。

3. 安装企业微信小程序模拟器

通过 菜单 > 工具 > 插件 安装企业微信小程序模拟器

4. 切换至企业微信小程序模式

通过 工具栏 > 模式 选择 企业微信小程序模式 进行预览。

使用须知

1. 接口授权

用户信息、通讯录、会话相关的 jsapi 须要先进行授权,具体使用细则参考wx.qy.login

调用前提:

  1. 必须先调用过wx.qy.login,且session_key未过期,开发者可调用checkSession 检查当前登录态
  2. 当前成员必须在应用的可见范围

2. access_token

本示例为了简化演示,获取 access_token 的过程直接放在小程序内处理,实际线上请勿这样操作,具体使用请参考文档 获取 access_tokenaccess_token 须要在 Server 端进行获取和混存,不可将 access_token 传递到前端。

miniprogramsample's People

Contributors

meterscao avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.