@@ -21,7 +21,7 @@ namespace HKCardIN.Helper | |||||
/// <summary> | /// <summary> | ||||
/// 拉取用户和卡信息 | /// 拉取用户和卡信息 | ||||
/// </summary> | /// </summary> | ||||
public static string PullUserAndCardInfo = DataBus.SaasRoute + ""; | |||||
public static string PullUserAndCardInfo = DataBus.SaasRoute + "api/member-helper/membercardinfo/"; | |||||
/// <summary> | /// <summary> | ||||
/// 推送充值到服务器 | /// 推送充值到服务器 | ||||
/// </summary> | /// </summary> | ||||
@@ -1,4 +1,5 @@ | |||||
using HKCardIN.Helper; | using HKCardIN.Helper; | ||||
using HKCardIN.Logic.Model; | |||||
using Newtonsoft.Json.Linq; | using Newtonsoft.Json.Linq; | ||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
@@ -18,12 +19,12 @@ namespace HKCardIN.Logic | |||||
/// 同步用户和卡信息 | /// 同步用户和卡信息 | ||||
/// </summary> | /// </summary> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
public async Task<dynamic> PullUserAndCardInfo(string CardNo) | |||||
public UserAndCardInfo PullUserAndCardInfo(string CardNo) | |||||
{ | { | ||||
return await IHttpMultiClient.HttpMulti.AddNode(t => | |||||
{ | |||||
t.NodePath = ApiRoute.PullUserAndCardInfo; | |||||
}).Build().RunStringFirstAsync(); | |||||
return IHttpMultiClient.HttpMulti.AddNode(t => | |||||
{ | |||||
t.NodePath = ApiRoute.PullUserAndCardInfo + CardNo; | |||||
}).Build().RunStringFirst().ToModel<JObject>()["data"].ToJson().ToModel<UserAndCardInfo>(); | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 同步充值记录 | /// 同步充值记录 | ||||
@@ -36,7 +37,7 @@ namespace HKCardIN.Logic | |||||
{ | { | ||||
t.NodePath = ApiRoute.PushMoneyToServer; | t.NodePath = ApiRoute.PushMoneyToServer; | ||||
t.ReqType = MultiType.POST; | t.ReqType = MultiType.POST; | ||||
t.JsonParam = (new { Money, Type = 1, No = CardNo }).ToJson(); | |||||
t.JsonParam = (new { Money, Type = 1, CardNum = CardNo }).ToJson(); | |||||
}).Build().RunStringFirst(); | }).Build().RunStringFirst(); | ||||
return bool.Parse(data.ToModel<JObject>()["data"].ToString()); | return bool.Parse(data.ToModel<JObject>()["data"].ToString()); | ||||
} | } | ||||
@@ -0,0 +1,20 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace HKCardIN.Logic.Model | |||||
{ | |||||
public class UserAndCardInfo | |||||
{ | |||||
public string MemberName { get; set; } | |||||
public string MemberPhone { get; set; } | |||||
public string MemberCardId { get; set; } | |||||
public string MemberHeadImgUrl { get; set; } | |||||
public string CardNum { get; set; } | |||||
public int CardState { get; set; } | |||||
public string Stutas => CardState == 0 ? "禁用" : (CardState == 1 ? "正常" : (CardState == 2 ? "挂失" : "作废")); | |||||
public decimal Money { get; set; } | |||||
} | |||||
} |
@@ -1,5 +1,6 @@ | |||||
using HKCardIN.Helper; | using HKCardIN.Helper; | ||||
using HKCardIN.Logic; | using HKCardIN.Logic; | ||||
using HKCardIN.Logic.Model; | |||||
using Stylet; | using Stylet; | ||||
using System; | using System; | ||||
using System.Threading; | using System.Threading; | ||||
@@ -54,6 +55,12 @@ namespace HKCardIN.ViewModels | |||||
get => _CardNo; | get => _CardNo; | ||||
set => SetAndNotify(ref _CardNo, value); | set => SetAndNotify(ref _CardNo, value); | ||||
} | } | ||||
UserAndCardInfo _Info; | |||||
public UserAndCardInfo Info | |||||
{ | |||||
get => _Info; | |||||
set => SetAndNotify(ref _Info, value); | |||||
} | |||||
#endregion | #endregion | ||||
#region 命令 | #region 命令 | ||||
@@ -116,7 +116,7 @@ | |||||
<Image | <Image | ||||
Width="100" | Width="100" | ||||
Height="120" | Height="120" | ||||
Source="/HKResouces/头像.png" | |||||
Source="{Binding Info.MemberHeadImgUrl}" | |||||
Stretch="UniformToFill" /> | Stretch="UniformToFill" /> | ||||
</Border> | </Border> | ||||
<StackPanel Grid.Column="1"> | <StackPanel Grid.Column="1"> | ||||
@@ -129,7 +129,7 @@ | |||||
FontSize="18" | FontSize="18" | ||||
Foreground="Red" | Foreground="Red" | ||||
Style="{StaticResource TextBlockDefaultBold}" | Style="{StaticResource TextBlockDefaultBold}" | ||||
Text="李四" /> | |||||
Text="{Binding Info.MemberName}" /> | |||||
</WrapPanel> | </WrapPanel> | ||||
<WrapPanel Margin="0,20,0,0"> | <WrapPanel Margin="0,20,0,0"> | ||||
<TextBlock | <TextBlock | ||||
@@ -140,18 +140,18 @@ | |||||
FontSize="18" | FontSize="18" | ||||
Foreground="Red" | Foreground="Red" | ||||
Style="{StaticResource TextBlockDefaultBold}" | Style="{StaticResource TextBlockDefaultBold}" | ||||
Text="13812345678" /> | |||||
Text="{Binding Info.MemberPhone}" /> | |||||
</WrapPanel> | </WrapPanel> | ||||
<WrapPanel Margin="0,20,0,0"> | <WrapPanel Margin="0,20,0,0"> | ||||
<TextBlock | <TextBlock | ||||
FontSize="18" | FontSize="18" | ||||
Style="{StaticResource Title}" | Style="{StaticResource Title}" | ||||
Text="员工号:" /> | |||||
Text="身份证:" /> | |||||
<TextBlock | <TextBlock | ||||
FontSize="18" | FontSize="18" | ||||
Foreground="Red" | Foreground="Red" | ||||
Style="{StaticResource TextBlockDefaultBold}" | Style="{StaticResource TextBlockDefaultBold}" | ||||
Text="001" /> | |||||
Text="{Binding Info.MemberCardId}" /> | |||||
</WrapPanel> | </WrapPanel> | ||||
</StackPanel> | </StackPanel> | ||||
</Grid> | </Grid> | ||||
@@ -170,7 +170,7 @@ | |||||
FontSize="18" | FontSize="18" | ||||
Foreground="Red" | Foreground="Red" | ||||
Style="{StaticResource TextBlockDefaultBold}" | Style="{StaticResource TextBlockDefaultBold}" | ||||
Text="123456" /> | |||||
Text="{Binding Info.CardNum}" /> | |||||
</WrapPanel> | </WrapPanel> | ||||
<WrapPanel Margin="0,20,0,0"> | <WrapPanel Margin="0,20,0,0"> | ||||
<TextBlock | <TextBlock | ||||
@@ -181,7 +181,7 @@ | |||||
FontSize="18" | FontSize="18" | ||||
Foreground="Red" | Foreground="Red" | ||||
Style="{StaticResource TextBlockDefaultBold}" | Style="{StaticResource TextBlockDefaultBold}" | ||||
Text="正常" /> | |||||
Text="{Binding Info.Stutas}" /> | |||||
</WrapPanel> | </WrapPanel> | ||||
<WrapPanel Margin="0,20,0,0"> | <WrapPanel Margin="0,20,0,0"> | ||||
<TextBlock | <TextBlock | ||||
@@ -192,7 +192,7 @@ | |||||
FontSize="18" | FontSize="18" | ||||
Foreground="Red" | Foreground="Red" | ||||
Style="{StaticResource TextBlockDefaultBold}" | Style="{StaticResource TextBlockDefaultBold}" | ||||
Text="123456" /> | |||||
Text="{Binding Info.Money}" /> | |||||
</WrapPanel> | </WrapPanel> | ||||
<WrapPanel Margin="0,20,0,0"> | <WrapPanel Margin="0,20,0,0"> | ||||
<TextBlock | <TextBlock | ||||