jufubao-base 1.0.119-beta3 → 1.0.119-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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.119-beta3",
3
+ "version": "1.0.119-beta5",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -12,7 +12,7 @@ export default {
12
12
  ele: 'xd-select-pages-path', //package 名称
13
13
  valueKey: 'useTicketUrl', //form[valueKey]
14
14
  placeholder: '请选择使用祝福券跳转地址',
15
- value: null,
15
+ value: data.useTicketUrl || null,
16
16
  setting: {
17
17
  router: XdBus.getParentApi('getPagesTree'),
18
18
  },
@@ -12,7 +12,7 @@ export default {
12
12
  ele: 'xd-select-pages-path', //package 名称
13
13
  valueKey: 'blessSignUrl', //form[valueKey]
14
14
  placeholder: '请选择祝福详情跳转地址',
15
- value: null,
15
+ value: data.blessSignUrl || null,
16
16
  setting: {
17
17
  router: XdBus.getParentApi('getPagesTree'),
18
18
  },
@@ -12,7 +12,7 @@ export default {
12
12
  ele: 'xd-select-pages-path', //package 名称
13
13
  valueKey: 'newsListUrl', //form[valueKey]
14
14
  placeholder: '请选择新闻列表地址',
15
- value: null,
15
+ value: data.newsListUrl ||null,
16
16
  setting: {
17
17
  router: XdBus.getParentApi('getPagesTree'),
18
18
  },
@@ -23,7 +23,7 @@ export default {
23
23
  ele: 'xd-select-pages-path', //package 名称
24
24
  valueKey: 'newsDetailUrl', //form[valueKey]
25
25
  placeholder: '请选择新闻详情地址',
26
- value: null,
26
+ value: data.newsDetailUrl || null,
27
27
  setting: {
28
28
  router: XdBus.getParentApi('getPagesTree'),
29
29
  },
@@ -327,23 +327,38 @@
327
327
  // if (!this.phoneLogin) this.accountLoginType = "pwd";
328
328
  }
329
329
  },
330
+ //快捷登录
331
+ doLoginAuth(){
332
+ console.log("快捷登录", this.quickLogin);
333
+ const { quickLogin } = this;
334
+ //登录平台name 聚福宝 钉钉 企业微信
335
+ if(quickLogin.login_platform_code === 'DD'){
336
+ this.p_loginDing();
337
+ }else if(quickLogin.login_platform_code === 'QW'){
338
+ this.p_loginWxEnter();
339
+ }
340
+ },
330
341
  //企业微信登录
331
342
  p_loginWxEnter(){
332
- let params = this.getReqParams();
333
- params['code'] = ""; //企业微信code
334
- jfbRootExec("loginWxEnter", {
335
- vm: this,
336
- data: params
337
- }).then(res => {
338
-
339
- })
343
+ const { quickLogin } = this;
344
+ location.href = quickLogin.redirect_url;
345
+ // let params = this.getReqParams();
346
+ // params['code'] = ""; //企业微信code
347
+ // jfbRootExec("loginWxEnter", {
348
+ // vm: this,
349
+ // data: params
350
+ // }).then(res => {
351
+ // location.href = res.redirect_url;
352
+ // })
340
353
  },
341
-
342
354
  //获取钉钉免登码
343
355
  p_loginDing(){
356
+ const { quickLogin } = this;
357
+
344
358
  dd.getAuthCode({
345
- corpId: 'ding12345xxx',
359
+ corpId: quickLogin.corp_id,
346
360
  success: (res) => {
361
+ console.log("钉钉授权成功", res);
347
362
  const { authCode } = res;
348
363
  jfbRootExec("loginDing", {
349
364
  vm: this,
@@ -359,12 +374,17 @@
359
374
  url: `${phone_auth_callback_url}?access_code=${access_code}&phone_number=${phone_number}`
360
375
  });
361
376
  }else{
362
- this.toHomeAfterLogin();
377
+ //passport登录
378
+ this.p_passportSaasLogin({access_code})
363
379
  }
364
380
  })
365
381
  },
366
- fail: () => {},
367
- complete: () => {},
382
+ fail: () => {
383
+ console.error("钉钉授权失败")
384
+ },
385
+ complete: () => {
386
+ console.info("钉钉授权完成")
387
+ },
368
388
  })
369
389
  },
370
390
  //账号登录
@@ -410,14 +430,13 @@
410
430
  });
411
431
  },
412
432
  //选择企业后,需要passport登录
413
- p_passportSaasLogin(item){
433
+ p_passportSaasLogin({access_code}){
414
434
  let redirect_url = this.handleRedirectUrl();
415
435
  const { phone_number, password, verification_code } = this.accountForm;
416
436
  jfbRootExec("passportSaasLogin", {
417
437
  vm: this,
418
438
  data: {
419
- access_token: item.access_code,
420
- redirect_url,
439
+ access_token: access_code,
421
440
  phone_number,
422
441
  valid_code: verification_code,
423
442
  biz_name: this.biz_name
@@ -12,7 +12,7 @@ export default {
12
12
  ele: 'xd-select-pages-path', //package 名称
13
13
  valueKey: 'newsDetailUrl', //form[valueKey]
14
14
  placeholder: '请选择新闻详情地址',
15
- value: null,
15
+ value: data.newsDetailUrl || null,
16
16
  setting: {
17
17
  router: XdBus.getParentApi('getPagesTree'),
18
18
  },
@@ -23,6 +23,21 @@ module.exports = [
23
23
  isConsole: true,
24
24
  disabled: true,
25
25
  },
26
+ {
27
+ mapFnName: "passportSaasLogin",
28
+ title: "saas用户登录",
29
+ path: "/passport-pb/v1/user/login-saas",
30
+ isRule: false,
31
+ params: {
32
+ access_token: ['access_token', 'String', true],
33
+ redirect_url: ['跳转地址', 'String', true],
34
+ phone_number: ['手机号', 'String', true],
35
+ valid_code: ['手机验证码', 'String', true],
36
+ biz_name: ['验证码校验参数', 'String', true]
37
+ },
38
+ isConsole: true,
39
+ disabled: true,
40
+ },
26
41
  {
27
42
  mapFnName: 'phoneCollect',
28
43
  title: "收集手机号",
@@ -25,6 +25,7 @@
25
25
  <xd-form-item label="手机号" content-align="left">
26
26
  <xd-form-input
27
27
  v-model="accountForm.phone_number"
28
+ disabled
28
29
  placeholder="请输入11位手机号"
29
30
  />
30
31
  </xd-form-item>
@@ -43,7 +44,7 @@
43
44
  </view>
44
45
  </xd-form-item>
45
46
  </xd-form>
46
- <view class="form-group" style="padding-bottom: 0">
47
+ <!-- <view class="form-group" style="padding-bottom: 0">
47
48
  <xd-form-checkbox
48
49
  class="xd-form-checkbox"
49
50
  v-model="panel_1_checked"
@@ -59,8 +60,8 @@
59
60
  </view>
60
61
  </template>
61
62
  </xd-form-checkbox>
62
- </view>
63
- <view class="form-group">
63
+ </view> -->
64
+ <!-- <view class="form-group">
64
65
  <xd-button
65
66
  style="flex: 1"
66
67
  type="primary"
@@ -69,11 +70,20 @@
69
70
  @click="doLoginForm"
70
71
  >登录</xd-button
71
72
  >
73
+ </view> -->
74
+ <view class="form-group">
75
+ <xd-button
76
+ style="flex: 1"
77
+ type="primary"
78
+ radius="10rpx"
79
+ @click="doLoginForm"
80
+ >确定</xd-button
81
+ >
72
82
  </view>
73
- <view
83
+ <!-- <view
74
84
  class="jump_collect"
75
85
  @click="jumpCollect"
76
- >跳过</view>
86
+ >跳过</view> -->
77
87
  </view>
78
88
  </view>
79
89
  </view>
@@ -111,6 +121,8 @@
111
121
  phone_number: "",
112
122
  verification_code: "",
113
123
  },
124
+ access_code: "",
125
+ phone_number: "",
114
126
  jfbTimeer: 0,
115
127
  interval: null,
116
128
  provider_id: "",
@@ -146,6 +158,9 @@
146
158
  onJfbLoad(options) {
147
159
  this.provider_id = options.provider_id;
148
160
  this.callback_url = options.callback_url;
161
+ this.access_code = options.access_code;
162
+ this.phone_number = options.phone_number;
163
+ this.$set(this.accountForm, 'phone_number', options.phone_number);
149
164
  },
150
165
  /**
151
166
  * @description 监听事件变化
@@ -205,17 +220,16 @@
205
220
  });
206
221
  },
207
222
  doLoginForm() {
208
- const { provider_id } = this;
209
223
  const { phone_number, verification_code } = this.accountForm;
210
224
  if (!phone_number || !verification_code) return uni.showToast({ title: "手机号跟验证码不能为空", icon: "none" });
211
225
 
212
226
  this.$xdShowLoading({})
213
- jfbRootExec("phoneCollect", {
227
+ jfbRootExec("phoneAuth", {
214
228
  vm: this,
215
229
  data: {
216
- provider_id,
217
230
  phone_number,
218
- verification_code,
231
+ valid_code: verification_code,
232
+ access_code: this.access_code
219
233
  },
220
234
  }).then((res) => {
221
235
  this.$xdHideLoading()
@@ -260,7 +274,76 @@
260
274
 
261
275
  .jfb-base-sass-phone-collect {
262
276
  &__body{
277
+ .xd-form-checkbox {
278
+ /deep/ .checklist-content .checklist-text {
279
+ font-size: 26rpx !important;
280
+ }
281
+ }
263
282
 
283
+ .xd-form-checkbox {
284
+ /deep/ .checklist-box {
285
+ margin: 0 !important;
286
+ }
287
+ }
288
+ .xd-form-checkbox {
289
+ /deep/ .checklist-group {
290
+ justify-content: center;
291
+ }
292
+ }
293
+
294
+ .xd-form-checkbox {
295
+ /deep/ .checklist-text {
296
+ margin-left: unit(20,rpx) !important;
297
+ }
298
+ }
299
+
300
+ .form-group {
301
+ padding: 40rpx 70rpx;
302
+ }
303
+
304
+ .get_code {
305
+ color: @xd-base-color;
306
+ font-size: 24rpx;
307
+ }
308
+ .panel-login-password {
309
+ /deep/ .uni-forms-item__label {
310
+ .label-text {
311
+ font-size: 26rpx;
312
+ color: #a6a6a6;
313
+ }
314
+ }
315
+
316
+ /deep/ .uni-easyinput__placeholder-class {
317
+ font-size: 26rpx;
318
+ color: #d4d4d4;
319
+ }
320
+
321
+ .not_login {
322
+ position: fixed;
323
+ width: 100%;
324
+ text-align: center;
325
+ bottom: 100rpx;
326
+ font-size: 24rpx;
327
+ color: #fe7a63;
328
+ }
329
+ .jump_collect{
330
+ font-size: 24rpx;
331
+ color: #a6a6a6;
332
+ text-align: right;
333
+ margin: 20rpx 70rpx 0 0;
334
+ }
335
+ }
264
336
  }
265
337
  }
338
+ .flex {
339
+ display: flex;
340
+ }
341
+
342
+ .flex-sub {
343
+ flex: 1;
344
+ }
345
+
346
+ .align-center {
347
+ align-items: center;
348
+ }
266
349
  </style>