LoveQin

 

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

如图:

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

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

 #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

 

分类:

技术点:

相关文章:

  • 2021-05-26
  • 2021-12-13
  • 2021-12-13
  • 2022-12-23
  • 2021-08-16
  • 2021-11-27
  • 2021-04-24
  • 2021-11-25
猜你喜欢
  • 2021-12-13
  • 2022-02-17
  • 2021-11-23
  • 2021-11-13
  • 2022-02-08
  • 2021-12-13
  • 2021-10-30
相关资源
相似解决方案