2017 © Pedro Peláez
 

library weapp

A SDK of WeChat mini app.

image

bqrd/weapp

A SDK of WeChat mini app.

  • Monday, June 25, 2018
  • by Qinjianbo
  • Repository
  • 2 Watchers
  • 0 Stars
  • 164 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 16 Forks
  • 0 Open issues
  • 23 Versions
  • 41 % Grown

The README.md

安装

//install by composer
composer require bqrd/weapp

//or clone from github
git clone git@github.com:bqrd/weapp_wechat_miniapp_sdk.git

用法

1. 通过客户端上传的code换取sessionkey

//code 换取 session_key
$weapp->getSessionKey($code);

2. 其他接口的调用

2.1 模板消息相关接口, (*1)

//从‘小程序’获取一个‘模板消息’单例对象
$templateMsg = $weapp->getTemplateMsg();

//1.获取小程序模板库标题列表
$res_array = $templateMsg->getListFromLib($offset,$count);

//2.获取模板库某个模板标题下关键词库
$res_array = $templateMsg->getTempFromLib($id);

//3.组合模板并添加至帐号下的个人模板库
$res_array = $templateMsg->add($id,$keyword_id_array);

//4.获取帐号下已存在的模板列表
$res_array = $templateMsg->getList($offset,$count);

//5.删除帐号下的某个模板
$res_array = $templateMsg->del($template_id);

//6.发送模板消息
$res_array = $templateMsg->send($touser,$template_id,$form_id,$data);

2.2.1 客服消息相关接口, (*2)

//从‘小程序’获取一个‘客服消息’单例对象
$customMsg = $weapp->getCustomMsg();

//1.发送客服消息 (微信对调用时机和次数都有限制,详情见微信文档)
$res_array = $customMsg->send($touser,$msgtype,$content_array);

2.2.2 客服消息更新计划: - [ ] 实现接收客户消息和事件并解密 - [ ] 实现新增临时素材 - [ ] 实现获取临时素材 - [ ] 转发消息, (*3)

2.3 二维码相关接口, (*4)

//从‘小程序’获取一个‘二维码’单例对象
$qrcode = $weapp->getQRCode();

//1.获取小程序A码
$res_array = $qrcode->getQRCodeA($path,$width=null,$auto_color=null,$line_color=null);

//2.获取小程序B码
$res_array = $qrcode->getQRCodeB($scene,$page,$width=null,$auto_color=null,$line_color=null);

//3.获取小程序C码(二维码)
$res_array = $qrcode->getQRCodeC($path,$width=null);

//注意数量限制 A码+C码:总共10万个 B码:无数量限制

2.4 数据统计相关接口, (*5)

//从‘小程序’获取一个‘数据统计’单例对象
$statistic = $weapp->getStatistic();

//1.获取每日数据概况趋势
$res_array = $statistic->getAbout($date);

//2.1 获取每日访问趋势
$res_array = $statistic->getVisitDaily($date);

//2.2 获取每周访问趋势
$res_array = $statistic->getVisitWeekly($begin_date,$end_date);

//2.3 获取每月访问趋势
$res_array = $statistic->getVisitMonthly($begin_date,$end_date);

//3. 获取每日访问分布
$res_array = $statistic->getDistribution($date);

//4.1 获取每日访问分布
$res_array = $statistic->getRetainDaily($date);

//4.2 获取每周访问分布
$res_array = $statistic->getRetainWeekly($begin_date,$end_date);

//4.3 获取每月访问分布
$res_array = $statistic->getRetainMonthly($begin_date,$end_date);

//5. 获取每日访问页面
$res_array = $statistic->getPage($date);

//6. 获取每日用户画像
$res_array = $statistic->getUserFeature($date);

参考文档

  1. 微信小程序文档 https://mp.weixin.qq.com/debug/wxadoc/dev/api/

致谢

kulokai/weapp_wechat_miniapp_sdk, (*6)

The Versions

25/06 2018

dev-master

9999999-dev

A SDK of WeChat mini app.

  Sources   Download

MIT

The Requires

 

by qinjb

wechat miniapp wechat app

25/06 2018

v1.5.7

1.5.7.0

A SDK of WeChat mini app.

  Sources   Download

MIT

The Requires

 

by qinjb

wechat miniapp wechat app

19/01 2018

v1.5.6

1.5.6.0

A SDK of WeChat mini app.

  Sources   Download

MIT

The Requires

 

by qinjb

wechat miniapp wechat app

19/01 2018

v1.5.4

1.5.4.0

A SDK of WeChat mini app.

  Sources   Download

MIT

The Requires

 

by qinjb

wechat miniapp wechat app

19/01 2018

v1.5.5

1.5.5.0

A SDK of WeChat mini app.

  Sources   Download

MIT

The Requires

 

by qinjb

wechat miniapp wechat app

28/12 2017

v1.5.3

1.5.3.0

A SDK of WeChat mini app.

  Sources   Download

MIT

The Requires

 

by qinjb

wechat miniapp wechat app

28/12 2017

v1.5.2

1.5.2.0

A SDK of WeChat mini app.

  Sources   Download

MIT

The Requires

 

by qinjb

wechat miniapp wechat app

27/12 2017

v1.5.1

1.5.1.0

A SDK of WeChat mini app.

  Sources   Download

MIT

The Requires

 

by qinjb

wechat miniapp wechat app

27/12 2017

v1.5.0

1.5.0.0

A SDK of WeChat mini app.

  Sources   Download

MIT

The Requires

 

by qinjb

wechat miniapp wechat app

27/12 2017

v1.4.9

1.4.9.0

A SDK of WeChat mini app.

  Sources   Download

MIT

The Requires

 

by qinjb

wechat miniapp wechat app

27/12 2017

v1.4.8

1.4.8.0

A SDK of WeChat mini app.

  Sources   Download

MIT

The Requires

 

by qinjb

wechat miniapp wechat app

27/12 2017

v1.4.7

1.4.7.0

A SDK of WeChat mini app.

  Sources   Download

MIT

The Requires

 

by qinjb

wechat miniapp wechat app

26/12 2017

1.4.4

1.4.4.0

A SDK of WeChat mini app.

  Sources   Download

MIT

The Requires

  • php ^5.5.9 || ^7.0

 

by qinjb

wechat miniapp wechat app

14/12 2017

1.4.3

1.4.3.0

一个微信小程序服务端SDK,集成小程序服务端所有接口。A SDK of WeChat mini app.

  Sources   Download

MIT

The Requires

 

by Avatar JiaweiXS

wechat miniapp wechat app

14/11 2017

1.4.2

1.4.2.0

一个微信小程序服务端SDK,集成小程序服务端所有接口。A SDK of WeChat mini app.

  Sources   Download

MIT

The Requires

 

by Avatar JiaweiXS

wechat miniapp wechat app

10/11 2017

1.4.1

1.4.1.0

一个微信小程序服务端SDK,集成小程序服务端所有接口。A SDK of WeChat mini app.

  Sources   Download

MIT

The Requires

 

by Avatar JiaweiXS

wechat miniapp wechat app

24/08 2017

1.4

1.4.0.0

一个微信小程序服务端SDK,集成小程序服务端所有接口。A SDK of WeChat mini app.

  Sources   Download

MIT

The Requires

 

by Avatar JiaweiXS

wechat miniapp wechat app

24/08 2017

1.3

1.3.0.0

一个微信小程序服务端SDK,集成小程序服务端所有接口。A SDK of WeChat mini app.

  Sources   Download

MIT

The Requires

 

by Avatar JiaweiXS

wechat miniapp wechat app

02/08 2017

1.2

1.2.0.0

一个微信小程序服务端SDK,集成小程序服务端所有接口。A SDK of WeChat mini app.

  Sources   Download

MIT

The Requires

 

by Avatar JiaweiXS

wechat miniapp wechat app

30/07 2017

1.1.1

1.1.1.0

一个微信小程序服务端SDK,集成小程序服务端所有接口。A SDK of WeChat mini app.

  Sources   Download

MIT

The Requires

 

by Avatar JiaweiXS

wechat miniapp wechat app

30/07 2017

1.1

1.1.0.0

一个微信小程序服务端SDK,集成小程序服务端所有接口。A SDK of WeChat mini app.

  Sources   Download

MIT

The Requires

  • php ^5.5.9 || ^7.0
  • kurokai/simplecache *

 

by Avatar JiaweiXS

wechat miniapp wechat app

30/07 2017

1.0.1

1.0.1.0

A SDK of WeChat mini app.

  Sources   Download

MIT

The Requires

  • php ^5.5.9 || ^7.0
  • kurokai/simplecache *

 

by Avatar JiaweiXS

wechat miniapp wechat app

29/07 2017

1.0

1.0.0.0

A SDK of WeChat mini app.

  Sources   Download

MIT

The Requires

  • php ^5.5.9 || ^7.0
  • kurokai/simplecache *

 

by Avatar JiaweiXS

wechat miniapp wechat app