forked from natuka/web.puabadge.com
再次生成bug修改,提示文字修改
This commit is contained in:
1 parent
accc430153
commit
5e0ce4b4b5
3 files changed
+59
-32
No files matched your search
+52
-27
@@ -24,7 +24,7 @@
|
||||
<div class="progress-bar-bg">
|
||||
<div class="progress-bar-fg" :style="{ width: progress + '%' }"></div>
|
||||
</div>
|
||||
<div class="progress-text">照片数据分析中 {{progress}}%</div>
|
||||
<div class="progress-text">{{progressText}} {{progress}}%</div>
|
||||
<div class="progress-desc">总计大约需要60秒,请耐心等待...</div>
|
||||
</div>
|
||||
<div v-else class="progress-section">
|
||||
@@ -163,7 +163,7 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useRoutimporter } from 'vue-router';
|
||||
import { showSuccessToast, showToast, showNotify } from 'vant';
|
||||
import { showSuccessToast, showToast, showNotify, showConfirmDialog } from 'vant';
|
||||
import * as badgeApi from '@/api/badge'
|
||||
const router = useRouter();
|
||||
const value = ref(0);
|
||||
@@ -199,13 +199,17 @@ function reload() {
|
||||
})
|
||||
showReload.value = true
|
||||
}
|
||||
const getKindID = () => {
|
||||
return kindList.value.map(obj => obj.id)[Math.floor(Math.random() * kindList.value.length)];
|
||||
}
|
||||
function sureReload() {
|
||||
console.log('sureReload')
|
||||
imageUrl.value = '';
|
||||
group.value = newGroup.value
|
||||
const kindID = checkId.value == 0 ? getKindID() : checkId.value
|
||||
const params = {
|
||||
pid: pid.value,
|
||||
kind_id: checkId.value,
|
||||
kind_id: kindID,
|
||||
extend_value: extend_value.value,
|
||||
group: group.value,
|
||||
}
|
||||
@@ -314,30 +318,41 @@ const confirm = () => {
|
||||
return
|
||||
}
|
||||
loading.value = true
|
||||
const parms = {
|
||||
pid: pid.value,
|
||||
key: key.value,
|
||||
pay_amount: payAmount.value,
|
||||
products: sizeList.value
|
||||
}
|
||||
badgeApi.creatOrder(parms).then((res: any) => {
|
||||
console.log('creatOrder', res)
|
||||
showSuccessToast({
|
||||
message: '下单成功',
|
||||
duration: 2000,
|
||||
})
|
||||
router.push({
|
||||
path: '/badge/myOrder'
|
||||
})
|
||||
}).catch((err) => {
|
||||
console.log('creatOrder', err)
|
||||
showToast({
|
||||
message: err.message,
|
||||
duration: 2000,
|
||||
})
|
||||
}).finally(() => {
|
||||
loading.value = false
|
||||
showConfirmDialog({
|
||||
title: '确认下单',
|
||||
message:
|
||||
'请再次确认是否选择这个模型下单。',
|
||||
})
|
||||
.then(() => {
|
||||
const parms = {
|
||||
pid: pid.value,
|
||||
key: key.value,
|
||||
pay_amount: payAmount.value,
|
||||
products: sizeList.value
|
||||
}
|
||||
badgeApi.creatOrder(parms).then((res: any) => {
|
||||
console.log('creatOrder', res)
|
||||
showSuccessToast({
|
||||
message: '下单成功',
|
||||
duration: 2000,
|
||||
})
|
||||
router.push({
|
||||
path: '/badge/myOrder'
|
||||
})
|
||||
}).catch((err) => {
|
||||
console.log('creatOrder', err)
|
||||
showToast({
|
||||
message: err.message,
|
||||
duration: 2000,
|
||||
})
|
||||
}).finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
// on cancel
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
const imageUrl = ref('')
|
||||
@@ -347,6 +362,7 @@ const flag = ref(1)
|
||||
const timer = ref()
|
||||
const progress = ref(0)
|
||||
const progressTimer = ref()
|
||||
const progressText = ref('')
|
||||
const progressList = () => {
|
||||
// 启动进度条计时器
|
||||
progress.value = 0
|
||||
@@ -354,6 +370,15 @@ const progressList = () => {
|
||||
progressTimer.value = setInterval(() => {
|
||||
if (progress.value < 90) {
|
||||
progress.value += 1
|
||||
if (progress.value < 25) {
|
||||
progressText.value = '照片数据分析中'
|
||||
} else if (progress.value < 50) {
|
||||
progressText.value = '提炼图像关键词'
|
||||
} else if (progress.value < 75) {
|
||||
progressText.value = '图像生成中'
|
||||
} else {
|
||||
progressText.value = '图像后处理与优化'
|
||||
}
|
||||
}
|
||||
}, 300)
|
||||
}
|
||||
@@ -381,6 +406,7 @@ const getImageList = () => {
|
||||
imageUrl.value = data.list[0].origin_url
|
||||
imageList.value = data.list
|
||||
key.value = data.list[0].key
|
||||
getCompareImage()
|
||||
}
|
||||
}).catch((err) => {
|
||||
clearInterval(progressTimer.value)
|
||||
@@ -404,7 +430,6 @@ onMounted(() => {
|
||||
getImageList()
|
||||
progressList()
|
||||
getSizeList()
|
||||
getCompareImage()
|
||||
timer.value = setInterval(() => {
|
||||
getImageList()
|
||||
}, 10000)
|
||||
|
||||
Reference in new issue
Block a user