2024-08-03 11:49:28 +00:00
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using RustTools.DataList;
|
|
|
|
|
using RustTools.muqing;
|
|
|
|
|
using Windows.System;
|
2024-07-14 11:24:10 +00:00
|
|
|
|
|
|
|
|
|
namespace RustTools.ViewModels;
|
|
|
|
|
|
|
|
|
|
public partial class ConcernViewModel : ObservableRecipient
|
|
|
|
|
{
|
2024-08-03 11:49:28 +00:00
|
|
|
|
public ObservableCollection<CommunityList.Data> communitylist = new();
|
|
|
|
|
public ObservableCollection<MovingInfo.Data> MovingInfoList = new();
|
|
|
|
|
private readonly string json = @"
|
|
|
|
|
{
|
|
|
|
|
""code"": 0,
|
|
|
|
|
""message"": ""获取成功,共3条记录"",
|
|
|
|
|
""data"": [
|
|
|
|
|
{
|
|
|
|
|
""account"": ""offical"",
|
|
|
|
|
""cover"": ""../user/offical/cover.png"",
|
|
|
|
|
""introduce"": null,
|
|
|
|
|
""fans"": ""64"",
|
|
|
|
|
""follower"": ""5"",
|
|
|
|
|
""praise"": ""0"",
|
|
|
|
|
""userName"": ""铁锈助手官方"",
|
|
|
|
|
""headIcon"": ""http://rust.coldmint.top/user/offical/icon.png"",
|
|
|
|
|
""email"": ""2923268971@qq.com"",
|
|
|
|
|
""permission"": ""2"",
|
|
|
|
|
""loginTime"": ""2023-10-21 22:28:18"",
|
|
|
|
|
""gender"": ""1"",
|
|
|
|
|
""enable"": ""true"",
|
|
|
|
|
""dynamicColor"": ""null""
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
""account"": ""coldmint"",
|
|
|
|
|
""cover"": ""http://rust.coldmint.top/user/coldmint/covers/181d019f-7cb7-9c07-389e-5a78b98eea54.png"",
|
|
|
|
|
""introduce"": ""我是薄荷老师。”"",
|
|
|
|
|
""fans"": ""141"",
|
|
|
|
|
""follower"": ""13"",
|
|
|
|
|
""praise"": ""0"",
|
|
|
|
|
""userName"": ""薄荷今天吃什么?"",
|
|
|
|
|
""headIcon"": ""https://rust.coldmint.top/user/coldmint/icons/4006dc55-9101-39cc-7076-34c4b32924d5.png"",
|
|
|
|
|
""email"": ""cold_mint@qq.com"",
|
|
|
|
|
""permission"": ""1"",
|
|
|
|
|
""loginTime"": ""2024-08-02 22:04:48"",
|
|
|
|
|
""gender"": ""-1"",
|
|
|
|
|
""enable"": ""true"",
|
|
|
|
|
""dynamicColor"": ""null""
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
""account"": ""muqing"",
|
|
|
|
|
""cover"": ""../user/muqing/covers/d4083a79-1e7f-d3bc-5944-ae9bce0d6714.png"",
|
|
|
|
|
""introduce"": ""nihao"",
|
|
|
|
|
""fans"": ""1"",
|
|
|
|
|
""follower"": ""1"",
|
|
|
|
|
""praise"": ""0"",
|
|
|
|
|
""userName"": ""薄荷是我的老婆"",
|
|
|
|
|
""headIcon"": ""../user/muqing/icons/cf0582bb-584c-176f-098b-a9a95af22a44.png"",
|
|
|
|
|
""email"": ""2583089389@qq.com"",
|
|
|
|
|
""permission"": ""3"",
|
|
|
|
|
""loginTime"": ""2024-04-18 14:08:22"",
|
|
|
|
|
""gender"": ""1"",
|
|
|
|
|
""enable"": ""true"",
|
|
|
|
|
""dynamicColor"": ""null""
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}";
|
2024-07-14 11:24:10 +00:00
|
|
|
|
public ConcernViewModel()
|
|
|
|
|
{
|
2024-08-03 11:49:28 +00:00
|
|
|
|
|
|
|
|
|
var response = JsonConvert.DeserializeObject<CommunityList>(json);
|
|
|
|
|
var a = new CommunityList.Data
|
|
|
|
|
{
|
|
|
|
|
UserName = "全部",
|
|
|
|
|
HeadIcon = "/Assets/tool.png"
|
|
|
|
|
};
|
|
|
|
|
communitylist.Add(a);
|
|
|
|
|
foreach (var item in response.data)
|
|
|
|
|
{
|
|
|
|
|
//item.UserName
|
|
|
|
|
item.HeadIcon= item.HeadIcon.Replace("..", wl.api);
|
|
|
|
|
communitylist.Add(item);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MovingInfoList.Add(new MovingInfo.Data("123123"));
|
|
|
|
|
MovingInfoList.Add(new MovingInfo.Data("123123"));
|
|
|
|
|
MovingInfoList.Add(new MovingInfo.Data("123123"));
|
|
|
|
|
MovingInfoList.Add(new MovingInfo.Data("123123"));
|
|
|
|
|
MovingInfoList.Add(new MovingInfo.Data("123123"));
|
|
|
|
|
MovingInfoList.Add(new MovingInfo.Data("123123"));
|
|
|
|
|
MovingInfoList.Add(new MovingInfo.Data("123123"));
|
2024-07-14 11:24:10 +00:00
|
|
|
|
}
|
|
|
|
|
}
|