# Member Card Component
Developers can call this interface within Mini Program to launch the member card application component, allowing users to quickly fill out registration information and obtain their cards. This interface enables the card application component to be used without pre-binding it to the same official account as Mini Program. Developers can simply invoke it directly.
Before calling this interface, developers must complete the following steps:
- Create a WeChat member card and set it to one-click activation mode;
- Define the fields required for card application;
- Obtain the parameters for the card application component;
For more details, refer to the Member Card Application Component documentation: Member Card Application Component
# Parameter Description
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| appId | String | Yes | Enter ‘wxeb490c6f9b154ef9’; this value is fixed |
| extraData | Object | Yes | Parameters for the card application component, obtained in Step 3, including: |
| encrypt_card_id | String | Yes | Encrypted card_id; please decode it using urldecode before passing |
| outer_str | String | Yes | Channel identifier for obtaining the member card, which will be passed back to Merchant during the coupon retrieval process |
| biz | String | Yes | Identifier for the Merchant official account; please decode it using urldecode before passing |
| success | Function | No | Callback function for successful interface calls |
| fail | Function | No | Callback function for failed interface calls |
| complete | Function | No | Callback function called upon completion of the interface call (executed whether successful or not) |
# Return Parameters
| Parameter Name | Type | Description |
|---|---|---|
| errMsg | String | Result of the call |
# Example Code
wx.navigateToMiniProgram({
appId: 'wxeb490c6f9b154ef9', // Fixed appid, do not modify
extraData: data, // Includes encrypt_card_id, outer_str, and biz. Obtain these parameters from the link in Step 3
success: function() {
},
fail: function() {
},
complete: function() {
}
})
Note: The navigateToMiniProgram interface has been deprecated. In newer versions, use the navigator component for this functionality:
<navigator target="miniProgram" app-id="wxeb490c6f9b154ef9" extra-data="{{data}}">Member Card Application</navigator>
# Return Value Handling
In the App.onShow event, check the data returned from the member card application Mini Program:
- Verify if
data.referrerInfo.appIdmatches the Mini Program appid ‘wxeb490c6f9b154ef9’. If not, terminate further processing. - Check if
data.referrerInfo.extraDatacontains any information. If not, it indicates either that the user did not activate the card and left via swiping left or clicking the back button, or that the user has already activated the card. - If the activation was successful, you can retrieve the
activate_ticket,card_id, andcodeparameters fromdata.referrerInfo.extraDatafor subsequent operations.
# Important Notes
- Calling this API in the developer tools does not actually redirect to another Mini Program. However, the developer tools will verify whether the redirection was successful.
- The developer tools allow for debugging of parameter reception in the destination Mini Program.
- The card application component is an official component developed using
wx.navigateToMiniProgram. There is no need to bind it to the same official account; simply invoke it directly.