jufubao-base 1.0.145-beta4 → 1.0.145

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.145-beta4",
3
+ "version": "1.0.145",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -18,7 +18,7 @@
18
18
  <!-- #endif -->
19
19
  <view class="jfb-base-card__body">
20
20
  <view class="jfb-base-card__body-cut">
21
- <template v-if="isQrCode">
21
+ <template v-if="isWx">
22
22
  <view
23
23
  class="jfb-base-card__body-cut-item"
24
24
  @click="handleScan"
@@ -226,11 +226,10 @@ import JfbBaseCardMixin from "./JfbBaseCardMixin";
226
226
  import componentsMixins from "@/mixins/componentsMixins";
227
227
  import extsMixins from "@/mixins/extsMixins";
228
228
  import { mapState, mapActions } from "vuex";
229
- import { getContainerPropsValue, isWechat,isQrCode } from "@/utils/xd.base";
229
+ import { getContainerPropsValue, isWechat } from "@/utils/xd.base";
230
230
  import XdNoticeBar from "@/components/XdNoticeBar/XdNoticeBar";
231
231
  import { Base64 } from "js-base64";
232
232
  const Color = require("color");
233
-
234
233
  export default {
235
234
  name: "JfbBaseCard",
236
235
  components: {
@@ -294,7 +293,7 @@ export default {
294
293
  isPreview: false,
295
294
  noticeStatus: false,
296
295
 
297
- isQrCode: true,
296
+ isWx: true,
298
297
  cutIndex: 1,
299
298
  tabIndex: 1,
300
299
  offsetIndex:0,//第几页
@@ -341,9 +340,10 @@ export default {
341
340
  this.init(this.container);
342
341
  this.noticeBackgroundColor = Color(this.warningColor).alpha(0.2).toString();
343
342
  this.isPreview = this.$configProject.isPreview;
344
- this.isQrCode = isQrCode(this);
345
343
 
346
344
  //#ifdef H5
345
+ this.isWx = this.isPreview || isWechat();
346
+
347
347
  if (!this.$configProject.isPreview) {
348
348
  jfbRootExec("getH5WxAuthorize", {
349
349
  vm: this,
@@ -21,7 +21,6 @@
21
21
  <view
22
22
  class="scan_icon"
23
23
  @click="doScanCode"
24
- v-if="isQrCode"
25
24
  >
26
25
  <xd-font-icon icon="iconsaoma1"></xd-font-icon>
27
26
  </view>
@@ -59,7 +58,7 @@
59
58
  import XdButton from "@/components/XdButton/XdButton"
60
59
  import { jfbRootExec } from "@/utils/xd.event";
61
60
  import JfbBaseCardBindV2Mixin from "./JfbBaseCardBindV2Mixin";
62
- import { getContainerPropsValue,isQrCode } from "@/utils/xd.base";
61
+ import { getContainerPropsValue } from "@/utils/xd.base";
63
62
  import componentsMixins from "@/mixins/componentsMixins";
64
63
  import extsMixins from "@/mixins/extsMixins";
65
64
  import { mapState } from "vuex"
@@ -92,7 +91,6 @@
92
91
  validImageAPIUrl: "",
93
92
  backUrl: "",
94
93
  inCallbackUrlOrg:'',//是否带有回调地址
95
- isQrCode: false,
96
94
  }
97
95
  },
98
96
  watch: {
@@ -101,7 +99,6 @@
101
99
  }
102
100
  },
103
101
  created() {
104
- this.isQrCode = isQrCode(this)
105
102
  this.init(this.container);
106
103
  this.validImageAPIUrl = this.brandInfo['api_host'] + '/common/v1/valid_code/image/show'
107
104
 
@@ -179,6 +176,7 @@
179
176
  success: res => {
180
177
  let result = res.resultStr;
181
178
  this.cardForm.card_qrcode = result;
179
+
182
180
  jfbRootExec("qrCardBind", {
183
181
  vm: this,
184
182
  data: {
@@ -18,7 +18,7 @@
18
18
  <!-- #endif -->
19
19
  <view class="jfb-base-card-entry__body">
20
20
  <view class="jfb-base-card-entry__body-cut">
21
- <template v-if="isQrCode">
21
+ <template v-if="isWx">
22
22
  <view
23
23
  class="jfb-base-card-entry__body-cut-item"
24
24
  @click="handleScan"
@@ -383,7 +383,7 @@ import extsMixins from "@/mixins/extsMixins";
383
383
  import colorCardMixins from "@/mixins/colorCardMixins";
384
384
  import cardListMixins from "@/mixins/cardListMixins";
385
385
  import { mapState, mapActions } from "vuex";
386
- import { getContainerPropsValue, isWechat,isQrCode } from "@/utils/xd.base";
386
+ import { getContainerPropsValue, isWechat } from "@/utils/xd.base";
387
387
  import XdNoticeBar from "@/components/XdNoticeBar/XdNoticeBar";
388
388
  import { Base64 } from "js-base64";
389
389
  const Color = require("color");
@@ -434,6 +434,7 @@ export default {
434
434
  noticeStatus: false,
435
435
  loadingCardList: true,
436
436
 
437
+ isWx: true,
437
438
  cutIndex: 1,
438
439
  tabIndex: 1,
439
440
  isBack: null, //是否使用返回键
@@ -453,7 +454,6 @@ export default {
453
454
  showDisabled: 'Y',
454
455
  showCardList: false,
455
456
  showIndex:false,
456
- isQrCode: false,
457
457
 
458
458
  //活动
459
459
  dialogEvent: false,
@@ -466,7 +466,7 @@ export default {
466
466
  this.isPreview = this.$configProject.isPreview;
467
467
 
468
468
  //#ifdef H5
469
- this.isQrCode = isQrCode(this);
469
+ this.isWx = this.isPreview || isWechat();
470
470
  if (!this.$configProject.isPreview) {
471
471
  jfbRootExec("getH5WxAuthorize", {
472
472
  vm: this,
@@ -23,18 +23,6 @@ module.exports = [
23
23
  phone_number_collect_url: ['收集手机号地址', 'String', '是'],
24
24
  }
25
25
  },
26
- {
27
- mapFnName: 'userBaseLoginIcb',
28
- title: '工行e生活登录',
29
- path: '/passport/v1/user/login-icbc',
30
- isRule: false,
31
- data: {
32
- encrypted_params: ['用户登录信息', 'String', '必选'],
33
- provider_id: ['登录方式id', 'Number', '必选'],
34
- },
35
- isConsole: true,
36
- disabled: true,
37
- },
38
26
  {
39
27
  mapFnName: 'phoneLogin',
40
28
  title: "手机号登录",
@@ -30,7 +30,8 @@
30
30
  type="primary"
31
31
  radius="20rpx"
32
32
  @click="doLoginAuth"
33
- >{{h5FastLoginName}}</xd-button>
33
+ >快捷登录</xd-button
34
+ >
34
35
  <!-- #endif -->
35
36
  <!--#ifdef MP-->
36
37
  <xd-button
@@ -49,7 +50,8 @@
49
50
  type="primary"
50
51
  radius="20rpx"
51
52
  @click="doLoginAccount"
52
- >账号登录</xd-button>
53
+ >账号登录
54
+ </xd-button>
53
55
  </view>
54
56
 
55
57
  <view class="protocol">
@@ -215,9 +217,7 @@ import {
215
217
  getAllPath,
216
218
  getDomainAllPath,
217
219
  getLocalJumpOutSiteCallbackUrl,
218
- isThirdLogin
219
220
  } from "@/utils/xd.base";
220
- import icb from "@/common/ICB.SDK";
221
221
 
222
222
  export default {
223
223
  name: "JfbBaseLogin",
@@ -236,7 +236,6 @@ export default {
236
236
  //体验模式
237
237
  dialogPreview: false,
238
238
  previewAccout: '',
239
- h5FastLoginName:'快捷登录',
240
239
 
241
240
  showStep: 1,
242
241
  panel_1_checked: "",
@@ -287,7 +286,7 @@ export default {
287
286
  };
288
287
  },
289
288
  computed: {
290
- ...mapState(["jfbAuthorize","siteInfo",'loginParams']),
289
+ ...mapState(["jfbAuthorize","siteInfo"]),
291
290
  panelIsChecked() {
292
291
  return this.panel_1_checked.includes(1);
293
292
  },
@@ -317,7 +316,7 @@ export default {
317
316
  this.init(this.container);
318
317
  this.base = this.jfbAuthorize.getBasePath(this);
319
318
  this.site_logo = getServiceUrl(this.projectAttr["site_logo"]);
320
- this.$xdLog.setProject('JfbBaseLogin', 'JfbBaseLogin.create.done');
319
+ this.$xdLog.setProject('JfbBaseLogin', 'JfbBaseLogin.create.done')
321
320
  },
322
321
 
323
322
  methods: {
@@ -363,20 +362,35 @@ export default {
363
362
 
364
363
 
365
364
  onJfbLoad(options) {
366
- this.$xdLog.setProject('JfbBaseLogin', 'JfbBaseLogin.onJfbLoad.start')
367
365
  this.redirect_url = options.redirect_url ? Base64.decode(options.redirect_url): '';
368
366
  this.isDebugPreview = options['x-test'] === 'jfb-tiyan';
369
367
  // #ifdef MP-WEIXIN
370
368
  this.authWxMpListProviders();
371
369
  // #endif
372
-
370
+ this.$xdLog.setProject('JfbBaseLogin', 'JfbBaseLogin.onJfbLoad.start')
373
371
  // #ifdef H5
374
- try{ this.authH5ListProviders();}
375
- catch (error) {
372
+ try{
373
+ this.authH5ListProviders();
374
+ }catch (error) {
376
375
  this.$xdLog.setProject('JfbBaseLogin', 'JfbBaseLogin.onJfbLoad.error');
377
376
  this.$xdLog.setARMSError(error);
378
377
  }
379
378
  //#endif
379
+
380
+ // if (options.isDebug === "1") {
381
+ // getAllPath(this, "main/play/index");
382
+ // getDomainAllPath(this, "main/play/index");
383
+ // getLocalJumpOutSiteCallbackUrl(
384
+ // this,
385
+ // { customParams: 1 },
386
+ // false,
387
+ // "main/play/index"
388
+ // );
389
+ //
390
+ // getAllPath(this);
391
+ // getDomainAllPath(this);
392
+ // getLocalJumpOutSiteCallbackUrl(this, { customParams: 1 }, false);
393
+ // }
380
394
  },
381
395
 
382
396
  /**
@@ -411,11 +425,6 @@ export default {
411
425
  if (res.quick_enabled) {
412
426
  this.hasAuthLogin = true;
413
427
  this.quickLogin = res.quick;
414
-
415
- //工行处理
416
- if(this.quickLogin.login_platform_code === 'icbc') {
417
- this.h5FastLoginName = '工银e生活登录'
418
- }
419
428
  }
420
429
  if (res.others.length > 0) {
421
430
  this.hasAccountLogin = true;
@@ -476,7 +485,8 @@ export default {
476
485
  //需要授权操作
477
486
  if (res.auth_code) {
478
487
  let { redirect_url, callback_url } = this;
479
- if (redirect_url) redirect_url = redirect_url;
488
+ if (redirect_url)
489
+ redirect_url = redirect_url;
480
490
  let url = Base64.encodeURI(
481
491
  redirect_url || callback_url || this.settings.index
482
492
  );
@@ -540,12 +550,12 @@ export default {
540
550
  };
541
551
 
542
552
  this.$xdLog.setProject('JfbBaseLogin', 'JfbBaseLogin.onJfbLoad.loading..');
553
+
543
554
  jfbRootExec("listSiteProvider", {
544
555
  vm: this,
545
556
  data: params,
546
557
  })
547
558
  .then((res) => {
548
- console.log('listSiteProvider',res)
549
559
  this.handleAuthResult(res);
550
560
  })
551
561
  .catch((error) => {
@@ -593,59 +603,12 @@ export default {
593
603
  setAccountLoginType(type) {
594
604
  this.accountLoginType = type;
595
605
  },
596
-
597
- /**
598
- * @description 工行e生活处理
599
- */
600
- icbcLogin(){
601
- //无三方用户登录信息
602
- if(!this.loginParams) {
603
- this.status = false;
604
- console.warn(`无三方用户登录信息`);
605
- throw new Error('无三方用户登录信息');
606
- }
607
-
608
- console.warn(`LoginParams.use: ${this.loginParams}`)
609
- this.$xdShowLoading({});
610
- jfbRootExec("userBaseLoginIcb", {
611
- vm: this,
612
- data:{
613
- encrypted_params: this.loginParams,
614
- provider_id: this.quickLogin.provider_id
615
- },
616
- })
617
- .then(res=>{
618
- this.$xdHideLoading();
619
- this.$xdUniHelper.redirectTo({
620
- url: this.redirect_url || this.$settings.index,
621
- },false, true);
622
- })
623
- .catch(err=>{
624
- this.$xdHideLoading();
625
- console.error(err);
626
- })
627
- },
628
-
629
606
  //h5授权登录
630
607
  doLoginAuth() {
631
608
  if(this.isFastLoginStatus) return;
632
609
  this.isFastLoginStatus = true;
633
-
634
- //工行处理
635
- if(this.quickLogin && this.quickLogin.login_platform_code === 'icbc'){
636
- window['ICBC_SDK']['merLogin']((res)=>{
637
- console.log('ICBC_SDK',res);
638
- this.icbcLogin(res)
639
- })
640
- return;
641
- }
642
-
643
- //跳转到第三方进行授权
644
- if(this.quickLogin.is_redirect === 'Y') {
645
- const { redirect_url } = this.quickLogin;
646
- location.href = redirect_url;
647
- }
648
-
610
+ const { provider_id, login_platform_code, is_redirect, redirect_url } = this.quickLogin;
611
+ location.href = redirect_url;
649
612
  },
650
613
 
651
614
  //小程序授权登录
@@ -744,7 +707,6 @@ export default {
744
707
  });
745
708
  }
746
709
  },
747
-
748
710
  toHomeAfterLogin() {
749
711
  let { redirect_url, callback_url } = this;
750
712
  if (redirect_url) redirect_url = redirect_url;
@@ -1,78 +0,0 @@
1
- 'use strict';
2
-
3
- const ICB_SDK = require('@/common/paysdk/ICB.SDK');
4
-
5
- class ICB {
6
- constructor() {
7
- this.ICB_APP = ICB_SDK;
8
- this.fail(false)
9
- }
10
-
11
- /**
12
- * @description 获取版本号
13
- * @return {*}
14
- */
15
- version(){
16
- return this.ICB_APP.elifeVer()
17
- }
18
-
19
- fail(notExc=true){
20
- // if(typeof window.WebViewJavascriptBridge === "undefined"){
21
- // console.warn('初始化工商银行e生活SDK失败');
22
- // if(notExc) throw new Error('初始化工商银行e生活SDK失败');
23
- // }
24
- }
25
-
26
- /**
27
- * @description 获取用户登录方式
28
- * @param callback {Function} 成功回调函数
29
- */
30
- login(callback){
31
- this.fail();
32
-
33
- this.ICB_APP.merLogin(callback)
34
- }
35
-
36
- /**
37
- * @description 第三方显示或隐藏tabBar
38
- * @param show 默认值:true
39
- */
40
- showBar(show = true){
41
- this.fail();
42
- this.ICB_APP.showToolBar(show);
43
- }
44
-
45
- /**
46
- * @description 第三方返回APP
47
- */
48
- back(){
49
- this.fail();
50
- this.ICB_APP.back();
51
- }
52
-
53
- /**
54
- * @description 拨打电话
55
- * @param tel 电话号码
56
- */
57
- callPhone(tel){
58
- if(!tel){
59
- console.warn(`拨打电话号码不能为空,电话号码:${tel}`);
60
- throw new Error('拨打电话号码不能为空');
61
- }
62
- this.fail();
63
- this.ICB_APP.callPhoneNumber(tel);
64
- }
65
-
66
- /**
67
- * @description 是否隐藏第三方的头
68
- * @param show
69
- */
70
- showThirdNavigation(show = true){
71
- this.fail();
72
- if(show) this.ICB_APP.showThirdWebviewNavigation()
73
- else this.ICB_APP.hideThirdWebviewNavigation()
74
- }
75
-
76
- }
77
-
78
- module.exports = new ICB();