Ejemplo n.º 1
0
        /// <summary>
        /// 扫描二维码,用户已关注时,进行关注后的事件推送
        /// </summary>
        /// <param name="httpRequest"></param>
        /// <param name="msg"></param>
        public static void ResponseScanSubscribeEvent(HttpResponseBase Response, MsgModel msg, ResultCryptography ccg)
        {
            string str = msg.EventModel.EventKeyModel.EventKey;

            if (!string.IsNullOrEmpty(str))
            {
                int Id = Convert.ToInt32(System.Text.RegularExpressions.Regex.Replace(str, @"[^0-9]+", ""));
                if (Id < 30000 && Id > 0)
                {
                    //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"
                    };
                    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"
                    };
                    ArticelModel articel3 = new ArticelModel()
                    {
                        Title       = "即日起至2月10日,凡任务达标者即可瓜分20万积分红包!",
                        Description = "即日起至2月10日,凡任务达标者即可瓜分20万积分红包!",
                        PicUrl      = "https://mmbiz.qpic.cn/mmbiz_jpg/uuwJXDpEBqtIndjMF7wbHqDy3CVVvrmTHXAdA9QtewoUvqgazfLlCmfhjExN3HuHk7sbtgp6trxNqt64Z01uqA/0?wx_fmt=jpeg",
                        Url         = "http://mp.weixin.qq.com/s/5H6_rnk86ai2fOs-ChI2Gg"
                    };
                    msg.Articles = new List <ArticelModel>();
                    msg.Articles.Add(articel);
                    msg.Articles.Add(articel2);
                    msg.Articles.Add(articel3);
                }
            }
            //else
            //{
            //    ResponseNoEvent(Response, msg, ccg);
            //}
            var remsg = XmlHelpler.GetArticlesXml(msg);

            Response.Write(GetMsg(remsg, ccg));
        }