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. 39
      Build_God_Game/src/views/LoginView.vue
  6. 33
      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) public async Task AssignDailyMissionsIfNeeded(int characterId)
{ {
var today = GetBeijingDate(); 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>() var character = await _db.Queryable<Character>()
.FirstAsync(x => x.Id == characterId) .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"> <div class="page-footer">
<StarBorder as="div" color="#e63d3d" speed="3s" :thickness="3"> <StarBorder as="div" color="#e63d3d" speed="3s" :thickness="3">
<div class="btn-out"> <div class="btn-out" @click="handleLogout">
退出登录 退出登录
</div> </div>
</StarBorder> </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 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)) const todayMissions = computed(() => missions.value.filter(m => !m.isFromYesterday))
</script> </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" /> <Particles :particle-count="50" :particle-colors="['#ffffff', '#cccccc']" class="particles-bg" />
<div class="game-container"> <div class="game-container">
<div style="text-align: center; margin-bottom: 20px;"> <div style="text-align: center; margin-bottom: 20px;">
<StarBorder <StarBorder as="div" color="#22c55e" speed="5s" :thickness="2"
as="div" style="display: block; width: 100%; max-width: 480px;">
color="#22c55e"
speed="5s"
:thickness="2"
style="display: block; width: 100%; max-width: 480px;"
>
<div class="character-header" @click="handleSwitchCharacter"> <div class="character-header" @click="handleSwitchCharacter">
<div class="character-info"> <div class="character-info">
<span class="character-name">{{ characterStore.currentCharacter?.name || '未选择角色' }}</span> <span class="character-name">{{ characterStore.currentCharacter?.name || '未选择角色' }}</span>
@ -154,11 +149,13 @@ const handleBreakthrough = async () => {
{{ breakthroughMessage }} {{ breakthroughMessage }}
</div> </div>
<GlareHover width="200px" height="44px" background="transparent" border-radius="22px" <div class="page-footer">
border-color="rgba(255,255,255,0.1)" glare-color="#ffffff" :glare-opacity="0.1" class="logout-button" <StarBorder as="div" color="#e63d3d" speed="3s" :thickness="3">
@click="handleLogout"> <div class="btn-out" @click="handleLogout">
<span class="logout-text">退出登录</span> 退出登录
</GlareHover> </div>
</StarBorder>
</div>
<ChatBox /> <ChatBox />
</div> </div>
@ -240,7 +237,7 @@ const handleBreakthrough = async () => {
font-weight: bold; font-weight: bold;
} }
.star-border{ .star-border {
background: transparent; background: transparent;
border: none; border: none;
padding: 12px 16px; padding: 12px 16px;
@ -451,6 +448,25 @@ const handleBreakthrough = async () => {
justify-content: center; justify-content: center;
margin: 0 auto; margin: 0 auto;
cursor: pointer; 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 { .logout-text {

39
Build_God_Game/src/views/LoginView.vue

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

33
Build_God_Game/src/views/RegisterView.vue

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

Loading…
Cancel
Save