<div class="AccountLevel" style="margin-top: 15px;">
<span style="float: left;">账户安全等级:</span>
@{
int levelValue = 0;
string levelName = "低";
string progressBarName = "progress-bar-warning";默认橘黄色
if (Model.CustomerInfo != null)
{
if (Model.CustomerInfo.IsPassWord != null && Model.CustomerInfo.IsPassWord.Value)
{
levelValue += 25;
}
if (Model.CustomerInfo.IsMobile != null && Model.CustomerInfo.IsMobile.Value)
{
levelValue += 25;
}
if (Model.CustomerInfo.IsEmail != null && Model.CustomerInfo.IsEmail.Value)
{
levelValue += 25;
}
if (Model.CustomerInfo.IsIdentity != null && Model.CustomerInfo.IsIdentity.Value)
{
levelValue += 25;
}
if (levelValue >= 50 && levelValue < 75)
{
levelName = "中";
}
else if (levelValue >= 75)
{
levelName = "高";
progressBarName = "progress-bar-success";判断之后绿色
}
}
string level = levelValue + "%";
<div class="progress progressDiv" style="margin-top: 10px;">
<div class="progress-bar @progressBarName" role="progressbar"
aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: @level; line-height: 12px;"
id="accountLevel">
<span id="accountLevelValue">@level</span>
</div>
</div>
<span id="accountLevelName">@levelName</span>
if (levelName != "高")
{
<span class="Enhance"><a href="/AccountSetting/Index?tab=safety">提升</a></span>
}
}
</div>
相关文章
- C# autofac 在Net6中的使用
- 在linux上安装配置nodejs工具,设置环境变量,设置npm国内镜像源,提高下载速度。
- Object.prototype.toString判断类型的原理
- #yyds干货盘点 【React工作记录十一】控制ant design中form的必填项判断
- 【译】.NET 7 中的性能改进(十一)
- 如何判断一个客户是大客户?
- ASP.NET Core 中文文档 第三章 原理(15)请求功能
- MongoDB从入门到实战之.NET Core使用MongoDB开发ToDoList系统(3)-系统数据集合设计
- 学习ASP.NET Core Blazor编程系列二十七——JWT登录(1)
- Qt 如何判断文件是不是一个目录