feat: 添加转发量弹窗功能,优化数据获取和页码变更逻辑

This commit is contained in:
傅光孟 2026-03-23 21:04:32 +08:00
parent 5c18809a58
commit c882b43f74
1 changed files with 20 additions and 5 deletions

View File

@ -101,6 +101,7 @@
:total="shareDetailData.total" :total="shareDetailData.total"
:pager-count="5" :pager-count="5"
v-model:current-page="shareDetailData.page" v-model:current-page="shareDetailData.page"
@current-change="currentChange"
/> />
</div> </div>
</div> </div>
@ -188,6 +189,7 @@ function clearForm() {
// //
const shareDialogVisible = ref(false); const shareDialogVisible = ref(false);
const shareDialogTitle = ref(''); const shareDialogTitle = ref('');
const sharePlayload = ref({});
const shareDetailData = reactive({ const shareDetailData = reactive({
data: [], data: [],
total: 0, total: 0,
@ -195,12 +197,28 @@ const shareDetailData = reactive({
size: 10, size: 10,
loading: false, loading: false,
}); });
//
function handleOpenShare(playload: any) { function handleOpenShare(playload: any) {
sharePlayload.value = playload;
shareDialogTitle.value = `${playload.name || '-'}转发明细`; shareDialogTitle.value = `${playload.name || '-'}转发明细`;
shareDialogVisible.value = true; shareDialogVisible.value = true;
shareDetailData.loading = true; shareDetailData.loading = true;
getShareDetails({ mobile: playload.mobile, page: 1, size: 10 }).then((res) => { shareDetailData.page = 1
getShareData();
}
//
function handleClose() {
shareDialogVisible.value = false;
}
//
function currentChange(page: number) {
shareDetailData.page = page;
getShareData();
}
//
function getShareData() {
getShareDetails({ mobile: sharePlayload.value.mobile, page: shareDetailData.page, size: shareDetailData.size }).then((res) => {
shareDetailData.loading = false; shareDetailData.loading = false;
const { code, data, total } = res; const { code, data, total } = res;
if (code == 200) { if (code == 200) {
@ -212,9 +230,6 @@ function handleOpenShare(playload: any) {
} }
}); });
} }
const handleClose = () => {
shareDialogVisible.value = false;
};
// //
onMounted(() => { onMounted(() => {