jufubao-base 1.0.56 → 1.0.61-beta5

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 (32) hide show
  1. package/package.json +2 -2
  2. package/src/components/JfbBaseCardDetail/JfbBaseCardDetail.vue +19 -1
  3. package/src/components/JfbBaseCardDetailEntry/Api.js +58 -0
  4. package/src/components/JfbBaseCardDetailEntry/Attr.js +30 -0
  5. package/src/components/JfbBaseCardDetailEntry/JfbBaseCardDetailEntry.vue +812 -0
  6. package/src/components/JfbBaseCardDetailEntry/JfbBaseCardDetailEntryLess.less +80 -0
  7. package/src/components/JfbBaseCardDetailEntry/JfbBaseCardDetailEntryMixin.js +30 -0
  8. package/src/components/JfbBaseCardDetailEntry/Mock.js +106 -0
  9. package/src/components/JfbBaseCardDetailEntry/XdEditPwd.vue +299 -0
  10. package/src/components/JfbBaseCardDetailEntry/XdPwPay.vue +214 -0
  11. package/src/components/JfbBaseCardDisabledEntry/Api.js +12 -7
  12. package/src/components/JfbBaseCardDisabledEntry/JfbBaseCardDisabledEntry.vue +39 -12
  13. package/src/components/JfbBaseCardEntry/JfbBaseCardEntry.vue +37 -1
  14. package/src/components/JfbBaseCardInfoEntry/Api.js +71 -0
  15. package/src/components/JfbBaseCardInfoEntry/Attr.js +37 -0
  16. package/src/components/JfbBaseCardInfoEntry/JfbBaseCardInfoEntry.vue +661 -0
  17. package/src/components/JfbBaseCardInfoEntry/JfbBaseCardInfoEntryLess.less +80 -0
  18. package/src/components/JfbBaseCardInfoEntry/JfbBaseCardInfoEntryMixin.js +30 -0
  19. package/src/components/JfbBaseCardInfoEntry/Mock.js +122 -0
  20. package/src/components/JfbBaseCardMergeEntry/Api.js +61 -0
  21. package/src/components/JfbBaseCardMergeEntry/Attr.js +237 -0
  22. package/src/components/JfbBaseCardMergeEntry/JfbBaseCardMergeEntry.vue +443 -0
  23. package/src/components/JfbBaseCardMergeEntry/JfbBaseCardMergeEntryLess.less +80 -0
  24. package/src/components/JfbBaseCardMergeEntry/JfbBaseCardMergeEntryMixin.js +30 -0
  25. package/src/components/JfbBaseCardMergeEntry/Mock.js +32 -0
  26. package/src/components/JfbBaseCardShiftEntry/Api.js +51 -0
  27. package/src/components/JfbBaseCardShiftEntry/Attr.js +237 -0
  28. package/src/components/JfbBaseCardShiftEntry/JfbBaseCardShiftEntry.vue +476 -0
  29. package/src/components/JfbBaseCardShiftEntry/JfbBaseCardShiftEntryLess.less +80 -0
  30. package/src/components/JfbBaseCardShiftEntry/JfbBaseCardShiftEntryMixin.js +30 -0
  31. package/src/components/JfbBaseCardShiftEntry/Mock.js +5 -0
  32. package/src/mixins/colorCardMixins.js +1 -1
@@ -0,0 +1,661 @@
1
+ <template>
2
+ <view
3
+ class="jfb-base-card-info-entry"
4
+ @click="handleEditxSelect"
5
+ :class="{ editx: isEditx && active }"
6
+ >
7
+ <!--#ifdef H5-->
8
+ <view
9
+ class="jfb-base-card-info-entry__edit"
10
+ :class="{ editx: isEditx && active }"
11
+ v-if="isEditx && active"
12
+ >
13
+ <view class="jfb-base-card-info-entry__edit-icon" @click="delEdit"
14
+ >删除</view
15
+ >
16
+ </view>
17
+ <!-- #endif -->
18
+ <view class="jfb-base-card-info-entry__body" :style="{minHeight: layoutInfo.bodyMinHeightRpx + 'rpx'}">
19
+ <view v-if="!qrcode && showForm">
20
+ <view>
21
+ <view class="jfb-base-card-info-entry__body-form">
22
+ <view class="jfb-base-card-info-entry__body-form-label"
23
+ >票券号码</view
24
+ >
25
+ <input
26
+ type="number"
27
+ max="32"
28
+ v-model="card_number"
29
+ :placeholder="card_num_placeholder"
30
+ />
31
+ </view>
32
+ <view class="jfb-base-card-info-entry__body-form">
33
+ <view class="jfb-base-card-info-entry__body-form-label"
34
+ >票券密码</view
35
+ >
36
+ <input
37
+ max="18"
38
+ :password="isPassword"
39
+ v-model="card_password"
40
+ :placeholder="card_pwd_placeholder"
41
+ />
42
+ <xd-font-icon
43
+ @click="isPassword = !isPassword"
44
+ :icon="isPassword ? 'iconbiyan' : 'iconchakan'"
45
+ ></xd-font-icon>
46
+ </view>
47
+ </view>
48
+ <view :style="{ height: '100rpx' }"></view>
49
+ <view class="fixe_bottom" :style="prod_bottom">
50
+ <xd-button
51
+ type="primary"
52
+ width="360rpx"
53
+ @click="handleGetInfo"
54
+ >确认</xd-button
55
+ >
56
+ </view>
57
+ </view>
58
+
59
+ <view v-if="showInfo && info !== null">
60
+ <view
61
+ class="jfb-base-card-info-entry__body-header"
62
+ :style="{
63
+ background: headerBg.color,
64
+ backgroundSize: '100%',
65
+ }"
66
+ >
67
+ <view
68
+ class="jfb-base-card-info-entry__body-header-wrap"
69
+ :style="{
70
+ backgroundImage: `url(${headerBg.image})`,
71
+ }"
72
+ >
73
+ <view class="jfb-base-card-info-entry__body-header-item">
74
+ <view>券名:</view>
75
+ <view>{{ info.card_type_name }}</view>
76
+ </view>
77
+ <view
78
+ style="padding-bottom: 0px"
79
+ class="jfb-base-card-info-entry__body-header-item"
80
+ >
81
+ <view>券号:</view>
82
+ <view>{{ info.card_number }}</view>
83
+ </view>
84
+ </view>
85
+ </view>
86
+ <view class="jfb-base-card-info-entry__body-content">
87
+ <view
88
+ :class="
89
+ item.key === 'other_card_point'
90
+ ? 'jfb-base-card-info-entry__body-content-special'
91
+ : 'jfb-base-card-info-entry__body-content-item'
92
+ "
93
+ v-for="(item, index) in valueKey"
94
+ :key="index"
95
+ >
96
+ <view> {{ item.label }}: </view>
97
+ <view :style="{color:mainColor,fontWeight:500}" v-if="item.type === 'price'">
98
+ {{ info[item.key] }}
99
+ <text>{{info.unit}}</text>
100
+ </view>
101
+ <view style="color: #333; font-weight: 500" v-else>
102
+ {{ info[item.key] }}
103
+ <text v-if="item.type === 'type'">券</text>
104
+ </view>
105
+ </view>
106
+ </view>
107
+ <view
108
+ v-if="info.site_entry_settings && info.site_entry_settings.length > 0"
109
+ class="jfb-base-card-info-entry__body-business"
110
+ >
111
+ <view class="jfb-base-card-info-entry__body-business-title">
112
+ 支持业务板块
113
+ </view>
114
+ <view
115
+ style="
116
+ display: flex;
117
+ align-content: center;
118
+ justify-content: center;
119
+ "
120
+ >
121
+ <view class="jfb-base-card-info-entry__body-business-content">
122
+ <view
123
+ class="jfb-base-card-info-entry__body-business-content-item"
124
+ v-for="(item, index) in info.site_entry_settings"
125
+ :key="index"
126
+ >
127
+ <view><image :src="item.image_url"></image></view>
128
+ <view>{{ item.entry_name }}</view>
129
+ </view>
130
+ </view>
131
+ </view>
132
+ </view>
133
+ <view :style="{ height: '100rpx' }"></view>
134
+ <view class="fixe_bottom" :style="prod_bottom">
135
+ <xd-button
136
+ type="primary"
137
+ width="360rpx"
138
+ @click="handleToLink"
139
+ >立即绑定</xd-button
140
+ >
141
+ </view>
142
+ </view>
143
+ </view>
144
+ </view>
145
+ </template>
146
+
147
+ <script>
148
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
149
+ import { jfbRootExec } from "@/utils/xd.event";
150
+ import JfbBaseCardInfoEntryMixin from "./JfbBaseCardInfoEntryMixin";
151
+ import { getContainerPropsValue } from "@/utils/xd.base";
152
+ import getServiceUrl from "@/common/getServiceUrl";
153
+ import componentsMixins from "@/mixins/componentsMixins";
154
+ import extsMixins from "@/mixins/extsMixins";
155
+ import colorCardMixins from "@/mixins/colorCardMixins";
156
+ import XdUnit from "@/components/XdUnit/XdUnit";
157
+ import XdButton from "@/components/XdButton/XdButton";
158
+
159
+ export default {
160
+ name: "JfbBaseCardInfoEntry",
161
+ components: {
162
+ XdFontIcon,
163
+ XdUnit,
164
+ XdButton,
165
+ },
166
+ mixins: [
167
+ componentsMixins, extsMixins, JfbBaseCardInfoEntryMixin,colorCardMixins
168
+ ],
169
+ data() {
170
+ return {
171
+ info: null,
172
+ valueKey: [
173
+ {
174
+ label: "票券余额",
175
+ key: "card_point",
176
+ type: "price",
177
+ },
178
+ {
179
+ label: "购买其他物品可抵",
180
+ key: "other_card_point",
181
+ type: "price",
182
+ },
183
+ {
184
+ label: "有效期限",
185
+ key: "end_time",
186
+ type: "normal",
187
+ },
188
+ ],
189
+ card_number: "", //卡号
190
+ card_password: "", //卡密码
191
+ isPassword: true,
192
+ card_num_placeholder: "",
193
+ card_pwd_placeholder: "",
194
+
195
+ showInfo: false,
196
+
197
+ qrcode: "", //二维码
198
+ showForm: true,
199
+
200
+ //页面跳转地址
201
+ backUrl: "",
202
+ headerBg: {},
203
+ };
204
+ },
205
+ watch: {
206
+ container(value) {
207
+ this.init(value);
208
+ },
209
+ },
210
+ computed: {
211
+ prod_bottom() {
212
+ return this.fixedStyle({ height: 0, zIndex: 111 });
213
+ },
214
+ },
215
+ created() {},
216
+ methods: {
217
+ handleToLink() {
218
+ if(this.info.card_point===0) {
219
+ this.$xdConfirm({
220
+ $vm: this,
221
+ content: "票券余额为0,是否确认绑定?",
222
+ width: "80%",
223
+ success: (res) => {
224
+ if (res.confirm) {
225
+ this.handleToBind()
226
+ }
227
+ },
228
+ });
229
+ return
230
+ }
231
+ this.handleToBind()
232
+ },
233
+ handleToBind() {
234
+ if (this.qrcode) {
235
+ jfbRootExec("qrCardBindEntry", {
236
+ vm: this,
237
+ data: {
238
+ card_qrcode: this.qrcode,
239
+ },
240
+ })
241
+ .then((res) => {
242
+ this.$xdAlert({
243
+ content: "绑定成功",
244
+ close: () => {
245
+ this.$xdUniHelper.redirectTo({
246
+ url: this.backUrl,
247
+ });
248
+ },
249
+ });
250
+ })
251
+ .catch();
252
+ } else {
253
+ jfbRootExec("pwdCardBindEntry", {
254
+ vm: this,
255
+ data: {
256
+ card_password: this.card_password,
257
+ card_number: this.card_number + "",
258
+ is_show_entry_settings: "Y"
259
+ },
260
+ })
261
+ .then((res) => {
262
+ console.log(this.$xdAlert, "this.$xdAlertfsdfs");
263
+ this.$xdAlert({
264
+ content: "绑定成功",
265
+ close: () => {
266
+ this.$xdUniHelper.redirectTo({
267
+ url: this.backUrl,
268
+ });
269
+ },
270
+ });
271
+ })
272
+ .catch();
273
+ }
274
+ },
275
+ init() {
276
+ this.backUrl = getContainerPropsValue(
277
+ this.container,
278
+ "content.back_url",
279
+ { value: "/pages/card/card" }
280
+ ).value;
281
+ this.card_num_placeholder = getContainerPropsValue(
282
+ this.container,
283
+ "content.card_num_placeholder",
284
+ "请输入券号(电子券除外)"
285
+ );
286
+ this.card_pwd_placeholder = getContainerPropsValue(
287
+ this.container,
288
+ "content.card_pwd_placeholder",
289
+ "请输入密码"
290
+ );
291
+ },
292
+ onJfbLoad(options) {
293
+ this.init();
294
+ this.qrcode = options.qrcode;
295
+ console.log(this.$configProject.isPreview, "898989989");
296
+ //正式环境判断参数错误
297
+ // if(!this.$configProject.isPreview) {
298
+ // if(!this.qrcode) {
299
+ // this.$xdAlert({
300
+ // content: '参数配置错误',
301
+ // type: 'error'
302
+ // });
303
+ // return
304
+ // }
305
+ // }
306
+ if (this.qrcode) {
307
+ jfbRootExec("getByQrCardDetailEntry", {
308
+ vm: this,
309
+ data: {
310
+ card_qrcode: decodeURIComponent(this.qrcode),
311
+ is_show_entry_settings: "Y"
312
+ },
313
+ })
314
+ .then((res) => {
315
+ res.is_exchange_name =
316
+ res.is_exchange === "Y" ? "可转换" : "不可转换";
317
+ let temp = {};
318
+ Object.keys(res).map((key) => {
319
+ if (key === "card_point" || key === "other_card_point") {
320
+ temp[key] = this.$xdUniHelper.divisionFloatNumber(
321
+ res[key],
322
+ 100
323
+ );
324
+ } else if (key === "unit") {
325
+ temp[key] = res[key];
326
+ } else {
327
+ temp[key] = res[key];
328
+ }
329
+ });
330
+ if(res && res.site_entry_settings && res.site_entry_settings.length>0) {
331
+ res.site_entry_settings = res.site_entry_settings.map(item=>{
332
+ item['image_url'] = getServiceUrl(item['image_url'])
333
+ return item
334
+ })
335
+ }
336
+ if(res.other_card_point===0 || res.card_point_type === 1) {
337
+ this.valueKey.splice(1,1);
338
+ }
339
+ this.headerBg = this.getCardThemes(res.card_type_name);
340
+ this.showInfo = true;
341
+ this.info = temp;
342
+ })
343
+ .catch();
344
+ }
345
+ },
346
+ getInfoByCard() {
347
+ jfbRootExec("getByPwdCardDetailEntry", {
348
+ vm: this,
349
+ data: {
350
+ card_password: this.card_password,
351
+ card_number: this.card_number + "",
352
+ is_show_entry_settings: "Y"
353
+ },
354
+ })
355
+ .then((res) => {
356
+ res.is_exchange_name =
357
+ res.is_exchange === "Y" ? "可转换" : "不可转换";
358
+ let temp = {};
359
+ Object.keys(res).map((key) => {
360
+ if (key === "card_point" || key === "other_card_point") {
361
+ temp[key] = this.$xdUniHelper.divisionFloatNumber(res[key], 100);
362
+ // temp[key] = res[key];
363
+ } else if (key === "unit") {
364
+ temp[key] = res[key];
365
+ } else {
366
+ temp[key] = res[key];
367
+ }
368
+ });
369
+ if(res && res.site_entry_settings && res.site_entry_settings.length>0) {
370
+ res.site_entry_settings = res.site_entry_settings.map(item=>{
371
+ item['image_url'] = getServiceUrl(item['image_url'])
372
+ return item
373
+ })
374
+ }
375
+ if(res.other_card_point===0 || res.card_point_type === 1) {
376
+ this.valueKey.splice(1,1);
377
+ }
378
+ this.headerBg = this.getCardThemes(res.card_type_name);
379
+ this.showInfo = true;
380
+ this.showForm = false;
381
+ this.info = temp;
382
+ })
383
+ .catch();
384
+ },
385
+ isEmpty(str) {
386
+ if (str === null || str === "") {
387
+ return true;
388
+ }
389
+ return false;
390
+ },
391
+ handleGetInfo() {
392
+ if (this.isEmpty(this.card_password)) {
393
+ this.$xdAlert({
394
+ content: "请填写票券密码",
395
+ time: 1500,
396
+ isClose: false,
397
+ zIndex: 5000,
398
+ });
399
+ return;
400
+ }
401
+ this.getInfoByCard();
402
+ },
403
+ onJfbBack(options) {
404
+ this.$xdUniHelper.navigateBack();
405
+ },
406
+ onJfbShow(options) {
407
+ this.onJfbLoad(options);
408
+ },
409
+ },
410
+ };
411
+ </script>
412
+
413
+ <style scoped lang="less">
414
+ @import "./JfbBaseCardInfoEntryLess.less";
415
+
416
+ .jfb-base-card-info-entry {
417
+ &__body {
418
+ color: #333;
419
+ padding: unit(26, rpx);
420
+ &-form {
421
+ display: flex;
422
+ align-items: center;
423
+ justify-content: flex-start;
424
+ font-size: unit(24, rpx);
425
+ padding: unit(40, rpx);
426
+ border-bottom: unit(2, rpx) solid #eeeeee;
427
+ background: #fff;
428
+
429
+ &-label {
430
+ width: unit(120, rpx);
431
+ color: #a6a6a6;
432
+ margin-right: unit(70, rpx);
433
+ text-align: center;
434
+ }
435
+
436
+ input {
437
+ font-size: unit(24, rpx);
438
+ }
439
+
440
+ &-value {
441
+ flex: 1;
442
+ }
443
+
444
+ &-code {
445
+ background: #f5f5f5;
446
+ border-radius: unit(6, rpx);
447
+ width: unit(180, rpx);
448
+ height: unit(80, rpx);
449
+ line-height: unit(80, rpx);
450
+ font-size: unit(48, rpx);
451
+ color: #a6a6a6;
452
+ text-align: center;
453
+ }
454
+ }
455
+ .logo-icon {
456
+ width: unit(100, rpx) !important;
457
+ height: unit(100, rpx) !important;
458
+ position: absolute;
459
+ top: 50%;
460
+ left: 50%;
461
+ transform: translate(-50rpx, -50rpx);
462
+ }
463
+ &-header {
464
+ border-radius: unit(16, rpx);
465
+ font-size: unit(40, rpx);
466
+ font-weight: 700;
467
+ color: #fff;
468
+ position: relative;
469
+ min-height: unit(260,rpx);
470
+
471
+ &-wrap {
472
+ width: unit(700, rpx);
473
+ border-radius: unit(16, rpx);
474
+ background-size: 100%;
475
+ min-height: unit(260,rpx);
476
+ display: flex;
477
+ flex-direction: column;
478
+ justify-content: center;
479
+ }
480
+
481
+ &-item {
482
+ display: flex;
483
+ justify-content: flex-start;
484
+ align-content: center;
485
+ padding-bottom: unit(32, rpx);
486
+ padding-left: unit(40,rpx);
487
+
488
+ & > view:first-child {
489
+ flex-basis: unit(120,rpx);
490
+ flex-shrink: 0;
491
+ }
492
+ }
493
+ }
494
+
495
+ &-content {
496
+ background: #fff;
497
+ border-radius: unit(16, rpx);
498
+ padding: unit(38, rpx) 0;
499
+ margin-top: unit(24, rpx);
500
+
501
+ &-item {
502
+ display: flex;
503
+ color: #666;
504
+ justify-content: space-between;
505
+ align-content: center;
506
+ font-size: unit(28, rpx);
507
+ padding: unit(16, rpx) unit(48, rpx);
508
+ }
509
+
510
+ &-special {
511
+ display: flex;
512
+ color: #666;
513
+ justify-content: space-between;
514
+ font-size: unit(24, rpx);
515
+ padding: unit(18, rpx) unit(24, rpx);
516
+ margin: 0 unit(24, rpx);
517
+ border-radius: unit(16, rpx);
518
+ background: #f9f9f9;
519
+ align-content: center;
520
+ }
521
+ }
522
+
523
+ &-qrcode {
524
+ text-align: center;
525
+ font-size: @xd-font-size-base;
526
+ line-height: unit(36, rpx);
527
+ background: #fff;
528
+ border-radius: unit(16, rpx);
529
+ margin-top: unit(24, rpx);
530
+ padding: unit(20, rpx) unit(70, rpx) unit(70, rpx) unit(70, rpx);
531
+
532
+ & > view {
533
+ // margin-bottom: unit(20, rpx);
534
+
535
+ & > view {
536
+ margin-bottom: 0;
537
+ }
538
+ }
539
+
540
+ & > view:nth-child(1) {
541
+ display: flex;
542
+ justify-content: center;
543
+ align-items: center;
544
+ box-sizing: border-box;
545
+ height: unit(200, rpx);
546
+ width: 100%;
547
+ margin-top: unit(20, rpx);
548
+
549
+ & > view {
550
+ width: 100%;
551
+ height: unit(200, rpx);
552
+ padding: unit(10, rpx);
553
+ display: flex;
554
+ justify-content: center;
555
+ align-items: center;
556
+
557
+ & > image {
558
+ max-width: 100%;
559
+ max-height: unit(200, rpx);
560
+ }
561
+ }
562
+ }
563
+
564
+ & > view:nth-child(2) {
565
+ display: flex;
566
+ justify-content: center;
567
+ align-items: center;
568
+ padding: unit(20, rpx);
569
+
570
+ & > view {
571
+ width: unit(450, rpx);
572
+ height: unit(450, rpx);
573
+ padding: unit(10, rpx);
574
+
575
+ & > image {
576
+ width: unit(450, rpx);
577
+ height: unit(450, rpx);
578
+ }
579
+ }
580
+ }
581
+ }
582
+
583
+ &-business {
584
+ background: #fff;
585
+ border-radius: unit(16, rpx);
586
+ margin-top: unit(24, rpx);
587
+
588
+ &-title {
589
+ font-size: unit(28, rpx);
590
+ font-weight: 500;
591
+ text-align: center;
592
+ padding: unit(28, rpx);
593
+ }
594
+
595
+ &-content {
596
+ display: flex;
597
+ justify-content: flex-start;
598
+ align-items: center;
599
+ flex-flow: wrap;
600
+ padding-left: unit(30, rpx);
601
+
602
+ & > view {
603
+ width: unit(120, rpx);
604
+ margin-right: unit(10, rpx);
605
+ flex-shrink: 0;
606
+ display: flex;
607
+ justify-content: center;
608
+ flex-direction: column;
609
+ align-items: center;
610
+
611
+ & > view:first-child {
612
+ width: unit(76, rpx);
613
+ height: unit(76, rpx);
614
+ overflow: hidden;
615
+
616
+ & > image {
617
+ height: 100%;
618
+ width: 100%;
619
+ }
620
+ }
621
+
622
+ & > view:nth-child(2) {
623
+ margin-top: unit(10, rpx);
624
+ font-size: unit(24, rpx);
625
+ line-height: unit(36, rpx);
626
+ margin-bottom: unit(10, rpx);
627
+ }
628
+
629
+ & > view:nth-child(3) {
630
+ display: flex;
631
+ justify-content: flex-start;
632
+ align-items: center;
633
+ flex-shrink: 0;
634
+ font-size: unit(20, rpx);
635
+ color: #999;
636
+ }
637
+
638
+ &:last-child {
639
+ margin-right: 0;
640
+ }
641
+ }
642
+ }
643
+ }
644
+
645
+ .fixe_bottom {
646
+ display: flex;
647
+ align-items: center;
648
+ justify-content: space-between;
649
+ height: unit(100, rpx);
650
+ padding: 0 unit(40, rpx);
651
+ background: #fff;
652
+ box-shadow: 0 0 unit(16, rpx) rgba(0, 0, 0, 0.05);
653
+ .flex_l {
654
+ display: flex;
655
+ align-items: center;
656
+ font-size: unit(32, rpx);
657
+ }
658
+ }
659
+ }
660
+ }
661
+ </style>