CODESHIF - 2019年1月 最有灵魂的开发者 2019-01-26T16:12:00+08:00 Typecho https://www.codeshif.com/feed/atom/2019/01/ <![CDATA[微信小程序wx.addCard添加会员卡爬坑记录]]> https://www.codeshif.com/archives/28.html 2019-01-26T16:12:00+08:00 2019-01-26T16:12:00+08:00 admin https://www.codeshif.com 微信官方给的SDK叫simple.zip,其中文件jssdk.php 52行

$url = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?type=jsapi&access_token=$accessToken";

我们需要把这个链接中的jsapi修改为wx_card才可以使用微信小程序添加卡券进来。

注意在获取ACCESS_TOKEN的时候,要使用微信公众号的APPID和APP_SERCRT,不要使用小程序的来获取卡券,不然会出现错误。

参考链接:

https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1499332673_Unm7V

https://developers.weixin.qq.com/miniprogram/dev/api/wx.addCard.html

https://developers.weixin.qq.com/community/develop/doc/00020408e80528a75c08d4a3451004

https://www.jianshu.com/p/7d1f08f3a460

https://www.jianshu.com/p/a0863e704405

]]>