Ejemplo n.º 1
0
        /// <summary>
        /// 创建菜单
        /// </summary>
        /// <param name="Response"></param>
        /// <param name="msg"></param>
        public static void CreateMenu()
        {
            StringBuilder sb   = new StringBuilder();
            string        url  = ConfigurationManager.AppSettings["WeiXinDomain"];
            string        json = "{\"button\":[" +
                                 "{\"name\":\"👑我的\",\"sub_button\":[" +
                                 "{\"type\":\"view\",\"name\":\"我的账户\",\"url\":\"" + url + "component/personal\"}," +
                                 "{\"type\":\"view\",\"name\":\"我要注册\",\"url\":\"" + url + "component/register\"}," +
                                 "{\"type\":\"view\",\"name\":\"会员须知\",\"url\":\"" + url + "component/membernotice\"}," +
                                 "{\"type\": \"scancode_waitmsg\",\"name\": \"扫一扫\",\"key\": \"rselfmenu_0_1\",\"sub_button\": [ ]}]" +
                                 "}," +
                                 //"{\"type\":\"view\",\"name\":\"📓菜谱\",\"url\":\"" + url + "component/menu\" }," +
                                 "{\"name\":\"📓菜谱\",\"sub_button\":[" +
                                 //"{\"type\":\"view\",\"name\":\"👏免费抽奖\",\"url\":\"" + url + "component/hometastedraw\"}," +
                                 //"{\"type\":\"view\",\"name\":\"💰赚10元话费\",\"url\":\"" + url + "component/dishshow\"}," +
                                 "{\"type\":\"view\",\"name\":\"📓菜谱\",\"url\":\"" + url + "component/menu\" }]" +

                                 "}," +
                                 "{\"name\":\"💰积分活动\",\"sub_button\":[" +
                                 //"{\"type\":\"view\",\"name\":\"答题赚积分\",\"url\":\"" + url + "component/riddleshome\" }," +
                                 "{\"type\":\"view\",\"name\":\"每日签到\",\"url\":\"" + url + "component/sign\"}," +
                                 "{\"type\":\"view\",\"name\":\"积分兑换\",\"url\":\"" + url + "component/shop\"}," +
                                 "{\"type\":\"view\",\"name\":\"积分抽奖\",\"url\":\"" + url + "component/integraldraw\"}," +
                                 "{\"type\":\"view\",\"name\":\"扫码规则\",\"url\":\"" + url + "component/activityrule\"}]" +
                                 "}" +
                                 "]}";

            PostJson("https://api.weixin.qq.com/cgi-bin/menu/create?access_token=" + BasicApi.GetAccessToken(), json);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 创建菜单
        /// </summary>
        /// <param name="Response"></param>
        /// <param name="msg"></param>
        public static void CreateMenu()

        {
            StringBuilder sb   = new StringBuilder();
            string        url  = ConfigurationManager.AppSettings["WeChat"];
            string        json = "{\"button\":[" +
                                 "{\"name\":\"我的\",\"sub_button\":[" +
                                 //"{\"type\":\"view\",\"name\":\"我的账户\",\"url\":\"" + url + "component/personal\"}," +
                                 "{\"type\":\"view\",\"name\":\"注册&账户\",\"url\":\"" + url + "?action=personal\"}," +
                                 "{\"type\": \"scancode_waitmsg\",\"name\": \"扫一扫\",\"key\": \"rselfmenu_0_1\",\"sub_button\": [ ]}," +
                                 "{\"type\":\"view\",\"name\":\"商城入口\",\"url\":\"" + url + "?action=shop\"}," +
                                 "{\"type\":\"view\",\"name\":\"积分抽奖\",\"url\":\"" + url + "?action=integraldraw\"}," +
                                 "{\"type\":\"view\",\"name\":\"会员须知\",\"url\":\"" + url + "?action=membernotice\"}" +
                                 "]}," +
                                 "{\"type\":\"view\",\"name\":\"" + "🔥欣鲜菜谱库" + "\",\"url\":" + "\"http://jifenweixin.shinho.net.cn/?action=dishstore\"" +
                                 "}," +
                                 "{\"name\":\"码上抢红包\",\"sub_button\":[" +
                                 "{\"type\":\"view\",\"name\":\"活动入口\",\"url\":\"" + url + "?action=scanhome\"}," +
                                 "{\"type\":\"view\",\"name\":\"我的零钱包\",\"url\":\"" + url + "?action=scanrecord\"}," +
                                 "{\"type\":\"view\",\"name\":\"兑奖规则\",\"url\":\"" + url + "?action=scanrule\"}" +
                                 "]}" +
                                 "]}";

            PostJson("https://api.weixin.qq.com/cgi-bin/menu/create?access_token=" + BasicApi.GetAccessToken(), json);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 创建队员关注二维码
        /// </summary>
        public static string CreateSubscribeQRcode(int salemanId)
        {
            string json = "{\"expire_seconds\": 1800, \"action_name\": \"QR_SCENE\", \"action_info\": {\"scene\": {\"scene_id\": " + salemanId.ToString() + "}}}";
            string ret  = PostJson("https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=" + BasicApi.GetAccessToken(), json);
            var    q    = JsonHelper.JsonToObject <QRcode>(ret);

            return(q.ticket);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 1注册成功给1发模板消息
 /// </summary>
 /// <param name="Response"></param>
 /// <param name="msg"></param>
 public static void SendMuBanMsg(string json)
 {
     PostJson("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + BasicApi.GetAccessToken(), json);
 }
Ejemplo n.º 5
0
        /// <summary>
        /// 创建永久字符串形式的二维码参数
        /// </summary>
        public static string CreateLimitSubscribeQRcode(string scene_str)
        {
            string json = "{\"action_name\": \"QR_LIMIT_STR_SCENE\", \"action_info\": {\"scene\": {\"scene_str\": \"" + scene_str + "\"}}}";
            string ret  = PostJson("https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=" + BasicApi.GetAccessToken(), json);
            var    q    = JsonHelper.JsonToObject <QRcode>(ret);

            return(q.ticket);
        }