Skip to content

Commit

Permalink
[*] ICP 备案列表添加加载动画
Browse files Browse the repository at this point in the history
  • Loading branch information
Muska-Ami committed Oct 1, 2024
1 parent db32211 commit dbe762f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
6 changes: 3 additions & 3 deletions src/views/DonateView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
</n-grid>
</n-card>
<n-h3>留言</n-h3>
<n-spin :show="loadingDonateList">
<n-spin :show="donateListLoading">
<n-grid cols="3" item-responsive :x-gap="12" :y-gap="12">
<n-grid-item
v-for="item in donateList
Expand Down Expand Up @@ -142,7 +142,7 @@ const amount_filter_threshold = ref(3.0)
const trade_no = getUrlKey('out_trade_no')
const showMessageLabel = ref(false)
const showModal = ref(false)
const loadingDonateList = ref(true)
const donateListLoading = ref(true)
const display_messages_default = ref(5)
const display_all_messages = ref(false)
const trade_info = ref({
Expand Down Expand Up @@ -204,7 +204,7 @@ async function getDonateList() {
if (!rs) return
if (rs.status === 200) {
donateList.value = rs.data
loadingDonateList.value = false
donateListLoading.value = false
} else {
sendErrorMessage(rs.message)
}
Expand Down
37 changes: 21 additions & 16 deletions src/views/IcpCheckView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,21 @@
</n-card>
</n-grid-item>
<n-grid-item span="1">
<n-list bordered v-show="showList">
<template #header> 已登记的域名 </template>
<n-list-item v-for="item in icpList">
<n-thing
:title="item.domain"
:description="item.unit_name + ' (' + item.nature_name + ') - ' + item.icp"
>
</n-thing>
<template #suffix>
<n-button type="error" @click="removeICP(item.id)">删除</n-button>
</template>
</n-list-item>
</n-list>
<n-spin :show="icpListLoading">
<n-list bordered v-show="showList">
<template #header> 已登记的域名 </template>
<n-list-item v-for="item in icpList">
<n-thing
:title="item.domain"
:description="item.unit_name + ' (' + item.nature_name + ') - ' + item.icp"
>
</n-thing>
<template #suffix>
<n-button type="error" @click="removeICP(item.id)">删除</n-button>
</template>
</n-list-item>
</n-list>
</n-spin>
</n-grid-item>
</n-grid>
</n-form>
Expand All @@ -53,6 +55,7 @@ const showList = ref(false)
const formRef = ref(null)
const dialog = useDialog()
const loading = ref(false)
const icpListLoading = ref(true)
const domainInput = ref({
domain: ''
})
Expand All @@ -69,7 +72,7 @@ const icpList = ref([
])
async function submit() {
if (loading.value == true) {
if (loading.value === true) {
return
}
loading.value = true
Expand All @@ -86,7 +89,7 @@ async function submit() {
}
loading.value = false
if (!rs) return
if (rs.status != 200) {
if (rs.status !== 200) {
loading.value = false
sendErrorDialog('审核失败,可能是域名没有备案或格式错误!')
} else {
Expand All @@ -112,7 +115,7 @@ async function removeICP(id) {
if (!rs) return
if (rs.status === 200) {
sendSuccessDialog('删除成功!')
getList()
await getList()
} else {
sendErrorDialog('删除失败,请联系管理员处理!')
}
Expand All @@ -127,6 +130,7 @@ async function removeICP(id) {
}
async function getList() {
icpListLoading.value = true
let rs
try {
rs = await api.v2.icp.get(userData.getters.get_username)
Expand All @@ -140,6 +144,7 @@ async function getList() {
} else {
showList.value = false
}
icpListLoading.value = false
}
getList()
Expand Down

0 comments on commit dbe762f

Please sign in to comment.