feat: 添加转发量弹窗功能,优化数据获取和页码变更逻辑
This commit is contained in:
parent
5c18809a58
commit
c882b43f74
|
|
@ -101,6 +101,7 @@
|
|||
:total="shareDetailData.total"
|
||||
:pager-count="5"
|
||||
v-model:current-page="shareDetailData.page"
|
||||
@current-change="currentChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -188,6 +189,7 @@ function clearForm() {
|
|||
// 转发量弹窗
|
||||
const shareDialogVisible = ref(false);
|
||||
const shareDialogTitle = ref('');
|
||||
const sharePlayload = ref({});
|
||||
const shareDetailData = reactive({
|
||||
data: [],
|
||||
total: 0,
|
||||
|
|
@ -195,12 +197,28 @@ const shareDetailData = reactive({
|
|||
size: 10,
|
||||
loading: false,
|
||||
});
|
||||
|
||||
// 转发量弹窗打开
|
||||
function handleOpenShare(playload: any) {
|
||||
sharePlayload.value = playload;
|
||||
shareDialogTitle.value = `${playload.name || '-'}转发明细`;
|
||||
shareDialogVisible.value = 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;
|
||||
const { code, data, total } = res;
|
||||
if (code == 200) {
|
||||
|
|
@ -212,9 +230,6 @@ function handleOpenShare(playload: any) {
|
|||
}
|
||||
});
|
||||
}
|
||||
const handleClose = () => {
|
||||
shareDialogVisible.value = false;
|
||||
};
|
||||
|
||||
// 页面加载时
|
||||
onMounted(() => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue