# Membership Card Component

Developers can call the interface in Weixin Mini Program to pull up the membership card component, convenient for users to quickly fill in the membership registration information and receive the card. The interface pulls up the open card component without binding the open card component and the initiator Mini Program to the same Official Account in advance, and the developer can call it directly.

Before calling, the developer must complete the following steps:

  1. Create a WeChat membership card and set it to one-click activation mode;
  2. Set the card open field;
  3. Get card open component parameters;

View the details of the member open card component: member open card component

# Parameter explaination

Parameter Name type Is it compulsory? Parameter explaination
appId String yes Fill in wxeb490c6f9b154ef9, fix this AppID
extraData Object yes The card open component parameter, obtained by step 3, contains the following three parameters
encrypt_card_id String yes Encrypting card_id, preceded by urldecode
outer_str String yes The value of the member card collection channel will be returned to the merchant at the voucher collection event
biz String yes Merchant Official Account identity parameter, passed in with urldecode
success Function no The interface calls a successful callback function
fail Function no A callback function that fails to call an interface
complete Function no The interface calls a callback function that ends (both successful and failed calls are executed)

# Return Parameters

Parameter Name type Parameter explaination
errMsg String Call results

# sample code

wx.navigateToMiniProgram({
  appId: 'wxeb490c6f9b154ef9', //固定为此 appid,不可改动
  extraData: data, // 包括 encrypt_card_id, outer_str, biz三个字段,须从 step3 中获得的链接中获取参数
  success: function() {
  },
  fail: function() {
  },
  complete: function() {
  }
})

NavigateToMiniPrograminterface is about to be deprecated. Use the navigator component in the new version to use this feature

<navigator target="miniProgram" app-id="wxeb490c6f9b154ef9" extra-data="{{data}}">会员卡开卡</navigator>

# Return instructions

In ApageonShow to determine the data returned from the membership card Weixin Mini Program data

  1. Determine if data.referrerInfo.appId is open card Weixin Mini Program appIdwxeb490c6f9b154ef9if it is not
  2. Determine whether there is data.referrerInfo.extraData whether there is data, if not, indicating that the user is not activated direct left swipe / click the return key to return, or the user has activated
  3. If the user activates successfully, you can get the activate_ticket, card_id, and code parameters from data.referrerInfo.extraData for the next action

# Note

  1. Calling this API on the developer tools does not actually jump to another Weixin Mini Program, but the developer tools will verify that the call jumps successfully Details
  2. Debugging details of the jump Weixin Mini Program on the developer tools to handle received parameters
  3. Open card component is the use of wx.navigateToMiniProgram development of the official component, jump without binding the same Official Account, direct call can be