jufubao-base 1.0.71 → 1.0.73-beta1

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.71",
3
+ "version": "1.0.73-beta1",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -29,6 +29,7 @@ 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}'
32
33
  }, settings.token? settings.token: {});
33
34
  }
34
35
 
@@ -40,6 +41,7 @@ class JfbAuthorize {
40
41
  * @returns {string|*}
41
42
  */
42
43
  getTokenKeyword(key){
44
+
43
45
  if (!this.config[key]) key = 'user';
44
46
  if(key === 'access') return this.config.access;
45
47
  else{
@@ -83,6 +85,8 @@ class JfbAuthorize {
83
85
  */
84
86
  removeToken(key, options = {}) {
85
87
  key = this.getTokenKeyword(key);
88
+ let codeKey = this.getTokenKeyword('cardCode');
89
+ debugger
86
90
  //#ifdef H5
87
91
  cookie.remove(key, options);
88
92
  console.warn(`cookie.key=${key}`);
@@ -142,7 +146,7 @@ class JfbAuthorize {
142
146
  * @description 跳转到用户登陆页面
143
147
  * @param $vm {Vue}
144
148
  */
145
- jumpToUserLogin($vm) {
149
+ jumpToUserLogin($vm,isRedirect) {
146
150
  let redirect_url = '';
147
151
  if(store.state.configProject.platform === 'mp.weixin') {
148
152
  redirect_url = $vm['$xdUniHelper'].parseURL().source;
@@ -6,219 +6,219 @@
6
6
  export default {
7
7
  style: [],
8
8
  content: [
9
- {
10
- label: '领券规则:',
11
- ele: 'xd-site-news',
12
- valueKey: 'notice',
13
- value: null,
14
- className: 'input70',
15
- setting: {
16
- config: {
17
- sort: true,
18
- maxlen: 100,
19
- action: 'aliyun',
20
- size: 5,
21
- tipsformet: '上传文件格式:@imageType@,不超过@size@MB.',
22
- uploadType: 'aliyun',
23
- type: ['jpg', 'png', 'jpeg']
24
- },
25
- },
26
- handleCustom({action, data}) {
27
- if (data && data.params) {
28
- //当一个插件中出现使用内容分类时候需要设置code值,在页面引用时候容器id + code进行拼接
29
- //data.params = Object.assign({}, data.params, {code: 'g_test_id'});
30
- }
31
-
32
- //获取返回参数(场景类型名称为必填)
33
- let loading = XdBus.getParentApi('loading')({});
34
-
35
- //获取显示内容
36
- if (action === 'screen') {
37
- XdBus.getParentApi('getOptionsSettingList')({setting_id: 'edtix_bucket_content_tip'})
38
- .then(res => {
39
- loading.close();
40
- data.cb(res['list'])
41
- })
42
- .catch(error => {
43
- console.error(error);
44
- loading.close();
45
- });
46
-
47
- }
48
-
49
- //获取返回参数(广告位高度必选项)
50
- if (action === 'getNewsInfo') {
51
- XdBus.getParentApi('cmsGetPublishEditxContent')(data.params)
52
- .then(res => {
53
- loading.close()
54
- data.cb({list: res.list, selectId: res.selected})
55
- })
56
- .catch(error => {
57
- loading.close()
58
- console.error(error);
59
- });
60
- }
61
-
62
- //获取产品业务线列表
63
- if (action === 'namespace') {
64
- XdBus.getParentApi('getOptionsNamespaces')({})
65
- .then(res => {
66
- loading.close()
67
- data.cb(res['list'])
68
- })
69
- .catch(error => {
70
- loading.close()
71
- console.error(error);
72
- });
73
- }
74
-
75
- //使用内容分类
76
- if (action === 'cmsPublishEditxContent') {
77
- XdBus.getParentApi('cmsPublishEditxContent')(data.params)
78
- .then(res => {
79
- console.log('cmsPublishEditxContent', res)
80
- loading.close();
81
- data.cb(res)
82
- })
83
- .catch(error => {
84
- loading.close();
85
- console.error(error);
86
- });
87
- }
88
-
89
- //位置列表
90
- if (action === 'getListPostion') {
91
- XdBus.getParentApi('getListNewsPosition')(data.params)
92
- .then(res => {
93
- loading.close();
94
- data.cb(res)
95
- })
96
- .catch(error => {
97
- loading.close();
98
- console.error(error);
99
- });
100
- }
101
-
102
- //位置创建
103
- if (action === 'addPostion') {
104
- XdBus.getParentApi('addNewsPosition')(data.params)
105
- .then(res => {
106
- loading.close();
107
- data.cb(true)
108
- })
109
- .catch(error => {
110
- console.error(error);
111
- loading.close();
112
- data.cb(false)
113
- });
114
- }
115
-
116
- //位置编辑
117
- if (action === 'editPostion') {
118
- XdBus.getParentApi('updateNewsPosition')(data.params)
119
- .then(res => {
120
- loading.close();
121
- data.cb(true)
122
- })
123
- .catch(error => {
124
- console.error(error);
125
- loading.close();
126
- data.cb(false)
127
- });
128
- }
129
-
130
- //位置删除
131
- if (action === 'deleltePostion') {
132
- XdBus.getParentApi('deleteNewsPosition')(data.params)
133
- .then(res => {
134
- loading.close();
135
- data.cb(true)
136
- })
137
- .catch(error => {
138
- console.error(error);
139
- loading.close();
140
- data.cb(false)
141
- });
142
- }
143
-
144
- //获取广告位内容列表
145
- if (action === 'getListContent') {
146
- XdBus.getParentApi('getListNewsContent')(data.params)
147
- .then(res => {
148
- loading.close();
149
- data.cb(res)
150
- })
151
- .catch(error => {
152
- loading.close();
153
- console.error(error);
154
- });
155
- }
156
-
157
- //广告内容创建
158
- if (action === 'addContent') {
159
- XdBus.getParentApi('addNewsContent')(data.params)
160
- .then(res => {
161
- loading.close();
162
- data.cb(true)
163
- })
164
- .catch(error => {
165
- console.error(error);
166
- loading.close();
167
- data.cb(false)
168
- });
169
- }
170
-
171
- //广告内容编辑
172
- if (action === 'editContent') {
173
- XdBus.getParentApi('updateNewsContent')(data.params)
174
- .then(res => {
175
- loading.close();
176
- data.cb(true)
177
- })
178
- .catch(error => {
179
- console.error(error);
180
- loading.close();
181
- data.cb(false)
182
- });
183
- }
184
-
185
- //广告内容删除
186
- if (action === 'deleteContent') {
187
- XdBus.getParentApi('deleteNewsContent')(data.params)
188
- .then(res => {
189
- loading.close();
190
- data.cb(true)
191
- })
192
- .catch(error => {
193
- console.error(error);
194
- loading.close();
195
- data.cb(false)
196
- });
197
- }
198
-
199
- //内容发布
200
- if (action === 'publish') {
201
- console.log('publish', data.params)
202
- XdBus.getParentApi('cmsPublishContent')(data.params)
203
- .then(res => {
204
- loading.close();
205
- data.cb(res)
206
- })
207
- .catch(error => {
208
- loading.close();
209
- console.error(error);
210
- });
211
- }
212
-
213
- //通知页面进行刷新
214
- if (action === 'update') {
215
- XdBus.getParentApi('getXdBusUpdateView')('onUpdateView', {});
216
- loading.close()
217
- }
218
- },
219
- inline: false,
220
- notice: '请配置温馨提示内容,未配置的情况将不显示此模块',
221
- },
9
+ // {
10
+ // label: '领券规则:',
11
+ // ele: 'xd-site-news',
12
+ // valueKey: 'notice',
13
+ // value: null,
14
+ // className: 'input70',
15
+ // setting: {
16
+ // config: {
17
+ // sort: true,
18
+ // maxlen: 100,
19
+ // action: 'aliyun',
20
+ // size: 5,
21
+ // tipsformet: '上传文件格式:@imageType@,不超过@size@MB.',
22
+ // uploadType: 'aliyun',
23
+ // type: ['jpg', 'png', 'jpeg']
24
+ // },
25
+ // },
26
+ // handleCustom({action, data}) {
27
+ // if (data && data.params) {
28
+ // //当一个插件中出现使用内容分类时候需要设置code值,在页面引用时候容器id + code进行拼接
29
+ // //data.params = Object.assign({}, data.params, {code: 'g_test_id'});
30
+ // }
31
+
32
+ // //获取返回参数(场景类型名称为必填)
33
+ // let loading = XdBus.getParentApi('loading')({});
34
+
35
+ // //获取显示内容
36
+ // if (action === 'screen') {
37
+ // XdBus.getParentApi('getOptionsSettingList')({setting_id: 'edtix_bucket_content_tip'})
38
+ // .then(res => {
39
+ // loading.close();
40
+ // data.cb(res['list'])
41
+ // })
42
+ // .catch(error => {
43
+ // console.error(error);
44
+ // loading.close();
45
+ // });
46
+
47
+ // }
48
+
49
+ // //获取返回参数(广告位高度必选项)
50
+ // if (action === 'getNewsInfo') {
51
+ // XdBus.getParentApi('cmsGetPublishEditxContent')(data.params)
52
+ // .then(res => {
53
+ // loading.close()
54
+ // data.cb({list: res.list, selectId: res.selected})
55
+ // })
56
+ // .catch(error => {
57
+ // loading.close()
58
+ // console.error(error);
59
+ // });
60
+ // }
61
+
62
+ // //获取产品业务线列表
63
+ // if (action === 'namespace') {
64
+ // XdBus.getParentApi('getOptionsNamespaces')({})
65
+ // .then(res => {
66
+ // loading.close()
67
+ // data.cb(res['list'])
68
+ // })
69
+ // .catch(error => {
70
+ // loading.close()
71
+ // console.error(error);
72
+ // });
73
+ // }
74
+
75
+ // //使用内容分类
76
+ // if (action === 'cmsPublishEditxContent') {
77
+ // XdBus.getParentApi('cmsPublishEditxContent')(data.params)
78
+ // .then(res => {
79
+ // console.log('cmsPublishEditxContent', res)
80
+ // loading.close();
81
+ // data.cb(res)
82
+ // })
83
+ // .catch(error => {
84
+ // loading.close();
85
+ // console.error(error);
86
+ // });
87
+ // }
88
+
89
+ // //位置列表
90
+ // if (action === 'getListPostion') {
91
+ // XdBus.getParentApi('getListNewsPosition')(data.params)
92
+ // .then(res => {
93
+ // loading.close();
94
+ // data.cb(res)
95
+ // })
96
+ // .catch(error => {
97
+ // loading.close();
98
+ // console.error(error);
99
+ // });
100
+ // }
101
+
102
+ // //位置创建
103
+ // if (action === 'addPostion') {
104
+ // XdBus.getParentApi('addNewsPosition')(data.params)
105
+ // .then(res => {
106
+ // loading.close();
107
+ // data.cb(true)
108
+ // })
109
+ // .catch(error => {
110
+ // console.error(error);
111
+ // loading.close();
112
+ // data.cb(false)
113
+ // });
114
+ // }
115
+
116
+ // //位置编辑
117
+ // if (action === 'editPostion') {
118
+ // XdBus.getParentApi('updateNewsPosition')(data.params)
119
+ // .then(res => {
120
+ // loading.close();
121
+ // data.cb(true)
122
+ // })
123
+ // .catch(error => {
124
+ // console.error(error);
125
+ // loading.close();
126
+ // data.cb(false)
127
+ // });
128
+ // }
129
+
130
+ // //位置删除
131
+ // if (action === 'deleltePostion') {
132
+ // XdBus.getParentApi('deleteNewsPosition')(data.params)
133
+ // .then(res => {
134
+ // loading.close();
135
+ // data.cb(true)
136
+ // })
137
+ // .catch(error => {
138
+ // console.error(error);
139
+ // loading.close();
140
+ // data.cb(false)
141
+ // });
142
+ // }
143
+
144
+ // //获取广告位内容列表
145
+ // if (action === 'getListContent') {
146
+ // XdBus.getParentApi('getListNewsContent')(data.params)
147
+ // .then(res => {
148
+ // loading.close();
149
+ // data.cb(res)
150
+ // })
151
+ // .catch(error => {
152
+ // loading.close();
153
+ // console.error(error);
154
+ // });
155
+ // }
156
+
157
+ // //广告内容创建
158
+ // if (action === 'addContent') {
159
+ // XdBus.getParentApi('addNewsContent')(data.params)
160
+ // .then(res => {
161
+ // loading.close();
162
+ // data.cb(true)
163
+ // })
164
+ // .catch(error => {
165
+ // console.error(error);
166
+ // loading.close();
167
+ // data.cb(false)
168
+ // });
169
+ // }
170
+
171
+ // //广告内容编辑
172
+ // if (action === 'editContent') {
173
+ // XdBus.getParentApi('updateNewsContent')(data.params)
174
+ // .then(res => {
175
+ // loading.close();
176
+ // data.cb(true)
177
+ // })
178
+ // .catch(error => {
179
+ // console.error(error);
180
+ // loading.close();
181
+ // data.cb(false)
182
+ // });
183
+ // }
184
+
185
+ // //广告内容删除
186
+ // if (action === 'deleteContent') {
187
+ // XdBus.getParentApi('deleteNewsContent')(data.params)
188
+ // .then(res => {
189
+ // loading.close();
190
+ // data.cb(true)
191
+ // })
192
+ // .catch(error => {
193
+ // console.error(error);
194
+ // loading.close();
195
+ // data.cb(false)
196
+ // });
197
+ // }
198
+
199
+ // //内容发布
200
+ // if (action === 'publish') {
201
+ // console.log('publish', data.params)
202
+ // XdBus.getParentApi('cmsPublishContent')(data.params)
203
+ // .then(res => {
204
+ // loading.close();
205
+ // data.cb(res)
206
+ // })
207
+ // .catch(error => {
208
+ // loading.close();
209
+ // console.error(error);
210
+ // });
211
+ // }
212
+
213
+ // //通知页面进行刷新
214
+ // if (action === 'update') {
215
+ // XdBus.getParentApi('getXdBusUpdateView')('onUpdateView', {});
216
+ // loading.close()
217
+ // }
218
+ // },
219
+ // inline: false,
220
+ // notice: '请配置温馨提示内容,未配置的情况将不显示此模块',
221
+ // },
222
222
  ],
223
223
  advanced: [],
224
224
  };
@@ -281,6 +281,7 @@ export default {
281
281
  });
282
282
  console.log("couponList", this.couponList);
283
283
  this.message = res.message;
284
+ this.notice = res.rule;
284
285
  this.done = true;
285
286
  })
286
287
  .catch((err) => {
@@ -372,32 +373,32 @@ export default {
372
373
  console.log(err, "err");
373
374
  });
374
375
  },
375
- getContent() {
376
- jfbRootExec("getListBaseNewsContentCoupon", {
377
- vm: this,
378
- data: {
379
- page_id: this.pageAttr["page_id"], //页面ID
380
- container_id: this.containerId, //组件ID
381
- limit: 1,
382
- },
383
- })
384
- .then((res) => {
385
- console.log(res, "ajajajajaj");
386
- if (res.list&&res.list.length > 0) {
387
- this.notice = res.list[0].content;
388
- }
389
- })
390
- .catch((error) => {
391
- console.error(error);
392
- });
393
- },
376
+ // getContent() {
377
+ // jfbRootExec("getListBaseNewsContentCoupon", {
378
+ // vm: this,
379
+ // data: {
380
+ // page_id: this.pageAttr["page_id"], //页面ID
381
+ // container_id: this.containerId, //组件ID
382
+ // limit: 1,
383
+ // },
384
+ // })
385
+ // .then((res) => {
386
+ // console.log(res, "ajajajajaj");
387
+ // if (res.list&&res.list.length > 0) {
388
+ // this.notice = res.list[0].content;
389
+ // }
390
+ // })
391
+ // .catch((error) => {
392
+ // console.error(error);
393
+ // });
394
+ // },
394
395
  onJfbLoad(options) {
395
396
  console.log(this.pageBusinessCode, "pageNamespace");
396
397
  this.activity_id = options.activity_id;
397
398
  this.method = options.distribution_method
398
399
  ? options.distribution_method
399
400
  : "entry";
400
- this.getContent();
401
+ // this.getContent();
401
402
  this.getList();
402
403
  },
403
404
 
@@ -131,4 +131,13 @@ 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
+ },
134
143
  ];
@@ -170,6 +170,23 @@
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>
173
190
  </view>
174
191
  </view>
175
192
  </template>
@@ -187,6 +204,7 @@ import XdFormCheckbox from "@/components/XdFormCheckbox/XdFormCheckbox";
187
204
  import XdFormInput from "@/components/XdFormInput/XdFormInput";
188
205
  import XdForm from "@/components/XdForm/XdForm";
189
206
  import XdFormItem from "@/components/XdFormItem/XdFormItem";
207
+ import XdDailog from "@/components/XdDailog/XdDailog.vue";
190
208
  import { Base64 } from "js-base64";
191
209
  import { mapState } from "vuex";
192
210
  import getServiceUrl from "@/common/getServiceUrl";
@@ -208,15 +226,19 @@ export default {
208
226
  XdFormInput,
209
227
  XdForm,
210
228
  XdFormItem,
229
+ XdDailog
211
230
  },
212
231
  mixins: [componentsMixins, extsMixins, JfbBaseLoginMixin, privacyMixins],
213
232
  data() {
214
233
  return {
234
+ //体验模式
235
+ dialogPreview: false,
236
+ previewAccout: '',
237
+
215
238
  showStep: 1,
216
239
  panel_1_checked: "",
217
240
  panel_2_checked: "",
218
241
  password: "",
219
- //todo
220
242
  accountLoginType: "phone", //phone: 验证码登录 pwd: 密码登录
221
243
  accountForm: {
222
244
  phone_number: "", //15801505541
@@ -265,6 +287,9 @@ export default {
265
287
  panelTwoIsChecked() {
266
288
  return this.panel_2_checked.includes(1);
267
289
  },
290
+ prod_bottom() {
291
+ return this.fixedStyle({ height: 0, zIndex: 111 });
292
+ },
268
293
  },
269
294
  watch: {
270
295
  container(value) {
@@ -296,16 +321,46 @@ export default {
296
321
  url: `/pages/content/content?${params}`
297
322
  })
298
323
  },
299
-
300
-
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
+
301
358
  onJfbLoad(options) {
302
359
  this.redirect_url = options.redirect_url ? Base64.decode(options.redirect_url): '';
303
360
  // #ifdef MP-WEIXIN
304
361
  this.authWxMpListProviders();
305
362
  // #endif
306
-
307
363
  this.$xdLog.setProject('JfbBaseLogin', 'JfbBaseLogin.onJfbLoad.start')
308
-
309
364
  // #ifdef H5
310
365
  try{
311
366
  this.authH5ListProviders();
@@ -313,7 +368,6 @@ export default {
313
368
  this.$xdLog.setProject('JfbBaseLogin', 'JfbBaseLogin.onJfbLoad.error');
314
369
  this.$xdLog.setARMSError(error);
315
370
  }
316
-
317
371
  //#endif
318
372
 
319
373
  // if (options.isDebug === "1") {
@@ -354,7 +408,7 @@ export default {
354
408
  this.phone_number_collect_url = getContainerPropsValue(value, "content.phone_number_collect_url", {value: ''}).value;
355
409
  this.forget_pwd_url = getContainerPropsValue(value, "content.forget_pwd_url", {value: ''}).value;
356
410
  this.error_callback_url = getContainerPropsValue(value, "content.error_url", {value: ''}).value;
357
-
411
+
358
412
  },
359
413
 
360
414
  /**
@@ -464,22 +518,22 @@ export default {
464
518
  "62fde99f2583a19c58fd937b",
465
519
  "62fde9432583a19c58fd937a",
466
520
  ];
467
-
521
+
468
522
  let { redirect_url, callback_url } = this;
469
-
523
+
470
524
  //不同项目直接域名替换
471
525
  if (/^(@site_domain@).+$/.test(redirect_url)) {
472
526
  redirect_url = redirect_url.replace(/@site_domain@/, location.origin)
473
527
  }
474
-
528
+
475
529
  try {
476
530
  let redirectURL = new URL(redirect_url);
477
531
  redirect_url = redirectURL.href;
478
532
  } catch (e) {
479
533
  redirect_url = location.origin + this.base + redirect_url;
480
534
  }
481
-
482
-
535
+
536
+
483
537
  let params = {
484
538
  providers: providers.join(","),
485
539
  callback_url: redirect_url,
@@ -487,9 +541,9 @@ export default {
487
541
  phone_number_collect_url: location.origin + this.base + this.phone_number_collect_url,
488
542
  error_callback_url: location.origin + this.base + this.error_callback_url,
489
543
  };
490
-
544
+
491
545
  this.$xdLog.setProject('JfbBaseLogin', 'JfbBaseLogin.onJfbLoad.loading..');
492
-
546
+
493
547
  jfbRootExec("listSiteProvider", {
494
548
  vm: this,
495
549
  data: params,
@@ -701,7 +755,7 @@ export default {
701
755
  margin-left: unit(20,rpx) !important;
702
756
  }
703
757
  }
704
-
758
+
705
759
  .form-group {
706
760
  padding: 40rpx 70rpx;
707
761
  }
@@ -851,4 +905,45 @@ export default {
851
905
  .login-pub {
852
906
  margin-top: unit(40, rpx);
853
907
  }
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
+
854
949
  </style>
@@ -37,19 +37,20 @@
37
37
  <xd-font-icon :color="color" icon="iconwode_mian" size="100"></xd-font-icon>
38
38
  </view>
39
39
  </template>
40
- <view class="no-image" :style="{borderColor: color}" v-else>
40
+ <view v-else class="no-image" :style="{borderColor: color}">
41
41
  <xd-font-icon :color="color" icon="iconwode_mian" size="90"></xd-font-icon>
42
42
  </view>
43
+
43
44
  <view v-if="logined && textType ==='N'" :style="{color:color}">{{userInfo|getName}}</view>
44
45
  <view class="vertical-user" v-if="logined && textType ==='Y'" :style="{color:color}">
45
46
  <view>{{userInfo|getName}}</view>
46
- <view @click="handleToLink()" v-if="0">
47
+ <view @click="handleToLink()">
47
48
  <xd-font-icon :color="color" size="40" icon="iconshezhi_mian"></xd-font-icon>
48
49
  </view>
49
50
  </view>
50
51
  </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>
52
+ <view @click="handleLogout()" v-if="logined" class="logout">
53
+ <view v-if="textType ==='N'">[退出登录]</view>
53
54
  </view>
54
55
  </view>
55
56
  </view>
@@ -64,6 +65,7 @@
64
65
  import extsMixins from "@/mixins/extsMixins"
65
66
  import { getContainerPropsValue } from "@/utils/xd.base";
66
67
  import {mapState} from 'vuex';
68
+ import store from "@/store";
67
69
  export default {
68
70
  name: "JfbBaseUserInfo",
69
71
  components: {
@@ -72,7 +74,7 @@
72
74
  mixins: [componentsMixins,extsMixins,JfbBaseUserInfoMixin],
73
75
  computed: {
74
76
  ...mapState(['jfbAuthorize']),
75
-
77
+
76
78
  outMargin() {
77
79
  let margin = `${this.margin.top !== null ? this.margin.top : 20}rpx`;
78
80
  margin = `${margin} ${this.margin.right !== null ? this.margin.right : 20}rpx`;
@@ -106,24 +108,24 @@
106
108
  logined: false,
107
109
  userInfo: null,
108
110
  address_url: '',
109
-
111
+
110
112
  //基础
111
113
  color: '#333',
112
114
  backgroundColor: 'rgba(0,0,0,0)',
113
115
  textType: 'N', //默认水平
114
116
  radius: 0,
115
-
117
+
116
118
  //投影
117
119
  is_shadow: 'Y',
118
120
  is_shadow_bg: 0,
119
121
  is_shadow_w: 0,
120
-
121
-
122
+
123
+
122
124
  //边框
123
125
  is_border: 'Y',
124
126
  is_border_w: 0,
125
127
  is_border_c: '',
126
-
128
+
127
129
  //其他
128
130
  margin: {
129
131
  top: 0,
@@ -137,7 +139,7 @@
137
139
  right: 0,
138
140
  bottom: 0
139
141
  },
140
-
142
+
141
143
  }
142
144
  },
143
145
  watch: {
@@ -154,8 +156,27 @@
154
156
  url: '/pages/settings/settings'
155
157
  })
156
158
  },
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
+
157
178
  async onJfbLoad(options) {
158
-
179
+
159
180
  //预览模式
160
181
  if(this.$configProject.isPreview) {
161
182
  jfbRootExec('getBaseUserInfo', {
@@ -170,10 +191,10 @@
170
191
  });
171
192
  return;
172
193
  }
173
-
194
+
174
195
  this.logined = await this.jfbAuthorize.checkUserLogin(true, this, false);
175
196
  if(!this.logined) return;
176
-
197
+
177
198
  jfbRootExec('getBaseUserInfo', {
178
199
  vm: this,
179
200
  data: {}
@@ -194,16 +215,16 @@
194
215
  this.address_url = getContainerPropsValue(container, 'content.address_url', {value: ''});
195
216
  this.color = getContainerPropsValue(container, 'content.textColor', '#333');
196
217
  this.backgroundColor = getContainerPropsValue(container, 'content.backgroundColor', 'rgba(0,0,0,0)');
197
- this.textType = getContainerPropsValue(container, 'content.text_type', 'N');
198
-
218
+ this.textType = "N";//getContainerPropsValue(container, 'content.text_type', 'N');
219
+
199
220
  this.is_shadow = getContainerPropsValue(container, 'content.is_shadow', 'N');
200
221
  this.is_shadow_bg = getContainerPropsValue(container, 'content.is_shadow_bg', '#fff');
201
222
  this.is_shadow_w = getContainerPropsValue(container, 'content.is_shadow_w', '10');
202
-
223
+
203
224
  this.is_border = getContainerPropsValue(container, 'content.is_border', 'N');
204
225
  this.is_border_c = getContainerPropsValue(container, 'content.is_border_c', '#fff');
205
226
  this.is_border_w = getContainerPropsValue(container, 'content.is_border_w', '10');
206
-
227
+
207
228
  this.radius = getContainerPropsValue(container, 'content.radius', '0');
208
229
  },
209
230
  }
@@ -213,7 +234,7 @@
213
234
 
214
235
  <style scoped lang="less">
215
236
  @import "./JfbBaseUserInfoLess.less";
216
-
237
+
217
238
  .vertical-user {
218
239
  display: flex;
219
240
  justify-content: center;
@@ -229,29 +250,29 @@
229
250
  display: flex;
230
251
  align-items: center;
231
252
  justify-content: flex-start;
232
-
233
-
253
+
254
+
234
255
  &-left {
235
256
  display: flex;
236
257
  align-items: center;
237
258
  flex: 1;
238
-
259
+
239
260
  &.vertical {
240
261
  width: 100%;
241
262
  flex-direction: column;
242
-
263
+
243
264
  & > view:last-child {
244
265
  width: 100%;
245
266
  text-align: center;
246
267
  flex-shrink: 0;
247
268
  padding-top: unit(20, rpx);
248
269
  }
249
-
270
+
250
271
  & > image, .no-image {
251
272
  margin-right: unit(0, rpx);
252
273
  }
253
274
  }
254
-
275
+
255
276
  & > image, .no-image {
256
277
  width: unit(140, rpx);
257
278
  height: unit(140, rpx);
@@ -263,21 +284,28 @@
263
284
  flex-shrink: 0;
264
285
  overflow: hidden;
265
286
  }
266
-
287
+
267
288
  .no-image {
268
289
  border: unit(4, rpx) solid #e5e5e5;
269
290
  }
270
-
291
+
271
292
  & > view {
272
293
  color: #383838;
273
294
  font-size: unit(32, rpx);
274
295
  }
275
296
  }
276
-
297
+
277
298
  & > view:nth-child(2) {
278
299
  flex-shrink: 0;
279
300
  }
280
301
  }
281
302
  }
303
+
304
+ .logout {
305
+ font-size: unit(26, rpx);
306
+ & > view {
307
+ color: #333;
308
+ }
309
+ }
282
310
  }
283
311
  </style>