jufubao-base 1.0.169 → 1.0.170

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 (41) hide show
  1. package/package.json +1 -1
  2. package/src/components/JfbBaseHeader/JfbBaseHeader.vue +2 -2
  3. package/src/components/JfbBaseLogin/Attr.js +1157 -510
  4. package/src/components/JfbBaseLogin/JfbBaseLogin.vue +369 -63
  5. package/src/components/JfbBaseMapSearch/MapSearchMp.vue +1 -1
  6. package/src/components/JfbBaseNotice/JfbBaseNotice.vue +2 -2
  7. package/src/components/JfbBaseTfkCardBind/Api.js +49 -30
  8. package/src/components/JfbBaseTfkCardBind/Attr.js +708 -38
  9. package/src/components/JfbBaseTfkCardBind/JfbBaseTfkCardBind.vue +688 -22
  10. package/src/components/JfbBaseTfkCardBind/Mock.js +19 -9
  11. package/src/components/JfbBaseTfkCardDetail/Api.js +19 -32
  12. package/src/components/JfbBaseTfkCardDetail/Attr.js +740 -33
  13. package/src/components/JfbBaseTfkCardDetail/JfbBaseTfkCardDetail.vue +639 -23
  14. package/src/components/JfbBaseTfkCardDetail/Mock.js +151 -11
  15. package/src/components/JfbBaseTfkCardLogin/Api.js +19 -34
  16. package/src/components/JfbBaseTfkCardLogin/Attr.js +1094 -32
  17. package/src/components/JfbBaseTfkCardLogin/JfbBaseTfkCardLogin.vue +775 -17
  18. package/src/components/JfbBaseTfkCardLogin/Mock.js +191 -11
  19. package/src/components/JfbBaseTfkCardLogin/XdCouponItem.vue +275 -0
  20. package/src/components/JfbBaseTfkCardLogin/XdNotice.vue +550 -0
  21. package/src/components/JfbBaseTfkSearch/AllList.vue +337 -0
  22. package/src/components/JfbBaseTfkSearch/Api.js +11 -42
  23. package/src/components/JfbBaseTfkSearch/Attr.js +344 -32
  24. package/src/components/JfbBaseTfkSearch/ContentCinema.vue +157 -0
  25. package/src/components/JfbBaseTfkSearch/ContentFilm.vue +218 -0
  26. package/src/components/JfbBaseTfkSearch/ContentProduct.vue +317 -0
  27. package/src/components/JfbBaseTfkSearch/ContentShop.vue +186 -0
  28. package/src/components/JfbBaseTfkSearch/CusAttr.js +213 -0
  29. package/src/components/JfbBaseTfkSearch/CustomList.vue +453 -0
  30. package/src/components/JfbBaseTfkSearch/JfbBaseTfkSearch.vue +286 -35
  31. package/src/components/JfbBaseTfkSearch/Mock.js +242 -11
  32. package/src/components/JfbBaseTfkSearch/SkeletonCinema.vue +45 -0
  33. package/src/components/JfbBaseTfkSearch/SkeletonFilm.vue +109 -0
  34. package/src/components/JfbBaseTfkSearch/SkeletonProduct.vue +246 -0
  35. package/src/components/JfbBaseTfkSearch/SkeletonShop.vue +81 -0
  36. package/src/components/JfbBaseTfkSearch/handleKeyword.js +24 -0
  37. package/src/components/JfbBaseTfkSearch/listMixins.js +187 -0
  38. package/src/components/JfbBaseUserInfo/JfbBaseUserInfo.vue +2 -1
  39. package/src/mixins/colorCardMixins.js +71 -9
  40. package/src/mixins/componentsMixins.js +376 -23
  41. package/src/mixins/posterMixins.js +122 -0
@@ -13,31 +13,474 @@
13
13
  <view class="jfb-base-tfk-card-login__edit-icon" @click="delEdit">删除</view>
14
14
  </view>
15
15
  <!-- #endif -->
16
- <view class="jfb-base-tfk-card-login__body">
17
- <view>测试插件( {{containerId}} )</view>
16
+ <view class="jfb-base-tfk-card-login__body" :style="{
17
+ '--card-list-margin': ($rpxNum * cardItemMargin) + 'px',
18
+ }">
19
+ <view class="menu_wrap" :style="menuBoxStyle">
20
+ <view class="menu_list">
21
+ <view class="menu_item"
22
+ :style="{
23
+ marginRight: menuItemMargin + 'px'
24
+ }"
25
+ @click="changeMenu('card')"
26
+ >
27
+ <view class="menu_item_inner"
28
+ :style="[menuType === 'card' ? menuItemActiveStyle : menuItemStyle, menuItemBoxStyle]">我的票券包</view>
29
+ </view>
30
+ <view class="menu_item" @click="changeMenu('coupon')">
31
+ <view class="menu_item_inner"
32
+ :style="[menuType === 'coupon' ? menuItemActiveStyle : menuItemStyle, menuItemBoxStyle]">我的优惠券</view>
33
+ </view>
34
+ </view>
35
+ <view class="bind_card" :style="bindCardBoxStyle" @click="toBindCard">
36
+ <xd-font-icon :icon="bindCardIcon.icon"
37
+ :color="bindCardIcon.color"
38
+ :size="bindCardIcon.size"
39
+ ></xd-font-icon>
40
+ <view v-if="bindCardText" :style="getBindCardTextStyle">{{ bindCardText }}</view>
41
+ </view>
42
+ </view>
43
+ <view class="JfbBaseNotice">
44
+ <xd-notice
45
+ :panelSetting="noticeSetting"
46
+ :apiGetContent="apiGetContent"
47
+ ></xd-notice>
48
+ </view>
49
+ <view class="card_list_wrap" :style="listBoxStyle">
50
+ <!-- 我的票券包- 已绑票券 -->
51
+ <template v-if="menuType === 'card'">
52
+ <view v-if="loadingList">
53
+ <view class="bind_list skeleton-wrap">
54
+ <view class="bind_item" v-for="i in 5" :key="i" :style="cardItemBoxStyle">
55
+ <view>
56
+ <view class="bind_point"></view>
57
+ <view class="bind_deduct"></view>
58
+ </view>
59
+ <view>
60
+ <view class="bind_number"></view>
61
+ <view class="bind_time"></view>
62
+ </view>
63
+ <view class="bind_type"></view>
64
+ <view class="bind_btn"></view>
65
+ </view>
66
+ </view>
67
+ </view>
68
+ <view v-else>
69
+ <view v-if="cardList.length" class="bind_list">
70
+ <view class="bind_item" v-for="(item, i) in cardList" :key="i"
71
+ :style="cardItemBoxStyle" @click="toCardDetail(item)">
72
+ <view>
73
+ <view class="bind_point">
74
+ <xd-unit
75
+ :unitFontSize="24"
76
+ :fontSize="48"
77
+ :price="item.card_point"
78
+ :isOld="false"
79
+ :unit="item.unit || ''"
80
+ :colorNew="cardFontColor"
81
+ ></xd-unit>
82
+ </view>
83
+ <view v-if="item.other_card_point && item.card_point_type !== 1" class="bind_deduct">
84
+ 兑换其他商品可抵:{{ item.other_card_point }}
85
+ </view>
86
+ </view>
87
+ <view>
88
+ <view class="bind_number">{{ item.card_number }}</view>
89
+ <view class="bind_time">{{ item.end_time }}到期</view>
90
+ </view>
91
+ <view class="bind_type" :style="{
92
+ top: cardPadding.top + 'rpx',
93
+ right: cardPadding.right + 'rpx',
94
+ }">
95
+ <view>{{ item.card_type_name }}</view>
96
+ <view v-if="item.is_exchange === 'Y'">(可转票券)</view>
97
+ </view>
98
+ <view class="bind_btn"
99
+ :style="[{
100
+ right: cardPadding.right + 'rpx',
101
+ bottom: cardPadding.bottom + 'rpx',
102
+ borderRadius: cardBtnRadius + 'rpx',
103
+ padding: bindCardBtnPadding,
104
+ minWidth: cardBtnMinWidth + 'rpx',
105
+ }, item.is_login === 'Y' ? bindCardActiveStyle : bindCardBtnStyle]"
106
+ @click.stop="doCardLogin(item)"
107
+ >{{ item.is_login === 'Y' ? '已登录' : '登录'}}</view>
108
+ </view>
109
+ <view v-if="!hasCardList" class="no_more_card" @click="toDisableUrl">没有更多券了,查看失效的票券 ></view>
110
+ </view>
111
+ <view v-else>
112
+ <!-- 暂无数据 -->
113
+ </view>
114
+ </view>
115
+ </template>
116
+
117
+ <!-- 优惠券 -->
118
+ <template v-else >
119
+ <view v-if="couponList.length" class="coupon_list">
120
+ <xd-coupon-item v-for="(item, i) in couponList" :key="i"
121
+ :couponRadius="couponRadius"
122
+ :couponImageUrl="couponImageUrl"
123
+ :couponTitleBgColor="couponTitleBgColor"
124
+ :couponUseBtnPadding="couponUseBtnPadding"
125
+ :couponBtnRadius="couponBtnRadius"
126
+ :couponBtnTextStyle="couponBtnTextStyle"
127
+ :couponLeftBgColor="couponLeftBgColor"
128
+ :item="item"
129
+ @useCoupon="doCardLogin(item)"
130
+ @toDetail="toCardDetail(item)"
131
+ ></xd-coupon-item>
132
+ <view v-if="!hasCouponList" class="no_more_card" @click="toDisableUrl">没有更多券了,查看失效的票券 ></view>
133
+ </view>
134
+ <view v-else>
135
+ 暂无数据
136
+ </view>
137
+
138
+ </template>
139
+ </view>
140
+
18
141
  </view>
19
142
  </view>
20
143
  </template>
21
144
 
22
145
  <script>
23
146
  import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
147
+ import XdUnit from "@/components/XdUnit/XdUnit";
148
+ import XdNotice from "./XdNotice";
24
149
  import { jfbRootExec } from "@/utils/xd.event";
25
150
  import JfbBaseTfkCardLoginMixin from "./JfbBaseTfkCardLoginMixin";
26
151
  import { getContainerPropsValue } from "@/utils/xd.base";
27
152
  import componentsMixins from "@/mixins/componentsMixins";
28
153
  import extsMixins from "@/mixins/extsMixins";
154
+ import getServiceUrl from '@/common/getServiceUrl'
155
+ import XdNoticeBar from "@/components/XdNoticeBar/XdNoticeBar";
156
+ import XdCouponItem from "./XdCouponItem";
157
+ import Color from "color"
158
+ import { mapState, mapActions } from "vuex";
29
159
  export default {
30
160
  name: "JfbBaseTfkCardLogin",
31
161
  components: {
32
- XdFontIcon
162
+ XdFontIcon,
163
+ XdNoticeBar,
164
+ XdCouponItem,
165
+ XdUnit,
166
+ XdNotice,
33
167
  },
34
168
  mixins: [
35
169
  componentsMixins, extsMixins, JfbBaseTfkCardLoginMixin
36
170
  ],
37
171
  data() {
38
172
  return {
173
+ // hideMask: true,
174
+ menuType: "card", // card, coupon
175
+ loadingList: true,
176
+ cardList: [],
177
+ couponList: [],
178
+ hasCardList: false,
179
+ hasCouponList: false,
180
+
181
+ inCallbackUrlOrg:'',//是否带有回调地址
182
+ inCallback: null, //内部跳转地址
183
+ allEntryPath: "", //综合福利入口页
184
+ cardDetailPath: "", //我的票券包详情页
185
+ disabledPath: "", //禁用票券包详情页
186
+
187
+ options: {},
188
+ showDisabled: 'Y',
39
189
 
40
190
  //todo
191
+ previewCurrent: "",
192
+ isPreview: false,
193
+ notice: "",
194
+ noticeStatus: false,
195
+ noticeBackgroundColor: "",
196
+ cardBindPath: "",
197
+ menuPadding: {},
198
+ menuBtnPadding: {},
199
+ menuItemMargin: 40,
200
+ menuBorderWidth: 1,
201
+ menuTabColor: {},
202
+ bindCardIcon: {},
203
+ cardImageUrl: "",
204
+ couponImageUrl: "",
205
+ cardPadding: {},
206
+ cardRadius: 0,
207
+ couponRadius: 0,
208
+ cardListPadding: {},
209
+ cardItemMargin: 20,
210
+ couponTitleBgColor: "",
211
+ cardBtnTextStyle: {}, //我的票券包登录按钮文字背景色设置
212
+ cardBtnRadius: 16,
213
+ cardBtnPadding: {},
214
+ couponBtnTextStyle: {}, //优惠券包登录按钮文字背景色设置
215
+ couponUseBtnPadding: {},
216
+ couponBtnRadius: 16,
217
+ couponLeftBgColor: "",
218
+
219
+
220
+ noticeStyle: "",
221
+ notice_is_hide_dailog: "",
222
+ noticeIsTitle: "",
223
+ noticeTextAlign: "",
224
+ noticeRadius: "",
225
+ noticeBgc: "",
226
+ noticeTextColor: "",
227
+ noticeFontSize: "",
228
+ noticeNum: "",
229
+ noticeSpeed: "",
230
+ noticeScrollMargin: "",
231
+ noticeTime: "",
232
+
233
+ noticeBgColor: "",
234
+ noticeMargin: {},
235
+ noticePadding: {},
236
+ noticeFont: {},
237
+ noticeMoreFont: {},
238
+
239
+
240
+ bindCardText: "",
241
+ bindCardTextStyle: {},
242
+ bindCardShowType: "",
243
+ bindCardBtnRadius: 16,
244
+ cardBorder: {},
245
+ cardShadow: {},
246
+ cardImageMode: "",
247
+ entryGroupId: "",
248
+ cardHeight: 270,
249
+ cardBtnMinWidth: 100,
250
+ menuShowType: "text",
251
+ cardFontColor: "",
252
+ }
253
+ },
254
+ computed: {
255
+ ...mapState({
256
+ jwxSDK: (state) => state.jwxSDK,
257
+ jfbAuthorize: (state) => state.jfbAuthorize,
258
+ }),
259
+ menuBoxStyle(){
260
+ let padding = `${this.checkValue(this.menuPadding.top, 20)}rpx`;
261
+ padding = `${padding} ${this.checkValue(this.menuPadding.right, 20)}rpx`;
262
+ padding = `${padding} ${this.checkValue(this.menuPadding.bottom, 20)}rpx`;
263
+ padding = `${padding} ${this.checkValue(this.menuPadding.left, 20)}rpx`;
264
+
265
+ return this.styleObjectToString({
266
+ // background: this.formBgColor,
267
+ padding: padding,
268
+ })
269
+ },
270
+ menuItemBoxStyle(){
271
+ let padding = `${this.checkValue(this.menuBtnPadding.top, 20)}rpx`;
272
+ padding = `${padding} ${this.checkValue(this.menuBtnPadding.right, 20)}rpx`;
273
+ padding = `${padding} ${this.checkValue(this.menuBtnPadding.bottom, 20)}rpx`;
274
+ padding = `${padding} ${this.checkValue(this.menuBtnPadding.left, 20)}rpx`;
275
+ return this.styleObjectToString({
276
+ padding
277
+ })
278
+ },
279
+ menuItemStyle(){
280
+ let styleObj = {
281
+ color: this.menuTabColor['color'] || '#333',
282
+ background: this.menuTabColor['bgColor'] || '#fff',
283
+ fontSize: this.menuTabColor['fontSize'] || '30rpx',
284
+ fontWeight: this.menuTabColor['fontWeight'] || 'normal',
285
+ borderWidth: this.menuBorderWidth + 'px',
286
+ }
287
+
288
+ return this.styleObjectToString(styleObj)
289
+ },
290
+ menuItemActiveStyle(){
291
+ let defaultTextColor = '#ff5a39';
292
+ let styleActiveObj = {
293
+ color: this.menuTabColor['actColor'] || defaultTextColor,
294
+ background: this.menuTabColor['actBgColor'] || '#fff',
295
+ fontSize: this.menuTabColor['actFontSize'] || '30rpx',
296
+ fontWeight: this.menuTabColor['actFontWeight'] || 'normal',
297
+ }
298
+ if(this.menuShowType === 'text'){
299
+ styleActiveObj.borderBottom = `${this.menuBorderWidth}px solid ${this.menuTabColor['actColor'] || defaultTextColor}`
300
+ }else{
301
+ styleActiveObj.borderRadius = '100rpx';
302
+ }
303
+
304
+ return this.styleObjectToString(styleActiveObj)
305
+ },
306
+ bindCardBtnPadding(){
307
+ let padding = `${this.checkValue(this.cardBtnPadding.top, 20)}rpx`;
308
+ padding = `${padding} ${this.checkValue(this.cardBtnPadding.right, 20)}rpx`;
309
+ padding = `${padding} ${this.checkValue(this.cardBtnPadding.bottom, 20)}rpx`;
310
+ padding = `${padding} ${this.checkValue(this.cardBtnPadding.left, 20)}rpx`;
311
+ return padding;
312
+ },
313
+ bindCardBtnStyle(){
314
+ let styleObj = {
315
+ color: this.cardBtnTextStyle['color'] || '#333',
316
+ background: this.cardBtnTextStyle['bgColor'] || '#fff',
317
+ fontSize: this.cardBtnTextStyle['fontSize'] || '30rpx',
318
+ fontWeight: this.cardBtnTextStyle['fontWeight'] || 'normal',
319
+ }
320
+ return this.styleObjectToString(styleObj)
321
+ },
322
+ bindCardActiveStyle(){
323
+ let defaultTextColor = '#ff5a39';
324
+ let styleActiveObj = {
325
+ color: this.cardBtnTextStyle['actColor'] || defaultTextColor,
326
+ background: this.cardBtnTextStyle['actBgColor'] || '#fff',
327
+ fontSize: this.cardBtnTextStyle['actFontSize'] || '30rpx',
328
+ fontWeight: this.cardBtnTextStyle['actFontWeight'] || 'normal',
329
+ }
330
+ return this.styleObjectToString(styleActiveObj)
331
+ },
332
+ couponBtnPadding(){
333
+ let padding = `${this.checkValue(this.couponUseBtnPadding.top, 20)}rpx`;
334
+ padding = `${padding} ${this.checkValue(this.couponUseBtnPadding.right, 20)}rpx`;
335
+ padding = `${padding} ${this.checkValue(this.couponUseBtnPadding.bottom, 20)}rpx`;
336
+ padding = `${padding} ${this.checkValue(this.couponUseBtnPadding.left, 20)}rpx`;
337
+ return padding;
338
+ },
339
+ couponBtnStyle(){
340
+ let styleObj = {
341
+ color: this.couponBtnTextStyle['color'] || '#333',
342
+ background: this.couponBtnTextStyle['bgColor'] || '#fff',
343
+ fontSize: this.couponBtnTextStyle['fontSize'] || '30rpx',
344
+ fontWeight: this.couponBtnTextStyle['fontWeight'] || 'normal',
345
+ }
346
+ return this.styleObjectToString(styleObj)
347
+ },
348
+ bindCardBoxStyle(){
349
+ return this.styleObjectToString({
350
+ border: `1px solid ${this.bindCardShowType == 'button' ? this.bindCardTextStyle.color : 'transparent'}`,
351
+ borderRadius: this.bindCardBtnRadius + 'rpx',
352
+ })
353
+ },
354
+ getBindCardTextStyle(){
355
+ let styleObj = {
356
+ color: this.bindCardTextStyle['color'] || '#333',
357
+ fontSize: this.bindCardTextStyle['fontSize'] || '30rpx',
358
+ fontWeight: this.bindCardTextStyle['fontWeight'] || 'normal',
359
+ marginLeft: this.bindCardIcon.icon ? '10rpx' : 0,
360
+ }
361
+ return this.styleObjectToString(styleObj)
362
+ },
363
+ getCardBgImage(){
364
+ let bg = '';
365
+ if(this.$xdUniHelper.checkVarType(this.cardImageUrl) === 'object'
366
+ || this.$xdUniHelper.checkVarType(this.cardImageUrl) === 'array'
367
+ ) {
368
+ if(!this.$xdUniHelper.isEmpty(this.cardImageUrl)) {
369
+ return getServiceUrl(this.cardImageUrl.url)
370
+ }
371
+ }
372
+ return bg
373
+ },
374
+ cardItemBoxStyle(){
375
+ let image = {};
376
+ let border = "none";
377
+ let boxShadow = "none";
378
+ if(this.cardBorder && this.cardBorder.type === 'Y'){
379
+ let { width, color } = this.cardBorder.value;
380
+ border = `${width}rpx solid ${color}`;
381
+ }
382
+ if(this.cardShadow && this.cardShadow.type === 'Y'){
383
+ let { width, color } = this.cardShadow.value;
384
+ boxShadow = `0 0 ${width}rpx ${color}`;
385
+ }
386
+ if(this.cardImageUrl) image = {
387
+ backgroundImage: `url(${this.getCardBgImage})`,
388
+ backgroundSize: '100%',
389
+ backgroundRepeat: 'no-repeat',
390
+ }
391
+ if(this.cardImageMode) image['backgroundSize'] = this.cardImageMode;
392
+
393
+ let padding = `${this.checkValue(this.cardPadding.top, 20)}rpx`;
394
+ padding = `${padding} ${this.checkValue(this.cardPadding.right, 20)}rpx`;
395
+ padding = `${padding} ${this.checkValue(this.cardPadding.bottom, 20)}rpx`;
396
+ padding = `${padding} ${this.checkValue(this.cardPadding.left, 20)}rpx`;
397
+ return this.styleObjectToString({
398
+ ...image,
399
+ padding: padding,
400
+ borderRadius: this.cardRadius + 'rpx',
401
+ border: border,
402
+ boxShadow: boxShadow,
403
+ height: this.cardHeight + 'rpx',
404
+ color: this.cardFontColor
405
+ })
406
+ },
407
+ listBoxStyle(){
408
+ let padding = `${this.checkValue(this.cardListPadding.top, 20)}rpx`;
409
+ padding = `${padding} ${this.checkValue(this.cardListPadding.right, 20)}rpx`;
410
+ padding = `${padding} ${this.checkValue(this.cardListPadding.bottom, 20)}rpx`;
411
+ padding = `${padding} ${this.checkValue(this.cardListPadding.left, 20)}rpx`;
412
+
413
+ return this.styleObjectToString({
414
+ padding: padding,
415
+ })
416
+ },
417
+ getCouponBgImage(){
418
+ let bg = '';
419
+ if(this.$xdUniHelper.checkVarType(this.couponImageUrl) === 'object'
420
+ || this.$xdUniHelper.checkVarType(this.couponImageUrl) === 'array'
421
+ ) {
422
+ if(!this.$xdUniHelper.isEmpty(this.couponImageUrl)) {
423
+ return getServiceUrl(this.couponImageUrl.url)
424
+ }
425
+ }
426
+ return bg
427
+ },
428
+ couponRightItemBoxStyle(){
429
+ let image = {};
430
+ if(this.cardImageUrl) image = {
431
+ backgroundImage: `url(${this.getCouponBgImage})`,
432
+ backgroundSize: '100%',
433
+ backgroundRepeat: 'no-repeat',
434
+ }
435
+ return this.styleObjectToString(image)
436
+ },
437
+ couponItemBoxStyle(){
438
+ return this.styleObjectToString({
439
+ borderRadius: this.couponRadius + 'rpx',
440
+ })
441
+ },
442
+ noticeWrapBoxStyle(){
443
+ let padding = `${this.checkValue(this.noticeMargin.top, 20)}rpx`;
444
+ padding = `${padding} ${this.checkValue(this.noticeMargin.right, 20)}rpx`;
445
+ padding = `${padding} ${this.checkValue(this.noticeMargin.bottom, 20)}rpx`;
446
+ padding = `${padding} ${this.checkValue(this.noticeMargin.left, 20)}rpx`;
447
+
448
+ return this.styleObjectToString({
449
+ padding: padding,
450
+ })
451
+ },
452
+ noticeBoxStyle(){
453
+ let padding = `${this.checkValue(this.noticePadding.top, 20)}rpx`;
454
+ padding = `${padding} ${this.checkValue(this.noticePadding.right, 20)}rpx`;
455
+ padding = `${padding} ${this.checkValue(this.noticePadding.bottom, 20)}rpx`;
456
+ padding = `${padding} ${this.checkValue(this.noticePadding.left, 20)}rpx`;
457
+ return this.styleObjectToString({
458
+ padding: padding,
459
+ background: this.noticeBgColor
460
+ })
461
+ },
462
+ noticeSetting(){
463
+
464
+ return {
465
+ style: this.noticeStyle,
466
+ is_hide_dailog: this.notice_is_hide_dailog,
467
+ isTitle: this.noticeIsTitle,
468
+ textAlign: this.noticeTextAlign,
469
+ radius: this.noticeRadius,
470
+ bgc: this.noticeBgc,
471
+ textColor: this.noticeFont.color || this.warningColor, // noticeTextColor,
472
+ fontSize: this.noticeFont.size, //noticeFontSize,
473
+ num: this.noticeNum,
474
+ speed: this.noticeSpeed,
475
+ scrollMargin: this.noticeScrollMargin,
476
+ time: this.noticeTime,
477
+ warningColor: this.warningColor,
478
+ containerId: this.containerId,
479
+ padding: this.noticePadding,
480
+ margin: this.noticeMargin,
481
+ moreTextColor: this.noticeMoreFont.color || this.warningColor,
482
+ moreFontSize: this.noticeMoreFont.size || 24,
483
+ }
41
484
  }
42
485
  },
43
486
  watch: {
@@ -48,34 +491,218 @@
48
491
  },
49
492
  created() {
50
493
  this.init(this.container);
51
-
494
+ this.isPreview = this.$configProject.isPreview;
495
+ this.noticeBackgroundColor = Color(this.warningColor).alpha(0.2).toString();
52
496
  //todo
53
497
  },
54
498
  methods: {
55
499
  onJfbLoad(options) {
500
+ this.options = options;
501
+ let { inCallback } = options;
502
+ if(!inCallback) this.$storage.remove("inCallback"); //作为入口
503
+ else {
504
+ this.$storage.set("inCallback", inCallback);
505
+ try{
506
+ inCallback = Base64.decode(inCallback);
507
+ this.inCallbackUrlOrg = options.inCallback;
508
+ }catch (e){
509
+ inCallback = null;
510
+ }
511
+ }
512
+ //登录成功调整地址优先级
513
+ this.inCallback = inCallback || this.allEntryPath || this.settings.index;
56
514
 
57
- // jfbRootExec('baiduUserLogin', {
58
-
59
- // vm: this,// data: {
60
-
61
- // account: 'gaoshiyong',// password: '123456789',// type: 3,// ...options
62
-
63
- // }
64
-
65
- // }).then().catch()
515
+ this.getCardList();
66
516
  },
67
517
  /**
68
518
  * @description 监听事件变化
69
519
  * @param container {object} 业务组件对象自己
70
520
  */
71
- init(container) {
521
+ init(value) {
522
+ this.previewCurrent = getContainerPropsValue(value, "content.previewCurrent", 'card');
523
+ this.cardBindPath = getContainerPropsValue(value, "content.cardBindPath", {value: ""}).value;
524
+ this.menuPadding = getContainerPropsValue(value, "content.menuPadding", {top: 20, left: 20, right: 20, bottom: 20});
525
+ this.menuBtnPadding = getContainerPropsValue(value, "content.menuBtnPadding", {top: 20, left: 20, right: 20, bottom: 20});
526
+ this.menuItemMargin = getContainerPropsValue(value, "content.menuItemMargin", 40);
527
+ this.menuTabColor = getContainerPropsValue(value, "content.menuTabColor", {});
528
+ this.menuBorderWidth = getContainerPropsValue(value, "content.menuBorderWidth", 1);
529
+ this.bindCardIcon = getContainerPropsValue(value, "content.bindCardIcon", {});
530
+ this.cardImageUrl = getContainerPropsValue(value, "content.cardImageUrl", "");
531
+ this.couponImageUrl = getContainerPropsValue(value, "content.couponImageUrl", "");
532
+ this.cardPadding = getContainerPropsValue(value, "content.cardPadding", {top: 20, left: 20, right: 20, bottom: 20});
533
+ this.cardRadius = getContainerPropsValue(value, "content.cardRadius", 16);
534
+ this.couponRadius = getContainerPropsValue(value, "content.couponRadius", 16);
535
+ this.cardListPadding = getContainerPropsValue(value, "content.cardListPadding", {});
536
+ this.cardItemMargin = getContainerPropsValue(value, "content.cardItemMargin", 20);
537
+ this.couponTitleBgColor = getContainerPropsValue(value, "content.couponTitleBgColor", {});
538
+ this.cardBtnTextStyle = getContainerPropsValue(value, "content.cardBtnTextStyle", {});
539
+ this.cardBtnRadius = getContainerPropsValue(value, "content.cardBtnRadius", 16);
540
+ this.cardBtnPadding = getContainerPropsValue(value, "content.cardBtnPadding", {top: 20, left: 20, right: 20, bottom: 20});
541
+ this.couponBtnTextStyle = getContainerPropsValue(value, "content.couponBtnTextStyle", {});
542
+ this.couponUseBtnPadding = getContainerPropsValue(value, "content.couponUseBtnPadding", {top: 20, left: 20, right: 20, bottom: 20});
543
+ this.couponBtnRadius = getContainerPropsValue(value, "content.couponBtnRadius", 16);
544
+ this.couponLeftBgColor = getContainerPropsValue(value, "content.couponLeftBgColor", "");
545
+
546
+ this.bindCardText = getContainerPropsValue(value, "content.bindCardText", "");
547
+ this.bindCardTextStyle = getContainerPropsValue(value, "content.bindCardTextStyle", {});
548
+ this.bindCardShowType = getContainerPropsValue(value, "content.bindCardShowType", 'text');
549
+ this.bindCardBtnRadius = getContainerPropsValue(value, "content.bindCardBtnRadius", 16);
550
+ this.cardBorder = getContainerPropsValue(value, "content.cardBorder", {});
551
+ this.cardShadow = getContainerPropsValue(value, "content.cardShadow", {});
552
+ this.cardImageMode = getContainerPropsValue(value, "content.cardImageMode", '');
553
+ this.allEntryPath = getContainerPropsValue(value, "content.allEntryPath", {value: ""}).value;
554
+ this.cardDetailPath = getContainerPropsValue(value, "content.cardDetailPath", {value: ""}).value;
555
+ // this.entryGroupId = getContainerPropsValue(value,"content.entryGroupId","default");
556
+ this.cardHeight = getContainerPropsValue(value, "content.cardHeight", 270);
557
+ this.cardBtnMinWidth = getContainerPropsValue(value, "content.cardBtnMinWidth", 100);
558
+ this.disabledPath = getContainerPropsValue(value, "content.disabledPath", {value: ""}).value;
559
+ this.menuShowType = getContainerPropsValue(value, "content.menuShowType", 'text');
560
+ this.cardFontColor = getContainerPropsValue(value, "content.cardFontColor", '#333');
561
+
562
+ this.noticeStyle = getContainerPropsValue(value, "content.noticeStyle", '1');
563
+ this.notice_is_hide_dailog = getContainerPropsValue(value, "content.notice_is_hide_dailog", 'N');
564
+ this.noticeIsTitle = getContainerPropsValue(value, "content.noticeIsTitle", '');
565
+ this.noticeTextAlign = getContainerPropsValue(value, "content.noticeTextAlign", 'left');
566
+ this.noticeRadius = getContainerPropsValue(value, "content.noticeRadius", '');
567
+ this.noticeBgc = getContainerPropsValue(value, "content.noticeBgc", '');
568
+ this.noticeTextColor = getContainerPropsValue(value, "content.noticeTextColor", this.warningColor);
569
+ this.noticeFontSize = getContainerPropsValue(value, "content.noticeFontSize", '20');
570
+ this.noticeNum = getContainerPropsValue(value, "content.noticeNum", 1);
571
+ this.noticeSpeed = getContainerPropsValue(value, "content.noticeSpeed", 30);
572
+ this.noticeScrollMargin = getContainerPropsValue(value, "content.noticeScrollMargin", '');
573
+ this.noticeTime = getContainerPropsValue(value, "content.noticeTime", 3);
72
574
 
73
- //this.bgcolor = getContainerPropsValue(container, 'content.bgcolor', '#fff');
575
+ this.noticeBgColor = getContainerPropsValue(value, "content.noticeBgColor", "");
576
+ this.noticeMargin = getContainerPropsValue(value, "content.noticeMargin", {top: 20, left: 20, right: 20, bottom: 20});
577
+ this.noticePadding = getContainerPropsValue(value, "content.noticePadding", {top: 20, left: 20, right: 20, bottom: 20});
578
+ this.noticeFont = getContainerPropsValue(value, "content.noticeFont", {});
579
+ this.noticeMoreFont = getContainerPropsValue(value, "content.noticeMoreFont", {});
74
580
 
75
- //this.height = getContainerPropsValue(container, 'content.height', 10);
581
+ console.log(this.cardShadow, 'cardShadow')
582
+ if(this.bindCardTextStyle && !this.bindCardTextStyle.color){
583
+ this.bindCardTextStyle.color = this.mainColor;
584
+ }
585
+ if(this.bindCardIcon && !this.bindCardIcon.color){
586
+ this.bindCardIcon.color = this.mainColor;
587
+ }
588
+ if(this.menuTabColor && !this.menuTabColor.actColor){
589
+ this.menuTabColor.actColor = this.mainColor;
590
+ }
591
+ if(this.cardBtnTextStyle){
592
+ if(!this.cardBtnTextStyle.actBgColor){
593
+ this.cardBtnTextStyle.actBgColor = this.mainColor;
594
+ }
595
+ if(!this.cardBtnTextStyle.bgColor){
596
+ this.cardBtnTextStyle.bgColor = this.mainColor;
597
+ }
598
+ }
599
+
600
+ if(this.$configProject.isPreview){
601
+ this.menuType = this.previewCurrent;
602
+ this.getCardList();
603
+ }
604
+ },
605
+ toCardDetail(item){
606
+ this.$xdUniHelper.navigateTo({
607
+ url: this.cardDetailPath + `?card_number=${item["card_number"]}`
608
+ },false)
609
+ },
610
+ doCardLogin(item){
611
+ this.$xdShowLoading({});
612
+ jfbRootExec("loginTfkCardBind", {
613
+ vm: this,
614
+ data: {
615
+ card_number: item["card_number"]
616
+ }
617
+ }).then(res => {
618
+ this.$xdHideLoading();
619
+ //#ifdef MP-WEIXIN
620
+ if (this.jfbAuthorize !== null) {
621
+ this.jfbAuthorize.setCardToken(res);
622
+ }
623
+ //#endif
624
+
625
+ if (this.$configProject.isPreview) {
626
+ console.log("handleBindLogin", "预览模式不跳转", this.inCallback);
627
+ } else {
628
+ this.$xdUniHelper.redirectTo({
629
+ url: this.inCallback,
630
+ });
631
+ }
632
+ }).catch((res) => {
633
+ this.$xdHideLoading();
634
+ });
635
+ },
636
+ changeMenu(menu){
637
+ this.menuType = menu;
638
+ this.getCardList();
639
+ },
640
+ getCardList(){
641
+ let show_type = this.menuType === 'coupon' ? 'coupon' : 'normal';
642
+ let params = {show_type};
643
+
644
+ // let params = {is_all: 'Y', is_show_entry_settings: 'Y'};
645
+ // if(options['jfb_business_code']) {
646
+ // params['card_business_code'] = options['jfb_business_code'];
647
+ // }
648
+ // if(this.entryGroupId) params['group_id'] = this.entryGroupId;
649
+ this.$xdShowLoading({});
650
+ jfbRootExec("getTfkListCardBind", {
651
+ vm: this,
652
+ data: params,
653
+ }).then(res => {
654
+ this.loadingList = false;
655
+ this.$xdHideLoading();
656
+ this.showDisabled = res.is_show_invalid_card_entrance;
657
+
658
+ let list = res.list.map(item => {
659
+ item.other_card_point = item.other_card_point ? this.$xdUniHelper.divisionFloatNumber(item.other_card_point, 100) : 0
660
+ return item;
661
+ })
662
+ if(show_type === 'coupon'){
663
+ if(this.$configProject.isPreview){
664
+ list = list.filter(item => item.consume_type == 2)
665
+ }
666
+ this.couponList = list;
667
+ }
668
+ if(show_type === 'normal'){
669
+ if(this.$configProject.isPreview){
670
+ list = list.filter(item => item.consume_type != 2)
671
+ }
672
+ this.cardList = list;
673
+ }
674
+ })
675
+ .catch(() => this.$xdHideLoading());
676
+ },
677
+ toBindCard(){
678
+ this.$xdUniHelper.navigateTo({
679
+ url: this.cardBindPath
680
+ })
681
+ },
682
+ apiGetContent(params){
683
+ return new Promise((resolve, reject) => {
684
+ jfbRootExec("getListBaseNewsContent", {
685
+ vm: this,
686
+ data: {
687
+ page_id: this.pageAttr["page_id"], //页面ID
688
+ container_id: this.containerId, //组件ID
689
+ page_size: this.noticeNum || 1,
690
+ ...params
691
+ },
692
+ }).then(res => {
693
+ resolve(res);
694
+ }).catch(err => {
695
+ reject(err);
696
+ })
697
+ })
698
+ },
699
+ toDisableUrl(){
700
+ this.$xdUniHelper.navigateTo({
701
+ url: this.disabledPath
702
+ })
76
703
  },
77
704
  onJfbScroll(options) {
78
- console.log('event.onJfbScroll', options)
705
+ // console.log('event.onJfbScroll', options)
79
706
  },
80
707
  onJfbReachBottom(options) {
81
708
  console.log('event.onJfbReachBottom', options)
@@ -105,7 +732,138 @@
105
732
 
106
733
  .jfb-base-tfk-card-login {
107
734
  &__body{
735
+ .menu_wrap{
736
+ display: flex;
737
+ justify-content: space-between;
738
+ align-items: center;
739
+ background-color: #FFFFFF;
740
+ .menu_list{
741
+ display: flex;
742
+ align-items: center;
743
+ .menu_item_inner{
744
+ border-bottom: 1px solid transparent;
745
+ }
746
+ }
747
+ .bind_card{
748
+ display: flex;
749
+ align-items: center;
750
+ padding: 8rpx 20rpx;
751
+ border-radius: 16rpx;
752
+ }
753
+ }
754
+ &-notice {
755
+ width: 100%;
756
+ box-sizing: border-box;
757
+ &-in {
758
+ display: flex;
759
+ overflow: hidden;
760
+ align-items: center;
761
+ box-sizing: border-box;
762
+ }
108
763
 
764
+ }
765
+ .card_list_wrap{
766
+ padding: 0 20rpx;
767
+ .bind_list{
768
+ &.skeleton-wrap{
769
+ .bind_item{
770
+ .bind_point{
771
+ .skeleton-item(120rpx, 40rpx);
772
+ }
773
+ .bind_deduct{
774
+ .skeleton-item(350rpx, 48rpx);
775
+ padding: 0;
776
+ }
777
+ .bind_number{
778
+ .skeleton-item(250rpx, 28rpx);
779
+ }
780
+ .bind_time{
781
+ .skeleton-item(180rpx, 24rpx);
782
+ }
783
+ .bind_type{
784
+ .skeleton-item(150rpx, 66rpx);
785
+ }
786
+ .bind_btn{
787
+ .skeleton-item(180rpx, 64rpx);
788
+ padding: 0;
789
+ }
790
+ }
791
+ }
792
+ .bind_item{
793
+ padding: 32rpx;
794
+ background: #fff;
795
+ border-radius: 16rpx;
796
+ box-sizing: border-box;
797
+ margin: var(--card-list-margin) 0;
798
+ position: relative;
799
+ display: flex;
800
+ flex-direction: column;
801
+ justify-content: space-between;
802
+ .bind_point{
803
+ font-size: 48rpx;
804
+ ::v-deep .xd-unit{
805
+ height: auto !important;
806
+ font-weight: bold;
807
+ align-items: flex-end;
808
+ .xd-unit__unit{
809
+ line-height: 1.7 !important;
810
+ }
811
+ }
812
+ }
813
+ .bind_deduct{
814
+ font-size: 28rpx;
815
+ background: rgba(51, 51, 51, 0.05);
816
+ display: inline-block;
817
+ padding: 4rpx 20rpx;
818
+ margin-top: 12rpx;
819
+ }
820
+ .bind_number{
821
+ font-size: 28rpx;
822
+ margin-top: 20rpx;
823
+ font-weight: 500;
824
+ }
825
+ .bind_time{
826
+ font-size: 24rpx;
827
+ margin-top: 16rpx;
828
+ font-weight: 500;
829
+ line-height: 1;
830
+ }
831
+ .bind_type{
832
+ font-size: 28rpx;
833
+ position: absolute;
834
+ top: 32rpx;
835
+ right: 32rpx;
836
+ text-align: center;
837
+ font-size: 24rpx;
838
+ font-weight: 400;
839
+ }
840
+ .bind_btn{
841
+ font-size: 28rpx;
842
+ color: #999;
843
+ position: absolute;
844
+ bottom: 32rpx;
845
+ right: 32rpx;
846
+ background: #ddd;
847
+ padding: 16rpx 60rpx;
848
+ border-radius: 12rpx;
849
+ display: flex;
850
+ align-items: center;
851
+ justify-content: center;
852
+ }
853
+ }
854
+ }
855
+ .coupon_list{
856
+ ::v-deep .xd-coupon_item{
857
+ margin: var(--card-list-margin) 0;
858
+ }
859
+ }
860
+ .no_more_card{
861
+ text-align: center;
862
+ padding: 20rpx 0;
863
+ color: #CCCCCC;
864
+ font-size: 28rpx;
865
+ }
866
+ }
109
867
  }
110
868
  }
111
869
  </style>