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
23651259
Commit
23651259
authored
Aug 04, 2021
by
your yuchenglong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:图片上传,搜商品,商家接口
parent
71ecc8f7
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
337 additions
and
142 deletions
+337
-142
activity.js
server/controllers/activity.js
+34
-2
router.js
server/router.js
+5
-0
index.vue
src/pages/Activity/Manage/index.vue
+3
-0
addProduc.vue
src/pages/Activity/releaseProduc/components/addProduc.vue
+204
-93
infoEditing.vue
src/pages/Activity/releaseProduc/components/infoEditing.vue
+49
-38
index.vue
src/pages/Activity/releaseProduc/index.vue
+16
-9
index.js
src/service/Activity/index.js
+26
-0
No files found.
server/controllers/activity.js
View file @
23651259
// const ACTIVITY_URI = require("../config.js").ACTIVITY_URI;
const
ACTIVITY_URI
=
require
(
"../config.js"
).
ACTIVITY_URI
;
// const req = require("../utils/request").httpReq;
const
req
=
require
(
"../utils/request"
).
httpReq
;
// 获取商家列表
exports
.
getBusinessList
=
async
ctx
=>
{
const
url
=
`
${
ACTIVITY_URI
}
/goods/background/ota_list`
;
const
opts
=
{
url
,
method
:
"GET"
};
ctx
.
body
=
await
req
(
ctx
,
opts
);
};
// 添加商品
exports
.
addGoods
=
async
ctx
=>
{
const
url
=
`
${
ACTIVITY_URI
}
/goods/background/add_goods`
;
const
opts
=
{
url
,
method
:
"POST"
,
json
:
true
,
body
:
ctx
.
request
.
body
};
ctx
.
body
=
await
req
(
ctx
,
opts
);
};
// 商品库列表
exports
.
pindanGoods
=
async
ctx
=>
{
const
url
=
`
${
ACTIVITY_URI
}
/goods/background/pindan_goods`
;
const
opts
=
{
url
,
method
:
"GET"
};
ctx
.
body
=
await
req
(
ctx
,
opts
);
};
\ No newline at end of file
server/router.js
View file @
23651259
...
@@ -63,4 +63,9 @@ router.get(`${API_VERSION}/merchant/lifeinner/life_list`, life.get_life_list)
...
@@ -63,4 +63,9 @@ 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
.
post
(
`
${
API_VERSION
}
/merchant/authority/get_user_info`
,
user
.
getUser_detail
)
//活动管理
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
);
module
.
exports
=
router
;
module
.
exports
=
router
;
src/pages/Activity/Manage/index.vue
View file @
23651259
...
@@ -178,6 +178,9 @@ export default {
...
@@ -178,6 +178,9 @@ export default {
// 查看详情
// 查看详情
handleLook
()
{},
handleLook
()
{},
},
},
created
(){
}
};
};
</
script
>
</
script
>
<
style
lang=
"less"
src=
"./index.less"
scope
></
style
>
<
style
lang=
"less"
src=
"./index.less"
scope
></
style
>
\ No newline at end of file
src/pages/Activity/releaseProduc/components/addProduc.vue
View file @
23651259
This diff is collapsed.
Click to expand it.
src/pages/Activity/releaseProduc/components/infoEditing.vue
View file @
23651259
...
@@ -19,65 +19,76 @@
...
@@ -19,65 +19,76 @@
</el-form-item>
</el-form-item>
<el-form-item
label=
"图片:"
>
<el-form-item
label=
"图片:"
>
<el-upload
<el-upload
action=
"#"
:data=
"
{ type: 1 }"
:class=
"
{ hide: hideUpload }"
:action="uploadUrl"
:on-preview="previewImage"
:on-success="handleDetailSuccess"
:before-remove="removeDetailFiles"
:file-list="infoEditForm.picUrlList"
auto-upload
ref="picUpload"
:limit="9"
list-type="picture-card"
list-type="picture-card"
:auto-upload="false"
multiple
limit="9"
>
>
<template
#
default
>
<template
#
default
>
<i
class=
"el-icon-plus"
></i>
<i
class=
"el-icon-plus"
></i>
</
template
>
</
template
>
<
template
#
file=
"{ file }"
>
<div>
<img
class=
"el-upload-list__item-thumbnail"
:src=
"file.url"
alt=
""
/>
<span
class=
"el-upload-list__item-actions"
>
<span
v-if=
"!disabled"
class=
"el-upload-list__item-delete"
@
click=
"handleRemove(file)"
>
<i
class=
"el-icon-delete"
></i>
</span>
</span>
</div>
</
template
>
</el-upload>
</el-upload>
<el-dialog
v-model=
"dialogVisible"
>
<img
width=
"100%"
:src=
"dialogImageUrl"
alt=
""
/>
</el-dialog>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<!-- 展示缩略图 -->
<el-dialog
width=
"40%"
v-model=
"isShowPopver"
>
<el-image
:src=
"popoverImage"
fit=
"fill"
style=
"width: 100%"
></el-image>
</el-dialog>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
GOODS_URI
}
from
"../../../../../server/config"
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
infoEditForm
:
{
infoEditForm
:
{
title
:
""
,
title
:
""
,
// 标题
desc
:
""
,
desc
:
""
,
// 介绍
picUploadList
:
[],
// 上传详情图片列表
},
},
dialogImageUrl
:
""
,
dialogVisible
:
false
,
isShowPopver
:
false
,
// 是否展示图片框
disabled
:
false
,
picUrlList
:
[],
// 图片回显列表
hideUpload
:
false
,
uploadUrl
:
`
${
GOODS_URI
}
/ksy/ks3apiunencrypt/ks3api_upload`
,
// 金山云上传地址
};
};
},
},
methods
:
{
methods
:
{
validate
(
callback
)
{
// 初始化上传图片列表
this
.
$refs
.
form
.
validate
((
valid
)
=>
{
// formatUploadPictureList(fileStr) {
callback
(
valid
);
// if (!fileStr) {
});
// return [];
// } else {
// return fileStr.split(",");
// }
// },
// 展示商品大图
previewImage
(
file
)
{
this
.
popoverImage
=
file
.
url
;
this
.
isShowPopver
=
true
;
},
},
// 图片删除
handleRemove
(
file
)
{
// 图片上传成功时
console
.
log
(
file
);
handleDetailSuccess
(
res
)
{
console
.
log
(
res
);
this
.
infoEditForm
.
picUploadList
.
push
(
res
.
result
.
image_id
);
},
// 图片删除后
removeDetailFiles
(
file
,
fileList
)
{
for
(
let
i
=
0
;
i
<
fileList
.
length
;
i
++
)
{
if
(
fileList
[
i
].
uid
==
file
.
uid
)
{
this
.
infoEditForm
.
picUploadList
.
splice
(
i
,
1
);
}
}
},
},
},
},
};
};
...
...
src/pages/Activity/releaseProduc/index.vue
View file @
23651259
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
</el-steps>
</el-steps>
<div
class=
"content"
>
<div
class=
"content"
>
<infoEditing
ref=
"infoEdit"
v-if=
"active === 1"
/>
<infoEditing
ref=
"infoEdit"
v-if=
"active === 1"
/>
<addProduc
v-else-if=
"active === 2"
/>
<addProduc
ref=
"addProduc"
v-else-if=
"active === 2"
/>
<spellOrderSet
v-else
/>
<spellOrderSet
v-else
/>
</div>
</div>
<div
class=
"stepsBtn"
>
<div
class=
"stepsBtn"
>
...
@@ -33,10 +33,10 @@
...
@@ -33,10 +33,10 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
ElMessage
}
from
"element-plus"
;
import
infoEditing
from
"./components/infoEditing.vue"
;
import
infoEditing
from
"./components/infoEditing.vue"
;
import
addProduc
from
"./components/addProduc.vue"
;
import
addProduc
from
"./components/addProduc.vue"
;
import
spellOrderSet
from
"./components/spellOrderSet.vue"
;
import
spellOrderSet
from
"./components/spellOrderSet.vue"
;
import
{
ElMessage
}
from
"element-plus"
;
export
default
{
export
default
{
components
:
{
components
:
{
infoEditing
,
infoEditing
,
...
@@ -46,7 +46,7 @@ export default {
...
@@ -46,7 +46,7 @@ export default {
data
()
{
data
()
{
return
{
return
{
active
:
1
,
// 步骤条状态
active
:
1
,
// 步骤条状态
infoEditArr
:
[],
infoEditArr
:
[],
// 信息编辑数据
};
};
},
},
...
@@ -58,15 +58,20 @@ export default {
...
@@ -58,15 +58,20 @@ export default {
// 下一步
// 下一步
next
()
{
next
()
{
if
(
this
.
active
==
"1"
)
{
if
(
this
.
active
==
=
1
)
{
if
(
this
.
$refs
.
infoEdit
.
infoEditForm
.
title
==
""
)
{
if
(
this
.
$refs
.
infoEdit
.
infoEditForm
.
title
==
""
)
{
ElMessage
.
error
(
"请填写商品标题"
);
ElMessage
.
error
(
"请填写商品标题"
);
// this.$refs["infoEdit"].validateForm(() => {
// this.active++;
// });
return
;
return
;
}
}
// console.log(this.$refs.infoEdit.infoEditForm.picUploadList.join(","));
this
.
infoEditArr
.
push
(
this
.
$refs
.
infoEdit
.
infoEditForm
);
}
else
if
(
this
.
active
===
2
)
{
if
(
this
.
$refs
.
addProduc
.
comTableData
.
length
==
0
)
{
ElMessage
.
error
(
"请至少选择一个商品"
);
return
;
}
}
}
// 信息编辑中的图片
this
.
active
++
;
this
.
active
++
;
},
},
// 取消
// 取消
...
@@ -74,7 +79,9 @@ export default {
...
@@ -74,7 +79,9 @@ export default {
this
.
$router
.
go
(
-
1
);
this
.
$router
.
go
(
-
1
);
},
},
// 确认发布
// 确认发布
confirmRelease
()
{},
confirmRelease
()
{
this
.
$router
.
push
({
path
:
"/op/activity/manage"
});
},
},
},
created
()
{},
created
()
{},
};
};
...
...
src/service/Activity/index.js
View file @
23651259
import
axios
from
"@/utils/request"
;
// 获取商家列表
export
async
function
getBusinessList
(
params
)
{
const
res
=
await
axios
.
get
(
"/api/v1/goods/background/ota_list"
,{
params
});
return
res
;
}
// 添加商品
export
async
function
addGoods
(
params
)
{
const
res
=
await
axios
.
post
(
"/api/v1/goods/background/add_goods"
,
params
);
return
res
;
}
// 商品库列表
export
async
function
pindanGoods
(
params
)
{
const
res
=
await
axios
.
get
(
"/api/v1/goods/background/pindan_goods"
,{
params
});
return
res
;
}
\ No newline at end of file
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