Exemple #1
0
        /// <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));
        }
Exemple #2
0
        /// <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 async Task <AddShelfResult> AddShelvesAsync(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(await Core.CommonAPIs.CommonJsonSend.SendAsync <AddShelfResult>(accessToken, urlFormat, data));
        }