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 4b257fd2
authored
Nov 06, 2021
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
首页设置
1 parent
ad816bf0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
338 additions
and
31 deletions
src/api/modules/common.js
src/api/modules/homeSet.js
src/assets/css/public.scss
src/components/index.js
src/components/selectMutiProDialog/index.vue
src/components/selectSingleProDialog/index.vue
src/views/homeSet/index.vue
src/views/zoneList/editZone.vue
src/api/modules/common.js
View file @
4b257fd
...
...
@@ -2,15 +2,15 @@ import { http } from '@/main'
const
defaultPath
=
'scrm.api.carlife.'
// const getGoodsList
= params => {
//
params.method = 'scrm.api.shopmall.goods.page.curMerchant'
//
return http({
//
url: 'rop-scrm-shopmall/router',
//
method: 'GET',
//
data: params,
//
sign: true
//
})
//
}
const
getGoodsListApi
=
params
=>
{
params
.
method
=
'scrm.api.shopmall.goods.page.curMerchant'
return
http
({
url
:
'rop-scrm-shopmall/router'
,
method
:
'GET'
,
data
:
params
,
sign
:
true
})
}
const
uploadImgApi
=
params
=>
{
params
.
method
=
`
${
defaultPath
}
common.uploadImg`
...
...
@@ -43,4 +43,4 @@ const getMerchantList = params => {
// })
// }
export
default
{
uploadImgApi
,
getMerchantList
}
export
default
{
getGoodsListApi
,
uploadImgApi
,
getMerchantList
}
src/api/modules/homeSet.js
View file @
4b257fd
...
...
@@ -10,4 +10,15 @@ const getHomeInfoListApi = params => {
})
}
export
default
{
getHomeInfoListApi
}
const
updateHomeApi
=
params
=>
{
params
.
method
=
'scrm.api.shopmall.homeConfig.update'
return
http
({
url
:
'rop-scrm-shopmall/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
,
returnAll
:
true
})
}
export
default
{
getHomeInfoListApi
,
updateHomeApi
}
src/assets/css/public.scss
View file @
4b257fd
...
...
@@ -51,6 +51,11 @@
height
:
60px
;
}
.marketing
.img-100
{
width
:
100px
;
height
:
100px
;
}
.marketing
.footer
{
position
:
fixed
;
bottom
:
0
;
...
...
@@ -68,6 +73,10 @@
justify-content
:
space-between
;
}
.marketing
.flex-grow
{
flex
:
1
;
}
.marketing
.edit-title
{
font-size
:
16px
;
font-weight
:
bold
;
...
...
@@ -79,22 +88,33 @@
margin
:
0
0
;
}
.
marketing
.
edit-sub-title
:
:
before
{
position
:
absolute
;
display
:
inline-block
;
content
:
''
;
height
:
18px
;
width
:
4px
;
top
:
2px
;
left
:
0
;
background-color
:
#0947C6
;
}
//
.marketing .edit-sub-title::before {
//
position: absolute;
//
display: inline-block;
//
content: '';
//
height: 18px;
//
width: 4px;
//
top: 2px;
//
left: 0;
//
background-color: #0947C6;
//
}
.marketing
.edit-sub-title
{
position
:
relative
;
font-size
:
1
6
px
;
font-size
:
1
3
px
;
font-weight
:
700
;
height
:
32px
;
line-height
:
32px
;
color
:
#333333
;
margin
:
0
0
30px
0
;
margin
-bottom
:
20px
;
padding-left
:
8px
;
background-color
:
rgba
(
242
,
242
,
242
,
1
);
}
.one-line-ellipsis
{
display
:
-
webkit-box
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
-webkit-line-clamp
:
1
;
-webkit-box-orient
:
vertical
;
}
\ No newline at end of file
src/components/index.js
View file @
4b257fd
...
...
@@ -8,8 +8,9 @@
* @FilePath: \scrm\scrm-sub-blog\src\components\index.js
*/
import
Vue
from
'vue'
// 导入权限按钮
// import _button from '@/components/glsx-button/index'
import
glsxCombiForm
from
'@/components/glsx-combi-form/index.vue'
// Vue.component('glsx-button', _button)
Vue
.
component
(
'glsx-combi-form'
,
glsxCombiForm
)
\ No newline at end of file
import
selectMutiProDialog
from
'@/components/selectMutiProDialog/index.vue'
import
selectSingleProDialog
from
'@/components/selectSingleProDialog/index.vue'
Vue
.
component
(
'glsx-combi-form'
,
glsxCombiForm
)
Vue
.
component
(
'select-muti-pro-dialog'
,
selectMutiProDialog
)
Vue
.
component
(
'select-single-pro-dialog'
,
selectSingleProDialog
)
\ No newline at end of file
src/components/selectMutiProDialog/index.vue
0 → 100644
View file @
4b257fd
<!-- 选择商品弹窗 -->
<
template
>
<glsx-dialog
class=
"muti-pro"
title=
"选择商品"
:isVisible
.
sync=
"isMutiSelectVisible"
width=
"70%"
@
confirmDialog=
"handleMutiSelectConfirm"
@
closeDialog=
"handleMutiSelectClose"
>
<GLTable
ref=
"mutiProRef"
:tableData=
"productList"
:tableParams=
"tableParams"
@
refreshTable=
"getList"
>
<span
slot=
"goodsImage"
slot-scope=
"scope"
>
<img
class=
"m-t-10 img-60"
:src=
"scope.scope.goodsImage"
/>
</span>
</GLTable>
</glsx-dialog>
</
template
>
<
script
>
// import { getGoodsList } from '@/api/modules/common'
import
glsxDialog
from
'@/components/glsx-dialog'
export
default
{
name
:
'selectMutiProDialog'
,
data
()
{
return
{
// 表格组件
// getListApi: this.$apis.common.getGoodsListApi,
productList
:
[],
// pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams
:
{
listName
:
'list'
,
// 行数据的key
mutiSelectUniqueKey
:
'id'
,
// 多选ref的名称
mutiSelectName
:
'list'
,
tableColumns
:
[
{
label
:
'商品名称'
,
prop
:
'goodsName'
},
{
label
:
'缩略图'
,
prop
:
'goodsImage'
,
addHtml
:
'goodsImage'
},
{
label
:
'价格(元)'
,
prop
:
'retailPrice'
},
{
label
:
'来源门店'
,
prop
:
'merchantName'
}
]
}
}
},
props
:
{
isMutiSelectVisible
:
{
type
:
Boolean
,
default
:
false
},
selectedProList
:
{
type
:
Array
,
default
:
()
=>
[]
}
},
components
:
{
glsxDialog
},
mounted
()
{
this
.
getList
(
true
)
},
methods
:
{
getList
(
isMounted
=
false
)
{
var
params
=
{
goodsStatus
:
1
,
goodsSource
:
1
,
pageNum
:
isMounted
?
1
:
this
.
$refs
.
mutiProRef
.
page
.
pageNum
,
pageSize
:
isMounted
?
10
:
this
.
$refs
.
mutiProRef
.
page
.
pageSize
}
var
that
=
this
this
.
$apis
.
common
.
getGoodsListApi
(
params
).
then
(
res
=>
{
// console.log(res)
this
.
productList
=
res
.
list
this
.
$refs
.
mutiProRef
.
tableTotal
=
res
.
total
this
.
productList
.
forEach
(
function
(
item
)
{
item
.
saleAmount
=
item
.
goodsStatistics
.
saleAmount
if
(
item
.
specificationDetailList
.
length
>
1
)
{
let
retailPriceList
=
item
.
specificationDetailList
.
sort
(
function
(
a
,
b
)
{
return
a
.
retailPrice
-
b
.
retailPrice
})
let
stockeList
=
item
.
specificationDetailList
.
sort
(
function
(
a
,
b
)
{
return
a
.
stock
-
b
.
stock
})
let
minRatilPrice
=
retailPriceList
[
0
].
retailPrice
/
100
let
maxRatilPrice
=
retailPriceList
[
retailPriceList
.
length
-
1
].
retailPrice
/
100
let
minStock
=
stockeList
[
0
].
stock
let
maxStock
=
stockeList
[
stockeList
.
length
-
1
].
stock
item
.
retailPrice
=
minRatilPrice
==
maxRatilPrice
?
minRatilPrice
.
toFixed
(
2
)
:
minRatilPrice
.
toFixed
(
2
)
+
'-'
+
maxRatilPrice
.
toFixed
(
2
)
item
.
minRatilPrice
=
minRatilPrice
.
toFixed
(
2
)
item
.
goodsStock
=
minStock
==
maxStock
?
minStock
:
minStock
+
'-'
+
maxStock
}
else
if
(
item
.
specificationDetailList
.
length
==
1
)
{
item
.
retailPrice
=
(
item
.
specificationDetailList
[
0
].
retailPrice
/
100
).
toFixed
(
2
)
item
.
minRatilPrice
=
item
.
retailPrice
item
.
goodsStock
=
item
.
specificationDetailList
[
0
].
stock
}
else
{
item
.
retailPrice
=
(
item
.
retailPrice
/
100
).
toFixed
(
2
)
item
.
minRatilPrice
=
item
.
retailPrice
}
})
this
.
recoverySelected
()
})
},
recoverySelected
()
{
if
(
this
.
selectedProList
.
length
)
{
this
.
selectedProList
.
forEach
(
row
=>
{
this
.
$refs
.
mutiProRef
.
$refs
[
this
.
tableParams
.
mutiSelectName
+
'MutiTable'
].
toggleRowSelection
(
row
)
})
}
},
handleMutiSelectConfirm
()
{
var
selectedData
=
this
.
$refs
.
mutiProRef
.
mutiSelectArr
[
this
.
tableParams
.
mutiSelectName
]
console
.
log
(
selectedData
)
this
.
$emit
(
'handleMutiSelectConfirm'
,
selectedData
)
},
handleMutiSelectClose
()
{
this
.
$emit
(
'handleMutiSelectClose'
)
}
}
}
</
script
>
<
style
>
.muti-pro
.m-t-10
{
margin-top
:
10px
;
}
</
style
>
src/components/selectSingleProDialog/index.vue
0 → 100644
View file @
4b257fd
<!-- 选择商品 - 单选 -->
<
template
>
<glsx-dialog
class=
"single-pro"
title=
"选择商品"
:isVisible
.
sync=
"isSingleSelectVisible"
width=
"900px"
@
confirmDialog=
"handleSingleSelectConfirm"
@
closeDialog=
"handleSingleSelectClose"
>
<el-radio-group
v-model=
"infoId"
>
<el-radio
class=
"pro-box"
v-for=
"item in productList"
:key=
"item.id"
:label=
"item.id"
>
<img
:src=
"item.goodsImage"
/>
<div
class=
"txt-box"
>
<p
:title=
"item.goodsName"
class=
"ellipsis"
>
{{
item
.
goodsName
}}
</p>
<p
class=
"f-s-12"
>
销量:
{{
item
.
saleAmount
}}
</p>
<p
class=
"f-s-12"
>
库存:
{{
item
.
goodsStock
}}
</p>
<p
class=
"f-s-12"
>
零售价:
{{
item
.
retailPrice
}}
</p>
<p
:title=
"item.merchantName"
class=
"ellipsis f-s-12"
>
门店名称:
{{
item
.
merchantName
}}
</p>
</div>
</el-radio>
</el-radio-group>
</glsx-dialog>
</
template
>
<
script
>
// import { getGoodsList } from '@/api/modules/common'
import
glsxDialog
from
'@/components/glsx-dialog'
export
default
{
name
:
'selectSingleProDialog'
,
data
()
{
return
{
infoId
:
''
,
minRatilPrice
:
''
,
productList
:
[]
}
},
props
:
{
isSingleSelectVisible
:
{
type
:
Boolean
,
default
:
false
},
selectedProInfo
:
{
type
:
Object
,
default
:
()
=>
{}
}
},
components
:
{
glsxDialog
},
computed
:
{},
mounted
()
{
this
.
infoId
=
this
.
selectedProInfo
.
id
this
.
getList
()
},
methods
:
{
getList
()
{
var
params
=
{
goodsStatus
:
1
,
goodsSource
:
1
,
pageNum
:
1
,
pageSize
:
100000
}
var
that
=
this
this
.
$apis
.
common
.
getGoodsListApi
(
params
).
then
(
res
=>
{
// console.log(res)
this
.
productList
=
res
.
list
this
.
productList
.
forEach
(
function
(
item
)
{
item
.
saleAmount
=
item
.
goodsStatistics
.
saleAmount
if
(
item
.
specificationDetailList
.
length
>
1
)
{
let
retailPriceList
=
item
.
specificationDetailList
.
sort
(
function
(
a
,
b
)
{
return
a
.
retailPrice
-
b
.
retailPrice
})
let
stockeList
=
item
.
specificationDetailList
.
sort
(
function
(
a
,
b
)
{
return
a
.
stock
-
b
.
stock
})
let
minRatilPrice
=
retailPriceList
[
0
].
retailPrice
/
100
let
maxRatilPrice
=
retailPriceList
[
retailPriceList
.
length
-
1
].
retailPrice
/
100
let
minStock
=
stockeList
[
0
].
stock
let
maxStock
=
stockeList
[
stockeList
.
length
-
1
].
stock
item
.
retailPrice
=
minRatilPrice
==
maxRatilPrice
?
minRatilPrice
.
toFixed
(
2
)
:
minRatilPrice
.
toFixed
(
2
)
+
'-'
+
maxRatilPrice
.
toFixed
(
2
)
item
.
minRatilPrice
=
minRatilPrice
.
toFixed
(
2
)
item
.
goodsStock
=
minStock
==
maxStock
?
minStock
:
minStock
+
'-'
+
maxStock
}
else
if
(
item
.
specificationDetailList
.
length
==
1
)
{
item
.
retailPrice
=
(
item
.
specificationDetailList
[
0
].
retailPrice
/
100
).
toFixed
(
2
)
item
.
minRatilPrice
=
item
.
retailPrice
item
.
goodsStock
=
item
.
specificationDetailList
[
0
].
stock
}
else
{
item
.
retailPrice
=
(
item
.
retailPrice
/
100
).
toFixed
(
2
)
item
.
minRatilPrice
=
item
.
retailPrice
}
})
})
},
handleSingleSelectConfirm
()
{
if
(
!
this
.
infoId
)
{
this
.
$message
.
error
(
'请选择商品'
)
return
true
}
var
selectInfo
=
this
.
productList
.
find
(
item
=>
item
.
id
===
this
.
infoId
)
this
.
$emit
(
'handleSingleSelectConfirm'
,
selectInfo
)
},
handleSingleSelectClose
()
{
this
.
$emit
(
'handleSingleSelectClose'
)
}
}
}
</
script
>
<
style
>
.single-pro
.pro-box
{
width
:
202px
;
border
:
1px
solid
#cccccc
;
margin
:
0
10px
10px
0
;
}
.single-pro
p
{
margin
:
0
0
8px
0
;
}
.single-pro
.f-s-12
{
font-size
:
12px
;
}
.single-pro
.pro-box
img
{
width
:
202px
;
height
:
202px
;
}
.single-pro
.el-radio__input
{
position
:
absolute
;
top
:
8px
;
left
:
8px
;
}
.single-pro
.el-radio__label
{
padding
:
0
;
}
.single-pro
.txt-box
{
padding
:
10px
10px
0
;
color
:
#666666
;
}
.single-pro
.ellipsis
{
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
</
style
>
src/views/homeSet/index.vue
View file @
4b257fd
This diff is collapsed.
Click to expand it.
src/views/zoneList/editZone.vue
View file @
4b257fd
...
...
@@ -4,13 +4,13 @@
<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"
>
<div
slot=
"selectMerchant"
slot-scope=
"
item
"
class=
"select-merchant"
>
<el-button
type=
"primary"
@
click=
"handleRelateStoreClose(
item
)"
>
{{
editForm
.
merchantList
.
length
?
'更换'
:
'请选择'
}}
</el-button>
<div
slot=
"selectMerchant"
slot-scope=
"
scope
"
class=
"select-merchant"
>
<el-button
type=
"primary"
@
click=
"handleRelateStoreClose(
scope
)"
>
{{
editForm
.
merchantList
.
length
?
'更换'
:
'请选择'
}}
</el-button>
</div>
<div
slot=
"merchantTable"
class=
"select-merchant"
>
<GLTable
v-show=
"editForm.merchantList.length"
ref=
"warehousListRef"
:hasPage=
"false"
:tableParams=
"tableParams"
:tableData=
"editForm.merchantList"
>
<span
slot=
"auth-button"
slot-scope=
"
item
"
>
<el-button
type=
"text"
@
click=
"handleMerchantDelete(
item
)"
>
删除
</el-button>
<span
slot=
"auth-button"
slot-scope=
"
scope
"
>
<el-button
type=
"text"
@
click=
"handleMerchantDelete(
scope
)"
>
删除
</el-button>
</span>
</GLTable>
</div>
...
...
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