jufubao-base 1.0.19 → 1.0.21

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 (39) hide show
  1. package/package.json +2 -1
  2. package/src/components/JfbBaseAfterOrderList/Api.js +60 -0
  3. package/src/components/JfbBaseAfterOrderList/Attr.js +154 -0
  4. package/src/components/JfbBaseAfterOrderList/JfbBaseAfterOrderList.vue +203 -0
  5. package/src/components/JfbBaseAfterOrderList/JfbBaseAfterOrderListLess.less +57 -0
  6. package/src/components/JfbBaseAfterOrderList/JfbBaseAfterOrderListMixin.js +222 -0
  7. package/src/components/JfbBaseBlock/JfbBaseBlock.vue +20 -0
  8. package/src/components/JfbBaseBlock/JfbBaseBlockMixin.js +42 -4
  9. package/src/components/JfbBaseCard/JfbBaseCardMixin.js +42 -4
  10. package/src/components/JfbBaseCardBind/JfbBaseCardBindMixin.js +42 -4
  11. package/src/components/JfbBaseCardDetail/JfbBaseCardDetailMixin.js +42 -4
  12. package/src/components/JfbBaseCardInfo/JfbBaseCardInfoMixin.js +42 -4
  13. package/src/components/JfbBaseCardMy/JfbBaseCardMyMixin.js +42 -4
  14. package/src/components/JfbBaseCardShift/JfbBaseCardShiftMixin.js +42 -4
  15. package/src/components/JfbBaseFooter/Attr.js +82 -0
  16. package/src/components/JfbBaseFooter/JfbBaseFooter.vue +111 -40
  17. package/src/components/JfbBaseFooter/JfbBaseFooterMixin.js +49 -3
  18. package/src/components/JfbBaseLine/JfbBaseLineMixin.js +42 -4
  19. package/src/components/JfbBaseLogin/JfbBaseLogin.vue +172 -51
  20. package/src/components/JfbBaseLogin/JfbBaseLoginMixin.js +42 -4
  21. package/src/components/JfbBaseMy/Api.js +60 -0
  22. package/src/components/JfbBaseMy/Attr.js +54 -0
  23. package/src/components/JfbBaseMy/JfbBaseMy.vue +262 -0
  24. package/src/components/JfbBaseMy/JfbBaseMyLess.less +57 -0
  25. package/src/components/JfbBaseMy/JfbBaseMyMixin.js +222 -0
  26. package/src/components/JfbBaseOrderList/Api.js +60 -0
  27. package/src/components/JfbBaseOrderList/Attr.js +154 -0
  28. package/src/components/JfbBaseOrderList/JfbBaseOrderList.vue +285 -0
  29. package/src/components/JfbBaseOrderList/JfbBaseOrderListLess.less +57 -0
  30. package/src/components/JfbBaseOrderList/JfbBaseOrderListMixin.js +222 -0
  31. package/src/components/JfbBaseSetPwd/JfbBaseSetPwdMixin.js +42 -4
  32. package/src/components/JfbBaseSuccess/Attr.js +68 -0
  33. package/src/components/JfbBaseSuccess/JfbBaseSuccess.vue +327 -0
  34. package/src/components/JfbBaseSuccess/JfbBaseSuccessLess.less +57 -0
  35. package/src/components/JfbBaseSuccess/JfbBaseSuccessMixin.js +222 -0
  36. package/src/components/JfbBaseTestApi/JfbBaseTestApiMixin.js +42 -4
  37. package/src/components/JfbBaseTestBody/JfbBaseTestBodyMixin.js +37 -3
  38. package/src/components/JfbBaseTestBottom/JfbBaseTestBottomMixin.js +37 -3
  39. package/src/components/JfbBaseTestTop/JfbBaseTestTopMixin.js +37 -3
@@ -0,0 +1,82 @@
1
+ 'use strict';
2
+ export default {
3
+ style: [],
4
+ advanced: [],
5
+ content: [
6
+ {
7
+ label: '', //label
8
+ ele: 'slot', //package 名称
9
+ slot: 'is_reference_title',
10
+ },
11
+ {
12
+ label: '背景颜色:', //label
13
+ ele: 'xd-color', //package 名称
14
+ valueKey: 'bgColor', //form[valueKey]
15
+ value: '#f9f9f9', //v-model
16
+ placeholder: '请选择背景颜色',
17
+ setting: {
18
+ isAlpha: false
19
+ },
20
+ classNmae: 'input80', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
21
+ rules: [
22
+ {
23
+ required: true,
24
+ message: '请选择背景颜色',
25
+ trigger: 'change'
26
+ },
27
+ ]
28
+ },
29
+ {
30
+ label: '菜单文字颜色:', //label
31
+ ele: 'xd-color', //package 名称
32
+ valueKey: 'color', //form[valueKey]
33
+ value: '#333', //v-model
34
+ setting: {
35
+ isAlpha: false
36
+ },
37
+ placeholder: '请选择菜单文字颜色',
38
+ classNmae: 'input80', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
39
+ },
40
+ {
41
+ label: '菜单文字选中颜色:', //label
42
+ ele: 'xd-color', //package 名称
43
+ valueKey: 'selectedColor', //form[valueKey]
44
+ setting: {
45
+ isAlpha: false
46
+ },
47
+ value: '#c00', //v-model
48
+ placeholder: '请选择菜单文字选中颜色',
49
+ classNmae: 'input80', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
50
+ },
51
+ {
52
+ label: '菜单配置:', //label
53
+ ele: 'xd-footer-setting', //package 名称
54
+ valueKey: 'footer-setting', //form[valueKey]
55
+ value: [],
56
+ setting: {
57
+ router: XdBus.getParentData('getPagesTree'),
58
+ },
59
+ handleCustom({action,data}){
60
+ console.log(`handleCustom.${action}`, data);
61
+ if(action === 'number') {
62
+ XdBus.getParentApi('getOptionsNoticeNumber')()
63
+ .then(res => {
64
+ data.cb(res.list)
65
+ })
66
+ .catch();
67
+ }
68
+ },
69
+ inline: false,
70
+ notice: '设置底部菜单的链接地址、标题(最多<sapn style="color: red">五个汉字</sapn>)、ICON图标(<a href="https://www.iconfont.cn/manage/index?spm=a313x.7781069.1998910419.db775f1f3&manage_type=myprojects&projectId=3378319&keyword=&project_type=&page=" style="color: blue" target="_blank">ICONFONT库</a>)、ICON大小(单位:<sapn style="color: red">像素</sapn>)和是否有消息数量显示(无数量显示可以不填写)',
71
+ rules: [
72
+ {required: true, message: '请添加内容', trigger: 'change'},
73
+ ],
74
+ },
75
+ {
76
+ label: '', //label
77
+ ele: 'slot', //package 名称
78
+ slot: 'is_reference',
79
+ },
80
+ ],
81
+ };
82
+
@@ -13,78 +13,149 @@
13
13
  <view class="jfb-base-footer__edit-icon" @click="delEdit">删除</view>
14
14
  </view>
15
15
  <!-- #endif -->
16
- <view class="jfb-base-footer__body">
17
- <view>测试插件( {{containerId}} )</view>
16
+ <view class="jfb-base-footer__body" :style="{height:height + 'rpx'}">
17
+ <xd-footer-bar
18
+ v-if="list !== null"
19
+ :height="height"
20
+ :tabbar="list"
21
+ :view="view"
22
+ :styles="styles"
23
+ :key="footerBarKey"
24
+ ></xd-footer-bar>
18
25
  </view>
19
26
  </view>
20
27
  </template>
21
28
 
22
29
  <script>
23
30
  import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
31
+ import XdFooterBar from "@/components/XdFooterBar/XdFooterBar";
24
32
  import { jfbRootExec } from "@/utils/xd.event";
25
33
  import JfbBaseFooterMixin from "./JfbBaseFooterMixin";
26
- import { getContainerPropsValue } from "@/utils/xd.base";
34
+ import {getNoUrl} from "@/utils/nourl";
35
+ import {
36
+ getContainerPropsValue,
37
+ getComponentAttr
38
+ } from "@/utils/xd.base";
27
39
  export default {
28
40
  name: "JfbBaseFooter",
29
41
  components: {
30
- XdFontIcon
42
+ XdFontIcon,
43
+ XdFooterBar
31
44
  },
32
45
  mixins: [
33
46
  JfbBaseFooterMixin
34
47
  ],
35
48
  data() {
36
49
  return {
37
-
38
- //todo
50
+ height: 0,
51
+ list: null,
52
+ view: false,
53
+ numObj: {},
54
+ footerBarKey: 'footerBarKey', //刷新
55
+
39
56
  }
40
57
  },
41
58
  watch: {
42
59
  container(value) {
43
- this.init(value)
60
+ this.init(value);
61
+ this.getNumber()
62
+ this.footerBarKey = this.$xdUniHelper.randomChar(20);
44
63
  }
45
64
  },
46
65
  created() {
66
+ this.view = window['jfbConfingView'] === 'preview';
67
+
68
+ //设置高度
69
+ if(window['jfbConfingView'] === 'preview') {
70
+ this.height = getComponentAttr(this.componentAttr, 'height') - 4;
71
+ }
72
+ else {
73
+ this.height = getComponentAttr(this.componentAttr, 'height');
74
+ }
75
+
47
76
  this.init(this.container);
48
-
49
- //todo
50
77
  },
51
78
  methods: {
52
79
  onJfbLoad(options) {
53
-
54
- // jfbRootExec('baiduUserLogin', {
55
-
56
- // vm: this,// data: {
57
-
58
- // account: 'gaoshiyong',// password: '123456789',// type: 3,// ...options
59
-
60
- // }
61
-
62
- // }).then().catch()
80
+ this.getNumber()
63
81
  },
82
+
64
83
  /**
65
- * @description 监听事件变化
66
- * @param container {object} 业务组件对象自己
84
+ * @description 从后台获取消息数量
67
85
  */
68
- init(value) {
69
-
70
- //this.bgcolor = getContainerPropsValue(value, 'content.bgcolor', '#fff');
71
-
72
- //this.height = getContainerPropsValue(value, 'content.height', 10);
73
- },
74
- onJfbScroll(options) {
75
- console.log('event.onJfbScroll', options)
76
- },
77
- onJfbReachBottom(options) {
78
- console.log('event.onJfbReachBottom', options)
86
+ getNumber(){
87
+ let bar = getContainerPropsValue(this.container, 'content.footer-setting', []);
88
+ let params = [];
89
+ bar.map((item, index) => {
90
+ if(item.api) {
91
+ let urlObj = this.$xdUniHelper.parseURL(item.api);
92
+ params.push({
93
+ url: urlObj.path,
94
+ index: index,
95
+ params: {
96
+ ...urlObj.params,
97
+ }
98
+ })
99
+ }
100
+ });
101
+
102
+ //预览模式
103
+ if(this.view) {
104
+ this.setNumber(params, params.map(item=>{
105
+ return {
106
+ num: [9,99,199][this.$xdUniHelper.random(0,2)]
107
+ }
108
+ }));
109
+ return;
110
+ }
111
+
112
+ //打包模式
113
+ getNoUrl(params)
114
+ .then(res=>{
115
+ this.setNumber(params, res);
116
+ })
117
+ .catch(error=>{
118
+ console.log(error)
119
+ });
79
120
  },
80
- onJfbShow(options) {
81
- console.log('event.onJfbShow', options)
82
- },
83
- onJfbHide(options) {
84
- console.log('event.onJfbHide', options)
121
+
122
+ /**
123
+ * @description 设置系统消息数量
124
+ * @param params {Array} 请求参数
125
+ * @param result {Array} 返回结果
126
+ */
127
+ setNumber(params, result){
128
+ let index = {};
129
+ params.map((item, idx)=>{
130
+ if(result[idx]['num'] > 99) result[idx]['num'] = '99+';
131
+ index[item.index] = result[idx]['num'];
132
+ });
133
+ this.numObj = index;
134
+ this.init(this.container);
135
+ this.footerBarKey = this.$xdUniHelper.randomChar(20);
85
136
  },
86
- onJfbBack(options) {
87
- console.log('event.onJfbBack', options)
137
+
138
+ /**
139
+ * @description 监听事件变化
140
+ * @param value {object} 业务组件对象自己
141
+ */
142
+ init(value) {
143
+ //设置底部菜单
144
+ let bar = getContainerPropsValue(value, 'content.footer-setting', []);
145
+ this.list = {
146
+ bgColor: getContainerPropsValue(value, 'content.bgColor', '#fff'),
147
+ selectedColor: getContainerPropsValue(value, 'content.selectedColor', '#fff'),
148
+ color: getContainerPropsValue(value, 'content.color', '#333'),
149
+ list: bar.map((item,index)=>{
150
+ return {
151
+ name: item.name,
152
+ icon: item.icon,
153
+ path: item.path.value,
154
+ size: item.size,
155
+ num: this.numObj[index] ? this.numObj[index]: 0 ,
156
+ }
157
+ }),
158
+ };
88
159
  },
89
160
  }
90
161
  }
@@ -96,7 +167,7 @@
96
167
 
97
168
  .jfb-base-footer {
98
169
  &__body{
99
-
170
+ box-sizing: border-box;
100
171
  }
101
172
  }
102
173
  </style>
@@ -1,5 +1,9 @@
1
1
  'use strict';
2
2
 
3
+ //@AttrImport
4
+ import Attr from "./Attr";
5
+ //@EndAttrImport
6
+
3
7
  import {getContainerPropsValue} from "@/utils/xd.base";
4
8
  export default {
5
9
  props: {
@@ -88,13 +92,32 @@ export default {
88
92
  containerId: null, //容器ID
89
93
  //#ifdef H5
90
94
 
95
+ //@AttrData
96
+ Attr:{}, //对外开发编辑属性
97
+ //@EndAttrData
98
+
91
99
  active: false, //是否选择当前状态
92
100
  isEditx: true, //当前为Editx模式
93
101
  edit: false, //是否开启编辑模式
94
102
  // #endif
103
+
104
+ //风格键
105
+ mainColor: '',
106
+ successColor: '',
107
+ warningColor: '',
108
+ subMainColor: '',
109
+ infoColor: '',
110
+ defaultColor: '',
111
+ dangerColor: ''
95
112
  }
96
113
  },
97
114
  created() {
115
+
116
+ //@AttrDataCreated
117
+ this.Attr = this.$xdUniHelper.customClone(Attr);
118
+ //@EndAttrDataCreated
119
+
120
+
98
121
  //设置插件cid
99
122
  if (this.cid) {
100
123
  this.containerId = this.cid;
@@ -102,6 +125,9 @@ export default {
102
125
  this.containerId = this.$xdUniHelper.randomChar(20);
103
126
  }
104
127
 
128
+ //初始化风格
129
+ this.initThemesToData();
130
+
105
131
  //#ifdef H5
106
132
  //监听用户点击状态显示虚框
107
133
  XdBus.addEvent('select', ({containerId}) => {
@@ -124,6 +150,26 @@ export default {
124
150
  onCheck() {
125
151
  },
126
152
 
153
+ /***
154
+ * @description 业务组件风格map到data中
155
+ */
156
+ initThemesToData() {
157
+ Object.keys(this.styles).map(key => {
158
+ let k = key.replace('$', '');
159
+ if (this[k] !== undefined) this[k] = this.styles[key];
160
+ });
161
+ console.log('initThemesToData',this)
162
+ },
163
+
164
+ /**
165
+ * @description 其子级插件获取当前插件的业务组件风格列表
166
+ * @returns {*}
167
+ */
168
+ getParentThemes(){
169
+ return this.styles;
170
+ },
171
+
172
+
127
173
  //#ifdef H5
128
174
  /**
129
175
  * @description 点击删除操作按钮
@@ -145,8 +191,8 @@ export default {
145
191
  //#ifdef H5
146
192
  if (this.active) return;
147
193
  this.active = true;
148
- let AttrObj = this.$xdUniHelper.checkVarType(Attr) === 'object' ?
149
- Attr: { style: [], advanced: [], content: []};
194
+ let AttrObj = this.$xdUniHelper.checkVarType(this.Attr) === 'object' ?
195
+ this.Attr : { style: [], advanced: [], content: []};
150
196
  console.log('handleSelect.Attr', AttrObj);
151
197
 
152
198
  //设置已绑定数据
@@ -161,7 +207,7 @@ export default {
161
207
  XdBus.send('onSelectPackage', {
162
208
  containerId: this.containerId,
163
209
  Attr: AttrObj,
164
- container: this.container
210
+ container: this.$xdUniHelper.cloneDeep(this.container)
165
211
  });
166
212
 
167
213
  //绑定选中插件事件
@@ -93,16 +93,31 @@ export default {
93
93
  //#ifdef H5
94
94
 
95
95
  //@AttrData
96
- Attr, //对外开发编辑属性
96
+ Attr:{}, //对外开发编辑属性
97
97
  //@EndAttrData
98
98
 
99
99
  active: false, //是否选择当前状态
100
100
  isEditx: true, //当前为Editx模式
101
101
  edit: false, //是否开启编辑模式
102
102
  // #endif
103
+
104
+ //风格键
105
+ mainColor: '',
106
+ successColor: '',
107
+ warningColor: '',
108
+ subMainColor: '',
109
+ infoColor: '',
110
+ defaultColor: '',
111
+ dangerColor: ''
103
112
  }
104
113
  },
105
114
  created() {
115
+
116
+ //@AttrDataCreated
117
+ this.Attr = this.$xdUniHelper.customClone(Attr);
118
+ //@EndAttrDataCreated
119
+
120
+
106
121
  //设置插件cid
107
122
  if (this.cid) {
108
123
  this.containerId = this.cid;
@@ -110,6 +125,9 @@ export default {
110
125
  this.containerId = this.$xdUniHelper.randomChar(20);
111
126
  }
112
127
 
128
+ //初始化风格
129
+ this.initThemesToData();
130
+
113
131
  //#ifdef H5
114
132
  //监听用户点击状态显示虚框
115
133
  XdBus.addEvent('select', ({containerId}) => {
@@ -132,6 +150,26 @@ export default {
132
150
  onCheck() {
133
151
  },
134
152
 
153
+ /***
154
+ * @description 业务组件风格map到data中
155
+ */
156
+ initThemesToData() {
157
+ Object.keys(this.styles).map(key => {
158
+ let k = key.replace('$', '');
159
+ if (this[k] !== undefined) this[k] = this.styles[key];
160
+ });
161
+ console.log('initThemesToData',this)
162
+ },
163
+
164
+ /**
165
+ * @description 其子级插件获取当前插件的业务组件风格列表
166
+ * @returns {*}
167
+ */
168
+ getParentThemes(){
169
+ return this.styles;
170
+ },
171
+
172
+
135
173
  //#ifdef H5
136
174
  /**
137
175
  * @description 点击删除操作按钮
@@ -153,8 +191,8 @@ export default {
153
191
  //#ifdef H5
154
192
  if (this.active) return;
155
193
  this.active = true;
156
- let AttrObj = this.$xdUniHelper.checkVarType(Attr) === 'object' ?
157
- Attr: { style: [], advanced: [], content: []};
194
+ let AttrObj = this.$xdUniHelper.checkVarType(this.Attr) === 'object' ?
195
+ this.Attr : { style: [], advanced: [], content: []};
158
196
  console.log('handleSelect.Attr', AttrObj);
159
197
 
160
198
  //设置已绑定数据
@@ -169,7 +207,7 @@ export default {
169
207
  XdBus.send('onSelectPackage', {
170
208
  containerId: this.containerId,
171
209
  Attr: AttrObj,
172
- container: this.container
210
+ container: this.$xdUniHelper.cloneDeep(this.container)
173
211
  });
174
212
 
175
213
  //绑定选中插件事件