jufubao-base 1.0.77-beta1 → 1.0.77-beta3

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.77-beta1",
3
+ "version": "1.0.77-beta3",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -4,6 +4,32 @@ export default {
4
4
  style: [],
5
5
  advanced: [],
6
6
  content: [
7
+ {
8
+ label: 'LOGO文字颜色:',
9
+ ele: 'xd-color',
10
+ valueKey: 'logoTextColor',
11
+ value: '',
12
+ placeholder: '请输入LOGO文字颜色',
13
+ classNmae: 'input80',
14
+ },
15
+ {
16
+ label: '是否使用体验码功能:',
17
+ ele: 'xd-radio',
18
+ valueKey: 'isPreview',
19
+ value: 'N',
20
+ placeholder: '请选择是否使用体验码功能',
21
+ multiple: false,
22
+ className: 'input80',
23
+ list: [
24
+ {label: '是', value: 'Y'},
25
+ {label: '否', value: 'N'},
26
+ ]
27
+ },
28
+ {
29
+ ele: 'title',
30
+ label: '页面连接设置',
31
+ size: 'small',
32
+ },
7
33
  {
8
34
  label: '快速授权失败访问地址:', //label
9
35
  ele: 'xd-select-pages-path', //package 名称
@@ -60,12 +86,9 @@ export default {
60
86
  inline: false,
61
87
  },
62
88
  {
63
- label: 'logo文字颜色:',
64
- ele: 'xd-color',
65
- valueKey: 'logoTextColor',
66
- value: '',
67
- placeholder: '请输入logo文字颜色',
68
- classNmae: 'input80',
89
+ ele: 'title',
90
+ label: '服务设置',
91
+ size: 'small',
69
92
  },
70
93
  {
71
94
  label: '隐私政策:',
@@ -170,6 +170,24 @@
170
170
  >忘记密码</view
171
171
  >
172
172
  </view>
173
+ <view class="bottom_btn" :style="prod_bottom" v-if="isPreview === 'Y'">
174
+ <view @click="dialogPreview = true" :style="{
175
+ color: mainColor,
176
+ border: `1px solid ${mainColor}`
177
+ }">进入体验 ></view>
178
+ </view>
179
+ <xd-dailog
180
+ v-if="dialogPreview"
181
+ title="体验码"
182
+ :show.sync="dialogPreview"
183
+ :cancel="false"
184
+ confirm-text="进入体验模式"
185
+ @onBtn="handlePreview"
186
+ >
187
+ <view class="preview-login">
188
+ <input v-model="previewAccout" type="text" class="preview-login-input" placeholder="请输入体验码">
189
+ </view>
190
+ </xd-dailog>
173
191
  </view>
174
192
  </view>
175
193
  </template>
@@ -187,6 +205,7 @@ import XdFormCheckbox from "@/components/XdFormCheckbox/XdFormCheckbox";
187
205
  import XdFormInput from "@/components/XdFormInput/XdFormInput";
188
206
  import XdForm from "@/components/XdForm/XdForm";
189
207
  import XdFormItem from "@/components/XdFormItem/XdFormItem";
208
+ import XdDailog from "@/components/XdDailog/XdDailog.vue";
190
209
  import { Base64 } from "js-base64";
191
210
  import { mapState } from "vuex";
192
211
  import getServiceUrl from "@/common/getServiceUrl";
@@ -208,15 +227,19 @@ export default {
208
227
  XdFormInput,
209
228
  XdForm,
210
229
  XdFormItem,
230
+ XdDailog
211
231
  },
212
232
  mixins: [componentsMixins, extsMixins, JfbBaseLoginMixin, privacyMixins],
213
233
  data() {
214
234
  return {
235
+ //体验模式
236
+ dialogPreview: false,
237
+ previewAccout: '',
238
+
215
239
  showStep: 1,
216
240
  panel_1_checked: "",
217
241
  panel_2_checked: "",
218
242
  password: "",
219
- //todo
220
243
  accountLoginType: "phone", //phone: 验证码登录 pwd: 密码登录
221
244
  accountForm: {
222
245
  phone_number: "", //15801505541
@@ -255,6 +278,7 @@ export default {
255
278
  logo: "",
256
279
  partnerName: "",
257
280
  logoTextColor: "",
281
+ isPreview:'N', //是否启用体验码模式
258
282
  };
259
283
  },
260
284
  computed: {
@@ -265,6 +289,9 @@ export default {
265
289
  panelTwoIsChecked() {
266
290
  return this.panel_2_checked.includes(1);
267
291
  },
292
+ prod_bottom() {
293
+ return this.fixedStyle({ height: 0, zIndex: 111 });
294
+ },
268
295
  },
269
296
  watch: {
270
297
  container(value) {
@@ -296,16 +323,46 @@ export default {
296
323
  url: `/pages/content/content?${params}`
297
324
  })
298
325
  },
299
-
300
-
326
+
327
+ loginPreview(experience_code){
328
+ return new Promise((resolve,reject)=>{
329
+ jfbRootExec("loginExperience", {
330
+ vm: this,
331
+ data: {experience_code},
332
+ }).then(res=>{
333
+ resolve(res)
334
+ }).catch(err=>{
335
+ reject(err)
336
+ })
337
+ })
338
+ },
339
+
340
+ async handlePreview(){
341
+ if(!this.previewAccout) {
342
+ this.$xdAlert({
343
+ content: '请输入体验码',
344
+ type:'error'
345
+ });
346
+ return;
347
+ }
348
+ this.$xdShowLoading({});
349
+ try{
350
+ const res = await this.loginPreview(this.previewAccout);
351
+ if(res) this.jfbAuthorize.setAllToken(res);
352
+ this.toHomeAfterLogin();
353
+ this.$xdHideLoading();
354
+ }catch (e){
355
+ this.$xdHideLoading();
356
+ }
357
+ },
358
+
359
+
301
360
  onJfbLoad(options) {
302
361
  this.redirect_url = options.redirect_url ? Base64.decode(options.redirect_url): '';
303
362
  // #ifdef MP-WEIXIN
304
363
  this.authWxMpListProviders();
305
364
  // #endif
306
-
307
365
  this.$xdLog.setProject('JfbBaseLogin', 'JfbBaseLogin.onJfbLoad.start')
308
-
309
366
  // #ifdef H5
310
367
  try{
311
368
  this.authH5ListProviders();
@@ -313,7 +370,6 @@ export default {
313
370
  this.$xdLog.setProject('JfbBaseLogin', 'JfbBaseLogin.onJfbLoad.error');
314
371
  this.$xdLog.setARMSError(error);
315
372
  }
316
-
317
373
  //#endif
318
374
 
319
375
  // if (options.isDebug === "1") {
@@ -354,7 +410,7 @@ export default {
354
410
  this.phone_number_collect_url = getContainerPropsValue(value, "content.phone_number_collect_url", {value: ''}).value;
355
411
  this.forget_pwd_url = getContainerPropsValue(value, "content.forget_pwd_url", {value: ''}).value;
356
412
  this.error_callback_url = getContainerPropsValue(value, "content.error_url", {value: ''}).value;
357
-
413
+ this.isPreview = getContainerPropsValue(value, "content.isPreview", 'N');
358
414
  },
359
415
 
360
416
  /**
@@ -464,22 +520,22 @@ export default {
464
520
  "62fde99f2583a19c58fd937b",
465
521
  "62fde9432583a19c58fd937a",
466
522
  ];
467
-
523
+
468
524
  let { redirect_url, callback_url } = this;
469
-
525
+
470
526
  //不同项目直接域名替换
471
527
  if (/^(@site_domain@).+$/.test(redirect_url)) {
472
528
  redirect_url = redirect_url.replace(/@site_domain@/, location.origin)
473
529
  }
474
-
530
+
475
531
  try {
476
532
  let redirectURL = new URL(redirect_url);
477
533
  redirect_url = redirectURL.href;
478
534
  } catch (e) {
479
535
  redirect_url = location.origin + this.base + redirect_url;
480
536
  }
481
-
482
-
537
+
538
+
483
539
  let params = {
484
540
  providers: providers.join(","),
485
541
  callback_url: redirect_url,
@@ -487,9 +543,9 @@ export default {
487
543
  phone_number_collect_url: location.origin + this.base + this.phone_number_collect_url,
488
544
  error_callback_url: location.origin + this.base + this.error_callback_url,
489
545
  };
490
-
546
+
491
547
  this.$xdLog.setProject('JfbBaseLogin', 'JfbBaseLogin.onJfbLoad.loading..');
492
-
548
+
493
549
  jfbRootExec("listSiteProvider", {
494
550
  vm: this,
495
551
  data: params,
@@ -701,7 +757,7 @@ export default {
701
757
  margin-left: unit(20,rpx) !important;
702
758
  }
703
759
  }
704
-
760
+
705
761
  .form-group {
706
762
  padding: 40rpx 70rpx;
707
763
  }
@@ -851,4 +907,45 @@ export default {
851
907
  .login-pub {
852
908
  margin-top: unit(40, rpx);
853
909
  }
910
+ .bottom_btn {
911
+ position: fixed;
912
+ width: 100%;
913
+ display:flex;
914
+ justify-content: center;
915
+ align-items: center;
916
+ height: unit(100, rpx);
917
+ background: #ffffff;
918
+
919
+ & > view {
920
+ height: unit(44, rpx);
921
+ line-height: unit(44, rpx);
922
+ width: unit(150, rpx);
923
+ text-align: center;
924
+ cursor: pointer;
925
+ font-size: unit(24, rpx);
926
+ border-radius: unit(12, rpx);
927
+ }
928
+ }
929
+
930
+ .preview-login {
931
+ padding: unit(40, rpx) 0;
932
+
933
+ &-input {
934
+ height: unit(70, rpx);
935
+ border-radius: unit(12, rpx);
936
+ padding: 0 unit(20, rpx);
937
+ text-align: left;
938
+ border: 1px solid #eee;
939
+ background: #F7F7F7;
940
+ color: #666;
941
+ transition: box-shadow 0.5s;
942
+ box-shadow: 0 0 0 rgba(0,0,0,0);
943
+
944
+ &:hover {
945
+ box-shadow: 0 0 unit(10, rpx) rgba(0,0,0,.1);
946
+ }
947
+ }
948
+ }
949
+
950
+
854
951
  </style>
@@ -116,7 +116,7 @@
116
116
  mixins: [componentsMixins,extsMixins,JfbBasePosterMixin],
117
117
  data() {
118
118
  return {
119
- selfMask: true,
119
+ selfMask: false,
120
120
  params: {},
121
121
 
122
122
  //Swiper 配置