|
@ -1,8 +1,7 @@ |
|
|
<script setup> |
|
|
<script setup> |
|
|
import ShowApi from "@/axios/ShowApi"; |
|
|
import ShowApi from "@/axios/ShowApi"; |
|
|
import { ref } from "vue"; |
|
|
import { ref } from "vue"; |
|
|
//众筹参与者 |
|
|
|
|
|
const participants = ref([]); |
|
|
|
|
|
|
|
|
|
|
|
//众筹活动 |
|
|
//众筹活动 |
|
|
const activity = ref(); |
|
|
const activity = ref(); |
|
|
const percent = ref(); |
|
|
const percent = ref(); |
|
@ -11,7 +10,13 @@ function loadParticipants() { |
|
|
ShowApi.showPage().then((result) => { |
|
|
ShowApi.showPage().then((result) => { |
|
|
activity.value = result.data; |
|
|
activity.value = result.data; |
|
|
// participants.value = result.data.participantList; |
|
|
// participants.value = result.data.participantList; |
|
|
percent.value = (result.data.nowNumber / result.data.targetNumber) * 100; |
|
|
|
|
|
|
|
|
let per = (result.data.nowNumber / result.data.targetNumber) * 100; |
|
|
|
|
|
|
|
|
|
|
|
// 使用 Math.round() 进行四舍五入 |
|
|
|
|
|
let roundedPercent = Math.round(per); |
|
|
|
|
|
|
|
|
|
|
|
// 将结果赋值给 percent.value |
|
|
|
|
|
percent.value = roundedPercent; |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
loadParticipants(); |
|
|
loadParticipants(); |
|
|