|
@@ -137,6 +137,26 @@ export default class SldSelGoodsSingleDiy extends Component {
|
137
|
137
|
},
|
138
|
138
|
];
|
139
|
139
|
|
|
140
|
+ live_columns = [
|
|
141
|
+ {
|
|
142
|
+ title: ' ',
|
|
143
|
+ dataIndex: 'roomId',
|
|
144
|
+ align: 'center',
|
|
145
|
+ width: 30,
|
|
146
|
+ render: (text, record, index) => getTableNum(this.state.params, pageSize, index),
|
|
147
|
+ }, {
|
|
148
|
+ title: `直播名称`,//直播名称
|
|
149
|
+ align: 'center',
|
|
150
|
+ dataIndex: 'name',
|
|
151
|
+ width: 200,
|
|
152
|
+ }, {
|
|
153
|
+ title: `主播名称`,//主播名称
|
|
154
|
+ align: 'center',
|
|
155
|
+ dataIndex: 'anchorName',
|
|
156
|
+ width: 200,
|
|
157
|
+ },
|
|
158
|
+ ];
|
|
159
|
+
|
140
|
160
|
cat_columns = [
|
141
|
161
|
{
|
142
|
162
|
title: `${sldComLanguage('分类名称')}`,//分类名称
|
|
@@ -238,7 +258,7 @@ export default class SldSelGoodsSingleDiy extends Component {
|
238
|
258
|
|
239
|
259
|
componentWillReceiveProps(nextProps, nextContext) {
|
240
|
260
|
let { columns, modaltitle, search_data, sldpagination } = this.state;
|
241
|
|
- if (nextProps.link_type == 'goods' || nextProps.link_type == 'category' || nextProps.link_type == 'topic' || nextProps.link_type == 'seckill' || nextProps.link_type == 'voucher') {
|
|
261
|
+ if (nextProps.link_type == 'goods' || nextProps.link_type == 'live' || nextProps.link_type == 'category' || nextProps.link_type == 'topic' || nextProps.link_type == 'seckill' || nextProps.link_type == 'voucher') {
|
242
|
262
|
if (nextProps.link_type == 'goods') {
|
243
|
263
|
columns = this.goods_columns;
|
244
|
264
|
modaltitle = `${sldComLanguage('选择商品')}`;//选择商品
|
|
@@ -250,7 +270,18 @@ export default class SldSelGoodsSingleDiy extends Component {
|
250
|
270
|
}];//筛选器
|
251
|
271
|
sldpagination = true;
|
252
|
272
|
this.rowKey = 'goodsId';
|
253
|
|
- } else if (nextProps.link_type == 'category') {
|
|
273
|
+ } else if (nextProps.link_type == 'live') {
|
|
274
|
+ columns = this.live_columns;
|
|
275
|
+ modaltitle = `选择直播`;//选择直播
|
|
276
|
+ search_data = [{
|
|
277
|
+ type: 'input',
|
|
278
|
+ label: `直播名称`,//直播名称
|
|
279
|
+ name: 'name',
|
|
280
|
+ placeholder: `请输入直播名称`,//请输入直播名称
|
|
281
|
+ }];//筛选器
|
|
282
|
+ sldpagination = true;
|
|
283
|
+ this.rowKey = 'roomId';
|
|
284
|
+ } else if (nextProps.link_type == 'category') {
|
254
|
285
|
columns = this.cat_columns;
|
255
|
286
|
modaltitle = `${sldComLanguage('选择分类')}`;//选择分类
|
256
|
287
|
search_data = [];
|
|
@@ -356,6 +387,9 @@ export default class SldSelGoodsSingleDiy extends Component {
|
356
|
387
|
//获取商品数据
|
357
|
388
|
dis_type = 'project/get_goods_lists';
|
358
|
389
|
new_params.state = 3;//在售状态
|
|
390
|
+ } else if (link_type == 'live') {
|
|
391
|
+ //获取直播数据
|
|
392
|
+ dis_type = 'project/get_live_lists';
|
359
|
393
|
} else if (link_type == 'category') {
|
360
|
394
|
//获取分类数据
|
361
|
395
|
dis_type = 'project/get_cate_list_by_id';
|
|
@@ -387,7 +421,7 @@ export default class SldSelGoodsSingleDiy extends Component {
|
387
|
421
|
callback: (res) => {
|
388
|
422
|
this.setState({ loading: false });
|
389
|
423
|
if (res.state == 200) {
|
390
|
|
- if (link_type == 'goods' || link_type == 'topic' || link_type == 'seckill' || link_type == 'voucher') {
|
|
424
|
+ if (link_type == 'goods' || link_type == 'live' || link_type == 'topic' || link_type == 'seckill' || link_type == 'voucher') {
|
391
|
425
|
data = res.data;
|
392
|
426
|
} else if (link_type == 'category') {
|
393
|
427
|
//id为0直接赋值
|
|
@@ -513,6 +547,10 @@ export default class SldSelGoodsSingleDiy extends Component {
|
513
|
547
|
modalTableSeleData.actualSales = record.actualSales;
|
514
|
548
|
modalTableSeleData.mainImgUrl = record.mainImage;
|
515
|
549
|
modalTableSeleData.defaultProductId = record.productId;
|
|
550
|
+ } else if (link_type == 'live') {
|
|
551
|
+ modalTableSeleData.roomId = record.roomId;
|
|
552
|
+ modalTableSeleData.name = record.name;
|
|
553
|
+ modalTableSeleData.anchorName = record.anchorName;
|
516
|
554
|
} else if (link_type == 'topic') {
|
517
|
555
|
if (this.props.client == 'mobile') {
|
518
|
556
|
modalTableSeleData.decoId = record.decoId;
|