Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-services
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 81dc9689
authored
Oct 26, 2021
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
新增/编辑直播间
1 parent
62d1b189
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
150 additions
and
79 deletions
src/api/modules/common.js
src/api/modules/liveRoom.js
src/router/index.js
src/router/routes.js
src/views/cmmodityLibrary/editProductGroup.vue
src/views/liveRoom/editLiveRoom.vue
src/views/liveRoom/liveControl.vue
src/views/liveRoom/liveRoomList.vue
src/views/liveRoom/relateStoreDialog.vue
src/api/modules/common.js
View file @
81dc968
...
...
@@ -23,4 +23,24 @@ const uploadImg = params => {
})
}
export
{
getGoodsList
,
uploadImg
}
const
getMerchantList
=
params
=>
{
params
.
method
=
`
${
defaultPath
}
get.merchant.list`
return
http
({
url
:
'rop-scrm-live/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
const
getZoneList
=
params
=>
{
params
.
method
=
`
${
defaultPath
}
get.zone.list`
return
http
({
url
:
'rop-scrm-live/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
export
{
getGoodsList
,
uploadImg
,
getMerchantList
,
getZoneList
}
src/api/modules/liveRoom.js
View file @
81dc968
import
{
http
}
from
'@/main'
const
defaultPath
=
'scrm.api.live.'
const
getLiveRoomListApi
=
params
=>
{
params
.
method
=
'scrm.api.live.live.room.list'
params
.
method
=
`
${
defaultPath
}
live.room.list`
return
http
({
url
:
'rop-scrm-live/router'
,
method
:
'GET'
,
...
...
@@ -10,4 +12,25 @@ const getLiveRoomListApi = params => {
})
}
export
{
getLiveRoomListApi
}
const
insertLiveRoomApi
=
params
=>
{
params
.
method
=
`
${
defaultPath
}
insert.live.room`
return
http
({
url
:
'rop-scrm-live/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
,
returnAll
:
true
})
}
const
getLiveRoomInfoApi
=
params
=>
{
params
.
method
=
`
${
defaultPath
}
get.live.room.by.id`
return
http
({
url
:
'rop-scrm-live/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
export
{
getLiveRoomListApi
,
insertLiveRoomApi
,
getLiveRoomInfoApi
}
src/router/index.js
View file @
81dc968
...
...
@@ -10,7 +10,7 @@ VueRouter.prototype.push = function push(location) {
function
getRoutes
(
routesData
)
{
return
routesData
.
reduce
((
routes
,
route
)
=>
{
routes
.
push
({
...
route
,
component
:
()
=>
import
(
'@/views'
+
route
.
path
+
'.vue'
)
})
routes
.
push
({
...
route
,
component
:
()
=>
import
(
'@/views'
+
route
.
com
path
+
'.vue'
)
})
return
routes
},
[])
}
...
...
src/router/routes.js
View file @
81dc968
...
...
@@ -42,7 +42,7 @@ const staticRoutes = Object.freeze([
},
{
name
:
'editLiveRoom'
,
path
:
'/liveRoom/editLiveRoom'
,
path
:
'/liveRoom/editLiveRoom
/:addOrEdit/:id
'
,
// component: () => import('@/views/liveRoom/editLiveRoom.vue'),
component
:
resolve
=>
require
([
`@/views/liveRoom/editLiveRoom.vue`
],
resolve
),
meta
:
{}
...
...
src/views/cmmodityLibrary/editProductGroup.vue
View file @
81dc968
...
...
@@ -174,8 +174,14 @@ export default {
this
.
isMutiSelectVisible
=
!
this
.
isMutiSelectVisible
},
handleProDelete
(
obj
)
{
var
idx
=
this
.
editForm
.
shopMallGoodsInfoList
.
findIndex
(
item
=>
item
.
id
==
obj
.
id
)
this
.
editForm
.
shopMallGoodsInfoList
.
splice
(
idx
,
1
)
this
.
$messageBox
.
alert
(
'是否删除该商品?'
,
'删除'
,
{
confirmButtonText
:
'确定'
,
type
:
'error'
,
callback
:
action
=>
{
var
idx
=
this
.
editForm
.
shopMallGoodsInfoList
.
findIndex
(
item
=>
item
.
id
==
obj
.
id
)
this
.
editForm
.
shopMallGoodsInfoList
.
splice
(
idx
,
1
)
}
})
},
handleMutiSelectConfirm
(
selectedProInfo
)
{
console
.
log
(
selectedProInfo
)
...
...
src/views/liveRoom/editLiveRoom.vue
View file @
81dc968
This diff is collapsed.
Click to expand it.
src/views/liveRoom/liveControl.vue
View file @
81dc968
<!-- 控制台 -->
<
template
>
<div
class=
"live-control"
>
<div
class=
"box"
>
<p
class=
"edit-title"
>
直播控制台
</p>
<div
class=
"head-box flex"
>
<img
class=
"head-img"
src=
"https://img2.baidu.com/it/u=4276914015,335466661&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500"
/>
<div>
<p>
{{
liveRoomData
.
title
}}
</p>
<p>
开播时间:
{{
liveRoomData
.
time
}}
</p>
<p>
房间号:
{{
liveRoomData
.
roomNum
}}
</p>
<p>
主播:
{{
liveRoomData
.
anchor
}}
</p>
<p>
微信号:
{{
liveRoomData
.
wechat
}}
</p>
<p
v-if=
"countDown"
>
开播倒计时:
{{
countDown
}}
</p>
<div
class=
"container edit-container"
>
<div
class=
"box"
>
<p
class=
"edit-title"
>
直播控制台
</p>
<div
class=
"head-box flex"
>
<img
class=
"head-img"
src=
"https://img2.baidu.com/it/u=4276914015,335466661&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500"
/>
<div>
<p>
{{
liveRoomData
.
title
}}
</p>
<p>
开播时间:
{{
liveRoomData
.
time
}}
</p>
<p>
房间号:
{{
liveRoomData
.
roomNum
}}
</p>
<p>
主播:
{{
liveRoomData
.
anchor
}}
</p>
<p>
微信号:
{{
liveRoomData
.
wechat
}}
</p>
<p
v-if=
"countDown"
>
开播倒计时:
{{
countDown
}}
</p>
</div>
</div>
</div>
<div
class=
"content"
>
<p
class=
"edit-sub-title"
>
直播数据
</p>
</div>
<div
class=
"content"
>
<p
class=
"edit-sub-title"
>
商品数据
</p>
<p>
累计推送次数
</p>
<p>
商品点击人数
</p>
<p>
商品点击次数
</p>
</div>
<div
class=
"content"
>
<div
class=
"flex"
style=
"justify-content: space-between;"
>
<p
class=
"edit-sub-title"
>
商品配置
</p>
<el-button
size=
"mini"
@
click=
"handleImportPro"
>
导入商品
</el-button>
<div
class=
"content"
>
<p
class=
"edit-sub-title"
>
直播数据
</p>
</div>
<div
class=
"content"
>
<p
class=
"edit-sub-title"
>
商品数据
</p>
<p>
累计推送次数
</p>
<p>
商品点击人数
</p>
<p>
商品点击次数
</p>
</div>
<div
class=
"content"
>
<div
class=
"flex"
style=
"justify-content: space-between;"
>
<p
class=
"edit-sub-title"
>
商品配置
</p>
<el-button
size=
"mini"
@
click=
"handleImportPro"
>
导入商品
</el-button>
</div>
<GLTable
ref=
"liveRoomRef"
:searchForm=
"searchConfigForm"
:tableParams=
"tableParams"
:tableData=
"tableData"
:pageConf=
"pageConf"
:beforeSearchFn=
"beforeConfigSearchFn"
>
<span
slot=
"showImg"
slot-scope=
"scope"
>
<img
style=
"width: 100px; height: 100px;"
:src=
"scope.scope.img"
/>
</span>
<span
slot=
"auth-button"
slot-scope=
"scope"
:data=
"scope.scope"
>
<el-button
type=
"text"
@
click=
"handlePush(scope.scope.id)"
>
{{
targetId
===
scope
.
scope
.
id
?
'已推送'
+
pushCountDown
+
's'
:
'推送'
}}
</el-button>
<el-button
type=
"text"
@
click=
"handleUpOrDown(scope.scope)"
>
{{
scope
.
scope
.
status
==
'1'
?
'下架'
:
'上架'
}}
</el-button>
<el-button
type=
"text"
@
click=
"handleDelete(scope.scope)"
>
删除
</el-button>
</span>
</GLTable>
</div>
<div
class=
"content"
>
<p
class=
"edit-sub-title"
>
直播设置
</p>
</div>
<GLTable
ref=
"liveRoomRef"
:searchForm=
"searchConfigForm"
:tableParams=
"tableParams"
:tableData=
"tableData"
:pageConf=
"pageConf"
:beforeSearchFn=
"beforeConfigSearchFn"
>
<span
slot=
"showImg"
slot-scope=
"scope"
>
<img
style=
"width: 100px; height: 100px;"
:src=
"scope.scope.img"
/>
</span>
<span
slot=
"auth-button"
slot-scope=
"scope"
:data=
"scope.scope"
>
<el-button
type=
"text"
@
click=
"handlePush(scope.scope.id)"
>
{{
targetId
===
scope
.
scope
.
id
?
'已推送'
+
pushCountDown
+
's'
:
'推送'
}}
</el-button>
<el-button
type=
"text"
@
click=
"handleUpOrDown(scope.scope)"
>
{{
scope
.
scope
.
status
==
'1'
?
'下架'
:
'上架'
}}
</el-button>
<el-button
type=
"text"
@
click=
"handleDelete(scope.scope)"
>
删除
</el-button>
</span>
</GLTable>
</div>
<div
class=
"content"
>
<p
class=
"edit-sub-title"
>
直播设置
</p>
</div>
<select-muti-pro-dialog
:isMutiSelectVisible=
"isMutiSelectVisible"
@
handleMutiSelectConfirm=
"handleMutiSelectConfirm"
@
handleMutiSelectClose=
"handleMutiSelectClose"
></select-muti-pro-dialog>
</div>
<select-muti-pro-dialog
:isMutiSelectVisible=
"isMutiSelectVisible"
@
handleMutiSelectConfirm=
"handleMutiSelectConfirm"
@
handleMutiSelectClose=
"handleMutiSelectClose"
></select-muti-pro-dialog>
</div>
</
template
>
...
...
src/views/liveRoom/liveRoomList.vue
View file @
81dc968
...
...
@@ -148,7 +148,11 @@ export default {
},
handleDetail
(
row
)
{
this
.
$router
.
push
({
name
:
'liveControl'
// name: 'liveControl',
path
:
'/liveroom/liveControl'
,
query
:
{
id
:
row
?
row
.
id
:
''
}
})
},
handleDelete
(
row
)
{
...
...
@@ -165,14 +169,20 @@ export default {
},
// 1-新增;2-编辑
handleEdit
(
addOrEdit
,
row
)
{
// console.log(row)
// this.$history.push('services/liveRoom/editLiveRoom', { addOrEdit: addOrEdit, row: row || {} })
// this.eventBus.$emit('editRoom', {
// addOrEdit: addOrEdit,
// id: row ? row.id : ''
// })
this
.
$router
.
push
({
// name: 'editLiveRoom',
path
:
'/liveRoom/editLiveRoom'
,
name
:
'ServicesLiveRoomEditLiveRoom'
,
params
:
{
addOrEdit
:
addOrEdit
,
row
:
row
||
{}
id
:
row
?
row
.
id
:
'-1'
}
// name: 'editLiveRoom',
// path: '/liveRoom/editLiveRoom'
})
},
handleSearch
()
{
...
...
src/views/liveRoom/relateStoreDialog.vue
View file @
81dc968
...
...
@@ -6,29 +6,29 @@
<el-col
:span=
"12"
>
<el-table
ref=
"seletingTable"
:data=
"selectingData"
height=
"464px"
class=
"table"
border
@
select=
"handleChange"
@
select-all=
"handleAll"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
:selectable=
"selectable"
></el-table-column>
<el-table-column
v-if=
"sourcePage != 'serviceStore'"
prop=
"yqMerchantName"
label=
"园区店
名称"
align=
"center"
>
<template
slot-scope=
"scope"
>
<el-table-column
prop=
"merchantName"
label=
"商户
名称"
align=
"center"
>
<
!--
<
template
slot-scope=
"scope"
>
<span
:class=
"
{ red: !scope.row.isSetUpgradeSettleRule
&&
needTip.includes(sourcePage) }">
{{
scope
.
row
.
yqMerchantName
}}
</span>
</
template
>
</
template
>
-->
</el-table-column>
<el-table-column
prop=
"merchantName"
label=
"4S店名称"
align=
"center"
>
<
!-- <
el-table-column prop="merchantName" label="4S店名称" align="center">
<template slot-scope="scope">
<span :class="{ red: !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage) }">{{ scope.row.merchantName }}</span>
<el-tooltip v-if="!scope.row.isSetUpgradeSettleRule" popper-class="tooltip-class" effect="dark" content="该门店无配置财务分润规则,无法关联!" placement="top">
<span v-if="!scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)" class="tip-icon">?</span>
</el-tooltip>
</template>
</el-table-column>
</el-table-column>
-->
</el-table>
<el-pagination
small
background
@
current-change=
"handleCurrentChange"
:current-page
.
sync=
"
currentPage
"
:page-size=
"pageSize"
layout=
"total, prev, pager, next"
:total=
"total"
></el-pagination>
<el-pagination
small
background
@
current-change=
"handleCurrentChange"
:current-page
.
sync=
"
pageNum
"
:page-size=
"pageSize"
layout=
"total, prev, pager, next"
:total=
"total"
></el-pagination>
</el-col>
<el-col
:span=
"12"
>
<el-table
:data=
"selectedData"
class=
"table"
border
height=
"464px"
>
<el-table-column
v-if=
"sourcePage != 'serviceStore'"
prop=
"yqMerchantName"
label=
"园区店
名称"
align=
"center"
></el-table-column>
<
el-table-column
prop=
"merchantName"
label=
"4S店名称"
align=
"center"
></el-table-column
>
<el-table-column
label=
"删除"
align=
"center"
width=
"50
px
"
>
<el-table-column
prop=
"merchantName"
label=
"商户
名称"
align=
"center"
></el-table-column>
<
!-- <el-table-column prop="merchantName" label="4S店名称" align="center"></el-table-column> --
>
<el-table-column
label=
"删除"
align=
"center"
width=
"50"
>
<
template
slot-scope=
"scope"
>
<el-button
class=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
type=
"text"
></el-button>
<el-button
style=
"padding: 0;"
class=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
type=
"text"
></el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -45,10 +45,10 @@ export default {
return
{
selectedData
:
[],
selectingData
:
[],
needTip
:
[
'editProduct'
],
//
needTip: ['editProduct'],
// 分页
total
:
0
,
currentPage
:
1
,
pageNum
:
1
,
pageSize
:
20
}
},
...
...
@@ -59,10 +59,10 @@ export default {
default
:
false
},
// 页面来源
sourcePage
:
{
type
:
String
,
default
:
''
},
//
sourcePage: {
//
type: String,
//
default: ''
//
},
storeApi
:
{
type
:
Function
,
default
:
()
=>
{}
...
...
@@ -94,21 +94,23 @@ export default {
methods
:
{
selectable
(
row
,
index
)
{
var
isSelect
=
row
.
hasOwnProperty
(
'beServed'
)
?
!
row
.
beServed
:
true
if
(
this
.
sourcePage
===
'editProduct'
)
{
isSelect
=
row
.
isSetUpgradeSettleRule
}
//
if (this.sourcePage === 'editProduct') {
//
isSelect = row.isSetUpgradeSettleRule
//
}
return
isSelect
},
recoverySelection
()
{
var
exitIds
=
this
.
selectedData
.
map
(
item
=>
item
.
merchant
Id
)
var
exitIds
=
this
.
selectedData
.
map
(
item
=>
item
.
merchant
No
+
''
)
this
.
selectingData
.
forEach
(
item
=>
{
exitIds
.
includes
(
item
.
merchantId
)
&&
this
.
$refs
.
seletingTable
.
toggleRowSelection
(
item
,
true
)
if
(
exitIds
.
includes
(
item
.
merchantNo
))
{
this
.
$refs
.
seletingTable
.
toggleRowSelection
(
item
,
true
)
}
})
},
getSelectingList
()
{
this
.
storeApi
({
...
this
.
storeSearchForm
,
currentPage
:
this
.
currentPage
,
pageNum
:
this
.
pageNum
,
pageSize
:
this
.
pageSize
}).
then
(
res
=>
{
this
.
selectingData
=
res
.
list
...
...
@@ -119,12 +121,12 @@ export default {
})
},
handleChange
(
selection
,
row
)
{
var
addOrDelete
=
!!
selection
.
find
(
item
=>
item
.
merchant
Id
===
row
.
merchantId
)
addOrDelete
?
this
.
selectedData
.
push
(
row
)
:
(
this
.
selectedData
=
this
.
selectedData
.
filter
(
item
=>
item
.
merchant
Id
!==
row
.
merchantId
))
var
addOrDelete
=
!!
selection
.
find
(
item
=>
item
.
merchant
No
===
row
.
merchantNo
)
addOrDelete
?
this
.
selectedData
.
push
(
row
)
:
(
this
.
selectedData
=
this
.
selectedData
.
filter
(
item
=>
item
.
merchant
No
!==
row
.
merchantNo
))
},
handleAll
(
selection
)
{
this
.
selectingData
.
forEach
(
item
=>
{
var
isExit
=
this
.
selectedData
.
findIndex
(
subItem
=>
subItem
.
merchant
Id
===
item
.
merchantId
)
var
isExit
=
this
.
selectedData
.
findIndex
(
subItem
=>
subItem
.
merchant
No
===
item
.
merchantNo
)
var
isServed
=
item
.
hasOwnProperty
(
'beServed'
)
?
item
.
beServed
:
false
if
(
selection
.
length
&&
isExit
===
-
1
&&
!
isServed
)
{
this
.
selectedData
.
push
(
item
)
...
...
@@ -134,14 +136,22 @@ export default {
})
},
handleDelete
(
row
)
{
this
.
selectedData
=
this
.
selectedData
.
filter
(
item
=>
item
.
merchant
Id
!==
row
.
merchantId
)
this
.
selectedData
=
this
.
selectedData
.
filter
(
item
=>
item
.
merchant
No
!==
row
.
merchantNo
)
this
.
$refs
.
seletingTable
.
toggleRowSelection
(
row
)
},
handleCurrentChange
(
val
)
{
this
.
currentPage
=
val
this
.
pageNum
=
val
this
.
getSelectingList
()
},
handleRelateStoreConfirm
()
{
if
(
!
this
.
selectedData
.
length
)
{
this
.
$message
({
message
:
'请选择关联门店'
,
type
:
'warning'
,
showClose
:
true
})
return
true
}
this
.
$emit
(
'handleRelateStoreConfirm'
,
this
.
selectedData
)
},
handleRelateStoreClose
()
{
...
...
@@ -155,10 +165,10 @@ export default {
margin
:
0
auto
20px
!important
;
width
:
98%
;
}
.service-store
.relateStore
.el-table
.cell
,
/*
.service-store .relateStore .el-table .cell,
.d2-form .relateStore .el-table .cell {
line-height: 26px !important;
}
}
*/
.service-store
.relateStore
.el-table--medium
td
,
.d2-form
.relateStore
.el-table--medium
td
{
padding
:
6px
8px
!important
;
...
...
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