|
@@ -113,6 +113,7 @@ import { colNoData } from '@/utils/noData';
|
|
|
import { searchTabs } from '@/views/models';
|
|
import { searchTabs } from '@/views/models';
|
|
|
import NP from 'number-precision';
|
|
import NP from 'number-precision';
|
|
|
import { rowItems } from '../models';
|
|
import { rowItems } from '../models';
|
|
|
|
|
+import { debounce } from 'lodash';
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
const { dm_package_type, dm_permit_type, vip_level } = toRefs<any>(proxy?.useDict('dm_package_type', 'dm_permit_type', 'vip_level'));
|
|
const { dm_package_type, dm_permit_type, vip_level } = toRefs<any>(proxy?.useDict('dm_package_type', 'dm_permit_type', 'vip_level'));
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
@@ -126,14 +127,14 @@ const showRowItems = ref(false);
|
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
|
const total = ref(0);
|
|
const total = ref(0);
|
|
|
const list = ref<any>([]);
|
|
const list = ref<any>([]);
|
|
|
-const getList = async () => {
|
|
|
|
|
|
|
+const getList = debounce(async () => {
|
|
|
loading.value = true;
|
|
loading.value = true;
|
|
|
const res = await testPackageList(queryParams.value);
|
|
const res = await testPackageList(queryParams.value);
|
|
|
if (!res || res.code !== 200) return;
|
|
if (!res || res.code !== 200) return;
|
|
|
list.value = res.rows;
|
|
list.value = res.rows;
|
|
|
total.value = res.total;
|
|
total.value = res.total;
|
|
|
loading.value = false;
|
|
loading.value = false;
|
|
|
-};
|
|
|
|
|
|
|
+}, 500);
|
|
|
const handleQuery = () => {
|
|
const handleQuery = () => {
|
|
|
queryParams.value.pageNum = 1;
|
|
queryParams.value.pageNum = 1;
|
|
|
getList();
|
|
getList();
|
|
@@ -144,12 +145,12 @@ const resetQuery = () => {
|
|
|
};
|
|
};
|
|
|
// 获取tabs统计数据
|
|
// 获取tabs统计数据
|
|
|
const tabs = ref<any[]>([]);
|
|
const tabs = ref<any[]>([]);
|
|
|
-const getTabsCount = async () => {
|
|
|
|
|
|
|
+const getTabsCount = debounce(async () => {
|
|
|
const res = await testPackageListCount({ ...queryParams.value });
|
|
const res = await testPackageListCount({ ...queryParams.value });
|
|
|
if (!res || res.code !== 200) return;
|
|
if (!res || res.code !== 200) return;
|
|
|
// this.tabsList = res.rows;
|
|
// this.tabsList = res.rows;
|
|
|
tabs.value = res.data;
|
|
tabs.value = res.data;
|
|
|
-};
|
|
|
|
|
|
|
+}, 500);
|
|
|
// 上架套餐
|
|
// 上架套餐
|
|
|
const putaway = async (row: any) => {
|
|
const putaway = async (row: any) => {
|
|
|
console.log(row);
|
|
console.log(row);
|
|
@@ -158,7 +159,7 @@ const putaway = async (row: any) => {
|
|
|
showCancelButton: true,
|
|
showCancelButton: true,
|
|
|
confirmButtonText: '确认上架',
|
|
confirmButtonText: '确认上架',
|
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
|
- message: h('p', null, [h('div', null, `是否确认上架:${ row?.name }`), h('div', { style: 'color: #2A6D52;' }, '上架后,即可分享并在小程序上显示该套餐!')]),
|
|
|
|
|
|
|
+ message: h('p', null, [h('div', null, `是否确认上架:${row?.name}`), h('div', { style: 'color: #2A6D52;' }, '上架后,即可分享并在小程序上显示该套餐!')]),
|
|
|
callback: async (action: string) => {
|
|
callback: async (action: string) => {
|
|
|
if (action === 'confirm') {
|
|
if (action === 'confirm') {
|
|
|
proxy.$modal.loading('上架中...');
|
|
proxy.$modal.loading('上架中...');
|
|
@@ -178,7 +179,7 @@ const soldOut = async (row: any) => {
|
|
|
showCancelButton: true,
|
|
showCancelButton: true,
|
|
|
confirmButtonText: '确认下架',
|
|
confirmButtonText: '确认下架',
|
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
|
- message: h('p', null, [h('div', null, `是否确认下架:${ row?.name }`), h('div', { style: 'color: #F56C6C;' }, '下架后,该套餐将不再小程序上显示,已购买企业不受影响!')]),
|
|
|
|
|
|
|
+ message: h('p', null, [h('div', null, `是否确认下架:${row?.name}`), h('div', { style: 'color: #F56C6C;' }, '下架后,该套餐将不再小程序上显示,已购买企业不受影响!')]),
|
|
|
callback: async (action: string) => {
|
|
callback: async (action: string) => {
|
|
|
if (action === 'confirm') {
|
|
if (action === 'confirm') {
|
|
|
proxy.$modal.loading('下架中...');
|
|
proxy.$modal.loading('下架中...');
|
|
@@ -208,4 +209,8 @@ onMounted(() => {
|
|
|
getTabsCount();
|
|
getTabsCount();
|
|
|
getList();
|
|
getList();
|
|
|
});
|
|
});
|
|
|
|
|
+onActivated(() => {
|
|
|
|
|
+ getTabsCount();
|
|
|
|
|
+ getList();
|
|
|
|
|
+});
|
|
|
</script>
|
|
</script>
|