提示:小程(cheng)序卡券和公(gong)眾(zhong)平(ping)臺調(diao)用基本一(yi)致,請(qing)先查看公(gong)眾(zhong)平(ping)臺卡券文檔 一(yi)、公(gong)眾(zhong)帳號/小程(cheng)序綁定 由于(yu)微信(xin)卡券用的(de)是一(yi)套邏(luo)輯。所以小程(cheng)序需要先和公(gong)眾(zhong)賬號綁定,才(cai)能在(zai)小程(cheng)序中調(diao)起公(gong)眾(zhong)平(ping)臺卡券 登錄微信(xin)公(gong)眾(zhong)平(ping)臺:h ...

$access_token = 'Yn6h-PM679IXWtndisSKGtxWHV3rHpIl9IrUVFgE96m4aKbhyVDiG34OuOUGs_SIIceQSplwLWWexURWiuXGyTkaYXU8pFW-goveJ8XQJvpSU1KX9UnUssssssssssQhAAAGWZ';$post = '{"card_id":"cccccccccccccccccc-dw","gift": {"base_info": {"custom_url_name": "小程序(xu)","custom_url": "//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": "//www.qq.com","promotion_app_brand_user_name": "gh_aaaaaaaaaaa@app","promotion_app_brand_pass":"pages/index/index"}}}';$url = "//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) }})