feat:更新UI

This commit is contained in:
2025-06-27 17:08:52 +08:00
parent 4276e9466a
commit c77c3ff512
8 changed files with 33 additions and 9 deletions

View File

@@ -8,7 +8,8 @@
<div class="moment-image-list"> <div class="moment-image-list">
<el-image v-for="(item, index) in props.item.imageList" :key="index" <el-image v-for="(item, index) in props.item.imageList" :key="index"
:src="serviceFileRootPath + item" fit="fill" /> :src="serviceFileRootPath + item" fit="cover"
:preview-src-list="[serviceFileRootPath + item]"/>
</div> </div>
<p>{{ formatTimeAgo(props.item.date) }}</p> <p>{{ formatTimeAgo(props.item.date) }}</p>

View File

@@ -14,7 +14,7 @@ export const useAppStore = defineStore('ipp', {
isDark: false, isDark: false,
isWebSocket: false, isWebSocket: false,
serverIp: '14.103.235.151', serverIp: '14.103.235.151',
version: 'v1.0.0.2025062701' version: 'v1.0.0.2025062702'
}), }),
actions: { actions: {
initApp() { initApp() {

View File

@@ -16,6 +16,10 @@
<register v-if="authStore.loginType === 'register'" <register v-if="authStore.loginType === 'register'"
class="animate__animated animate__bounceIn"/> class="animate__animated animate__bounceIn"/>
</div> </div>
<div class="app-version">
<span>版本号{{ appStore.version }}</span>
</div>
</div> </div>
</template> </template>
@@ -153,5 +157,11 @@ $login-height: 500px;
} }
} }
} }
.app-version {
position: absolute;
bottom: 10px;
right: 10px;
}
} }
</style> </style>

View File

@@ -5,11 +5,15 @@
<div v-else class="moment-list"> <div v-else class="moment-list">
<moment-card v-for="(item, index) in foodStore.momentList" <moment-card v-for="(item, index) in foodStore.momentList"
:key="index" :item="item"/> :key="index" :item="item"/>
<el-button type="primary" circle :icon="Refresh"
class="refresh-button" @click="foodStore.queryMomentList()"/>
</div> </div>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { Refresh } from '@element-plus/icons-vue'
import MomentCard from '@/components/Moment/MomentCard.vue' import MomentCard from '@/components/Moment/MomentCard.vue'
import { useFoodStore } from '@/store/food' import { useFoodStore } from '@/store/food'
import { onMounted } from 'vue' import { onMounted } from 'vue'
@@ -31,6 +35,12 @@ onMounted(async () => {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 10px; gap: 10px;
.refresh-button {
position: fixed;
top: 60px;
right: 20px;
}
} }
} }
</style> </style>

View File

@@ -1,8 +1,8 @@
<template> <template>
<div class="moment-form common-mobile-view"> <div class="moment-form common-mobile-view">
<el-form ref="formRef" :model="foodStore.currentMoment" <el-form ref="formRef" :model="foodStore.currentMoment"
:rules="rules" label-width="80"> :rules="rules" label-width="60">
<el-form-item label="发布内容" prop="content"> <el-form-item label="内容" prop="content">
<el-input v-model="foodStore.currentMoment.content" <el-input v-model="foodStore.currentMoment.content"
type="textarea" :rows="3" type="textarea" :rows="3"
:maxlength="100" show-word-limit :maxlength="100" show-word-limit

View File

@@ -32,7 +32,8 @@ const userStore = useUserStore()
const authStore = useAuthStore() const authStore = useAuthStore()
const router = useRouter() const router = useRouter()
const viewLatestVersionClick = () => { const viewLatestVersionClick = async () => {
await router.push('/')
location.reload() location.reload()
} }

View File

@@ -11,7 +11,7 @@
<el-form-item label="菜系" prop="category"> <el-form-item label="菜系" prop="category">
<el-select v-model="foodStore.currentRecipe.category" <el-select v-model="foodStore.currentRecipe.category"
placeholder="请选择或输入菜系"> placeholder="请选择或输入菜系" allow-create filterable>
<el-option v-for="(item, index) in foodCategoryList" <el-option v-for="(item, index) in foodCategoryList"
:key="index" :label="item" :value="item"/> :key="index" :label="item" :value="item"/>
</el-select> </el-select>
@@ -41,7 +41,8 @@
<div class="button-container"> <div class="button-container">
<el-button type="primary" @click="confirmClick">确认</el-button> <el-button type="primary" @click="confirmClick">确认</el-button>
<el-button type="danger" @click="deleteClick">删除</el-button> <el-button v-if="foodStore.recipeApiType === 'UPDATE'"
type="danger" @click="deleteClick">删除</el-button>
<el-button type="info" @click="cancelClick">取消</el-button> <el-button type="info" @click="cancelClick">取消</el-button>
</div> </div>
@@ -65,7 +66,7 @@ const rules = reactive<FormRules>(foodRules)
const formRef = ref<FormInstance>() const formRef = ref<FormInstance>()
const foodStore = useFoodStore() const foodStore = useFoodStore()
const foodCategoryList = ['家常菜', '淮扬菜', '鲁菜', '川菜', '粤菜', '闽菜', '浙菜', '湘菜', '徽菜', '其他'] const foodCategoryList = ['家常菜', '淮扬菜', '甜点', '其他']
/** /**
* 点击确认按钮 * 点击确认按钮

View File

@@ -34,7 +34,8 @@
<div class="button-container"> <div class="button-container">
<el-button type="primary" @click="confirmClick">确认</el-button> <el-button type="primary" @click="confirmClick">确认</el-button>
<el-button type="danger" @click="deleteClick">删除</el-button> <el-button v-if="foodStore.recordApiType === 'UPDATE'"
type="danger" @click="deleteClick">删除</el-button>
<el-button type="info" @click="cancelClick">取消</el-button> <el-button type="info" @click="cancelClick">取消</el-button>
</div> </div>
</div> </div>