コード例 #1
0
ファイル: ShelvesTest.cs プロジェクト: bananaxzw/WeiXinMPSDK
 public void AddShelvesTest()
 {
     var m1 = new M1(2, 50);
     var groupIds =new int[]{49, 50, 51, 52};
     var m2 = new M2(groupIds);
     var m3 = new M3(49, "http://img0.bdstatic.com/img/image/shouye/dengni57.jpg");
     var imgs = new string[] { "http://img0.bdstatic.com/img/image/shouye/dengni57.jpg", "http://img0.bdstatic.com/img/image/shouye/dengni57.jpg", "http://img0.bdstatic.com/img/image/shouye/dengni57.jpg", "http://img0.bdstatic.com/img/image/shouye/dengni57.jpg" };
     var m4 = new M4(groupIds, imgs);
     var m5 = new M5(groupIds, "http://img0.bdstatic.com/img/image/shouye/dengni57.jpg");
     var result = WeixinShopShelves.AddShelves("accessToken", m1, m2, m3, m4, m5, "http://img0.bdstatic.com/img/image/shouye/dengni57.jpg", "测试货架");
     Console.Write(result);
     Assert.IsNotNull(result);
 }
コード例 #2
0
ファイル: Shelves.cs プロジェクト: henfe/WeiXinMPSDK
        /// <summary>
        /// 增加货架
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="m1">控件1数据</param>
        /// <param name="m2">控件2数据</param>
        /// <param name="m3">控件3数据</param>
        /// <param name="m4">控件4数据</param>
        /// <param name="m5">控件5数据</param>
        /// <param name="shelfBanner">货架招牌图片Url</param>
        /// <param name="shelfName">货架名称</param>
        /// <returns></returns>
        public static AddShelvesResult AddShelves(string accessToken, M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, string shelfBanner, string shelfName)
        {
            var urlFormat = "https://api.weixin.qq.com/merchant/shelf/add?access_token={0}";

            var data = new
                {
                    shelf_data = new
                        {
                            module_infos = new object[]
                                {
                                    m1,
                                    m2,
                                    m3,
                                    m4,
                                    m5
                                }
                        },
                    shelf_banner = shelfBanner,
                    shelf_name = shelfName
                };

            return CommonJsonSend.Send<AddShelvesResult>(accessToken, urlFormat, data);
        }
コード例 #3
0
ファイル: Shelves.cs プロジェクト: ngochoanhbr/dahuco
        /// <summary>
        /// 修改货架
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="m1">控件1数据</param>
        /// <param name="m2">控件2数据</param>
        /// <param name="m3">控件3数据</param>
        /// <param name="m4">控件4数据</param>
        /// <param name="m5">控件5数据</param>
        /// <param name="shelfId">货架Id</param>
        /// <param name="shelfBanner">货架招牌图片Url</param>
        /// <param name="shelfName">货架名称</param>
        /// <returns></returns>
        public static WxJsonResult ModShelves(string accessToken, M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, int shelfId, string shelfBanner, string shelfName)
        {
            var urlFormat = "https://api.weixin.qq.com/merchant/shelf/mod?access_token={0}";

            var data = new
            {
                shelf_id   = shelfId,
                shelf_data = new
                {
                    module_infos = new object[]
                    {
                        m1,
                        m2,
                        m3,
                        m4,
                        m5
                    }
                },
                shelf_banner = shelfBanner,
                shelf_name   = shelfName
            };

            return(CommonJsonSend.Send <WxJsonResult>(accessToken, urlFormat, data));
        }