Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-pay
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c2dd634a
authored
Nov 09, 2021
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
商品编辑
1 parent
9bb534b6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
325 additions
and
37 deletions
src/api/modules/common.js
src/assets/css/public.scss
src/views/homeSet/index.vue
src/views/productGroup/editProduct.vue
src/views/productGroup/images/pro-header.png
src/api/modules/common.js
View file @
c2dd634
...
...
@@ -65,4 +65,14 @@ const getZoneListApi = params => {
})
}
export
default
{
getMerchantGoodsListApi
,
getGoodsListApi
,
uploadImgApi
,
uploadVideoApi
,
getMerchantList
,
getZoneListApi
}
const
getClassifyListApi
=
params
=>
{
params
.
method
=
'scrm.api.shopmall.classify.list.curMerchant'
return
http
({
url
:
'rop-scrm-shopmall/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
export
default
{
getMerchantGoodsListApi
,
getGoodsListApi
,
uploadImgApi
,
uploadVideoApi
,
getMerchantList
,
getZoneListApi
,
getClassifyListApi
}
src/assets/css/public.scss
View file @
c2dd634
...
...
@@ -5,6 +5,22 @@
padding
:
20px
;
}
.marketing
.wechat-container
{
width
:
375px
;
margin-right
:
45px
;
background
:
#ffffff
;
position
:
relative
;
}
.marketing
.wechat-container
.w-100-per
{
width
:
100%
;
}
.marketing
.wechat-container
.wechat-box
{
width
:
375px
;
border
:
1px
solid
#cecece
;
// width: 100%;
border-radius
:
2px
;
}
.marketing
.edit-container
{
margin-bottom
:
84px
;
}
...
...
@@ -61,6 +77,10 @@
margin-top
:
10px
;
}
.marketing
.m-t-20
{
margin-top
:
20px
;
}
.marketing
.footer
{
position
:
fixed
;
bottom
:
0
;
...
...
src/views/homeSet/index.vue
View file @
c2dd634
...
...
@@ -282,10 +282,8 @@ export default {
.home-set
.container
{
padding
:
30px
;
}
.wechat-container
{
/*
.wechat-container {
width: 375px;
/* height: 800px; */
/* margin: 30px 45px 0 60px; */
margin-right: 45px;
background: #ffffff;
position: relative;
...
...
@@ -297,7 +295,7 @@ export default {
border: 1px solid #cecece;
width: 100%;
border-radius: 2px;
}
}
*/
.home-set
.banner-upload-box
{
width
:
140px
;
margin-bottom
:
10px
;
...
...
src/views/productGroup/editProduct.vue
View file @
c2dd634
...
...
@@ -3,7 +3,117 @@
<div
class=
"edit-share marketing"
>
<div
class=
"container edit-container"
>
<p
class=
"edit-title"
>
{{
title
}}
</p>
<glsx-combi-form
class=
"edit-form-container"
ref=
"editFormRef"
labelWidth=
"140px"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"editFormData"
:formRules=
"editRule"
></glsx-combi-form>
<div
class=
"flex m-t-20"
>
<div
class=
"wechat-container"
>
<div
class=
"wechat-box"
>
<img
class=
"w-100-per"
src=
"./images/pro-header.png"
>
<!--
<div
class=
"home-banner wechant-conf-box home-bg"
style=
"border: none;margin-top: 0;"
>
<ul
ng-show=
"wechatImgList.length != 0"
class=
"home-banner-box wechant-config"
ng-style=
"
{'width':wechatImgList.length * 100 + '%'}">
<li
ng-repeat=
"item in wechatImgList"
ng-show=
"item.content"
>
<video
ng-show=
"item.resType == 3"
class=
"videoUpload"
ng-src=
"
{{
trustUrl
(
formData
.
goodsVideo
)
}}
" controls="controls">
</video>
<img
ng-show=
"item.resType == 1"
ng-src=
"
{{
item
.
content
}}
" />
</li>
</ul>
<img
ng-show=
"(wechatImgList.length == 1 && !wechatImgList[0].content) || wechatImgList.length == 0 || !wechatImgList"
style=
"width: 100%;height: 100%;"
src=
"images/upload.png"
alt=
""
>
<ul
class=
"indicator-dots-box align-center"
ng-show=
"wechatImgList[0].length != 0 && wechatImgList.length != 1"
>
<li
class=
"indicator-dots-box-radius"
ng-show=
"item.content"
ng-class=
"
{'active':$index == 0}" ng-click="bannerClick($index, 0)" ng-repeat="item in wechatImgList">
</li>
</ul>
</div>
-->
<!--
<div
class=
"wechat-box"
>
<span
ng-show=
"!specificationDetailList.length"
>
<span
class=
"price"
>
¥
{{
formData
.
retailPrice
}}
</span>
</span>
<span
ng-show=
"specificationDetailList.length"
>
<span
class=
"price"
>
¥
{{
minRetailPrice
}}
</span>
<span
ng-show=
"specificationDetailList.length > 1"
>
起
</span>
</span>
<span
class=
"old"
ng-show=
"formData.originalPrice"
>
{{
formData
.
originalPrice
}}
</span>
<p
class=
"good-name txt-ellipsis"
>
{{
formData
.
goodsName
}}
</p>
<p>
<span
class=
"txt-tips"
>
剩余:
</span>
<span
class=
"txt-tips"
style=
"margin-left: 20px;"
>
销售:0
</span>
</p>
</div>
<div
class=
"wechat-box"
>
<div
class=
"line right-arrow"
ng-if=
"nameToValSpecsList.length"
>
<span
class=
"line-label"
>
已选
</span>
<span
class=
"line-txt"
>
{{
nameToValSpecsList
[
0
].
specificationData
}}
</span>
</div>
<div
class=
"line right-arrow"
style=
"display: flex;"
>
<span
class=
"line-label"
>
配送
</span>
<div>
<div
style=
"height: 25px; line-height: 30px;"
class=
"line-txt"
>
填写地址
</div>
<div
style=
"height: 25px; line-height: 18px;"
class=
"line-txt"
>
支付后,预计48小时内发货
</div>
</div>
</div>
<div
class=
"line"
>
<span
class=
"line-label"
>
运费
</span>
<span
ng-show=
"formData.deliveryType == 1"
class=
"line-txt"
>
免运费
</span>
<span
ng-show=
"formData.deliveryType == 2"
class=
"line-txt"
>
{{
formData
.
expressFee
}}
元
</span>
</div>
</div>
<div
class=
"wechat-box"
style=
"margin-bottom: 0;"
>
<div
style=
"word-wrap: break-word;"
>
{{
formData
.
describe
}}
</div>
<div
ng-repeat=
"item in textAndput"
>
<img
ng-show=
"item.content"
ng-src=
"
{{
item
.
content
}}
">
</div>
</div>
-->
</div>
</div>
<div
class=
"home-set-form flex-grow"
>
<div
v-for=
"(item, index) in externalFormList"
:key=
"index"
>
<p
class=
"edit-sub-title"
>
{{
item
.
title
}}
</p>
<glsx-combi-form
class=
"edit-form-container"
ref=
"editFormRef"
:labelWidth=
"labelWidth"
:isBlock=
"true"
:formRef=
"item.editChildRef"
:formObj=
"editForm"
:formData=
"item.editFormData"
:formRules=
"item.editRule"
>
<template
slot=
"bannerBtn"
>
<el-button
type=
"primary"
@
click=
"handleBannerAdd"
>
新增banner
</el-button>
</
template
>
<div
:style=
"{ 'margin-left': labelWidth }"
slot=
"bannerList"
slot-scope=
"scope"
>
<div
v-for=
"(subItem, subIndex) in editForm[scope.scope.name]"
:key=
"subIndex"
class=
"flex"
>
<!-- 上传图片 -->
<div
class=
"banner-upload-box"
>
<div
class=
"p-t-12"
>
<div
class=
"flex"
>
<div
v-show=
"!subItem.bannerImg"
class=
"activity-img img-w-h"
style=
"margin-bottom: 11px;"
>
<div
class=
"add"
>
+
</div>
<span
class=
"number"
>
上传
</span>
<input
type=
"file"
style=
"opacity: 0;"
ref=
"file"
class=
"activity-img img-w-h"
accept=
"image/png, image/jpeg, image/gif, image/jpg"
@
change=
"e => handleImgChange(e, subIndex)"
/>
</div>
<div
v-show=
"!subItem.bannerImg"
>
<el-button
type=
"text"
class=
"el-icon-delete"
@
click=
"handleBannerDelete(subIndex)"
></el-button>
</div>
</div>
<span
v-show=
"subItem.bannerImg"
class=
"muti-imgs"
>
<img
class=
"img-w-h"
:src=
"subItem.bannerImg"
/>
<span
class=
"img-btns"
>
<span
class=
"btn-item"
>
<i
class=
"el-icon-delete"
@
click=
"handleImgDelete(scope.scope.name, subIndex)"
></i>
<i
class=
"el-icon-zoom-in"
@
click=
"handleImgLook(subItem.bannerImg)"
></i>
</span>
</span>
</span>
</div>
<p
class=
"edit-tips"
>
支持上传10MB以内的jpg,png,jpeg图片
</p>
</div>
<!-- 选择商品 -->
<div
v-show=
"subItem.bannerImg"
class=
"flex-grow"
>
<div>
<span>
商品链接:
</span>
<el-button
v-show=
"!subItem.goodsId"
type=
"text"
class=
"btn-link"
@
click=
"handleSinglePro(scope.scope, subIndex)"
>
选择
</el-button>
<el-button
v-show=
"subItem.goodsId"
type=
"text"
class=
"btn-link"
@
click=
"handleSinglePro(scope.scope, subIndex)"
>
更换
</el-button>
<el-button
v-show=
"subItem.goodsId"
type=
"text"
class=
"btn-link"
@
click=
"handleProDelete(subIndex)"
>
删除
</el-button>
</div>
<div
class=
"show-pro-box flex"
v-if=
"subItem.goodsId"
>
<img
class=
"img-60"
:src=
"subItem.goods.goodsImage"
>
<p
class=
"pro-txt flex-grow one-line-ellipsis"
>
{{ subItem.goods.goodsName }}
</p>
</div>
</div>
</div>
</div>
</glsx-combi-form>
</div>
</div>
<!-- <glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="140px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"></glsx-combi-form> -->
</div>
</div>
<div
class=
"footer"
:style=
"{ left: footerLeft + 'px', width: footerWidth + 'px' }"
>
<el-button
type=
"primary"
@
click=
"handleConfirm"
>
确定
</el-button>
...
...
@@ -29,57 +139,182 @@ export default {
routeInfo
:
{
// 1-新增;2-编辑;3-查看
addOrEdit
:
1
,
// 1-集团;2-门店
groupOrStore
:
''
,
id
:
''
},
editForm
:
{
// 专区类型(1发现频道,2商城专区)
zoneType
:
'2'
,
zoneName
:
''
,
zoneImg
:
''
,
merchantList
:
[]
goodsName
:
''
,
goodsImage
:
''
,
goodsDetailImageList
:
[],
goodsVideo
:
''
,
classifyIdList
:
[],
zoneId
:
''
},
editRule
:
{
zoneName
:
[{
required
:
true
,
message
:
'请输入专区名称'
,
trigger
:
'change'
}],
zoneImg
:
[{
required
:
true
,
message
:
'请选择专区图片'
,
trigger
:
'change'
}],
merchantList
:
[{
required
:
true
,
message
:
'请选择门店'
,
trigger
:
'change'
}]
},
editFormData
:
[
labelWidth
:
'110px'
,
externalFormList
:
[
{
label
:
'专区名称'
,
name
:
'zoneName'
,
width
:
'320px'
,
type
:
'input'
,
maxlength
:
20
title
:
'基本信息'
,
editChildRef
:
'editProRef1'
,
editRule
:
{
goodsName
:
[{
required
:
true
,
message
:
'请输入商品名称'
,
trigger
:
'change'
}],
goodsImage
:
[{
required
:
true
,
message
:
'请选择商品缩略图'
,
trigger
:
'change'
}],
goodsDetailImageList
:
[{
required
:
true
,
message
:
'请选择商品详图'
,
trigger
:
'change'
}],
zoneId
:
[{
required
:
true
,
message
:
'请选择关联专区'
,
trigger
:
'change'
}]
},
editFormData
:
[
{
label
:
'商品名称'
,
name
:
'goodsName'
,
type
:
'input'
,
maxlength
:
20
,
width
:
'320px'
},
{
label
:
'商品缩略图'
,
name
:
'goodsImage'
,
type
:
'upload'
,
width
:
'320px'
,
limitSize
:
10
,
maxPhotoNum
:
1
,
handleUpload
:
(
e
,
file
,
targetItem
)
=>
{
const
imgFile
=
e
.
target
.
result
const
base64
=
file
.
name
.
split
(
'.'
)[
1
]
+
'@'
+
imgFile
.
split
(
','
)[
1
]
this
.
$apis
.
common
.
uploadImgApi
({
file
:
base64
,
fileType
:
'image'
}).
then
(
res
=>
{
this
.
editForm
[
targetItem
.
name
]
=
res
this
.
$refs
.
editFormRef
.
$refs
.
editProRef1
.
validateField
(
targetItem
.
name
)
})
}
},
{
label
:
'商品详图'
,
name
:
'goodsDetailImageList'
,
type
:
'upload'
,
width
:
'100%'
,
limitSize
:
20
,
maxPhotoNum
:
10
,
handleUpload
:
(
e
,
file
,
targetItem
)
=>
{
const
imgFile
=
e
.
target
.
result
const
base64
=
file
.
name
.
split
(
'.'
)[
1
]
+
'@'
+
imgFile
.
split
(
','
)[
1
]
this
.
$apis
.
common
.
uploadImgApi
({
file
:
base64
,
fileType
:
'image'
}).
then
(
res
=>
{
this
.
editForm
[
targetItem
.
name
].
push
({
content
:
res
,
resType
:
1
,
bizType
:
1
})
this
.
$refs
.
editFormRef
.
$refs
.
editProRef1
.
validateField
(
targetItem
.
name
)
})
}
},
{
label
:
'商品视频'
,
name
:
'goodsVideo'
,
type
:
'upload'
,
uploadType
:
'video'
,
limitSize
:
50
,
maxPhotoNum
:
1
,
handleUpload
:
(
e
,
file
,
targetItem
)
=>
{
const
imgFile
=
e
.
target
.
result
const
base64
=
file
.
name
.
split
(
'.'
)[
1
]
+
'@'
+
imgFile
.
split
(
','
)[
1
]
this
.
$apis
.
common
.
uploadVideoApi
({
file
:
base64
}).
then
(
res
=>
{
this
.
editForm
[
targetItem
.
name
]
=
res
})
}
},
{
label
:
'商品分类'
,
name
:
'classifyIdList'
,
type
:
'select'
,
multiple
:
true
,
width
:
'320px'
,
optionList
:
[],
optionId
:
'id'
,
optionLabel
:
'classifyName'
,
optionsName
:
'classifyList'
},
{
label
:
'关联专区'
,
name
:
'zoneId'
,
type
:
'select'
,
width
:
'320px'
,
optionList
:
[],
optionId
:
'id'
,
optionLabel
:
'zoneName'
,
optionsName
:
'zoneList'
}
]
},
{
label
:
'专区图片'
,
name
:
'zoneImg'
,
type
:
'upload'
,
width
:
'320px'
,
limitSize
:
10
,
maxPhotoNum
:
1
,
handleUpload
:
(
e
,
file
,
targetItem
)
=>
{
const
imgFile
=
e
.
target
.
result
const
base64
=
file
.
name
.
split
(
'.'
)[
1
]
+
'@'
+
imgFile
.
split
(
','
)[
1
]
this
.
$apis
.
common
.
uploadImgApi
({
file
:
base64
,
fileType
:
'image'
}).
then
(
res
=>
{
this
.
editForm
[
targetItem
.
name
]
=
res
this
.
$refs
.
editFormRef
.
$refs
[
this
.
editChildRef
].
validateField
(
targetItem
.
name
)
})
}
title
:
'Banner管理'
,
editFormData
:
[
{
label
:
'banner图片'
,
addHtml
:
'bannerBtn'
},
{
label
:
''
,
name
:
'bannerList'
,
addHtml
:
'bannerList'
}
]
},
{
title
:
'公告管理'
,
editFormData
:
[
{
label
:
'门店公告'
,
name
:
'noticeContent'
,
type
:
'input'
,
inputType
:
'textarea'
,
width
:
'320px'
,
maxlength
:
'50'
}
]
},
{
title
:
'新车优惠政策'
,
editFormData
:
[
{
label
:
'优惠政策'
,
name
:
'police'
,
type
:
'input'
,
inputType
:
'textarea'
,
width
:
'320px'
,
maxlength
:
'300'
}
]
}
]
],
baseData
:
{
classifyList
:
[],
zoneList
:
[]
}
}
},
mounted
()
{
this
.
userInfo
=
this
.
$globalState
.
session
this
.
footerLeft
=
document
.
querySelector
(
'.base-container-right'
).
offsetLeft
this
.
footerWidth
=
document
.
documentElement
.
clientWidth
-
this
.
footerLeft
this
.
routeInfo
=
this
.
$route
.
params
this
.
title
=
this
.
titleObj
[
this
.
routeInfo
.
addOrEdit
]
this
.
getBaseDate
().
then
(()
=>
{
this
.
getOptionsList
(
0
,
'editFormData'
,
false
)
})
this
.
routeInfo
.
addOrEdit
!=
1
?
this
.
getInfo
()
:
''
},
methods
:
{
getBaseDate
()
{
return
new
Promise
(
resolve
=>
{
Promise
.
all
([
this
.
$apis
.
common
.
getClassifyListApi
({}),
this
.
$apis
.
common
.
getZoneListApi
({
zoneType
:
2
,
merchantId
:
this
.
userInfo
.
merchantId
})]).
then
(([
classify
,
zone
])
=>
{
this
.
baseData
.
classifyList
=
classify
this
.
baseData
.
zoneList
=
zone
console
.
log
(
this
.
baseData
)
resolve
()
})
})
},
getInfo
()
{
// this.$apis.zoneList.getZoneInfoApi({ id: this.routeInfo.id }).then(res => {
// this.editForm.zoneName = res.zoneName
...
...
@@ -90,6 +325,31 @@ export default {
// })
// })
},
getOptionsList
(
idx
,
formName
,
hasAll
=
true
,
refreshSigle
)
{
if
(
refreshSigle
)
{
var
item
=
this
.
externalFormList
[
idx
][
formName
].
find
(
k
=>
k
.
name
==
refreshSigle
)
var
index
=
this
.
externalFormList
[
idx
][
formName
].
findIndex
(
k
=>
k
.
name
==
refreshSigle
)
this
.
$set
(
this
.
externalFormList
[
idx
][
formName
][
index
],
'optionList'
,
this
.
$common
.
utils
.
deepClone
(
this
.
baseData
[
item
.
optionsName
]))
if
(
hasAll
&&
this
.
baseData
[
item
.
optionsName
].
length
&&
this
.
baseData
[
item
.
optionsName
][
0
][
this
.
externalFormList
[
idx
][
formName
][
index
].
optionLabel
]
!==
'全部'
)
{
const
temp
=
{}
temp
[
this
.
externalFormList
[
idx
][
formName
][
index
].
optionId
]
=
''
temp
[
this
.
externalFormList
[
idx
][
formName
][
index
].
optionLabel
]
=
'全部'
this
.
externalFormList
[
idx
][
formName
][
index
].
optionList
.
unshift
(
temp
)
}
}
else
{
this
.
externalFormList
[
idx
][
formName
].
forEach
((
item
,
index
)
=>
{
if
(
item
.
type
===
'select'
&&
this
.
baseData
[
item
.
optionsName
].
length
)
{
this
.
$set
(
this
.
externalFormList
[
idx
][
formName
][
index
],
'optionList'
,
this
.
$common
.
utils
.
deepClone
(
this
.
baseData
[
item
.
optionsName
]))
if
(
hasAll
&&
this
.
baseData
[
item
.
optionsName
].
length
&&
this
.
baseData
[
item
.
optionsName
][
0
][
this
.
externalFormList
[
idx
][
formName
][
index
].
optionLabel
]
!==
'全部'
)
{
const
temp
=
{}
temp
[
this
.
externalFormList
[
idx
][
formName
][
index
].
optionId
]
=
''
temp
[
this
.
externalFormList
[
idx
][
formName
][
index
].
optionLabel
]
=
'全部'
this
.
externalFormList
[
idx
][
formName
][
index
].
optionList
.
unshift
(
temp
)
}
}
})
}
},
handleConfirm
()
{
this
.
$refs
.
editFormRef
.
$refs
[
this
.
editChildRef
].
validate
(
valid
=>
{
if
(
valid
)
{
...
...
src/views/productGroup/images/pro-header.png
0 → 100644
View file @
c2dd634
32.2 KB
Write
Preview
Markdown
is supported
Attach a file
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 post a comment