jufubao-base 1.0.186-beta2 → 1.0.186

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.
@@ -3,1003 +3,469 @@
3
3
  export default {
4
4
  style: [],
5
5
  advanced: [],
6
- content: (data) => {
7
- return [
8
- {
9
- label: '隐私政策:',
10
- ele: 'xd-site-news',
11
- valueKey: 'notice',
12
- groupKey: 'content',
13
- value: data.notice || { type: 'privacy' },
14
- className: 'input70',
15
- setting: {
16
- type: 'privacy',
17
- config: {
18
- sort: true,
19
- maxlen: 100,
20
- action: 'aliyun',
21
- size: 5,
22
- tipsformet: '上传文件格式:@imageType@,不超过@size@MB.',
23
- uploadType: 'aliyun',
24
- type: ['jpg', 'png', 'jpeg']
25
- },
6
+ content: [
7
+ {
8
+ label: '隐私政策:',
9
+ ele: 'xd-site-news',
10
+ valueKey: 'notice',
11
+ groupKey:'content',
12
+ value: {type: 'privacy'},
13
+ className: 'input70',
14
+ setting: {
15
+ type: 'privacy',
16
+ config: {
17
+ sort: true,
18
+ maxlen: 100,
19
+ action: 'aliyun',
20
+ size: 5,
21
+ tipsformet: '上传文件格式:@imageType@,不超过@size@MB.',
22
+ uploadType: 'aliyun',
23
+ type: ['jpg', 'png', 'jpeg']
26
24
  },
27
- handleCustom({ action, data }) {
28
- if (data && data.params) {
29
- //当一个插件中出现多个内容分类时候需要设置code值,在页面引用时候(容器id + code)进行拼接获取数据列表
30
- data.params = Object.assign({}, data.params, { code: 'privacy_privacy' });
31
- }
32
-
33
- //获取返回参数(场景类型名称为必填)
34
- //获取返回参数(场景类型名称为必填)
35
- let loading = { close() { } }
36
-
37
- //获取显示内容
38
- if (action === 'screen') {
39
- XdBus.getParentApi('getOptionsSettingList')({ setting_id: 'edtix_bucket_content_tip' })
40
- .then(res => {
41
- loading.close();
42
- data.cb(res['list'])
43
- })
44
- .catch(error => {
45
- console.error(error);
46
- loading.close();
47
- });
48
-
49
- }
50
-
51
- //获取返回参数(广告位高度必选项)
52
- if (action === 'getNewsInfo') {
53
- XdBus.getParentApi('cmsGetPublishEditxContent')(data.params)
54
- .then(res => {
55
- loading.close()
56
- data.cb({ list: res.list, selectId: res.selected })
57
- })
58
- .catch(error => {
59
- loading.close()
60
- console.error(error);
61
- });
62
- }
63
-
64
- //获取产品业务线列表
65
- if (action === 'namespace') {
66
- XdBus.getParentApi('getOptionsNamespaces')({})
67
- .then(res => {
68
- loading.close()
69
- data.cb(res['list'])
70
- })
71
- .catch(error => {
72
- loading.close()
73
- console.error(error);
74
- });
75
- }
76
-
77
- //使用内容分类
78
- if (action === 'cmsPublishEditxContent') {
79
- loading = XdBus.getParentApi('loading')({});
80
- XdBus.getParentApi('cmsPublishEditxContent')(data.params)
81
- .then(res => {
82
- console.log('cmsPublishEditxContent', res)
83
- loading.close();
84
- data.cb(res)
85
- })
86
- .catch(error => {
87
- loading.close();
88
- console.error(error);
89
- });
90
- }
91
-
92
- //位置列表
93
- if (action === 'getListPostion') {
94
- loading = XdBus.getParentApi('loading')({});
95
- XdBus.getParentApi('getListNewsPosition')(data.params)
96
- .then(res => {
97
- loading.close();
98
- data.cb(res)
99
- })
100
- .catch(error => {
101
- loading.close();
102
- console.error(error);
103
- });
104
- }
105
-
106
- //位置创建
107
- if (action === 'addPostion') {
108
- loading = XdBus.getParentApi('loading')({});
109
- XdBus.getParentApi('addNewsPosition')(data.params)
110
- .then(res => {
111
- loading.close();
112
- data.cb(true)
113
- })
114
- .catch(error => {
115
- console.error(error);
116
- loading.close();
117
- data.cb(false)
118
- });
119
- }
120
-
121
- //位置编辑
122
- if (action === 'editPostion') {
123
- loading = XdBus.getParentApi('loading')({});
124
- XdBus.getParentApi('updateNewsPosition')(data.params)
125
- .then(res => {
126
- loading.close();
127
- data.cb(true)
128
- })
129
- .catch(error => {
130
- console.error(error);
131
- loading.close();
132
- data.cb(false)
133
- });
134
- }
135
-
136
- //位置删除
137
- if (action === 'deleltePostion') {
138
- loading = XdBus.getParentApi('loading')({});
139
- XdBus.getParentApi('deleteNewsPosition')(data.params)
140
- .then(res => {
141
- loading.close();
142
- data.cb(true)
143
- })
144
- .catch(error => {
145
- console.error(error);
146
- loading.close();
147
- data.cb(false)
148
- });
149
- }
150
-
151
- //获取广告位内容列表
152
- if (action === 'getListContent') {
153
- loading = XdBus.getParentApi('loading')({});
154
- XdBus.getParentApi('getListNewsContent')(data.params)
155
- .then(res => {
156
- loading.close();
157
- data.cb(res)
158
- })
159
- .catch(error => {
160
- loading.close();
161
- console.error(error);
162
- });
163
- }
164
-
165
- //广告内容创建
166
- if (action === 'addContent') {
167
- loading = XdBus.getParentApi('loading')({});
168
- XdBus.getParentApi('addNewsContent')(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 === 'editContent') {
182
- loading = XdBus.getParentApi('loading')({});
183
- XdBus.getParentApi('updateNewsContent')(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 === 'deleteContent') {
197
- loading = XdBus.getParentApi('loading')({});
198
- XdBus.getParentApi('deleteNewsContent')(data.params)
199
- .then(res => {
200
- loading.close();
201
- data.cb(true)
202
- })
203
- .catch(error => {
204
- console.error(error);
205
- loading.close();
206
- data.cb(false)
207
- });
208
- }
209
-
210
- //内容发布
211
- if (action === 'publish') {
212
- loading = XdBus.getParentApi('loading')({});
213
- console.log('publish', data.params)
214
- XdBus.getParentApi('cmsPublishContent')(data.params)
215
- .then(res => {
216
- loading.close();
217
- data.cb(res)
218
- })
219
- .catch(error => {
220
- loading.close();
221
- console.error(error);
222
- });
223
- }
224
-
225
- //通知页面进行刷新
226
- if (action === 'update') {
227
- loading = XdBus.getParentApi('loading')({});
228
- XdBus.getParentApi('getXdBusUpdateView')('onUpdateView', {});
229
- loading.close()
230
- }
231
- },
232
- inline: false,
233
- notice: '',
234
- },
235
- {
236
- label: '用户服务协议:',
237
- ele: 'xd-site-news',
238
- valueKey: 'notices',
239
- groupKey: 'content',
240
- value: data.notices || { type: 'privacy' },
241
- className: 'input70',
242
- setting: {
243
- config: {
244
- sort: true,
245
- maxlen: 100,
246
- action: 'aliyun',
247
- size: 5,
248
- tipsformet: '上传文件格式:@imageType@,不超过@size@MB.',
249
- uploadType: 'aliyun',
250
- type: ['jpg', 'png', 'jpeg']
251
- },
252
- },
253
- handleCustom({ action, data }) {
254
- if (data && data.params) {
255
- //当一个插件中出现多个内容分类时候需要设置code值,在页面引用时候(容器id + code)进行拼接获取数据列表
256
- data.params = Object.assign({}, data.params, { code: 'privacy_service' });
257
- }
258
-
259
- //获取返回参数(场景类型名称为必填)
260
- let loading = { close() { } }
261
-
262
- //获取显示内容
263
- if (action === 'screen') {
264
- XdBus.getParentApi('getOptionsSettingList')({ setting_id: 'edtix_bucket_content_tip' })
265
- .then(res => {
266
- loading.close();
267
- data.cb(res['list'])
268
- })
269
- .catch(error => {
270
- console.error(error);
271
- loading.close();
272
- });
273
-
274
- }
275
-
276
- //获取返回参数(广告位高度必选项)
277
- if (action === 'getNewsInfo') {
278
- XdBus.getParentApi('cmsGetPublishEditxContent')(data.params)
279
- .then(res => {
280
- loading.close()
281
- data.cb({ list: res.list, selectId: res.selected })
282
- })
283
- .catch(error => {
284
- loading.close()
285
- console.error(error);
286
- });
287
- }
288
-
289
- //获取产品业务线列表
290
- if (action === 'namespace') {
291
- XdBus.getParentApi('getOptionsNamespaces')({})
292
- .then(res => {
293
- loading.close()
294
- data.cb(res['list'])
295
- })
296
- .catch(error => {
297
- loading.close()
298
- console.error(error);
299
- });
300
- }
301
-
302
- //使用内容分类
303
- if (action === 'cmsPublishEditxContent') {
304
- loading = XdBus.getParentApi('loading')({});
305
- XdBus.getParentApi('cmsPublishEditxContent')(data.params)
306
- .then(res => {
307
- console.log('cmsPublishEditxContent', res)
308
- loading.close();
309
- data.cb(res)
310
- })
311
- .catch(error => {
312
- loading.close();
313
- console.error(error);
314
- });
315
- }
316
-
317
- //位置列表
318
- if (action === 'getListPostion') {
319
- loading = XdBus.getParentApi('loading')({});
320
- XdBus.getParentApi('getListNewsPosition')(data.params)
321
- .then(res => {
322
- loading.close();
323
- data.cb(res)
324
- })
325
- .catch(error => {
326
- loading.close();
327
- console.error(error);
328
- });
329
- }
330
-
331
- //位置创建
332
- if (action === 'addPostion') {
333
- loading = XdBus.getParentApi('loading')({});
334
- XdBus.getParentApi('addNewsPosition')(data.params)
335
- .then(res => {
336
- loading.close();
337
- data.cb(true)
338
- })
339
- .catch(error => {
340
- console.error(error);
341
- loading.close();
342
- data.cb(false)
343
- });
344
- }
345
-
346
- //位置编辑
347
- if (action === 'editPostion') {
348
- loading = XdBus.getParentApi('loading')({});
349
- XdBus.getParentApi('updateNewsPosition')(data.params)
350
- .then(res => {
351
- loading.close();
352
- data.cb(true)
353
- })
354
- .catch(error => {
355
- console.error(error);
356
- loading.close();
357
- data.cb(false)
358
- });
359
- }
360
-
361
- //位置删除
362
- if (action === 'deleltePostion') {
363
- loading = XdBus.getParentApi('loading')({});
364
- XdBus.getParentApi('deleteNewsPosition')(data.params)
365
- .then(res => {
366
- loading.close();
367
- data.cb(true)
368
- })
369
- .catch(error => {
370
- console.error(error);
371
- loading.close();
372
- data.cb(false)
373
- });
374
- }
375
-
376
- //获取广告位内容列表
377
- if (action === 'getListContent') {
378
- loading = XdBus.getParentApi('loading')({});
379
- XdBus.getParentApi('getListNewsContent')(data.params)
380
- .then(res => {
381
- loading.close();
382
- data.cb(res)
383
- })
384
- .catch(error => {
385
- loading.close();
386
- console.error(error);
387
- });
388
- }
389
-
390
- //广告内容创建
391
- if (action === 'addContent') {
392
- loading = XdBus.getParentApi('loading')({});
393
- XdBus.getParentApi('addNewsContent')(data.params)
394
- .then(res => {
395
- loading.close();
396
- data.cb(true)
397
- })
398
- .catch(error => {
399
- console.error(error);
400
- loading.close();
401
- data.cb(false)
402
- });
403
- }
404
-
405
- //广告内容编辑
406
- if (action === 'editContent') {
407
- loading = XdBus.getParentApi('loading')({});
408
- XdBus.getParentApi('updateNewsContent')(data.params)
409
- .then(res => {
410
- loading.close();
411
- data.cb(true)
412
- })
413
- .catch(error => {
414
- console.error(error);
415
- loading.close();
416
- data.cb(false)
417
- });
418
- }
419
-
420
- //广告内容删除
421
- if (action === 'deleteContent') {
422
- loading = XdBus.getParentApi('loading')({});
423
- XdBus.getParentApi('deleteNewsContent')(data.params)
424
- .then(res => {
425
- loading.close();
426
- data.cb(true)
427
- })
428
- .catch(error => {
429
- console.error(error);
430
- loading.close();
431
- data.cb(false)
432
- });
433
- }
434
-
435
- //内容发布
436
- if (action === 'publish') {
437
- loading = XdBus.getParentApi('loading')({});
438
- console.log('publish', data.params)
439
- XdBus.getParentApi('cmsPublishContent')(data.params)
440
- .then(res => {
441
- loading.close();
442
- data.cb(res)
443
- })
444
- .catch(error => {
445
- loading.close();
446
- console.error(error);
447
- });
448
- }
449
-
450
- //通知页面进行刷新
451
- if (action === 'update') {
452
- loading = XdBus.getParentApi('loading')({});
453
- XdBus.getParentApi('getXdBusUpdateView')('onUpdateView', {});
454
- loading.close()
455
- }
456
- },
457
- inline: false,
458
- notice: '',
459
- },
460
- {
461
- label: "是否展示[跳过]功能",
462
- ele: "xd-radio",
463
- valueKey: "is_show_skip",
464
- value: data['is_show_skip'] || "Y",
465
- groupKey: "content",
466
- list: [
467
- { label: '展示', value: 'Y' },
468
- { label: '隐藏', value: 'N' },
469
- ]
470
- },
471
- {
472
- label: "手机号自定义提示语:",
473
- ele: 'el-input',
474
- valueKey: 'phonePlaceholder',
475
- value: data.phonePlaceholder || "",
476
- groupKey: 'content',
477
- placeholder: "请输入手机号自定义提示语",
478
- className: 'input80',
479
- },
480
- {
481
- label: "验证码自定义提示语:",
482
- ele: 'el-input',
483
- valueKey: 'codePlaceholder',
484
- value: data.codePlaceholder || "",
485
- groupKey: 'content',
486
- placeholder: "请输入验证码自定义提示语",
487
- className: 'input80',
488
- },
489
- {
490
- ele: "title",
491
- label: "表单样式配置",
492
- size: "small",
493
- groupKey: "style",
494
- },
495
- {
496
- label: "输入框样式:",
497
- ele: 'xd-radio',
498
- valueKey: 'inputStyle',
499
- value: data.inputStyle || "linear",
500
- groupKey: 'style',
501
- placeholder: "请选择输入框样式",
502
- multiple: false,
503
- className: 'input80',
504
- list: [
505
- { label: '线性', value: "linear" },
506
- { label: '面性', value: "face" },
507
- ],
508
- },
509
- {
510
- label: "表单边框颜色:",
511
- ele: 'xd-color',
512
- valueKey: 'formBorderColor',
513
- value: data.formBorderColor || "#F9F9F9",
514
- groupKey: 'style',
515
- placeholder: "请选择表单边框颜色",
516
- },
517
- {
518
- label: "表单边框宽度:",
519
- ele: 'el-input',
520
- valueKey: 'formBorderWidth',
521
- value: data.formBorderWidth || "1",
522
- type: "number",
523
- groupKey: 'style',
524
- placeholder: "请输入表单边框宽度",
525
- className: 'input60',
526
- },
527
- {
528
- label: "表单背景颜色:",
529
- ele: 'xd-color',
530
- valueKey: 'formBgColor',
531
- value: data.formBgColor || "#FFFFFF",
532
- groupKey: 'style',
533
- placeholder: "请选择表单背景颜色",
534
25
  },
535
- {
536
- label: '表单容器设置内边距:',
537
- groupKey: 'style',
538
- ele: 'xd-margin-padding',
539
- valueKey: 'formPadding',
540
- value: data.formPadding || null,
541
- setting: {
542
- type: 'padding',
543
- },
544
- placeholder: '请设置边距',
545
- inline: false,
546
- notice: '设置内边距,<span style="color: red">单位:像素</span>。默认值:<span style="color: red">20</span>像素',
547
- },
548
- {
549
- label: '表单容器设置外边距:',
550
- ele: "xd-margin-padding",
551
- valueKey: 'formMargin',
552
- value: data.formMargin || {
553
- top: 0,
554
- right: 0,
555
- bottom: 0,
556
- left: 0
557
- },
558
- setting: {
559
- type: 'margin',
560
- },
561
- groupKey:'style',
562
- placeholder: '请设置边距',
563
- inline: false,
564
- notice: '设置外边距,<span style="color: red">单位:像素</span>。默认值:<span style="color: red">20</span>像素',
565
- },
566
- {
567
- label: "表单容器圆角",
568
- ele: 'xd-site-select-list',
569
- valueKey: 'formRadius',
570
- value: data['formRadius'] || '0',
571
- groupKey: 'style',
572
- placeholder: '请选择内容圆角设置',
573
- multiple: false,
574
- className: 'input80',
575
- handleCustom({ action, data }) {
576
- XdBus.getParentApi('getOptionsSettingList')({ setting_id: 'edtix_style_radius' })
26
+ handleCustom({action, data}) {
27
+ if (data && data.params) {
28
+ //当一个插件中出现多个内容分类时候需要设置code值,在页面引用时候(容器id + code)进行拼接获取数据列表
29
+ data.params = Object.assign({}, data.params, {code: 'privacy_privacy'});
30
+ }
31
+
32
+ //获取返回参数(场景类型名称为必填)
33
+ //获取返回参数(场景类型名称为必填)
34
+ let loading = { close(){}}
35
+
36
+ //获取显示内容
37
+ if (action === 'screen') {
38
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'edtix_bucket_content_tip'})
577
39
  .then(res => {
578
- data.cb(res.list)
40
+ loading.close();
41
+ data.cb(res['list'])
579
42
  })
580
43
  .catch(error => {
581
44
  console.error(error);
45
+ loading.close();
582
46
  });
583
- },
584
- },
585
- {
586
- label: "表单容器边框颜色:",
587
- ele: 'xd-color',
588
- valueKey: 'formWrapBorderColor',
589
- value: data.formWrapBorderColor || "#F9F9F9",
590
- groupKey: 'style',
591
- placeholder: "请选择表单边框颜色",
592
- },
593
- {
594
- label: "表单容器边框宽度:",
595
- ele: 'el-input',
596
- valueKey: 'formWrapBorderWidth',
597
- value: data.formWrapBorderWidth || "0",
598
- type: "number",
599
- groupKey: 'style',
600
- placeholder: "请输入表单边框宽度",
601
- className: 'input60',
602
- },
603
- {
604
- label: '表单容器投影颜色:',
605
- ele: 'xd-color',
606
- groupKey:'style',
607
- valueKey: 'formShadowColor',
608
- value: data['formShadowColor'] || '',
609
- placeholder: '请选择投影颜色',
610
- classNmae: 'input80',
611
- },
612
- {
613
- label: '表单容器投影范围:',
614
- groupKey:'style',
615
- ele: 'xd-site-select-list',
616
- valueKey: 'formShadowW',
617
- value: data['formShadowW'] || '0',
618
- placeholder: '请选择投影范围',
619
- multiple: false,
620
- className: 'input80',
621
- handleCustom({action, data}) {
622
- XdBus.getParentApi('getOptionsSettingList')({
623
- setting_id: 'edtix_style_radius',
624
- key: Date.now()
625
- })
47
+
48
+ }
49
+
50
+ //获取返回参数(广告位高度必选项)
51
+ if (action === 'getNewsInfo') {
52
+ XdBus.getParentApi('cmsGetPublishEditxContent')(data.params)
626
53
  .then(res => {
627
- data.cb(res.list)
54
+ loading.close()
55
+ data.cb({list: res.list, selectId: res.selected})
628
56
  })
629
57
  .catch(error => {
58
+ loading.close()
630
59
  console.error(error);
631
60
  });
632
- },
633
- },
634
- {
635
- ele: 'title',
636
- label: '标签样式配置',
637
- size: 'small',
638
- groupKey: 'style',
639
- },
640
- {
641
- label: "标签文字对齐方式:",
642
- ele: 'xd-radio',
643
- valueKey: 'labelAlign',
644
- value: data.labelAlign || "right",
645
- groupKey: 'style',
646
- placeholder: "请选择标签对齐方式",
647
- multiple: false,
648
- className: 'input80',
649
- list: [
650
- { label: '左对齐', value: "left" },
651
- { label: '右对齐', value: "right" },
652
- { label: '居中', value: "center" },
653
- ],
654
- },
655
- {
656
- label: "标签位置:",
657
- ele: "xd-radio",
658
- valueKey: "labelPosition",
659
- value: data.labelPosition || "left",
660
- groupKey: 'style',
661
- placeholder: "请选择标签对齐方式",
662
- multiple: false,
663
- className: 'input80',
664
- list: [
665
- { label: '居左', value: "left" },
666
- { label: '居上', value: "top" },
667
- ],
668
- },
669
- {
670
- label: "标签宽度:",
671
- ele: 'el-input',
672
- type: "number",
673
- valueKey: 'labelWidth',
674
- value: data.labelWidth || "180",
675
- groupKey: 'style',
676
- placeholder: "请输入标签宽度",
677
- className: 'input60',
678
- },
679
- {
680
- label: "手机号图标:",
681
- ele: "el-input",
682
- valueKey: "phoneIcon",
683
- value: data.phoneIcon || "",
684
- groupKey: 'style',
685
- placeholder: "请输入手机号图标",
686
- className: "input70",
687
- },
688
- {
689
- label: "验证码图标:",
690
- ele: "el-input",
691
- valueKey: "codeIcon",
692
- value: data.codeIcon || "",
693
- groupKey: 'style',
694
- placeholder: "请输入验证码图标",
695
- className: "input70",
696
- },
697
- {
698
- label: "标签字体样式设置:",
699
- ele: "xd-font",
700
- valueKey: "labelFont",
701
- value: data.labelFont || {},
702
- groupKey: 'style',
703
- setting: {
704
- align: false,
705
- lineHeight: false,
706
- },
707
- handleCustom({ action, data }) {
708
- XdBus.getParentApi('getOptionsSettingList')({ setting_id: 'edtix_style_font_size' })
61
+ }
62
+
63
+ //获取产品业务线列表
64
+ if (action === 'namespace') {
65
+ XdBus.getParentApi('getOptionsNamespaces')({})
709
66
  .then(res => {
710
- data.cb(res.list)
67
+ loading.close()
68
+ data.cb(res['list'])
711
69
  })
712
70
  .catch(error => {
713
- data.cb([])
71
+ loading.close()
714
72
  console.error(error);
715
73
  });
716
- },
717
- inline: false,
718
- notice: '填充设置,单位:<span style="color: red">像素</span>。默认值:<span style="color: red">20</span> 像素',
719
- },
720
- {
721
- ele: 'title',
722
- label: '输入框设置',
723
- size: 'small',
724
- groupKey: 'style',
725
- },
726
- {
727
- label: "占位符字体样式设置:",
728
- ele: "xd-font",
729
- valueKey: "placeholderFont",
730
- value: data.placeholderFont || {
731
- color: '#d4d4d4',
732
- fontSize: '24rpx',
733
- fontWeight: "normal",
734
- },
735
- groupKey: 'style',
736
- setting: {
737
- align: false,
738
- lineHeight: false,
739
- },
740
- handleCustom({ action, data }) {
741
- XdBus.getParentApi('getOptionsSettingList')({ setting_id: 'edtix_style_font_size' })
74
+ }
75
+
76
+ //使用内容分类
77
+ if (action === 'cmsPublishEditxContent') {
78
+ loading = XdBus.getParentApi('loading')({});
79
+ XdBus.getParentApi('cmsPublishEditxContent')(data.params)
742
80
  .then(res => {
743
- data.cb(res.list)
81
+ console.log('cmsPublishEditxContent', res)
82
+ loading.close();
83
+ data.cb(res)
744
84
  })
745
85
  .catch(error => {
746
- data.cb([])
86
+ loading.close();
747
87
  console.error(error);
748
88
  });
749
- },
750
- inline: false,
751
- notice: '填充设置,单位:<span style="color: red">像素</span>。默认值:<span style="color: red">20</span> 像素',
752
- },
753
- {
754
- label: "内容字体样式设置:",
755
- ele: "xd-font",
756
- valueKey: "contentFont",
757
- value: data.contentFont || {},
758
- groupKey: 'style',
759
- setting: {
760
- align: false,
761
- lineHeight: false,
762
- },
763
- handleCustom({ action, data }) {
764
- XdBus.getParentApi('getOptionsSettingList')({ setting_id: 'edtix_style_font_size' })
89
+ }
90
+
91
+ //位置列表
92
+ if (action === 'getListPostion') {
93
+ loading = XdBus.getParentApi('loading')({});
94
+ XdBus.getParentApi('getListNewsPosition')(data.params)
765
95
  .then(res => {
766
- data.cb(res.list)
96
+ loading.close();
97
+ data.cb(res)
767
98
  })
768
99
  .catch(error => {
769
- data.cb([])
100
+ loading.close();
770
101
  console.error(error);
771
102
  });
772
- },
773
- inline: false,
774
- notice: '填充设置,单位:<span style="color: red">像素</span>。默认值:<span style="color: red">20</span> 像素',
775
- },
776
- {
777
- ele: 'title',
778
- label: '获取验证码',
779
- size: 'small',
780
- groupKey: 'style',
781
- },
782
- {
783
- label: "获取验证码字体样式设置:",
784
- ele: "xd-font",
785
- valueKey: "getCodeFont",
786
- value: data.getCodeFont || {
787
- color: "#ff5a39",
788
- fontSize: "24rpx",
789
- fontWeight: "normal",
790
- },
791
- groupKey: 'style',
792
- setting: {
793
- align: false,
794
- lineHeight: false,
795
- },
796
- handleCustom({ action, data }) {
797
- XdBus.getParentApi('getOptionsSettingList')({ setting_id: 'edtix_style_font_size' })
103
+ }
104
+
105
+ //位置创建
106
+ if (action === 'addPostion') {
107
+ loading = XdBus.getParentApi('loading')({});
108
+ XdBus.getParentApi('addNewsPosition')(data.params)
798
109
  .then(res => {
799
- data.cb(res.list)
110
+ loading.close();
111
+ data.cb(true)
800
112
  })
801
113
  .catch(error => {
802
- data.cb([])
803
114
  console.error(error);
115
+ loading.close();
116
+ data.cb(false)
804
117
  });
805
- },
806
- inline: false,
807
- notice: '填充设置,单位:<span style="color: red">像素</span>。默认值:<span style="color: red">20</span> 像素',
808
- },
809
- {
810
- label: "获取验证码展示方式:",
811
- ele: 'xd-radio',
812
- valueKey: 'getCodeShowType',
813
- value: data.getCodeShowType || 'text',
814
- groupKey: 'style',
815
- multiple: false,
816
- className: 'input80',
817
- list: [
818
- { label: '文字', value: 'text' },
819
- { label: '按钮', value: 'button' },
820
- ],
821
- },
822
- {
823
- ele: 'title',
824
- label: '按钮样式配置',
825
- size: 'small',
826
- groupKey: 'style',
827
- },
828
- // {
829
- // label: "按钮颜色",
830
- // ele: 'xd-color',
831
- // valueKey: 'btnColor',
832
- // value: data.btnColor || '',
833
- // groupKey:'style',
834
- // placeholder: "请选择按钮颜色",
835
- // className: 'input60',
836
- // },
837
- {
838
- label: "表单按钮外边距设置",
839
- groupKey: 'style',
840
- ele: 'xd-margin-padding',
841
- valueKey: 'btnMargin',
842
- value: data.btnMargin || null,
843
- setting: {
844
- type: 'padding',
845
- },
846
- placeholder: '请设置边距',
847
- inline: false,
848
- notice: '设置内边距,<span style="color: red">单位:像素</span>。默认值:<span style="color: red">20</span>像素',
849
- },
850
- {
851
- label: "按钮圆角 - 通用",
852
- ele: 'xd-site-select-list',
853
- valueKey: 'btnRadius',
854
- value: data['btnRadius'] || '20',
855
- groupKey: 'style',
856
- placeholder: '请选择内容圆角设置',
857
- multiple: false,
858
- className: 'input80',
859
- handleCustom({ action, data }) {
860
- XdBus.getParentApi('getOptionsSettingList')({ setting_id: 'edtix_style_radius' })
118
+ }
119
+
120
+ //位置编辑
121
+ if (action === 'editPostion') {
122
+ loading = XdBus.getParentApi('loading')({});
123
+ XdBus.getParentApi('updateNewsPosition')(data.params)
861
124
  .then(res => {
862
- data.cb(res.list)
125
+ loading.close();
126
+ data.cb(true)
863
127
  })
864
128
  .catch(error => {
865
129
  console.error(error);
130
+ loading.close();
131
+ data.cb(false)
866
132
  });
867
- },
868
- },
869
- {
870
- ele: 'title',
871
- label: '条款协议 - 通用',
872
- size: 'small',
873
- groupKey: 'style',
874
- },
875
- {
876
- label: "文字样式设置: ",
877
- ele: "xd-font",
878
- valueKey: "agreeFont",
879
- value: data.agreeFont || {
880
- color: "#666666",
881
- fontSize: "24rpx",
882
- fontWeight: "normal",
883
- },
884
- groupKey: 'style',
885
- setting: {
886
- align: false,
887
- },
888
- handleCustom({ action, data }) {
889
- XdBus.getParentApi('getOptionsSettingList')({ setting_id: 'edtix_style_font_size' })
133
+ }
134
+
135
+ //位置删除
136
+ if (action === 'deleltePostion') {
137
+ loading = XdBus.getParentApi('loading')({});
138
+ XdBus.getParentApi('deleteNewsPosition')(data.params)
890
139
  .then(res => {
891
- data.cb(res.list)
140
+ loading.close();
141
+ data.cb(true)
892
142
  })
893
143
  .catch(error => {
894
- data.cb([])
895
144
  console.error(error);
145
+ loading.close();
146
+ data.cb(false)
896
147
  });
897
- },
898
- inline: false,
899
- notice: '填充设置,单位:<span style="color: red">像素</span>。默认值:<span style="color: red">20</span> 像素',
900
- },
901
- {
902
- label: "隐私条款链接字体设置:",
903
- ele: "xd-font",
904
- valueKey: "privacyFont",
905
- value: data.privacyFont || {},
906
- groupKey: 'style',
907
- setting: {
908
- align: false,
909
- lineHeight: false,
910
- fontSize: false,
911
- },
912
- handleCustom({ action, data }) {
913
- XdBus.getParentApi('getOptionsSettingList')({ setting_id: 'edtix_style_font_size' })
148
+ }
149
+
150
+ //获取广告位内容列表
151
+ if (action === 'getListContent') {
152
+ loading = XdBus.getParentApi('loading')({});
153
+ XdBus.getParentApi('getListNewsContent')(data.params)
914
154
  .then(res => {
915
- data.cb(res.list)
155
+ loading.close();
156
+ data.cb(res)
916
157
  })
917
158
  .catch(error => {
918
- data.cb([])
159
+ loading.close();
919
160
  console.error(error);
920
161
  });
921
- },
922
- inline: false,
923
- notice: '填充设置,单位:<span style="color: red">像素</span>。默认值:<span style="color: red">20</span> 像素',
924
- },
925
- {
926
- label: "选择框垂直对齐方式:",
927
- ele: 'xd-radio',
928
- valueKey: 'agreementAlign',
929
- value: data.agreementAlign || "center",
930
- groupKey: 'style',
931
- multiple: false,
932
- className: 'input80',
933
- list: [
934
- { label: '居中', value: "center" },
935
- { label: '顶部', value: "flex-start" },
936
- { label: '底部', value: "flex-end" },
937
- ]
938
- },
939
- {
940
- label: "条款协议外边距设置 - 账号登录",
941
- groupKey: 'style',
942
- ele: 'xd-margin-padding',
943
- valueKey: 'agreePadding',
944
- value: data.agreePadding || {
945
- top: 40,
946
- left: 20,
947
- right: 20,
948
- bottom: 0
949
- },
950
- setting: {
951
- type: 'padding',
952
- },
953
- placeholder: '请设置边距',
954
- inline: false,
955
- notice: '设置内边距,<span style="color: red">单位:像素</span>。默认值:<span style="color: red">20</span>像素',
956
- },
957
- {
958
- ele: 'title',
959
- label: '跳过样式设置',
960
- size: 'small',
961
- groupKey: 'style',
962
- },
963
- {
964
- label: "跳过样式设置: ",
965
- ele: "xd-font",
966
- valueKey: "jumpFont",
967
- value: data.jumpFont || {
968
- color: "#666666",
969
- fontSize: "24rpx",
970
- fontWeight: "normal",
971
- },
972
- groupKey: 'style',
973
- setting: {
974
- align: false,
975
- },
976
- handleCustom({ action, data }) {
977
- XdBus.getParentApi('getOptionsSettingList')({ setting_id: 'edtix_style_font_size' })
162
+ }
163
+
164
+ //广告内容创建
165
+ if (action === 'addContent') {
166
+ loading = XdBus.getParentApi('loading')({});
167
+ XdBus.getParentApi('addNewsContent')(data.params)
168
+ .then(res => {
169
+ loading.close();
170
+ data.cb(true)
171
+ })
172
+ .catch(error => {
173
+ console.error(error);
174
+ loading.close();
175
+ data.cb(false)
176
+ });
177
+ }
178
+
179
+ //广告内容编辑
180
+ if (action === 'editContent') {
181
+ loading = XdBus.getParentApi('loading')({});
182
+ XdBus.getParentApi('updateNewsContent')(data.params)
183
+ .then(res => {
184
+ loading.close();
185
+ data.cb(true)
186
+ })
187
+ .catch(error => {
188
+ console.error(error);
189
+ loading.close();
190
+ data.cb(false)
191
+ });
192
+ }
193
+
194
+ //广告内容删除
195
+ if (action === 'deleteContent') {
196
+ loading = XdBus.getParentApi('loading')({});
197
+ XdBus.getParentApi('deleteNewsContent')(data.params)
198
+ .then(res => {
199
+ loading.close();
200
+ data.cb(true)
201
+ })
202
+ .catch(error => {
203
+ console.error(error);
204
+ loading.close();
205
+ data.cb(false)
206
+ });
207
+ }
208
+
209
+ //内容发布
210
+ if (action === 'publish') {
211
+ loading = XdBus.getParentApi('loading')({});
212
+ console.log('publish', data.params)
213
+ XdBus.getParentApi('cmsPublishContent')(data.params)
978
214
  .then(res => {
979
- data.cb(res.list)
215
+ loading.close();
216
+ data.cb(res)
980
217
  })
981
218
  .catch(error => {
982
- data.cb([])
219
+ loading.close();
983
220
  console.error(error);
984
221
  });
222
+ }
223
+
224
+ //通知页面进行刷新
225
+ if (action === 'update') {
226
+ loading = XdBus.getParentApi('loading')({});
227
+ XdBus.getParentApi('getXdBusUpdateView')('onUpdateView', {});
228
+ loading.close()
229
+ }
230
+ },
231
+ inline: false,
232
+ notice: '',
233
+ },
234
+ {
235
+ label: '用户服务协议:',
236
+ ele: 'xd-site-news',
237
+ valueKey: 'notices',
238
+ groupKey:'content',
239
+ value: {type: 'privacy'},
240
+ className: 'input70',
241
+ setting: {
242
+ config: {
243
+ sort: true,
244
+ maxlen: 100,
245
+ action: 'aliyun',
246
+ size: 5,
247
+ tipsformet: '上传文件格式:@imageType@,不超过@size@MB.',
248
+ uploadType: 'aliyun',
249
+ type: ['jpg', 'png', 'jpeg']
985
250
  },
986
- inline: false,
987
- notice: '填充设置,单位:<span style="color: red">像素</span>。默认值:<span style="color: red">20</span> 像素',
988
- },
989
- {
990
- label: "跳过垂直对齐方式:",
991
- ele: 'xd-radio',
992
- valueKey: 'jumpAlign',
993
- value: data.jumpAlign || "right",
994
- groupKey: 'style',
995
- multiple: false,
996
- className: 'input80',
997
- list: [
998
- { label: '左侧', value: "left" },
999
- { label: '居中', value: "center" },
1000
- { label: '右侧', value: "right" },
1001
- ]
1002
251
  },
1003
- ]
1004
- }
252
+ handleCustom({action, data}) {
253
+ if (data && data.params) {
254
+ //当一个插件中出现多个内容分类时候需要设置code值,在页面引用时候(容器id + code)进行拼接获取数据列表
255
+ data.params = Object.assign({}, data.params, {code: 'privacy_service'});
256
+ }
257
+
258
+ //获取返回参数(场景类型名称为必填)
259
+ let loading = { close(){}}
260
+
261
+ //获取显示内容
262
+ if (action === 'screen') {
263
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'edtix_bucket_content_tip'})
264
+ .then(res => {
265
+ loading.close();
266
+ data.cb(res['list'])
267
+ })
268
+ .catch(error => {
269
+ console.error(error);
270
+ loading.close();
271
+ });
272
+
273
+ }
274
+
275
+ //获取返回参数(广告位高度必选项)
276
+ if (action === 'getNewsInfo') {
277
+ XdBus.getParentApi('cmsGetPublishEditxContent')(data.params)
278
+ .then(res => {
279
+ loading.close()
280
+ data.cb({list: res.list, selectId: res.selected})
281
+ })
282
+ .catch(error => {
283
+ loading.close()
284
+ console.error(error);
285
+ });
286
+ }
287
+
288
+ //获取产品业务线列表
289
+ if (action === 'namespace') {
290
+ XdBus.getParentApi('getOptionsNamespaces')({})
291
+ .then(res => {
292
+ loading.close()
293
+ data.cb(res['list'])
294
+ })
295
+ .catch(error => {
296
+ loading.close()
297
+ console.error(error);
298
+ });
299
+ }
300
+
301
+ //使用内容分类
302
+ if (action === 'cmsPublishEditxContent') {
303
+ loading = XdBus.getParentApi('loading')({});
304
+ XdBus.getParentApi('cmsPublishEditxContent')(data.params)
305
+ .then(res => {
306
+ console.log('cmsPublishEditxContent', res)
307
+ loading.close();
308
+ data.cb(res)
309
+ })
310
+ .catch(error => {
311
+ loading.close();
312
+ console.error(error);
313
+ });
314
+ }
315
+
316
+ //位置列表
317
+ if (action === 'getListPostion') {
318
+ loading = XdBus.getParentApi('loading')({});
319
+ XdBus.getParentApi('getListNewsPosition')(data.params)
320
+ .then(res => {
321
+ loading.close();
322
+ data.cb(res)
323
+ })
324
+ .catch(error => {
325
+ loading.close();
326
+ console.error(error);
327
+ });
328
+ }
329
+
330
+ //位置创建
331
+ if (action === 'addPostion') {
332
+ loading = XdBus.getParentApi('loading')({});
333
+ XdBus.getParentApi('addNewsPosition')(data.params)
334
+ .then(res => {
335
+ loading.close();
336
+ data.cb(true)
337
+ })
338
+ .catch(error => {
339
+ console.error(error);
340
+ loading.close();
341
+ data.cb(false)
342
+ });
343
+ }
344
+
345
+ //位置编辑
346
+ if (action === 'editPostion') {
347
+ loading = XdBus.getParentApi('loading')({});
348
+ XdBus.getParentApi('updateNewsPosition')(data.params)
349
+ .then(res => {
350
+ loading.close();
351
+ data.cb(true)
352
+ })
353
+ .catch(error => {
354
+ console.error(error);
355
+ loading.close();
356
+ data.cb(false)
357
+ });
358
+ }
359
+
360
+ //位置删除
361
+ if (action === 'deleltePostion') {
362
+ loading = XdBus.getParentApi('loading')({});
363
+ XdBus.getParentApi('deleteNewsPosition')(data.params)
364
+ .then(res => {
365
+ loading.close();
366
+ data.cb(true)
367
+ })
368
+ .catch(error => {
369
+ console.error(error);
370
+ loading.close();
371
+ data.cb(false)
372
+ });
373
+ }
374
+
375
+ //获取广告位内容列表
376
+ if (action === 'getListContent') {
377
+ loading = XdBus.getParentApi('loading')({});
378
+ XdBus.getParentApi('getListNewsContent')(data.params)
379
+ .then(res => {
380
+ loading.close();
381
+ data.cb(res)
382
+ })
383
+ .catch(error => {
384
+ loading.close();
385
+ console.error(error);
386
+ });
387
+ }
388
+
389
+ //广告内容创建
390
+ if (action === 'addContent') {
391
+ loading = XdBus.getParentApi('loading')({});
392
+ XdBus.getParentApi('addNewsContent')(data.params)
393
+ .then(res => {
394
+ loading.close();
395
+ data.cb(true)
396
+ })
397
+ .catch(error => {
398
+ console.error(error);
399
+ loading.close();
400
+ data.cb(false)
401
+ });
402
+ }
403
+
404
+ //广告内容编辑
405
+ if (action === 'editContent') {
406
+ loading = XdBus.getParentApi('loading')({});
407
+ XdBus.getParentApi('updateNewsContent')(data.params)
408
+ .then(res => {
409
+ loading.close();
410
+ data.cb(true)
411
+ })
412
+ .catch(error => {
413
+ console.error(error);
414
+ loading.close();
415
+ data.cb(false)
416
+ });
417
+ }
418
+
419
+ //广告内容删除
420
+ if (action === 'deleteContent') {
421
+ loading = XdBus.getParentApi('loading')({});
422
+ XdBus.getParentApi('deleteNewsContent')(data.params)
423
+ .then(res => {
424
+ loading.close();
425
+ data.cb(true)
426
+ })
427
+ .catch(error => {
428
+ console.error(error);
429
+ loading.close();
430
+ data.cb(false)
431
+ });
432
+ }
433
+
434
+ //内容发布
435
+ if (action === 'publish') {
436
+ loading = XdBus.getParentApi('loading')({});
437
+ console.log('publish', data.params)
438
+ XdBus.getParentApi('cmsPublishContent')(data.params)
439
+ .then(res => {
440
+ loading.close();
441
+ data.cb(res)
442
+ })
443
+ .catch(error => {
444
+ loading.close();
445
+ console.error(error);
446
+ });
447
+ }
448
+
449
+ //通知页面进行刷新
450
+ if (action === 'update') {
451
+ loading = XdBus.getParentApi('loading')({});
452
+ XdBus.getParentApi('getXdBusUpdateView')('onUpdateView', {});
453
+ loading.close()
454
+ }
455
+ },
456
+ inline: false,
457
+ notice: '',
458
+ },
459
+ {
460
+ label: "是否展示[跳过]功能",
461
+ ele: "xd-radio",
462
+ valueKey: "is_show_skip",
463
+ value: "Y",
464
+ groupKey: "content",
465
+ list: [
466
+ { label: '展示', value: 'Y' },
467
+ { label: '隐藏', value: 'N' },
468
+ ]
469
+ }
470
+ ]
1005
471
  }