feat: mobile page refactor is finished

This commit is contained in:
RockYang
2024-04-29 19:22:00 +08:00
parent 24479814e9
commit 8b40ac5b5c
11 changed files with 181 additions and 87 deletions

View File

@@ -161,7 +161,7 @@
</van-collapse>
</div>
<div class="text-line">
<div class="text-line pt-6">
<el-tag>绘图消耗{{ mjPower }}算力U/V 操作消耗{{ mjActionPower }}算力当前算力{{ power }}</el-tag>
</div>
@@ -290,6 +290,7 @@ import {getSessionId} from "@/store/session";
import {checkSession} from "@/action/session";
import {useRouter} from "vue-router";
import {Delete} from "@element-plus/icons-vue";
import {showLoginDialog} from "@/utils/libs";
const activeColspan = ref([""])
@@ -335,18 +336,19 @@ const finishedJobs = ref([])
const socket = ref(null)
const power = ref(0)
const activeName = ref("txt2img")
const isLogin = ref(false)
onMounted(() => {
checkSession().then(user => {
power.value = user['power']
userId.value = user.id
isLogin.value = true
fetchRunningJobs()
fetchFinishJobs(1)
connect()
}).catch(() => {
router.push('/login')
// router.push('/login')
});
})
@@ -564,6 +566,10 @@ const variation = (index, item) => {
}
const generate = () => {
if (!isLogin.value) {
return showLoginDialog(router)
}
if (params.value.prompt === '' && params.value.task_type === "image") {
return showFailToast("请输入绘画提示词!")
}

View File

@@ -228,12 +228,12 @@ import {
showSuccessToast,
showToast
} from "vant";
import {showLoginDialog} from "@/utils/libs";
const listBoxHeight = ref(window.innerHeight - 40)
const mjBoxHeight = ref(window.innerHeight - 150)
const showTaskDialog = ref(false)
const item = ref({})
const showLoginDialog = ref(false)
const isLogin = ref(false)
const activeColspan = ref([""])
@@ -429,16 +429,15 @@ const onLoad = () => {
// 创建绘图任务
const promptRef = ref(null)
const generate = () => {
if (!isLogin.value) {
return showLoginDialog(router)
}
if (params.value.prompt === '') {
promptRef.value.focus()
return showToast("请输入绘画提示词!")
}
if (!isLogin.value) {
showLoginDialog.value = true
return
}
if (params.value.seed === '') {
params.value.seed = -1
}