Commit 5acc2c10 authored by liwenhong's avatar liwenhong

add

parent fab26efb
...@@ -248,9 +248,10 @@ exports.colonelAddApplyPoint = async ctx => { ...@@ -248,9 +248,10 @@ exports.colonelAddApplyPoint = async ctx => {
ctx.body = res; ctx.body = res;
}; };
//营销中心-活动列表
exports.yingxiaoList = async ctx => { exports.yingxiaoList = async ctx => {
const url = `${GOODS_URI}/marketing/background/yingxiao_list`; // const url = `${GOODS_URI}/marketing/background/yingxiaoList`;
const url = 'https://www.fastmock.site/mock/54a26f3382fe445fd8a48d4c6b4ed65f/login/chart';
const opts = { const opts = {
url, url,
method: "POST", method: "POST",
...@@ -259,4 +260,33 @@ exports.yingxiaoList = async ctx => { ...@@ -259,4 +260,33 @@ exports.yingxiaoList = async ctx => {
}; };
const res = await req(ctx, opts); const res = await req(ctx, opts);
ctx.body = res; ctx.body = res;
}; };
\ No newline at end of file
//营销中心-活动列表
exports.toogleYingxiaoOnlineStatus = async ctx => {
const url = `${GOODS_URI}/marketing/background/toogle_yingxiao_online_status`;
const opts = {
url,
method: "POST",
json: true,
body: ctx.request.body
};
const res = await req(ctx, opts);
ctx.body = res;
};
//营销中心-充值
exports.addAmount = async ctx => {
const url = `${GOODS_URI}/marketing/background/add_amount`;
const opts = {
url,
method: "POST",
json: true,
body: ctx.request.body
};
const res = await req(ctx, opts);
ctx.body = res;
};
...@@ -68,6 +68,8 @@ router.post(`${API_VERSION}/colonelAudit`, goods.colonelAudit) ...@@ -68,6 +68,8 @@ router.post(`${API_VERSION}/colonelAudit`, goods.colonelAudit)
router.post(`${API_VERSION}/colonelApplyPoint`, goods.colonelApplyPoint) router.post(`${API_VERSION}/colonelApplyPoint`, goods.colonelApplyPoint)
router.post(`${API_VERSION}/colonelAddApplyPoint`, goods.colonelAddApplyPoint) router.post(`${API_VERSION}/colonelAddApplyPoint`, goods.colonelAddApplyPoint)
router.post(`${API_VERSION}/yingxiaoList`, goods.yingxiaoList); router.post(`${API_VERSION}/yingxiaoList`, goods.yingxiaoList);
router.post(`${API_VERSION}/addAmount`, goods.addAmount);
router.post(`${API_VERSION}/toogleYingxiaoOnlineStatus`, goods.toogleYingxiaoOnlineStatus);
......
...@@ -5,25 +5,19 @@ ...@@ -5,25 +5,19 @@
<!-- 表头 --> <!-- 表头 -->
<div class="header"> <div class="header">
<h2>账户信息</h2> <h2>账户信息</h2>
<el-button
>充值</el-button
>
</div> </div>
<!-- 列表区 --> <!-- 列表区 -->
<el-table class="goods_list" :data="activityList" border stripe :tab-position="left"> <el-table class="goods_list" :data="anlysis" border stripe>
<el-table-column <el-table-column
label="商品id" prop="title"
prop="goods_spu_id"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="商品名称" prop="total"
prop="goods_name"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="一级分类" prop="explain"
prop="category_1_name"
align="center" align="center"
></el-table-column> ></el-table-column>
</el-table> </el-table>
...@@ -62,18 +56,11 @@ ...@@ -62,18 +56,11 @@
></el-table-column> ></el-table-column>
<!-- 操作快捷键 --> <!-- 操作快捷键 -->
<el-table-column label="操作" align="center" fixed="right" width="200"> <el-table-column label="操作" align="center" fixed="right" width="200">
<template> <template #default="scope">
<el-button <el-button @click.stop="handleAddAmount(scope.row)" type="text">充值</el-button>
>预算分配</el-button <!-- <el-button>预算分配</el-button> -->
> <el-button type="text" @click="handleActivityOnline(scope.row)">{{scope.row.online_status==1?'活动下线':'活动上线'}}</el-button>
<el-button type="text">活动配置</el-button>
<el-button
>活动下线</el-button
>
<el-button
>活动配置</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -86,6 +73,8 @@ import Layout from "../../Groupmeal/layout/index.vue"; ...@@ -86,6 +73,8 @@ import Layout from "../../Groupmeal/layout/index.vue";
import page from "@/components/Pagination" import page from "@/components/Pagination"
import { import {
yingxiaoList, yingxiaoList,
addAmount,
toogleYingxiaoOnlineStatus
} from "@/service/Goods/goods"; } from "@/service/Goods/goods";
// import { getLifeNoList as reqGetLifeNoList } from "../../service/life-no"; // import { getLifeNoList as reqGetLifeNoList } from "../../service/life-no";
...@@ -98,9 +87,27 @@ export default { ...@@ -98,9 +87,27 @@ export default {
data () { data () {
return { return {
activityList: [], activityList: [],
anlysis: [{
title: '营销账户预算',
explain: '运营申请的用户业务增长的营销总预算',
total: ''
},{
title: '已消耗(T+1更新)',
explain: '目前已经确认消耗的营销预算',
total: ''
},{
title: '已占用(每10分钟更新)',
explain: '分享裂变活动中派发出的有效优惠券的总额',
total: ''
},{
title: '可用余额',
explain: '目前平台可使用的余额',
total: ''
}],
anlysisObj: {},
params: { params: {
page: 1, page: 1,
page_size: 20 page_size: 20,
}, },
} }
...@@ -110,14 +117,38 @@ export default { ...@@ -110,14 +117,38 @@ export default {
}, },
methods: { methods: {
async getMarketingActivityList() { async getMarketingActivityList() {
try {
const res = await yingxiaoList(); const res = await yingxiaoList();
if (res.code !== 0) return this.$message.error(res.reason); if (res.code !== 0) return this.$message.error(res.reason);
this.activityList = res.result.list; this.activityList = res.result.list;
} catch (error) { this.anlysisObj = res.result.anlysis;
console.error(error); let list = [];
} for(let k in this.anlysisObj) {
list.push(this.anlysisObj[k])
}
this.anlysis.map((item, index) => item.total = list[index])
}, },
handleActivityOnline(item) {
this.$confirm(`您确定要${item.online_status == 1?'下线':'上线'}${item.marketing_name}吗`, `活动${item.online_status == 1?'下线':'上线'}`, {
confirmButtonText: '确定',
cancelButtonText: '取消',
center: true
}).then(async () => {
let res = await toogleYingxiaoOnlineStatus({marketing_id: item.marketing_id, online_status: item.online_status == 1?2:1}) //1上线 2下线
this.getMarketingActivityList()
if (res.code !== 0) return this.$message.error(res.reason);
})
},
async handleAddAmount(item) {
this.$prompt(`当前账户预算:${this.anlysisObj.total} \r 当前账户可用余额:${this.anlysisObj.balance}`, '充值', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/,
inputErrorMessage: '邮箱格式不正确'
}).then(async ({ value }) => {
let res = await addAmount({capital_pool_id: item.capital_pool_id, amount: value})
if (res.code !== 0) return this.$message.error(res.reason);
})
}
} }
} }
</script> </script>
......
...@@ -130,4 +130,16 @@ export async function colonelAddApplyPoint (params) { ...@@ -130,4 +130,16 @@ export async function colonelAddApplyPoint (params) {
export async function yingxiaoList (params) { export async function yingxiaoList (params) {
const res = await axios.post("/api/v1/yingxiaoList", params); const res = await axios.post("/api/v1/yingxiaoList", params);
return res; return res;
} }
\ No newline at end of file
// 营销中心-活动下线
export async function toogleYingxiaoOnlineStatus (params) {
const res = await axios.post("/api/v1/toogleYingxiaoOnlineStatus", params);
return res;
}
// 营销中心-充值
export async function addAmount (params) {
const res = await axios.post("/api/v1/addAmount", params);
return res;
}
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