Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
op-web-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
op-web-service
Commits
5acc2c10
Commit
5acc2c10
authored
Aug 29, 2021
by
liwenhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
fab26efb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
106 additions
and
31 deletions
+106
-31
goods.js
server/controllers/goods.js
+33
-3
router.js
server/router.js
+2
-0
index.vue
src/pages/Groupmeal/Marketing/index.vue
+58
-27
goods.js
src/service/Goods/goods.js
+13
-1
No files found.
server/controllers/goods.js
View file @
5acc2c10
...
...
@@ -248,9 +248,10 @@ exports.colonelAddApplyPoint = async ctx => {
ctx
.
body
=
res
;
};
//营销中心-活动列表
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
=
{
url
,
method
:
"POST"
,
...
...
@@ -259,4 +260,33 @@ exports.yingxiaoList = async ctx => {
};
const
res
=
await
req
(
ctx
,
opts
);
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
;
};
server/router.js
View file @
5acc2c10
...
...
@@ -68,6 +68,8 @@ router.post(`${API_VERSION}/colonelAudit`, goods.colonelAudit)
router
.
post
(
`
${
API_VERSION
}
/colonelApplyPoint`
,
goods
.
colonelApplyPoint
)
router
.
post
(
`
${
API_VERSION
}
/colonelAddApplyPoint`
,
goods
.
colonelAddApplyPoint
)
router
.
post
(
`
${
API_VERSION
}
/yingxiaoList`
,
goods
.
yingxiaoList
);
router
.
post
(
`
${
API_VERSION
}
/addAmount`
,
goods
.
addAmount
);
router
.
post
(
`
${
API_VERSION
}
/toogleYingxiaoOnlineStatus`
,
goods
.
toogleYingxiaoOnlineStatus
);
...
...
src/pages/Groupmeal/Marketing/index.vue
View file @
5acc2c10
...
...
@@ -5,25 +5,19 @@
<!-- 表头 -->
<div
class=
"header"
>
<h2>
账户信息
</h2>
<el-button
>
充值
</el-button
>
</div>
<!-- 列表区 -->
<el-table
class=
"goods_list"
:data=
"a
ctivityList"
border
stripe
:tab-position=
"left"
>
<el-table
class=
"goods_list"
:data=
"a
nlysis"
border
stripe
>
<el-table-column
label=
"商品id"
prop=
"goods_spu_id"
prop=
"title"
align=
"center"
></el-table-column>
<el-table-column
label=
"商品名称"
prop=
"goods_name"
prop=
"total"
align=
"center"
></el-table-column>
<el-table-column
label=
"一级分类"
prop=
"category_1_name"
prop=
"explain"
align=
"center"
></el-table-column>
</el-table>
...
...
@@ -62,18 +56,11 @@
></el-table-column>
<!-- 操作快捷键 -->
<el-table-column
label=
"操作"
align=
"center"
fixed=
"right"
width=
"200"
>
<template>
<el-button
>
预算分配
</el-button
>
<el-button
>
活动下线
</el-button
>
<el-button
>
活动配置
</el-button
>
<template
#
default=
"scope"
>
<el-button
@
click
.
stop=
"handleAddAmount(scope.row)"
type=
"text"
>
充值
</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>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -86,6 +73,8 @@ import Layout from "../../Groupmeal/layout/index.vue";
import
page
from
"@/components/Pagination"
import
{
yingxiaoList
,
addAmount
,
toogleYingxiaoOnlineStatus
}
from
"@/service/Goods/goods"
;
// import { getLifeNoList as reqGetLifeNoList } from "../../service/life-no";
...
...
@@ -98,9 +87,27 @@ export default {
data
()
{
return
{
activityList
:
[],
anlysis
:
[{
title
:
'营销账户预算'
,
explain
:
'运营申请的用户业务增长的营销总预算'
,
total
:
''
},{
title
:
'已消耗(T+1更新)'
,
explain
:
'目前已经确认消耗的营销预算'
,
total
:
''
},{
title
:
'已占用(每10分钟更新)'
,
explain
:
'分享裂变活动中派发出的有效优惠券的总额'
,
total
:
''
},{
title
:
'可用余额'
,
explain
:
'目前平台可使用的余额'
,
total
:
''
}],
anlysisObj
:
{},
params
:
{
page
:
1
,
page_size
:
20
page_size
:
20
,
},
}
...
...
@@ -110,14 +117,38 @@ export default {
},
methods
:
{
async
getMarketingActivityList
()
{
try
{
const
res
=
await
yingxiaoList
();
if
(
res
.
code
!==
0
)
return
this
.
$message
.
error
(
res
.
reason
);
this
.
activityList
=
res
.
result
.
list
;
}
catch
(
error
)
{
console
.
error
(
error
);
}
this
.
anlysisObj
=
res
.
result
.
anlysis
;
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
>
...
...
src/service/Goods/goods.js
View file @
5acc2c10
...
...
@@ -130,4 +130,16 @@ export async function colonelAddApplyPoint (params) {
export
async
function
yingxiaoList
(
params
)
{
const
res
=
await
axios
.
post
(
"/api/v1/yingxiaoList"
,
params
);
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
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment