Skip to content

Commit

Permalink
[*] push
Browse files Browse the repository at this point in the history
  • Loading branch information
Daiyangcheng committed Dec 31, 2023
1 parent 3a22112 commit 722536e
Showing 1 changed file with 14 additions and 30 deletions.
44 changes: 14 additions & 30 deletions src/views/Prize.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@
<n-card :title="'奖品: ' + item.prizename">
<n-p>
获奖人:
<n-tag style="margin: 3px" type="success" v-if="PrizeUsers.length" v-for="prizeuser in PrizeUsers[item.id]">{{ prizeuser }}
<n-tag style="margin: 3px" type="success" v-if="PrizeUsers.length" v-for="prizeuser in PrizeUsers[item.id]">{{
prizeuser }}
</n-tag>
<n-tag style="margin: 3px" type="success" v-else > 暂未开奖
<n-tag style="margin: 3px" type="info" v-else> 暂未开奖
</n-tag>
</n-p>
<n-p>
参与用户:
<n-tag style="margin: 3px" type="info" v-if="users.length" v-for="user in users[item.id]">{{ user }}
</n-tag>
<n-tag style="margin: 3px" type="info" v-else > 没有用户参与欸
<n-tag style="margin: 3px" type="info" v-else> 没有用户参与欸
</n-tag>
</n-p>
<n-p>奖品描述:</n-p>
Expand Down Expand Up @@ -99,8 +100,6 @@ function submitjoin(id) {
});
}
GetPrizeList();
function GetPrizeList() {
let i = 0;
const rs = get("https://api.locyanfrp.cn/Prize/GetPrizes", []);
Expand All @@ -109,41 +108,26 @@ function GetPrizeList() {
// 用奖品ID排列
res.forEach((e) => {
PrizesList.value[i] = e;
if (e.username === null) {
users.value = [];
if (e.username.indexOf("|") !== -1) {
users.value[e.id] = e.username.split("|");
} else {
if (e.username === "") {
users.value = [];
} else {
if (e.username.indexOf("|") !== -1) {
users.value[e.id] = e.username.split("|");
} else {
users.value[e.id] = [e.username];
}
}
users.value[e.id] = [e.username];
}
if (e.prize_user === null) {
PrizeUsers.value = [];
// 获奖用户部分
if (e.prize_user.indexOf("|") !== -1) {
PrizeUsers.value[e.id] = e.prize_user.split("|");
} else {
if (e.prize_user === "") {
PrizeUsers.value = [];
} else {
// 获奖用户部分
if (e.prize_user.indexOf("|") !== -1) {
PrizeUsers.value[e.id] = e.prize_user.split("|");
} else {
PrizeUsers.value[e.id] = [e.prize_user];
}
}
PrizeUsers.value[e.id] = [e.prize_user];
}
i++;
});
});
console.log(PrizesList.value);
}
GetPrizeList();
</script>
<style scoped>
#item {
Expand Down

0 comments on commit 722536e

Please sign in to comment.