jufubao-base 1.0.159-beta1 → 1.0.159-beta10

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 (70) hide show
  1. package/package.json +1 -1
  2. package/src/components/JfbBaseAddress/JfbBaseAddress.vue +3 -2
  3. package/src/components/JfbBaseAfterOrderDetail/JfbBaseAfterOrderDetail.vue +3 -2
  4. package/src/components/JfbBaseAfterOrderList/JfbBaseAfterOrderList.vue +3 -2
  5. package/src/components/JfbBaseBack/JfbBaseBack.vue +3 -2
  6. package/src/components/JfbBaseBackground/JfbBaseBackground.vue +3 -2
  7. package/src/components/JfbBaseBlock/JfbBaseBlock.vue +3 -2
  8. package/src/components/JfbBaseCard/JfbBaseCard.vue +6 -5
  9. package/src/components/JfbBaseCardBindV2/JfbBaseCardBindV2.vue +3 -2
  10. package/src/components/JfbBaseCardDetail/JfbBaseCardDetail.vue +0 -1
  11. package/src/components/JfbBaseCardDetailEntry/Attr.js +22 -0
  12. package/src/components/JfbBaseCardDetailEntry/JfbBaseCardDetailEntry.vue +85 -35
  13. package/src/components/JfbBaseCardDisabled/JfbBaseCardDisabled.vue +3 -3
  14. package/src/components/JfbBaseCardDisabledEntry/JfbBaseCardDisabledEntry.vue +3 -4
  15. package/src/components/JfbBaseCardEntry/Attr.js +22 -1
  16. package/src/components/JfbBaseCardEntry/JfbBaseCardEntry.vue +89 -35
  17. package/src/components/JfbBaseCardInfo/JfbBaseCardInfo.vue +25 -4
  18. package/src/components/JfbBaseCardInfoEntry/Attr.js +22 -0
  19. package/src/components/JfbBaseCardInfoEntry/JfbBaseCardInfoEntry.vue +283 -262
  20. package/src/components/JfbBaseCardMerge/JfbBaseCardMerge.vue +3 -2
  21. package/src/components/JfbBaseCardMergeEntry/JfbBaseCardMergeEntry.vue +3 -2
  22. package/src/components/JfbBaseCardShift/JfbBaseCardShift.vue +3 -10
  23. package/src/components/JfbBaseCardShiftEntry/JfbBaseCardShiftEntry.vue +15 -18
  24. package/src/components/JfbBaseCardSweepInfo/JfbBaseCardSweepInfo.vue +3 -2
  25. package/src/components/JfbBaseCardV3/JfbBaseCardV3.vue +14 -14
  26. package/src/components/JfbBaseCity/JfbBaseCity.vue +3 -2
  27. package/src/components/JfbBaseClear/JfbBaseClear.vue +3 -2
  28. package/src/components/JfbBaseConList/JfbBaseConList.vue +4 -5
  29. package/src/components/JfbBaseConPhone/JfbBaseConPhone.vue +3 -2
  30. package/src/components/JfbBaseEntry/JfbBaseEntry.vue +4 -3
  31. package/src/components/JfbBaseExpressDetail/JfbBaseExpressDetail.vue +3 -4
  32. package/src/components/JfbBaseFastLink/JfbBaseFastLink.vue +17 -15
  33. package/src/components/JfbBaseFooter/JfbBaseFooter.vue +0 -1
  34. package/src/components/JfbBaseHeader/JfbBaseHeader.vue +3 -2
  35. package/src/components/JfbBaseLogin/JfbBaseLogin.vue +26 -9
  36. package/src/components/JfbBaseLoginForgetPwd/JfbBaseLoginForgetPwd.vue +6 -8
  37. package/src/components/JfbBaseLoginSetPwd/JfbBaseLoginSetPwd.vue +6 -3
  38. package/src/components/JfbBaseMapOverlay/JfbBaseMapOverlay.vue +6 -5
  39. package/src/components/JfbBaseMapSearch/JfbBaseMapSearch.vue +3 -2
  40. package/src/components/JfbBaseMergeUserCard/JfbBaseMergeUserCard.vue +28 -27
  41. package/src/components/JfbBaseMultipleExpress/JfbBaseMultipleExpress.vue +3 -4
  42. package/src/components/JfbBaseMy/JfbBaseMy.vue +3 -3
  43. package/src/components/JfbBaseMySetting/JfbBaseMySetting.vue +6 -4
  44. package/src/components/JfbBaseNotice/JfbBaseNotice.vue +6 -4
  45. package/src/components/JfbBaseNoticeBottom/JfbBaseNoticeBottom.vue +3 -2
  46. package/src/components/JfbBaseNoticeTop/JfbBaseNoticeTop.vue +3 -2
  47. package/src/components/JfbBaseOrderDetail/JfbBaseOrderDetail.vue +18 -29
  48. package/src/components/JfbBaseOrderList/JfbBaseOrderList.vue +8 -3
  49. package/src/components/JfbBasePay/JfbBasePay.vue +3 -2
  50. package/src/components/JfbBasePhoneCollect/JfbBasePhoneCollect.vue +22 -7
  51. package/src/components/JfbBasePhoneLogin/JfbBasePhoneLogin.vue +23 -7
  52. package/src/components/JfbBasePosterType/FourScreen.vue +12 -6
  53. package/src/components/JfbBaseRecharge/JfbBaseRecharge.vue +4 -4
  54. package/src/components/JfbBaseRechargeOrder/JfbBaseRechargeOrder.vue +3 -4
  55. package/src/components/JfbBaseRechargeOrderDetail/JfbBaseRechargeOrderDetail.vue +4 -7
  56. package/src/components/JfbBaseRechargeSuccess/JfbBaseRechargeSuccess.vue +6 -9
  57. package/src/components/JfbBaseSearch/JfbBaseSearch.vue +3 -2
  58. package/src/components/JfbBaseSuccess/JfbBaseSuccess.vue +3 -3
  59. package/src/components/JfbBaseUserCenter/JfbBaseUserCenter.vue +3 -2
  60. package/src/components/JfbBaseUserInfo/JfbBaseUserInfo.vue +3 -2
  61. package/src/components/JfbBaseUserOrder/JfbBaseUserOrder.vue +4 -3
  62. package/src/components/JfbBaseVideo/JfbBaseVideo.vue +6 -4
  63. package/src/components/JfbBaseWallet/JfbBaseWallet.vue +3 -2
  64. package/src/components/JfbBaseWalletDetail/JfbBaseWalletDetail.vue +5 -8
  65. package/src/components/JfbBaseWalletEffective/JfbBaseWalletEffective.vue +5 -8
  66. package/src/components/JfbBaseWalletIndex/JfbBaseWalletIndex.vue +3 -4
  67. package/src/components/JfbBaseWalletItem/JfbBaseWalletItem.vue +8 -17
  68. package/src/components/JfbBaseWebview/JfbBaseWebview.vue +4 -3
  69. package/src/components/JfbBaseWxAuthorize/JfbBaseWxAuthorize.vue +3 -2
  70. package/src/components/JfbBaseWxAuthorizeError/JfbBaseWxAuthorizeError.vue +3 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.159-beta1",
3
+ "version": "1.0.159-beta10",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -193,8 +193,9 @@ export default {
193
193
  },
194
194
  },
195
195
  watch: {
196
- container(value) {
197
- this.init(value);
196
+ container(value,oldValue) {
197
+ if(JSON.stringify(value) === JSON.stringify(oldValue)) return;
198
+ if (this.$configProject['isPreview']) this.init(value)
198
199
  },
199
200
  showAddress(val) {
200
201
  if (val === false) this.defaultValue = null;
@@ -178,8 +178,9 @@ export default {
178
178
  };
179
179
  },
180
180
  watch: {
181
- container(value) {
182
- this.init(value);
181
+ container(value,oldValue) {
182
+ if(JSON.stringify(value) === JSON.stringify(oldValue)) return;
183
+ if (this.$configProject['isPreview']) this.init(value)
183
184
  },
184
185
  },
185
186
  computed: {
@@ -162,8 +162,9 @@ export default {
162
162
  };
163
163
  },
164
164
  watch: {
165
- container(value) {
166
- this.init(value);
165
+ container(value,oldValue) {
166
+ if(JSON.stringify(value) === JSON.stringify(oldValue)) return;
167
+ if (this.$configProject['isPreview']) this.init(value)
167
168
  },
168
169
  },
169
170
  computed: {
@@ -55,8 +55,9 @@
55
55
  }
56
56
  },
57
57
  watch: {
58
- container(value) {
59
- this.init(value)
58
+ container(value,oldValue) {
59
+ if(JSON.stringify(value) === JSON.stringify(oldValue)) return;
60
+ if (this.$configProject['isPreview']) this.init(value)
60
61
  }
61
62
  },
62
63
  created() {
@@ -41,8 +41,9 @@ export default {
41
41
  };
42
42
  },
43
43
  watch: {
44
- container(value) {
45
- this.init(value);
44
+ container(value,oldValue) {
45
+ if(JSON.stringify(value) === JSON.stringify(oldValue)) return;
46
+ if (this.$configProject['isPreview']) this.init(value)
46
47
  },
47
48
  },
48
49
  destroyed() {
@@ -43,8 +43,9 @@
43
43
  }
44
44
  },
45
45
  watch: {
46
- container(value) {
47
- this.init(value)
46
+ container(value,oldValue) {
47
+ if(JSON.stringify(value) === JSON.stringify(oldValue)) return;
48
+ if (this.$configProject['isPreview']) this.init(value)
48
49
  }
49
50
  },
50
51
  created() {
@@ -255,7 +255,7 @@ export default {
255
255
  if(this.login_text_color) style['color'] = this.login_text_color;
256
256
  if(this.login_text_bg_color) style['backgroundColor'] = this.login_text_bg_color;
257
257
  if(this.login_text_radius) style['borderRadius'] = this.login_text_radius + 'rpx'
258
- return style;
258
+ return this.styleObjectToString(style);
259
259
  },
260
260
  lookStyle(){
261
261
  let style = { backgroundColor: this.cardLayout === '2'? '' : this.mainColor};
@@ -263,7 +263,7 @@ export default {
263
263
  if(this.look_text_color) style['color'] = this.look_text_color;
264
264
  if(this.look_text_bg_color) style['backgroundColor'] = this.look_text_bg_color;
265
265
  if(this.look_text_radius) style['borderRadius'] = this.look_text_radius + 'rpx';
266
- return style;
266
+ return this.styleObjectToString(style);
267
267
  }
268
268
  },
269
269
  watch: {
@@ -282,9 +282,10 @@ export default {
282
282
  })
283
283
 
284
284
  },
285
- container(value) {
286
- this.init(value)
287
- }
285
+ container(value,oldValue) {
286
+ if(JSON.stringify(value) === JSON.stringify(oldValue)) return;
287
+ if (this.$configProject['isPreview']) this.init(value)
288
+ },
288
289
  },
289
290
  data() {
290
291
  return {
@@ -103,8 +103,9 @@
103
103
  }
104
104
  },
105
105
  watch: {
106
- container(value) {
107
- this.init(value)
106
+ container(value,oldValue) {
107
+ if(JSON.stringify(value) === JSON.stringify(oldValue)) return;
108
+ if (this.$configProject['isPreview']) this.init(value)
108
109
  }
109
110
  },
110
111
  created() {
@@ -302,7 +302,6 @@ export default {
302
302
  width: "80%",
303
303
  isTitle: true,
304
304
  zIndex: 2000,
305
- vm: this,
306
305
  success: (res) => {
307
306
  if (res.confirm) {
308
307
  this.timeStr = ""
@@ -4,6 +4,28 @@ export default {
4
4
  style: [],
5
5
  advanced: [],
6
6
  content: [
7
+ {
8
+ label: '选择综合入口类型:',
9
+ ele: 'xd-site-select-list',
10
+ valueKey: 'entryGroupId',
11
+ value: 'default',
12
+ placeholder: '请选择综合入口类型',
13
+ multiple: false,
14
+ groupKey:'content',
15
+ className: 'input50',
16
+ rules: [
17
+ {required: true, message: '请选择综合入口类型', trigger: ['blur', 'change']}
18
+ ],
19
+ handleCustom({action, data}) {
20
+ XdBus.getParentApi('getEntryGroupOption')({key: Date.now()})
21
+ .then(res => {
22
+ data.cb(res.list)
23
+ })
24
+ .catch(error => {
25
+ console.error(error);
26
+ });
27
+ },
28
+ },
7
29
  {
8
30
  label: '票券解绑成功回跳地址:',
9
31
  ele: 'xd-select-pages-path',
@@ -74,7 +74,7 @@
74
74
  <view v-if="info.is_exchange==='Y'">
75
75
  <xd-button
76
76
  width="100%"
77
- @click="handleToShift"
77
+ @click="handleToShift()"
78
78
  size="small"
79
79
  type="primary"
80
80
  >券转换</xd-button>
@@ -82,7 +82,7 @@
82
82
  <view v-if="isShowUnbind">
83
83
  <xd-button
84
84
  width="100%"
85
- @click="handleUnBindCard"
85
+ @click="handleUnBindCard()"
86
86
  size="small"
87
87
  type="primary">解除绑定</xd-button>
88
88
  </view>
@@ -106,6 +106,7 @@ import XdPwPay from "./XdPwPay";
106
106
  import XdEditPwd from "./XdEditPwd";
107
107
  import XdUnit from "@/components/XdUnit/XdUnit";
108
108
  import XdButton from '@/components/XdButton/XdButton'
109
+ import {parsePath} from "@/utils/linkUrl";
109
110
  export default {
110
111
  name: "JfbBaseCardDetailEntry",
111
112
  components: {
@@ -121,6 +122,7 @@ export default {
121
122
  data() {
122
123
  return {
123
124
  userInfo: null, //用户信息(暂时不可用)
125
+ entryGroupId: '',//加载入口数据组别
124
126
 
125
127
  info: null,
126
128
  timeStr: "",
@@ -202,6 +204,8 @@ export default {
202
204
  init(container) {
203
205
  this.backUrl = getContainerPropsValue(container, "content.back_url", { value: "" }).value;
204
206
  this.shift_url = getContainerPropsValue(container, "content.shift_url", { value: "" }).value;
207
+ //'wechat_mini_program|default'
208
+ this.entryGroupId = getContainerPropsValue(container,"content.entryGroupId","default");
205
209
  },
206
210
  /**
207
211
  * @description 获取卡详情
@@ -212,6 +216,7 @@ export default {
212
216
  data: {
213
217
  card_number: this.card_number,
214
218
  is_show_entry_settings: "Y",
219
+ group_id: this.entryGroupId
215
220
  },
216
221
  })
217
222
  .then((res) => {
@@ -227,6 +232,9 @@ export default {
227
232
  100
228
233
  );
229
234
  }
235
+
236
+ res['site_entry_settings'] = this.filterNotSupportEntry(res['site_entry_settings']);
237
+
230
238
  if(res && res.site_entry_settings && res.site_entry_settings.length>0) {
231
239
  res.site_entry_settings = res.site_entry_settings.filter(item=>{
232
240
  item['image_url'] = getServiceUrl(item['image_url'])
@@ -314,59 +322,102 @@ export default {
314
322
  //#ifdef MP-WEIXIN
315
323
  if (this.jfbAuthorize !== null) {
316
324
  this.jfbAuthorize.setCardToken(res);
317
- this.handleToApp(entry);
325
+ this.handleClick(entry);
326
+ return
318
327
  }
319
328
  //#endif
329
+
320
330
  if (this.$configProject.isPreview) {
321
331
  console.log("handleBindLogin", "预览模式不跳转", this.inCallback);
322
332
  }
323
-
324
333
  else {
325
- this.handleToApp(entry);
334
+ this.handleClick(entry);
326
335
  }
327
336
  })
328
337
  .catch((res) => {
329
338
  this.$xdHideLoading();
330
339
  });
331
340
  },
332
- toApp(url){
333
- this.$xdUniHelper.redirectTo({
334
- url
335
- })
336
- },
337
- handleToApp(entry){
338
- let item, redirectUrl;
339
- try{
340
- item = JSON.parse(entry['redirect_data']);
341
- }catch (e) {
342
- return;
341
+
342
+ getCardPath(custom_redirect_data = {}){
343
+ //#ifdef H5
344
+ return null;
345
+ //#endif
346
+ //#ifdef MP-WEIXIN
347
+ const dir = custom_redirect_data.dir;
348
+ const actDir = this.projectAttr['deploy_dir'];
349
+ if(custom_redirect_data.appType === 'wxmp') {
350
+ if(dir === actDir) {
351
+ return {
352
+ cardPath: custom_redirect_data.path,
353
+ cardSelf: 'wxmp',
354
+ };
355
+ }
356
+ else return null;
343
357
  }
344
- const {dir, path, host} = item;
358
+ else if(custom_redirect_data.appType === 'h5'){
359
+ return {
360
+ cardPath: custom_redirect_data.site_url,
361
+ cardSelf: 'h5',
362
+ };
363
+ }
364
+ else return null;
365
+ //#endif
366
+ },
367
+
368
+
369
+ handleClick(entry){
370
+ const {dir, path, host, appType} = entry['redirect_data'];
371
+ let regHttp = /^(\/\/|http:\/\/|https:\/\/).+$/;
372
+ let regSp = /(-apiuri\/v)/;
373
+
374
+ if(!appType) entry.redirect_data.appType = 'h5';
345
375
  let nsp = Base64.encodeURI(JSON.stringify({business_code: entry['business_code']}));
346
376
 
347
377
  //外站配置地址
348
- if (entry.redirect_type === 'URL') {
349
- if (item['path'].indexOf('?') === -1) {
350
- redirectUrl = `${item['path']}?x-common=${nsp}&vs=${new Date().getTime()}`
351
- } else redirectUrl = `${item['path']}&x-common=${nsp}&vs=${new Date().getTime()}`;
352
- this.toApp(redirectUrl);
353
- return;
378
+ if(entry.redirect_type === 'URL') {
379
+ if(regHttp.test(entry.redirect_data['path']) || regSp.test(entry.redirect_data['path'])) {
380
+ this.$xdUniHelper.redirectTo({
381
+ url:`${entry.redirect_data['path']}?x-common=${nsp}&vs=${new Date().getTime()}${cardPathStr}`
382
+ }, false)
383
+ }
384
+ else {
385
+ console.error(`配置错误:${entry.redirect_data['path']}`);
386
+ throw new Error(`配置错误:${entry.redirect_data['path']}`)
387
+ }
388
+ return
354
389
  }
355
390
 
356
- //站内转换
357
- let jumpUrl = item.path;
358
- //#ifdef H5
359
- jumpUrl = `//${host}/${dir}${path}`;
360
- //#endif
361
-
362
- if (item['fixed_business_code'] === '') {
363
- redirectUrl = `${jumpUrl}?x-common=${nsp}&vs=${new Date().getTime()}`
391
+ //站内应用处理
392
+ let jumpUrl = path;
393
+ let cardPathStr = '';
394
+ const {deploy_dir} = this.projectAttr;
395
+ if(host === this.projectAttr.host && deploy_dir !== dir){
396
+ jumpUrl = `//${host}/${dir}${path}`;
397
+ //#ifdef MP-WEIXIN
398
+ jumpUrl = `https:${jumpUrl}`;
399
+ //#endif
364
400
  }
365
- else {
366
- redirectUrl = `${jumpUrl}?x-common=${nsp}&vs=${new Date().getTime()}`
401
+
402
+
403
+ //#ifdef MP-WEIXIN
404
+ //获取自定义卡券登录地址(微信小程序跳转到H5平台起作用)
405
+ if(entry.redirect_data.appType === 'h5') {
406
+ const custom_redirect_data = this.$xdUniHelper.checkVarType(entry['custom_redirect_data']) === 'object'?entry['custom_redirect_data']:{};
407
+ const cardPathObject = this.getCardPath(custom_redirect_data);
408
+ if(cardPathObject !== null) {
409
+ const {cardPath, cardSelf} =cardPathObject
410
+ if(cardPath) cardPathStr = `&card-login=${encodeURIComponent(cardPath)}&cardSelf=${cardSelf}`
411
+ }
367
412
  }
368
- this.toApp(redirectUrl);
413
+ //#endif
414
+
415
+ jumpUrl = `${jumpUrl}?x-common=${nsp}&vs=${new Date().getTime()}${cardPathStr}`;
416
+ console.warn(`entry.path:${jumpUrl}`);
417
+ if(regHttp.test(jumpUrl)) this.$xdUniHelper.redirectTo({url:jumpUrl}, false)
418
+ else this.$xdUniHelper.navigateTo({url:jumpUrl}, false)
369
419
  },
420
+
370
421
  handleOnClose() {
371
422
  this.editShow = false;
372
423
  },
@@ -391,7 +442,6 @@ export default {
391
442
  width: "80%",
392
443
  isTitle: true,
393
444
  zIndex: 2000,
394
- vm: this,
395
445
  success: (res) => {
396
446
  if (res.confirm) {
397
447
  this.timeStr = ""
@@ -115,8 +115,9 @@ export default {
115
115
  };
116
116
  },
117
117
  watch: {
118
- container(value) {
119
- this.init(value);
118
+ container(value,oldValue) {
119
+ if(JSON.stringify(value) === JSON.stringify(oldValue)) return;
120
+ if (this.$configProject['isPreview']) this.init(value)
120
121
  },
121
122
  },
122
123
  created() {
@@ -166,7 +167,6 @@ export default {
166
167
  width: "80%",
167
168
  isTitle: true,
168
169
  zIndex: 2000,
169
- vm: this,
170
170
  success: (res) => {
171
171
  if (res.confirm) {
172
172
  jfbRootExec("disabledCardUnbind", {
@@ -182,8 +182,9 @@ export default {
182
182
  },
183
183
  },
184
184
  watch: {
185
- container(value) {
186
- this.init(value);
185
+ container(value,oldValue) {
186
+ if(JSON.stringify(value) === JSON.stringify(oldValue)) return;
187
+ if (this.$configProject['isPreview']) this.init(value)
187
188
  },
188
189
  },
189
190
  created() {
@@ -231,7 +232,6 @@ export default {
231
232
  width: "80%",
232
233
  isTitle: true,
233
234
  zIndex: 2000,
234
- vm: this,
235
235
  success: (res) => {
236
236
  if (res.confirm) {
237
237
  let cardIds = this.cardOrgList.map(item=>{
@@ -264,7 +264,6 @@ export default {
264
264
  width: "80%",
265
265
  isTitle: true,
266
266
  zIndex: 2000,
267
- vm: this,
268
267
  success: (res) => {
269
268
  if (res.confirm) {
270
269
  jfbRootExec("disabledCardUnbindEntry", {
@@ -4,6 +4,28 @@ export default {
4
4
  style: [],
5
5
  advanced: [],
6
6
  content: [
7
+ {
8
+ label: '选择综合入口类型:',
9
+ ele: 'xd-site-select-list',
10
+ valueKey: 'entryGroupId',
11
+ value: 'default',
12
+ placeholder: '请选择综合入口类型',
13
+ multiple: false,
14
+ groupKey:'content',
15
+ className: 'input50',
16
+ rules: [
17
+ {required: true, message: '请选择综合入口类型', trigger: ['blur', 'change']}
18
+ ],
19
+ handleCustom({action, data}) {
20
+ XdBus.getParentApi('getEntryGroupOption')({key: Date.now()})
21
+ .then(res => {
22
+ data.cb(res.list)
23
+ })
24
+ .catch(error => {
25
+ console.error(error);
26
+ });
27
+ },
28
+ },
7
29
  {
8
30
  label: '提示内容:',
9
31
  ele: 'xd-site-news',
@@ -312,6 +334,5 @@ export default {
312
334
  },
313
335
  inline: false,
314
336
  },
315
-
316
337
  ],
317
338
  };
@@ -387,6 +387,8 @@ import { mapState, mapActions } from "vuex";
387
387
  import { getContainerPropsValue, isWechat,isQrCode } from "@/utils/xd.base";
388
388
  import XdNoticeBar from "@/components/XdNoticeBar/XdNoticeBar";
389
389
  import { Base64 } from "js-base64";
390
+ import getServiceUrl from "@/common/getServiceUrl";
391
+ import {parsePath} from "@/utils/linkUrl";
390
392
  const Color = require("color");
391
393
 
392
394
  export default {
@@ -414,8 +416,9 @@ export default {
414
416
  }
415
417
  },
416
418
  watch: {
417
- container(value) {
418
- this.init(value)
419
+ container(value,oldValue) {
420
+ if(JSON.stringify(value) === JSON.stringify(oldValue)) return;
421
+ if (this.$configProject['isPreview']) this.init(value)
419
422
  },
420
423
  tabIndex(){
421
424
  this.clearDefault();
@@ -434,6 +437,7 @@ export default {
434
437
  isPreview: false,
435
438
  noticeStatus: false,
436
439
  loadingCardList: true,
440
+ entryGroupId: '',//加载入口数据组别
437
441
 
438
442
  cutIndex: 1,
439
443
  tabIndex: 1,
@@ -466,9 +470,9 @@ export default {
466
470
  this.init(this.container);
467
471
  this.noticeBackgroundColor = Color(this.warningColor).alpha(0.2).toString();
468
472
  this.isPreview = this.$configProject.isPreview;
473
+ this.isQrCode = isQrCode(this);
469
474
 
470
475
  //#ifdef H5
471
- this.isQrCode = isQrCode(this);
472
476
  if (!this.$configProject.isPreview) {
473
477
  jfbRootExec("getH5WxAuthorize", {
474
478
  vm: this,
@@ -487,7 +491,6 @@ export default {
487
491
  methods: {
488
492
 
489
493
  init(container){
490
- //设置
491
494
  this.cardLayout = getContainerPropsValue(container,"content.cardLayout","1");
492
495
  this.changeUrl = getContainerPropsValue(container,"content.change_url",{value: ""}).value;
493
496
  this.disabledUrl = getContainerPropsValue(container,"content.disabled_url",{value: ""}).value;
@@ -497,6 +500,8 @@ export default {
497
500
  this.login_name = getContainerPropsValue(container, "content.login_name", "登录");
498
501
  this.isShowCode = getContainerPropsValue(container, "content.isShowCode", "Y");
499
502
  this.bindCard = getContainerPropsValue(container,"content.bindCard","1");
503
+ //'wechat_mini_program|default'
504
+ this.entryGroupId = getContainerPropsValue(container,"content.entryGroupId","default");
500
505
  },
501
506
 
502
507
  handleToLink(path) {
@@ -578,6 +583,7 @@ export default {
578
583
  /**
579
584
  * @description 已绑定卡登录
580
585
  * @param item
586
+ * @param entry
581
587
  */
582
588
  handleBindLogin(item , entry) {
583
589
  //卡券登录
@@ -593,10 +599,12 @@ export default {
593
599
  })
594
600
  .then((res) => {
595
601
  this.$xdHideLoading();
602
+
596
603
  //#ifdef MP-WEIXIN
597
604
  if (this.jfbAuthorize !== null) {
598
605
  this.jfbAuthorize.setCardToken(res);
599
- this.handleToApp(entry);
606
+ this.handleClick(entry);
607
+ return
600
608
  }
601
609
  //#endif
602
610
  if (this.$configProject.isPreview) {
@@ -604,7 +612,7 @@ export default {
604
612
  }
605
613
 
606
614
  else {
607
- this.handleToApp(entry);
615
+ this.handleClick(entry);
608
616
  }
609
617
  })
610
618
  .catch((res) => {
@@ -619,43 +627,84 @@ export default {
619
627
  }, false);
620
628
  }
621
629
  },
622
- toApp(url){
623
- this.$xdUniHelper.redirectTo({
624
- url
625
- })
626
- },
627
- handleToApp(entry){
628
- let item, redirectUrl;
629
- try{
630
- item = JSON.parse(entry['redirect_data']);
631
- }catch (e) {
632
- return;
630
+
631
+
632
+ getCardPath(custom_redirect_data = {}){
633
+ //#ifdef H5
634
+ return null;
635
+ //#endif
636
+ //#ifdef MP-WEIXIN
637
+ const dir = custom_redirect_data.dir;
638
+ const actDir = this.projectAttr['deploy_dir'];
639
+ if(custom_redirect_data.appType === 'wxmp') {
640
+ if(dir === actDir) {
641
+ return {
642
+ cardPath: custom_redirect_data.path,
643
+ cardSelf: 'wxmp',
644
+ };
645
+ }
646
+ else return null;
633
647
  }
634
- const {dir, path, host} = item;
648
+ else if(custom_redirect_data.appType === 'h5'){
649
+ return {
650
+ cardPath: custom_redirect_data.site_url,
651
+ cardSelf: 'h5',
652
+ };
653
+ }
654
+ else return null;
655
+ //#endif
656
+ },
657
+
658
+ handleClick(entry){
659
+ const {dir, path, host, appType} = entry['redirect_data'];
660
+ let regHttp = /^(\/\/|http:\/\/|https:\/\/).+$/;
661
+ let regSp = /(-apiuri\/v)/;
662
+
663
+ if(!appType) entry.redirect_data.appType = 'h5';
635
664
  let nsp = Base64.encodeURI(JSON.stringify({business_code: entry['business_code']}));
636
665
 
637
666
  //外站配置地址
638
- if (entry.redirect_type === 'URL') {
639
- if (item['path'].indexOf('?') === -1) {
640
- redirectUrl = `${item['path']}?x-common=${nsp}&vs=${new Date().getTime()}`
641
- } else redirectUrl = `${item['path']}&x-common=${nsp}&vs=${new Date().getTime()}`;
642
- this.toApp(redirectUrl);
643
- return;
667
+ if(entry.redirect_type === 'URL') {
668
+ if(regHttp.test(entry.redirect_data['path']) || regSp.test(entry.redirect_data['path'])) {
669
+ this.$xdUniHelper.redirectTo({
670
+ url:`${entry.redirect_data['path']}?x-common=${nsp}&vs=${new Date().getTime()}${cardPathStr}`
671
+ }, false)
672
+ }
673
+ else {
674
+ console.error(`配置错误:${entry.redirect_data['path']}`);
675
+ throw new Error(`配置错误:${entry.redirect_data['path']}`)
676
+ }
677
+ return
644
678
  }
645
679
 
646
- //站内转换
647
- let jumpUrl = item.path;
648
- //#ifdef H5
649
- jumpUrl = `//${host}/${dir}${path}`;
650
- //#endif
651
-
652
- if (item['fixed_business_code'] === '') {
653
- redirectUrl = `${jumpUrl}?x-common=${nsp}&vs=${new Date().getTime()}`
680
+ //站内应用处理
681
+ let jumpUrl = path;
682
+ let cardPathStr = '';
683
+ const {deploy_dir} = this.projectAttr;
684
+ if(host === this.projectAttr.host && deploy_dir !== dir){
685
+ jumpUrl = `//${host}/${dir}${path}`;
686
+ //#ifdef MP-WEIXIN
687
+ jumpUrl = `https:${jumpUrl}`;
688
+ //#endif
654
689
  }
655
- else {
656
- redirectUrl = `${jumpUrl}?x-common=${nsp}&vs=${new Date().getTime()}`
690
+
691
+
692
+ //#ifdef MP-WEIXIN
693
+ //获取自定义卡券登录地址(微信小程序跳转到H5平台起作用)
694
+ if(entry.redirect_data.appType === 'h5') {
695
+ const custom_redirect_data = this.$xdUniHelper.checkVarType(entry['custom_redirect_data']) === 'object'?entry['custom_redirect_data']:{};
696
+ const cardPathObject = this.getCardPath(custom_redirect_data);
697
+ if(cardPathObject !== null) {
698
+ const {cardPath, cardSelf} =cardPathObject
699
+ if(cardPath) cardPathStr = `&card-login=${encodeURIComponent(cardPath)}&cardSelf=${cardSelf}`
700
+ }
657
701
  }
658
- this.toApp(redirectUrl);
702
+ //#endif
703
+
704
+ jumpUrl = `${jumpUrl}?x-common=${nsp}&vs=${new Date().getTime()}${cardPathStr}`;
705
+ console.warn(`entry.path:${jumpUrl}`);
706
+ if(regHttp.test(jumpUrl)) this.$xdUniHelper.redirectTo({url:jumpUrl}, false)
707
+ else this.$xdUniHelper.navigateTo({url:jumpUrl}, false)
659
708
  },
660
709
 
661
710
  toDetail(item, out=true) {
@@ -693,6 +742,7 @@ export default {
693
742
  if(options['jfb_business_code']) {
694
743
  params['card_business_code'] = options['jfb_business_code'];
695
744
  }
745
+ if(this.entryGroupId) params['group_id'] = this.entryGroupId;
696
746
  this.$xdShowLoading({});
697
747
  jfbRootExec("getListEntryCardBind", {
698
748
  vm: this,
@@ -714,6 +764,10 @@ export default {
714
764
  ),
715
765
  };
716
766
  });
767
+
768
+ //过滤入口配置
769
+ res['site_entry_settings'] = this.filterNotSupportEntry(res['site_entry_settings']);
770
+
717
771
  this.ajaxCardList = res;
718
772
  this.hasChangeStatus = this.getCardGroupItem(this.ajaxCardList.list.filter((item) => {
719
773
  return item["is_exchange"] === "Y";