feat:更新UI
This commit is contained in:
@@ -8,7 +8,8 @@
|
||||
|
||||
<div class="moment-image-list">
|
||||
<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>
|
||||
|
||||
<p>{{ formatTimeAgo(props.item.date) }}</p>
|
||||
|
||||
@@ -14,7 +14,7 @@ export const useAppStore = defineStore('ipp', {
|
||||
isDark: false,
|
||||
isWebSocket: false,
|
||||
serverIp: '14.103.235.151',
|
||||
version: 'v1.0.0.2025062701'
|
||||
version: 'v1.0.0.2025062702'
|
||||
}),
|
||||
actions: {
|
||||
initApp() {
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
<register v-if="authStore.loginType === 'register'"
|
||||
class="animate__animated animate__bounceIn"/>
|
||||
</div>
|
||||
|
||||
<div class="app-version">
|
||||
<span>版本号:{{ appStore.version }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -153,5 +157,11 @@ $login-height: 500px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.app-version {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
right: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -5,11 +5,15 @@
|
||||
<div v-else class="moment-list">
|
||||
<moment-card v-for="(item, index) in foodStore.momentList"
|
||||
:key="index" :item="item"/>
|
||||
|
||||
<el-button type="primary" circle :icon="Refresh"
|
||||
class="refresh-button" @click="foodStore.queryMomentList()"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Refresh } from '@element-plus/icons-vue'
|
||||
import MomentCard from '@/components/Moment/MomentCard.vue'
|
||||
import { useFoodStore } from '@/store/food'
|
||||
import { onMounted } from 'vue'
|
||||
@@ -31,6 +35,12 @@ onMounted(async () => {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
|
||||
.refresh-button {
|
||||
position: fixed;
|
||||
top: 60px;
|
||||
right: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div class="moment-form common-mobile-view">
|
||||
<el-form ref="formRef" :model="foodStore.currentMoment"
|
||||
:rules="rules" label-width="80">
|
||||
<el-form-item label="发布内容" prop="content">
|
||||
:rules="rules" label-width="60">
|
||||
<el-form-item label="内容" prop="content">
|
||||
<el-input v-model="foodStore.currentMoment.content"
|
||||
type="textarea" :rows="3"
|
||||
:maxlength="100" show-word-limit
|
||||
|
||||
@@ -32,7 +32,8 @@ const userStore = useUserStore()
|
||||
const authStore = useAuthStore()
|
||||
const router = useRouter()
|
||||
|
||||
const viewLatestVersionClick = () => {
|
||||
const viewLatestVersionClick = async () => {
|
||||
await router.push('/')
|
||||
location.reload()
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
<el-form-item label="菜系" prop="category">
|
||||
<el-select v-model="foodStore.currentRecipe.category"
|
||||
placeholder="请选择或输入菜系">
|
||||
placeholder="请选择或输入菜系" allow-create filterable>
|
||||
<el-option v-for="(item, index) in foodCategoryList"
|
||||
:key="index" :label="item" :value="item"/>
|
||||
</el-select>
|
||||
@@ -41,7 +41,8 @@
|
||||
|
||||
<div class="button-container">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
@@ -65,7 +66,7 @@ const rules = reactive<FormRules>(foodRules)
|
||||
const formRef = ref<FormInstance>()
|
||||
const foodStore = useFoodStore()
|
||||
|
||||
const foodCategoryList = ['家常菜', '淮扬菜', '鲁菜', '川菜', '粤菜', '闽菜', '浙菜', '湘菜', '徽菜', '其他']
|
||||
const foodCategoryList = ['家常菜', '淮扬菜', '甜点', '其他']
|
||||
|
||||
/**
|
||||
* 点击确认按钮
|
||||
|
||||
@@ -34,7 +34,8 @@
|
||||
|
||||
<div class="button-container">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user