public void CreateLandingPage()
 {
     using (var fs = GetInputFile("qrcode.jpg"))
     {
         var result = _weChatApi.UploadImage("qrcode.jpg", fs);
         if (!result.IsSuccess())
         {
             Assert.Fail("上传图片失败,返回结果如下:" + result.DetailResult + ";Msg:" + result.GetFriendlyMessage());
         }
         var PageRequest = new CreateLandingPageRequest()
         {
             Banner     = result.Url,
             PageTitle  = "艾唯特优惠大放送",
             SceneTypes = SceneTypes.SCENE_MENU,
             CanShare   = true,
             CardList   = new List <SceneCardInfo>()
             {
                 new SceneCardInfo()
                 {
                     CardId   = "pl0uwwXdAIetRFMDxLlsoqRlBJac",
                     ThumbUrl = result.Url
                 }
             }
         };
         var resultPageRequest = _weChatApi.CreateLandingPage(PageRequest);
         if (!resultPageRequest.IsSuccess())
         {
             Assert.Fail("创建货架失败,错误信息:" + resultPageRequest.DetailResult + ";Msg:" + resultPageRequest.GetFriendlyMessage());
         }
     }
 }
Example #2
0
        /// <summary>
        /// 卡券货架支持开发者通过调用接口生成一个卡券领取H5页面,并获取页面链接,进行卡券投放动作。
        /// 目前卡券货架仅支持非自定义code的卡券,自定义code的卡券需先调用导入code接口将code导入才能正常使用。
        /// 创建货架时需填写投放路径的场景字段
        /// </summary>
        public CreateLandingPageResult CreateLandingPage(CreateLandingPageRequest model)
        {
            var url    = GetAccessApiUrl("create", "card/landingpage", "https://api.weixin.qq.com");
            var result = Post <CreateLandingPageResult>(url, model);

            return(result);
        }