Merge pull request #266 from niuzhix/master

feat: 首页头图轮播&样式issue模板
This commit is contained in:
denglihong2007
2025-12-14 00:39:44 +08:00
committed by GitHub
7 changed files with 121 additions and 22 deletions

View File

@@ -0,0 +1,58 @@
name: 新样式请求
description: 提出一种新的屏幕样式
title: (将此栏【替换】为你的屏幕名称 例:无锡站站外大屏)
labels: ["新样式"]
body:
- type: markdown
attributes:
value: |
感谢您贡献您的想法。请在上面的文本框⬆️起一个能够清晰概括此样式的标题,便于开发者了解您的想法。
> [!important]
> 重要:如果您想要提出 **多项样式**,请为每一个样式开一个单独的 issue。
>
> 由于开发者时间精力有限,加上已经积压了大量的样式请求,提交的样式请求可能需要比较久的时间才能实现。
- type: checkboxes
id: checklist
attributes:
label: 检查清单
description: 在开始反馈这个问题之前,请先检查:
options:
- label: 我已将本应用更新到最新测试版 ![最新的版本号](https://img.shields.io/github/v/release/denglihong2007/CRSim?include_prereleases&style=flat-square&label=),并看过 [最新提交](https://github.com/denglihong2007/CRSim/commits/dev/),确认我想要的样式还没有实现。我也已在 [Issues](https://github.com/denglihong2007/CRSim/issues?q=-label%3ABug) 确认我想要的样式未被提交过。
required: true
- label: 我已经仔细阅读过选项里的内容,并且知道这个选项不用勾选。
- label: 我已知晓由于开发者时间精力有限,加上已经积压了大量的样式请求,我提交的样式请求可能需要比较久的时间才能实现。
required: true
- type: input
id: stationName
attributes:
label: 站名
description:
placeholder: 无锡站
validations:
required: false
- type: dropdown
id: screentype
attributes:
label: 想要请求的新样式种类
options:
- 站外屏
- 站内屏
- 检票口屏
- 廊桥屏
- 站台屏
- 出站口屏
- type: markdown
attributes:
label: 上传图片
value: |
> [!note]
> 上传附件时**请优先使用 GitHub 的附件系统上传附件**,将需要上传的附件粘贴或拖动到撰写区域即可上传。多个文件可打包为 zip 格式后上传。**尽量避免使用需要登陆或安装客户端才能接收附件的网盘(如\*度网盘、\*克网盘、1\*3网盘等上传附件**,以避免开发者因不具有对应网盘客户端或账户而延误问题诊断。
- type: checkboxes
id: revision
attributes:
label: 最后一步
description: 回顾您的回答
options:
- label: 我认为上述的描述已经足以详细,以便开发人员理解您想要的功能。如果我的 issue 没有按照上述的要求填写,可能会被无条件关闭。
required: true

View File

@@ -30,18 +30,26 @@ namespace CRSim.ScreenSimulator.Converters
// 到达模式或关键数据缺失
if (DisplayMode == "Arrive" || (values.Length > 1 && values[1] == null))
{
if (values[0] is DateTime arriveTime){
if (values[2] is TimeSpan state){
// arriveTime += TimeSpan.FromMinutes(state.TotalMinutes);
if (now >= arriveTime){
if (state.TotalMinutes > 0)
return string.Format(ArrivedLateText, ToHourMinuteString(state));
return ArrivedText;
}else{
if (state.TotalMinutes > 0)
return string.Format(ArrivingLateText, ToHourMinuteString(state));
return ArrivingText;
if (values.Length > 1)
{
if (values[2] is TimeSpan state)
{
// arriveTime += TimeSpan.FromMinutes(state.TotalMinutes);
if (now >= arriveTime)
{
if (state.TotalMinutes > 0)
return string.Format(ArrivedLateText, ToHourMinuteString(state));
return ArrivedText;
}
else
{
if (state.TotalMinutes > 0)
return string.Format(ArrivingLateText, ToHourMinuteString(state));
return ArrivingText;
}
}
}
return now >= arriveTime? ArrivedText : ArrivingText;

View File

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

@@ -167,4 +167,4 @@
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
<DefaultLanguage>zh-CN</DefaultLanguage>
</PropertyGroup>
</Project>
</Project>

View File

@@ -63,11 +63,24 @@
x:Name="ImageGrid"
Margin="0,-100,0,0"
Background="{ThemeResource BackgroundGradient}">
<Image
x:Name="HeroImage"
Opacity="{ThemeResource ImageOpacity}"
Source="/Assets/HomeHeaderTiles/GalleryHeaderImage.jpg"
Stretch="UniformToFill" />
<FlipView
x:Name="HeroImageFlipView"
Grid.RowSpan="3"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Background="{ThemeResource BackgroundGradient}"
BorderThickness="0"
Padding="0"
ItemsSource="{x:Bind CarouselImages}">
<FlipView.ItemTemplate>
<DataTemplate>
<Image
Source="{Binding}"
Stretch="UniformToFill"
Opacity="{ThemeResource ImageOpacity}" />
</DataTemplate>
</FlipView.ItemTemplate>
</FlipView>
</Grid>
</local:OpacityMaskView>

View File

@@ -2,9 +2,28 @@ namespace CRSim.Controls;
public sealed partial class HomePageHeader : UserControl
{
public List<string> CarouselImages { get; set; }
private DispatcherTimer _timer;
public HomePageHeader()
{
InitializeComponent();
CarouselImages = new List<string>
{
"ms-appx:///Assets/HomeHeaderTiles/GalleryHeaderImage-Republic.jpg"
};
this.DataContext = this;
_timer = new DispatcherTimer
{
Interval = TimeSpan.FromSeconds(5)
};
_timer.Tick += (s, e) =>
{
var total = HeroImageFlipView.Items.Count;
var next = (HeroImageFlipView.SelectedIndex + 1) % total;
HeroImageFlipView.SelectedIndex = next;
};
_timer.Start();
}
}

View File

@@ -49,16 +49,17 @@
<FontIcon Glyph="&#xE786;" />
</NavigationViewItem.Icon>
</NavigationViewItem>
<NavigationViewItem Content="站台占用图" Tag="PlatformDiagramPage">
<NavigationViewItem.Icon>
<FontIcon Glyph="&#xECA5;" />
</NavigationViewItem.Icon>
</NavigationViewItem>
<NavigationViewItem Content="12306" Tag="WebsiteSimulatorPage">
<NavigationViewItem.Icon>
<FontIcon Glyph="&#xEB41;" />
</NavigationViewItem.Icon>
</NavigationViewItem>
<NavigationViewItemHeader Content="其他工具"/>
<NavigationViewItem Content="站台占用图" Tag="PlatformDiagramPage">
<NavigationViewItem.Icon>
<FontIcon Glyph="&#xECA5;" />
</NavigationViewItem.Icon>
</NavigationViewItem>
</NavigationView.MenuItems>
<Frame x:Name="contentFrame"/>
</NavigationView>