提示:小程序卡券和公眾平臺調(diào)用基本一致,請先查看公眾平臺卡券文檔 一、公眾帳號/小程序綁定 由于微信卡券用的是一套邏輯。所以小程序需要先和公眾賬號綁定,才能在小程序中調(diào)起公眾平臺卡券 登錄微信公眾平臺:h ...
$access_token = 'Yn6h-PM679IXWtndisSKGtxWHV3rHpIl9IrUVFgE96m4aKbhyVDiG34OuOUGs_SIIceQSplwLWWexURWiuXGyTkaYXU8pFW-goveJ8XQJvpSU1KX9UnUssssssssssQhAAAGWZ';
$post = '{
"card_id":"cccccccccccccccccc-dw",
"gift": {
"base_info": {
"custom_url_name": "小程序",
"custom_url": "http://www.qq.com",
"custom_app_brand_user_name": "gh_aaaaaaaaaaa@app",
"custom_app_brand_pass":"pages/index/index",
"custom_url_sub_title": "點擊進入",
"promotion_url_name": "更多信息",
"promotion_url": "http://www.qq.com",
"promotion_app_brand_user_name": "gh_aaaaaaaaaaa@app",
"promotion_app_brand_pass":"pages/index/index"
}
}
}';
$url = "https://api.weixin.qq.com/card/update?access_token={$access_token}";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
if (!empty($post)) {
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
}
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
$output = curl_exec($curl);
curl_close($curl);
var_dump($output);
die();
let cardExt='{"timestamp":"'+res.data[0].timestamp+'","signature":"'+res.data[0].signature+'","nonce_str":"'+res.data[0].nonce_str+'"}'
wx.addCard({
cardList: [
{
cardId: res.data[0].cardId,
cardExt: cardExt
}
],
success: function(res) {
console.log(res)
}
})
工作日 8:30-12:00 14:30-18:00
周六及部分節(jié)假日提供值班服務(wù)