jufubao-base 1.0.56-beta2005 → 1.0.56-beta2007

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