主要说说如何使用微信的激活会员卡

如图:

C# 微信开发-----微信会员卡(二)-LMLPHP

点击激活会员卡时,要跳转到如下的图片:

C# 微信开发-----微信会员卡(二)-LMLPHP

要实现这个功能,首先我们在创建会员卡后就操作如下代码

 #region 添加激活时的自定义字段
string customFiled = "{";
customFiled += "\"card_id\": \"" + cardId + "\",";//cardId是卡券的ID,请看我上一篇的文章
customFiled += "\"required_form\": {";
customFiled += "\"can_modify\": false,";
customFiled += "\"common_field_id_list\": [\"USER_FORM_INFO_FLAG_MOBILE\"]";
customFiled += "}";
customFiled += "}";
string customUrl = "https://api.weixin.qq.com/card/membercard/activateuserform/set?access_token=" + access_token; string resultCustom = PostWebRequest(customUrl, customFiled);
resultCustom = "[" + resultCustom + "]";
Newtonsoft.Json.Linq.JArray jsCustomArr = (Newtonsoft.Json.Linq.JArray)JsonConvert.DeserializeObject(resultCustom);
Newtonsoft.Json.Linq.JObject jsCustomObj = (Newtonsoft.Json.Linq.JObject)jsCustomArr[];
                      //接受微信返回的数据
#endregion
04-02 17:54