我用的是测试的access_token,是非跳转型一键激活,领取会员卡显示激活失败
真机测试结果错误现象:
用的这个组件:
<navigator target="miniProgram" app-id="wxeb490c6f9b154ef9" extra-data="{{data}}">会员卡开卡</navigator>
这是我的创建会员接口的代码:
card_id:function(){
var that=this;
wx.request({
url: 'https://api.weixin.qq.com/card/create?access_token=38_hnCvyoWGd06d6We61X5aR7auLwuvZ6HYWKqjh2YBq32kGZ0yEmhwJxRhdcBU0kMWlbGU-vh2vKq1fKRfak-1u5obN2J_sJ3SpQWfy7vsZZcRueKMA4VI4rPx3JwI1FZU39DgKf7lp12HgWKLTINfAEAJYD',
method:"POST",
data:{
"card": {
"card_type": "MEMBER_CARD",
"member_card": {
"background_pic_url": "https://mmbiz.qlogo.cn/mmbiz/",//背景图
"base_info": {
"logo_url": "http://mmbiz.qpic.cn/mmbiz_jpg/oRMZVStIHknlh4ibB4HiaGwZObDEGB35Kw3OZoJWcKuvMibF0Z4pM6mxciaLibbzGWZSZEeJiauOudnK9iaOghWF04aEQ/0",//头像图片
"brand_name": "欣容理发",
"code_type": "CODE_TYPE_QRCODE",//二维码
"title": "会员卡",
"color": "Color010",
"notice": "使用时向服务员出示此券",
"service_phone": "020-88888888",
"description": "不可与其他优惠同享",
"date_info": {
"type": "DATE_TYPE_PERMANENT",//永久有效
},
"sku": {
"quantity": 50000000//卡券库存
},
"get_limit": 1,
"use_custom_code": false,//不自定义code
"can_give_friend": false,//不可转赠
},
"advanced_info": {
"abstract": {
"abstract": "微信餐厅推出多种新季菜品,期待您的光临",
"icon_url_list": [
"http://mmbiz.qpic.cn/mmbiz/p98FjXy8LacgHxp3sJ3vn97bGLz0ib0Sfz1bjiaoOYA027iasqSG0sjpiby4vce3AtaPu6cIhBHkt6IjlkY9YnDsfw/0"
]
},
"text_image_list": [
{
"image_url": "http://mmbiz.qpic.cn/mmbiz/p98FjXy8LacgHxp3sJ3vn97bGLz0ib0Sfz1bjiaoOYA027iasqSG0sjpiby4vce3AtaPu6cIhBHkt6IjlkY9YnDsfw/0",
"text": "此菜品精选食材,以独特的烹饪方法,最大程度地刺激食 客的味蕾"
},
{
"image_url": "http://mmbiz.qpic.cn/mmbiz/p98FjXy8LacgHxp3sJ3vn97bGLz0ib0Sfz1bjiaoOYA027iasqSG0sj piby4vce3AtaPu6cIhBHkt6IjlkY9YnDsfw/0",
"text": "此菜品迎合大众口味,老少皆宜,营养均衡"
}
],
"business_service": [
"BIZ_SERVICE_FREE_WIFI",
"BIZ_SERVICE_WITH_PET",
"BIZ_SERVICE_FREE_PARK",
"BIZ_SERVICE_DELIVER"
]
},
"supply_bonus": true,
"supply_balance": false,
"prerogative": "test_prerogative",
//"auto_activate":true,//自动激活
"wx_activate":true,//一键激活
//"wx_activate_after_submit":true,
//"wx_activate_after_submit_url" : "http://qq.com",
"bonus_rule": {
"cost_money_unit": 100,
"increase_bonus": 1,
"max_increase_bonus": 200,
"init_increase_bonus": 10,
"cost_bonus_unit": 5,
"reduce_money": 100,
"least_money_to_use_bonus": 1000,
"max_reduce_bonus": 50
},
"discount": 10
}
}
},
success:(res)=>{
console.log('获取cardID成功',res)
that.setData({
cardID:res.data.card_id,
})
let cardid = this.data.cardID;
wx.request({
url: 'https://api.weixin.qq.com/card/membercard/activateuserform/set?access_token=38_hnCvyoWGd06d6We61X5aR7auLwuvZ6HYWKqjh2YBq32kGZ0yEmhwJxRhdcBU0kMWlbGU-vh2vKq1fKRfak-1u5obN2J_sJ3SpQWfy7vsZZcRueKMA4VI4rPx3JwI1FZU39DgKf7lp12HgWKLTINfAEAJYD',
method:"POST",
data:{
"card_id": cardid,
"service_statement": {
"name": "会员守则",
"url": "https://www.qq.com"
},
"bind_old_card": {
"name": "老会员绑定",
"url": "https://www.qq.com"
},
"required_form": {
"can_modify":false,
"common_field_id_list": [
"USER_FORM_INFO_FLAG_MOBILE"
]
},
"optional_form": {
"can_modify":false,
"common_field_id_list": [
"USER_FORM_INFO_FLAG_LOCATION",
"USER_FORM_INFO_FLAG_BIRTHDAY"
],
}
},
success(res){
console.log('设置会员卡开卡字段成功',res)
//获取开卡组件链接
wx.request({
url: 'https://api.weixin.qq.com/card/membercard/activate/geturl?access_token= 38_hnCvyoWGd06d6We61X5aR7auLwuvZ6HYWKqjh2YBq32kGZ0yEmhwJxRhdcBU0kMWlbGU-vh2vKq1fKRfak-1u5obN2J_sJ3SpQWfy7vsZZcRueKMA4VI4rPx3JwI1FZU39DgKf7lp12HgWKLTINfAEAJYD',
method:'POST',
data:{
"card_id" :cardid,
"outer_str" : "123"
},
success(res){
console.log('获取开卡组件链接成功',res)
},
fail(err){
console.log('获取开卡组件链接失败',err)
}
})
},
fail(err){
console.log('设置会员卡开卡字段失败',err)
}
})
},
fail(err){
console.log('获取cardID失败',err)
}
})
},
你好,这边建议您添加一下wepayTS8(备注:微信社区XXX问题)。提供一下以下信息。
-请求的具体API接口(提供文档地址和请求的URL):
- 问题发生时间【必填】:
- 商户号【 必填】:
- 商户订单号【 必填】:
- 相关报错信息文案【 必填】:
- 问题截图或视频【 必填】:
-完整的请求和返回参数以及单号【 必填】: