jufubao-base 1.0.237-beta2 → 1.0.237-beta3

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.
Files changed (107) hide show
  1. package/package.json +1 -1
  2. package/src/components/JfbBaseBlock/Attr.js +479 -34
  3. package/src/components/JfbBaseBlock/JfbBaseBlock.vue +52 -9
  4. package/src/components/JfbBaseNoticeDialog/Api.js +1 -1
  5. package/src/components/JfbBaseNoticeDialog/Attr.js +0 -26
  6. package/src/components/JfbBaseNoticeDialog/JfbBaseNoticeDialog.vue +6 -25
  7. package/src/components/JfbBaseTfkSearch/ContentProduct.vue +22 -11
  8. package/src/components/JfbBaseTfkSearch/JfbBaseTfkSearch.vue +1 -8
  9. package/src/components/JfbBaseTfkSearch/Mock.js +3 -51
  10. package/src/components/JfbBaseTfkSearch/listMixins.js +1 -1
  11. package/src/components/JfbBaseUserInfo/Attr.js +10 -102
  12. package/src/components/JfbBaseUserInfo/JfbBaseUserInfo.vue +114 -305
  13. package/src/mixins/componentsMixins.js +117 -28
  14. package/src/components/JfbBaseBalance/Api.js +0 -46
  15. package/src/components/JfbBaseBalance/Attr.js +0 -316
  16. package/src/components/JfbBaseBalance/JfbBaseBalance.vue +0 -332
  17. package/src/components/JfbBaseBalance/JfbBaseBalanceLess.less +0 -79
  18. package/src/components/JfbBaseBalance/JfbBaseBalanceMixin.js +0 -30
  19. package/src/components/JfbBaseBalance/Mock.js +0 -9
  20. package/src/components/JfbBaseCodeOpenVip/Api.js +0 -36
  21. package/src/components/JfbBaseCodeOpenVip/Attr.js +0 -281
  22. package/src/components/JfbBaseCodeOpenVip/JfbBaseCodeOpenVip.vue +0 -253
  23. package/src/components/JfbBaseCodeOpenVip/JfbBaseCodeOpenVipLess.less +0 -79
  24. package/src/components/JfbBaseCodeOpenVip/JfbBaseCodeOpenVipMixin.js +0 -30
  25. package/src/components/JfbBaseCodeOpenVip/Mock.js +0 -13
  26. package/src/components/JfbBaseConsumpCode/Api.js +0 -133
  27. package/src/components/JfbBaseConsumpCode/Attr.js +0 -61
  28. package/src/components/JfbBaseConsumpCode/JfbBaseConsumpCode.vue +0 -961
  29. package/src/components/JfbBaseConsumpCode/JfbBaseConsumpCodeLess.less +0 -79
  30. package/src/components/JfbBaseConsumpCode/JfbBaseConsumpCodeMixin.js +0 -30
  31. package/src/components/JfbBaseConsumpCode/Mock.js +0 -22
  32. package/src/components/JfbBaseOpenVip/Api.js +0 -39
  33. package/src/components/JfbBaseOpenVip/Attr.js +0 -270
  34. package/src/components/JfbBaseOpenVip/JfbBaseOpenVip.vue +0 -424
  35. package/src/components/JfbBaseOpenVip/JfbBaseOpenVipLess.less +0 -79
  36. package/src/components/JfbBaseOpenVip/JfbBaseOpenVipMixin.js +0 -30
  37. package/src/components/JfbBaseOpenVip/Mock.js +0 -7
  38. package/src/components/JfbBaseOpenVip/XdVipList.vue +0 -125
  39. package/src/components/JfbBaseOpenVipCard/Api.js +0 -58
  40. package/src/components/JfbBaseOpenVipCard/Attr.js +0 -48
  41. package/src/components/JfbBaseOpenVipCard/JfbBaseOpenVipCard.vue +0 -111
  42. package/src/components/JfbBaseOpenVipCard/JfbBaseOpenVipCardLess.less +0 -79
  43. package/src/components/JfbBaseOpenVipCard/JfbBaseOpenVipCardMixin.js +0 -30
  44. package/src/components/JfbBaseOpenVipCard/Mock.js +0 -13
  45. package/src/components/JfbBaseOpenVipDetail/Api.js +0 -36
  46. package/src/components/JfbBaseOpenVipDetail/Attr.js +0 -37
  47. package/src/components/JfbBaseOpenVipDetail/JfbBaseOpenVipDetail.vue +0 -225
  48. package/src/components/JfbBaseOpenVipDetail/JfbBaseOpenVipDetailLess.less +0 -79
  49. package/src/components/JfbBaseOpenVipDetail/JfbBaseOpenVipDetailMixin.js +0 -30
  50. package/src/components/JfbBaseOpenVipDetail/Mock.js +0 -13
  51. package/src/components/JfbBasePersonalData/Api.js +0 -26
  52. package/src/components/JfbBasePersonalData/Attr.js +0 -12
  53. package/src/components/JfbBasePersonalData/JfbBasePersonalData.vue +0 -198
  54. package/src/components/JfbBasePersonalData/JfbBasePersonalDataLess.less +0 -79
  55. package/src/components/JfbBasePersonalData/JfbBasePersonalDataMixin.js +0 -30
  56. package/src/components/JfbBasePersonalData/Mock.js +0 -13
  57. package/src/components/JfbBasePointsCard/Api.js +0 -18
  58. package/src/components/JfbBasePointsCard/Attr.js +0 -187
  59. package/src/components/JfbBasePointsCard/JfbBasePointsCard.vue +0 -208
  60. package/src/components/JfbBasePointsCard/JfbBasePointsCardLess.less +0 -79
  61. package/src/components/JfbBasePointsCard/JfbBasePointsCardMixin.js +0 -30
  62. package/src/components/JfbBasePointsCard/Mock.js +0 -5
  63. package/src/components/JfbBasePointsDetail/Api.js +0 -48
  64. package/src/components/JfbBasePointsDetail/Attr.js +0 -304
  65. package/src/components/JfbBasePointsDetail/JfbBasePointsDetail.vue +0 -267
  66. package/src/components/JfbBasePointsDetail/JfbBasePointsDetailLess.less +0 -79
  67. package/src/components/JfbBasePointsDetail/JfbBasePointsDetailMixin.js +0 -30
  68. package/src/components/JfbBasePointsDetail/Mock.js +0 -6
  69. package/src/components/JfbBasePosterGroup/Api.js +0 -58
  70. package/src/components/JfbBasePosterGroup/Attr.js +0 -48
  71. package/src/components/JfbBasePosterGroup/JfbBasePosterGroup.vue +0 -111
  72. package/src/components/JfbBasePosterGroup/JfbBasePosterGroupLess.less +0 -79
  73. package/src/components/JfbBasePosterGroup/JfbBasePosterGroupMixin.js +0 -30
  74. package/src/components/JfbBasePosterGroup/Mock.js +0 -13
  75. package/src/components/JfbBaseSavingDetail/Api.js +0 -41
  76. package/src/components/JfbBaseSavingDetail/Attr.js +0 -70
  77. package/src/components/JfbBaseSavingDetail/JfbBaseSavingDetail.vue +0 -679
  78. package/src/components/JfbBaseSavingDetail/JfbBaseSavingDetailLess.less +0 -79
  79. package/src/components/JfbBaseSavingDetail/JfbBaseSavingDetailMixin.js +0 -30
  80. package/src/components/JfbBaseSavingDetail/Mock.js +0 -10
  81. package/src/components/JfbBaseSavingDetail/components/echarts.min.js +0 -26
  82. package/src/components/JfbBaseSavingDetail/components/echarts.vue +0 -254
  83. package/src/components/JfbBaseSavingDetail/components/wx-canvas.js +0 -105
  84. package/src/components/JfbBaseShare/Api.js +0 -20
  85. package/src/components/JfbBaseShare/Attr.js +0 -14
  86. package/src/components/JfbBaseShare/JfbBaseShare.vue +0 -261
  87. package/src/components/JfbBaseShare/JfbBaseShareLess.less +0 -79
  88. package/src/components/JfbBaseShare/JfbBaseShareMixin.js +0 -30
  89. package/src/components/JfbBaseShare/Mock.js +0 -16
  90. package/src/components/JfbBaseWithDrawAgain/Api.js +0 -41
  91. package/src/components/JfbBaseWithDrawAgain/Attr.js +0 -92
  92. package/src/components/JfbBaseWithDrawAgain/JfbBaseWithDrawAgain.vue +0 -334
  93. package/src/components/JfbBaseWithDrawAgain/JfbBaseWithDrawAgainLess.less +0 -79
  94. package/src/components/JfbBaseWithDrawAgain/JfbBaseWithDrawAgainMixin.js +0 -30
  95. package/src/components/JfbBaseWithDrawAgain/Mock.js +0 -10
  96. package/src/components/JfbBaseWithDrawRecord/Api.js +0 -19
  97. package/src/components/JfbBaseWithDrawRecord/Attr.js +0 -79
  98. package/src/components/JfbBaseWithDrawRecord/JfbBaseWithDrawRecord.vue +0 -233
  99. package/src/components/JfbBaseWithDrawRecord/JfbBaseWithDrawRecordLess.less +0 -79
  100. package/src/components/JfbBaseWithDrawRecord/JfbBaseWithDrawRecordMixin.js +0 -30
  101. package/src/components/JfbBaseWithDrawRecord/Mock.js +0 -7
  102. package/src/components/JfbBaseWithdraw/Api.js +0 -48
  103. package/src/components/JfbBaseWithdraw/Attr.js +0 -328
  104. package/src/components/JfbBaseWithdraw/JfbBaseWithdraw.vue +0 -245
  105. package/src/components/JfbBaseWithdraw/JfbBaseWithdrawLess.less +0 -79
  106. package/src/components/JfbBaseWithdraw/JfbBaseWithdrawMixin.js +0 -30
  107. package/src/components/JfbBaseWithdraw/Mock.js +0 -7
@@ -5,6 +5,7 @@ import {mapActions,mapState, mapMutations} from "vuex";
5
5
  import helper from "@/utils/helper";
6
6
  import store from "@/store/index";
7
7
  import getServiceUrl from "@/common/getServiceUrl"
8
+ import {parsePath} from "@/utils/linkUrl";
8
9
 
9
10
 
10
11
  export default {
@@ -136,7 +137,11 @@ export default {
136
137
  "op_user_id": "",
137
138
  "created_time": 0,
138
139
  "updated_time": 0
139
- }
140
+ },
141
+
142
+ //全局样式
143
+ gStyleValue:{},
144
+ gOrgStyleValue:{},
140
145
  }
141
146
  },
142
147
 
@@ -164,6 +169,12 @@ export default {
164
169
  if (this.$vnode && this.$vnode.tag) tag = this.$vnode.tag;
165
170
  this.$xdLog.setProject('App.components.start', `App.components.vnode.name.${tag}`);
166
171
 
172
+ //全局样式处理
173
+ if(this.pageAttr['configs']['default_style']) {
174
+ this.gOrgStyleValue = this.$xdUniHelper.cloneDeep(this.pageAttr['configs']['default_style']);
175
+ this.setGStyleValue(this.pageAttr['configs']['default_style']);
176
+ }
177
+
167
178
  //设置插件cid
168
179
  if (this.cid) {
169
180
  this.containerId = this.cid;
@@ -285,7 +296,8 @@ export default {
285
296
  computed:{
286
297
  ...mapState({
287
298
  pageNamespace: state=> state.pageBusinessCode,
288
- })
299
+ jfbAuthorize: state=> state.jfbAuthorize,
300
+ }),
289
301
  },
290
302
 
291
303
  watch:{
@@ -298,6 +310,48 @@ export default {
298
310
  ...mapActions(['setXNamespace','setStyleCommon','wxCodeForGetAppId']),
299
311
  ...mapMutations(['setCurrentStyle']),
300
312
 
313
+ /**
314
+ * @description 设置全局样式
315
+ * @param data
316
+ */
317
+ setGStyleValue(data){
318
+
319
+ function objFn(mpObj){
320
+ if(mpObj['type'] === 'D') return {top: 0, left: 20, right: 20, bottom:20};
321
+ else {
322
+ Object.keys(mpObj['custom']).map(key=>{
323
+ if(mpObj['custom'][key] === -999999) mpObj['custom'][key] = 0;
324
+ })
325
+ }
326
+ return mpObj['custom'];
327
+ }
328
+ let temp = {};
329
+ Object.keys(data).map(key=>{
330
+ if(key === 'padding' || key === 'margin') {
331
+ temp[key] = objFn(data[key]);
332
+ }
333
+ else if(key === 'shadow') {
334
+ if(data['type'] === 'D') temp['shadow'] = 'none';
335
+ else {
336
+ if(data[key]['custom'] && data[key]['custom']['color']) {
337
+ temp['shadow'] = `0 0 ${data[key]['custom']['width']}rpx ${data[key]['custom']['color']}`
338
+ }
339
+ else temp['shadow'] = 'none';
340
+ }
341
+ }
342
+ else if(key === 'background') {
343
+ if(data['type'] === 'D') temp['background'] = 'none';
344
+ else {
345
+ if(data[key]['custom']) {
346
+ temp['background'] = data[key]['custom']
347
+ }
348
+ else temp['background'] = 'none';
349
+ }
350
+ }
351
+ });
352
+ this.gStyleValue = this.$xdUniHelper.cloneDeep(temp);
353
+ },
354
+
301
355
  /**
302
356
  * @description 自动生成调试模式
303
357
  */
@@ -315,8 +369,6 @@ export default {
315
369
  }
316
370
  },
317
371
 
318
-
319
-
320
372
  /**
321
373
  * @description 检查是否同域名
322
374
  * @param url
@@ -459,12 +511,14 @@ export default {
459
511
  * @description 点击选择插件显示边框
460
512
  */
461
513
  handleEditxSelect() {
514
+
462
515
  //加载本地业务插件库
463
516
  if (this.noBorder) return;
464
517
 
465
518
  //#ifdef H5
466
519
  if (this.active) return;
467
520
  this.active = true;
521
+
468
522
  let AttrObj = this.$xdUniHelper.checkVarType(this.Attr) === 'object' ?
469
523
  this.$xdUniHelper.customClone(this.Attr) : {style: [], advanced: [], content: []};
470
524
 
@@ -474,10 +528,16 @@ export default {
474
528
  if (type === 'style' || type === 'advanced' || type === 'content') {
475
529
  if (typeof AttrObj[type] === "function") {
476
530
  let params = getContainerFnPropsValue(this.container, `${type}`);
531
+ //默认样式设置
532
+ let defaultGValue = this.$xdUniHelper.cloneDeep(this.gStyleValue);
533
+ //是否为添加组件操作
534
+ defaultGValue['isAdd'] = this.container.isAdd === true;
535
+ //面板首次加载
536
+ defaultGValue['isFirst'] = true;
477
537
  let Attr = this.$xdUniHelper.customClone(this.Attr);
478
538
  AttrObj[`${type}.isFn`] = true;
479
539
  AttrObj[`${type}.Fn`] = Attr[type];
480
- AttrObj[type] = Attr[type](params);
540
+ AttrObj[type] = Attr[type](params, defaultGValue);
481
541
  } else {
482
542
  AttrObj[type].map(item => {
483
543
  if (item.value !== undefined) {
@@ -493,10 +553,12 @@ export default {
493
553
  });
494
554
 
495
555
  //发送点击组件事件
556
+ let sendContainer = this.$xdUniHelper.cloneDeep(this.container);
557
+ sendContainer.defaultData = this.$xdUniHelper.cloneDeep(this.gStyleValue||{});//设置全局默认值
496
558
  XdBus.send('onSelectPackage', {
497
559
  containerId: this.containerId,
498
560
  Attr: this.$xdUniHelper.customClone(AttrObj),
499
- container: this.$xdUniHelper.cloneDeep(this.container)
561
+ container: sendContainer
500
562
  });
501
563
 
502
564
  //绑定选中插件事件
@@ -735,6 +797,7 @@ export default {
735
797
  let showActivityPrice = getContainerPropsValue(container, "content.showActivityPrice", "N");
736
798
  let isShowTag = getContainerPropsValue(container, "content.isShowTag", "Y");
737
799
  let isAddCart = getContainerPropsValue(container, "content.isAddCart", "N");
800
+ let showFreeShipping = getContainerPropsValue(container, "content.showFreeShipping", "N");
738
801
  return {
739
802
  isShowDiscount: isShowDiscount,
740
803
  isPrice: isPrice,
@@ -743,6 +806,7 @@ export default {
743
806
  showActivityPrice:showActivityPrice,
744
807
  isShowTag : isShowTag,
745
808
  differ: differ,
809
+ showFreeShipping: showFreeShipping
746
810
  }
747
811
  },
748
812
 
@@ -907,30 +971,55 @@ export default {
907
971
  }
908
972
  },
909
973
 
910
- handleH5ToMP(app_id,url,params){
911
- debugger
974
+ getProductTagsParams(conf=null,data={}){
975
+ var temp = [];
976
+ let defaultValue = {
977
+ isShowTag:"market",
978
+ showActivityPrice:"flashsale",
979
+ showTag: "market",
980
+ }
981
+ try{
982
+ if(conf) {
983
+ conf = JSON.parse(conf).value;
984
+ conf={
985
+ ...defaultValue,
986
+ ...conf,
987
+ }
988
+ Object.keys(data).map(key=>{
989
+ if(data[key] === 'Y') {
990
+ temp.push(conf[key]);
991
+ }
992
+ })
993
+ }
994
+ else {
995
+ temp = [];
996
+ }
997
+ }catch(e){
998
+ temp = []
999
+ }
1000
+ return temp
912
1001
  },
913
-
914
- handleMpToMP(app_id,url,params){
915
-
1002
+ getProductTagsKeys(conf=null,container,type='productList'){
1003
+ let defaultValue
1004
+ if(type==='productList' ){
1005
+ defaultValue = ["isShowTag","showActivityPrice"]
1006
+ } else {
1007
+ defaultValue = ["showTag","showActivityPrice"]
1008
+ }
1009
+ try{
1010
+ if(conf) conf = JSON.parse(conf).keys;
1011
+ else conf = []
1012
+ }catch(e){
1013
+ conf = []
1014
+ }
1015
+ conf = conf.concat(defaultValue)
1016
+ let tagList = {}
1017
+ conf.map(item=>{
1018
+ tagList[item] = getContainerPropsValue(container, `content.${item}`, "N");
1019
+ })
1020
+ return tagList
916
1021
  },
917
- /**
918
- * @description 处理站点应用内部跳转微信小程序处理
919
- * @param code {string} 站点内部微信小程序aopen_app_code
920
- * @param type {string} h5|wxmp
921
- * @param url {string} 内部链接地址
922
- * @param params {string} 自定义参数 例如:id=1&cid=1234
923
- */
924
- codeForGetAppId(code, type, url,params){
925
- this.wxCodeForGetAppId({app_code: code})
926
- .then(app_id=>{
927
- if(type === 'h5') this.handleH5ToMP(app_id,url, params || '');
928
- if(type === 'wxmp') this.handleMpToMP( app_id, url, params || '')
929
- })
930
- .catch(err=>{
931
- console.error(err)
932
- })
933
- }
1022
+
934
1023
  }
935
1024
  }
936
1025
 
@@ -1,46 +0,0 @@
1
- 'use strict';
2
- /**
3
- * @description 接口配置,
4
- * 在设置方法名字当时候,别忘记加上【模块名字】:Points
5
- * @type {*[]}
6
- */
7
- module.exports = [
8
- {
9
- mapFnName: 'getListBaseNewsContent', //自定义方法名字(必选)
10
- title: '获取内容',
11
- path: '/cms/v1/news-content',
12
- isRule: false,
13
- params: {
14
- scene: ['使用场景', 'String', '选填'],
15
- container_id: ['插件ID', 'String', '必填'],
16
- page_id: ['页面ID', 'String', '必填'],
17
- page_size: ['记录条数', 'Number', '必填', 1],
18
- code: ['业务线id', 'String', '选填'],
19
- },
20
- isConsole: true,
21
- disabled: true,
22
- },
23
- {
24
- mapFnName: 'getBalanceDetail',
25
- title: '用户资产 - 获取钱包(或积分)余额详情',
26
- path: '/pay/v1/property/wallet-detail',
27
- isRule: false,
28
- params: {
29
- method: ['wallet 余额; score 积分;', 'Number', '非必选'],
30
- },
31
- isConsole: true,
32
- disabled: true,
33
- },
34
- {
35
- mapFnName: 'getBalanceWalletTradeList',
36
- title: '用户资产 - 获取钱包(或积分)交易记录列表',
37
- path: '/pay/v1/property/wallet-trade/list',
38
- isRule: false,
39
- params: {
40
- wallet_type: ['钱包类型', 'Number', '必选'],
41
- page_size: ['每页条数', 'Number', '必选'],
42
- },
43
- isConsole: true,
44
- disabled: true,
45
- },
46
- ];
@@ -1,316 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * @description 当表单组件中有联动操作时候,使用方法进行返回
5
- */
6
- export default {
7
- style: [],
8
- content: (data) => {
9
- return [
10
- {
11
- label: '外边距:',
12
- ele: 'xd-margin-padding',
13
- valueKey: 'bodyMargin',
14
- groupKey: 'style',
15
- value: data['bodyMargin'] || null,
16
- setting: {
17
- type: 'margin',
18
- },
19
- placeholder: '请设置外边距',
20
- inline: false,
21
- notice: '设置外边距,<span style="color: red">单位:像素</span>。默认值:<span style="color: red">0</span>像素',
22
- },
23
- {
24
- label: '外填充:',
25
- ele: 'xd-margin-padding',
26
- valueKey: 'bodyPadding',
27
- groupKey: 'style',
28
- value: data['bodyPadding'] || null,
29
- setting: {
30
- type: 'padding',
31
- },
32
- placeholder: '请设置外填充',
33
- inline: false,
34
- notice: '设置填充值,<span style="color: red">单位:像素</span>。默认值:<span style="color: red">20</span>像素',
35
- },
36
- {
37
- label: '圆角设置:',
38
- ele: 'xd-site-select-list',
39
- valueKey: 'radius',
40
- value: data['radius'] || '20',
41
- labelInline: true,
42
- groupKey: 'style',
43
- placeholder: '请选择圆角设置',
44
- multiple: false,
45
- className: 'input60',
46
- handleCustom({ action, data }) {
47
- XdBus.getParentApi('getOptionsSettingList')({
48
- setting_id: 'edtix_style_radius',
49
- key: Date.now()
50
- })
51
- .then(res => {
52
- data.cb(res.list)
53
- })
54
- .catch(error => {
55
- console.error(error);
56
- });
57
- },
58
- },
59
- {
60
- label: "边框设置:",
61
- ele: "xd-border",
62
- valueKey: "bodyBorder",
63
- value: data['bodyBorder'] || { type: 'Y', value: { color: '#eee', style: "solid", width: '1' } },
64
- className: 'input80',
65
- groupKey: 'style',
66
- },
67
- {
68
- label: '背景颜色:',
69
- ele: 'xd-color',
70
- valueKey: 'bgColor',
71
- groupKey: 'style',
72
- value: data['bgColor'] || null,
73
- placeholder: '请选择背景颜色',
74
- labelInline: true,
75
- classNmae: 'input80',
76
- },
77
- {
78
- label: '公告内容:',
79
- ele: 'xd-site-news',
80
- valueKey: 'notice',
81
- groupKey: 'content',
82
- value: data.notice || null,
83
- className: 'input70',
84
- setting: {
85
- config: {
86
- sort: true,
87
- maxlen: 100,
88
- action: 'aliyun',
89
- size: 5,
90
- tipsformet: '上传文件格式:@imageType@,不超过@size@MB.',
91
- uploadType: 'aliyun',
92
- type: ['jpg', 'png', 'jpeg']
93
- },
94
- },
95
- handleCustom({ action, data }) {
96
- if (data && data.params) {
97
- //当一个插件中出现使用内容分类时候需要设置code值,在页面引用时候容器id + code进行拼接
98
- //data.params = Object.assign({}, data.params, {code: 'g_test_id'});
99
- }
100
-
101
- //获取返回参数(场景类型名称为必填)
102
- //获取返回参数(场景类型名称为必填)
103
- let loading = { close() { } }
104
-
105
- //获取显示内容
106
- if (action === 'screen') {
107
- XdBus.getParentApi('getOptionsSettingList')({ setting_id: 'edtix_bucket_content_tip' })
108
- .then(res => {
109
- loading.close();
110
- data.cb(res['list'])
111
- })
112
- .catch(error => {
113
- console.error(error);
114
- loading.close();
115
- });
116
-
117
- }
118
-
119
- //获取返回参数(广告位高度必选项)
120
- if (action === 'getNewsInfo') {
121
- XdBus.getParentApi('cmsGetPublishEditxContent')(data.params)
122
- .then(res => {
123
- loading.close()
124
- data.cb({ list: res.list, selectId: res.selected })
125
- })
126
- .catch(error => {
127
- loading.close()
128
- console.error(error);
129
- });
130
- }
131
-
132
- //获取产品业务线列表
133
- if (action === 'namespace') {
134
- XdBus.getParentApi('getOptionsNamespaces')({})
135
- .then(res => {
136
- loading.close()
137
- data.cb(res['list'])
138
- })
139
- .catch(error => {
140
- loading.close()
141
- console.error(error);
142
- });
143
- }
144
-
145
- //使用内容分类
146
- if (action === 'cmsPublishEditxContent') {
147
- loading = XdBus.getParentApi('loading')({});
148
- XdBus.getParentApi('cmsPublishEditxContent')(data.params)
149
- .then(res => {
150
- console.log('cmsPublishEditxContent', res)
151
- loading.close();
152
- data.cb(res)
153
- })
154
- .catch(error => {
155
- loading.close();
156
- console.error(error);
157
- });
158
- }
159
-
160
- //位置列表
161
- if (action === 'getListPostion') {
162
- loading = XdBus.getParentApi('loading')({});
163
- XdBus.getParentApi('getListNewsPosition')(data.params)
164
- .then(res => {
165
- loading.close();
166
- data.cb(res)
167
- })
168
- .catch(error => {
169
- loading.close();
170
- console.error(error);
171
- });
172
- }
173
-
174
- //位置创建
175
- if (action === 'addPostion') {
176
- loading = XdBus.getParentApi('loading')({});
177
- XdBus.getParentApi('addNewsPosition')(data.params)
178
- .then(res => {
179
- loading.close();
180
- data.cb(true)
181
- })
182
- .catch(error => {
183
- console.error(error);
184
- loading.close();
185
- data.cb(false)
186
- });
187
- }
188
-
189
- //位置编辑
190
- if (action === 'editPostion') {
191
- loading = XdBus.getParentApi('loading')({});
192
- XdBus.getParentApi('updateNewsPosition')(data.params)
193
- .then(res => {
194
- loading.close();
195
- data.cb(true)
196
- })
197
- .catch(error => {
198
- console.error(error);
199
- loading.close();
200
- data.cb(false)
201
- });
202
- }
203
-
204
- //位置删除
205
- if (action === 'deleltePostion') {
206
- loading = XdBus.getParentApi('loading')({});
207
- XdBus.getParentApi('deleteNewsPosition')(data.params)
208
- .then(res => {
209
- loading.close();
210
- data.cb(true)
211
- })
212
- .catch(error => {
213
- console.error(error);
214
- loading.close();
215
- data.cb(false)
216
- });
217
- }
218
-
219
- //获取广告位内容列表
220
- if (action === 'getListContent') {
221
- loading = XdBus.getParentApi('loading')({});
222
- XdBus.getParentApi('getListNewsContent')(data.params)
223
- .then(res => {
224
- loading.close();
225
- data.cb(res)
226
- })
227
- .catch(error => {
228
- loading.close();
229
- console.error(error);
230
- });
231
- }
232
-
233
- //广告内容创建
234
- if (action === 'addContent') {
235
- loading = XdBus.getParentApi('loading')({});
236
- XdBus.getParentApi('addNewsContent')(data.params)
237
- .then(res => {
238
- loading.close();
239
- data.cb(true)
240
- })
241
- .catch(error => {
242
- console.error(error);
243
- loading.close();
244
- data.cb(false)
245
- });
246
- }
247
-
248
- //广告内容编辑
249
- if (action === 'editContent') {
250
- loading = XdBus.getParentApi('loading')({});
251
- XdBus.getParentApi('updateNewsContent')(data.params)
252
- .then(res => {
253
- loading.close();
254
- data.cb(true)
255
- })
256
- .catch(error => {
257
- console.error(error);
258
- loading.close();
259
- data.cb(false)
260
- });
261
- }
262
-
263
- //广告内容删除
264
- if (action === 'deleteContent') {
265
- loading = XdBus.getParentApi('loading')({});
266
- XdBus.getParentApi('deleteNewsContent')(data.params)
267
- .then(res => {
268
- loading.close();
269
- data.cb(true)
270
- })
271
- .catch(error => {
272
- console.error(error);
273
- loading.close();
274
- data.cb(false)
275
- });
276
- }
277
-
278
- //内容发布
279
- if (action === 'publish') {
280
- loading = XdBus.getParentApi('loading')({});
281
- console.log('publish', data.params)
282
- XdBus.getParentApi('cmsPublishContent')(data.params)
283
- .then(res => {
284
- loading.close();
285
- data.cb(res)
286
- })
287
- .catch(error => {
288
- loading.close();
289
- console.error(error);
290
- });
291
- }
292
-
293
- //通知页面进行刷新
294
- if (action === 'update') {
295
- loading = XdBus.getParentApi('loading')({});
296
- XdBus.getParentApi('getXdBusUpdateView')('onUpdateView', {});
297
- loading.close()
298
- }
299
- },
300
- },
301
- {
302
- label: '提现入口路径:',
303
- ele: 'xd-select-pages-path',
304
- valueKey: 'withDrawRoutePath',
305
- groupKey:'advanced',
306
- placeholder: '请选择提现入口路径',
307
- value: data['withDrawRoutePath'] || {},
308
- setting: {
309
- router: XdBus.getParentApi('getPagesTree'),
310
- },
311
- inline: false,
312
- },
313
- ].filter(i => i)
314
- },
315
- advanced: [],
316
- };