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
a755542a
Commit
a755542a
authored
Aug 03, 2021
by
lihui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:api
parent
7182c0ed
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
111 additions
and
147 deletions
+111
-147
activity.js
server/controllers/activity.js
+12
-2
router.js
server/router.js
+2
-0
index.vue
src/pages/Activity/Manage/index.vue
+76
-145
index.js
src/service/Activity/index.js
+21
-0
No files found.
server/controllers/activity.js
View file @
a755542a
// 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
);
};
server/router.js
View file @
a755542a
...
...
@@ -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
;
src/pages/Activity/Manage/index.vue
View file @
a755542a
...
...
@@ -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
>
...
...
src/service/Activity/index.js
View file @
a755542a
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
;
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