Browse Source

隔天清理掉昨日分配的任务

master
秦汉 4 hours ago
parent
commit
b49a00af33
  1. 15
      Build_God_Api/Build_God_Api/Services/DailyMissionService.cs
  2. 2
      Build_God_Game/src/views/CharacterView.vue
  3. 2
      Build_God_Game/src/views/DailyMissionView.vue
  4. 42
      Build_God_Game/src/views/GameView.vue
  5. 35
      Build_God_Game/src/views/LoginView.vue
  6. 27
      Build_God_Game/src/views/RegisterView.vue

15
Build_God_Api/Build_God_Api/Services/DailyMissionService.cs

@ -278,6 +278,21 @@ namespace Build_God_Api.Services
public async Task AssignDailyMissionsIfNeeded(int characterId)
{
var today = GetBeijingDate();
var yesterday = today.AddDays(-1);
var yesterdayUnclaimedMissions = await _db.Queryable<CharacterDailyMission>()
.Where(x => x.CharacterId == characterId && x.AssignedDate == yesterday)
.Where(x => x.Status != DailyMissionStatus.Claimed && x.Status != DailyMissionStatus.Completed)
.ToListAsync();
if (yesterdayUnclaimedMissions.Any())
{
foreach (var mission in yesterdayUnclaimedMissions)
{
await _db.Deleteable<CharacterDailyMission>().Where(x => x.Id == mission.Id).ExecuteCommandAsync();
_logger.LogInformation("清理角色 {CharacterId} 的昨日未领取任务 {MissionId}", characterId, mission.Id);
}
}
var character = await _db.Queryable<Character>()
.FirstAsync(x => x.Id == characterId)

2
Build_God_Game/src/views/CharacterView.vue

@ -206,7 +206,7 @@ const formatNumber = (num: number) => {
<div class="page-footer">
<StarBorder as="div" color="#e63d3d" speed="3s" :thickness="3">
<div class="btn-out">
<div class="btn-out" @click="handleLogout">
退出登录
</div>
</StarBorder>

2
Build_God_Game/src/views/DailyMissionView.vue

@ -145,7 +145,7 @@ onMounted(() => {
})
const activeMissions = computed(() => missions.value.filter(m => m.status !== DailyMissionStatus.Claimed))
const yesterdayMissions = computed(() => missions.value.filter(m => m.isFromYesterday))
const yesterdayMissions = computed(() => missions.value.filter(m => m.isFromYesterday && m.status === DailyMissionStatus.Completed))
const todayMissions = computed(() => missions.value.filter(m => !m.isFromYesterday))
</script>

42
Build_God_Game/src/views/GameView.vue

@ -84,13 +84,8 @@ const handleBreakthrough = async () => {
<Particles :particle-count="50" :particle-colors="['#ffffff', '#cccccc']" class="particles-bg" />
<div class="game-container">
<div style="text-align: center; margin-bottom: 20px;">
<StarBorder
as="div"
color="#22c55e"
speed="5s"
:thickness="2"
style="display: block; width: 100%; max-width: 480px;"
>
<StarBorder as="div" color="#22c55e" speed="5s" :thickness="2"
style="display: block; width: 100%; max-width: 480px;">
<div class="character-header" @click="handleSwitchCharacter">
<div class="character-info">
<span class="character-name">{{ characterStore.currentCharacter?.name || '未选择角色' }}</span>
@ -154,11 +149,13 @@ const handleBreakthrough = async () => {
{{ breakthroughMessage }}
</div>
<GlareHover width="200px" height="44px" background="transparent" border-radius="22px"
border-color="rgba(255,255,255,0.1)" glare-color="#ffffff" :glare-opacity="0.1" class="logout-button"
@click="handleLogout">
<span class="logout-text">退出登录</span>
</GlareHover>
<div class="page-footer">
<StarBorder as="div" color="#e63d3d" speed="3s" :thickness="3">
<div class="btn-out" @click="handleLogout">
退出登录
</div>
</StarBorder>
</div>
<ChatBox />
</div>
@ -240,7 +237,7 @@ const handleBreakthrough = async () => {
font-weight: bold;
}
.star-border{
.star-border {
background: transparent;
border: none;
padding: 12px 16px;
@ -451,6 +448,25 @@ const handleBreakthrough = async () => {
justify-content: center;
margin: 0 auto;
cursor: pointer;
width: 200px;
}
.page-footer {
margin-top: 32px;
display: flex;
justify-content: center;
}
.btn-out {
display: flex;
justify-content: center;
align-items: center;
background: rgba(255, 255, 255, 0.03);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 12px;
padding: 12px 16px;
cursor: pointer;
width: 200px;
}
.logout-text {

35
Build_God_Game/src/views/LoginView.vue

@ -5,6 +5,7 @@ import { useAuthStore } from '@/stores/auth'
import Particles from '@/components/Particles/Particles.vue'
import GlareHover from '@/components/GlareHover/GlareHover.vue'
import BlurText from '@/components/BlurText/BlurText.vue'
import StarBorder from '@/components/StarBorder/StarBorder.vue'
const router = useRouter()
const authStore = useAuthStore()
@ -62,26 +63,27 @@ const handleLogin = async () => {
<form class="login-form" @submit.prevent="handleLogin">
<div class="form-group">
<label class="form-label">用户名</label>
<input v-model="username" type="text" class="form-input" placeholder="请输入用户名" autocomplete="username"
<input v-model="username" type="text" class="form-input" autocomplete="username"
@keyup.enter="handleLogin" />
</div>
<div class="form-group">
<label class="form-label">密码</label>
<input v-model="password" type="password" class="form-input" placeholder="请输入密码"
autocomplete="current-password" @keyup.enter="handleLogin" />
<input v-model="password" type="password" class="form-input" autocomplete="current-password"
@keyup.enter="handleLogin" />
</div>
<div v-if="errorMsg" class="error-message">
{{ errorMsg }}
</div>
<GlareHover width="100%" height="50px" background="transparent" border-radius="12px"
border-color="rgba(255,255,255,0.15)" glare-color="#ffffff" :glare-opacity="0.15" class="login-button"
@click="handleLogin">
<StarBorder as="div" color="Magenta" speed="3s" :thickness="3" @click="handleLogin">
<div class="btn-login">
<span v-if="isLoading" class="loading-text">登录中...</span>
<span v-else class="button-text"> </span>
</GlareHover>
</div>
</StarBorder>
</form>
<div class="login-footer">
@ -133,7 +135,7 @@ const handleLogin = async () => {
.login-header {
text-align: center;
margin-bottom: 32px;
margin-bottom: 20px;
}
.blur-title {
@ -190,10 +192,10 @@ const handleLogin = async () => {
.form-input {
width: 100%;
padding: 14px 16px;
padding: 10px 16px;
background: rgba(255, 255, 255, 0.03);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 10px;
border-radius: 15px;
color: #ffffff;
font-size: 0.95rem;
transition: all 0.3s ease;
@ -227,11 +229,20 @@ const handleLogin = async () => {
cursor: pointer;
}
.btn-login {
display: flex;
justify-content: center;
align-items: center;
background: rgba(255, 255, 255, 0.03);
padding: 12px 16px;
cursor: pointer;
height: 100%;
}
.button-text,
.loading-text {
color: #ffffff;
font-size: 0.9rem;
font-weight: 400;
font-weight: bold;
letter-spacing: 0.2em;
}

27
Build_God_Game/src/views/RegisterView.vue

@ -5,6 +5,7 @@ import { useAuthStore } from '@/stores/auth'
import Particles from '@/components/Particles/Particles.vue'
import GlareHover from '@/components/GlareHover/GlareHover.vue'
import Shuffle from '@/components/Shuffle/Shuffle.vue'
import StarBorder from '@/components/StarBorder/StarBorder.vue'
const router = useRouter()
const authStore = useAuthStore()
@ -119,13 +120,14 @@ const handleRegister = async () => {
{{ errorMsg }}
</div>
<GlareHover width="100%" height="50px" background="transparent" border-radius="12px"
border-color="rgba(255,255,255,0.15)" glare-color="#ffffff" :glare-opacity="0.15" class="register-button"
@click="handleRegister">
<StarBorder as="div" color="Magenta" speed="3s" :thickness="3" @click="handleRegister">
<div class="btn-register">
<span v-if="isLoading" class="loading-text">注册中...</span>
<span v-else-if="registerSuccess" class="button-text">注册成功</span>
<span v-else class="button-text">立即注册</span>
</GlareHover>
</div>
</StarBorder>
</form>
<div class="register-footer">
@ -177,17 +179,14 @@ const handleRegister = async () => {
.register-header {
text-align: center;
margin-bottom: 28px;
margin-bottom: 20px;
}
.shuffle-title {
justify-content: center;
/* 水平居中 flex 项目 */
text-align: center;
/* 文字居中 */
color: white;
width: 100%;
/* 确保占满宽度 */
font-size: 30px;
}
@ -227,10 +226,10 @@ const handleRegister = async () => {
.form-input {
width: 100%;
padding: 14px 16px;
padding: 10px 16px;
background: rgba(255, 255, 255, 0.03);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 10px;
border-radius: 15px;
color: #ffffff;
font-size: 0.95rem;
transition: all 0.3s ease;
@ -256,12 +255,14 @@ const handleRegister = async () => {
border-radius: 8px;
}
.register-button {
margin-top: 8px;
.btn-register {
display: flex;
align-items: center;
justify-content: center;
align-items: center;
background: rgba(255, 255, 255, 0.03);
padding: 12px 16px;
cursor: pointer;
height: 100%;
}
.button-text,

Loading…
Cancel
Save