jufubao-base 1.0.197-beta1 → 1.0.197-beta11

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/commands.js +1 -1
  2. package/package.json +1 -1
  3. package/src/ICONS.js +1128 -0
  4. package/src/components/JfbBaseAddress/Attr.js +109 -1
  5. package/src/components/JfbBaseAddress/JfbBaseAddress.vue +164 -80
  6. package/src/components/JfbBaseAddress/XdAddress.vue +12 -6
  7. package/src/components/JfbBaseAddress/XdTfkItem.vue +117 -0
  8. package/src/components/JfbBaseCardEntry/Attr.js +472 -443
  9. package/src/components/JfbBaseCardEntry/JfbBaseCardEntry.vue +124 -98
  10. package/src/components/JfbBaseCardEntry/Mock.js +1 -0
  11. package/src/components/JfbBaseCardEntry/XdCardNew.vue +135 -0
  12. package/src/components/JfbBaseConDialog/JfbBaseConDialog.vue +41 -13
  13. package/src/components/JfbBaseFastLink/Attr.js +24 -8
  14. package/src/components/JfbBaseFastLink/JfbBaseFastLink.vue +37 -21
  15. package/src/components/JfbBaseFooter/Attr.js +141 -75
  16. package/src/components/JfbBaseFooter/JfbBaseFooter.vue +50 -15
  17. package/src/components/JfbBaseHeader/Attr.js +134 -51
  18. package/src/components/JfbBaseHeader/JfbBaseHeader.vue +118 -31
  19. package/src/components/JfbBaseHeaderElephant/Attr.js +496 -0
  20. package/src/components/JfbBaseHeaderElephant/JfbBaseHeaderElephant.vue +272 -15
  21. package/src/components/JfbBaseNotice/Attr.js +26 -0
  22. package/src/components/JfbBaseNotice/JfbBaseNotice.vue +13 -1
  23. package/src/components/JfbBaseOrderDetail/Attr.js +147 -65
  24. package/src/components/JfbBaseOrderDetail/JfbBaseOrderDetail.vue +97 -47
  25. package/src/components/JfbBaseOrderList/Attr.js +59 -2
  26. package/src/components/JfbBaseOrderList/JfbBaseOrderList.vue +139 -92
  27. package/src/components/JfbBaseOrderList/Mock.js +3 -0
  28. package/src/components/JfbBaseOrderList/XdTfkOrderItem.vue +267 -0
  29. package/src/components/JfbBasePosterBigSmall/JfbBasePosterBigSmall.vue +27 -29
  30. package/src/components/JfbBasePosterBigSmall/getWidthHeight.js +13 -9
  31. package/src/components/JfbBaseUserCenter/Attr.js +297 -52
  32. package/src/components/JfbBaseUserCenter/JfbBaseUserCenter.vue +135 -44
  33. package/src/components/JfbBaseUserInfo/Attr.js +313 -37
  34. package/src/components/JfbBaseUserInfo/JfbBaseUserInfo.vue +173 -63
  35. package/src/components/JfbBaseUserOrder/Attr.js +332 -30
  36. package/src/components/JfbBaseUserOrder/JfbBaseUserOrder.vue +183 -55
  37. package/src/components/JfbBaseWallet/Attr.js +376 -8
  38. package/src/components/JfbBaseWallet/JfbBaseWallet.vue +185 -49
  39. package/src/mixins/componentsMixins.js +210 -35
@@ -15,20 +15,41 @@
15
15
  <!-- #endif -->
16
16
  <view class="jfb-base-header-elephant__body">
17
17
  <view class="box_wrap">
18
- <view class="box_cont">
18
+ <view class="box_cont" :style="[boxContStyle]">
19
19
  <view class="box_l">
20
- <view class="box_logo"></view>
21
- <view class="box_site_name"></view>
20
+ <view class="box_logo">
21
+ <image v-if="showLogoType==='self' && selfLogo" :src="selfLogo" mode="heightFix" />
22
+ <image v-if="showLogoType==='default'" :src="site_logo" mode="heightFix" />
23
+ </view>
24
+ <view v-if="showSiteName==='Y'"
25
+ class="box_site_name"
26
+ :style="[siteNameFont]"
27
+ >{{ site_name }}</view>
22
28
  </view>
23
- <view class="box_r">
24
- <xd-font-icon icon="iconfenlei1"></xd-font-icon>
29
+ <view v-if="showCategory === 'Y'" class="box_r" @click="isExtendCate=!isExtendCate">
30
+ <xd-font-icon :icon=" categoryIcon || 'iconfenlei1'" :color="siteNameFont.color"></xd-font-icon>
25
31
  </view>
26
32
  </view>
27
- <view class="cate_pop">
28
- <view></view>
33
+ <view v-if="isExtendCate && showCategory==='Y'" class="cate_pop" :style="[catePopBoxStyle]">
34
+ <view class="cate_list" :style="[cateListBoxStyle]">
35
+ <view class="cate_item"
36
+ v-for="(item, i) in cateList" :key="i"
37
+ :style="[cateItemBoxStyle]"
38
+ @click="handleClick(item)"
39
+ >
40
+ <view class="cate_img" :style=[cateIconStyle]>
41
+ <image :src="item.image_url" mode="aspectFill" />
42
+ </view>
43
+ <view class="cate_name">{{item.content_name}}</view>
44
+ </view>
45
+ </view>
29
46
  </view>
30
47
 
31
48
  </view>
49
+ <view v-if="isExtendCate && showCategory==='Y'" class="_modal"
50
+ @click="isExtendCate=false"
51
+ @touchmove.stop.prevent="moveHandle"
52
+ ></view>
32
53
  </view>
33
54
  </view>
34
55
  </template>
@@ -51,9 +72,81 @@
51
72
  ],
52
73
  data() {
53
74
  return {
54
- useNumber: 4,
55
- info: [],
75
+ useNumber: 24,
76
+ cateList: [],
77
+ previewCateList: [],
78
+ site_logo: "",
79
+ site_name: "",
80
+ isPreview: false,
81
+ isExtendCate: false,
56
82
  //todo
83
+
84
+ showLogoType: "default",
85
+ selfLogo: "",
86
+ showSiteName: "",
87
+ showCategory: "",
88
+ categoryIcon: "",
89
+ bgColor: "",
90
+ siteNameFont: {},
91
+ navColumn: "",
92
+ navRow: "",
93
+ navPadding: "",
94
+ iconWidth: "",
95
+ iconHeight: "",
96
+ navBgColor: "",
97
+ navFontColor: "",
98
+ navColumnGap: "",
99
+ navRowGap: "",
100
+ navExpand: "",
101
+ iconMargin: "",
102
+ navRadius: "",
103
+ navShadow: "",
104
+ navCount: "",
105
+ }
106
+ },
107
+ computed: {
108
+ boxContStyle(){
109
+ return {
110
+ backgroundColor: this.bgColor,
111
+ }
112
+ },
113
+ cateListBoxStyle(){
114
+ let padding = `${this.checkValue(this.navPadding.top, 20)}rpx`;
115
+ padding = `${padding} ${this.checkValue(this.navPadding.right, 20)}rpx`;
116
+ padding = `${padding} ${this.checkValue(this.navPadding.bottom, 20)}rpx`;
117
+ padding = `${padding} ${this.checkValue(this.navPadding.left, 20)}rpx`;
118
+ return {
119
+ gridTemplateColumns: `repeat(${this.navColumn}, 1fr)`,
120
+ columnGap: `${this.navColumnGap}rpx`,
121
+ rowGap: `${this.navRowGap}rpx`,
122
+ padding: padding
123
+ }
124
+ },
125
+ cateItemBoxStyle(){
126
+ return {
127
+ backgroundColor: this.navBgColor,
128
+ color: this.navFontColor
129
+ }
130
+ },
131
+ cateIconStyle(){
132
+ let margin = `${this.checkValue(this.iconMargin.top, 0)}rpx`;
133
+ margin = `${margin} ${this.checkValue(this.iconMargin.right, 0)}rpx`;
134
+ margin = `${margin} ${this.checkValue(this.iconMargin.bottom, 0)}rpx`;
135
+ margin = `${margin} ${this.checkValue(this.iconMargin.left, 0)}rpx`;
136
+ return {
137
+ width: `${this.checkValue(this.iconWidth, 100)}rpx`,
138
+ height: `${this.checkValue(this.iconHeight, 100)}rpx`,
139
+ margin: margin,
140
+ borderRadius: this.navRadius + 'rpx',
141
+ boxShadow: this.navShadow
142
+ }
143
+ },
144
+ catePopBoxStyle(){
145
+ let position = 'absolute';
146
+ if(this.isPreview) position = 'relative';
147
+ return {
148
+ position: position,
149
+ }
57
150
  }
58
151
  },
59
152
  watch: {
@@ -64,7 +157,9 @@
64
157
  },
65
158
  created() {
66
159
  this.init(this.container);
67
-
160
+ this.site_logo = getServiceUrl(this.projectAttr["site_logo"], "size3");
161
+ this.site_name = this.projectAttr["site_name"];
162
+ this.isPreview = this.$configProject['isPreview'];
68
163
  //todo
69
164
  },
70
165
  methods: {
@@ -78,6 +173,7 @@
78
173
  page_size: this.useNumber //可以不传
79
174
  },
80
175
  }).then(res => {
176
+ this.previewCateList = res.list;
81
177
  if(res.list.length === 0 && this.isPreview) {
82
178
  res.list = this.getTestData();
83
179
  }
@@ -89,7 +185,106 @@
89
185
  * @param container {object} 业务组件对象自己
90
186
  */
91
187
  init(container) {
188
+ this.showLogoType = getContainerPropsValue(container, 'content.showLogoType', 'default');
189
+ this.selfLogo = getServiceUrl(getContainerPropsValue(container, 'content.selfLogo', {url: ""}).url);
190
+ this.showSiteName = getContainerPropsValue(container, 'content.showSiteName', 'Y');
191
+ this.showCategory = getContainerPropsValue(container, 'content.showCategory', 'Y');
192
+ this.categoryIcon = getContainerPropsValue(container, 'content.categoryIcon', '');
193
+ this.bgColor = getContainerPropsValue(container, 'content.bgColor', '');
194
+ this.siteNameFont = getContainerPropsValue(container, 'content.siteNameFont', {});
195
+ this.navColumn = getContainerPropsValue(container, 'content.navColumn', 4);
196
+ this.navPadding = getContainerPropsValue(container, 'content.navPadding', {});
197
+ this.navRow = getContainerPropsValue(container, 'content.navRow', 2);
198
+ this.iconWidth = getContainerPropsValue(container, 'content.iconWidth', 100);
199
+ this.iconHeight = getContainerPropsValue(container, 'content.iconHeight', 100);
200
+ this.navBgColor = getContainerPropsValue(container, 'content.navBgColor', '');
201
+ this.navFontColor = getContainerPropsValue(container, 'content.navFontColor', '');
202
+ this.navColumnGap = getContainerPropsValue(container, 'content.navColumnGap', 10);
203
+ this.navRowGap = getContainerPropsValue(container, 'content.navRowGap', 10);
204
+ this.navExpand = getContainerPropsValue(container, 'content.navExpand', '');
205
+ this.iconMargin = getContainerPropsValue(container, 'content.iconMargin', {});
206
+ this.navRadius = getContainerPropsValue(container, 'content.navRadius', 0);
207
+ this.navCount = getContainerPropsValue(container, 'content.navCount', 0);
208
+ let navShadow = getContainerPropsValue(container, 'content.navShadow', '');
209
+ if(navShadow.type === "Y" && navShadow.value){
210
+ this.navShadow = `0 0 ${navShadow.value.width}rpx ${navShadow.value.color}`;
211
+ }else{
212
+ this.navShadow = 'none';
213
+ }
214
+ console.log("navShadow", this.navShadow);
215
+
216
+ this.useNumber = this.navCount || this.navRow * this.navColumn;
217
+ if(this.isPreview){
218
+ let testData = this.getTestData();
219
+ testData.unshift(...this.previewCateList);
220
+ //从数组testData中取useNumber个数据
221
+ this.handleOne(testData.slice(0, this.useNumber));
222
+ this.isExtendCate = this.navExpand === 'Y' ? true : false;
223
+ if(this.isExtendCate){
224
+ document.querySelector('.xd-Layout__top').style.zIndex = 149099;
225
+ }else{
226
+ document.querySelector('.xd-Layout__top').style.zIndex = 1490;
227
+ }
228
+ }
229
+ },
230
+ moveHandle(){},
231
+ handleClick(item) {
232
+ if(!item.redirect_data) {
233
+ console.warn(`未配置链接地址: ${item.redirect_data}`);
234
+ console.error(`未配置链接地址: ${item.redirect_data}`);
235
+ return
236
+ }
237
+
238
+ //内部链接跳转地址
239
+ if (item.redirect_type === 'INN') {
240
+ try {
241
+ let url = JSON.parse(item.redirect_data);
242
+ let params = '';
243
+ if(url.page) {
244
+ if (item['redirect_params']) params = `?${item['redirect_params']}`;
245
+ this.$xdUniHelper.navigateTo({url: url.page + params})
246
+ }
247
+ else {
248
+ console.error(`应用链接配置错误: ${url.page}`)
249
+ }
250
+ } catch (e) {
251
+ console.error(`应用链接配置错误: ${item.redirect_data}`)
252
+ }
253
+ }
92
254
 
255
+ //外部链接
256
+ if (item.redirect_type === 'URL') {
257
+ let reg = /^(http:\/\/|https:\/\/|\/\/)+.+$/;
258
+ let spReg = /(-apiuri\/v)/;
259
+ //#ifdef MP-WEIXIN
260
+ try {
261
+ let url = JSON.parse(item.redirect_data);
262
+ if (reg.test(url.url) || spReg.test(url.url)) {
263
+ console.warn(`广告跳转外站: ${url.url}`)
264
+ this.$xdUniHelper.navigateTo(url);
265
+ } else {
266
+ console.error(`广告跳转外站配置错误: ${url.url}`)
267
+ }
268
+ } catch (e) {
269
+ console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
270
+ }
271
+ //#endif
272
+ //#ifdef H5
273
+ try {
274
+ let url = JSON.parse(item.redirect_data);
275
+ console.warn(`广告跳转外站: ${url.url}`);
276
+ this.$xdUniHelper.redirectTo(url, false)
277
+ } catch (e) {
278
+ console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
279
+ }
280
+ //#endif
281
+
282
+ }
283
+
284
+ //无跳转地址
285
+ if(item.redirect_type === 'EMP') {
286
+ console.warn(`无跳转地址`);
287
+ }
93
288
  },
94
289
  handleImage(list){
95
290
  list = this.filterItem(list);
@@ -103,12 +298,12 @@
103
298
  })
104
299
  },
105
300
  handleOne(list){
106
- this.info = this.handleImage(list);
301
+ this.cateList = this.handleImage(list);
107
302
 
108
303
  //轮播图记录为0条处理
109
- if( this.info.length === 0) return
304
+ if( this.cateList.length === 0) return
110
305
  let current = this.current || 0;
111
- this.currentImage = this.info[current]['image_background_url']
306
+ this.currentImage = this.cateList[current]['image_background_url']
112
307
  },
113
308
  getTestData(){
114
309
  let temp = [];
@@ -116,7 +311,7 @@
116
311
  let item = this.$xdUniHelper.cloneDeep(this['posterTest']);
117
312
  item.content_id = i;
118
313
  item.content_name = item.content_name + i;
119
- item.image_url = `//dummyimage.com/${this.width}x${this.height}`;
314
+ item.image_url = `//dummyimage.com/${this.iconWidth}x${this.iconHeight}`;
120
315
  temp.push(item)
121
316
  }
122
317
  return temp
@@ -178,6 +373,7 @@
178
373
  },
179
374
  onJfbShow(options) {
180
375
  console.log('event.onJfbShow', options)
376
+ this.onJfbLoad(options);
181
377
  },
182
378
  onJfbHide(options) {
183
379
  console.log('event.onJfbHide', options)
@@ -201,7 +397,68 @@
201
397
 
202
398
  .jfb-base-header-elephant {
203
399
  &__body{
204
-
400
+ overflow: initial !important;
401
+ ._modal{
402
+ position: fixed;
403
+ top: 0;
404
+ left: 0;
405
+ width: 100vh;
406
+ height: 100vh;
407
+ background: rgba(0, 0, 0, .5);
408
+ z-index: 999;
409
+ }
410
+ .box_wrap{
411
+ position: relative;
412
+ z-index: 1000;
413
+ .cate_pop{
414
+ top: 100%;
415
+ left: 0;
416
+ width: 100%;
417
+ z-index: 11;
418
+ background: #FFFFFF;
419
+ }
420
+ }
421
+ .box_cont{
422
+ display: flex;
423
+ align-items: center;
424
+ justify-content: space-between;
425
+ padding: 20rpx;
426
+ .box_l{
427
+ display: flex;
428
+ align-items: center;
429
+ }
430
+ .box_logo{
431
+ //width: 72rpx;
432
+ height: 72rpx;
433
+ image{
434
+ // width: 100%;
435
+ height: 100%;
436
+ }
437
+ }
438
+ .box_site_name{
439
+ margin-left: 20rpx;
440
+ }
441
+ }
442
+ .cate_list{
443
+ display: grid;
444
+ justify-items: center;
445
+ .cate_item{
446
+ width: 100%;
447
+ display: flex;
448
+ flex-direction: column;
449
+ align-items: center;
450
+ justify-content: center;
451
+ .cate_img{
452
+ width: 100rpx;
453
+ height: 100rpx;
454
+ overflow: hidden;
455
+ image{
456
+ width: 100%;
457
+ height: 100%;
458
+ }
459
+ }
460
+ }
461
+ }
205
462
  }
206
463
  }
207
464
  </style>
@@ -275,6 +275,32 @@ export default {
275
275
  { label: '否', value: 'N' },
276
276
  ]
277
277
  },
278
+ {
279
+ label: "按钮长度:",
280
+ ele: "el-input",
281
+ valueKey: "btnConfirmWidth",
282
+ value: data['btnConfirmWidth'] || '',
283
+ placeholder: '请输入按钮长度',
284
+ className: 'input60',
285
+ groupKey: "content",
286
+ },
287
+ {
288
+ label: "按钮背景颜色:",
289
+ ele: "xd-color",
290
+ valueKey: "btnConfirmBgColor",
291
+ groupKey:'content',
292
+ value: data['btnConfirmBgColor'] || '',
293
+ placeholder: '请选择按钮背景颜色',
294
+ groupKey: "content",
295
+ },
296
+ {
297
+ label: "按钮文字颜色:",
298
+ ele: "xd-color",
299
+ valueKey: "btnConfirmTextColor",
300
+ groupKey:'content',
301
+ value: data['btnConfirmTextColor'] || '',
302
+ placeholder: '请选择按钮文字颜色',
303
+ },
278
304
  {
279
305
  ele: 'title',
280
306
  label: '静态显示',
@@ -220,7 +220,11 @@
220
220
  backgroundColor: '',
221
221
  is_hide_dailog:'N',
222
222
 
223
- isMp:false
223
+ isMp:false,
224
+
225
+ btnConfirmWidth: "",
226
+ btnConfirmBgColor: "",
227
+ btnConfirmTextColor: "",
224
228
  }
225
229
  },
226
230
  watch: {
@@ -330,11 +334,16 @@
330
334
  this.scrollMargin = getContainerPropsValue(container, 'content.scrollMargin', {});
331
335
  this.radius = getContainerPropsValue(container, 'content.radius', 0);
332
336
  this.fontSize = Number(getContainerPropsValue(container, 'content.fontSize', '20'));
337
+ this.btnConfirmWidth = getContainerPropsValue(container, 'content.btnConfirmWidth', '');
338
+ this.btnConfirmBgColor = getContainerPropsValue(container, 'content.btnConfirmBgColor', '');
339
+ this.btnConfirmTextColor = getContainerPropsValue(container, 'content.btnConfirmTextColor', '');
333
340
  if (this.fontSize === 20) this.titleFontSize = 28;
334
341
  if (this.fontSize === 26) this.titleFontSize = 36;
335
342
  if (this.fontSize === 36) this.titleFontSize = 44;
336
343
  this.isTitle = getContainerPropsValue(container, 'content.isTitle', false);
337
344
 
345
+ console.log("this.btnConfirmTextColor", this.btnConfirmTextColor);
346
+
338
347
  if(this.style === '2') {
339
348
  this.num = getContainerPropsValue(container, 'content.num', 1);
340
349
  //#ifdef H5
@@ -358,6 +367,9 @@
358
367
  isHtml: true,
359
368
  zIndex: 2000,
360
369
  cancel: false,
370
+ btnConfirmWidth: this.btnConfirmWidth,
371
+ btnConfirmBgColor: this.btnConfirmBgColor,
372
+ btnConfirmTextColor: this.btnConfirmTextColor,
361
373
  });
362
374
  },
363
375