@@ -21,7 +21,7 @@ namespace HKCardIN.Helper | |||||
/// <summary> | /// <summary> | ||||
/// 拉取用户和卡信息 | /// 拉取用户和卡信息 | ||||
/// </summary> | /// </summary> | ||||
public static string PullUserAndCardInfo = DataBus.SaasRoute + "api/member-helper/membercardinfo/"; | |||||
public static string PullUserAndCardInfo = DataBus.SaasRoute + "api/member-helper/membercardinfo"; | |||||
/// <summary> | /// <summary> | ||||
/// 推送充值到服务器 | /// 推送充值到服务器 | ||||
/// </summary> | /// </summary> | ||||
@@ -29,6 +29,6 @@ namespace HKCardIN.Helper | |||||
/// <summary> | /// <summary> | ||||
/// 根据会员手机获取卡号 | /// 根据会员手机获取卡号 | ||||
/// </summary> | /// </summary> | ||||
public static string GetCardNoByPhone = DataBus.SaasRoute + "api/"; | |||||
public static string GetCardNoByPhone = DataBus.SaasRoute + "api/member-helper/membercardinfo"; | |||||
} | } | ||||
} | } |
@@ -1,4 +1,5 @@ | |||||
using HKCardIN.Helper; | |||||
using HandyControl.Controls; | |||||
using HKCardIN.Helper; | |||||
using HKCardIN.Logic.Model; | using HKCardIN.Logic.Model; | ||||
using Newtonsoft.Json.Linq; | using Newtonsoft.Json.Linq; | ||||
using System; | using System; | ||||
@@ -23,7 +24,9 @@ namespace HKCardIN.Logic | |||||
{ | { | ||||
return IHttpMultiClient.HttpMulti.AddNode(t => | return IHttpMultiClient.HttpMulti.AddNode(t => | ||||
{ | { | ||||
t.NodePath = ApiRoute.PullUserAndCardInfo + CardNo; | |||||
t.NodePath = ApiRoute.PullUserAndCardInfo; | |||||
t.ReqType = MultiType.POST; | |||||
t.JsonParam = (new { cardNum = CardNo }).ToJson(); | |||||
}).Build().RunStringFirst().ToModel<JObject>()["data"].ToJson().ToModel<UserAndCardInfo>(); | }).Build().RunStringFirst().ToModel<JObject>()["data"].ToJson().ToModel<UserAndCardInfo>(); | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -46,11 +49,13 @@ namespace HKCardIN.Logic | |||||
/// </summary> | /// </summary> | ||||
/// <param name="Phone"></param> | /// <param name="Phone"></param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
public string GetCardNoByPhone(string Phone) | |||||
public UserAndCardInfo GetCardNoByPhone(string Phone) | |||||
{ | { | ||||
var data = IHttpMultiClient.HttpMulti.AddNode(t => { | var data = IHttpMultiClient.HttpMulti.AddNode(t => { | ||||
t.NodePath = ApiRoute.GetCardNoByPhone; | t.NodePath = ApiRoute.GetCardNoByPhone; | ||||
}).Build().RunStringFirst(); | |||||
t.ReqType = MultiType.POST; | |||||
t.JsonParam = (new { phone = Phone }).ToJson(); | |||||
}).Build().RunStringFirst().ToModel<JObject>()["data"].ToJson().ToModel<UserAndCardInfo>(); | |||||
return data; | return data; | ||||
} | } | ||||
} | } | ||||
@@ -1,4 +1,6 @@ | |||||
using HKLog; | |||||
using HKCardIN.Logic; | |||||
using HKCardIN.Logic.Model; | |||||
using HKLog; | |||||
using System.Text.RegularExpressions; | using System.Text.RegularExpressions; | ||||
using System.Windows; | using System.Windows; | ||||
using UHFHelper; | using UHFHelper; | ||||
@@ -11,6 +13,7 @@ namespace HKCardIN.Views | |||||
/// </summary> | /// </summary> | ||||
public partial class CardView : System.Windows.Window | public partial class CardView : System.Windows.Window | ||||
{ | { | ||||
UserAndCardInfo info; | |||||
public CardView() | public CardView() | ||||
{ | { | ||||
InitializeComponent(); | InitializeComponent(); | ||||
@@ -20,13 +23,15 @@ namespace HKCardIN.Views | |||||
{ | { | ||||
if (this.Phone.Text.IsNullOrEmpty()) HandyControl.Controls.Growl.InfoGlobal("手机号不能为空!"); | if (this.Phone.Text.IsNullOrEmpty()) HandyControl.Controls.Growl.InfoGlobal("手机号不能为空!"); | ||||
if (!Regex.IsMatch(this.Phone.Text, "\\d{11}")) HandyControl.Controls.Growl.InfoGlobal("请输入正确的手机号!"); | if (!Regex.IsMatch(this.Phone.Text, "\\d{11}")) HandyControl.Controls.Growl.InfoGlobal("请输入正确的手机号!"); | ||||
//查询接口 | |||||
Create.IsEnabled = true; | |||||
info = BaseLogic.GetInstance().GetCardNoByPhone(Phone.Text); | |||||
if (info != null) | |||||
//查询接口 | |||||
Create.IsEnabled = true; | |||||
} | } | ||||
private void CreateClick(object sender, RoutedEventArgs e) | private void CreateClick(object sender, RoutedEventArgs e) | ||||
{ | { | ||||
var res = UHFCardHelper.GetInstance().WriteCard("1569245210230263808"); | |||||
var res = UHFCardHelper.GetInstance().WriteCard(info.CardNum); | |||||
HKLogImport.WriteInfo(res.ResMes); | HKLogImport.WriteInfo(res.ResMes); | ||||
DialogResult = true; | DialogResult = true; | ||||
Close(); | Close(); | ||||