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
25f5dce8
Commit
25f5dce8
authored
Aug 05, 2021
by
your yuchenglong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:添加编辑营销活动,营销活动详情
parent
2e10f914
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
141 additions
and
59 deletions
+141
-59
activity.js
server/controllers/activity.js
+13
-0
router.js
server/router.js
+2
-2
addProduc.vue
src/pages/Activity/releaseProduc/components/addProduc.vue
+22
-8
infoEditing.vue
src/pages/Activity/releaseProduc/components/infoEditing.vue
+23
-8
index.vue
src/pages/Activity/releaseProduc/index.vue
+75
-41
index.js
src/service/Activity/index.js
+6
-0
No files found.
server/controllers/activity.js
View file @
25f5dce8
...
...
@@ -89,6 +89,19 @@ exports.addMarketing = async ctx => {
ctx
.
body
=
await
req
(
ctx
,
opts
);
};
// 编辑营销活动
exports
.
updateMarketing
=
async
ctx
=>
{
const
url
=
`
${
ACTIVITY_URI
}
/marketing/background/update_marketing`
;
const
opts
=
{
url
,
method
:
"POST"
,
json
:
true
,
body
:
ctx
.
request
.
body
};
ctx
.
body
=
await
req
(
ctx
,
opts
);
};
// 营销活动详情
exports
.
marketingInfo
=
async
ctx
=>
{
const
url
=
`
${
ACTIVITY_URI
}
/marketing/background/marketing_info`
;
...
...
server/router.js
View file @
25f5dce8
...
...
@@ -71,14 +71,14 @@ router.post(`${API_VERSION}/marketing/background/marketing_info`, activity.check
router
.
get
(
`
${
API_VERSION
}
/marketing/background/take_place_list`
,
activity
.
getPlaceList
)
router
.
post
(
`
${
API_VERSION
}
/marketing/background/add_take_place`
,
activity
.
addPlace
)
router
.
post
(
`
${
API_VERSION
}
/marketing/background/delete_take_place`
,
activity
.
deletePlace
)
//活动管理
router
.
get
(
`
${
API_VERSION
}
/goods/background/ota_list`
,
activity
.
getBusinessList
);
router
.
post
(
`
${
API_VERSION
}
/goods/background/add_goods`
,
activity
.
addGoods
);
router
.
get
(
`
${
API_VERSION
}
/goods/background/pindan_goods`
,
activity
.
pindanGoods
);
router
.
get
(
`
${
API_VERSION
}
/goods/background/marketing_goods_info`
,
activity
.
markGoodsInfo
);
router
.
post
(
`
${
API_VERSION
}
/goods/background/edit_goods`
,
activity
.
editGoods
);
router
.
post
(
`
${
API_VERSION
}
/marketing/background/add_marketing`
,
activity
.
addMarketing
);
router
.
post
(
`
${
API_VERSION
}
/marketing/background/marketing_info`
,
activity
.
marketingInfo
);
router
.
post
(
`
${
API_VERSION
}
/marketing/background/update_marketing`
,
activity
.
updateMarketing
);
...
...
src/pages/Activity/releaseProduc/components/addProduc.vue
View file @
25f5dce8
...
...
@@ -236,6 +236,7 @@ import {
pindanGoods
,
markGoodsInfo
,
editGoods
,
marketingInfo
,
}
from
"../../../../service/Activity/index"
;
export
default
{
...
...
@@ -336,8 +337,10 @@ export default {
let
params
=
{
ota_name
:
""
,
offset
:
""
,
limit
:
""
};
try
{
const
res
=
await
getBusinessList
(
params
);
this
.
businessOpt
=
[{
ota_id
:
""
,
ota_name
:
"全部"
},
...
res
.
data
.
list
];
console
.
log
(
this
.
businessOpt
);
this
.
businessOpt
=
[
{
ota_id
:
""
,
ota_name
:
"全部"
},
...
res
.
result
.
list
,
];
}
catch
(
error
)
{
this
.
$message
.
error
(
"发生未知错误,请稍后再试一下吧~~~"
);
console
.
error
(
error
);
...
...
@@ -351,7 +354,6 @@ export default {
this
.
commodityForm
=
res
.
result
.
goods_info
;
this
.
commodityForm
.
business1
=
res
.
result
.
goods_info
.
ota_id
;
this
.
commodityForm
.
picUrlList
=
res
.
result
.
goods_info
.
desc_pic_url_list
;
console
.
log
(
this
.
commodityForm
.
picUrlList
);
},
// 编辑商品详情
...
...
@@ -363,11 +365,11 @@ export default {
inventory_add
:
this
.
commodityForm
.
inventory_total
,
original_price
:
this
.
commodityForm
.
original_price
,
price
:
this
.
commodityForm
.
price
,
marketing_name
:
this
.
editInfo
[
0
]
.
title
,
marketing_name
:
this
.
editInfo
.
title
,
marketing_type
:
"4"
,
ota_id
:
this
.
commodityForm
.
business1
,
op_cur_user
:
store
.
state
.
userInfo
.
email
,
goods_sku_id
:
goodsSkuID
,
goods_sku_id
:
goodsSkuID
,
});
if
(
res
.
code
==
0
)
{
ElMessage
.
success
({
...
...
@@ -379,7 +381,6 @@ export default {
}
else
{
ElMessage
.
error
(
res
.
reason
);
}
console
.
log
(
res
);
},
// 获取商品库列表
...
...
@@ -395,7 +396,6 @@ export default {
this
.
commodityForm
=
{};
if
(
type
==
"add"
)
{
this
.
commodityForm
.
total_amount_order
=
0
;
console
.
log
(
this
.
commodityForm
.
total_amount_order
);
this
.
addCommodityTitle
=
"商品添加"
;
}
else
{
this
.
addCommodityTitle
=
"商品编辑"
;
...
...
@@ -407,7 +407,7 @@ export default {
// 添加商品
async
addGoodsMet
()
{
const
res
=
await
addGoods
({
marketing_name
:
this
.
editInfo
[
0
]
.
title
,
marketing_name
:
this
.
editInfo
.
title
,
goods_name
:
this
.
commodityForm
.
goods_name
,
desc_pic_url
:
this
.
picUploadList
.
join
(
","
),
desc
:
""
,
...
...
@@ -481,9 +481,23 @@ export default {
}
}
},
// 获取营销活动详情
async
marketingInfoMet
()
{
let
marketingId
=
this
.
$route
.
query
.
marketing_id
;
if
(
marketingId
==
undefined
)
{
return
;
}
let
params
=
{
marketing_id
:
marketingId
,
marketing_type
:
"4"
,
};
const
res
=
await
marketingInfo
(
params
);
this
.
comTableData
=
res
.
result
.
goods_list
;
},
},
created
()
{
this
.
getBusinessListMet
();
this
.
marketingInfoMet
();
},
};
</
script
>
...
...
src/pages/Activity/releaseProduc/components/infoEditing.vue
View file @
25f5dce8
...
...
@@ -46,8 +46,8 @@
<
script
>
import
{
GOODS_URI
}
from
"../../../../../server/config"
;
import
{
marketingInfo
}
from
"../../../../service/Activity/index"
;
export
default
{
props
:
[
"editInfo"
],
data
()
{
return
{
infoEditForm
:
{
...
...
@@ -82,16 +82,31 @@ export default {
}
}
},
// 获取营销活动详情
async
marketingInfoMet
()
{
let
marketingId
=
this
.
$route
.
query
.
marketing_id
;
if
(
marketingId
==
undefined
)
{
return
;
}
let
params
=
{
marketing_id
:
marketingId
,
marketing_type
:
"4"
,
};
const
res
=
await
marketingInfo
(
params
);
this
.
infoEditForm
.
title
=
res
.
result
.
marketing_info
.
marketing_name
;
this
.
infoEditForm
.
desc
=
res
.
result
.
marketing_info
.
pindan_desc
;
this
.
infoEditForm
.
picUploadList
=
res
.
result
.
marketing_info
.
pindan_pic_url
;
},
},
created
()
{
this
.
marketingInfoMet
();
},
created
(){
console
.
log
(
this
.
editInfo
);
}
};
</
script
>
<
style
scoped
>
.infoEditing
{
width
:
64%
;
margin
:
0
auto
;
}
.infoEditing
{
width
:
64%
;
margin
:
0
auto
;
}
</
style
>
\ No newline at end of file
src/pages/Activity/releaseProduc/index.vue
View file @
25f5dce8
...
...
@@ -13,17 +13,13 @@
<el-step
title=
"拼单设置"
></el-step>
</el-steps>
<div
class=
"content"
>
<<<<<<<
Updated
upstream
<infoEditing
ref=
"infoEdit"
v-if=
"active === 1"
/>
=======
<infoEditing
ref=
"infoEdit"
v-if=
"active === 1"
:editInfo=
"infoEditArr"
/>
>>>>>>> Stashed changes
<addProduc
ref=
"addProduc"
v-else-if=
"active === 2"
:editInfo=
"infoEditArr"
/>
<spellOrderSet
v-else
/>
<spellOrderSet
ref=
"spellOrderSet"
v-else
/>
</div>
<div
class=
"stepsBtn"
>
<el-button
@
click=
"prev"
v-show=
"active >= 2"
style=
"margin-right: 20px"
...
...
@@ -41,21 +37,28 @@
</
template
>
<
script
>
import
store
from
"../../../store/index"
;
import
{
ElMessage
}
from
"element-plus"
;
import
infoEditing
from
"./components/infoEditing.vue"
;
import
addProduc
from
"./components/addProduc.vue"
;
import
spellOrderSet
from
"./components/spellOrderSet.vue"
;
import
{
addMarketing
,
marketingInfo
}
from
"../../../service/Activity/index"
;
// , marketingInfo
import
{
addMarketing
,
updateMarketing
}
from
"../../../service/Activity/index"
;
export
default
{
components
:
{
infoEditing
,
addProduc
,
spellOrderSet
spellOrderSet
,
},
data
()
{
return
{
active
:
3
,
// 步骤条状态
infoEditArr
:
[]
// 信息编辑数据
active
:
1
,
// 步骤条状态
infoEditArr
:
[],
// 信息编辑数据
addProducArr
:
[],
// 添加商品
goodsSkuIDArr
:
[],
// 接收goods_sku_id
// spellOrderSetArr:[]
startDate
:
""
,
// 开始时间
endDate
:
""
,
// 结束时间
};
},
...
...
@@ -72,30 +75,38 @@ export default {
ElMessage
.
error
(
"请填写商品标题"
);
return
;
}
// console.log(this.$refs.infoEdit.infoEditForm.picUploadList.join(","));
this
.
infoEditArr
.
push
(
this
.
$refs
.
infoEdit
.
infoEditForm
);
this
.
infoEditArr
=
{
title
:
this
.
$refs
.
infoEdit
.
infoEditForm
.
title
,
desc
:
this
.
$refs
.
infoEdit
.
infoEditForm
.
desc
,
picUploadList
:
this
.
$refs
.
infoEdit
.
infoEditForm
.
picUploadList
.
join
(
","
),
};
}
else
if
(
this
.
active
===
2
)
{
if
(
this
.
$refs
.
addProduc
.
comTableData
.
length
==
0
)
{
ElMessage
.
error
(
"请至少选择一个商品"
);
return
;
}
this
.
addProducArr
=
this
.
$refs
.
addProduc
;
}
else
{
this
.
startDate
=
this
.
$refs
.
spellOrderSet
.
startDate
;
this
.
endDate
=
this
.
$refs
.
spellOrderSet
.
endDate
;
}
this
.
active
++
;
},
// 获取营销活动详情
async
marketingInfoMet
()
{
let
marketingId
=
this
.
$route
.
query
.
marketing_id
;
if
(
marketingId
==
undefined
)
{
return
;
}
let
params
=
{
marketing_id
:
marketingId
,
marketing_type
:
"4"
,
};
const
res
=
await
marketingInfo
(
params
);
this
.
infoEditArr
=
res
.
result
.
marketing_info
;
},
//
async marketingInfoMet() {
//
let marketingId = this.$route.query.marketing_id;
//
if (marketingId == undefined) {
//
return;
//
}
//
let params = {
//
marketing_id: marketingId,
//
marketing_type: "4",
//
};
//
const res = await marketingInfo(params);
//
this.infoEditArr = res.result.marketing_info;
//
},
// 取消
cancel
()
{
...
...
@@ -103,28 +114,51 @@ export default {
},
// 确认发布
async
confirmRelease
()
{
// this.$refs.addProduc.comTableData
const
res
=
await
addMarketing
({
goods_sku_id
:
""
,
marketing_name
:
""
,
for
(
var
i
in
this
.
addProducArr
.
comTableData
)
{
this
.
goodsSkuIDArr
.
push
(
this
.
addProducArr
.
comTableData
[
i
].
goods_sku_id
);
}
let
params
=
{
marketing_id
:
this
.
$route
.
query
.
marketing_id
==
undefined
?
""
:
this
.
$route
.
query
.
marketing_id
,
goods_sku_id
:
this
.
goodsSkuIDArr
.
join
(
","
),
marketing_name
:
this
.
infoEditArr
.
title
,
marketing_type
:
"4"
,
op_cur_user
:
""
,
start_time
:
""
,
end_time
:
""
,
pindan_pic
:
""
,
pindan_desc
:
""
,
});
console
.
log
(
res
);
this
.
$router
.
push
({
path
:
"/op/activity/manage"
});
}
op_cur_user
:
store
.
state
.
userInfo
.
email
,
start_time
:
this
.
startDate
,
end_time
:
this
.
endDate
,
pindan_pic
:
this
.
infoEditArr
.
picUploadList
,
pindan_desc
:
this
.
infoEditArr
.
desc
,
};
if
(
this
.
$route
.
query
.
marketing_id
==
undefined
)
{
const
res
=
await
addMarketing
(
params
);
if
(
res
.
code
===
0
)
{
ElMessage
.
success
({
message
:
"添加成功"
,
type
:
"success"
,
});
this
.
$router
.
push
({
path
:
"/op/activity/manage"
});
}
else
{
ElMessage
.
error
(
res
.
reason
);
}
}
else
{
const
res
=
await
updateMarketing
(
params
);
if
(
res
.
code
===
0
)
{
ElMessage
.
success
({
message
:
"修改成功"
,
type
:
"success"
,
});
this
.
$router
.
push
({
path
:
"/op/activity/manage"
});
}
else
{
ElMessage
.
error
(
res
.
reason
);
}
}
},
},
<<<<<<<
Updated
upstream
created
()
{}
=======
created
()
{
this
.
marketingInfoMet
();
//
this.marketingInfoMet();
},
>>>>>>>
Stashed
changes
};
</
script
>
...
...
src/service/Activity/index.js
View file @
25f5dce8
...
...
@@ -42,6 +42,12 @@ export async function addMarketing(params) {
return
res
;
}
// 编辑营销活动
export
async
function
updateMarketing
(
params
)
{
const
res
=
await
axios
.
post
(
"/api/v1/marketing/background/update_marketing"
,
params
);
return
res
;
}
// 营销活动详情
export
async
function
marketingInfo
(
params
)
{
const
res
=
await
axios
.
post
(
"/api/v1/marketing/background/marketing_info"
,
params
);
...
...
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