forked from natuka/web.puabadge.com
去掉随机选择
This commit is contained in:
1 parent
f38a5dc7eb
commit
8bb73181e0
2 files changed
+16
-9
No files matched your search
@@ -55,6 +55,10 @@ function goToPreview() {
|
|||||||
showToast('剩余次数不足')
|
showToast('剩余次数不足')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (checkId.value == 0) {
|
||||||
|
showToast('请选择风格样式')
|
||||||
|
return
|
||||||
|
}
|
||||||
isLoading.value = true
|
isLoading.value = true
|
||||||
getPid()
|
getPid()
|
||||||
}
|
}
|
||||||
@@ -94,10 +98,10 @@ const getPid = async () => {
|
|||||||
message: '上传中...',
|
message: '上传中...',
|
||||||
forbidClick: true,
|
forbidClick: true,
|
||||||
})
|
})
|
||||||
kindId.value = checkId.value == 0 ? getRandomNumber() : checkId.value
|
// kindId.value = checkId.value == 0 ? getRandomNumber() : checkId.value
|
||||||
const params = {
|
const params = {
|
||||||
extend_value: isBgShow.value ? -1 : 0,
|
extend_value: isBgShow.value ? -1 : 0,
|
||||||
kind_id: kindId.value,
|
kind_id: checkId.value,
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const res = await badgeApi.getPid(params)
|
const res = await badgeApi.getPid(params)
|
||||||
@@ -399,13 +403,13 @@ onMounted(() => {
|
|||||||
风格样式
|
风格样式
|
||||||
</div>
|
</div>
|
||||||
<div class="style-list">
|
<div class="style-list">
|
||||||
<div class="style-item" @click="checkId = 0">
|
<!-- <div class="style-item" @click="checkId = 0">
|
||||||
<img class="style-img" src="@/assets/badge/suiji.png" alt="随机风格盲盒">
|
<img class="style-img" src="@/assets/badge/suiji.png" alt="随机风格盲盒">
|
||||||
<div class="style-label">
|
<div class="style-label">
|
||||||
随机风格盲盒
|
随机风格盲盒
|
||||||
</div>
|
</div>
|
||||||
<span class="style-selected" v-if="checkId == 0" />
|
<span class="style-selected" v-if="checkId == 0" />
|
||||||
</div>
|
</div> -->
|
||||||
<div class="style-item" v-for="item in kindList" :key="item.id" @click="checkId = item.id">
|
<div class="style-item" v-for="item in kindList" :key="item.id" @click="checkId = item.id">
|
||||||
<img class="style-img" :src="item.path" :alt="item.name">
|
<img class="style-img" :src="item.path" :alt="item.name">
|
||||||
<div class="style-label">
|
<div class="style-label">
|
||||||
|
|||||||
@@ -190,6 +190,10 @@ function compare() {
|
|||||||
const kindList = ref([])
|
const kindList = ref([])
|
||||||
const checkId = ref(0)
|
const checkId = ref(0)
|
||||||
function reload() {
|
function reload() {
|
||||||
|
if (checkId.value == 0) {
|
||||||
|
showToast('请选择风格样式')
|
||||||
|
return
|
||||||
|
}
|
||||||
badgeApi.getKindList({
|
badgeApi.getKindList({
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 20,
|
size: 20,
|
||||||
@@ -207,17 +211,16 @@ function reload() {
|
|||||||
})
|
})
|
||||||
showReload.value = true
|
showReload.value = true
|
||||||
}
|
}
|
||||||
const getKindID = () => {
|
// const getKindID = () => {
|
||||||
return kindList.value.map(obj => obj.id)[Math.floor(Math.random() * kindList.value.length)];
|
// return kindList.value.map(obj => obj.id)[Math.floor(Math.random() * kindList.value.length)];
|
||||||
}
|
// }
|
||||||
function sureReload() {
|
function sureReload() {
|
||||||
console.log('sureReload')
|
console.log('sureReload')
|
||||||
imageUrl.value = '';
|
imageUrl.value = '';
|
||||||
group.value = newGroup.value
|
group.value = newGroup.value
|
||||||
const kindID = checkId.value == 0 ? getKindID() : checkId.value
|
|
||||||
const params = {
|
const params = {
|
||||||
pid: pid.value,
|
pid: pid.value,
|
||||||
kind_id: kindID,
|
kind_id: checkId.value,
|
||||||
extend_value: extend_value.value,
|
extend_value: extend_value.value,
|
||||||
group: group.value,
|
group: group.value,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user