Commit 7eb16e57 by cwq0219

商品组,直播成员

1 parent deabf2f5
......@@ -12,6 +12,17 @@ const getWarehousListApi = params => {
})
}
const auditGoodApi = params => {
params.method = `${defaultPath}audit.goods`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const getGoodInfoApi = params => {
params.method = `${defaultPath}get.good.by.id`
return http({
......@@ -22,6 +33,16 @@ const getGoodInfoApi = params => {
})
}
const getGoodGroupInfoApi = params => {
params.method = `${defaultPath}get.good.group.by.id`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true
})
}
const insertGoodApi = params => {
params.method = `${defaultPath}insert.good`
return http({
......@@ -33,4 +54,15 @@ const insertGoodApi = params => {
})
}
export { getWarehousListApi, getGoodInfoApi, insertGoodApi }
const insertGoodGroupApi = params => {
params.method = `${defaultPath}insert.good.group`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export { getWarehousListApi, auditGoodApi, getGoodInfoApi, getGoodGroupInfoApi, insertGoodApi, insertGoodGroupApi }
import { http } from '@/main'
const defaultPath = 'scrm.api.live.'
const getMerberList = params => {
params.method = `${defaultPath}get.member.list`
return http({
url: 'rop-scrm-live/router',
method: 'GET',
data: params,
sign: true
})
}
export { getMerberList }
.container {
.live-room .container {
background: #FFFFFF;
margin: 20px 40px;
padding: 15px 20px;
box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.10);
}
img {
.live-room .img-60 {
width: 60px;
height: 60px;
}
.edit-container {
.live-room .edit-container {
margin: 20px 40px 84px;
}
.footer {
.live-room .footer {
position: absolute;
bottom: 0;
width: 100%;
......@@ -22,14 +22,15 @@ img {
text-align: center;
line-height: 64px;
background: #FFFFFF;
z-index: 999;
}
.flex {
.live-room .flex {
display: flex;
justify-content: space-between;
}
.edit-title {
.live-room .edit-title {
font-size: 16px;
font-weight: bold;
height: 48px;
......@@ -40,7 +41,7 @@ img {
margin: 0 0;
}
.edit-sub-title::before {
.live-room .edit-sub-title::before {
position: absolute;
display: inline-block;
content: '';
......@@ -51,7 +52,7 @@ img {
background-color: #0947C6;
}
.edit-sub-title {
.live-room .edit-sub-title {
position: relative;
font-size: 16px;
font-weight: 700;
......@@ -60,30 +61,30 @@ img {
padding-left: 8px;
}
table {
width: 98%;
color: #666666;
border: 1px solid #e5e6e7;
border-width: 1px 0 0 1px;
}
// .live-room table {
// width: 98%;
// color: #666666;
// border: 1px solid #e5e6e7;
// border-width: 1px 0 0 1px;
// }
table tr {
height: 30px;
// line-height: 30px;
}
// .live-room table tr {
// height: 30px;
// // line-height: 30px;
// }
table th,
table td {
font-size: 12px;
font-weight: normal;
padding: 0px 10px;
border: 1px solid #e5e6e7;
border-width: 0px 1px 1px 0px;
border-spacing: 0;
text-align: center;
vertical-align: middle;
}
// .live-room table th,
// .live-room table td {
// font-size: 12px;
// font-weight: normal;
// padding: 0px 10px;
// border: 1px solid #e5e6e7;
// border-width: 0px 1px 1px 0px;
// border-spacing: 0;
// text-align: center;
// vertical-align: middle;
// }
table td {
min-width: 50px;
}
\ No newline at end of file
// .live-room table td {
// min-width: 50px;
// }
\ No newline at end of file
......@@ -27,8 +27,7 @@ function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, max
}
}
const liveStatusList = [
{
const liveStatusList = [{
confId: '101',
confName: '直播中'
},
......@@ -58,4 +57,22 @@ const liveStatusList = [
}
]
export { limitPrice, liveStatusList }
const auditStatusList = [{
confId: 0,
confName: '未审核'
},
{
confId: 1,
confName: '审核中'
},
{
confId: 2,
confName: '审核通过'
},
{
confId: 3,
confName: '审核失败'
}
]
export { limitPrice, liveStatusList, auditStatusList }
\ No newline at end of file
......@@ -62,10 +62,12 @@
</el-upload> -->
<template v-else-if="item.type === 'upload'">
<p class="photo-top-tips">{{ item.topTips }}</p>
<div v-if="Array.isArray(formObj[item.name]) ? (formObj[item.name].length < item.maxPhotoNum) : !formObj[item.name]" class="activity-img">
<div class="add">+</div>
<span class="number">{{ formObj[item.name].length }} / {{ item.maxPhotoNum }}</span>
<input type="file" style="opacity: 0;" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleImgChange(e, item)">
<div v-if="!item.isDisabled">
<div v-if="Array.isArray(formObj[item.name]) ? (formObj[item.name].length < item.maxPhotoNum) : !formObj[item.name]" class="activity-img img-w-h">
<div class="add">+</div>
<span class="number">{{ formObj[item.name].length }} / {{ item.maxPhotoNum }}</span>
<input type="file" style="opacity: 0;" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleImgChange(e, item)">
</div>
</div>
<template>
<div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length : formObj[item.name]">
......@@ -74,7 +76,7 @@
<img class="img-w-h" :src="subItem.content" />
<span class="img-btns">
<span class="btn-item">
<i class="el-icon-delete" @click="handleImgDelete(item, subIndex)"></i>
<i v-show="!item.isDisabled" class="el-icon-delete" @click="handleImgDelete(item, subIndex)"></i>
<i class="el-icon-zoom-in" @click="handleImgLook(subItem.content)"></i>
</span>
</span>
......@@ -84,7 +86,7 @@
<img class="img-w-h" :src="formObj[item.name]" />
<span class="img-btns">
<span class="btn-item">
<i class="el-icon-delete" @click="handleImgDelete(item)"></i>
<i v-show="!item.isDisabled" class="el-icon-delete" @click="handleImgDelete(item)"></i>
<i class="el-icon-zoom-in" @click="handleImgLook(formObj[item.name])"></i>
</span>
</span>
......@@ -169,10 +171,14 @@ export default {
handleImgChange(e, targetItem) {
var reader = new FileReader()
var file = e.srcElement.files[0]
const limitSize = targetItem.limitSize || 10
const isType = ['image/jpeg', 'image/png', 'image/jpg'].includes(file.type)
// console.log(file)
// 默认1MB
const limitSize = targetItem.limitSize || 1
const isLt = file.size / 1024 / 1024 < limitSize
const isType = ['image/jpeg', 'image/png', 'image/jpg'].includes(file.type)
const maxPhotoNum = targetItem.maxPhotoNum || 1
const wdithLt = targetItem.wdithLt || 300
const heightLt = targetItem.heightLt || 300
if (maxPhotoNum == this.formObj[targetItem.name].length) {
this.$message.error('只能上传' + maxPhotoNum + '张图片')
return true
......@@ -187,7 +193,17 @@ export default {
}
reader.readAsDataURL(file)
reader.onload = e => {
targetItem.handleUpload(e, file, targetItem)
var image = new Image()
image.src = e.target.result
image.onload = () => {
var imgWidth = image.width
var imgHeight = image.height
if (imgWidth > wdithLt || imgHeight > heightLt) {
this.$message.error('图片尺寸最大为'+ wdithLt +'像素*' + heightLt + '像素')
} else {
targetItem.handleUpload(e, file, targetItem)
}
}
}
},
// 图片删除
......
<!-- 商品库 -->
<template>
<div class="container">
<el-tabs v-model="activeName" type="card" @tab-click="handleTabClick">
<el-tab-pane label="未入库" name="noWarehous">
<warehous-list></warehous-list>
</el-tab-pane>
<el-tab-pane label="已入库" name="warehousing">
<warehousing-list></warehousing-list>
</el-tab-pane>
</el-tabs>
<div class="live-room">
<div class="container">
<el-tabs v-model="activeName" type="card" @tab-click="handleTabClick">
<el-tab-pane label="未入库" name="noWarehous">
<warehous-list></warehous-list>
</el-tab-pane>
<el-tab-pane label="已入库" name="warehousing">
<warehousing-list></warehousing-list>
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
......
<!-- 添加商品 -->
<template>
<div class="edit-pro">
<div class="edit-pro live-room">
<div class="container edit-container">
<p class="edit-title">{{ routeInfo.addOrEdit == 1 ? '添加商品' : '编辑商品' }}</p>
<p class="edit-title">{{ title }}</p>
<glsx-combi-form ref="editFormRef" labelWidth="140px" :isBlock="isBlock" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="selectSinglePro" slot-scope="item" class="select-pro">
<el-button type="text" @click="handleSinglePro(item)">{{ selectedProInfo.id ? '更换' : '请选择' }}</el-button>
<el-button v-show="routeInfo.addOrEdit != 3" type="text" @click="handleSinglePro(item)">{{ selectedProInfo.id ? '更换' : '请选择' }}</el-button>
</div>
<div slot="proTable" class="select-pro">
<GLTable v-show="selectedProInfoList.length" ref="warehousListRef" :hasPage="hasPage" :searchForm="searchForm" :tableParams="tableParams" :tableData="selectedProInfoList">
<span slot="goodsImage" slot-scope="scope">
<img class="m-t-10" :src="scope.scope.goodsImage" />
<img class="m-t-10 img-60" :src="scope.scope.goodsImage" />
</span>
<span slot="price">
<el-input placeholder="请输入" v-model="editForm.price"><template slot="append">元</template></el-input>
<el-input :disabled="routeInfo.addOrEdit == 3" placeholder="请输入" v-model="editForm.price"><template slot="append">元</template></el-input>
</span>
<span slot="auth-button">
<el-button type="text" @click="handleProDelete()">删除</el-button>
</span>
</GLTable>
<!-- <table v-show="Object.keys(selectedProInfoList).length" cellpadding="0" cellspacing="0" class="table-block">
<tr>
<td>商品图片</td>
<td>商品名称</td>
<td>商品价格</td>
<td>来源门店</td>
</tr>
<tr>
<td><img :src="selectedProInfoList.goodsImage" /></td>
<td>{{ selectedProInfoList.goodsName }}</td>
<td>{{ selectedProInfoList.retailPrice }}</td>
<td>{{ selectedProInfoList.merchantName }}</td>
</tr>
</table> -->
</div>
</glsx-combi-form>
<p>直播价表示直播开始时,用户购买的实际支付价格,直播结束时恢复原价</p>
<select-single-pro-dialog v-if="isSingleSelectVisible" :isSingleSelectVisible="isSingleSelectVisible" :selectedProInfo="selectedProInfo" @handleSingleSelectConfirm="handleSingleSelectConfirm" @handleSingleSelectClose="handleSingleSelectClose"></select-single-pro-dialog>
</div>
<div class="footer">
<el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button v-show="routeInfo.addOrEdit != 3" type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button>
</div>
</div>
......@@ -57,10 +43,15 @@ export default {
data() {
return {
title: '添加商品',
titleObj: {
1: '新增商品',
2: '编辑商品',
3: '查看商品'
},
isBlock: true,
editChildRef: 'editChildRef',
routeInfo: {
// 1-新增;2-编辑
// 1-新增;2-编辑;3-查看
addOrEdit: 1,
id: ''
},
......@@ -84,6 +75,7 @@ export default {
name: 'coverImgUrl',
type: 'upload',
// limitSize: 1,
isDisabled: false,
maxPhotoNum: 1,
tips: '建议尺寸:300像素 * 300像素,图片大小不得超过1M',
handleUpload: (e, file, targetItem) => {
......@@ -100,6 +92,7 @@ export default {
name: 'name',
width: '480px',
type: 'input',
isDisabled: false,
maxlength: 20
},
{
......@@ -162,7 +155,11 @@ export default {
mounted() {
this.routeInfo = this.$route.query
this.routeInfo.addOrEdit == 2 ? this.getInfo() : ''
this.title = this.titleObj[this.routeInfo.addOrEdit]
this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
this.editFormData[0].isDisabled = this.routeInfo.addOrEdit == 3
this.editFormData[1].isDisabled = this.routeInfo.addOrEdit == 3
this.tableParams.tableOption = this.routeInfo.addOrEdit != 3
},
methods: {
......@@ -174,6 +171,7 @@ export default {
if (res.goodsInfo) {
this.selectedProInfo = {
id: res.goodsInfo.goodsId,
retailPrice: res.goodsInfo.price2 && res.goodsInfo.price1 != res.goodsInfo.price2 ? (res.goodsInfo.price1 / 100).toFixed(2) + '-' + (res.goodsInfo.price2 / 100).toFixed(2) : (res.goodsInfo.price1 / 100).toFixed(2),
goodsName: res.goodsInfo.name,
merchantId: res.goodsInfo.merchantId,
merchantName: res.goodsInfo.merchantName,
......
<!-- 选择商品弹窗 -->
<template>
<glsx-dialog class="muti-pro" title="选择商品" :isVisible.sync="isMutiSelectVisible" width="70%" @confirmDialog="handleMutiSelectConfirm" @closeDialog="handleMutiSelectClose">
<GLTable ref="mutiProRef" :tableParams="tableParams" :tableData="tableData" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"></GLTable>
<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: '',
tableData: [
{
id: 1,
name: '商品名称1'
},
{
id: 2,
name: '商品名称2'
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
getListApi: getGoodsList,
productList: [],
// pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
listName: 'list',
......@@ -31,23 +27,23 @@ export default {
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'list',
tableOption: true,
tableColumns: [
{
label: '商品名称',
prop: 'name'
prop: 'goodsName'
},
{
label: '缩略图',
prop: 'title'
prop: 'goodsImage',
addHtml: 'goodsImage'
},
{
label: '价格(元)',
prop: 'status'
prop: 'retailPrice'
},
{
label: '来源门店',
prop: ''
prop: 'merchantName'
}
]
}
......@@ -58,6 +54,10 @@ export default {
isMutiSelectVisible: {
type: Boolean,
default: false
},
selectedProList: {
type: Array,
default: () => []
}
},
......@@ -65,9 +65,58 @@ export default {
glsxDialog
},
mounted() {},
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
getGoodsList(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)
......@@ -79,4 +128,8 @@ export default {
}
}
</script>
<style></style>
<style>
.muti-pro .m-t-10 {
margin-top: 10px;
}
</style>
......@@ -17,7 +17,7 @@
</template>
<script>
import { uploadImg, getGoodsList } from '@/api/modules/common'
import { getGoodsList } from '@/api/modules/common'
import glsxDialog from '@/components/glsx-dialog'
export default {
name: 'selectSingleProDialog',
......
......@@ -21,26 +21,31 @@
<div></div>
<GLTable ref="warehousListRef" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="coverImgUrl" slot-scope="scope">
<img style="width: 60px; height: 60px;" :src="scope.scope.coverImgUrl" />
<img class="img-60" :src="scope.scope.coverImgUrl" />
</span>
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="handleExamine(scope.scope)">提交审核</el-button>
<el-button type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
<span v-show="scope.scope.auditStatus != 1" >
<el-button type="text" @click="handleExamine(scope.scope)">提交审核</el-button>
<el-button type="text" @click="scope.scope.goodsGroupFlag == 'N' ? handleEdit(2, scope.scope) : handleEditGroup(2, scope.scope)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
</span>
<el-button v-show="scope.scope.auditStatus == 1" type="text" @click="scope.scope.goodsGroupFlag == 'N' ? handleEdit(3, scope.scope) : handleEditGroup(3, scope.scope)">查看</el-button>
</span>
</GLTable>
</div>
</template>
<script>
import { getWarehousListApi } from '@/api/modules/cmmodityLibrary'
import { getWarehousListApi, auditGoodApi } from '@/api/modules/cmmodityLibrary'
import { auditStatusList } from '@/common/constant'
export default {
name: 'warehousList',
data() {
return {
size: 'small',
searchForm: {
name: ''
name: '',
status: '-1'
},
// 表格组件
getListApi: getWarehousListApi,
......@@ -67,10 +72,20 @@ export default {
}
},
{
label: '审核状态',
prop: 'auditStatus',
formatter: cellValue => {
return this.baseDataList.auditStatusList.find(item => item.confId == cellValue.auditStatus).confName
}
},
{
label: '来源门店',
prop: 'merchantName'
}
]
},
baseDataList: {
auditStatusList: auditStatusList
}
}
},
......@@ -87,9 +102,8 @@ export default {
resolve()
})
},
// 1-新增;2-编辑
// 1-新增;2-编辑;3-查看
handleEdit(addOrEdit, row) {
console.log(row)
this.$router.push({
// name: 'editProduct',
path: '/cmmodityLibrary/editProduct',
......@@ -99,14 +113,14 @@ export default {
}
})
},
// 1-新增;2-编辑
// 1-新增;2-编辑;3-查看
handleEditGroup(addOrEdit, row) {
this.$router.push({
// name: 'editProductGroup',
path: '/cmmodityLibrary/editProductGroup',
query: {
addOrEdit: addOrEdit,
row: row || {}
id: row ? row.id : ''
}
})
},
......@@ -115,9 +129,14 @@ export default {
confirmButtonText: '确定',
type: 'warning',
callback: action => {
this.$message({
type: 'success',
message: '操作成功'
auditGoodApi({ id: row.id }).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleSearch()
}
})
}
})
......@@ -136,7 +155,8 @@ export default {
},
handleReset() {
this.searchForm = {
name: ''
name: '',
status: '-1'
}
this.handleSearch()
},
......
......@@ -17,7 +17,7 @@
<!-- 表格区域 开始 -->
<GLTable ref="wareRef" :searchForm="searchForm" :tableParams="tableParams" :tableData="tableData" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="showImg" slot-scope="scope">
<img style="width: 50px; height: 50px;" :src="scope.scope.pic" />
<img class="img-60" :src="scope.scope.pic" />
{{ scope.scope.title }}
</span>
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
......
<template>
<div>
<el-card shadow="never" slot="header">
<el-form :inline="true" :model="searchForm" class="demo-form-inline" size="small">
<el-form-item label="成员搜索:">
<el-input v-model="searchForm.userName" placeholder="请输入微信号或者昵称" clearable />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" :loading="tableLoading" @click="getList()">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button :loading="tableLoading" @click="reset()">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<div class="live-room">
<div class="container">
<div class="flex">
<el-form :inline="true" :model="searchForm">
<el-form-item label="成员搜索:">
<el-input :size="size" v-model="searchForm.name" placeholder="请输入微信号或者昵称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="memberRef" :searchForm="searchForm" :tableParams="tableParams" :tableData="tableData" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="showImg" slot-scope="scope">
<img style="width: 50px; height: 50px;" :src="scope.scope.pic" />
</span>
</GLTable>
<!-- 表格区域 end -->
<!-- 表格区域 开始 -->
<GLTable ref="memberRef" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf">
<span slot="headingImg" slot-scope="scope">
<img class="img-60" :src="scope.scope.headingImg" />
</span>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
// import {
// GETLISTUSERINFO,
// UPDATEPASSWORD
// } from '@/http/interface'
import { getMerberList } from '@/api/modules/liveMember'
export default {
name: 'memberList',
components: {
// 'glsx-dialog': GlsxDialog,
// 'add-cus': AddCus,
},
data() {
return {
size: 'small',
searchForm: {
userName: ''
name: ''
},
getListApi: getMerberList,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '头像',
prop: 'pic',
line: 1,
addHtml: 'showImg'
prop: 'headingImg',
addHtml: 'headingImg'
},
{
label: '昵称',
prop: 'userName'
prop: 'nickName'
},
{
label: '微信号',
prop: 'userCode'
prop: 'userName'
},
{
label: '所属角色',
prop: 'roleName'
prop: 'roleList',
formatter: cellValue => {
var txt = ''
cellValue.roleList.forEach((item, index) => {
let tempTxt = this.baseDataList.roleList.find(k => k.confId == item).confName
txt = index ? (txt + ',' + tempTxt) : tempTxt
})
return txt
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableData: [
{
id: 1,
pic: 'https://t7.baidu.com/it/u=4162611394,4275913936&fm=193&f=GIF',
userName: '昵称',
userCode: '微信号',
roleName: '所属角色'
}
],
tableLoading: false
baseDataList: {
roleList: [{
confId: 0,
confName: '超级管理员'
}, {
confId: 1,
confName: '管理员'
}, {
confId: 2,
confName: '主播'
}, {
confId: 3,
confName: '运营者'
}]
}
}
},
created() {},
mounted: function() {
// this.getList()
},
mounted: function() {},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
......@@ -89,56 +93,14 @@ export default {
})
},
/**
* 查询列表
*/
getList: function(current) {
const _this = this
const oParams = _this.getParams()
// oParams.pageNum = current || _this.currentPage
_this.tableLoading = true
let list = [
{
id: 1,
pic: 'https://t7.baidu.com/it/u=4162611394,4275913936&fm=193&f=GIF',
userName: '昵称',
userCode: '微信号',
roleName: '所属角色'
}
]
// GETLISTUSERINFO(oParams).then(res => {
// console.log(res)
_this.tableLoading = false
// if (res.returnCode == 0) {
// const { data } = res
// const { total, list } = data
_this.tableData = list || []
// _this.pageTotal = total
// }
// })
},
/**
* 获取查询参数
*/
getParams: function() {
const oParams = this.formInline
oParams.pageSize = this.pageSize
return oParams
},
/**
* 每页展示
*/
changePageSize: function(e) {
this.pageSize = e
this.getList()
handleReset() {
this.searchForm = {
name: ''
}
this.handleSearch()
},
/**
* 重置
*/
reset() {
handleSearch() {
this.$refs.memberRef.refreshTable()
}
}
......
<!-- 编辑直播间 -->
<template>
<div>
<div class="live-room">
<div class="container edit-container">
<p class="edit-title">{{ title }}</p>
<!-- <p class="edit-sub-title" style="margin-top: 10px;">关联门店信息</p> -->
......
<!-- 直播间列表 -->
<template>
<div class="container live-room">
<div class="flex">
<el-form>
<el-form-item>
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新增直播</el-button>
</el-form-item>
</el-form>
<el-form :inline="true" :model="searchForm">
<el-form-item label="直播间搜索:">
<el-input :size="size" v-model="searchForm.name" placeholder="请输入直播间名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
</div>
<GLTable ref="liveRoomRef" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="shareImgUrl" slot-scope="scope">
<img style="width: 60px; height: 60px;" :src="scope.scope.shareImgUrl" />
</span>
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="handleDetail(scope.scope)">控制台</el-button>
<el-button type="text" @click="handleShare(scope.scope)">分享</el-button>
<el-button type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
</span>
</GLTable>
<glsx-dialog title="分享" width="620px" :isVisible="isShareVisible" :noCancel="noCancel" @closeDialog="handleShareClose" @confirmDialog="handleShareClose">
<div class="share-dialog">
<div class="flex">
<div class="flex box poster">
<div>
<p>直播间分享海报</p>
<p>小程序码不带参数</p>
<el-button :size="size">保存图片</el-button>
<div class="live-room">
<div class="container live-room">
<div class="flex">
<el-form>
<el-form-item>
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新增直播</el-button>
</el-form-item>
</el-form>
<el-form :inline="true" :model="searchForm">
<el-form-item label="直播间搜索:">
<el-input :size="size" v-model="searchForm.name" placeholder="请输入直播间名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
</div>
<GLTable ref="liveRoomRef" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="shareImgUrl" slot-scope="scope">
<img class="img-60" :src="scope.scope.shareImgUrl" />
</span>
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="handleDetail(scope.scope)">控制台</el-button>
<el-button type="text" @click="handleShare(scope.scope)">分享</el-button>
<el-button type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
</span>
</GLTable>
<glsx-dialog title="分享" width="620px" :isVisible="isShareVisible" :noCancel="noCancel" @closeDialog="handleShareClose" @confirmDialog="handleShareClose">
<div class="share-dialog">
<div class="flex">
<div class="flex box poster">
<div>
<p>直播间分享海报</p>
<p>小程序码不带参数</p>
<el-button :size="size">保存图片</el-button>
</div>
<img src="https://img0.baidu.com/it/u=2322199322,1491298297&fm=26&fmt=auto" />
</div>
<div class="flex box poster">
<div>
<p>直播间小程序码</p>
<p>小程序码不带参数</p>
<el-button :size="size">保存图片</el-button>
</div>
<img src="https://img0.baidu.com/it/u=2322199322,1491298297&fm=26&fmt=auto" />
</div>
<img src="https://img0.baidu.com/it/u=2322199322,1491298297&fm=26&fmt=auto" />
</div>
<div class="flex box poster">
<div class="box page-route">
<div>
<p>直播间小程序码</p>
<p>小程序码不带参数</p>
<el-button :size="size">保存图片</el-button>
<p>直播间页面路径</p>
<p>www</p>
<el-button :size="size">复制链接</el-button>
<p>链接是直播间原始页面路径,如需加入参数,详见使用方法</p>
</div>
<img src="https://img0.baidu.com/it/u=2322199322,1491298297&fm=26&fmt=auto" />
</div>
</div>
<div class="box page-route">
<div>
<p>直播间页面路径</p>
<p>www</p>
<el-button :size="size">复制链接</el-button>
<p>链接是直播间原始页面路径,如需加入参数,详见使用方法</p>
</div>
</div>
</div>
</glsx-dialog>
</glsx-dialog>
</div>
</div>
</template>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!