jufubao-base 1.0.64-beta200 → 1.0.64-beta301

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.64-beta200",
3
+ "version": "1.0.64-beta301",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -50,7 +50,7 @@
50
50
  "core-js": "^2.6.5",
51
51
  "flyio": "^0.6.2",
52
52
  "gxd-commands-bussiness": "^1.0.12",
53
- "gxd-uni-library-editx": "1.0.13-beta7",
53
+ "gxd-uni-library-editx": "1.0.17-beta2",
54
54
  "jweixin-module": "^1.6.0",
55
55
  "md5": "^2.3.0",
56
56
  "path-to-regexp": "^6.2.1",
@@ -250,7 +250,16 @@ export default {
250
250
  {"label": "弹窗显示", "value": '3'},
251
251
  ]
252
252
  },
253
+
253
254
  checkNotice() && checkPop() && checkScroll() && data.style === '1' && {
255
+ label: '是否显示标题:',
256
+ ele: 'xd-switch',
257
+ valueKey: 'isTitle',
258
+ value: data['isTitle'],
259
+ list: ['否', '是'],
260
+ backValueType: 2,
261
+ },
262
+ checkNotice() && checkPop() && checkScroll() && data.style === '1' && data['isTitle'] && {
254
263
  label: '标题对其方式:',
255
264
  ele: 'xd-select-list',
256
265
  valueKey: 'textAlign',
@@ -262,14 +271,6 @@ export default {
262
271
  {"label": "右", "value": 'right'},
263
272
  ]
264
273
  },
265
- checkNotice() && checkPop() && checkScroll() && data.style === '1' && {
266
- label: '是否显示标题:',
267
- ele: 'xd-switch',
268
- valueKey: 'isTitle',
269
- value: data['isTitle'],
270
- list: ['否', '是'],
271
- backValueType: 2,
272
- },
273
274
  checkNotice() && checkPop() && checkScroll() && {
274
275
  label: '内容背景颜色:',
275
276
  ele: 'xd-color',
@@ -13,80 +13,131 @@
13
13
  <view class="jfb-base-notice__edit-icon" @click="delEdit">删除</view>
14
14
  </view>
15
15
  <!-- #endif -->
16
- <view
17
- class="jfb-base-notice__body"
18
- :style="{
19
- margin: marginUi,
20
- }"
21
- >
22
- <template v-if="style === '3' && isPreview">
23
- <view
24
- class="jfb-base-notice__body-pop"
25
- :style="{backgroundColor:backgroundColor, color:warningColor}"
26
- >弹窗模式方便编辑(占位),在线上此模块不显</view>
27
- </template>
28
- <template v-if="style === '2'">
29
- <template v-if="!content && isPreview">
16
+ <view class="jfb-base-notice__body">
17
+ <view class="jfb-base-notice__body-line"></view>
18
+ <view :style="{margin: marginUi}">
19
+ <template v-if="style === '3' && isPreview">
30
20
  <view
31
21
  class="jfb-base-notice__body-pop"
32
22
  :style="{backgroundColor:backgroundColor, color:warningColor}"
33
- >接口无数返回,请检查是否配置成功!</view>
23
+ >弹窗模式方便编辑(占位),在线上此模块不显</view>
34
24
  </template>
35
- <view v-else class="jfb-base-notice__body-scroll">
36
- <xd-notice-bar
37
- :key="speedKey"
38
- scrollable
39
- :speed="speed"
40
- >
25
+ <template v-if="style === '2'">
26
+ <template v-if="contentList.length === 0 && isPreview">
27
+ <view class="jfb-base-notice__body-pop" :style="{backgroundColor:backgroundColor, color:warningColor}">接口无数返回,请检查是否配置成功!</view>
28
+ </template>
29
+ <view v-else class="jfb-base-notice__body-scroll">
41
30
  <view
42
- v-for="item in contentList"
43
- class="jfb-base-notice__body-scroll-content"
44
- :key="item.content_id"
45
- v-html="item.content"
46
- ></view>
47
- </xd-notice-bar>
48
- </view>
49
- </template>
50
- <template v-if="style === '1'">
51
- <template v-if="!content && isPreview">
52
- <view
53
- class="jfb-base-notice__body-pop"
54
- :style="{backgroundColor:backgroundColor, color:warningColor}"
55
- >接口无数返回,请检查是否配置成功!</view>
56
- </template>
57
- <template v-else>
58
- <view
59
- class="jfb-base-notice__body-title"
60
- :style="{
61
- fontSize: titleFontSize + 'rpx',
62
- background: bgc,
63
- color:textColor,
64
- borderRadius: titleRadius,
65
- padding: titlePadding,
66
- borderBottomColor: borderTitleColor,
67
- textAlign: textAlign
68
- }"
69
- v-if="isTitle"
70
- >{{title}}</view>
71
- <view
72
- class="jfb-base-notice__body-content"
73
- :style="{
74
- background: bgc,
75
- color:textColor,
76
- borderRadius: contRadius,
77
- padding: paddingUi,
78
- lineHeight: '50rpx'
79
- }"
80
- v-if="content"
81
- >
82
- <xd-content-xss
83
- :key="contentKey"
84
- :html="content"
85
- :font-sizes="fontSize"
86
- ></xd-content-xss>
31
+ class="upAndDown"
32
+ :style="{
33
+ backgroundColor:backgroundColor,
34
+ color:warningColor
35
+ }"
36
+ >
37
+ <view>
38
+ <xd-font-icon icon="icontongzhi" :size="24"></xd-font-icon>
39
+ </view>
40
+ <view :class="{one:!getScrollType }">
41
+ <swiper
42
+ v-if="getScrollType"
43
+ class="upAndDown-swiper"
44
+ circular
45
+ vertical
46
+ :interval="2500"
47
+ autoplay
48
+ >
49
+ <swiper-item v-for="(item) in contentList" :key="item.content_id">
50
+ <view>{{item.title}}</view>
51
+ </swiper-item>
52
+ </swiper>
53
+ <xd-notice-bar v-else :key="speedKey" scrollable :speed="speed" background-color="rgba(0,0,0,0)">
54
+ <view
55
+ v-for="item in contentList"
56
+ class="jfb-base-notice__body-scroll-content"
57
+ :key="item.content_id"
58
+ v-html=" $xdUniHelper.filterHtml(item.content)"
59
+ ></view>
60
+ </xd-notice-bar>
61
+ </view>
62
+ <view>
63
+ <xd-font-icon icon="iconxiangyou_xian" :size="24" @click="handleShow(true)"></xd-font-icon>
64
+ </view>
65
+ </view>
66
+
87
67
  </view>
88
68
  </template>
89
- </template>
69
+ <template v-if="style === '1'">
70
+ <template v-if="!content && isPreview">
71
+ <view
72
+ class="jfb-base-notice__body-pop"
73
+ :style="{backgroundColor:backgroundColor, color:warningColor}"
74
+ >接口无数返回,请检查是否配置成功!</view>
75
+ </template>
76
+ <template v-else>
77
+ <view
78
+ class="jfb-base-notice__body-title"
79
+ :style="{
80
+ fontSize: titleFontSize + 'rpx',
81
+ background: bgc,
82
+ color:textColor,
83
+ borderRadius: titleRadius,
84
+ padding: titlePadding,
85
+ paddingBottom:0,
86
+ borderBottomColor: borderTitleColor,
87
+ textAlign: textAlign
88
+ }"
89
+ v-if="isTitle"
90
+ >{{title}}</view>
91
+ <view
92
+ class="jfb-base-notice__body-content"
93
+ :style="{
94
+ background: bgc,
95
+ color:textColor,
96
+ borderRadius: contRadius,
97
+ padding: paddingUi,
98
+ lineHeight: '50rpx'
99
+ }"
100
+ v-if="content"
101
+ >
102
+ <xd-content-xss
103
+ :key="contentKey"
104
+ :html="content"
105
+ :font-sizes="fontSize"
106
+ ></xd-content-xss>
107
+ </view>
108
+ </template>
109
+ </template>
110
+ </view>
111
+ <xd-down-drawer
112
+ v-if="showUp"
113
+ :show.sync="showUp"
114
+ :z-index="9999"
115
+ :is-close="true"
116
+ :is-body-close="false"
117
+ :fullscreen="true"
118
+ height="20vh"
119
+ >
120
+ <view class="upAndDown-swiper-all">
121
+ <view>
122
+ <view
123
+ class="upAndDown-swiper-all-list"
124
+ v-for="(item) in contentList"
125
+ :key="item.content_id"
126
+ >
127
+ <view :style="{color:warningColor}">{{item.title}}</view>
128
+ <view v-html="item.content"></view>
129
+ </view>
130
+ </view>
131
+ <view>
132
+ <xd-button
133
+ size="small"
134
+ type="primary"
135
+ radius="50rpx"
136
+ @click="handleShow(false)"
137
+ >我知道了</xd-button>
138
+ </view>
139
+ </view>
140
+ </xd-down-drawer>
90
141
  </view>
91
142
  </view>
92
143
  </template>
@@ -94,11 +145,13 @@
94
145
  <script>
95
146
  import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
96
147
  import XdContentXss from '@/components/XdContentXss/XdContentXss';
97
- import XdNoticeBar from "@/components/XdNoticeBar/XdNoticeBar"
148
+ import XdNoticeBar from "./XdNoticeBar"
149
+ import XdButton from "@/components/XdButton/XdButton.vue";
98
150
  import { jfbRootExec } from "@/utils/xd.event";
99
151
  import JfbBaseNoticeMixin from "./JfbBaseNoticeMixin";
100
152
  import componentsMixins from "@/mixins/componentsMixins";
101
153
  import extsMixins from "@/mixins/extsMixins"
154
+ import XdDownDrawer from "@/components/XdDownDrawer/XdDownDrawer.vue";
102
155
  import { getContainerPropsValue } from "@/utils/xd.base";
103
156
  import storage from "@/common/storage";
104
157
  import Color from "color";
@@ -108,18 +161,21 @@
108
161
  components: {
109
162
  XdFontIcon,
110
163
  XdContentXss,
111
- XdNoticeBar
164
+ XdNoticeBar,
165
+ XdDownDrawer,
166
+ XdButton
112
167
  },
113
168
  mixins: [componentsMixins,extsMixins,JfbBaseNoticeMixin],
114
169
  data() {
115
170
  return {
171
+ selfMask: true,
172
+ showUp: false,
116
173
  isTitle: '', //是否显示标题
117
174
  title: '', //标题
118
175
  textAlign: 'left', //标题对其方式
119
176
  noData: false,
120
177
  style: '1', //显示内容(静态/弹窗/滚动)
121
178
 
122
-
123
179
  bgc: '', //背景颜色
124
180
  textColor: '', //文字颜色
125
181
  content : '', //内容
@@ -156,23 +212,11 @@
156
212
  },
157
213
  watch: {
158
214
  container(value) {
159
- if (this.timer) {
160
- clearTimeout(this.timer);
161
- this.timer = null
162
- }
163
- setTimeout(() => {
164
- if (this.$configProject['isPreview']) this.onJfbLoad()
165
- }, 400)
166
-
215
+ this.init(this.container);
216
+ if (this.$configProject['isPreview']) this.onJfbLoad()
167
217
  },
168
218
  num(){
169
- if (this.timer) {
170
- clearTimeout(this.timer);
171
- this.timer = null
172
- }
173
- setTimeout(() => {
174
- if (this.$configProject['isPreview']) this.onJfbLoad()
175
- }, 400)
219
+ if (this.$configProject['isPreview']) this.onJfbLoad()
176
220
 
177
221
  },
178
222
  style() {
@@ -207,6 +251,10 @@
207
251
  return `${this.radius}rpx ${this.radius}rpx 0rpx 0rpx `
208
252
  },
209
253
 
254
+ getScrollType(){
255
+ return this.num > 1
256
+ }
257
+
210
258
  },
211
259
  created() {
212
260
  this.backgroundColor = Color(this.warningColor).alpha(0.2).toString();
@@ -215,6 +263,11 @@
215
263
  },
216
264
  methods: {
217
265
 
266
+ handleShow(type){
267
+ this.showUp = type;
268
+ },
269
+
270
+
218
271
  /**
219
272
  * @description 监听事件变化
220
273
  * @param container {object} 业务组件对象自己
@@ -262,10 +315,12 @@
262
315
  data: {
263
316
  page_id: this.pageAttr['page_id'], //页面ID
264
317
  container_id: this.containerId, //组件ID
265
- page_size: this.num //可以不传
318
+ page_size: (this.type==='1' && this.type==='2') ? 1: this.num //可以不传
266
319
  },
267
320
  })
268
321
  .then(res => {
322
+ //res = {"list":[{"content_id":"YSjVvl2X6f5qYW5G7NNNr","category_id":"KNCYuDPWmmb4jUaBEOvbz","partner_id":0,"site_id":"","title":"东北地区暴雪影响","content":"<p>尊敬的用户您好!因受东北地区暴雪影响,部分订单暂停发货或包裹运输会有延迟,我们将在预警恢复后尽快安排发货,请您耐心等待,给您带来不便敬请谅解!<\/p>","sort":1,"status":"","start_time":1699200000,"end_time":1699804800,"op_user_id":"","created_time":0,"updated_time":0,"code":"","code_name":""},{"content_id":"YSjVvl2X6f5qYW5G7NNNr1","category_id":"KNCYuDPWmmb4jUaBEOvbz","partner_id":0,"site_id":"","title":"东北地区暴雪影响","content":"<p>尊敬的用户您好!因受东北地区暴雪影响,部分订单暂停发货或包裹运输会有延迟,我们将在预警恢复后尽快安排发货,请您耐心等待,给您带来不便敬请谅解!<\/p>","sort":1,"status":"","start_time":1699200000,"end_time":1699804800,"op_user_id":"","created_time":0,"updated_time":0,"code":"","code_name":""}],"request_id":"2d3b6e0f1cb184c5"};
323
+
269
324
  //弹窗显示
270
325
  if (this.style === '3') {
271
326
  if (res.list.length > 0) {
@@ -276,7 +331,6 @@
276
331
  }
277
332
 
278
333
  else if(this.style === '2') {
279
- console.log('getContent',res.list)
280
334
  if(res.list.length > 0) {
281
335
  this.contentList = res.list;
282
336
  this.speedKey = Date.now()
@@ -301,21 +355,29 @@
301
355
  },
302
356
 
303
357
  onJfbLoad() {
304
- //弹窗模式
305
- if(this.style === '3') {
306
- if(this.isPreview) {
307
- this.getContent();
308
- }
309
- else {
310
- if(!storage.get(this.containerId)) this.getContent()
311
- }
312
- }
358
+ let delay = 500;
359
+ if(!this.isPreview) delay = 10;
313
360
 
314
- else {
315
- this.getContent()
361
+ if(this.timer){
362
+ clearTimeout(this.timer);
363
+ this.timer = null
316
364
  }
365
+ this.timer = setTimeout(()=>{
366
+ //弹窗模式
367
+ if(this.style === '3') {
368
+ if(this.isPreview) {
369
+ this.getContent();
370
+ }
371
+ else {
372
+ if(!storage.get(this.containerId)) this.getContent()
373
+ }
374
+ }
317
375
 
318
-
376
+ //非弹窗模式
377
+ else {
378
+ this.getContent()
379
+ }
380
+ }, delay)
319
381
  },
320
382
 
321
383
  onJfbUpdate(data) {
@@ -333,26 +395,94 @@
333
395
 
334
396
  .jfb-base-notice {
335
397
  &__body{
398
+ &-line {
399
+ height: 0px;
400
+ overflow: hidden;
401
+ width: 100%;
402
+ }
336
403
  &-scroll {
337
404
  &-content {
338
405
  font-size: unit(20, rpx);
339
406
  }
407
+
408
+ & .upAndDown {
409
+ display: flex;
410
+ height: unit(70, rpx);
411
+ line-height: unit(70, rpx);
412
+ justify-content: space-between;
413
+
414
+
415
+
416
+ & > view:first-child,& > view:last-child {
417
+ width: unit(70, rpx);
418
+ height: unit(70, rpx);
419
+ flex-shrink: 0;
420
+ }
421
+ & > view:nth-child(2) {
422
+ flex: 1;
423
+ padding: 0 unit(10, rpx);
424
+ height: 100%;
425
+
426
+ &.one {
427
+ display: flex;
428
+ align-items: center;
429
+ }
430
+ }
431
+
432
+ &-swiper {
433
+ height: 100%;
434
+ width: 100%;
435
+ font-size: unit(26, rpx);
436
+
437
+ }
438
+ }
340
439
  }
341
440
  &-pop {
342
- min-height: 60rpx;
441
+ min-height: 30rpx;
343
442
  text-align: center;
344
- line-height: 60rpx;
443
+ line-height: 30rpx;
345
444
  color: #666;
346
445
  font-size: unit(24, rpx);
347
446
  padding:unit(20, rpx);
348
447
  }
349
448
  &-title {
350
449
  border-bottom: 1px solid #fff;
450
+ line-height: 2rem;
351
451
  }
352
452
 
353
453
  &-content {
354
454
  padding: unit(8, rpx) unit(10, rpx);
355
455
  }
356
456
  }
457
+
458
+ .upAndDown-swiper-all {
459
+ padding: unit(40, rpx) unit(30, rpx) unit(40, rpx);
460
+
461
+ &-list{
462
+ padding-bottom: unit(40, rpx);
463
+ &:last-child {
464
+ padding-bottom: 0;
465
+ }
466
+
467
+ & >view:first-child {
468
+ font-size: unit(32, rpx);
469
+ font-weight: 700;
470
+ padding-bottom: 0.5rem;
471
+ }
472
+
473
+ &>view:nth-child(2) {
474
+ font-size: unit(26, rpx);
475
+ line-height: unit(36, rpx);
476
+ color: #666;
477
+ }
478
+ }
479
+
480
+ & > view:first-child {
481
+ padding-bottom: unit(30, rpx);
482
+ max-height: 50vh;
483
+ overflow-y: auto;
484
+ margin: unit(40, rpx) unit(10, rpx) unit(20, rpx);
485
+ }
486
+ }
357
487
  }
358
488
  </style>