jufubao-base 1.0.63-beta212 → 1.0.63-beta214

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.63-beta212",
3
+ "version": "1.0.63-beta214",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -20,11 +20,17 @@
20
20
  }"
21
21
  >
22
22
  <template v-if="style === '3' && isPreview">
23
- <view class="jfb-base-notice__body-pop">弹窗模式方便编辑(占位),在线上此模块不显</view>
23
+ <view
24
+ class="jfb-base-notice__body-pop"
25
+ :style="{backgroundColor:backgroundColor, color:warningColor}"
26
+ >弹窗模式方便编辑(占位),在线上此模块不显</view>
24
27
  </template>
25
28
  <template v-if="style === '2'">
26
29
  <template v-if="!content && isPreview">
27
- <view class="jfb-base-notice__body-pop" style="color:red">接口无数返回,请检查是否配置成功!</view>
30
+ <view
31
+ class="jfb-base-notice__body-pop"
32
+ :style="{backgroundColor:backgroundColor, color:warningColor}"
33
+ >接口无数返回,请检查是否配置成功!</view>
28
34
  </template>
29
35
  <view v-else class="jfb-base-notice__body-scroll">
30
36
  <xd-notice-bar
@@ -43,7 +49,10 @@
43
49
  </template>
44
50
  <template v-if="style === '1'">
45
51
  <template v-if="!content && isPreview">
46
- <view class="jfb-base-notice__body-pop" style="color:red">接口无数返回,请检查是否配置成功!</view>
52
+ <view
53
+ class="jfb-base-notice__body-pop"
54
+ :style="{backgroundColor:backgroundColor, color:warningColor}"
55
+ >接口无数返回,请检查是否配置成功!</view>
47
56
  </template>
48
57
  <template v-else>
49
58
  <view
@@ -92,6 +101,7 @@
92
101
  import extsMixins from "@/mixins/extsMixins"
93
102
  import { getContainerPropsValue } from "@/utils/xd.base";
94
103
  import storage from "@/common/storage";
104
+ import Color from "color";
95
105
  const color = require('color');
96
106
  export default {
97
107
  name: "JfbBaseNotice",
@@ -108,14 +118,14 @@
108
118
  textAlign: 'left', //标题对其方式
109
119
  noData: false,
110
120
  style: '1', //显示内容(静态/弹窗/滚动)
111
-
112
-
121
+
122
+
113
123
  bgc: '', //背景颜色
114
124
  textColor: '', //文字颜色
115
125
  content : '', //内容
116
126
  contentKey: 'contentKey',
117
127
  borderTitleColor: '#fff',
118
-
128
+
119
129
  margin: {
120
130
  top: 0,
121
131
  left: 0,
@@ -133,13 +143,15 @@
133
143
  titleFontSize: 26,
134
144
  time: 3, //小时
135
145
  isPreview: false,
136
-
146
+
137
147
  //滚动
138
148
  speed: 30, //滚动速度
139
149
  speedKey: 'speedKey',
140
150
  num: 1, //滚动记录数量
141
151
  timer: false,
142
152
  contentList: [],
153
+
154
+ backgroundColor: '',
143
155
  }
144
156
  },
145
157
  watch: {
@@ -151,7 +163,7 @@
151
163
  setTimeout(() => {
152
164
  if (this.$configProject['isPreview']) this.onJfbLoad()
153
165
  }, 400)
154
-
166
+
155
167
  },
156
168
  num(){
157
169
  if (this.timer) {
@@ -161,7 +173,7 @@
161
173
  setTimeout(() => {
162
174
  if (this.$configProject['isPreview']) this.onJfbLoad()
163
175
  }, 400)
164
-
176
+
165
177
  },
166
178
  style() {
167
179
  if(this.$configProject['isPreview']) this.onJfbLoad()
@@ -174,7 +186,7 @@
174
186
  setTimeout(()=>{
175
187
  this.speedKey = Date.now()
176
188
  }, 400)
177
-
189
+
178
190
  }
179
191
  },
180
192
  computed:{
@@ -194,14 +206,15 @@
194
206
  titleRadius() {
195
207
  return `${this.radius}rpx ${this.radius}rpx 0rpx 0rpx `
196
208
  },
197
-
209
+
198
210
  },
199
211
  created() {
212
+ this.backgroundColor = Color(this.warningColor).alpha(0.2).toString();
200
213
  this.isPreview = this.$configProject['isPreview'];
201
214
  this.init(this.container);
202
215
  },
203
216
  methods: {
204
-
217
+
205
218
  /**
206
219
  * @description 监听事件变化
207
220
  * @param container {object} 业务组件对象自己
@@ -222,14 +235,14 @@
222
235
  if (this.fontSize === 26) this.titleFontSize = 36;
223
236
  if (this.fontSize === 36) this.titleFontSize = 44;
224
237
  this.isTitle = getContainerPropsValue(container, 'content.isTitle', false);
225
-
238
+
226
239
  if(this.style === '2') {
227
240
  this.num = getContainerPropsValue(container, 'content.num', 1);
228
241
  this.speed = Number(getContainerPropsValue(container, 'content.speed', 30));
229
242
  }
230
243
  else this.num = 1;
231
244
  },
232
-
245
+
233
246
  handlePop(){
234
247
  console.log('this.time', this.time * 60 + '分钟');
235
248
  storage.set(this.containerId, 1, this.time);
@@ -242,7 +255,7 @@
242
255
  cancel: false,
243
256
  });
244
257
  },
245
-
258
+
246
259
  getContent(){
247
260
  jfbRootExec('getListNewsContent', {
248
261
  vm: this,
@@ -261,16 +274,16 @@
261
274
  this.handlePop()
262
275
  }
263
276
  }
264
-
277
+
265
278
  else if(this.style === '2') {
266
279
  console.log('getContent',res.list)
267
280
  if(res.list.length > 0) {
268
281
  this.contentList = res.list;
269
282
  this.speedKey = Date.now()
270
283
  }
271
-
284
+
272
285
  }
273
-
286
+
274
287
  //静态显示
275
288
  else {
276
289
  if (res.list.length > 0) {
@@ -280,13 +293,13 @@
280
293
  }
281
294
  this.noData = res.list.length > 0;
282
295
  }
283
-
296
+
284
297
  })
285
298
  .catch(error => {
286
299
  console.error(error)
287
300
  })
288
301
  },
289
-
302
+
290
303
  onJfbLoad() {
291
304
  //弹窗模式
292
305
  if(this.style === '3') {
@@ -297,19 +310,19 @@
297
310
  if(!storage.get(this.containerId)) this.getContent()
298
311
  }
299
312
  }
300
-
313
+
301
314
  else {
302
315
  this.getContent()
303
316
  }
304
-
305
-
317
+
318
+
306
319
  },
307
-
320
+
308
321
  onJfbUpdate(data) {
309
322
  storage.remove(this.containerId);
310
323
  this.getContent()
311
324
  }
312
-
325
+
313
326
  }
314
327
  }
315
328
 
@@ -326,7 +339,9 @@
326
339
  }
327
340
  }
328
341
  &-pop {
342
+ min-height: 60rpx;
329
343
  text-align: center;
344
+ line-height: 60rpx;
330
345
  color: #666;
331
346
  font-size: unit(24, rpx);
332
347
  padding:unit(20, rpx);
@@ -334,7 +349,7 @@
334
349
  &-title {
335
350
  border-bottom: 1px solid #fff;
336
351
  }
337
-
352
+
338
353
  &-content {
339
354
  padding: unit(8, rpx) unit(10, rpx);
340
355
  }
@@ -174,7 +174,7 @@
174
174
  <style scoped lang="less">
175
175
  .video-box {
176
176
  view.noImageUrl {
177
- background: #333;
177
+ background: rgba(0,0,0,.6);
178
178
  }
179
179
  view.thumb {
180
180
  height: 100%;