From 13ca6552d27b96b04cb3469af08dbd043db22444 Mon Sep 17 00:00:00 2001 From: Mc7246 Date: Fri, 14 Jun 2019 18:07:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=99=84=E8=BF=91=E7=9A=84?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=B7=BB=E5=8A=A0=E5=9C=B0=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdvancedAPIs/WxApp/WxAppApi.cs | 88 +++++++++++++------ .../WxAppJson/GetNearbyPoiListJsonResult.cs | 32 +++++++ ...questMessageEvent_AddNearbyPoiAuditInfo.cs | 2 +- 3 files changed, 95 insertions(+), 27 deletions(-) diff --git a/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs index 9a1737583b..fa71553018 100644 --- a/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs @@ -285,22 +285,40 @@ public static WxJsonResult CheckSession(string accessTokenOrAppId, string openId /// /// 添加地点 /// - /// AccessToken或AppId(推荐使用AppId,需要先注册) - /// 经营资质主体(与小程序同主体--不填,与小程序非同主体--必填) - /// 经营资质证件号 - /// 经营资质地址 - /// 相关证明材料照片临时素材mediaid(与小程序同主体--不填,与小程序非同主体--必填) + /// + /// 门店图片,最多9张,最少1张,上传门店图片如门店外景、环境设施、商品服务等,图片将展示在微信客户端的门店页。图片链接通过文档https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444738729中的《上传图文消息内的图片获取URL》接口获取。必填,文件格式为bmp、png、jpeg、jpg或gif,大小不超过5M pic_list是字符串,内容是一个json! + /// 服务标签列表 选填,需要填写服务标签ID、APPID、对应服务落地页的path路径,详细字段格式见下方示例 + /// 门店名字 必填,门店名称需按照所选地理位置自动拉取腾讯地图门店名称,不可修改,如需修改请重新选择地图地点或重新创建地点 + /// 营业时间,格式11:11-12:12 必填 + /// 资质号 必填, 15位营业执照注册号或9位组织机构代码 + /// 地址 必填 + /// 主体名字 必填 + /// 证明材料 必填 如果company_name和该小程序主体不一致,需要填qualification_list,详细规则见附近的小程序使用指南-如何证明门店的经营主体跟公众号或小程序帐号主体相关http://kf.qq.com/faq/170401MbUnim17040122m2qY.html + /// 客服信息 选填,可自定义服务头像与昵称,具体填写字段见下方示例kf_info pic_list是字符串,内容是一个json! + /// 如果创建新的门店,poi_id字段为空 如果更新门店,poi_id参数则填对应门店的poi_id 选填 /// /// [ApiBind(NeuChar.PlatformType.WeChat_MiniProgram, "WxAppApi.AddNearbyPoi", true)] - public static AddNearbyPoiJsonResult AddNearbyPoi(string accessTokenOrAppId, string relatedName, string relatedCredential, string relatedAddress, string relatedProofMaterial, int timeOut = Config.TIME_OUT) + public static AddNearbyPoiJsonResult AddNearbyPoi(string accessTokenOrAppId, string pic_list, string service_infos, string store_name,string hour, string credential, string address, string company_name, string qualification_list="", string kf_info="", string poi_id="", int timeOut = Config.TIME_OUT) { return WxOpenApiHandlerWapper.TryCommonApi(accessToken => { string urlFormat = Config.ApiMpHost + "/wxa/addnearbypoi?access_token={0}"; string url = string.Format(urlFormat, accessToken); - var data = new { related_name = relatedName, related_credential = relatedCredential, related_address = relatedAddress, related_proof_material = relatedProofMaterial }; + var data = new { + is_comm_nearby = "1", //必填,写死为"1" + pic_list = pic_list, + service_infos = service_infos, + store_name = store_name, + hour = hour, + credential = credential, + address = address, + company_name = company_name, + qualification_list = qualification_list, + kf_info = kf_info, + poi_id = poi_id + }; return CommonJsonSend.Send(accessToken, url, data, timeOut: timeOut); @@ -320,12 +338,12 @@ public static GetNearbyPoiListJsonResult GetNearbyPoiList(string accessTokenOrAp { return WxOpenApiHandlerWapper.TryCommonApi(accessToken => { - string urlFormat = Config.ApiMpHost + "/wxa/getnearbypoilist?access_token={0}"; - string url = string.Format(urlFormat, accessToken); + string urlFormat = Config.ApiMpHost + "/wxa/getnearbypoilist?access_token={0}&page={1}&page_rows={2}"; + string url = string.Format(urlFormat, accessToken, page, page_rows); - var data = new { page = page, page_rows = page_rows }; + //var data = new { page = page, page_rows = page_rows }; - return CommonJsonSend.Send(accessToken, url, data, timeOut: timeOut); + return CommonJsonSend.Send(accessToken, url, null, timeOut: timeOut); }, accessTokenOrAppId); } @@ -778,30 +796,48 @@ public static async Task CheckSessionAsync(string accessTokenOrApp }, accessTokenOrAppId).ConfigureAwait(false); } - /// /// 【异步方法】添加地点 /// - /// AccessToken或AppId(推荐使用AppId,需要先注册) - /// 经营资质主体(与小程序同主体--不填,与小程序非同主体--必填) - /// 经营资质证件号 - /// 经营资质地址 - /// 相关证明材料照片临时素材mediaid(与小程序同主体--不填,与小程序非同主体--必填) + /// + /// 门店图片,最多9张,最少1张,上传门店图片如门店外景、环境设施、商品服务等,图片将展示在微信客户端的门店页。图片链接通过文档https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1444738729中的《上传图文消息内的图片获取URL》接口获取。必填,文件格式为bmp、png、jpeg、jpg或gif,大小不超过5M pic_list是字符串,内容是一个json! + /// 服务标签列表 选填,需要填写服务标签ID、APPID、对应服务落地页的path路径,详细字段格式见下方示例 + /// 门店名字 必填,门店名称需按照所选地理位置自动拉取腾讯地图门店名称,不可修改,如需修改请重新选择地图地点或重新创建地点 + /// 营业时间,格式11:11-12:12 必填 + /// 资质号 必填, 15位营业执照注册号或9位组织机构代码 + /// 地址 必填 + /// 主体名字 必填 + /// 证明材料 必填 如果company_name和该小程序主体不一致,需要填qualification_list,详细规则见附近的小程序使用指南-如何证明门店的经营主体跟公众号或小程序帐号主体相关http://kf.qq.com/faq/170401MbUnim17040122m2qY.html + /// 客服信息 选填,可自定义服务头像与昵称,具体填写字段见下方示例kf_info pic_list是字符串,内容是一个json! + /// 如果创建新的门店,poi_id字段为空 如果更新门店,poi_id参数则填对应门店的poi_id 选填 /// /// [ApiBind(NeuChar.PlatformType.WeChat_MiniProgram, "WxAppApi.AddNearbyPoiAsync", true)] - public static async Task AddNearbyPoiAsync(string accessTokenOrAppId, string relatedName, string relatedCredential, string relatedAddress, string relatedProofMaterial, int timeOut = Config.TIME_OUT) + public static async Task AddNearbyPoiAsync(string accessTokenOrAppId, string pic_list, string service_infos, string store_name, string hour, string credential, string address, string company_name, string qualification_list = "", string kf_info = "", string poi_id = "", int timeOut = Config.TIME_OUT) { - return await WxOpenApiHandlerWapper.TryCommonApiAsync(async accessToken => + return await WxOpenApiHandlerWapper.TryCommonApiAsync(accessToken => { string urlFormat = Config.ApiMpHost + "/wxa/addnearbypoi?access_token={0}"; string url = string.Format(urlFormat, accessToken); - var data = new { related_name = relatedName, related_credential = relatedCredential, related_address = relatedAddress, related_proof_material = relatedProofMaterial }; + var data = new + { + is_comm_nearby = "1", //必填,写死为"1" + pic_list = pic_list, + service_infos = service_infos, + store_name = store_name, + hour = hour, + credential = credential, + address = address, + company_name = company_name, + qualification_list = qualification_list, + kf_info = kf_info, + poi_id = poi_id + }; - return await CommonJsonSend.SendAsync(accessToken, url, data, timeOut: timeOut).ConfigureAwait(false); + return CommonJsonSend.SendAsync(accessToken, url, data, timeOut: timeOut); - }, accessTokenOrAppId).ConfigureAwait(false); + }, accessTokenOrAppId); } /// @@ -817,12 +853,12 @@ public static async Task GetNearbyPoiListAsync(strin { return await WxOpenApiHandlerWapper.TryCommonApiAsync(async accessToken => { - string urlFormat = Config.ApiMpHost + "/wxa/getnearbypoilist?access_token={0}"; - string url = string.Format(urlFormat, accessToken); + string urlFormat = Config.ApiMpHost + "/wxa/getnearbypoilist?access_token={0}&page={1}&page_rows={2}"; + string url = string.Format(urlFormat, accessToken, page, page_rows); - var data = new { page = page, page_rows = page_rows }; + //var data = new { page = page, page_rows = page_rows }; - return await CommonJsonSend.SendAsync(accessToken, url, data, timeOut: timeOut).ConfigureAwait(false); + return await CommonJsonSend.SendAsync(accessToken, url, null, timeOut: timeOut).ConfigureAwait(false); }, accessTokenOrAppId).ConfigureAwait(false); } diff --git a/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppJson/GetNearbyPoiListJsonResult.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppJson/GetNearbyPoiListJsonResult.cs index 48aebefb6d..af11ea2f9d 100644 --- a/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppJson/GetNearbyPoiListJsonResult.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppJson/GetNearbyPoiListJsonResult.cs @@ -18,10 +18,19 @@ public class GetNearbyPoiListJsonResult : WxJsonResult [Serializable] public class Data { + /// + /// 剩余可添加地点个数 + /// public int left_apply_num { get; set; } + /// + /// 最大可添加地点个数 + /// public int max_apply_num { get; set; } + /// + /// 地址列表的 JSON 格式字符串 + /// public PoiList data { get; set; } } @@ -37,16 +46,39 @@ public class PoiList [Serializable] public class PoiInfo { + /// + /// 附近地点 ID + /// public string poi_id { get; set; } + /// + /// 资质证件地址 + /// public string qualification_address { get; set; } + /// + /// 资质证件证件号 + /// public string qualification_num { get; set; } + /// + /// 地点审核状态 + /// 3 审核中 + /// 4 审核失败 + /// 5 审核通过 + /// public int audit_status { get; set; } + /// + /// 地点展示在附近状态 + /// 0 未展示 + /// 1 展示中 + /// public int display_status { get; set; } + /// + /// 审核失败原因,audit_status=4 时返回 + /// public string refuse_reason { get; set; } } } diff --git a/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Entities/Request/Event/RequestMessageEvent_AddNearbyPoiAuditInfo.cs b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Entities/Request/Event/RequestMessageEvent_AddNearbyPoiAuditInfo.cs index 788ebeedeb..d29402d04c 100644 --- a/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Entities/Request/Event/RequestMessageEvent_AddNearbyPoiAuditInfo.cs +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Entities/Request/Event/RequestMessageEvent_AddNearbyPoiAuditInfo.cs @@ -58,7 +58,7 @@ public override Event Event public int status { get; set; } /// - /// 如果status为3或者4,会返回审核失败的原因 + /// 如果status为2,会返回审核失败的原因 /// public string reason { get; set; }