jufubao-base 1.0.63 → 1.0.64-beta300

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.
@@ -0,0 +1,519 @@
1
+ <template>
2
+ <view v-if="show" class="uni-noticebar" @click="onClick">
3
+ <!-- #ifdef MP-ALIPAY -->
4
+ <view
5
+ v-if="showClose === true || showClose === 'true'"
6
+ class="uni-noticebar-close uni-cursor-point"
7
+ @click="close"
8
+ >
9
+ <xd-font-icon
10
+ :color="uiColor"
11
+ size="20"
12
+ icon="iconguanbi2"
13
+ width="30"
14
+ height="30"
15
+ ></xd-font-icon>
16
+ </view>
17
+ <view
18
+ v-if="showIcon === true || showIcon === 'true'"
19
+ class="uni-noticebar-icon"
20
+ >
21
+ <xd-font-icon
22
+ icon="icontongzhi"
23
+ :color="uiColor"
24
+ size="30"
25
+ width="30"
26
+ height="30"
27
+ ></xd-font-icon>
28
+ </view>
29
+ <!-- #endif -->
30
+ <!-- #ifndef MP-ALIPAY -->
31
+ <xd-font-icon
32
+ class="uni-noticebar-icon"
33
+ v-if="showIcon === true || showIcon === 'true'"
34
+ icon="icontongzhi"
35
+ :color="uiColor"
36
+ size="30"
37
+ width="30"
38
+ height="30"
39
+ ></xd-font-icon>
40
+ <!-- #endif -->
41
+ <view
42
+ ref="textBox"
43
+ class="uni-noticebar__content-wrapper"
44
+ :class="{
45
+ 'uni-noticebar__content-wrapper--scrollable':scrollable,
46
+ 'uni-noticebar__content-wrapper--single':!scrollable && (single || moreText)
47
+ }">
48
+ <view
49
+ :id="elIdBox"
50
+ class="uni-noticebar__content"
51
+ :class="{
52
+ 'uni-noticebar__content--scrollable':scrollable,
53
+ 'uni-noticebar__content--single':!scrollable && (single || moreText)
54
+ }">
55
+ <view
56
+ :id="elId" ref="animationEle"
57
+ class="uni-noticebar__content-text"
58
+ :class="{
59
+ 'uni-noticebar__content-text--scrollable':scrollable,
60
+ 'uni-noticebar__content-text--single':!scrollable && (single || moreText)
61
+ }"
62
+ :style="{
63
+ color:uiColor,
64
+ width:wrapWidth+'px',
65
+ 'animationDuration': animationDuration,
66
+ '-webkit-animationDuration': animationDuration ,
67
+ animationPlayState: webviewHide?'paused':animationPlayState,
68
+ '-webkit-animationPlayState':webviewHide?'paused':animationPlayState,
69
+ animationDelay: '1s',
70
+ '-webkit-animationDelay':'1s'
71
+ }">
72
+ <slot>
73
+ <view>1. 本插件需要申请的系统权限列表:</view>
74
+ <view>2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:</view>
75
+ <view>3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:</view>
76
+ </slot>
77
+ </view>
78
+ </view>
79
+ </view>
80
+ <xd-font-icon
81
+ v-if="showClose === true || showClose === 'true'"
82
+ :color="uiColor"
83
+ size="20"
84
+ icon="iconguanbi2"
85
+ @click="close"
86
+ width="30"
87
+ height="30"
88
+ ></xd-font-icon>
89
+ <view
90
+ v-if="showGetMore === true || showGetMore === 'true'"
91
+ class="uni-noticebar__more uni-cursor-point"
92
+ @click="clickMore"
93
+ >
94
+ <text v-if="moreText" :style="{ color: moreColor }" class="uni-noticebar__more-text">{{ moreText }}</text>
95
+ <xd-font-icon
96
+ :color="uiColor"
97
+ size="20"
98
+ icon="iconjiantou"
99
+ width="30"
100
+ height="30"
101
+ ></xd-font-icon>
102
+ </view>
103
+ </view>
104
+ </template>
105
+
106
+ <script>
107
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
108
+ import {
109
+ getParentsStyle, //获取页面风格单个键值值
110
+ } from '@/utils/xd.base';
111
+ const Color = require('color');
112
+
113
+ // #ifdef APP-NVUE
114
+ const dom = weex.requireModule('dom');
115
+ const animation = weex.requireModule('animation');
116
+ // #endif
117
+
118
+ /**
119
+ * XdNoticeBar 自定义导航栏
120
+ * @description 通告栏组件
121
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=30
122
+ * @property {Number} speed 文字滚动的速度,默认100px/秒
123
+ * @property {String} text 显示文字
124
+ * @property {String} backgroundColor 背景颜色
125
+ * @property {String} color 文字颜色
126
+ * @property {String} moreColor 查看更多文字的颜色
127
+ * @property {String} moreText 设置“查看更多”的文本
128
+ * @property {Boolean} single = [true|false] 是否单行
129
+ * @property {Boolean} scrollable = [true|false] 是否滚动,为true时,NoticeBar为单行
130
+ * @property {Boolean} showIcon = [true|false] 是否显示左侧喇叭图标
131
+ * @property {Boolean} showClose = [true|false] 是否显示左侧关闭按钮
132
+ * @property {Boolean} showGetMore = [true|false] 是否显示右侧查看更多图标,为true时,NoticeBar为单行
133
+ * @event {Function} click 点击 NoticeBar 触发事件
134
+ * @event {Function} close 关闭 NoticeBar 触发事件
135
+ * @event {Function} getmore 点击”查看更多“时触发事件
136
+ */
137
+
138
+ export default {
139
+ name: 'XdNoticeBar',
140
+ components: {
141
+ XdFontIcon
142
+ },
143
+ props: {
144
+ text: {
145
+ type: String,
146
+ default: ''
147
+ },
148
+ moreText: {
149
+ type: String,
150
+ default: ''
151
+ },
152
+ backgroundColor: {
153
+ type: String,
154
+ default: '#fffbe8'
155
+ },
156
+ speed: {
157
+ // 默认1s滚动100px
158
+ type: Number,
159
+ default: 50
160
+ },
161
+ color: {
162
+ type: String,
163
+ default: '#de8c17'
164
+ },
165
+ moreColor: {
166
+ type: String,
167
+ default: '#999999'
168
+ },
169
+ isNoBgc:{
170
+ // 是否单行
171
+ type: Boolean,
172
+ default: true
173
+ },
174
+ single: {
175
+ // 是否单行
176
+ type: [Boolean, String],
177
+ default: false
178
+ },
179
+ scrollable: {
180
+ // 是否滚动,添加后控制单行效果取消
181
+ type: [Boolean, String],
182
+ default: false
183
+ },
184
+ showIcon: {
185
+ // 是否显示左侧icon
186
+ type: [Boolean, String],
187
+ default: false
188
+ },
189
+ showGetMore: {
190
+ // 是否显示右侧查看更多
191
+ type: [Boolean, String],
192
+ default: false
193
+ },
194
+ showClose: {
195
+ // 是否显示左侧关闭按钮
196
+ type: [Boolean, String],
197
+ default: false
198
+ },
199
+ fontSize: {
200
+ type: [Number, String],
201
+ default: 20
202
+ }
203
+ },
204
+ data() {
205
+ const elId = `Uni_text_${Math.ceil(Math.random() * 10e5).toString(36)}`
206
+ const elIdBox = `Uni_box_${Math.ceil(Math.random() * 10e5).toString(36)}`
207
+ return {
208
+ textWidth: 0,
209
+ boxWidth: 0,
210
+ wrapWidth: '',
211
+ webviewHide: false,
212
+ // #ifdef APP-NVUE
213
+ stopAnimation: false,
214
+ // #endif
215
+ elId: elId,
216
+ elIdBox: elIdBox,
217
+ show: true,
218
+ animationDuration: 'none',
219
+ animationPlayState: 'paused',
220
+ animationDelay: '0s',
221
+
222
+
223
+ uiColor: '', //文字颜色
224
+ uiBackgroundColor: '', //背景颜色
225
+ }
226
+ },
227
+
228
+ async created() {
229
+ // #ifdef APP-PLUS
230
+ var pages = getCurrentPages();
231
+ var page = pages[pages.length - 1];
232
+ var currentWebview = page.$getAppWebview();
233
+ currentWebview.addEventListener('hide', () => {
234
+ this.webviewHide = true
235
+ })
236
+ currentWebview.addEventListener('show', () => {
237
+ this.webviewHide = false
238
+ })
239
+ // #endif
240
+
241
+ this.$nextTick(() => {
242
+ this.initSize()
243
+ })
244
+ },
245
+ // #ifdef APP-NVUE
246
+ beforeDestroy() {
247
+ this.stopAnimation = true
248
+ },
249
+ // #endif
250
+ methods: {
251
+ getEleDone(ele){
252
+ let el = (e, callback)=>{
253
+ uni.createSelectorQuery()
254
+ // #ifndef MP-ALIPAY
255
+ .in(this)
256
+ // #endif
257
+ .select(e)
258
+ .boundingClientRect()
259
+ .exec((res) => {
260
+ if(res[0]['width']) {
261
+ res[0]['key'] = e.split('_')[1];
262
+ callback(res[0]);
263
+ }else{
264
+ setTimeout(()=>{
265
+ el(e, callback)
266
+ },100)
267
+ }
268
+ });
269
+ };
270
+ return new Promise((resolve, reject) => {
271
+ el(ele,(res)=>{
272
+ resolve(res)
273
+ });
274
+ });
275
+
276
+ },
277
+ initSize() {
278
+ if (this.scrollable) {
279
+ // #ifndef APP-NVUE
280
+ let query = [];
281
+ let textQuery = this.getEleDone(`#${this.elId}`);
282
+ let boxQuery = this.getEleDone(`#${this.elIdBox}`);
283
+ query.push(textQuery);
284
+ query.push(boxQuery);
285
+ Promise.all(query).then((res) => {
286
+ console.log('Promise.all',res);
287
+ res.map((item)=>{
288
+ if(item.key === 'text') {
289
+ this.textWidth = item.width;
290
+ this.animationDuration = `${item.width / this.speed}s`
291
+ }
292
+ if(item.key === 'box') {
293
+ this.boxWidth = item.width;
294
+ this.animationDelay = `0.5s`
295
+ }
296
+ });
297
+ setTimeout(() => {
298
+ this.animationPlayState = 'running'
299
+ }, 10)
300
+ })
301
+
302
+
303
+ // #endif
304
+ // #ifdef APP-NVUE
305
+ dom.getComponentRect(this.$refs['animationEle'], (res) => {
306
+ let winWidth = getApp().globalData.$systemInfo.windowWidth
307
+ this.textWidth = res.size.width
308
+ animation.transition(this.$refs['animationEle'], {
309
+ styles: {
310
+ transform: `translateX(-${winWidth}px)`
311
+ },
312
+ duration: 0,
313
+ timingFunction: 'linear',
314
+ delay: 0
315
+ }, () => {
316
+ if (!this.stopAnimation) {
317
+ animation.transition(this.$refs['animationEle'], {
318
+ styles: {
319
+ transform: `translateX(-${this.textWidth}px)`
320
+ },
321
+ timingFunction: 'linear',
322
+ duration: (this.textWidth - winWidth) / this.speed * 1000,
323
+ delay: 1000
324
+ }, () => {
325
+ if (!this.stopAnimation) {
326
+ this.loopAnimation()
327
+ }
328
+ });
329
+ }
330
+ });
331
+ })
332
+ // #endif
333
+ }
334
+ // #ifdef APP-NVUE
335
+ if (!this.scrollable && (this.single || this.moreText)) {
336
+ dom.getComponentRect(this.$refs['textBox'], (res) => {
337
+ this.wrapWidth = res.size.width
338
+ })
339
+ }
340
+ // #endif
341
+ },
342
+ loopAnimation() {
343
+ // #ifdef APP-NVUE
344
+ animation.transition(this.$refs['animationEle'], {
345
+ styles: {
346
+ transform: `translateX(0px)`
347
+ },
348
+ duration: 0
349
+ }, () => {
350
+ if (!this.stopAnimation) {
351
+ animation.transition(this.$refs['animationEle'], {
352
+ styles: {
353
+ transform: `translateX(-${this.textWidth}px)`
354
+ },
355
+ duration: this.textWidth / this.speed * 1000,
356
+ timingFunction: 'linear',
357
+ delay: 0
358
+ }, () => {
359
+ if (!this.stopAnimation) {
360
+ this.loopAnimation()
361
+ }
362
+ });
363
+ }
364
+ });
365
+ // #endif
366
+ },
367
+ clickMore() {
368
+ this.$emit('getmore')
369
+ },
370
+ close() {
371
+ this.show = false;
372
+ this.$emit('close')
373
+ },
374
+ onClick() {
375
+ this.$emit('click')
376
+ }
377
+ }
378
+ }
379
+ </script>
380
+
381
+ <style lang="less" scoped>
382
+
383
+ .uni-noticebar {
384
+ /* #ifndef APP-NVUE */
385
+ display: flex;
386
+ width: 100%;
387
+ box-sizing: border-box;
388
+ /* #endif */
389
+ flex-direction: row;
390
+ align-items: center;
391
+ padding: unit(12, rxp) unit(24, rpx);
392
+ }
393
+
394
+ .uni-cursor-point {
395
+ /* #ifdef H5 */
396
+ cursor: pointer;
397
+ /* #endif */
398
+ }
399
+
400
+ .uni-noticebar-close {
401
+ margin-right: unit(10, rpx);
402
+ }
403
+
404
+ .uni-noticebar-icon {
405
+ margin-right: unit(10, rpx);
406
+ }
407
+
408
+ .uni-noticebar__content-wrapper {
409
+ flex: 1;
410
+ flex-direction: column;
411
+ overflow: hidden;
412
+ }
413
+
414
+ .uni-noticebar__content-wrapper--single {
415
+ /* #ifndef APP-NVUE */
416
+ line-height: unit(42, rpx);
417
+ /* #endif */
418
+ }
419
+
420
+ .uni-noticebar__content-wrapper--single,
421
+ .uni-noticebar__content-wrapper--scrollable {
422
+ flex-direction: row;
423
+ }
424
+
425
+ /* #ifndef APP-NVUE */
426
+ .uni-noticebar__content-wrapper--scrollable {
427
+ position: relative;
428
+ height: unit(42, rpx);
429
+ }
430
+
431
+ /* #endif */
432
+
433
+ .uni-noticebar__content--scrollable {
434
+ /* #ifdef APP-NVUE */
435
+ flex: 0;
436
+ /* #endif */
437
+ /* #ifndef APP-NVUE */
438
+ flex: 1;
439
+ display: block;
440
+ overflow: hidden;
441
+ /* #endif */
442
+ }
443
+
444
+ .uni-noticebar__content--single {
445
+ /* #ifndef APP-NVUE */
446
+ display: flex;
447
+ flex: none;
448
+ width: 100%;
449
+ justify-content: center;
450
+ /* #endif */
451
+ }
452
+
453
+ .uni-noticebar__content-text {
454
+ font-size: unit(28, rpx);
455
+ line-height: unit(42, rpx);
456
+ /* #ifndef APP-NVUE */
457
+ word-break: break-all;
458
+ /* #endif */
459
+
460
+ }
461
+
462
+ .uni-noticebar__content-text--single {
463
+ /* #ifdef APP-NVUE */
464
+ lines: 1;
465
+ /* #endif */
466
+ /* #ifndef APP-NVUE */
467
+ display: block;
468
+ width: 100%;
469
+ white-space: nowrap;
470
+ /* #endif */
471
+ overflow: hidden;
472
+ text-overflow: ellipsis;
473
+ }
474
+
475
+ .uni-noticebar__content-text--scrollable {
476
+ /* #ifdef APP-NVUE */
477
+ lines: 1;
478
+ padding-left: unit(750, rpx);
479
+ /* #endif */
480
+ /* #ifndef APP-NVUE */
481
+ position: absolute;
482
+ height: unit(42, rpx);
483
+ line-height: unit(42, rpx);
484
+ white-space: nowrap;
485
+ padding-left: 100%;
486
+ animation: notice 10s 0s linear infinite both;
487
+ animation-play-state: paused;
488
+ /* #endif */
489
+ display: flex;
490
+ justify-content: flex-start;
491
+ align-items: flex-start;
492
+ flex-flow: nowrap;
493
+
494
+
495
+ /deep/ & > view {
496
+ padding-right: unit(30, rpx);
497
+ }
498
+ }
499
+
500
+ .uni-noticebar__more {
501
+ /* #ifndef APP-NVUE */
502
+ display: inline-flex;
503
+ /* #endif */
504
+ flex-direction: row;
505
+ flex-wrap: nowrap;
506
+ align-items: center;
507
+ padding-left: unit(10, rpx);
508
+ }
509
+
510
+ .uni-noticebar__more-text {
511
+ font-size: unit(28, rpx);
512
+ }
513
+
514
+ @keyframes notice {
515
+ 100% {
516
+ transform: translate3d(-100%, 0, 0);
517
+ }
518
+ }
519
+ </style>
@@ -209,6 +209,19 @@ export default {
209
209
  },
210
210
  inline: false,
211
211
  },
212
+ {
213
+ label: '是否需要客服电话:',
214
+ ele: 'xd-radio',
215
+ valueKey: 'is_hot',
216
+ value: data['is_hot'] || 'N',
217
+ placeholder: '请选择是否需要客服电话',
218
+ multiple: false,
219
+ className: 'input80',
220
+ list: [
221
+ { label: '是', value: 'Y' },
222
+ { label: '否', value: 'N' },
223
+ ]
224
+ },
212
225
  {
213
226
  label: '自定义内容:',
214
227
  ele: 'xd-site-news',
@@ -635,28 +635,28 @@
635
635
  </view>
636
636
  <view v-if="info.contacts&&info.contacts.length>0">
637
637
  <view
638
- :style="{
639
- background: backgroundColor,
640
- border: borderBox,
641
- borderRadius: radius + 'rpx',
642
- boxShadow: shadowBox,
643
- marginBottom: padding + 'rpx',
644
- }"
645
- class="jfb-base-order-detail__body-card jfb-base-order-detail__body-link"
646
- v-for="(item,index) in info.contacts"
647
- :key="index"
648
- >
649
- <view class="jfb-base-order-detail__body-link-title">{{ item.title }}</view>
650
- <view v-for="(Sitem, Sindex) in item.data" :key="Sindex">
651
- <view
652
- class="jfb-base-order-detail__body-link-item"
653
- >
654
- <view v-html="Sitem.label"></view>
655
- <view v-html="Sitem.value"></view>
638
+ :style="{
639
+ background: backgroundColor,
640
+ border: borderBox,
641
+ borderRadius: radius + 'rpx',
642
+ boxShadow: shadowBox,
643
+ marginBottom: padding + 'rpx',
644
+ }"
645
+ class="jfb-base-order-detail__body-card jfb-base-order-detail__body-link"
646
+ v-for="(item, index) in info.contacts"
647
+ :key="index"
648
+ >
649
+ <view class="jfb-base-order-detail__body-link-title">{{
650
+ item.title
651
+ }}</view>
652
+ <view v-for="(Sitem, Sindex) in item.data" :key="Sindex">
653
+ <view class="jfb-base-order-detail__body-link-item">
654
+ <view v-html="Sitem.label"></view>
655
+ <view v-html="Sitem.value"></view>
656
+ </view>
656
657
  </view>
657
658
  </view>
658
659
  </view>
659
- </view>
660
660
  <view
661
661
  v-if="info.productDetail"
662
662
  class="jfb-base-order-detail__body-card jfb-base-order-detail__body-shop"
@@ -821,6 +821,7 @@ export default {
821
821
  right: 0,
822
822
  bottom: 0,
823
823
  },
824
+ is_hot: "Y",
824
825
  };
825
826
  },
826
827
  watch: {
@@ -840,6 +841,7 @@ export default {
840
841
  },
841
842
  },
842
843
  computed: {
844
+ ...mapState(['siteInfo']),
843
845
  prod_bottom() {
844
846
  return this.fixedStyle({ height: 0, zIndex: 111 });
845
847
  },
@@ -902,7 +904,6 @@ export default {
902
904
  },
903
905
  })
904
906
  .then((res) => {
905
- debugger
906
907
  this.biz_code = res.biz_code;
907
908
  if (this.isPreview) {
908
909
  switch (this.viewStatus) {
@@ -1078,6 +1079,7 @@ export default {
1078
1079
  "content.is_border",
1079
1080
  "N"
1080
1081
  );
1082
+ this.is_hot = getContainerPropsValue(container, "content.is_hot", "Y");
1081
1083
  this.is_border_c = getContainerPropsValue(
1082
1084
  container,
1083
1085
  "content.is_border_c",
@@ -323,7 +323,7 @@ export default {
323
323
  []
324
324
  ).map((item) => {
325
325
  return {
326
- name: item.label,
326
+ name: item.customName || item.label,
327
327
  ...item,
328
328
  size: Number(item.size ? item.size : 18) * 2,
329
329
  };
@@ -17,22 +17,21 @@ export default {
17
17
  value: data.pay_success_path || null,
18
18
  setting: {
19
19
  router: XdBus.getParentApi('getPagesTree'),
20
-
21
- },
22
- inline: false,
23
- },
24
- {
25
- label: '充值成功跳转路径:', //label
26
- ele: 'xd-select-pages-path', //package 名称
27
- valueKey: 'rechargeSuccessPath', //form[valueKey]
28
- placeholder: '请选择充值成功路径',
29
- value: data.rechargeSuccessPath || null,
30
- setting: {
31
- router: XdBus.getParentApi('getPagesTree'),
32
-
33
20
  },
34
21
  inline: false,
35
22
  },
23
+ // {
24
+ // label: '充值成功跳转路径:', //label
25
+ // ele: 'xd-select-pages-path', //package 名称
26
+ // valueKey: 'rechargeSuccessPath', //form[valueKey]
27
+ // placeholder: '请选择充值成功路径',
28
+ // value: data.rechargeSuccessPath || null,
29
+ // setting: {
30
+ // router: XdBus.getParentApi('getPagesTree'),
31
+ //
32
+ // },
33
+ // inline: false,
34
+ // },
36
35
  ].filter(i=>i)
37
36
  },
38
37
  }