Commit 81dc9689 by cwq0219

新增/编辑直播间

1 parent 62d1b189
...@@ -23,4 +23,24 @@ const uploadImg = params => { ...@@ -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 }
import { http } from '@/main' import { http } from '@/main'
const defaultPath = 'scrm.api.live.'
const getLiveRoomListApi = params => { const getLiveRoomListApi = params => {
params.method = 'scrm.api.live.live.room.list' params.method = `${defaultPath}live.room.list`
return http({ return http({
url: 'rop-scrm-live/router', url: 'rop-scrm-live/router',
method: 'GET', method: 'GET',
...@@ -10,4 +12,25 @@ const getLiveRoomListApi = params => { ...@@ -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 }
...@@ -10,7 +10,7 @@ VueRouter.prototype.push = function push(location) { ...@@ -10,7 +10,7 @@ VueRouter.prototype.push = function push(location) {
function getRoutes(routesData) { function getRoutes(routesData) {
return routesData.reduce((routes, route) => { return routesData.reduce((routes, route) => {
routes.push({ ...route, component: () => import('@/views' + route.path + '.vue') }) routes.push({ ...route, component: () => import('@/views' + route.compath + '.vue') })
return routes return routes
}, []) }, [])
} }
......
...@@ -42,7 +42,7 @@ const staticRoutes = Object.freeze([ ...@@ -42,7 +42,7 @@ const staticRoutes = Object.freeze([
}, },
{ {
name: 'editLiveRoom', name: 'editLiveRoom',
path: '/liveRoom/editLiveRoom', path: '/liveRoom/editLiveRoom/:addOrEdit/:id',
// component: () => import('@/views/liveRoom/editLiveRoom.vue'), // component: () => import('@/views/liveRoom/editLiveRoom.vue'),
component: resolve => require([`@/views/liveRoom/editLiveRoom.vue`], resolve), component: resolve => require([`@/views/liveRoom/editLiveRoom.vue`], resolve),
meta: {} meta: {}
......
...@@ -174,8 +174,14 @@ export default { ...@@ -174,8 +174,14 @@ export default {
this.isMutiSelectVisible = !this.isMutiSelectVisible this.isMutiSelectVisible = !this.isMutiSelectVisible
}, },
handleProDelete(obj) { handleProDelete(obj) {
var idx = this.editForm.shopMallGoodsInfoList.findIndex(item => item.id == obj.id) this.$messageBox.alert('是否删除该商品?', '删除', {
this.editForm.shopMallGoodsInfoList.splice(idx, 1) confirmButtonText: '确定',
type: 'error',
callback: action => {
var idx = this.editForm.shopMallGoodsInfoList.findIndex(item => item.id == obj.id)
this.editForm.shopMallGoodsInfoList.splice(idx, 1)
}
})
}, },
handleMutiSelectConfirm(selectedProInfo) { handleMutiSelectConfirm(selectedProInfo) {
console.log(selectedProInfo) console.log(selectedProInfo)
......
<!-- 控制台 --> <!-- 控制台 -->
<template> <template>
<div class="live-control"> <div class="live-control">
<div class="box"> <div class="container edit-container">
<p class="edit-title">直播控制台</p> <div class="box">
<div class="head-box flex"> <p class="edit-title">直播控制台</p>
<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 class="head-box flex">
<div> <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" />
<p>{{ liveRoomData.title }}</p> <div>
<p>开播时间:{{ liveRoomData.time }}</p> <p>{{ liveRoomData.title }}</p>
<p>房间号:{{ liveRoomData.roomNum }}</p> <p>开播时间:{{ liveRoomData.time }}</p>
<p>主播:{{ liveRoomData.anchor }}</p> <p>房间号:{{ liveRoomData.roomNum }}</p>
<p>微信号:{{ liveRoomData.wechat }}</p> <p>主播:{{ liveRoomData.anchor }}</p>
<p v-if="countDown">开播倒计时:{{ countDown }}</p> <p>微信号:{{ liveRoomData.wechat }}</p>
<p v-if="countDown">开播倒计时:{{ countDown }}</p>
</div>
</div> </div>
</div> <div class="content">
<div class="content"> <p class="edit-sub-title">直播数据</p>
<p class="edit-sub-title">直播数据</p> </div>
</div> <div class="content">
<div class="content"> <p class="edit-sub-title">商品数据</p>
<p class="edit-sub-title">商品数据</p> <p>累计推送次数</p>
<p>累计推送次数</p> <p>商品点击人数</p>
<p>商品点击人数</p> <p>商品点击次数</p>
<p>商品点击次数</p> </div>
</div> <div class="content">
<div class="content"> <div class="flex" style="justify-content: space-between;">
<div class="flex" style="justify-content: space-between;"> <p class="edit-sub-title">商品配置</p>
<p class="edit-sub-title">商品配置</p> <el-button size="mini" @click="handleImportPro">导入商品</el-button>
<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> </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> </div>
<select-muti-pro-dialog :isMutiSelectVisible="isMutiSelectVisible" @handleMutiSelectConfirm="handleMutiSelectConfirm" @handleMutiSelectClose="handleMutiSelectClose"></select-muti-pro-dialog>
</div> </div>
<select-muti-pro-dialog :isMutiSelectVisible="isMutiSelectVisible" @handleMutiSelectConfirm="handleMutiSelectConfirm" @handleMutiSelectClose="handleMutiSelectClose"></select-muti-pro-dialog>
</div> </div>
</template> </template>
......
...@@ -148,7 +148,11 @@ export default { ...@@ -148,7 +148,11 @@ export default {
}, },
handleDetail(row) { handleDetail(row) {
this.$router.push({ this.$router.push({
name: 'liveControl' // name: 'liveControl',
path: '/liveroom/liveControl',
query: {
id: row ? row.id : ''
}
}) })
}, },
handleDelete(row) { handleDelete(row) {
...@@ -165,14 +169,20 @@ export default { ...@@ -165,14 +169,20 @@ export default {
}, },
// 1-新增;2-编辑 // 1-新增;2-编辑
handleEdit(addOrEdit, row) { handleEdit(addOrEdit, row) {
// console.log(row)
// this.$history.push('services/liveRoom/editLiveRoom', { addOrEdit: addOrEdit, row: row || {} }) // this.$history.push('services/liveRoom/editLiveRoom', { addOrEdit: addOrEdit, row: row || {} })
// this.eventBus.$emit('editRoom', {
// addOrEdit: addOrEdit,
// id: row ? row.id : ''
// })
this.$router.push({ this.$router.push({
// name: 'editLiveRoom', name: 'ServicesLiveRoomEditLiveRoom',
path: '/liveRoom/editLiveRoom',
params: { params: {
addOrEdit: addOrEdit, addOrEdit: addOrEdit,
row: row || {} id: row ? row.id : '-1'
} }
// name: 'editLiveRoom',
// path: '/liveRoom/editLiveRoom'
}) })
}, },
handleSearch() { handleSearch() {
......
...@@ -6,29 +6,29 @@ ...@@ -6,29 +6,29 @@
<el-col :span="12"> <el-col :span="12">
<el-table ref="seletingTable" :data="selectingData" height="464px" class="table" border @select="handleChange" @select-all="handleAll"> <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 type="selection" width="55" align="center" :selectable="selectable"></el-table-column>
<el-table-column v-if="sourcePage != 'serviceStore'" prop="yqMerchantName" label="园区店名称" align="center"> <el-table-column prop="merchantName" label="商户名称" align="center">
<template slot-scope="scope"> <!-- <template slot-scope="scope">
<span :class="{ red: !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage) }">{{ scope.row.yqMerchantName }}</span> <span :class="{ red: !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage) }">{{ scope.row.yqMerchantName }}</span>
</template> </template> -->
</el-table-column> </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"> <template slot-scope="scope">
<span :class="{ red: !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage) }">{{ scope.row.merchantName }}</span> <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"> <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> <span v-if="!scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)" class="tip-icon">?</span>
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column> -->
</el-table> </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>
<el-col :span="12"> <el-col :span="12">
<el-table :data="selectedData" class="table" border height="464px"> <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="商户名称" align="center"></el-table-column>
<el-table-column prop="merchantName" label="4S店名称" align="center"></el-table-column> <!-- <el-table-column prop="merchantName" label="4S店名称" align="center"></el-table-column> -->
<el-table-column label="删除" align="center" width="50px"> <el-table-column label="删除" align="center" width="50">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -45,10 +45,10 @@ export default { ...@@ -45,10 +45,10 @@ export default {
return { return {
selectedData: [], selectedData: [],
selectingData: [], selectingData: [],
needTip: ['editProduct'], // needTip: ['editProduct'],
// 分页 // 分页
total: 0, total: 0,
currentPage: 1, pageNum: 1,
pageSize: 20 pageSize: 20
} }
}, },
...@@ -59,10 +59,10 @@ export default { ...@@ -59,10 +59,10 @@ export default {
default: false default: false
}, },
// 页面来源 // 页面来源
sourcePage: { // sourcePage: {
type: String, // type: String,
default: '' // default: ''
}, // },
storeApi: { storeApi: {
type: Function, type: Function,
default: () => {} default: () => {}
...@@ -94,21 +94,23 @@ export default { ...@@ -94,21 +94,23 @@ export default {
methods: { methods: {
selectable(row, index) { selectable(row, index) {
var isSelect = row.hasOwnProperty('beServed') ? !row.beServed : true var isSelect = row.hasOwnProperty('beServed') ? !row.beServed : true
if (this.sourcePage === 'editProduct') { // if (this.sourcePage === 'editProduct') {
isSelect = row.isSetUpgradeSettleRule // isSelect = row.isSetUpgradeSettleRule
} // }
return isSelect return isSelect
}, },
recoverySelection() { recoverySelection() {
var exitIds = this.selectedData.map(item => item.merchantId) var exitIds = this.selectedData.map(item => item.merchantNo + '')
this.selectingData.forEach(item => { 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() { getSelectingList() {
this.storeApi({ this.storeApi({
...this.storeSearchForm, ...this.storeSearchForm,
currentPage: this.currentPage, pageNum: this.pageNum,
pageSize: this.pageSize pageSize: this.pageSize
}).then(res => { }).then(res => {
this.selectingData = res.list this.selectingData = res.list
...@@ -119,12 +121,12 @@ export default { ...@@ -119,12 +121,12 @@ export default {
}) })
}, },
handleChange(selection, row) { handleChange(selection, row) {
var addOrDelete = !!selection.find(item => item.merchantId === row.merchantId) var addOrDelete = !!selection.find(item => item.merchantNo === row.merchantNo)
addOrDelete ? this.selectedData.push(row) : (this.selectedData = this.selectedData.filter(item => item.merchantId !== row.merchantId)) addOrDelete ? this.selectedData.push(row) : (this.selectedData = this.selectedData.filter(item => item.merchantNo !== row.merchantNo))
}, },
handleAll(selection) { handleAll(selection) {
this.selectingData.forEach(item => { this.selectingData.forEach(item => {
var isExit = this.selectedData.findIndex(subItem => subItem.merchantId === item.merchantId) var isExit = this.selectedData.findIndex(subItem => subItem.merchantNo === item.merchantNo)
var isServed = item.hasOwnProperty('beServed') ? item.beServed : false var isServed = item.hasOwnProperty('beServed') ? item.beServed : false
if (selection.length && isExit === -1 && !isServed) { if (selection.length && isExit === -1 && !isServed) {
this.selectedData.push(item) this.selectedData.push(item)
...@@ -134,14 +136,22 @@ export default { ...@@ -134,14 +136,22 @@ export default {
}) })
}, },
handleDelete(row) { handleDelete(row) {
this.selectedData = this.selectedData.filter(item => item.merchantId !== row.merchantId) this.selectedData = this.selectedData.filter(item => item.merchantNo !== row.merchantNo)
this.$refs.seletingTable.toggleRowSelection(row) this.$refs.seletingTable.toggleRowSelection(row)
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.currentPage = val this.pageNum = val
this.getSelectingList() this.getSelectingList()
}, },
handleRelateStoreConfirm() { handleRelateStoreConfirm() {
if (!this.selectedData.length) {
this.$message({
message: '请选择关联门店',
type: 'warning',
showClose: true
})
return true
}
this.$emit('handleRelateStoreConfirm', this.selectedData) this.$emit('handleRelateStoreConfirm', this.selectedData)
}, },
handleRelateStoreClose() { handleRelateStoreClose() {
...@@ -155,10 +165,10 @@ export default { ...@@ -155,10 +165,10 @@ export default {
margin: 0 auto 20px !important; margin: 0 auto 20px !important;
width: 98%; width: 98%;
} }
.service-store .relateStore .el-table .cell, /* .service-store .relateStore .el-table .cell,
.d2-form .relateStore .el-table .cell { .d2-form .relateStore .el-table .cell {
line-height: 26px !important; line-height: 26px !important;
} } */
.service-store .relateStore .el-table--medium td, .service-store .relateStore .el-table--medium td,
.d2-form .relateStore .el-table--medium td { .d2-form .relateStore .el-table--medium td {
padding: 6px 8px !important; padding: 6px 8px !important;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!