jufubao-base 1.0.168 → 1.0.169-beta2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,50 +8,606 @@ export default {
8
8
  content: (data) => {
9
9
  return [
10
10
  {
11
- label: '背景颜色:',
12
- ele: 'xd-color',
13
- valueKey: 'bgcolor',
14
- value: data.bgcolor || '',
15
- placeholder: '请输入占位框背景颜色',
16
- classNmae: 'input80',
17
- rules: [
18
- {
19
- required: true,
20
- message: '请输入占位框背景颜色',
21
- trigger: 'blur'
11
+ label: "展示模块(预览调试样式)",
12
+ ele: 'xd-radio',
13
+ valueKey: "previewCurrent",
14
+ value: data.previewCurrent || "main",
15
+ groupKey: "content",
16
+ list: [
17
+ { label: '票券信息', value: 'main' },
18
+ { label: '规则信息', value: 'rule' },
19
+ { label: "提货券", value: "pickup" },
20
+ ],
21
+ },
22
+ {
23
+ label: '服务展示',
24
+ ele: "xd-radio",
25
+ valueKey: "showBusinessList",
26
+ value: data.showBusinessList || 'Y',
27
+ groupKey: 'content',
28
+ list: [
29
+ { label: "隐藏业务线", value: "N" },
30
+ { label: "展示业务线", value: "Y" }
31
+ ],
32
+ },
33
+ {
34
+ label: '票券背景图:',
35
+ ele: 'xd-upload',
36
+ valueKey: 'cardImageUrl',
37
+ groupKey:'content',
38
+ value: data.cardImageUrl || {},
39
+ defaultValue: data.cardImageUrl || null,
40
+ slot: true,
41
+ oneWidth: 355,
42
+ oneHeight: 170,
43
+ elinputClassName: 'input40',
44
+ tipsformet: '上传格式:@imageType@不超过@size@MB.建议尺寸710*340',
45
+ type: ['jpg', 'png', 'jpeg'],
46
+ styleType: 'one',
47
+ uploadType: 'aliyun',
48
+ size: 5,
49
+ action: 'action',
50
+ sort: true,
51
+ maxlen: 100,
52
+ },
53
+ {
54
+ label: "票券使用规则",
55
+ ele: 'xd-site-news',
56
+ valueKey: 'cardRule',
57
+ groupKey:'content',
58
+ value: data.cardRule || null,
59
+ className: 'input70',
60
+ setting: {
61
+ config: {
62
+ sort: true,
63
+ maxlen: 100,
64
+ action: 'aliyun',
65
+ size: 5,
66
+ tipsformet: '上传文件格式:@imageType@,不超过@size@MB.',
67
+ uploadType: 'aliyun',
68
+ type: ['jpg', 'png', 'jpeg']
22
69
  },
23
- ]
70
+ },
71
+ handleCustom({action, data}) {
72
+ if (data && data.params) {
73
+ //当一个插件中出现使用内容分类时候需要设置code值,在页面引用时候容器id + code进行拼接
74
+ //data.params = Object.assign({}, data.params, {code: 'g_test_id'});
75
+ }
76
+
77
+ //获取返回参数(场景类型名称为必填)
78
+ //获取返回参数(场景类型名称为必填)
79
+ let loading = { close(){}}
80
+
81
+ //获取显示内容
82
+ if (action === 'screen') {
83
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'edtix_bucket_content_tip'})
84
+ .then(res => {
85
+ loading.close();
86
+ data.cb(res['list'])
87
+ })
88
+ .catch(error => {
89
+ console.error(error);
90
+ loading.close();
91
+ });
92
+
93
+ }
94
+
95
+ //获取返回参数(广告位高度必选项)
96
+ if (action === 'getNewsInfo') {
97
+ XdBus.getParentApi('cmsGetPublishEditxContent')(data.params)
98
+ .then(res => {
99
+ loading.close()
100
+ data.cb({list: res.list, selectId: res.selected})
101
+ })
102
+ .catch(error => {
103
+ loading.close()
104
+ console.error(error);
105
+ });
106
+ }
107
+
108
+ //获取产品业务线列表
109
+ if (action === 'namespace') {
110
+ XdBus.getParentApi('getOptionsNamespaces')({})
111
+ .then(res => {
112
+ loading.close()
113
+ data.cb(res['list'])
114
+ })
115
+ .catch(error => {
116
+ loading.close()
117
+ console.error(error);
118
+ });
119
+ }
120
+
121
+ //使用内容分类
122
+ if (action === 'cmsPublishEditxContent') {
123
+ loading = XdBus.getParentApi('loading')({});
124
+ XdBus.getParentApi('cmsPublishEditxContent')(data.params)
125
+ .then(res => {
126
+ console.log('cmsPublishEditxContent', res)
127
+ loading.close();
128
+ data.cb(res)
129
+ })
130
+ .catch(error => {
131
+ loading.close();
132
+ console.error(error);
133
+ });
134
+ }
135
+
136
+ //位置列表
137
+ if (action === 'getListPostion') {
138
+ loading = XdBus.getParentApi('loading')({});
139
+ XdBus.getParentApi('getListNewsPosition')(data.params)
140
+ .then(res => {
141
+ loading.close();
142
+ data.cb(res)
143
+ })
144
+ .catch(error => {
145
+ loading.close();
146
+ console.error(error);
147
+ });
148
+ }
149
+
150
+ //位置创建
151
+ if (action === 'addPostion') {
152
+ loading = XdBus.getParentApi('loading')({});
153
+ XdBus.getParentApi('addNewsPosition')(data.params)
154
+ .then(res => {
155
+ loading.close();
156
+ data.cb(true)
157
+ })
158
+ .catch(error => {
159
+ console.error(error);
160
+ loading.close();
161
+ data.cb(false)
162
+ });
163
+ }
164
+
165
+ //位置编辑
166
+ if (action === 'editPostion') {
167
+ loading = XdBus.getParentApi('loading')({});
168
+ XdBus.getParentApi('updateNewsPosition')(data.params)
169
+ .then(res => {
170
+ loading.close();
171
+ data.cb(true)
172
+ })
173
+ .catch(error => {
174
+ console.error(error);
175
+ loading.close();
176
+ data.cb(false)
177
+ });
178
+ }
179
+
180
+ //位置删除
181
+ if (action === 'deleltePostion') {
182
+ loading = XdBus.getParentApi('loading')({});
183
+ XdBus.getParentApi('deleteNewsPosition')(data.params)
184
+ .then(res => {
185
+ loading.close();
186
+ data.cb(true)
187
+ })
188
+ .catch(error => {
189
+ console.error(error);
190
+ loading.close();
191
+ data.cb(false)
192
+ });
193
+ }
194
+
195
+ //获取广告位内容列表
196
+ if (action === 'getListContent') {
197
+ loading = XdBus.getParentApi('loading')({});
198
+ XdBus.getParentApi('getListNewsContent')(data.params)
199
+ .then(res => {
200
+ loading.close();
201
+ data.cb(res)
202
+ })
203
+ .catch(error => {
204
+ loading.close();
205
+ console.error(error);
206
+ });
207
+ }
208
+
209
+ //广告内容创建
210
+ if (action === 'addContent') {
211
+ loading = XdBus.getParentApi('loading')({});
212
+ XdBus.getParentApi('addNewsContent')(data.params)
213
+ .then(res => {
214
+ loading.close();
215
+ data.cb(true)
216
+ })
217
+ .catch(error => {
218
+ console.error(error);
219
+ loading.close();
220
+ data.cb(false)
221
+ });
222
+ }
223
+
224
+ //广告内容编辑
225
+ if (action === 'editContent') {
226
+ loading = XdBus.getParentApi('loading')({});
227
+ XdBus.getParentApi('updateNewsContent')(data.params)
228
+ .then(res => {
229
+ loading.close();
230
+ data.cb(true)
231
+ })
232
+ .catch(error => {
233
+ console.error(error);
234
+ loading.close();
235
+ data.cb(false)
236
+ });
237
+ }
238
+
239
+ //广告内容删除
240
+ if (action === 'deleteContent') {
241
+ loading = XdBus.getParentApi('loading')({});
242
+ XdBus.getParentApi('deleteNewsContent')(data.params)
243
+ .then(res => {
244
+ loading.close();
245
+ data.cb(true)
246
+ })
247
+ .catch(error => {
248
+ console.error(error);
249
+ loading.close();
250
+ data.cb(false)
251
+ });
252
+ }
253
+
254
+ //内容发布
255
+ if (action === 'publish') {
256
+ loading = XdBus.getParentApi('loading')({});
257
+ console.log('publish', data.params)
258
+ XdBus.getParentApi('cmsPublishContent')(data.params)
259
+ .then(res => {
260
+ loading.close();
261
+ data.cb(res)
262
+ })
263
+ .catch(error => {
264
+ loading.close();
265
+ console.error(error);
266
+ });
267
+ }
268
+
269
+ //通知页面进行刷新
270
+ if (action === 'update') {
271
+ loading = XdBus.getParentApi('loading')({});
272
+ XdBus.getParentApi('getXdBusUpdateView')('onUpdateView', {});
273
+ loading.close()
274
+ }
275
+ },
276
+ },
277
+ {
278
+ label: "票券信息样式配置",
279
+ ele: "title",
280
+ size: "small",
281
+ groupKey: 'style',
282
+ },
283
+ {
284
+ label: "字体颜色",
285
+ ele: 'xd-color',
286
+ valueKey: 'cardFontColor',
287
+ value: data.cardFontColor || '#303133',
288
+ groupKey:'style',
24
289
  },
25
290
  {
26
- label: '选中路径:',
27
- ele: 'xd-select-pages-path',
28
- valueKey: 'select-pages-path',
29
- value: data['select-pages-path'] || null,
291
+ label: "外边距设置",
292
+ groupKey:'style',
293
+ ele: 'xd-margin-padding',
294
+ valueKey: 'cardInfoMargin',
295
+ value: data.cardInfoMargin || {
296
+ top: 20,
297
+ left: 20,
298
+ right: 20,
299
+ bottom: 20
300
+ },
30
301
  setting: {
31
- router: XdBus.getParentApi('getPagesTree')
302
+ type: 'padding',
32
303
  },
304
+ placeholder: '请设置边距',
305
+ inline: false,
306
+ notice: '设置内边距,<span style="color: red">单位:像素</span>。默认值:<span style="color: red">20</span>像素',
33
307
  },
34
- data.bgcolor && {
35
- label: '高度:',
36
- ele: 'el-input',
308
+ {
309
+ label: "内边距设置",
310
+ groupKey:'style',
311
+ ele: 'xd-margin-padding',
312
+ valueKey: 'cardInfoPadding',
313
+ value: data.cardInfoPadding || {
314
+ top: 20,
315
+ left: 20,
316
+ right: 20,
317
+ bottom: 20
318
+ },
319
+ setting: {
320
+ type: 'padding',
321
+ },
322
+ placeholder: '请设置内边距',
323
+ inline: false,
324
+ notice: '设置内边距,<span style="color: red">单位:像素</span>。默认值:<span style="color: red">20</span>像素',
325
+ },
326
+ {
327
+ label: "票券高度",
328
+ ele: "el-input",
329
+ valueKey: 'cardHeight',
330
+ value: data.cardHeight || 260,
37
331
  type: 'number',
38
- valueKey: 'height',
39
- value: data.height || 100,
40
- placeholder: '请输入占位框高度,单位像素,默认:10px',
332
+ groupKey:'style',
333
+ placeholder: "请输入票券高度",
334
+ },
335
+ {
336
+ label: "票券圆角",
337
+ ele: 'xd-site-select-list',
338
+ valueKey: 'cardRadius',
339
+ value: data['cardRadius'] || 16,
340
+ groupKey:'style',
341
+ placeholder: '请选择内容圆角设置',
342
+ multiple: false,
41
343
  className: 'input80',
42
- rules: [
43
- {
44
- required: true,
45
- message: '请输入占位框高度',
46
- trigger: 'blur'
47
- },
48
- ]
344
+ handleCustom({ action, data }) {
345
+ XdBus.getParentApi('getOptionsSettingList')({ setting_id: 'edtix_style_radius' })
346
+ .then(res => {
347
+ data.cb(res.list)
348
+ })
349
+ .catch(error => {
350
+ console.error(error);
351
+ });
352
+ },
49
353
  },
50
354
  {
51
- label: '', //label
52
- ele: 'slot', //package 名称
53
- slot: 'is_reference',
355
+ label: "业务板块样式配置",
356
+ ele: 'title',
357
+ size: 'small',
358
+ groupKey: 'style',
54
359
  },
360
+ {
361
+ label: "业务板块外边距",
362
+ groupKey:'style',
363
+ ele: 'xd-margin-padding',
364
+ valueKey: 'bussTempMargin',
365
+ value: data.bussTempMargin || {
366
+ top: 30,
367
+ left: 0,
368
+ right: 0,
369
+ bottom: 0
370
+ },
371
+ setting: {
372
+ type: 'padding',
373
+ },
374
+ placeholder: '请设置内边距',
375
+ inline: false,
376
+ notice: '设置内边距,<span style="color: red">单位:像素</span>。',
377
+ },
378
+ {
379
+ label: "业务板块容器内边距",
380
+ groupKey:'style',
381
+ ele: 'xd-margin-padding',
382
+ valueKey: 'bussPadding',
383
+ value: data.bussPadding || {
384
+ top: 10,
385
+ left: 20,
386
+ right: 20,
387
+ bottom: 20
388
+ },
389
+ setting: {
390
+ type: 'padding',
391
+ },
392
+ placeholder: '请设置内边距',
393
+ inline: false,
394
+ notice: '设置内边距,<span style="color: red">单位:像素</span>。',
395
+ },
396
+ {
397
+ label: "业务板块背景色",
398
+ groupKey:'style',
399
+ ele: 'xd-color',
400
+ valueKey: 'bussTempBgColor',
401
+ value: data.bussTempBgColor || '#ffffff',
402
+ },
403
+ {
404
+ label: "单项业务外边距",
405
+ groupKey:'style',
406
+ ele: 'xd-margin-padding',
407
+ valueKey: 'bussMargin',
408
+ value: data.bussMargin || {
409
+ top: 30,
410
+ left: 30,
411
+ right: 30,
412
+ bottom: 30
413
+ },
414
+ setting: {
415
+ type: 'margin',
416
+ },
417
+ placeholder: '请设置外边距',
418
+ inline: false,
419
+ notice: '设置外边距,<span style="color: red">单位:像素</span>。',
420
+ },
421
+ {
422
+ label: "单项业务宽度",
423
+ groupKey:'style',
424
+ ele: 'el-input',
425
+ valueKey: 'bussWidth',
426
+ value: data.bussWidth || 100,
427
+ type: "number",
428
+ className: 'input70',
429
+ placeholder: "请输入单项业务宽度",
430
+ },
431
+ {
432
+ label: "使用规则、提货码样式配置",
433
+ ele: 'title',
434
+ size: 'small',
435
+ groupKey:'style',
436
+ },
437
+ {
438
+ label: "外边距",
439
+ groupKey:'style',
440
+ ele: 'xd-margin-padding',
441
+ valueKey: 'listColMargin',
442
+ value: data.listColMargin || {
443
+ top: 40,
444
+ left: 0,
445
+ right: 0,
446
+ bottom: 15
447
+ },
448
+ setting: {
449
+ type: 'margin',
450
+ },
451
+ placeholder: '请设置外边距',
452
+ inline: false,
453
+ notice: '设置外边距,<span style="color: red">单位:像素</span>。',
454
+ },
455
+ {
456
+ label: "单项内边距",
457
+ groupKey:'style',
458
+ ele: 'xd-margin-padding',
459
+ valueKey: 'listColPadding',
460
+ value: data.listColPadding || {
461
+ top: 20,
462
+ left: 20,
463
+ right: 20,
464
+ bottom: 20
465
+ },
466
+ setting: {
467
+ type: 'padding',
468
+ },
469
+ placeholder: '请设置内边距',
470
+ inline: false,
471
+ notice: '设置内边距,<span style="color: red">单位:像素</span>。'
472
+ },
473
+ {
474
+ label: "单项间隔距离",
475
+ ele: "el-input",
476
+ valueKey: 'listColSpace',
477
+ value: data.listColSpace || 10,
478
+ groupKey: 'style',
479
+ type: "number",
480
+ className: 'input70',
481
+ placeholder: "请输入间隔距离",
482
+ },
483
+ {
484
+ label: "提货码详情样式配置",
485
+ ele: 'title',
486
+ size: 'small',
487
+ groupKey:'style',
488
+ },
489
+ {
490
+ label: "提货码详情外边距",
491
+ groupKey:'style',
492
+ ele: 'xd-margin-padding',
493
+ valueKey: 'codeDetailMargin',
494
+ value: data.codeDetailMargin || {
495
+ top: 30,
496
+ left: 20,
497
+ right: 20,
498
+ bottom: 30
499
+ },
500
+ setting: {
501
+ type: 'margin',
502
+ },
503
+ placeholder: '请设置外边距',
504
+ inline: false,
505
+ notice: '设置外边距,<span style="color: red">单位:像素</span>'
506
+ },
507
+ {
508
+ label: "提货码详情内边距",
509
+ groupKey:'style',
510
+ ele: 'xd-margin-padding',
511
+ valueKey: 'codeDetailPadding',
512
+ value: data.codeDetailPadding || {
513
+ top: 20,
514
+ left: 20,
515
+ right: 20,
516
+ bottom: 20
517
+ },
518
+ setting: {
519
+ type: 'padding',
520
+ },
521
+ placeholder: '请设置内边距',
522
+ inline: false,
523
+ notice: '设置外边距,<span style="color: red">单位:像素</span>'
524
+ },
525
+ {
526
+ label: "提货码详情背景色",
527
+ groupKey:'style',
528
+ ele: 'xd-color',
529
+ valueKey: 'codeDetailBgColor',
530
+ value: data.codeDetailBgColor || '#ffffff',
531
+ },
532
+ {
533
+ label: "二维码长宽设置",
534
+ ele: "el-input",
535
+ valueKey: 'qrcodeWidth',
536
+ value: data.qrcodeWidth || 300,
537
+ groupKey: 'style',
538
+ type: "number",
539
+ className: 'input70',
540
+ placeholder: "请输入二维码长宽",
541
+ },
542
+ {
543
+ label: "向商家付款前置图标配置",
544
+ ele: 'el-input',
545
+ valueKey: 'payPreIcon',
546
+ value: data.payPreIcon || '',
547
+ groupKey: 'style',
548
+ type: "text",
549
+ className: 'input70',
550
+ placeholder: "请输入图标代码",
551
+ },
552
+ {
553
+ label: "刷新二维码图标配置",
554
+ ele: 'el-input',
555
+ valueKey: 'refreshIcon',
556
+ value: data.refreshIcon || '',
557
+ groupKey: 'style',
558
+ type: "text",
559
+ className: 'input70',
560
+ placeholder: "请输入图标代码",
561
+ },
562
+ {
563
+ label: "规则详情样式配置",
564
+ ele: 'title',
565
+ size: 'small',
566
+ groupKey:'style',
567
+ },
568
+ {
569
+ label: "规则详情外边距",
570
+ groupKey:'style',
571
+ ele: 'xd-margin-padding',
572
+ valueKey: 'ruleDetailMargin',
573
+ value: data.ruleDetailMargin || {
574
+ top: 0,
575
+ left: 20,
576
+ right: 20,
577
+ bottom: 15
578
+ },
579
+ setting: {
580
+ type: 'margin',
581
+ },
582
+ placeholder: '请设置外边距',
583
+ inline: false,
584
+ notice: '设置外边距,<span style="color: red">单位:像素</span>'
585
+ },
586
+ {
587
+ label: "规则详情内边距",
588
+ groupKey:'style',
589
+ ele: 'xd-margin-padding',
590
+ valueKey: 'ruleDetailPadding',
591
+ value: data.ruleDetailPadding || {
592
+ top: 20,
593
+ left: 15,
594
+ right: 15,
595
+ bottom: 20
596
+ },
597
+ setting: {
598
+ type: 'padding',
599
+ },
600
+ placeholder: '请设置内边距',
601
+ inline: false,
602
+ notice: '设置外边距,<span style="color: red">单位:像素</span>'
603
+ },
604
+ {
605
+ label: "规则详情背景色",
606
+ groupKey:'style',
607
+ ele: 'xd-color',
608
+ valueKey: 'ruleDetailBgColor',
609
+ value: data.ruleDetailBgColor || '#ffffff',
610
+ }
55
611
  ].filter(i=>i)
56
612
  },
57
613
  advanced: [],