Commit a755542a authored by lihui's avatar lihui

feat:api

parent 7182c0ed
// const ACTIVITY_URI = require("../config.js").ACTIVITY_URI;
// const req = require("../utils/request").httpReq;
const ACTIVITY_URI = require("../config.js").ACTIVITY_URI;
const req = require("../utils/request").httpReq;
// 获取活动过列表
exports.getActivityList = async ctx => {
const url = `${ACTIVITY_URI}/marketing/background/marketing_list`;
const opts = {
url,
method: "GET"
};
ctx.body = await req(ctx, opts);
};
......@@ -62,5 +62,7 @@ router.post(`${API_VERSION}/merchant/lifeinner/life_info`, life.get_life_info)
router.get(`${API_VERSION}/merchant/lifeinner/life_list`, life.get_life_list)
//用户
router.post(`${API_VERSION}/merchant/authority/get_user_info`, user.getUser_detail)
// 后台运营管理
router.get(`${API_VERSION}/marketing/background/marketing_list`, activity.getActivityList)
module.exports = router;
......@@ -33,8 +33,14 @@
</div>
<!-- 列表 -->
<div class="table-wrapper">
<el-table :data="manageList" border style="width: 100%">
<div
class="table-wrapper"
v-loading="tableLoading"
element-loading-text="拼命加载中"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.8)"
>
<el-table :data="tableActivityList" border style="width: 100%">
<el-table-column
align="center"
prop="activiteId"
......@@ -59,11 +65,11 @@
<template #default="scope">
<span>
{{
scope.row.online_status == 2
? "进行中"
: scope.row.online_status == 1
? "未开始"
: "已结束"
scope.row.online_status == 1
? "启用"
: scope.row.online_status == 2
? "关闭"
: "到期"
}}
</span>
</template>
......@@ -159,14 +165,19 @@
</div>
</template>
<script>
import ActivityService from "@/service/Activity/index";
export default {
name: "Manage",
data() {
return {
activity: {
activityName: "",
online_status: [],
online_status: ""
},
currentPage: 1, //当前页码
pageSize: 10, // 每页条数
tableActivityList: [],
tableLoading: false,
manageList: [
{
activiteId: "413315",
......@@ -177,149 +188,66 @@ export default {
pay: "",
discounts: "",
refund: "",
realized: "4000",
},
{
activiteId: "413315",
activiteHead: "生活圈7月29午饭",
activiteStatus: "进行中",
orderNumber: "345",
soldGoods: "",
pay: "",
discounts: "",
refund: "",
realized: "4000",
},
{
activiteId: "413315",
activiteHead: "生活圈7月29午饭",
activiteStatus: "进行中",
orderNumber: "345",
soldGoods: "",
pay: "",
discounts: "",
refund: "",
realized: "4000",
},
{
activiteId: "f",
activiteHead: "生活圈7月29午饭",
activiteStatus: "进行中",
orderNumber: "345",
soldGoods: "",
pay: "",
discounts: "",
refund: "",
realized: "4000",
},
{
activiteId: "f",
activiteHead: "生活圈7月29午饭",
activiteStatus: "进行中",
orderNumber: "345",
soldGoods: "",
pay: "",
discounts: "",
refund: "",
realized: "4000",
},
{
activiteId: "413315",
activiteHead: "生活圈7月29午饭",
activiteStatus: "进行中",
orderNumber: "345",
soldGoods: "",
pay: "",
discounts: "",
refund: "",
realized: "4000",
},
{
activiteId: "413315",
activiteHead: "生活圈7月29午饭",
activiteStatus: "进行中",
orderNumber: "345",
soldGoods: "",
pay: "",
discounts: "",
refund: "",
realized: "4000",
},
{
activiteId: "413315",
activiteHead: "生活圈7月29午饭",
activiteStatus: "进行中",
orderNumber: "345",
soldGoods: "",
pay: "",
discounts: "",
refund: "",
realized: "4000",
},
{
activiteId: "413315",
activiteHead: "生活圈7月29午饭",
activiteStatus: "进行中",
orderNumber: "345",
soldGoods: "",
pay: "",
discounts: "",
refund: "",
realized: "4000",
},
{
activiteId: "413315",
activiteHead: "生活圈7月29午饭",
activiteStatus: "进行中",
orderNumber: "345",
soldGoods: "",
pay: "",
discounts: "",
refund: "",
realized: "4000",
},
{
activiteId: "413315",
activiteHead: "生活圈7月29午饭",
activiteStatus: "进行中",
orderNumber: "345",
soldGoods: "",
pay: "",
discounts: "",
refund: "",
realized: "4000",
},
{
activiteId: "413315",
activiteHead: "生活圈7月29午饭",
activiteStatus: "进行中",
orderNumber: "345",
soldGoods: "",
pay: "",
discounts: "",
refund: "",
realized: "4000",
},
{
activiteId: "413315",
activiteHead: "生活圈7月29午饭",
activiteStatus: "进行中",
orderNumber: "345",
soldGoods: "",
pay: "",
discounts: "",
refund: "",
realized: "4000",
},
realized: "4000"
}
],
options: [
{ value: "0", label: "未开始" },
{ value: "1", label: "进行中" },
{ value: "2", label: "已结束" },
],
{ value: "2", label: "已结束" }
]
};
},
methods: {
/* API */
// 获取商品列表
async getActivityList() {
let params = {
marketing_name: "",
marketing_id: "",
online_status: "",
page: this.currentPage,
page_size: this.pageSize
};
try {
this.tableLoading = true;
let data = await ActivityService.getActivityList();
this.filterTableActiveList(data.result);
this.tableLoading = false;
} catch {
this.tableLoading = false;
}
},
filterTableActiveList(tableData) {
this.tableActivityList = tableData.map(item => {
let activityStatusText = "";
switch (item.online_status) {
case 1:
activityStatusText = "启用";
break;
case 2:
activityStatusText = "关闭";
break;
case 3:
activityStatusText = "到期";
break;
}
return {
activiteId: item.marketing_id,
activiteHead: item.marketing_name,
activiteStatus: item.online_status,
orderNumber: activityStatusText,
soldGoods: "",
pay: "",
discounts: "",
refund: "",
realized: "4000"
};
});
},
// 点击活动标题
handleHeadline() {},
// 发布拼单
......@@ -333,8 +261,11 @@ export default {
// 开始
handleStart() {},
// 查看详情
handleLook() {},
handleLook() {}
},
created() {
this.getActivityList();
}
};
</script>
<style lang="less" src="./index.less" scope></style>
......
import axios from "@/utils/request";
class ActivityService {
// 获取活动列表
static async getActivityList(params) {
const res = await axios.get("/api/v1/marketing/background/marketing_list", {
params
});
return res;
}
// 获取活动名称列表
// 获取活动状态列表
static async postMethod(query) {
const res = await axios.post("/api/v1/goods/background/online", {
goods_spu_id: query
});
return res;
}
}
export default ActivityService;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment