cen_click: function () {
var that = this
var grant_type = 'client_credential'
var appid = "wxf03b6b5aaedfa785"
var secret = "158553c156bab018999a1233cf5e9671"
var url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=' + grant_type + '&appid=' + appid + '&secret=' + secret //固定格式 自己嵌套参数
wx.request({
url: url,
method: 'GET',
success: function (res) {
var access_token = res.data.access_token //生成二维码你必须先获取token
var scene = '85688'//这个参数必须是字符串
var urls = 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=' + access_token
wx.request({
url: urls,
method: 'POST',
responseType: 'arraybuffer',// 这行很重要
data: {
scene: scene,
page:"pages/home/shopDesc/shopDesc",
width: '430px',
auto_color: true,
is_hyaline: false,
is_hyaline: false,
},
header: {
'content-type': 'application/json;charset=utf-8'
},
success: function (res) {
let bin64 = wx.arrayBufferToBase64(res.data)