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
9a0e23ab
Commit
9a0e23ab
authored
Aug 05, 2021
by
lihui
Browse files
Options
Browse Files
Download
Plain Diff
feat:merge
parents
cb5bc6bd
1ee812e0
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
147 additions
and
45 deletions
+147
-45
activity.js
server/controllers/activity.js
+13
-0
router.js
server/router.js
+2
-2
addProduc.vue
src/pages/Activity/releaseProduc/components/addProduc.vue
+29
-10
infoEditing.vue
src/pages/Activity/releaseProduc/components/infoEditing.vue
+23
-3
index.vue
src/pages/Activity/releaseProduc/index.vue
+74
-30
index.js
src/service/Activity/index.js
+6
-0
No files found.
server/controllers/activity.js
View file @
9a0e23ab
...
...
@@ -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 @
9a0e23ab
...
...
@@ -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 @
9a0e23ab
...
...
@@ -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
);
...
...
@@ -350,8 +353,11 @@ export default {
const
res
=
await
markGoodsInfo
(
params
);
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
);
for
(
var
i
in
res
.
result
.
goods_info
.
desc_pic_url_list
)
{
this
.
commodityForm
.
picUrlList
.
push
({
url
:
res
.
result
.
goods_info
.
desc_pic_url_list
[
i
],
});
}
},
// 编辑商品详情
...
...
@@ -363,11 +369,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 +385,6 @@ export default {
}
else
{
ElMessage
.
error
(
res
.
reason
);
}
console
.
log
(
res
);
},
// 获取商品库列表
...
...
@@ -395,7 +400,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 +411,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
:
""
,
...
...
@@ -423,7 +427,8 @@ export default {
message
:
"添加商品成功"
,
type
:
"success"
,
});
this
.
comTableData
=
[
res
.
result
.
goods_info
,
...
this
.
multipleSelection
];
// [res.result.goods_info, ...this.multipleSelection];
this
.
comTableData
.
push
(
res
.
result
.
goods_info
);
this
.
addCommodityPopup
=
false
;
}
else
{
ElMessage
.
error
(
res
.
reason
);
...
...
@@ -481,9 +486,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 @
9a0e23ab
...
...
@@ -46,6 +46,7 @@
<
script
>
import
{
GOODS_URI
}
from
"../../../../../server/config"
;
import
{
marketingInfo
}
from
"../../../../service/Activity/index"
;
export
default
{
//props: ["editInfo"],
props
:
{
...
...
@@ -59,11 +60,11 @@ export default {
infoEditForm
:
{
title
:
""
,
// 标题
desc
:
""
,
// 介绍
picUploadList
:
[]
// 上传详情图片列表
picUploadList
:
[],
// 上传详情图片列表
picUrlList
:
[]
// 图片回显列表
},
isShowPopver
:
false
,
// 是否展示图片框
picUrlList
:
[],
// 图片回显列表
uploadUrl
:
`
${
GOODS_URI
}
/ksy/ks3apiunencrypt/ks3api_upload`
// 金山云上传地址
};
},
...
...
@@ -76,7 +77,6 @@ export default {
// 图片上传成功时
handleDetailSuccess
(
res
)
{
console
.
log
(
res
);
this
.
infoEditForm
.
picUploadList
.
push
(
res
.
result
.
image_id
);
},
...
...
@@ -87,9 +87,29 @@ export default {
this
.
infoEditForm
.
picUploadList
.
splice
(
i
,
1
);
}
}
},
// 获取营销活动详情
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
;
for
(
var
i
in
res
.
result
.
marketing_info
.
pindan_pic_url
)
{
this
.
infoEditForm
.
picUrlList
.
push
({
url
:
res
.
result
.
marketing_info
.
pindan_pic_url
[
i
]
});
}
}
},
created
()
{
this
.
marketingInfoMet
();
console
.
log
(
this
.
editInfo
);
}
};
...
...
src/pages/Activity/releaseProduc/index.vue
View file @
9a0e23ab
...
...
@@ -41,11 +41,13 @@
</
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
,
...
...
@@ -54,8 +56,13 @@ export default {
},
data
()
{
return
{
active
:
3
,
// 步骤条状态
infoEditArr
:
[]
// 信息编辑数据
active
:
1
,
// 步骤条状态
infoEditArr
:
[],
// 信息编辑数据
addProducArr
:
[],
// 添加商品
goodsSkuIDArr
:
[],
// 接收goods_sku_id
// spellOrderSetArr:[]
startDate
:
""
,
// 开始时间
endDate
:
""
// 结束时间
};
},
...
...
@@ -72,30 +79,40 @@ 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);
// console.log(res);
// this.infoEditArr = res.result.marketing_info;
// },
// 取消
cancel
()
{
...
...
@@ -103,23 +120,50 @@ 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
);
}
}
}
},
created
()
{
this
.
marketingInfoMet
();
//
this.marketingInfoMet();
}
};
</
script
>
...
...
src/service/Activity/index.js
View file @
9a0e23ab
...
...
@@ -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