jufubao-base 1.0.168 → 1.0.169-beta10

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/JfbBaseLogin/Attr.js +1147 -510
  3. package/src/components/JfbBaseLogin/JfbBaseLogin.vue +364 -63
  4. package/src/components/JfbBaseMapSearch/MapSearchMp.vue +1 -1
  5. package/src/components/JfbBaseOrderDetail/Api.js +12 -7
  6. package/src/components/JfbBaseOrderDetail/Attr.js +28 -14
  7. package/src/components/JfbBaseOrderDetail/JfbBaseOrderDetail.vue +68 -18
  8. package/src/components/JfbBaseOrderDetail/Mock.js +3 -1
  9. package/src/components/JfbBaseTfkCardBind/Api.js +49 -30
  10. package/src/components/JfbBaseTfkCardBind/Attr.js +635 -38
  11. package/src/components/JfbBaseTfkCardBind/JfbBaseTfkCardBind.vue +617 -22
  12. package/src/components/JfbBaseTfkCardBind/Mock.js +19 -9
  13. package/src/components/JfbBaseTfkCardDetail/Api.js +19 -32
  14. package/src/components/JfbBaseTfkCardDetail/Attr.js +692 -33
  15. package/src/components/JfbBaseTfkCardDetail/JfbBaseTfkCardDetail.vue +630 -23
  16. package/src/components/JfbBaseTfkCardDetail/Mock.js +151 -11
  17. package/src/components/JfbBaseTfkCardLogin/Api.js +19 -34
  18. package/src/components/JfbBaseTfkCardLogin/Attr.js +898 -33
  19. package/src/components/JfbBaseTfkCardLogin/JfbBaseTfkCardLogin.vue +741 -17
  20. package/src/components/JfbBaseTfkCardLogin/Mock.js +677 -11
  21. package/src/components/JfbBaseTfkCardLogin/XdCouponItem.vue +271 -0
  22. package/src/components/JfbBaseTfkSearch/AllList.vue +232 -0
  23. package/src/components/JfbBaseTfkSearch/Api.js +11 -42
  24. package/src/components/JfbBaseTfkSearch/Attr.js +225 -33
  25. package/src/components/JfbBaseTfkSearch/ContentCinema.vue +157 -0
  26. package/src/components/JfbBaseTfkSearch/ContentFilm.vue +179 -0
  27. package/src/components/JfbBaseTfkSearch/ContentProduct.vue +308 -0
  28. package/src/components/JfbBaseTfkSearch/ContentShop.vue +184 -0
  29. package/src/components/JfbBaseTfkSearch/CusAttr.js +213 -0
  30. package/src/components/JfbBaseTfkSearch/CustomList.vue +402 -0
  31. package/src/components/JfbBaseTfkSearch/JfbBaseTfkSearch.vue +230 -26
  32. package/src/components/JfbBaseTfkSearch/Mock.js +90 -11
  33. package/src/components/JfbBaseTfkSearch/SkeletonCinema.vue +45 -0
  34. package/src/components/JfbBaseTfkSearch/SkeletonFilm.vue +109 -0
  35. package/src/components/JfbBaseTfkSearch/SkeletonProduct.vue +246 -0
  36. package/src/components/JfbBaseTfkSearch/SkeletonShop.vue +81 -0
  37. package/src/components/JfbBaseTfkSearch/handleKeyword.js +24 -0
  38. package/src/components/JfbBaseTfkSearch/listMixins.js +153 -0
  39. package/src/components/JfbBaseTfkSearch/search.js +293 -0
  40. package/src/mixins/colorCardMixins.js +71 -9
  41. package/src/mixins/componentsMixins.js +346 -23
@@ -13,31 +13,350 @@
13
13
  <view class="jfb-base-tfk-card-bind__edit-icon" @click="delEdit">删除</view>
14
14
  </view>
15
15
  <!-- #endif -->
16
- <view class="jfb-base-tfk-card-bind__body">
17
- <view>测试插件( {{containerId}} )</view>
16
+ <view class="jfb-base-tfk-card-bind__body" :style="{
17
+ '--form-border-color': formBorderColor,
18
+ '--form-border-width': formBorderWidth + 'px',
19
+ '--form-input-padding': inputPadding + 'px',
20
+ '--label-font-size': ($rpxNum * parseInt(labelFont.fontSize)) + 'px',
21
+ '--label-font-color': labelFont.color,
22
+ '--label-font-weight': labelFont.fontWeight,
23
+ '--content-font-size': ($rpxNum * parseInt(contentFont.fontSize)) + 'px',
24
+ '--content-font-color': contentFont.color,
25
+ '--content-font-weight': contentFont.fontWeight,
26
+ '--placeholder-font-size': ($rpxNum * parseInt(placeholderFont.fontSize)) + 'px',
27
+ '--placeholder-font-color': placeholderFont.color,
28
+ '--placeholder-font-weight': placeholderFont.fontWeight,
29
+ '--ticket-icon-size': ($rpxNum * parseInt(ticketIcon.fontSize)) + 'px',
30
+ '--password-icon-size': ($rpxNum * parseInt(passwordIcon.fontSize)) + 'px',
31
+ '--valid-icon-size': ($rpxNum * parseInt(validCodeIcon.fontSize)) + 'px',
32
+ '--digital-icon-size': ($rpxNum * parseInt(digitalCodeIcon.fontSize)) + 'px',
33
+ '--digital-border-radius': ($rpxNum * Number(digitalCodeRadius)) + 'px',
34
+ '--digital-border-color': digitalCodeColor
35
+ }">
36
+ <view class="menu_wrap" :style="menuBoxStyle">
37
+ <view class="menu_list">
38
+ <view class="menu_item" @click="switchShowType('ticket')">
39
+ <view class="menu_inner" :class="menuShowType"
40
+ :style="[menuType == 'ticket' ? menuItemActiveStyle : menuItemStyle, menuItemBoxStyle]">实体券</view>
41
+ </view>
42
+ <view class="menu_item" @click="switchShowType('code')">
43
+ <view class="menu_inner" :class="menuShowType"
44
+ :style="[menuType == 'code' ? menuItemActiveStyle : menuItemStyle, menuItemBoxStyle]">电子码</view>
45
+ </view>
46
+ </view>
47
+ </view>
48
+ <view v-if="menuType === 'ticket'" class="form_wrap" :style="cardFormStyle">
49
+ <template v-if="menuType === 'ticket'">
50
+ <xd-form :label-align="labelAlign"
51
+ :key="formRenderKey"
52
+ :labelPosition="labelPosition"
53
+ :border="true"
54
+ paddingBetween="0"
55
+ >
56
+ <xd-form-item
57
+ class="form-item ticket_item"
58
+ :class="[inputStyle]"
59
+ :label="labelShow ==='N'?'':'票券号码'"
60
+ :labelWidth="labelWidth"
61
+ :leftIcon="ticketIcon.icon"
62
+ :iconColor="ticketIcon.color"
63
+ content-align="left"
64
+ >
65
+ <view class="align-center">
66
+ <xd-form-input
67
+ v-model="form.card_number"
68
+ placeholder="请输入票券号"
69
+ />
70
+ <view @click="doScanCode">
71
+ <xd-font-icon :icon="scanIcon.icon || 'iconsaoma'"
72
+ :color="scanIcon.color"
73
+ :style="{fontSize: scanIcon.fontSize}"
74
+ ></xd-font-icon>
75
+ </view>
76
+ </view>
77
+ </xd-form-item>
78
+ <xd-form-item
79
+ class="form-item password_item"
80
+ :class="[inputStyle]"
81
+ :label="labelShow ==='N'?'':'票券密码'"
82
+ :labelWidth="labelWidth"
83
+ :leftIcon="passwordIcon.icon"
84
+ :iconColor="passwordIcon.color"
85
+ content-align="left"
86
+ >
87
+ <xd-form-input type="password" placeholder="请输入票券密码" v-model="form.card_password" />
88
+ </xd-form-item>
89
+ <xd-form-item
90
+ class="form-item valid_item"
91
+ :class="[inputStyle]"
92
+ style="border-top: none;"
93
+ :label="labelShow ==='N'?'':'验证号码'"
94
+ :labelWidth="labelWidth"
95
+ :leftIcon="validCodeIcon.icon"
96
+ :iconColor="validCodeIcon.color"
97
+ content-align="left"
98
+ lastBorder
99
+ >
100
+ <view class="align-center">
101
+ <xd-form-input
102
+ v-model="form.valid_code"
103
+ placeholder="请输入验证码"
104
+ />
105
+ <view class="form_valid_code">
106
+ <image
107
+ style="width: 100%;height:100%"
108
+ :src="validImageAPIUrl + '?image_width=160&image_height=50&token='+ valid_token"
109
+ />
110
+ </view>
111
+ </view>
112
+ </xd-form-item>
113
+ </xd-form>
114
+ <view :style="btnWrapStyle">
115
+ <xd-button type="primary"
116
+ :radius="btnRadius + 'rpx'"
117
+ @click="toBindCardTicket"
118
+ >
119
+ <xd-font-icon :icon="btnIcon.icon"
120
+ style="display: inline-flex;margin-right: 12rpx;"
121
+ :color="btnIcon.color"
122
+ :style="{fontSize: btnIcon.fontSize}"
123
+ ></xd-font-icon>
124
+ 确定
125
+ </xd-button>
126
+ </view>
127
+ </template>
128
+ </view>
129
+ <view v-else class="form_wrap" :style="digitalFormStyle">
130
+ <xd-form :key="formRenderKey"
131
+ label-align="left"
132
+ labelPosition="left"
133
+ :border="true"
134
+ paddingBetween="0"
135
+ >
136
+ <xd-form-item class="form-item digital_item"
137
+ label=""
138
+ :labelWidth="digitalCodeLabelWidth"
139
+ :leftIcon="digitalCodeIcon.icon"
140
+ :iconColor="digitalCodeIcon.color"
141
+ content-align="left"
142
+ >
143
+ <xd-form-input prefixIcon="1" placeholder="请输入票券号" v-model="form.code" />
144
+ </xd-form-item>
145
+ </xd-form>
146
+ <view :style="digitalBtnWrapStyle">
147
+ <xd-button type="primary"
148
+ :radius="btnRadius + 'rpx'"
149
+ @click="toBindCardDigital"
150
+ >
151
+ <xd-font-icon :icon="btnIcon.icon"
152
+ style="display: inline-flex;margin-right: 12rpx;"
153
+ :color="btnIcon.color"
154
+ :style="{fontSize: btnIcon.fontSize}"
155
+ ></xd-font-icon>
156
+ 确定
157
+ </xd-button>
158
+ </view>
159
+ </view>
160
+ <view :style="tipBoxStyle" v-html="tips"></view>
18
161
  </view>
19
162
  </view>
20
163
  </template>
21
164
 
22
165
  <script>
166
+ import XdButton from "@/components/XdButton/XdButton";
167
+ import XdFormCheckbox from "@/components/XdFormCheckbox/XdFormCheckbox";
168
+ import XdFormInput from "@/components/XdFormInput/XdFormInput";
169
+ import XdForm from "@/components/XdForm/XdForm";
170
+ import XdFormItem from "@/components/XdFormItem/XdFormItem";
23
171
  import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
24
172
  import { jfbRootExec } from "@/utils/xd.event";
25
173
  import JfbBaseTfkCardBindMixin from "./JfbBaseTfkCardBindMixin";
26
174
  import { getContainerPropsValue } from "@/utils/xd.base";
27
175
  import componentsMixins from "@/mixins/componentsMixins";
28
176
  import extsMixins from "@/mixins/extsMixins";
177
+ import { mapState } from "vuex";
29
178
  export default {
30
179
  name: "JfbBaseTfkCardBind",
31
180
  components: {
32
- XdFontIcon
181
+ XdFontIcon,
182
+ XdButton,
183
+ XdFormCheckbox,
184
+ XdFormInput,
185
+ XdFormItem,
186
+ XdForm,
33
187
  },
34
188
  mixins: [
35
189
  componentsMixins, extsMixins, JfbBaseTfkCardBindMixin
36
190
  ],
37
191
  data() {
38
192
  return {
39
-
193
+ menuType: "ticket", //ticket,code
194
+ form: {},
195
+ validImageAPIUrl: "",
196
+ valid_token: "",
197
+ formRenderKey: "formRenderKey",
198
+ hasCon: "", //是否有优惠券
199
+ jwxSDK: null,
200
+
40
201
  //todo
202
+ tips: "",
203
+ labelWidth: 180,
204
+ labelAlign: "left",
205
+ labelPosition: "left",
206
+ inputStyle: "linear", //输入框样式 linear:线性 face: 面性
207
+ formBorderColor: "#F9F9F9", //
208
+ formBorderWidth: 1, //表单边框宽度
209
+
210
+ formPadding: {
211
+ top: 0,
212
+ left: 0,
213
+ right: 0,
214
+ bottom: 0
215
+ },
216
+ digitalFormMargin: {},
217
+ menuPadding: {
218
+ top: 0,
219
+ left: 0,
220
+ right: 0,
221
+ bottom: 0
222
+ },
223
+ menuBtnPadding: {},
224
+
225
+ passwordIcon: {},
226
+ validCodeIcon: {},
227
+ btnMargin: {},
228
+ btnRadius: 0,
229
+ tipBgColor: "",
230
+ tipPadding: {},
231
+ menuTabColor: {},
232
+ menuShowType: "text",
233
+ menuBorderWidth: 1,
234
+ labelShow: "Y",
235
+ inputPadding: "20",
236
+ labelFont: { //表单label字体
237
+ color: "#333",
238
+ fontSize: "24rpx",
239
+ fontWeight: "normal",
240
+ },
241
+ contentFont: { //表单内容字体
242
+ color: "#333",
243
+ fontSize: "24rpx",
244
+ fontWeight: "normal",
245
+ },
246
+ placeholderFont: {
247
+ color: "#d4d4d4",
248
+ fontSize: "24rpx",
249
+ fontWeight: "normal",
250
+ },
251
+ scanIcon: {},
252
+ ticketIcon: {},
253
+ btnIcon: {},
254
+ digitalCodeIcon: {},
255
+ digitalBtnMargin: {},
256
+ digitalCodeLabelWidth: "",
257
+ digitalCodeRadius: 0,
258
+ digitalCodeColor: "",
259
+ my_card_url: "",
260
+ backUrl: "",
261
+ }
262
+ },
263
+ computed: {
264
+ ...mapState({
265
+ brandInfo: state => state.brandInfo
266
+ }),
267
+ cardFormStyle(){
268
+ let padding = `${this.checkValue(this.formPadding.top, 20)}rpx`;
269
+ padding = `${padding} ${this.checkValue(this.formPadding.right, 20)}rpx`;
270
+ padding = `${padding} ${this.checkValue(this.formPadding.bottom, 20)}rpx`;
271
+ padding = `${padding} ${this.checkValue(this.formPadding.left, 20)}rpx`;
272
+
273
+ return this.styleObjectToString({
274
+ // background: this.formBgColor,
275
+ padding: padding,
276
+ })
277
+ },
278
+ digitalFormStyle(){
279
+ let padding = `${this.checkValue(this.digitalFormMargin.top, 20)}rpx`;
280
+ padding = `${padding} ${this.checkValue(this.digitalFormMargin.right, 20)}rpx`;
281
+ padding = `${padding} ${this.checkValue(this.digitalFormMargin.bottom, 20)}rpx`;
282
+ padding = `${padding} ${this.checkValue(this.digitalFormMargin.left, 20)}rpx`;
283
+
284
+ return this.styleObjectToString({
285
+ padding: padding,
286
+ })
287
+ },
288
+ menuBoxStyle(){
289
+ let padding = `${this.checkValue(this.menuPadding.top, 20)}rpx`;
290
+ padding = `${padding} ${this.checkValue(this.menuPadding.right, 20)}rpx`;
291
+ padding = `${padding} ${this.checkValue(this.menuPadding.bottom, 20)}rpx`;
292
+ padding = `${padding} ${this.checkValue(this.menuPadding.left, 20)}rpx`;
293
+
294
+ return this.styleObjectToString({
295
+ // background: this.formBgColor,
296
+ padding: padding,
297
+ })
298
+ },
299
+ btnWrapStyle(){
300
+ let padding = `${this.checkValue(this.btnMargin.top, 20)}rpx`;
301
+ padding = `${padding} ${this.checkValue(this.btnMargin.right, 20)}rpx`;
302
+ padding = `${padding} ${this.checkValue(this.btnMargin.bottom, 20)}rpx`;
303
+ padding = `${padding} ${this.checkValue(this.btnMargin.left, 20)}rpx`;
304
+ return this.styleObjectToString({
305
+ padding: padding,
306
+ })
307
+ },
308
+ digitalBtnWrapStyle(){
309
+ let padding = `${this.checkValue(this.digitalBtnMargin.top, 20)}rpx`;
310
+ padding = `${padding} ${this.checkValue(this.digitalBtnMargin.right, 20)}rpx`;
311
+ padding = `${padding} ${this.checkValue(this.digitalBtnMargin.bottom, 20)}rpx`;
312
+ padding = `${padding} ${this.checkValue(this.digitalBtnMargin.left, 20)}rpx`;
313
+ return this.styleObjectToString({
314
+ padding: padding,
315
+ })
316
+ },
317
+ tipBoxStyle(){
318
+ let padding = `${this.checkValue(this.tipPadding.top, 20)}rpx`;
319
+ padding = `${padding} ${this.checkValue(this.tipPadding.right, 20)}rpx`;
320
+ padding = `${padding} ${this.checkValue(this.tipPadding.bottom, 20)}rpx`;
321
+ padding = `${padding} ${this.checkValue(this.tipPadding.left, 20)}rpx`;
322
+ return this.styleObjectToString({
323
+ background: this.tipBgColor,
324
+ padding: padding,
325
+ fontSize: '24rpx',
326
+ })
327
+ },
328
+ menuItemBoxStyle(){
329
+ let padding = `${this.checkValue(this.menuBtnPadding.top, 20)}rpx`;
330
+ padding = `${padding} ${this.checkValue(this.menuBtnPadding.right, 20)}rpx`;
331
+ padding = `${padding} ${this.checkValue(this.menuBtnPadding.bottom, 20)}rpx`;
332
+ padding = `${padding} ${this.checkValue(this.menuBtnPadding.left, 20)}rpx`;
333
+ return this.styleObjectToString({
334
+ padding
335
+ })
336
+ },
337
+ menuItemStyle(){
338
+ let styleObj = {
339
+ color: this.menuTabColor['color'] || '#333',
340
+ background: this.menuTabColor['bgColor'] || '#fff',
341
+ fontSize: this.menuTabColor['fontSize'] || '30rpx',
342
+ fontWeight: this.menuTabColor['fontWeight'] || 'normal',
343
+ }
344
+
345
+ return this.styleObjectToString(styleObj)
346
+ },
347
+ menuItemActiveStyle(){
348
+ let defaultTextColor = '#ff5a39';
349
+ let styleActiveObj = {
350
+ color: this.menuTabColor['actColor'] || defaultTextColor,
351
+ background: this.menuTabColor['actBgColor'] || '#fff',
352
+ fontSize: this.menuTabColor['actFontSize'] || '30rpx',
353
+ fontWeight: this.menuTabColor['actFontWeight'] || 'normal',
354
+ }
355
+ if(this.menuShowType === 'text'){
356
+ styleActiveObj['borderBottom'] = `${this.menuBorderWidth}px solid ${this.menuTabColor['actColor'] || defaultTextColor}`;
357
+ }else{
358
+ }
359
+ return this.styleObjectToString(styleActiveObj)
41
360
  }
42
361
  },
43
362
  watch: {
@@ -48,34 +367,218 @@
48
367
  },
49
368
  created() {
50
369
  this.init(this.container);
51
-
370
+ this.validImageAPIUrl = this.brandInfo['api_host'] + '/common/v1/valid_code/image/show'
371
+ this.valid_token = this.$xdUniHelper.randomChar(20);
52
372
  //todo
373
+ // #ifdef H5
374
+ jfbRootExec("getH5WxAuthorize", {
375
+ vm: this,
376
+ data: {
377
+ jsApiList: ["chooseWXPay"],
378
+ }
379
+ }).then(res => {
380
+ this.jwxSDK = res.jwxSDK;
381
+ })
382
+ // #endif
53
383
  },
54
384
  methods: {
55
385
  onJfbLoad(options) {
56
386
 
57
- // jfbRootExec('baiduUserLogin', {
58
-
59
- // vm: this,// data: {
60
-
61
- // account: 'gaoshiyong',// password: '123456789',// type: 3,// ...options
62
-
63
- // }
64
-
65
- // }).then().catch()
66
387
  },
67
388
  /**
68
389
  * @description 监听事件变化
69
390
  * @param container {object} 业务组件对象自己
70
391
  */
71
- init(container) {
392
+ init(value) {
393
+ this.previewCurrent = getContainerPropsValue(value, "content.previewCurrent", 'ticket');
394
+ this.tips = getContainerPropsValue(value, "content.tips", '');
395
+ this.formPadding = getContainerPropsValue(value, "content.formPadding", {top: 20, left: 20, right: 20, bottom: 20});
396
+ this.digitalFormMargin = getContainerPropsValue(value, "content.digitalFormMargin", {top: 20, left: 20, right: 20, bottom: 20});
397
+ this.menuPadding = getContainerPropsValue(value, "content.menuPadding", {top: 20, left: 20, right: 20, bottom: 20});
398
+ this.menuBtnPadding = getContainerPropsValue(value, "content.menuBtnPadding", {top: 20, left: 20, right: 20, bottom: 20});
399
+ this.labelAlign = getContainerPropsValue(value, "content.labelAlign", 'left');
400
+ this.labelPosition = getContainerPropsValue(value, "content.labelPosition", 'left');
401
+ this.labelWidth = getContainerPropsValue(value, "content.labelWidth", '180');
402
+ this.ticketIcon = getContainerPropsValue(value, "content.ticketIcon", {});
403
+ this.passwordIcon = getContainerPropsValue(value, "content.passwordIcon", {});
404
+ this.validCodeIcon = getContainerPropsValue(value, "content.validCodeIcon", {});
405
+ this.btnMargin = getContainerPropsValue(value, "content.btnMargin", {});
406
+ this.btnRadius = getContainerPropsValue(value, "content.btnRadius", 0);
407
+ this.tipBgColor = getContainerPropsValue(value, "content.tipBgColor", '#fff');
408
+ this.tipPadding = getContainerPropsValue(value, "content.tipPadding", {top: 20, left: 20, right: 20, bottom: 20});
409
+ this.menuTabColor = getContainerPropsValue(value, "content.menuTabColor", {});
410
+ this.menuShowType = getContainerPropsValue(value, "content.menuShowType", 'text');
411
+ this.menuBorderWidth = getContainerPropsValue(value, "content.menuBorderWidth", 1);
412
+ this.inputStyle = getContainerPropsValue(value, "content.inputStyle", 'linear');
413
+ this.formBorderColor = getContainerPropsValue(value, "content.formBorderColor", '#F9F9F9');
414
+ this.formBorderWidth = getContainerPropsValue(value, "content.formBorderWidth", '1');
415
+ this.labelShow = getContainerPropsValue(value, "content.labelShow", true);
416
+ this.inputPadding = getContainerPropsValue(value, "content.inputPadding", 20);
417
+ this.labelFont = getContainerPropsValue(value, "content.labelFont", {});
418
+ this.contentFont = getContainerPropsValue(value, "content.contentFont", {});
419
+ this.placeholderFont = getContainerPropsValue(value, "content.placeholderFont", {});
420
+ this.scanIcon = getContainerPropsValue(value, "content.scanIcon", {});
421
+ this.btnIcon = getContainerPropsValue(value, "content.btnIcon", {});
422
+ this.digitalCodeIcon = getContainerPropsValue(value, "content.digitalCodeIcon", {});
423
+ this.digitalBtnMargin = getContainerPropsValue(value, "content.digitalBtnMargin", {});
424
+ this.digitalCodeLabelWidth = getContainerPropsValue(value, "content.digitalCodeLabelWidth", '100');
425
+ this.digitalCodeRadius = getContainerPropsValue(value, "content.digitalCodeRadius", '0');
426
+ this.digitalCodeColor = getContainerPropsValue(value, "content.digitalCodeColor", '#dddddd');
427
+ this.my_card_url = getContainerPropsValue(this.container, 'content.my_card_url', { value: "" }).value;
428
+ this.backUrl = getContainerPropsValue(this.container, 'content.back_url', { value: "" }).value;
72
429
 
73
- //this.bgcolor = getContainerPropsValue(container, 'content.bgcolor', '#fff');
430
+ console.log(this.digitalCodeRadius, "digitalCodeRadius");
74
431
 
75
- //this.height = getContainerPropsValue(container, 'content.height', 10);
432
+ if(this.inputStyle === 'face'){
433
+ this.labelPosition = 'left';
434
+ this.labelAlign = 'left';
435
+ }
436
+ if(this.$configProject.isPreview){
437
+ this.menuType = this.previewCurrent;
438
+ this.formRenderKey = Date.now();
439
+ }
440
+ },
441
+ toShowCouponDialog(){
442
+ if(this.info){
443
+ jfbRootFnExec(this, 'onCustomEvent')("@showBaseConDialog", {user_card_number: this.form.card_number})
444
+ }
445
+ },
446
+ switchShowType(type){
447
+ this.menuType = type;
448
+ },
449
+ handlerAfterBindCard(res){
450
+ //已绑定卡券处理
451
+ if(res.pop_info && res.pop_info.pop_code === '1001'){
452
+ this.handleBindConfirm();
453
+ return;
454
+ }
455
+ let path = this.getUrlCallback(this.my_card_url || this.backUrl);
456
+ //有优惠券处理
457
+ if(this.hasCon){
458
+ this.toShowCouponDialog();
459
+ this.$bus.$on("onCloseConDialog",(container_id) => {
460
+ if(container_id === this.hasCon){
461
+ this.$xdUniHelper.redirectTo({
462
+ url: path,
463
+ });
464
+ }
465
+ })
466
+ }
467
+
468
+ //票券绑定成功
469
+ else{
470
+ this.$xdAlert({
471
+ content: "票券绑定成功",
472
+ close: () => {
473
+ this.$xdUniHelper.redirectTo({
474
+ url: path,
475
+ });
476
+ },
477
+ });
478
+ }
479
+ },
480
+ //卡券已被自己绑定时的弹框
481
+ handleBindConfirm(){
482
+ this.$xdConfirm({
483
+ styles: this.styles,
484
+ width: '90%',
485
+ content: '您已绑定该票券,无需再次绑定',
486
+ confirmText: '我的票券',
487
+ cancelText: '返回',
488
+ showClose: false,
489
+ success: (res) => {
490
+ if (res.confirm) {
491
+ let path = this.getUrlCallback(this.my_card_url || this.backUrl);
492
+ this.$xdUniHelper.redirectTo({ url: path});
493
+ }else{
494
+ }
495
+ }
496
+ })
497
+ },
498
+ //绑定实体券
499
+ async toBindCardTicket(){
500
+ console.log(this.form, 'this.form')
501
+ const { card_password, card_number, valid_code } = this.form;
502
+ if(!valid_code) return uni.showToast({
503
+ title: '请输入验证码',
504
+ icon: "none"
505
+ })
506
+ await this.checkValidToken();
507
+
508
+ jfbRootExec("pwdCardBind", {
509
+ vm: this,
510
+ data: {
511
+ card_password: card_password,
512
+ card_number: card_number + "",
513
+ is_show_pop: "Y"
514
+ }
515
+ }).then(res => {
516
+ this.handlerAfterBindCard(res);
517
+ })
518
+ },
519
+ //绑定电子码票券
520
+ toBindCardDigital(){
521
+ const { code } = this.form;
522
+
523
+ if(!code) return "";
524
+ jfbRootExec("pwdCardBind", {
525
+ vm: this,
526
+ data: {
527
+ card_password: code,
528
+ is_show_pop: "Y"
529
+ }
530
+ }).then(res => {
531
+ this.handlerAfterBindCard(res);
532
+ })
533
+ },
534
+ checkValidToken(){
535
+ const { valid_code } = this.form;
536
+ let token = this.valid_token;
537
+ return new Promise((r,j) => {
538
+ jfbRootExec("checkValidCode", {
539
+ vm: this,
540
+ data: {
541
+ token,
542
+ valid_code
543
+ }
544
+ }).then(res => {
545
+ if(res.is_valid){
546
+ r();
547
+ }else{
548
+ uni.showToast({
549
+ title: '验证码错误',
550
+ duration: 2000,
551
+ icon: "none"
552
+ });
553
+ this.switchValidToken();
554
+ j();
555
+ }
556
+ })
557
+ })
558
+ },
559
+ switchValidToken(){
560
+ let valid_token = this.$xdUniHelper.randomChar(20);
561
+ this.valid_token = valid_token;
562
+ },
563
+ doScanCode(){
564
+ // #ifdef H5
565
+ this.jwxSDK.scanQRCode({
566
+ needResult: 1,
567
+ success: res => {
568
+ this.$set(this.form, 'card_number', res.resultStr)
569
+ }
570
+ })
571
+ // #endif
572
+ // #ifdef MP
573
+ uni.scanCode({
574
+ success: res => {
575
+ this.$set(this.form, 'card_number', res.result)
576
+ }
577
+ })
578
+ // #endif
76
579
  },
77
580
  onJfbScroll(options) {
78
- console.log('event.onJfbScroll', options)
581
+ // console.log('event.onJfbScroll', options)
79
582
  },
80
583
  onJfbReachBottom(options) {
81
584
  console.log('event.onJfbReachBottom', options)
@@ -92,9 +595,12 @@
92
595
  onJfbUpdate(...data) {
93
596
  console.log('event.onJfbUpdate', data)
94
597
  },
95
- onJfbCustomEvent(options) {
96
- console.log('event.onJfbReachBottom', options)
97
- },
598
+ onJfbCustomEvent({action, data}){
599
+ if(action === 'baseConDialog@hasCon'){
600
+ this.hasCon = data;
601
+ }
602
+ console.log('onJfbCustomEvent',action, data);
603
+ }
98
604
  }
99
605
  }
100
606
 
@@ -102,10 +608,99 @@
102
608
 
103
609
  <style scoped lang="less">
104
610
  @import "./JfbBaseTfkCardBindLess.less";
611
+ .align-center{
612
+ display: flex;
613
+ align-items: center;
614
+ }
105
615
 
106
616
  .jfb-base-tfk-card-bind {
107
617
  &__body{
108
-
618
+ .form-item {
619
+ ::v-deep &.uni-forms-item {
620
+ .uni-input-input{
621
+ font-size: var(--content-font-size);
622
+ color: var(--content-font-color);
623
+ font-weight: var(--content-font-weight);
624
+ }
625
+ .label-text {
626
+ font-size: var(--label-font-size);
627
+ color: var(--label-font-color);
628
+ font-weight: var(--label-font-weight);
629
+ }
630
+ .uni-easyinput__placeholder-class{
631
+ font-size: var(--placeholder-font-size);
632
+ color: var(--placeholder-font-color);
633
+ font-weight: var(--placeholder-font-weight);
634
+ }
635
+ }
636
+ ::v-deep &.uni-forms-item--border{
637
+ padding: var(--form-input-padding) 0;
638
+ }
639
+ &.linear{
640
+ ::v-deep &.uni-forms-item--border{
641
+ border-color: var(--form-border-color) !important;
642
+ border-width: var(--form-border-width) !important;
643
+ }
644
+ }
645
+ &.face{
646
+ ::v-deep .uni-forms-item__box{
647
+ background: #F7F7F7;
648
+ border-radius: 16rpx;
649
+ padding-right: 20rpx;
650
+ }
651
+ ::v-deep &.uni-forms-item--border{
652
+ border: none;
653
+ }
654
+ }
655
+ &.ticket_item{
656
+ ::v-deep .label-icon{
657
+ font-size: var(--ticket-icon-size) !important;
658
+ }
659
+ }
660
+ &.password_item{
661
+ ::v-deep .label-icon{
662
+ font-size: var(--password-icon-size) !important;
663
+ }
664
+ }
665
+ &.valid_item{
666
+ ::v-deep .label-icon{
667
+ font-size: var(--valid-icon-size) !important;
668
+ }
669
+ }
670
+ &.digital_item{
671
+ ::v-deep .label-icon{
672
+ font-size: var(--digital-icon-size) !important;
673
+ }
674
+ ::v-deep .uni-forms-item__inner{
675
+ padding-bottom: 0% !important;
676
+ border: 1px solid var(--digital-border-color);
677
+ border-radius: var(--digital-border-radius);
678
+ }
679
+ }
680
+ }
681
+ .menu_wrap{
682
+ .menu_list{
683
+ display: flex;
684
+ .menu_item{
685
+ flex: 1;
686
+ text-align: center;
687
+
688
+ .menu_inner{
689
+ display: inline-block;
690
+ &.button{
691
+ border-radius: 50rpx;
692
+ }
693
+ }
694
+ }
695
+ }
696
+ }
697
+ .form_valid_code{
698
+ width: 160rpx;
699
+ height: 50rpx;
700
+ background: #DDD;
701
+ border-radius: 8rpx;
702
+ overflow: hidden;
703
+ }
109
704
  }
110
705
  }
111
706
  </style>