public GYWx.Reply.ReplayMsgBase ProcessMenuEvent(GYWx.Receive.EventMsg.MenuEvent sender) { //GYWx.Reply.ReplayMsgBase msg = null; ////测试 //if (sender.Event.ToLower() == "click") //{ // //string json = null; // //string token = GetWXToken(); // //var input = new ReplyBMsgUserText(); // //input.touser = new string[] { sender.FromUserName }; // //input.text = new GYWx.Post.JsonModel.Cls.ContentCls() { content = "测试发送模板素材" }; // //input.msgtype = "text"; // //var result = WxGetMethod.SendBatchMsgByOpenID(input, token, ref json); // GYWx.Reply.NormalReply.Replynews arictil = new Replynews(); // arictil.FromUserName = sender.ToUserName; // arictil.ToUserName = sender.FromUserName; // arictil.CreateTime = sender.CreateTime; // arictil.MsgType = "news"; // arictil.ArticleCount = "1"; // arictil.Articles = new ArticleCls() // { // item = new NewsCls[]{ // new NewsCls(){ // Url="123231", // Title="123123", // Description="213123", // PicUrl="2313" // } // } // }; // return arictil; // //GYWx.Reply.NormalReply.Replytext text = new Replytext(); // //text.FromUserName = sender.ToUserName; // //text.ToUserName = sender.FromUserName; // //text.CreateTime = sender.CreateTime; // //text.Content = "点击clike测试:" ; // //return text; //} //else //{ // return msg; //} return(null); }
/// <summary> /// 用户与菜单交互 /// </summary> /// <param name="sender"></param> /// <returns></returns> public ReplayMsgBase ProcessMenuEvent(GYWx.Receive.EventMsg.MenuEvent sender) { ReplayMsgBase msg = null; //测试 if (sender.Event.ToLower() == "click") { //string json = null; //string token = GetWXToken(); //var input = new ReplyBMsgUserText(); //input.touser = new string[] { sender.FromUserName }; //input.text = new GYWx.Post.JsonModel.Cls.ContentCls() { content = "测试发送模板素材" }; //input.msgtype = "text"; //var result = WxGetMethod.SendBatchMsgByOpenID(input, token, ref json); if (sender.EventKey == "V1001_jbwz") { GYWx.Reply.NormalReply.Replynews arictil = new Replynews(); arictil.FromUserName = sender.ToUserName; arictil.ToUserName = sender.FromUserName; arictil.CreateTime = sender.CreateTime; arictil.MsgType = "news"; arictil.ArticleCount = "4"; arictil.Articles = new ArticleCls() { item = new NewsCls[] { new NewsCls() { Url = "http://www.oznerwater.com/lktnew/wap/wxshareoauth.aspx?gourl=http://www.oznerwater.com/lktnew/wx/wxhtml/A1.html", Title = "我和健康有个约惠", Description = "我和健康有个约惠", PicUrl = "http://www.oznerwater.com/lktnew/upload/wxts/0.jpg" }, new NewsCls() { Url = "http://www.oznerwater.com/lktnew/wap/wxshareoauth.aspx?gourl=http://www.oznerwater.com/lktnew/wx/wxhtml/A2.html", Title = "第一次跟他接吻快亲上去的时候他突然", Description = "", PicUrl = "http://www.oznerwater.com/lktnew/upload/wxts/1.jpg" }, new NewsCls() { Url = "http://www.oznerwater.com/lktnew/wap/wxshareoauth.aspx?gourl=http://www.oznerwater.com/lktnew/wx/wxhtml/A3.html", Title = "彭麻麻最近拍了一个广告片,震惊国人!", Description = "", PicUrl = "http://www.oznerwater.com/lktnew/upload/wxts/2.jpg" }, new NewsCls() { Url = "http://www.oznerwater.com/lktnew/wap/wxshareoauth.aspx?gourl=http://www.oznerwater.com/lktnew/wx/wxhtml/A4.html", Title = "惊呆了!震动是吃哪补哪!养生达人私藏集锦!", Description = "", PicUrl = "http://www.oznerwater.com/lktnew/upload/wxts/3.jpg" } } }; return(arictil); } else { GYWx.Reply.NormalReply.Replytext text = new Replytext(); text.FromUserName = sender.ToUserName; text.ToUserName = sender.FromUserName; text.CreateTime = sender.CreateTime; text.Content = "点击clike测试:"; return(text); } } else { return(msg); } }