jufubao-base 1.0.158 → 1.0.159-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.
Files changed (49) hide show
  1. package/package.json +1 -1
  2. package/src/common/authorize.js +201 -70
  3. package/src/components/JfbBaseAddress/JfbBaseAddress.vue +4 -4
  4. package/src/components/JfbBaseAfterOrderDetail/JfbBaseAfterOrderDetail.vue +2 -1
  5. package/src/components/JfbBaseBack/JfbBaseBack.vue +7 -6
  6. package/src/components/JfbBaseCard/JfbBaseCard.vue +4 -1
  7. package/src/components/JfbBaseCardBindV2/JfbBaseCardBindV2.vue +54 -24
  8. package/src/components/JfbBaseCardDetail/JfbBaseCardDetail.vue +14 -14
  9. package/src/components/JfbBaseCardDetailEntry/JfbBaseCardDetailEntry.vue +313 -394
  10. package/src/components/JfbBaseCardDisabled/JfbBaseCardDisabled.vue +1 -1
  11. package/src/components/JfbBaseCardDisabledEntry/JfbBaseCardDisabledEntry.vue +4 -5
  12. package/src/components/JfbBaseCardEntry/JfbBaseCardEntry.vue +1 -0
  13. package/src/components/JfbBaseCardInfo/JfbBaseCardInfo.vue +15 -19
  14. package/src/components/JfbBaseCardInfoEntry/JfbBaseCardInfoEntry.vue +5 -2
  15. package/src/components/JfbBaseCardMerge/JfbBaseCardMerge.vue +1 -1
  16. package/src/components/JfbBaseCardMergeEntry/JfbBaseCardMergeEntry.vue +20 -16
  17. package/src/components/JfbBaseCardShift/JfbBaseCardShift.vue +1 -1
  18. package/src/components/JfbBaseCardShiftEntry/JfbBaseCardShiftEntry.vue +1 -1
  19. package/src/components/JfbBaseCardV2/JfbBaseCardV2.vue +34 -18
  20. package/src/components/JfbBaseEntry/Attr.js +22 -0
  21. package/src/components/JfbBaseEntry/JfbBaseEntry.vue +76 -13
  22. package/src/components/JfbBaseFastLink/JfbBaseFastLink.vue +27 -18
  23. package/src/components/JfbBaseFastLink/XdFastNav.vue +2 -2
  24. package/src/components/JfbBaseLogin/JfbBaseLogin.vue +2 -2
  25. package/src/components/JfbBaseLoginForgetPwd/JfbBaseLoginForgetPwd.vue +1 -1
  26. package/src/components/JfbBaseLoginSetPwd/JfbBaseLoginSetPwd.vue +3 -3
  27. package/src/components/JfbBaseMapOverlay/JfbBaseMapOverlay.vue +13 -0
  28. package/src/components/JfbBaseMapOverlay/XdMapOverlay.vue +52 -37
  29. package/src/components/JfbBaseMultipleExpress/JfbBaseMultipleExpress.vue +2 -1
  30. package/src/components/JfbBaseNotice/Attr.js +0 -2
  31. package/src/components/JfbBaseNotice/JfbBaseNotice.vue +30 -10
  32. package/src/components/JfbBaseNotice/XdNoticeBar.vue +17 -1
  33. package/src/components/JfbBaseOrderDetail/JfbBaseOrderDetail.vue +2 -2
  34. package/src/components/JfbBaseOrderList/JfbBaseOrderList.vue +1 -1
  35. package/src/components/JfbBasePoster/JfbBasePoster.vue +118 -18
  36. package/src/components/JfbBasePoster/MoreScreen.vue +155 -37
  37. package/src/components/JfbBasePosterBigSmall/Attr.js +1 -4
  38. package/src/components/JfbBasePosterBigSmall/JfbBasePosterBigSmall.vue +191 -67
  39. package/src/components/JfbBasePosterEntry/JfbBasePosterEntry.vue +90 -20
  40. package/src/components/JfbBasePosterType/FourScreen.vue +156 -18
  41. package/src/components/JfbBasePosterType/JfbBasePosterType.vue +0 -35
  42. package/src/components/JfbBaseSuccess/JfbBaseSuccess.vue +2 -1
  43. package/src/components/JfbBaseUserInfo/JfbBaseUserInfo.vue +2 -1
  44. package/src/components/JfbBaseVideo/JfbBaseVideo.vue +8 -7
  45. package/src/components/JfbBaseVideo/XdVideo.vue +0 -4
  46. package/src/components/JfbBaseWalletIndex/JfbBaseWalletIndex.vue +4 -13
  47. package/src/components/JfbBaseWalletItem/JfbBaseWalletItem.vue +5 -4
  48. package/src/components/JfbBaseWxAuthorize/JfbBaseWxAuthorize.vue +2 -2
  49. package/src/mixins/colorCardMixins.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.158",
3
+ "version": "1.0.159-beta1",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -4,13 +4,9 @@
4
4
  import cookie from "@/common/cookie";
5
5
  //#endif
6
6
  import storage from "@/common/storage";
7
-
8
7
  const settings = require('./../../settings');
9
- import Vue from 'vue';
10
-
11
8
  let __jfbAuthorize = null;
12
9
  import store from "@/store";
13
-
14
10
  import {Base64} from 'js-base64';
15
11
 
16
12
  class JfbAuthorize {
@@ -30,14 +26,25 @@ class JfbAuthorize {
30
26
  this.jumpToTimer = null;
31
27
  this.maxTime = 10;
32
28
 
29
+ //从地址栏中获取登录链接(webview)
30
+ //#ifdef H5
31
+ this.jfbLoginPath = cookie.get(`jfb-login-path-${this.siteId}`);
32
+ this.jfbCardPath = cookie.get(`jfb-card-path-${this.siteId}`);
33
+ this.jfbHost = cookie.get(`jfb-host-${this.siteId}`);
34
+ this.jfbDir = cookie.get(`jfb-dir-${this.siteId}`);
35
+ this.jfbAppType= cookie.get(`jfb-app-type-${this.siteId}`) || '';
36
+ //#endif
37
+
38
+
33
39
  this.config = Object.assign({}, {
34
40
  'user': 'JFB-CSRF-TOKEN-{siteID}',
35
- 'card': 'JFB-CARD-TOKEN-{siteID}',
36
41
  'refresh': 'JFB-REFRESH-TOKEN-{siteID}',
37
42
  'access': 'JFB-ACCESS-TOKEN',
38
- 'bizCode': 'JFB-CARD-CODE-{siteID}',
39
43
  'userAll':'JFB-USER-ALL-{siteID}',
40
- }, settings.token ? settings.token : {});
44
+ 'card': 'JFB-CARD-TOKEN-{siteID}',
45
+ 'bizCode': 'JFB-CARD-CODE-{siteID}',
46
+ 'cardExpire': 'JFB-CARD-EXPIRE-{siteID}',
47
+ }, settings.token ? settings.token : {}) ;
41
48
  }
42
49
 
43
50
  doMain() {
@@ -102,7 +109,7 @@ class JfbAuthorize {
102
109
  cookie.remove(codeKey, {domain: this.doMain()});
103
110
  //#endif
104
111
  storage.remove(key);
105
- storage.remove(codeKey);
112
+ if(key === 'card') storage.remove(codeKey);
106
113
  }
107
114
 
108
115
  /**
@@ -136,103 +143,205 @@ class JfbAuthorize {
136
143
  }
137
144
 
138
145
  /**
139
- * @description 跳转到卡登陆页面
140
- * @param $vm {Vue}
141
- * @param callbackUrl {String} 返回参数
146
+ * @description 检查是否在微信小程序webview环境下面
147
+ * @return {boolean}
142
148
  */
149
+ checkEnv(){
150
+ return window['__wxjs_environment'] === 'miniprogram'
151
+ }
143
152
 
144
- jumpToCardLogin($vm, callbackUrl) {
145
- let redirect_url = '';
146
- if (store.state.configProject.platform === 'mp.weixin') {
147
- redirect_url = $vm['$xdUniHelper'].parseURL().source;
148
- }
149
- if (store.state.configProject.platform === 'h5') {
150
- redirect_url = $vm.$route.fullPath;
151
- }
153
+ isCheckJfbWxDir(path){
154
+ path = path.replace('@site_domain@', '').split('/');
155
+ return path.length === 5 && path[1] === this.jfbDir;
156
+ }
152
157
 
158
+ /**
159
+ * @description 判断当前传入地址是否当前应用下面地址
160
+ * @param url
161
+ * @return {boolean} true =>不同应用 false=>相同应用
162
+ */
163
+ checkUrlIsNotCameDir(url) {
164
+ const urlArr = url.replace('@site_domain@', '').split('/');//pages/loading/loading | @site_domain@/$dir/main/mall/index
165
+ console.log('checkUrlIsNotCameDir.url', url,urlArr)
166
+ console.log('checkUrlIsNotCameDir.project', store.state.brandInfo)
167
+ return urlArr.length === 5 && urlArr[1] !== store.state.brandInfo.deploy_dir;
168
+ }
153
169
 
154
- //登陆地址与当前项目不再同一个app中处理
155
- //#ifdef H5
156
- if (!this.checkUrlIsCameDir(this.cardPath)) {
157
- redirect_url = `@site_domain@/${store.state.brandInfo.deploy_dir}${redirect_url}`
170
+ //#ifdef MP-WEIXIN
171
+ wxJumpToPath($vm,redirect_url, path, type = 'login'){
172
+ //微信小程序只能跳转应用内的地址
173
+ if(this.checkUrlIsNotCameDir(path)) {
174
+ let message = '请设置正确设置用户登录地址,微信小程序只能使用应用内地址';
175
+ if(type === 'card') message = '请设置正确设置用户票券登录地址,微信小程序只能使用应用内地址'
176
+ $vm.$xdAlert({content: message,time:4000})
177
+ throw new Error(message);
158
178
  }
159
- //#endif
160
179
 
161
- if (callbackUrl) redirect_url = callbackUrl;
180
+ let key = 'redirect_url';
181
+ let business_code = '';
162
182
 
163
- if (!this.cardPath) {
164
- console.error(this.cardPath);
165
- $vm.$xdAlert({
166
- content: "请设置卡登陆页面地址"
167
- })
168
- throw new Error('请设置卡登陆页面地址');
169
- }
183
+ if(type === 'card'){
184
+ key = 'inCallback';
170
185
 
171
- //设置页面过滤卡
172
- let business_code = '';
173
- if(store.state.pageBusinessCode) {
174
- business_code = `&jfb_business_code=${store.state.pageBusinessCode}`;
186
+ //设置过滤业务线
187
+ if(store.state.pageBusinessCode) {
188
+ business_code = `&jfb_business_code=${store.state.pageBusinessCode}`;
189
+ }
175
190
  }
176
191
 
177
- $vm['$xdUniHelper'].redirectTo({
178
- url: this.cardPath + `?inCallback=${Base64.encodeURI(redirect_url)}${business_code}`,
179
- });
192
+ let dir = store.state.brandInfo.deploy_dir;
193
+ let newPath = path.replace(`@site_domain@/${dir}/`, '/');
194
+
195
+ return newPath + `?${key}=${Base64.encodeURI(redirect_url)}${business_code}`;
196
+ }
197
+ //#endif
198
+
199
+ delPathSpParams($vm,redirect_url){
200
+ redirect_url = redirect_url.replace(`@site_domain@`, '')
201
+ let project = store.state.brandInfo;
202
+ let newPath = $vm.$xdUniHelper.parseURL(redirect_url);
203
+ let newParams = newPath.params;
204
+ if(newParams.ts) delete newParams.ts;
205
+ if(newParams.vs) delete newParams.vs;
206
+ if(newParams['lcdh']) delete newParams.lcdh;
207
+ if($vm.$xdUniHelper.isEmpty(newParams)) return `https://${project.host}${newPath.path}`
208
+ return `https://${project.host}${newPath.path}?${$vm.$xdUniHelper.jsonToParams(newParams)}`
180
209
  }
181
210
 
182
- checkUrlIsCameDir(url) {
183
- url = url.replace('@site_domain@', '').split('/');
184
- console.log('checkUrlIsCameDir', url)
185
- console.log('checkUrlIsCameDir', store.state.brandInfo)
186
- return url.length === 5 && url[1] === store.state.brandInfo.deploy_dir;
211
+ getCardPath(CardPath,redirect_url,business_code){
212
+ return CardPath + `?inCallback=${Base64.encodeURI(redirect_url)}${business_code}`;
187
213
  }
188
214
 
215
+
189
216
  /**
190
217
  * @description 跳转到用户登陆页面
191
218
  * @param $vm {Vue}
192
219
  * @param isRedirect {boolean}
193
220
  */
194
221
  jumpToUserLogin($vm,isRedirect = true) {
222
+
195
223
  let redirect_url = '';
196
- if (store.state.configProject.platform === 'mp.weixin') {
197
- redirect_url = $vm['$xdUniHelper'].parseURL().source;
224
+ let LoginPath = '';
225
+
226
+ //设置登录成功回跳地址
227
+ if(isRedirect) {
228
+ if (store.state.configProject.platform === 'mp.weixin') redirect_url = $vm['$xdUniHelper'].parseURL().source;
229
+ if (store.state.configProject.platform === 'h5') redirect_url = $vm.$route.fullPath;
198
230
  }
199
- if (store.state.configProject.platform === 'h5') {
200
- redirect_url = $vm.$route.fullPath;
231
+
232
+ //无配置登录地址地址提示
233
+ if (!this.LoginPath) {
234
+ $vm.$xdAlert({content: "请设置用户登陆页面地址"})
235
+ throw new Error('请设置用户登陆页面地址');
201
236
  }
202
- if(!isRedirect) redirect_url = '';
237
+
238
+
239
+ //#ifdef MP-WEIXIN
240
+ LoginPath = this.wxJumpToPath($vm,redirect_url, this.LoginPath);
241
+ //#endif
203
242
 
204
243
  //#ifdef H5
205
244
  //登陆地址与当前项目不再同一个app中处理
206
- if(!this.checkUrlIsCameDir(this.LoginPath)) {
207
- if(redirect_url) {
208
- redirect_url = `@site_domain@/${store.state.brandInfo.deploy_dir}${redirect_url}`;
209
- }
210
- else {
211
- redirect_url = `@site_domain@/${store.state.brandInfo.deploy_dir}/`;
212
- }
245
+ if(!this.checkUrlIsNotCameDir(this.LoginPath)) {
246
+ if(redirect_url) redirect_url = `@site_domain@/${store.state.brandInfo.deploy_dir}${redirect_url}`;
247
+ else redirect_url = `@site_domain@/${store.state.brandInfo.deploy_dir}/`;
213
248
  }
214
- //#endif
215
249
 
216
- //判断是否有登陆地址
217
- let LoginPath = redirect_url;
218
- if (LoginPath.indexOf(this.LoginPath) === -1) {
250
+ //判断redirect_url是否为登陆地址?
251
+ if (redirect_url.indexOf(this.LoginPath) === -1) {
219
252
  LoginPath = this.LoginPath + `?redirect_url=${Base64.encodeURI(redirect_url)}`;
220
253
  }
221
254
 
222
- if (!this.LoginPath) {
223
- console.error(this.LoginPath);
224
- $vm.$xdAlert({
225
- content: "请设置用户登陆页面地址"
226
- })
227
- throw new Error('请设置用户登陆页面地址');
255
+ //微信小程序webview环境直接返回小程序进行登录
256
+ if(this.checkEnv() && this.jfbLoginPath) {
257
+ //返回链接处理
258
+ if(redirect_url){
259
+ redirect_url = this.delPathSpParams($vm,redirect_url)
260
+ }
261
+
262
+ LoginPath = this.jfbLoginPath.replace(`@site_domain@/${this.jfbDir}/`, '/');
263
+ const jumpTo = LoginPath + `?redirect_url=${Base64.encodeURI(redirect_url)}`;
264
+ $vm['$xdUniHelper'].redirectTo({
265
+ url: `/pages/jumptomp/jumptomp?callback=${Base64.encodeURI(jumpTo)}`
266
+ });
267
+ return
228
268
  }
269
+ //#endif
229
270
 
230
- console.warn(`jumpToUserLogin.redirect.url: ${redirect_url} , login: ${LoginPath}`)
231
271
  $vm['$xdUniHelper'].redirectTo({
232
272
  url: LoginPath,
233
273
  });
234
274
  }
235
275
 
276
+ /**
277
+ * @description 跳转到卡登陆页面
278
+ * @param $vm {Vue}
279
+ * @param callbackUrl {String} 返回参数
280
+ */
281
+ jumpToCardLogin($vm, callbackUrl) {
282
+ let redirect_url = '';
283
+ let CardPath = ''; //登录地址
284
+ let jumpPath = ''; //跳转地址
285
+
286
+ //设置返回地址
287
+ if (store.state.configProject.platform === 'mp.weixin') redirect_url = $vm['$xdUniHelper'].parseURL().source;
288
+ if (store.state.configProject.platform === 'h5') redirect_url = $vm.$route.fullPath;
289
+
290
+
291
+ //#ifdef MP-WEIXIN
292
+ if (callbackUrl) redirect_url = callbackUrl;
293
+ jumpPath = this.wxJumpToPath($vm, redirect_url, this.cardPath, 'card');
294
+ //#endif
295
+
296
+ //#ifdef H5
297
+ CardPath = this.cardPath;
298
+
299
+ //当有callbackUrl参数时候,redirect_url地址直接使用callbackUrl参数
300
+ if (callbackUrl) redirect_url = callbackUrl;
301
+
302
+ //设置过滤业务线
303
+ let business_code = ''
304
+ if(store.state.pageBusinessCode) {
305
+ business_code = `&jfb_business_code=${store.state.pageBusinessCode}`;
306
+ }
307
+
308
+ //微信小程序webview模式处理(需要跳回微信小程序进行登录)
309
+ if(this.checkEnv()) {
310
+ if(this.jfbAppType === 'wxmp') {
311
+ const jumpTo = this.getCardPath(this.jfbCardPath, redirect_url, business_code)
312
+ $vm['$xdUniHelper'].redirectTo({
313
+ url: `/pages/jumptomp/jumptomp?callback=${Base64.encodeURI(jumpTo)}`
314
+ })
315
+ return;
316
+ }
317
+ else if(this.jfbAppType === 'h5') {
318
+ CardPath = this.jfbCardPath;
319
+ }
320
+ }
321
+
322
+ //无配置卡券登录页面
323
+ if (!CardPath) {
324
+ $vm.$xdAlert({content: "请设置卡登陆页面地址"})
325
+ throw new Error('请设置卡登陆页面地址');
326
+ }
327
+
328
+ //登陆地址与当前项目不再同一个app中处理
329
+ if (!this.checkEnv()) {
330
+ if(!this.checkUrlIsNotCameDir(this.cardPath)) {
331
+ redirect_url = `@site_domain@/${store.state.brandInfo.deploy_dir}${redirect_url}`
332
+ }
333
+ }
334
+
335
+ jumpPath = this.getCardPath(CardPath, redirect_url, business_code)
336
+ //#endif
337
+
338
+ //跳转到其他应用
339
+ console.warn(`jumpToCardLogin.path=${jumpPath}`);
340
+ $vm['$xdUniHelper'].redirectTo({
341
+ url: jumpPath,
342
+ });
343
+ }
344
+
236
345
  /**
237
346
  * @description 用户是否已登录卡信息
238
347
  * @param canCard {Boolean} 检查是否用登录购物车信息 默认:false
@@ -275,7 +384,7 @@ class JfbAuthorize {
275
384
  }
276
385
  return false;
277
386
  }
278
- //
387
+ //当前登录卡券有业务线线
279
388
  else{
280
389
  let bizCodeArr = bizCode.split(',');
281
390
  let currentBizCode = store.state.xnamespace;
@@ -367,7 +476,6 @@ class JfbAuthorize {
367
476
  * @param cb {Function|null}
368
477
  */
369
478
  setAllToken(result, cb = null) {
370
-
371
479
  //#ifdef MP-WEIXIN
372
480
  if(result['csrf_token_expire_in']) result['csrf_token_expire_in'] = Number(result['csrf_token_expire_in']);
373
481
  if(result['access_token_expire_in']) result['access_token_expire_in'] = Number(result['access_token_expire_in']);
@@ -380,14 +488,23 @@ class JfbAuthorize {
380
488
  //#endif
381
489
  }
382
490
 
491
+ /**
492
+ * @description 客户端设置所有卡登录信息
493
+ * @param result
494
+ * @param cb {Function|null}
495
+ */
383
496
  setCardToken(result,cb){
384
497
  //#ifdef MP-WEIXIN
498
+ if(result['card_expire_in']) result['card_expire_in'] = Number(result['card_expire_in']);
499
+ this.setToken('card',result['card_token'],{expires: result['card_expire_in'] / 60 / 60})
500
+ this.setToken('bizCode',result['business_codes'],{expires: result['card_expire_in'] / 60 / 60})
501
+ this.setToken('cardExpire',result['card_expire_time'],{expires: result['card_expire_in'] / 60 / 60})
385
502
  if (typeof cb === 'function') cb();
386
503
  //#endif
387
504
  }
388
505
 
389
506
  /**
390
- * @description 客户端删除所有token
507
+ * @description 客户端删除用户所有token
391
508
  * @param cb {Function|null}
392
509
  */
393
510
  removeAllToken(cb = null) {
@@ -396,8 +513,22 @@ class JfbAuthorize {
396
513
  this.removeToken('access');
397
514
  this.removeToken('refresh');
398
515
  this.removeToken('userAll');
516
+ if (typeof cb === 'function') cb();
399
517
  //#endif
400
518
  }
519
+ /**
520
+ * @description 客户端删除用户所卡券信息
521
+ * @param cb {Function|null}
522
+ */
523
+ removeAllCardToken(cb=null){
524
+ //#ifdef MP-WEIXIN
525
+ this.removeToken('card');
526
+ this.removeToken('bizCode');
527
+ this.removeToken('cardExpire');
528
+ if (typeof cb === 'function') cb();
529
+ //#endif
530
+ }
531
+
401
532
  }
402
533
 
403
534
  /**
@@ -327,7 +327,7 @@ export default {
327
327
  // cancel: false,
328
328
  // showClose: false,
329
329
  // confirmText: "我知道了",
330
- // $vm: this
330
+ // styles: this.styles,
331
331
  // });
332
332
  // return
333
333
  // }
@@ -458,7 +458,7 @@ export default {
458
458
  cancel: false,
459
459
  showClose: false,
460
460
  confirmText: "我知道了",
461
- $vm: this
461
+ styles: this.styles,
462
462
  });
463
463
  return;
464
464
  }
@@ -469,7 +469,7 @@ export default {
469
469
  data: {
470
470
  address_nnid: item.address_nnid,
471
471
  is_select: "Y",
472
- version: this.version
472
+ version: this.version
473
473
  },
474
474
  })
475
475
  .then((res) => {
@@ -525,7 +525,7 @@ export default {
525
525
  handleDel(item) {
526
526
  console.log("handleDel", item);
527
527
  this.$xdConfirm({
528
- $vm: this,
528
+ styles: this.styles,
529
529
  content: "确定删除当前配送地址吗?",
530
530
  width: "80%",
531
531
  success: (res) => {
@@ -274,8 +274,9 @@ export default {
274
274
  // #ifndef H5
275
275
  uni.setClipboardData({
276
276
  data: text,
277
+ showToast: false,
277
278
  success: () => {
278
- this.$xdAlert({ content: "复制成功" });
279
+ //this.$xdAlert({ content: "复制成功" });
279
280
  },
280
281
  });
281
282
  // #endif
@@ -66,7 +66,7 @@
66
66
  this.init(this.container);
67
67
  },
68
68
  methods: {
69
-
69
+
70
70
  /**
71
71
  * @description 监听事件变化
72
72
  * @param container {object} 业务组件对象自己
@@ -80,7 +80,7 @@
80
80
  this.shadow = (e.scrollTop > this.height ? this.height : e.scrollTop)/100;
81
81
  this.opacity = opacity < this.minOpacity ? this.minOpacity : opacity;
82
82
  },
83
-
83
+
84
84
  onJfbBack() {
85
85
  this.$xdUniHelper.navigateBack();
86
86
  }
@@ -102,7 +102,7 @@
102
102
  height: unit(90, rpx);
103
103
  padding: 0 unit(10, rpx);
104
104
  position: relative;
105
-
105
+
106
106
  &-icon {
107
107
  width: 1em;
108
108
  height: 1em;
@@ -112,12 +112,13 @@
112
112
  display: flex;
113
113
  justify-content: center;
114
114
  align-content: center;
115
+ align-items: center;
115
116
  flex-shrink: 0;
116
117
  position: relative;
117
118
  z-index: 2;
118
119
  background: #fff;
119
120
  }
120
-
121
+
121
122
  &-text {
122
123
  font-size: unit(54, rpx);
123
124
  padding-right: 1em;
@@ -125,7 +126,7 @@
125
126
  position: relative;
126
127
  z-index: 2;
127
128
  color: #666;
128
-
129
+
129
130
  & > view {
130
131
  width: 100%;
131
132
  text-align: center;
@@ -133,7 +134,7 @@
133
134
  font-size: unit(32, rpx);
134
135
  }
135
136
  }
136
-
137
+
137
138
  &-bg {
138
139
  background: #fff;
139
140
  position: absolute;
@@ -75,6 +75,7 @@
75
75
  :style="{ background: noticeBackgroundColor }"
76
76
  >
77
77
  <xd-notice-bar
78
+ style="width: 100%"
78
79
  :showIcon="true"
79
80
  :scrollable="true"
80
81
  :speed="20"
@@ -408,7 +409,9 @@ export default {
408
409
  })
409
410
  .then((res) => {
410
411
  if (res.list.length > 0) {
411
- this.notice = res.list[0].content;
412
+ if(res.list && res.list.length > 0) {
413
+ this.notice = this.$xdUniHelper.filterHtml(res.list[0].content);
414
+ }
412
415
  this.noticeStatus = true;
413
416
  }
414
417
  })
@@ -17,7 +17,11 @@
17
17
  <xd-form class="form-wrap" content-align="left" :paddingBetween="0">
18
18
  <xd-form-item content-align="left" labelWidth="60" leftIcon="iconpiao">
19
19
  <view class="card_wrap">
20
- <xd-form-input v-model="cardForm.card_number" placeholder="请输入票券号"></xd-form-input>
20
+ <xd-form-input
21
+ class="card_wrap_input"
22
+ v-model="cardForm.card_number"
23
+ placeholder="请输入票券号"
24
+ ></xd-form-input>
21
25
  <view
22
26
  class="scan_icon"
23
27
  @click="doScanCode"
@@ -64,6 +68,9 @@
64
68
  import extsMixins from "@/mixins/extsMixins";
65
69
  import { mapState } from "vuex"
66
70
  export default {
71
+ //#ifdef MP-WEIXIN
72
+ options: { styleIsolation: 'shared' },
73
+ //#endif
67
74
  name: "JfbBaseCardBindV2",
68
75
  components: {
69
76
  XdFontIcon,
@@ -136,7 +143,6 @@
136
143
  this.backUrl = getContainerPropsValue(container, "content.backUrl", {value: "/system/card/login"}).value;
137
144
  },
138
145
  handleBindSuccess(){
139
- debugger
140
146
  this.$xdAlert({
141
147
  content: "绑定成功",
142
148
  close: () => {
@@ -173,6 +179,7 @@
173
179
  },
174
180
 
175
181
  doScanCode(){
182
+ //#ifdef H5
176
183
  this.jwxSDK.scanQRCode({
177
184
  needResult: 1,
178
185
  scanType: ["qrCode", "barCode"],
@@ -197,28 +204,35 @@
197
204
  content: err.errMsg,
198
205
  });
199
206
  }
200
- })
201
- },
202
- onJfbScroll(options) {
203
- console.log('event.onJfbScroll', options)
204
- },
205
- onJfbReachBottom(options) {
206
- console.log('event.onJfbReachBottom', options)
207
- },
208
- onJfbShow(options) {
209
- console.log('event.onJfbShow', options)
210
- },
211
- onJfbHide(options) {
212
- console.log('event.onJfbHide', options)
207
+ });
208
+ //#endif
209
+ //#ifdef MP-WEIXIN
210
+ uni.scanCode({
211
+ scanType: ["qrCode"],
212
+ success: (res) => {
213
+ this.cardForm.card_qrcode = res.result;
214
+ jfbRootExec("qrCardBind", {
215
+ vm: this,
216
+ data: {
217
+ card_qrcode: res.result
218
+ }
219
+ }).then(res => {
220
+ this.handleBindSuccess()
221
+ }).catch(err => {
222
+ this.$xdLog.catch(err)
223
+ })
224
+ },
225
+ fail: (error) => {
226
+ this.$xdAlert({
227
+ content: error.errMsg,
228
+ });
229
+ },
230
+ });
231
+ //#endif
213
232
  },
233
+
214
234
  onJfbBack(options) {
215
- console.log('event.onJfbBack', options)
216
- },
217
- onJfbUpdate(...data) {
218
- console.log('event.onJfbUpdate', data)
219
- },
220
- onJfbCustomEvent(options) {
221
- console.log('event.onJfbReachBottom', options)
235
+ this.$xdUniHelper.redirectBack()
222
236
  },
223
237
  }
224
238
  }
@@ -233,7 +247,7 @@
233
247
  padding: 40rpx;
234
248
 
235
249
  .form-wrap{
236
- /deep/ .uni-forms-item__inner{
250
+ & /deep/ .uni-forms-item__inner {
237
251
  border-bottom: 1px solid #EEEEEE;
238
252
  padding-bottom: 0;
239
253
  margin-bottom: 24rpx;
@@ -243,14 +257,30 @@
243
257
  .card_wrap{
244
258
  display: flex;
245
259
  align-items: center;
260
+ justify-content: space-between;
261
+
262
+ & > .card_wrap_input {
263
+ flex: 1;
264
+ }
265
+ & > .scan_icon, & > .capture {
266
+ flex-shrink: 0;
267
+ }
246
268
  }
247
269
  .img_wrap{
248
270
  display: flex;
249
271
  align-items: center;
272
+ justify-content: space-between;
273
+
274
+ & > .card_wrap_input {
275
+ flex: 1;
276
+ }
277
+
250
278
  .capture{
251
279
  width: 180rpx;
252
- height: 80rpx;
280
+ height: 66rpx;
281
+ margin-left: 10rpx;
253
282
  background: #DDD;
283
+ flex-shrink: 0;
254
284
  }
255
285
  }
256
286
  .confirm_btn{