C# 微信开发-----微信会员卡(二)
主要说说如何使用微信的激活会员卡
如图:
点击激活会员卡时,要跳转到如下的图片:
要实现这个功能,首先我们在创建会员卡后就操作如下代码
#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[0]; //接受微信返回的数据 #endregion
(本人微信号:Liberty-bcy)如果,你正在埋怨命运不眷顾,那请记住:命,是失败者的借口;运,是成功者的谦词。