在小程序中加入开卡组件时,调用接口https://api.weixin.qq.com/card/create?access_token=创建会员卡, 使用的参数是:
{
"card": {
"card_type": "MEMBER_CARD",
"member_card": {
"background_pic_url": "http://mmbiz.qpic.cn/mmbiz_png/sORonibGwoiau9XqWwTjWJFhodxUGFFQvrw3v9A02AB8f2P072HKzWU2Hks1rjKTLw8dB3edljVzNRCMMXAeSPicw/0",
"base_info": {
"logo_url": "http://mmbiz.qpic.cn/mmbiz_png/sORonibGwoiatfLHlL5YUuhRU7iaezibzdokuvA1lQeBtKMJZibziatepibQ5WHcDYa57m8wOrfcZcQm53P9ocInaxwpA/0",
"brand_name": "VIP会员卡",
"code_type": "CODE_TYPE_QRCODE",
"title": "VIP会员卡",
"color": "Color010",
"notice": "使用时向服务员出示此券",
"service_phone": "13100167331",
"description": "积分不支持兑换现金",
"date_info": {
"type": "DATE_TYPE_PERMANENT"
},
"sku": {
"quantity": 50000000
},
"get_limit": 1,
"use_custom_code": false,
"need_push_on_view": true,
"center_title": "会员详情",
"center_sub_title": "到店享受更多优惠惊喜",
"custom_app_brand_user_name": "gh_7f692dbcf6de@app",
"custom_app_brand_pass": "pages/vip_index/index",
"center_app_brand_user_name": "gh_7f692dbcf6de@app",
"center_app_brand_pass": "pages/vip_index/index",
"promotion_app_brand_user_name": "gh_7f692dbcf6de@app",
"promotion_app_brand_pass": "pages/vip_index/index"
},
"supply_bonus": false,
"supply_balance": false,
"prerogative": "100积分可换精美礼品一份",
"auto_activate": false,
"wx_activate": true,
"wx_activate_after_submit": true,
"activate_app_brand_user_name":"gh_7f692dbcf6de@app",
"activate_app_brand_pass":"pages/vip_index/index"
}
}
}
也就是说我们想创建跳转型会员卡。但无论怎么传递参数
"wx_activate": true,
"wx_activate_after_submit": true,
"activate_app_brand_user_name":"gh_7f692dbcf6de@app",
"activate_app_brand_pass":"pages/vip_index/index"
会员效果没有什么变化。我们想创建建跳转型会员卡,在会员卡开卡完成后,自动跳转到我们设定的小程序页面。
可否帮我们看一下是哪里的问题。谢谢
会员卡ID是: pgfrm1AtkRUf2KMK3m___l5HCMBA
跳转型:即使是跳转小程序,也必须设置wx_activate_after_submit_url才可返回extraData(包含三个参数取activate_ticket card_id code),建议设置为小程序的路径即可;
非跳转型:其实是不支持返回extraData的(不是官方文档说的仅不返回activate_ticket,是啥都不返回了),官方文档说的这个是忽悠人的,按照这个设置是没用的“创建一张会员卡会员卡,会员卡的激活方式选择“wx_activate":true,"wx_activate_after_submit" : false,并获得card_id,详情见: 创建会员卡接口”
非跳转型填写wx_activate_after_submit_url,就会自动变成跳转型,不管你wx_activate_after_submit是否设置为false
所以建议使用跳转型,用小程序领卡。
官方文档链接:https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/Coupons-Mini_Program_Start_Up.html#%E6%AD%A5%E9%AA%A4-4
谢谢了