jufubao-base 1.0.145-beta2 → 1.0.145-beta4
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 +1 -1
- package/src/common/ICB.SDK.js +78 -0
- package/src/components/JfbBaseCard/JfbBaseCard.vue +5 -5
- package/src/components/JfbBaseCardBindV2/JfbBaseCardBindV2.vue +4 -2
- package/src/components/JfbBaseCardEntry/JfbBaseCardEntry.vue +4 -4
- package/src/components/JfbBaseLogin/Api.js +12 -0
- package/src/components/JfbBaseLogin/JfbBaseLogin.vue +68 -30
package/package.json
CHANGED
|
@@ -0,0 +1,78 @@
|
|
|
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();
|
|
@@ -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="
|
|
21
|
+
<template v-if="isQrCode">
|
|
22
22
|
<view
|
|
23
23
|
class="jfb-base-card__body-cut-item"
|
|
24
24
|
@click="handleScan"
|
|
@@ -226,10 +226,11 @@ 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 } from "@/utils/xd.base";
|
|
229
|
+
import { getContainerPropsValue, isWechat,isQrCode } 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
|
+
|
|
233
234
|
export default {
|
|
234
235
|
name: "JfbBaseCard",
|
|
235
236
|
components: {
|
|
@@ -293,7 +294,7 @@ export default {
|
|
|
293
294
|
isPreview: false,
|
|
294
295
|
noticeStatus: false,
|
|
295
296
|
|
|
296
|
-
|
|
297
|
+
isQrCode: true,
|
|
297
298
|
cutIndex: 1,
|
|
298
299
|
tabIndex: 1,
|
|
299
300
|
offsetIndex:0,//第几页
|
|
@@ -340,10 +341,9 @@ export default {
|
|
|
340
341
|
this.init(this.container);
|
|
341
342
|
this.noticeBackgroundColor = Color(this.warningColor).alpha(0.2).toString();
|
|
342
343
|
this.isPreview = this.$configProject.isPreview;
|
|
344
|
+
this.isQrCode = isQrCode(this);
|
|
343
345
|
|
|
344
346
|
//#ifdef H5
|
|
345
|
-
this.isWx = this.isPreview || isWechat();
|
|
346
|
-
|
|
347
347
|
if (!this.$configProject.isPreview) {
|
|
348
348
|
jfbRootExec("getH5WxAuthorize", {
|
|
349
349
|
vm: this,
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
<view
|
|
22
22
|
class="scan_icon"
|
|
23
23
|
@click="doScanCode"
|
|
24
|
+
v-if="isQrCode"
|
|
24
25
|
>
|
|
25
26
|
<xd-font-icon icon="iconsaoma1"></xd-font-icon>
|
|
26
27
|
</view>
|
|
@@ -58,7 +59,7 @@
|
|
|
58
59
|
import XdButton from "@/components/XdButton/XdButton"
|
|
59
60
|
import { jfbRootExec } from "@/utils/xd.event";
|
|
60
61
|
import JfbBaseCardBindV2Mixin from "./JfbBaseCardBindV2Mixin";
|
|
61
|
-
import { getContainerPropsValue } from "@/utils/xd.base";
|
|
62
|
+
import { getContainerPropsValue,isQrCode } from "@/utils/xd.base";
|
|
62
63
|
import componentsMixins from "@/mixins/componentsMixins";
|
|
63
64
|
import extsMixins from "@/mixins/extsMixins";
|
|
64
65
|
import { mapState } from "vuex"
|
|
@@ -91,6 +92,7 @@
|
|
|
91
92
|
validImageAPIUrl: "",
|
|
92
93
|
backUrl: "",
|
|
93
94
|
inCallbackUrlOrg:'',//是否带有回调地址
|
|
95
|
+
isQrCode: false,
|
|
94
96
|
}
|
|
95
97
|
},
|
|
96
98
|
watch: {
|
|
@@ -99,6 +101,7 @@
|
|
|
99
101
|
}
|
|
100
102
|
},
|
|
101
103
|
created() {
|
|
104
|
+
this.isQrCode = isQrCode(this)
|
|
102
105
|
this.init(this.container);
|
|
103
106
|
this.validImageAPIUrl = this.brandInfo['api_host'] + '/common/v1/valid_code/image/show'
|
|
104
107
|
|
|
@@ -176,7 +179,6 @@
|
|
|
176
179
|
success: res => {
|
|
177
180
|
let result = res.resultStr;
|
|
178
181
|
this.cardForm.card_qrcode = result;
|
|
179
|
-
|
|
180
182
|
jfbRootExec("qrCardBind", {
|
|
181
183
|
vm: this,
|
|
182
184
|
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="
|
|
21
|
+
<template v-if="isQrCode">
|
|
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 } from "@/utils/xd.base";
|
|
386
|
+
import { getContainerPropsValue, isWechat,isQrCode } 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,7 +434,6 @@ export default {
|
|
|
434
434
|
noticeStatus: false,
|
|
435
435
|
loadingCardList: true,
|
|
436
436
|
|
|
437
|
-
isWx: true,
|
|
438
437
|
cutIndex: 1,
|
|
439
438
|
tabIndex: 1,
|
|
440
439
|
isBack: null, //是否使用返回键
|
|
@@ -454,6 +453,7 @@ export default {
|
|
|
454
453
|
showDisabled: 'Y',
|
|
455
454
|
showCardList: false,
|
|
456
455
|
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.
|
|
469
|
+
this.isQrCode = isQrCode(this);
|
|
470
470
|
if (!this.$configProject.isPreview) {
|
|
471
471
|
jfbRootExec("getH5WxAuthorize", {
|
|
472
472
|
vm: this,
|
|
@@ -23,6 +23,18 @@ 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
|
+
},
|
|
26
38
|
{
|
|
27
39
|
mapFnName: 'phoneLogin',
|
|
28
40
|
title: "手机号登录",
|
|
@@ -30,8 +30,7 @@
|
|
|
30
30
|
type="primary"
|
|
31
31
|
radius="20rpx"
|
|
32
32
|
@click="doLoginAuth"
|
|
33
|
-
|
|
34
|
-
>
|
|
33
|
+
>{{h5FastLoginName}}</xd-button>
|
|
35
34
|
<!-- #endif -->
|
|
36
35
|
<!--#ifdef MP-->
|
|
37
36
|
<xd-button
|
|
@@ -50,8 +49,7 @@
|
|
|
50
49
|
type="primary"
|
|
51
50
|
radius="20rpx"
|
|
52
51
|
@click="doLoginAccount"
|
|
53
|
-
|
|
54
|
-
</xd-button>
|
|
52
|
+
>账号登录</xd-button>
|
|
55
53
|
</view>
|
|
56
54
|
|
|
57
55
|
<view class="protocol">
|
|
@@ -217,7 +215,9 @@ import {
|
|
|
217
215
|
getAllPath,
|
|
218
216
|
getDomainAllPath,
|
|
219
217
|
getLocalJumpOutSiteCallbackUrl,
|
|
218
|
+
isThirdLogin
|
|
220
219
|
} from "@/utils/xd.base";
|
|
220
|
+
import icb from "@/common/ICB.SDK";
|
|
221
221
|
|
|
222
222
|
export default {
|
|
223
223
|
name: "JfbBaseLogin",
|
|
@@ -236,6 +236,7 @@ export default {
|
|
|
236
236
|
//体验模式
|
|
237
237
|
dialogPreview: false,
|
|
238
238
|
previewAccout: '',
|
|
239
|
+
h5FastLoginName:'快捷登录',
|
|
239
240
|
|
|
240
241
|
showStep: 1,
|
|
241
242
|
panel_1_checked: "",
|
|
@@ -286,7 +287,7 @@ export default {
|
|
|
286
287
|
};
|
|
287
288
|
},
|
|
288
289
|
computed: {
|
|
289
|
-
...mapState(["jfbAuthorize","siteInfo"]),
|
|
290
|
+
...mapState(["jfbAuthorize","siteInfo",'loginParams']),
|
|
290
291
|
panelIsChecked() {
|
|
291
292
|
return this.panel_1_checked.includes(1);
|
|
292
293
|
},
|
|
@@ -316,7 +317,7 @@ export default {
|
|
|
316
317
|
this.init(this.container);
|
|
317
318
|
this.base = this.jfbAuthorize.getBasePath(this);
|
|
318
319
|
this.site_logo = getServiceUrl(this.projectAttr["site_logo"]);
|
|
319
|
-
this.$xdLog.setProject('JfbBaseLogin', 'JfbBaseLogin.create.done')
|
|
320
|
+
this.$xdLog.setProject('JfbBaseLogin', 'JfbBaseLogin.create.done');
|
|
320
321
|
},
|
|
321
322
|
|
|
322
323
|
methods: {
|
|
@@ -362,35 +363,20 @@ export default {
|
|
|
362
363
|
|
|
363
364
|
|
|
364
365
|
onJfbLoad(options) {
|
|
366
|
+
this.$xdLog.setProject('JfbBaseLogin', 'JfbBaseLogin.onJfbLoad.start')
|
|
365
367
|
this.redirect_url = options.redirect_url ? Base64.decode(options.redirect_url): '';
|
|
366
368
|
this.isDebugPreview = options['x-test'] === 'jfb-tiyan';
|
|
367
369
|
// #ifdef MP-WEIXIN
|
|
368
370
|
this.authWxMpListProviders();
|
|
369
371
|
// #endif
|
|
370
|
-
|
|
372
|
+
|
|
371
373
|
// #ifdef H5
|
|
372
|
-
try{
|
|
373
|
-
|
|
374
|
-
}catch (error) {
|
|
374
|
+
try{ this.authH5ListProviders();}
|
|
375
|
+
catch (error) {
|
|
375
376
|
this.$xdLog.setProject('JfbBaseLogin', 'JfbBaseLogin.onJfbLoad.error');
|
|
376
377
|
this.$xdLog.setARMSError(error);
|
|
377
378
|
}
|
|
378
379
|
//#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
|
-
// }
|
|
394
380
|
},
|
|
395
381
|
|
|
396
382
|
/**
|
|
@@ -425,6 +411,11 @@ export default {
|
|
|
425
411
|
if (res.quick_enabled) {
|
|
426
412
|
this.hasAuthLogin = true;
|
|
427
413
|
this.quickLogin = res.quick;
|
|
414
|
+
|
|
415
|
+
//工行处理
|
|
416
|
+
if(this.quickLogin.login_platform_code === 'icbc') {
|
|
417
|
+
this.h5FastLoginName = '工银e生活登录'
|
|
418
|
+
}
|
|
428
419
|
}
|
|
429
420
|
if (res.others.length > 0) {
|
|
430
421
|
this.hasAccountLogin = true;
|
|
@@ -485,8 +476,7 @@ export default {
|
|
|
485
476
|
//需要授权操作
|
|
486
477
|
if (res.auth_code) {
|
|
487
478
|
let { redirect_url, callback_url } = this;
|
|
488
|
-
if (redirect_url)
|
|
489
|
-
redirect_url = redirect_url;
|
|
479
|
+
if (redirect_url) redirect_url = redirect_url;
|
|
490
480
|
let url = Base64.encodeURI(
|
|
491
481
|
redirect_url || callback_url || this.settings.index
|
|
492
482
|
);
|
|
@@ -550,12 +540,12 @@ export default {
|
|
|
550
540
|
};
|
|
551
541
|
|
|
552
542
|
this.$xdLog.setProject('JfbBaseLogin', 'JfbBaseLogin.onJfbLoad.loading..');
|
|
553
|
-
|
|
554
543
|
jfbRootExec("listSiteProvider", {
|
|
555
544
|
vm: this,
|
|
556
545
|
data: params,
|
|
557
546
|
})
|
|
558
547
|
.then((res) => {
|
|
548
|
+
console.log('listSiteProvider',res)
|
|
559
549
|
this.handleAuthResult(res);
|
|
560
550
|
})
|
|
561
551
|
.catch((error) => {
|
|
@@ -603,12 +593,59 @@ export default {
|
|
|
603
593
|
setAccountLoginType(type) {
|
|
604
594
|
this.accountLoginType = type;
|
|
605
595
|
},
|
|
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
|
+
|
|
606
629
|
//h5授权登录
|
|
607
630
|
doLoginAuth() {
|
|
608
631
|
if(this.isFastLoginStatus) return;
|
|
609
632
|
this.isFastLoginStatus = true;
|
|
610
|
-
|
|
611
|
-
|
|
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
|
+
|
|
612
649
|
},
|
|
613
650
|
|
|
614
651
|
//小程序授权登录
|
|
@@ -707,6 +744,7 @@ export default {
|
|
|
707
744
|
});
|
|
708
745
|
}
|
|
709
746
|
},
|
|
747
|
+
|
|
710
748
|
toHomeAfterLogin() {
|
|
711
749
|
let { redirect_url, callback_url } = this;
|
|
712
750
|
if (redirect_url) redirect_url = redirect_url;
|