jufubao-base 1.0.289-beta2 → 1.0.290-beta1

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 (28) hide show
  1. package/package.json +1 -1
  2. package/src/components/JfbBaseFooter/Attr.js +155 -10
  3. package/src/components/JfbBaseFooter/JfbBaseFooter.vue +43 -96
  4. package/src/components/JfbBaseSavingDetail/JfbBaseSavingDetail.vue +14 -2
  5. package/src/components/JfbBaseTfkSearch/Api.js +0 -15
  6. package/src/components/JfbBaseTfkSearch/CustomList.vue +0 -10
  7. package/src/components/JfbBaseTfkSearch/JfbBaseTfkSearch.vue +7 -247
  8. package/src/components/JfbBaseUserInfo/Attr.js +0 -12
  9. package/src/components/JfbBaseUserInfo/JfbBaseUserInfo.vue +2 -8
  10. package/src/mixins/componentsMixins.js +55 -363
  11. package/src/mixins/posterMixins.js +199 -27
  12. package/src/components/CusCouponChose/CusCouponChose.vue +0 -1027
  13. package/src/components/CusCouponItem/CusCouponItem.vue +0 -298
  14. package/src/components/CusEnter/CusEnter.vue +0 -360
  15. package/src/components/CusPoster/CusPoster.vue +0 -212
  16. package/src/components/CusPoster/CusSwiperDot.vue +0 -234
  17. package/src/components/CusProduct/CusProduct.vue +0 -372
  18. package/src/components/CusShops/CusShops.vue +0 -518
  19. package/src/components/CusSwiperDot/CusSwiperDot.vue +0 -234
  20. package/src/components/CusTab/CusTab.vue +0 -411
  21. package/src/components/CusVideo/CusVideo.vue +0 -170
  22. package/src/components/JfbBaseFooter/cusAttr/advanced.js +0 -12
  23. package/src/components/JfbBaseFooter/cusAttr/content.js +0 -447
  24. package/src/components/JfbBaseFooter/cusAttr/style.js +0 -7
  25. package/src/components/JfbBaseFooter/cusAttr/tools.js +0 -17
  26. package/src/components/JfbBaseTfkSearch/XdQueryFilter.vue +0 -354
  27. package/src/components/JfbBaseTfkSearch/XdQuerySort.vue +0 -192
  28. package/src/mixins/productCompMixins.js +0 -252
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.289-beta2",
3
+ "version": "1.0.290-beta1",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -1,18 +1,163 @@
1
1
  'use strict';
2
-
3
- import style from "./cusAttr/style";
4
- import advanced from "./cusAttr/advanced";
5
- import content from "./cusAttr/content";
2
+ import ICONS from '@/ICONS'
6
3
 
7
4
  export default {
8
5
  style: [],
9
- content: (data, gValue, gColor, oldData={}) => {
6
+ advanced: [],
7
+ content:(data)=>{
8
+ let footerSettingImage = [];
9
+ let footerSetting = [];
10
+ if(data['footerSettingImage'] && data['footerSettingImage'].length > 0 ) {
11
+ footerSettingImage = data['footerSettingImage'];
12
+ }
13
+ if(data['footer-setting'] && data['footer-setting'].length > 0){
14
+ footerSetting = data['footer-setting'];
15
+ footerSetting.map((item,index)=>{
16
+ if(!footerSettingImage[index]) footerSettingImage[index] = {};
17
+ footerSettingImage[index] = Object.assign({},JSON.parse(JSON.stringify(item)),footerSettingImage[index])
18
+ })
19
+ }
10
20
  return [
11
- ...content(data, gValue, gColor, oldData),
12
- ...style(data, gValue, gColor, oldData),
13
- ...advanced(data, gValue, gColor,oldData ),
14
- ].filter(i => i)
21
+ {
22
+ label: '',
23
+ ele: 'slot',
24
+ slot: 'is_reference_title',
25
+ groupKey: 'advanced',
26
+ },
27
+ {
28
+ label: '背景图设置:',
29
+ ele: 'xd-upload',
30
+ valueKey: 'backgroundImage',
31
+ groupKey:'content',
32
+ value: data.backgroundImage || {},
33
+ defaultValue: data.backgroundImage || null,
34
+ slot: true,
35
+ oneWidth: 375,
36
+ oneHeight: 55,
37
+ elinputClassName: 'input40',
38
+ tipsformet: '上传文件格式:@imageType@,不超过@size@MB。建议尺寸:<span style="color:red">750*110</span>像素',
39
+ type: ['jpg', 'png', 'jpeg'],
40
+ styleType: 'one',
41
+ uploadType: 'aliyun',
42
+ size: .5,
43
+ action: 'action',
44
+ sort: true,
45
+ maxlen: 1,
46
+ },
47
+ {
48
+ label: '背景颜色:',
49
+ ele: 'xd-color',
50
+ valueKey: 'bgColor',
51
+ groupKey:'content',
52
+ value: data['bgColor'] || '',
53
+ placeholder: '请选择背景颜色',
54
+ setting: {
55
+ isAlpha: false
56
+ },
57
+ classNmae: 'input80',
58
+ },
59
+ {
60
+ label: '边框颜色:',
61
+ ele: 'xd-color',
62
+ valueKey: 'borderColor',
63
+ groupKey:'content',
64
+ value: data['borderColor'] || '',
65
+ placeholder: '请选择边框颜色',
66
+ setting: {
67
+ isAlpha: false
68
+ },
69
+ classNmae: 'input80',
70
+ },
71
+ {
72
+ label: '菜单文字颜色:',
73
+ ele: 'xd-color',
74
+ valueKey: 'color',
75
+ groupKey:'content',
76
+ value: data['color'] || '',
77
+ setting: {
78
+ isAlpha: false
79
+ },
80
+ placeholder: '请选择菜单文字颜色',
81
+ classNmae: 'input80',
82
+ },
83
+ {
84
+ label: '菜单文字选中颜色:',
85
+ ele: 'xd-color',
86
+ valueKey: 'selectedColor',
87
+ groupKey:'content',
88
+ setting: {
89
+ isAlpha: false
90
+ },
91
+ value:data['selectedColor'] || '',
92
+ placeholder: '请选择菜单文字选中颜色',
93
+ classNmae: 'input80',
94
+ },
95
+ footerSetting.length > 0 && {
96
+ label: '菜单图片配置:',
97
+ ele: 'xd-footer-setting',
98
+ valueKey: 'footerSettingImage',
99
+ groupKey:'content',
100
+ value: footerSettingImage,
101
+ setting: {
102
+ router: XdBus.getParentApi('getPagesTree'),
103
+ hideAdd: true,
104
+ showField: {
105
+ path: false,
106
+ icon: false,
107
+ notice: false,
108
+ image: true,
109
+ actImage: true
110
+ }
111
+ },
112
+ handleCustom({action,data}){
113
+ if(action === 'number') {
114
+ XdBus.getParentApi('getOptionsNoticeNumber')()
115
+ .then(res => {
116
+ data.cb(res.list)
117
+ })
118
+ .catch();
119
+ }
120
+ },
121
+ },
122
+
123
+ {
124
+ label: '菜单配置:',
125
+ ele: 'xd-footer-setting',
126
+ valueKey: 'footer-setting',
127
+ groupKey:'advanced',
128
+ value: footerSetting,
129
+ setting: {
130
+ router: XdBus.getParentApi('getPagesTree'),
131
+ icons:ICONS,
132
+ showField: {
133
+ path: true,
134
+ icon: true,
135
+ notice: true,
136
+ }
137
+ },
138
+ handleCustom({action,data}){
139
+ console.log(`handleCustom.${action}`, data);
140
+ if(action === 'number') {
141
+ XdBus.getParentApi('getOptionsNoticeNumber')()
142
+ .then(res => {
143
+ data.cb(res.list)
144
+ })
145
+ .catch();
146
+ }
147
+ },
148
+ inline: false,
149
+ notice: '设置底部菜单的链接地址1、标题(最多<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>)和是否有消息数量显示(无数量显示可以不填写)',
150
+ rules: [
151
+ {required: true, message: '请添加内容', trigger: 'change'},
152
+ ],
153
+ },
154
+ {
155
+ label: '',
156
+ ele: 'slot',
157
+ slot: 'is_reference',
158
+ groupKey: 'advanced',
159
+ },
160
+ ].filter(i=>i);
15
161
  },
16
- advanced: [],
17
162
  };
18
163
 
@@ -23,7 +23,7 @@
23
23
  style="height:100%"
24
24
  v-if="list !== null"
25
25
  :height="height"
26
- :tab-bar="list"
26
+ :tabbar="list"
27
27
  :view="view"
28
28
  :styles="styles"
29
29
  :key="footerBarKey"
@@ -44,8 +44,7 @@
44
44
  import {getNoUrl} from "@/utils/nourl";
45
45
  import {
46
46
  getContainerPropsValue,
47
- getComponentAttr,
48
- gCPVal
47
+ getComponentAttr
49
48
  } from "@/utils/xd.base";
50
49
  import getServiceUrl from "@/common/getServiceUrl";
51
50
 
@@ -66,7 +65,6 @@
66
65
  backgroundSize: '100% 100%',
67
66
  backgroundRepeat: 'no-repeat',
68
67
  backgroundPosition: 'top center',
69
- backgroundColor: this.backgroundColor,
70
68
  '--border-color': this.borderColor
71
69
  }
72
70
 
@@ -76,46 +74,49 @@
76
74
  return params
77
75
  }
78
76
  },
79
- watch: {
80
- container(value,oloValue) {
81
- if(JSON.stringify(value) === JSON.stringify(oloValue)) return;
82
- if (this.$configProject['isPreview']){
83
- this.init(value);
84
- this.getNumber();
85
- this.footerBarKey = this.$xdUniHelper.randomChar(20);
86
- }
87
- }
88
- },
89
77
  data() {
90
78
  return {
91
- closeMask: true,
92
79
  height: 0,
93
80
  list: null,
94
81
  view: false,
95
82
  numObj: {},
96
83
  footerBarKey: 'footerBarKey', //刷新
97
84
  baseUrl: '',
98
- footerTpl:'', //模版样式
99
-
100
- //样式
101
85
  backgroundImage: '',
102
- backgroundColor:'#fff',
103
- borderColor: '',
86
+ borderColor: ''
87
+ }
88
+ },
89
+ watch: {
90
+ container(value,oloValue) {
91
+ if(JSON.stringify(value) === JSON.stringify(oloValue)) return;
92
+ if (this.$configProject['isPreview']){
93
+ this.init(value);
94
+ this.getNumber();
95
+ this.footerBarKey = this.$xdUniHelper.randomChar(20);
96
+ }
104
97
  }
105
98
  },
106
99
  created() {
107
100
  this.view = this.$configProject.isPreview;
108
101
 
102
+ //非预览模式
109
103
  //#ifdef H5
110
104
  if (!this.$configProject.isPreview){
111
105
  this.baseUrl = this.projectAttr['deploy_dir']
112
106
  }
113
107
  //#endif
114
108
 
115
- this.height = Number(getComponentAttr(this.componentAttr, 'height'));
109
+ //设置高度
110
+ if(this.$configProject.isPreview) {
111
+ this.height = getComponentAttr(this.componentAttr, 'height');
112
+ }
113
+ else {
114
+ this.height = getComponentAttr(this.componentAttr, 'height');
115
+ }
116
116
 
117
- this.init(this.container);
117
+ this.height = Number(this.height);
118
118
 
119
+ this.init(this.container);
119
120
  //监听重试消息数量
120
121
  this.$xdRoot.$on('restFooterNumber', this.handle)
121
122
  },
@@ -195,83 +196,29 @@
195
196
 
196
197
  /**
197
198
  * @description 监听事件变化
198
- * @param container {object} 业务组件对象自己
199
+ * @param value {object} 业务组件对象自己
199
200
  */
200
- init(container) {
201
- this.footerTpl = gCPVal(container, 'footerTpl', 'noraml');
202
-
201
+ init(value) {
203
202
  //设置底部菜单
204
- let settingKey = 'footer-setting';
205
- if(this.footerTpl === 'itemCenterBig') settingKey = 'footer-setting-center-big'
206
- let barList = gCPVal(container, settingKey, []);
207
- let imageIcons = gCPVal(container, 'footerSettingImage', []);
208
-
209
- this.backgroundImage = gCPVal(container, 'backgroundImage', '',{sKey:'navStatus',fields:['bgColor','backgroundImage','borderColor']});
210
- this.backgroundColor = gCPVal(container, 'bgColor', '#fff',{sKey:'navStatus',fields:['bgColor','backgroundImage','borderColor']});
211
- this.borderColor = gCPVal(container, 'bgColor', ['#fff','#eee'],{sKey:'navStatus',fields:['bgColor','backgroundImage','borderColor']});
212
- let color = gCPVal(container,'color', '');
213
- let selectedColor = gCPVal(container,'selectedColor', '');
214
- let isShowTitle = gCPVal(container, 'isShowTitle', 'Y');
215
- this.iconStyle = gCPVal(container, 'iconStyle', [
216
- {
217
- cusColor:{
218
- iconColor: '#333',
219
- color:'#333'
220
- },
221
- cusActColor:{
222
- color: this.mainColor,
223
- iconColor: this.mainColor
224
- }
225
- },
226
- {
227
- cusColor:{
228
- iconColor: color || '#333',
229
- color:color || '#333'
230
- },
231
- cusActColor:{
232
- color: selectedColor || this.mainColor,
233
- iconColor: selectedColor || this.mainColor
234
- }
235
- }
236
- ],{sKey:'iconStyleStatus',fields:['iconStyle','color','selectedColor']});
237
- let borderColor = gCPVal(container, 'centerColor', this.backgroundColor,{sKey:'iconCenterStatus',fields:['centerWidth','centerColor']});
238
- let borderWidth = gCPVal(container, 'centerWidth', 12,{sKey:'iconCenterStatus',fields:['centerWidth','centerColor']});
239
-
240
-
203
+ let bar = getContainerPropsValue(value, 'content.footer-setting', []);
204
+ let imageIcons = getContainerPropsValue(value, 'content.footerSettingImage', []);
205
+ this.backgroundImage = getContainerPropsValue(value, 'content.backgroundImage', '');
206
+ this.borderColor = getContainerPropsValue(value, 'content.borderColor', '#eee');
241
207
  this.list = {
242
- tpl:this.footerTpl,
243
- hasName: isShowTitle === 'Y',
244
- borderColor,
245
- borderWidth,
246
- bgColor: this.backgroundColor,
247
- color:this.iconStyle.cusColor.color,
248
- selectedColor:this.iconStyle.cusActColor.color,
249
- iconColor:this.iconStyle.cusColor.iconColor,
250
- selectedIconColor:this.iconStyle.cusActColor.iconColor,
251
- list: barList.map((item,index)=>{
252
- let selfImage = (item.image && item.image.url) ? getServiceUrl(item.image.url,'size3'):'';
253
- let selfActImage = (item.actImage && item.actImage.url) ? getServiceUrl(item.actImage.url,'size3'):'';
254
- let image = (selfImage || selfActImage) || this.getImage(imageIcons,index,'image') || this.getImage(imageIcons,index,'actImage');
255
- let actImage = (selfActImage || selfImage) || this.getImage(imageIcons,index,'actImage') || this.getImage(imageIcons,index,'image');
256
- let iconType = 'icon';
257
- if(!item['iconType'] && (actImage || image)) iconType = 'image';
258
- if(['icon','image'].includes(item['iconType'])) iconType = item['iconType'];
259
- let router = {
260
- path: (item.path && item.path.value) ? item.path.value :'',
208
+ bgColor: getContainerPropsValue(value, 'content.bgColor', '#fff'),
209
+ bodyStyle: this.bodyStyle,
210
+ selectedColor: getContainerPropsValue(value, 'content.selectedColor', this.mainColor),
211
+ color: getContainerPropsValue(value, 'content.color', '#333'),
212
+ list: bar.map((item,index)=>{
213
+ return {
214
+ name: item.name.slice(0, 6),
215
+ icon: item.icon,
216
+ path: item.path.value,
217
+ size: item.size,
261
218
  num: this.numObj[index] ? this.numObj[index]: 0 ,
219
+ image: this.getImage(imageIcons,index,'image') || this.getImage(imageIcons,index,'actImage'),
220
+ actImage: this.getImage(imageIcons,index,'actImage') || this.getImage(imageIcons,index,'image'),
262
221
  }
263
- if(isShowTitle === 'Y') router['name'] = item.name ? item.name.slice(0, 5): '';
264
- if(iconType === 'icon') {
265
- router['icon'] = item.icon;
266
- router['image'] = '';
267
- router['actImage'] = '';
268
- }
269
- if(iconType === 'image') {
270
- router['icon'] = '';
271
- router['image'] = image;
272
- router['actImage'] = actImage;
273
- }
274
- return router
275
222
  }),
276
223
  };
277
224
  },
@@ -287,12 +234,12 @@
287
234
  border-color: var(--border-color);
288
235
  }
289
236
  }
290
-
237
+
291
238
 
292
239
  .jfb-base-footer {
240
+
293
241
  &__body{
294
242
  box-sizing: border-box;
295
- overflow: inherit!important;
296
243
  }
297
244
  }
298
245
  </style>
@@ -529,8 +529,20 @@
529
529
  const month = String(date.getMonth() + 1);
530
530
  return `${year}年${month}月`;
531
531
  },
532
+ convertDateFormat(dateStr) {
533
+ if(!dateStr)return''
534
+ // 提取年份和月份
535
+ const year = dateStr.match(/(\d{4})年/)[1];
536
+ const month = dateStr.match(/(\d+)月/)[1];
537
+
538
+ // 确保月份是两位数
539
+ const formattedMonth = month.padStart(2, '0');
540
+
541
+ // 组合成目标格式
542
+ return `${year}-${formattedMonth}-01`;
543
+ },
532
544
  handleLastMonth() {
533
- const dateRange = new Date(this.monthDateRange.replace("年", "-").replace("月", "-01"));
545
+ const dateRange = new Date(this.convertDateFormat(this.monthDateRange));
534
546
  // 获取上一个月的日期范围
535
547
  const previousMonth = new Date(dateRange);
536
548
  previousMonth.setMonth(dateRange.getMonth() - 1);
@@ -540,7 +552,7 @@
540
552
  this.getMonthData()
541
553
  },
542
554
  handleNextMonth() {
543
- const dateRange = new Date(this.monthDateRange.replace("年", "-").replace("月", "-01"));
555
+ const dateRange = new Date(this.convertDateFormat(this.monthDateRange));
544
556
  // 获取下一个月的日期范围
545
557
  const nextMonth = new Date(dateRange);
546
558
  nextMonth.setMonth(dateRange.getMonth() + 1);
@@ -24,19 +24,4 @@ module.exports = [
24
24
  isConsole: true,
25
25
  disabled: true,
26
26
  },
27
- {
28
- //设置方法名字当别忘记加上【模块名字】:Tfk
29
- mapFnName: 'getTfkSearchFilterItems',
30
- title: '获取搜索筛选条件',
31
- path: '/mall/v1/msearch/search-filter',
32
- isRule: false,
33
- data: {
34
- type: ['类型', 'String', '必选'],
35
- namespace: ['业务线', 'Number', '非必选'],
36
- city_code: ['城市编码', 'Number', '非必选'],
37
- filter_item: ['纬度', 'Number', '非必选'],
38
- },
39
- isConsole: true,
40
- disabled: true,
41
- },
42
27
  ];
@@ -177,10 +177,6 @@ export default {
177
177
  tabId:{
178
178
  type:String,
179
179
  required:true
180
- },
181
- refresh: {
182
- type: String | Number,
183
- default: '',
184
180
  }
185
181
  },
186
182
 
@@ -286,12 +282,6 @@ export default {
286
282
  this.onCusReloadList();
287
283
  },
288
284
 
289
- refresh() {
290
- this.handleClear();
291
- this.parseTab()
292
- this.onCusReloadList();
293
- },
294
-
295
285
  stateCity(n, o){
296
286
  if(n && JSON.stringify(n) !== JSON.stringify(o)){
297
287
  this.onCusReloadList()