/// <summary> /// 扫描二维码,用户已关注时,进行关注后的事件推送 /// </summary> /// <param name="httpRequest"></param> /// <param name="msg"></param> public static void ResponseScanSubscribeEvent(HttpResponseBase Response, MsgModel msg, ResultCryptography ccg) { var remsg = ""; string str = msg.EventModel.EventKeyModel.EventKey; if (!string.IsNullOrEmpty(str) || str.Contains("A")) { int Id = Convert.ToInt32(System.Text.RegularExpressions.Regex.Replace(str, @"[^0-9]+", "")); if (Id > 0 && Id < 3000) { remsg = ActivityExc(msg, Id); } if (Id < 50000 && Id > 3000) { //msg.TextModel = new TextModel() { Content = "厨师大大,点击 http://jifenweixin.shinho.net.cn/RegistMember/Create?activityId=" + Id + "链接完成签到,新用户需先完成注册" }; msg.MsgType = "news"; ArticelModel articel = new ArticelModel() { Title = "点击图片完成注册", Description = "欣和餐饮服务欢迎您的到来", PicUrl = "https://mmbiz.qpic.cn/mmbiz_jpg/uuwJXDpEBqsSZZuaafJUZfNibZ109B0CXbWpLSaKEdQdibozC0LOibu9Eshs0R1yfgFNOYvI0icb7ntDKXC2k06tVw/0?wx_fmt=jpeg", Url = ConfigurationManager.AppSettings["WeiXinDomain"] + "component/register?RecommendId=" + Id }; msg.Articles = new List <ArticelModel>(); msg.Articles.Add(articel); remsg = XmlHelpler.GetArticlesXml(msg); } } //else //{ // ResponseNoEvent(Response, msg, ccg); //} Response.Write(GetMsg(remsg, ccg)); }
public static string ActivityExc(MsgModel msg, int id) { msg.MsgType = "news"; //msg.TextModel = new TextModel() { Content = "厨大大们,点击 http://jifenweixin.shinho.net.cn/RegistMember/Create?activityId=" + Id + "链接完成签到,新用户需先完成注册" }; ArticelModel articel = new ArticelModel() { Title = "点击上文完成签到", Description = "欣和餐饮服务欢迎您的到来!", PicUrl = "https://mmbiz.qpic.cn/mmbiz_jpg/uuwJXDpEBqsynpxhFaMHaRGSNcnicINW3EVhsLcwqYFK4AUKyw5kyickELM1cmjxdT2RCWic6icrk3d9Xr4aAHcibUw/0?wx_fmt=jpeg", Url = ConfigurationManager.AppSettings["WeiXinDomain"] + "component/signsuccess?activityId=" + id }; msg.Articles = new List <ArticelModel>(); msg.Articles.Add(articel); string remsg = XmlHelpler.GetArticlesXml(msg); return(remsg); }
/// <summary> /// 扫一扫 /// </summary> public static void ResponseAdvClickEvent(HttpResponseBase Response, MsgModel msg, ResultCryptography ccg) { string remsg = string.Empty; string openid = msg.FromUserName; //LogHelper.WriteLog("lalal" + ConfigurationManager.AppSettings["ScanCodeInfoUrl"] + "?url=" + System.Web.HttpUtility.UrlEncode(msg.EventModel.ClickEventModel.ScanResult) + "&openid=" + openid); //调用积分url string ret = BasicApi.RequestCreate(ConfigurationManager.AppSettings["ScanCodeInfoUrl"] + "?url=" + System.Web.HttpUtility.UrlEncode(msg.EventModel.ClickEventModel.ScanResult) + "&openid=" + openid); //LogHelper.WriteLog(ConfigurationManager.AppSettings["ScanCodeInfoUrl"]); if (ret.Contains("x")) { //BasicApi.RequestCreate("http://jifenweixin.shinho.net.cn/#/component/scansuccess?integral=" + ret); ret = ret.Replace("x", ""); msg.MsgType = "news"; ArticelModel articel = new ArticelModel() { Title = "好手气,拿大奖", Description = "点击上文查看中奖情况", PicUrl = "https://mmbiz.qpic.cn/mmbiz_jpg/uuwJXDpEBqudkJX4sk2WDIYvqmibxToUKFtPcmLS2c2tnoXvoWoVgANLiaZPvEEAohSxdnTxPdIRSBDy10SPE1TA/0?wx_fmt=jpeg", Url = ConfigurationManager.AppSettings["WeiXinDomain"] + "component/scansuccess?integral=" + ret }; msg.Articles = new List <ArticelModel>(); msg.Articles.Add(articel); remsg = XmlHelpler.GetArticlesXml(msg); Response.Write(GetMsg(remsg, ccg)); } else { msg.TextModel = new TextModel() { Content = ret }; remsg = XmlHelpler.GetTextXml(msg); Response.Write(GetMsg(remsg, ccg)); } }
/// <summary> /// 扫描二维码,用户未关注时,进行关注后的事件推送 /// </summary> /// <param name="httpRequest"></param> /// <param name="msg"></param> public static void ResponseScanUnSubscribeEvent(HttpResponseBase Response, MsgModel msg, ResultCryptography ccg) { var remsg = ""; string str = msg.EventModel.EventKeyModel.EventKey; if (!string.IsNullOrEmpty(str)) { int Id = Convert.ToInt32(System.Text.RegularExpressions.Regex.Replace(str, @"[^0-9]+", "")); if (Id > 0 && Id < 3000) { remsg = ActivityExc(msg, Id); } if (Id < 50000 && Id > 0) { msg.MsgType = "news"; ArticelModel articel = new ArticelModel() { Title = "点击图片完成注册", Description = "欣和餐饮服务欢迎您的到来", PicUrl = "https://mmbiz.qpic.cn/mmbiz_jpg/uuwJXDpEBqsSZZuaafJUZfNibZ109B0CXbWpLSaKEdQdibozC0LOibu9Eshs0R1yfgFNOYvI0icb7ntDKXC2k06tVw/0?wx_fmt=jpeg", Url = ConfigurationManager.AppSettings["WeiXinDomain"] + "component/register?RecommendId=" + Id }; msg.Articles = new List <ArticelModel>(); msg.Articles.Add(articel); remsg = XmlHelpler.GetArticlesXml(msg); } else { msg.MsgType = "news"; ArticelModel articel = new ArticelModel() { Title = "味达美厨师会员招募啦!点击图片即可注册!!", Description = "积分好礼、国内外学习考察、新品试用等你来!", PicUrl = "https://mmbiz.qpic.cn/mmbiz_jpg/uuwJXDpEBqsSZZuaafJUZfNibZ109B0CXbWpLSaKEdQdibozC0LOibu9Eshs0R1yfgFNOYvI0icb7ntDKXC2k06tVw/0?wx_fmt=jpeg", Url = ConfigurationManager.AppSettings["WeiXinDomain"] + "component/register" }; ArticelModel articel2 = new ArticelModel() { Title = "会员扫码须知", Description = "会员扫码须知", PicUrl = "https://mmbiz.qpic.cn/mmbiz_jpg/uuwJXDpEBqtaGUZZoklAKp1sE9eqTK2Mia7RSpH0AyT3lP5BaxNJkiagobOIz3Gpe2ZQs3HYz8icFKw3wxic35KApQ/0?wx_fmt=jpeg", Url = "http://jifenweixin.shinho.net.cn/#/component/activityrule" }; msg.Articles = new List <ArticelModel>(); msg.Articles.Add(articel); msg.Articles.Add(articel2); remsg = XmlHelpler.GetArticlesXml(msg); } } else { msg.MsgType = "news"; ArticelModel articel = new ArticelModel() { Title = "味达美厨师会员招募啦!点击图片即可注册!!!", Description = "积分好礼、国内外学习考察、新品试用等你来!", PicUrl = "https://mmbiz.qpic.cn/mmbiz_jpg/uuwJXDpEBqsSZZuaafJUZfNibZ109B0CXbWpLSaKEdQdibozC0LOibu9Eshs0R1yfgFNOYvI0icb7ntDKXC2k06tVw/0?wx_fmt=jpeg", Url = ConfigurationManager.AppSettings["WeiXinDomain"] + "component/register" }; ArticelModel articel2 = new ArticelModel() { Title = "会员扫码须知", Description = "会员扫码须知", PicUrl = "https://mmbiz.qpic.cn/mmbiz_jpg/uuwJXDpEBqtaGUZZoklAKp1sE9eqTK2Mia7RSpH0AyT3lP5BaxNJkiagobOIz3Gpe2ZQs3HYz8icFKw3wxic35KApQ/0?wx_fmt=jpeg", Url = "http://jifenweixin.shinho.net.cn/#/component/activityrule" }; msg.Articles = new List <ArticelModel>(); msg.Articles.Add(articel); msg.Articles.Add(articel2); remsg = XmlHelpler.GetArticlesXml(msg); } Response.Write(GetMsg(remsg, ccg)); }