parent
2e9c82082d
commit
71e9e99ff4
@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-TW">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>{$lang.cp_home}{if $ur_here} - {$ur_here}{/if}</title>
|
||||
<!-- Google Font: Source Sans Pro -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback"
|
||||
/>
|
||||
<link href="https://dev.iconly.io/public/x2OLQFwf8Nev/iconly.css" rel="stylesheet"/>
|
||||
</head>
|
||||
<body class="hold-transition login-page">
|
||||
<!-- /.login-box -->
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/pages/affiliate/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,10 @@
|
||||
import { request } from '@/utils/request'
|
||||
|
||||
export function getAffiliateList(params) {
|
||||
return request('/affiliate/getAffiliateList', 'post', params)
|
||||
}
|
||||
|
||||
export function delAffiliateLog(id) {
|
||||
return request('/affiliate/delAffiliateLog', 'get', {id})
|
||||
}
|
||||
|
||||
@ -0,0 +1,18 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-config-provider :locale="locale">
|
||||
<router-view></router-view>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { ElConfigProvider } from 'element-plus'
|
||||
import zhTw from 'element-plus/lib/locale/lang/zh-tw'
|
||||
|
||||
const locale = ref(zhTw)
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
||||
@ -0,0 +1,71 @@
|
||||
<script setup>
|
||||
import { ref, onMounted } from "vue";
|
||||
|
||||
import { getAffiliateList, delAffiliateLog } from "@/api/affiliate";
|
||||
|
||||
const tableData = ref([]);
|
||||
const total = ref(0);
|
||||
const page = ref(1);
|
||||
const pageSize = ref(10);
|
||||
|
||||
const getTableData = async () => {
|
||||
const res = await getAffiliateList({
|
||||
page: page.value,
|
||||
pageSize: pageSize.value,
|
||||
});
|
||||
if (res.code === 200) {
|
||||
tableData.value = res.data.data;
|
||||
total.value = res.data.total;
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getTableData();
|
||||
});
|
||||
|
||||
const handleDelete = (row) => {
|
||||
ElMessageBox.confirm('此操作將永久刪除該推薦記錄, 是否繼續?', '提示', {
|
||||
confirmButtonText: '確定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const res = await delAffiliateLog(row.log_id);
|
||||
if (res.code === 200) {
|
||||
getTableData();
|
||||
return ElMessage.success('刪除成功');
|
||||
}
|
||||
return ElMessage.error(res.msg);
|
||||
|
||||
}).catch(() => {
|
||||
ElMessage({
|
||||
type: 'info',
|
||||
message: '已取消刪除'
|
||||
});
|
||||
});
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="main">
|
||||
<!-- Breadcrumb: Start -->
|
||||
<el-page-header :icon="null" title=" " @back="onBack">
|
||||
<template #breadcrumb>
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item> 電商管理中心 </el-breadcrumb-item>
|
||||
<el-breadcrumb-item>推薦設置</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</template>
|
||||
<template #content>
|
||||
<span class="text-large font-600 mr-3"> 推薦設置 </span>
|
||||
</template>
|
||||
</el-page-header>
|
||||
<!-- Breadcrumb: End -->
|
||||
<hr />
|
||||
<el-card>
|
||||
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@ -0,0 +1,10 @@
|
||||
<scipt setup>
|
||||
import { ref, reactive, watch, onMounted } from "vue";
|
||||
</scipt>
|
||||
|
||||
<template>
|
||||
info
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
</style>
|
||||
@ -0,0 +1,10 @@
|
||||
import { createApp } from 'vue'
|
||||
import App from './App.vue'
|
||||
import router from './router/index.js'
|
||||
|
||||
import '@/assets/css/normalize.less'
|
||||
import '@/assets/css/common.less'
|
||||
|
||||
const app = createApp(App)
|
||||
app.use(router)
|
||||
app.mount('#app')
|
||||
@ -0,0 +1,32 @@
|
||||
import { createRouter, createWebHashHistory } from 'vue-router'
|
||||
|
||||
let history = createWebHashHistory()
|
||||
|
||||
let routes = [
|
||||
{
|
||||
path: '/',
|
||||
name: 'Affiliate',
|
||||
redirect: '/list'
|
||||
},
|
||||
{
|
||||
path: '/list',
|
||||
name: 'List',
|
||||
component: ()=> import("../Index.vue")
|
||||
},
|
||||
{
|
||||
path: '/info',
|
||||
name: 'Info',
|
||||
component: ()=> import("../Info.vue")
|
||||
},
|
||||
]
|
||||
|
||||
const router = createRouter({
|
||||
history,
|
||||
routes,
|
||||
scrollBehavior(to, from, savedPosition) {
|
||||
return { top: 0 };
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
export default router
|
||||
Loading…
Reference in new issue