jufubao-base 1.0.73-beta3 → 1.0.73

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.73-beta3",
3
+ "version": "1.0.73",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -29,7 +29,6 @@ class JfbAuthorize {
29
29
  'card': 'JFB-CARD-TOKEN-{siteID}',
30
30
  'refresh': 'JFB-REFRESH-TOKEN-{siteID}',
31
31
  'access': 'JFB-ACCESS-TOKEN',
32
- 'cardCode':'JFB-CARD-CODE-{siteID}'
33
32
  }, settings.token? settings.token: {});
34
33
  }
35
34
 
@@ -41,7 +40,6 @@ class JfbAuthorize {
41
40
  * @returns {string|*}
42
41
  */
43
42
  getTokenKeyword(key){
44
-
45
43
  if (!this.config[key]) key = 'user';
46
44
  if(key === 'access') return this.config.access;
47
45
  else{
@@ -85,8 +83,6 @@ class JfbAuthorize {
85
83
  */
86
84
  removeToken(key, options = {}) {
87
85
  key = this.getTokenKeyword(key);
88
- let codeKey = this.getTokenKeyword('cardCode');
89
- debugger
90
86
  //#ifdef H5
91
87
  cookie.remove(key, options);
92
88
  console.warn(`cookie.key=${key}`);
@@ -146,7 +142,7 @@ class JfbAuthorize {
146
142
  * @description 跳转到用户登陆页面
147
143
  * @param $vm {Vue}
148
144
  */
149
- jumpToUserLogin($vm,isRedirect) {
145
+ jumpToUserLogin($vm) {
150
146
  let redirect_url = '';
151
147
  if(store.state.configProject.platform === 'mp.weixin') {
152
148
  redirect_url = $vm['$xdUniHelper'].parseURL().source;
@@ -131,13 +131,4 @@ module.exports = [
131
131
  provider_id: ['登陆提供者id', 'String', '必选']
132
132
  }
133
133
  },
134
- {
135
- mapFnName: 'loginExperience',
136
- title: '体验码登录',
137
- path: '/passport-pb/v1/user/login-experience',
138
- isRule: false,
139
- params: {
140
- experience_code: ['体验码code', 'String', '必选'],
141
- }
142
- },
143
134
  ];
@@ -170,23 +170,6 @@
170
170
  >忘记密码</view
171
171
  >
172
172
  </view>
173
- <view class="bottom_btn" :style="prod_bottom">
174
- <view @click="dialogPreview = true" :style="{
175
- color: mainColor,
176
- border: `1px solid ${mainColor}`
177
- }">进入体验 ></view>
178
- </view>
179
- <xd-dailog
180
- title="体验码"
181
- :show.sync="dialogPreview"
182
- :cancel="false"
183
- confirm-text="进入体验模式"
184
- @onBtn="handlePreview"
185
- >
186
- <view class="preview-login">
187
- <input v-model="previewAccout" type="text" class="preview-login-input" placeholder="请输入体验码">
188
- </view>
189
- </xd-dailog>
190
173
  </view>
191
174
  </view>
192
175
  </template>
@@ -204,7 +187,6 @@ import XdFormCheckbox from "@/components/XdFormCheckbox/XdFormCheckbox";
204
187
  import XdFormInput from "@/components/XdFormInput/XdFormInput";
205
188
  import XdForm from "@/components/XdForm/XdForm";
206
189
  import XdFormItem from "@/components/XdFormItem/XdFormItem";
207
- import XdDailog from "@/components/XdDailog/XdDailog.vue";
208
190
  import { Base64 } from "js-base64";
209
191
  import { mapState } from "vuex";
210
192
  import getServiceUrl from "@/common/getServiceUrl";
@@ -226,19 +208,15 @@ export default {
226
208
  XdFormInput,
227
209
  XdForm,
228
210
  XdFormItem,
229
- XdDailog
230
211
  },
231
212
  mixins: [componentsMixins, extsMixins, JfbBaseLoginMixin, privacyMixins],
232
213
  data() {
233
214
  return {
234
- //体验模式
235
- dialogPreview: false,
236
- previewAccout: '',
237
-
238
215
  showStep: 1,
239
216
  panel_1_checked: "",
240
217
  panel_2_checked: "",
241
218
  password: "",
219
+ //todo
242
220
  accountLoginType: "phone", //phone: 验证码登录 pwd: 密码登录
243
221
  accountForm: {
244
222
  phone_number: "", //15801505541
@@ -287,9 +265,6 @@ export default {
287
265
  panelTwoIsChecked() {
288
266
  return this.panel_2_checked.includes(1);
289
267
  },
290
- prod_bottom() {
291
- return this.fixedStyle({ height: 0, zIndex: 111 });
292
- },
293
268
  },
294
269
  watch: {
295
270
  container(value) {
@@ -321,46 +296,16 @@ export default {
321
296
  url: `/pages/content/content?${params}`
322
297
  })
323
298
  },
324
-
325
- loginPreview(experience_code){
326
- return new Promise((resolve,reject)=>{
327
- jfbRootExec("loginExperience", {
328
- vm: this,
329
- data: {experience_code},
330
- }).then(res=>{
331
- resolve(res)
332
- }).catch(err=>{
333
- reject(err)
334
- })
335
- })
336
- },
337
-
338
- async handlePreview(){
339
- if(!this.previewAccout) {
340
- this.$xdAlert({
341
- content: '请输入体验码',
342
- type:'error'
343
- });
344
- return;
345
- }
346
- this.$xdShowLoading({});
347
- try{
348
- const res = await this.loginPreview(this.previewAccout);
349
- if(res) this.jfbAuthorize.setAllToken(res);
350
- this.toHomeAfterLogin();
351
- this.$xdHideLoading();
352
- }catch (e){
353
- this.$xdHideLoading();
354
- }
355
- },
356
-
357
-
299
+
300
+
358
301
  onJfbLoad(options) {
359
302
  this.redirect_url = options.redirect_url ? Base64.decode(options.redirect_url): '';
360
303
  // #ifdef MP-WEIXIN
361
304
  this.authWxMpListProviders();
362
305
  // #endif
306
+
363
307
  this.$xdLog.setProject('JfbBaseLogin', 'JfbBaseLogin.onJfbLoad.start')
308
+
364
309
  // #ifdef H5
365
310
  try{
366
311
  this.authH5ListProviders();
@@ -368,6 +313,7 @@ export default {
368
313
  this.$xdLog.setProject('JfbBaseLogin', 'JfbBaseLogin.onJfbLoad.error');
369
314
  this.$xdLog.setARMSError(error);
370
315
  }
316
+
371
317
  //#endif
372
318
 
373
319
  // if (options.isDebug === "1") {
@@ -408,7 +354,7 @@ export default {
408
354
  this.phone_number_collect_url = getContainerPropsValue(value, "content.phone_number_collect_url", {value: ''}).value;
409
355
  this.forget_pwd_url = getContainerPropsValue(value, "content.forget_pwd_url", {value: ''}).value;
410
356
  this.error_callback_url = getContainerPropsValue(value, "content.error_url", {value: ''}).value;
411
-
357
+
412
358
  },
413
359
 
414
360
  /**
@@ -518,22 +464,22 @@ export default {
518
464
  "62fde99f2583a19c58fd937b",
519
465
  "62fde9432583a19c58fd937a",
520
466
  ];
521
-
467
+
522
468
  let { redirect_url, callback_url } = this;
523
-
469
+
524
470
  //不同项目直接域名替换
525
471
  if (/^(@site_domain@).+$/.test(redirect_url)) {
526
472
  redirect_url = redirect_url.replace(/@site_domain@/, location.origin)
527
473
  }
528
-
474
+
529
475
  try {
530
476
  let redirectURL = new URL(redirect_url);
531
477
  redirect_url = redirectURL.href;
532
478
  } catch (e) {
533
479
  redirect_url = location.origin + this.base + redirect_url;
534
480
  }
535
-
536
-
481
+
482
+
537
483
  let params = {
538
484
  providers: providers.join(","),
539
485
  callback_url: redirect_url,
@@ -541,9 +487,9 @@ export default {
541
487
  phone_number_collect_url: location.origin + this.base + this.phone_number_collect_url,
542
488
  error_callback_url: location.origin + this.base + this.error_callback_url,
543
489
  };
544
-
490
+
545
491
  this.$xdLog.setProject('JfbBaseLogin', 'JfbBaseLogin.onJfbLoad.loading..');
546
-
492
+
547
493
  jfbRootExec("listSiteProvider", {
548
494
  vm: this,
549
495
  data: params,
@@ -755,7 +701,7 @@ export default {
755
701
  margin-left: unit(20,rpx) !important;
756
702
  }
757
703
  }
758
-
704
+
759
705
  .form-group {
760
706
  padding: 40rpx 70rpx;
761
707
  }
@@ -905,45 +851,4 @@ export default {
905
851
  .login-pub {
906
852
  margin-top: unit(40, rpx);
907
853
  }
908
- .bottom_btn {
909
- position: fixed;
910
- width: 100%;
911
- display:flex;
912
- justify-content: center;
913
- align-items: center;
914
- height: unit(100, rpx);
915
- background: #ffffff;
916
-
917
- & > view {
918
- height: unit(44, rpx);
919
- line-height: unit(44, rpx);
920
- width: unit(150, rpx);
921
- text-align: center;
922
- cursor: pointer;
923
- font-size: unit(24, rpx);
924
- border-radius: unit(12, rpx);
925
- }
926
- }
927
-
928
- .preview-login {
929
- padding: unit(40, rpx) 0;
930
-
931
- &-input {
932
- height: unit(70, rpx);
933
- border-radius: unit(12, rpx);
934
- padding: 0 unit(20, rpx);
935
- text-align: left;
936
- border: 1px solid #eee;
937
- background: #F7F7F7;
938
- color: #666;
939
- transition: box-shadow 0.5s;
940
- box-shadow: 0 0 0 rgba(0,0,0,0);
941
-
942
- &:hover {
943
- box-shadow: 0 0 unit(10, rpx) rgba(0,0,0,.1);
944
- }
945
- }
946
- }
947
-
948
-
949
854
  </style>
@@ -37,20 +37,19 @@
37
37
  <xd-font-icon :color="color" icon="iconwode_mian" size="100"></xd-font-icon>
38
38
  </view>
39
39
  </template>
40
- <view v-else class="no-image" :style="{borderColor: color}">
40
+ <view class="no-image" :style="{borderColor: color}" v-else>
41
41
  <xd-font-icon :color="color" icon="iconwode_mian" size="90"></xd-font-icon>
42
42
  </view>
43
-
44
43
  <view v-if="logined && textType ==='N'" :style="{color:color}">{{userInfo|getName}}</view>
45
44
  <view class="vertical-user" v-if="logined && textType ==='Y'" :style="{color:color}">
46
45
  <view>{{userInfo|getName}}</view>
47
- <view @click="handleToLink()">
46
+ <view @click="handleToLink()" v-if="0">
48
47
  <xd-font-icon :color="color" size="40" icon="iconshezhi_mian"></xd-font-icon>
49
48
  </view>
50
49
  </view>
51
50
  </view>
52
- <view @click="handleLogout()" v-if="logined" class="logout">
53
- <view v-if="textType ==='N'">[退出登录]</view>
51
+ <view @click="handleToLink()" v-if="logined && textType ==='N' && 0 ">
52
+ <xd-font-icon :color="color" size="40" icon="iconshezhi_mian"></xd-font-icon>
54
53
  </view>
55
54
  </view>
56
55
  </view>
@@ -65,7 +64,6 @@
65
64
  import extsMixins from "@/mixins/extsMixins"
66
65
  import { getContainerPropsValue } from "@/utils/xd.base";
67
66
  import {mapState} from 'vuex';
68
- import store from "@/store";
69
67
  export default {
70
68
  name: "JfbBaseUserInfo",
71
69
  components: {
@@ -74,7 +72,7 @@
74
72
  mixins: [componentsMixins,extsMixins,JfbBaseUserInfoMixin],
75
73
  computed: {
76
74
  ...mapState(['jfbAuthorize']),
77
-
75
+
78
76
  outMargin() {
79
77
  let margin = `${this.margin.top !== null ? this.margin.top : 20}rpx`;
80
78
  margin = `${margin} ${this.margin.right !== null ? this.margin.right : 20}rpx`;
@@ -108,24 +106,24 @@
108
106
  logined: false,
109
107
  userInfo: null,
110
108
  address_url: '',
111
-
109
+
112
110
  //基础
113
111
  color: '#333',
114
112
  backgroundColor: 'rgba(0,0,0,0)',
115
113
  textType: 'N', //默认水平
116
114
  radius: 0,
117
-
115
+
118
116
  //投影
119
117
  is_shadow: 'Y',
120
118
  is_shadow_bg: 0,
121
119
  is_shadow_w: 0,
122
-
123
-
120
+
121
+
124
122
  //边框
125
123
  is_border: 'Y',
126
124
  is_border_w: 0,
127
125
  is_border_c: '',
128
-
126
+
129
127
  //其他
130
128
  margin: {
131
129
  top: 0,
@@ -139,7 +137,7 @@
139
137
  right: 0,
140
138
  bottom: 0
141
139
  },
142
-
140
+
143
141
  }
144
142
  },
145
143
  watch: {
@@ -156,27 +154,8 @@
156
154
  url: '/pages/settings/settings'
157
155
  })
158
156
  },
159
-
160
- async handleLogout(){
161
- debugger
162
- // #ifdef H5
163
- if (this.$configProject.isPreview) return;
164
- // #endif
165
-
166
- if (this.jfbAuthorize !== null) {
167
- this.$xdShowLoading({});
168
- store.dispatch('logout').then(res=>{
169
- this.$xdHideLoading();
170
- this.jfbAuthorize.removeToken('card');
171
- this.jfbAuthorize.jumpToUserLogin(this, false);
172
- }).catch(err=>{
173
- console.error(err);
174
- })
175
- }
176
- },
177
-
178
157
  async onJfbLoad(options) {
179
-
158
+
180
159
  //预览模式
181
160
  if(this.$configProject.isPreview) {
182
161
  jfbRootExec('getBaseUserInfo', {
@@ -191,10 +170,10 @@
191
170
  });
192
171
  return;
193
172
  }
194
-
173
+
195
174
  this.logined = await this.jfbAuthorize.checkUserLogin(true, this, false);
196
175
  if(!this.logined) return;
197
-
176
+
198
177
  jfbRootExec('getBaseUserInfo', {
199
178
  vm: this,
200
179
  data: {}
@@ -215,16 +194,16 @@
215
194
  this.address_url = getContainerPropsValue(container, 'content.address_url', {value: ''});
216
195
  this.color = getContainerPropsValue(container, 'content.textColor', '#333');
217
196
  this.backgroundColor = getContainerPropsValue(container, 'content.backgroundColor', 'rgba(0,0,0,0)');
218
- this.textType = "N";//getContainerPropsValue(container, 'content.text_type', 'N');
219
-
197
+ this.textType = getContainerPropsValue(container, 'content.text_type', 'N');
198
+
220
199
  this.is_shadow = getContainerPropsValue(container, 'content.is_shadow', 'N');
221
200
  this.is_shadow_bg = getContainerPropsValue(container, 'content.is_shadow_bg', '#fff');
222
201
  this.is_shadow_w = getContainerPropsValue(container, 'content.is_shadow_w', '10');
223
-
202
+
224
203
  this.is_border = getContainerPropsValue(container, 'content.is_border', 'N');
225
204
  this.is_border_c = getContainerPropsValue(container, 'content.is_border_c', '#fff');
226
205
  this.is_border_w = getContainerPropsValue(container, 'content.is_border_w', '10');
227
-
206
+
228
207
  this.radius = getContainerPropsValue(container, 'content.radius', '0');
229
208
  },
230
209
  }
@@ -234,7 +213,7 @@
234
213
 
235
214
  <style scoped lang="less">
236
215
  @import "./JfbBaseUserInfoLess.less";
237
-
216
+
238
217
  .vertical-user {
239
218
  display: flex;
240
219
  justify-content: center;
@@ -250,29 +229,29 @@
250
229
  display: flex;
251
230
  align-items: center;
252
231
  justify-content: flex-start;
253
-
254
-
232
+
233
+
255
234
  &-left {
256
235
  display: flex;
257
236
  align-items: center;
258
237
  flex: 1;
259
-
238
+
260
239
  &.vertical {
261
240
  width: 100%;
262
241
  flex-direction: column;
263
-
242
+
264
243
  & > view:last-child {
265
244
  width: 100%;
266
245
  text-align: center;
267
246
  flex-shrink: 0;
268
247
  padding-top: unit(20, rpx);
269
248
  }
270
-
249
+
271
250
  & > image, .no-image {
272
251
  margin-right: unit(0, rpx);
273
252
  }
274
253
  }
275
-
254
+
276
255
  & > image, .no-image {
277
256
  width: unit(140, rpx);
278
257
  height: unit(140, rpx);
@@ -284,28 +263,21 @@
284
263
  flex-shrink: 0;
285
264
  overflow: hidden;
286
265
  }
287
-
266
+
288
267
  .no-image {
289
268
  border: unit(4, rpx) solid #e5e5e5;
290
269
  }
291
-
270
+
292
271
  & > view {
293
272
  color: #383838;
294
273
  font-size: unit(32, rpx);
295
274
  }
296
275
  }
297
-
276
+
298
277
  & > view:nth-child(2) {
299
278
  flex-shrink: 0;
300
279
  }
301
280
  }
302
281
  }
303
-
304
- .logout {
305
- font-size: unit(26, rpx);
306
- & > view {
307
- color: #333;
308
- }
309
- }
310
282
  }
311
283
  </style>