feat: 添加转发量弹窗功能,优化数据获取和页码变更逻辑
This commit is contained in:
parent
5c18809a58
commit
c882b43f74
|
|
@ -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(() => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue