jufubao-base 1.0.158-beta4 → 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 (50) 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 +21 -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/JfbBaseCardSweepInfo/JfbBaseCardSweepInfo.vue +7 -1
  20. package/src/components/JfbBaseCardV2/JfbBaseCardV2.vue +34 -18
  21. package/src/components/JfbBaseEntry/Attr.js +22 -0
  22. package/src/components/JfbBaseEntry/JfbBaseEntry.vue +76 -13
  23. package/src/components/JfbBaseFastLink/JfbBaseFastLink.vue +27 -18
  24. package/src/components/JfbBaseFastLink/XdFastNav.vue +2 -2
  25. package/src/components/JfbBaseLogin/JfbBaseLogin.vue +2 -2
  26. package/src/components/JfbBaseLoginForgetPwd/JfbBaseLoginForgetPwd.vue +1 -1
  27. package/src/components/JfbBaseLoginSetPwd/JfbBaseLoginSetPwd.vue +3 -3
  28. package/src/components/JfbBaseMapOverlay/JfbBaseMapOverlay.vue +13 -0
  29. package/src/components/JfbBaseMapOverlay/XdMapOverlay.vue +52 -37
  30. package/src/components/JfbBaseMultipleExpress/JfbBaseMultipleExpress.vue +2 -1
  31. package/src/components/JfbBaseNotice/Attr.js +0 -2
  32. package/src/components/JfbBaseNotice/JfbBaseNotice.vue +30 -10
  33. package/src/components/JfbBaseNotice/XdNoticeBar.vue +17 -1
  34. package/src/components/JfbBaseOrderDetail/JfbBaseOrderDetail.vue +2 -2
  35. package/src/components/JfbBaseOrderList/JfbBaseOrderList.vue +1 -1
  36. package/src/components/JfbBasePoster/JfbBasePoster.vue +118 -18
  37. package/src/components/JfbBasePoster/MoreScreen.vue +155 -37
  38. package/src/components/JfbBasePosterBigSmall/Attr.js +1 -4
  39. package/src/components/JfbBasePosterBigSmall/JfbBasePosterBigSmall.vue +191 -67
  40. package/src/components/JfbBasePosterEntry/JfbBasePosterEntry.vue +90 -20
  41. package/src/components/JfbBasePosterType/FourScreen.vue +156 -18
  42. package/src/components/JfbBasePosterType/JfbBasePosterType.vue +0 -35
  43. package/src/components/JfbBaseSuccess/JfbBaseSuccess.vue +2 -1
  44. package/src/components/JfbBaseUserInfo/JfbBaseUserInfo.vue +2 -1
  45. package/src/components/JfbBaseVideo/JfbBaseVideo.vue +8 -7
  46. package/src/components/JfbBaseVideo/XdVideo.vue +0 -4
  47. package/src/components/JfbBaseWalletIndex/JfbBaseWalletIndex.vue +4 -13
  48. package/src/components/JfbBaseWalletItem/JfbBaseWalletItem.vue +5 -4
  49. package/src/components/JfbBaseWxAuthorize/JfbBaseWxAuthorize.vue +2 -2
  50. package/src/mixins/colorCardMixins.js +1 -1
@@ -160,7 +160,7 @@ export default {
160
160
  },
161
161
  handleUnBindCard(item) {
162
162
  this.$xdConfirm({
163
- $vm: this,
163
+ styles: this.styles,
164
164
  content: "您确定要解除绑定票券吗",
165
165
  title: "系统提示",
166
166
  width: "80%",
@@ -11,7 +11,7 @@
11
11
  v-if="isEditx && active"
12
12
  >
13
13
  <view class="jfb-base-card-disabled-entry__edit-icon" @click="delEdit"
14
- >删除</view
14
+ >删除</view
15
15
  >
16
16
  </view>
17
17
  <!-- #endif -->
@@ -178,7 +178,7 @@ export default {
178
178
  return this.fixedStyle({height: 0, zIndex: 111});
179
179
  },
180
180
  emptyBg() {
181
- return this.getNoData();
181
+ return this.getNoData();
182
182
  },
183
183
  },
184
184
  watch: {
@@ -195,7 +195,6 @@ export default {
195
195
  this.getCardList();
196
196
  },
197
197
 
198
-
199
198
  getCardList() {
200
199
  this.$xdShowLoading({});
201
200
  jfbRootExec("getDisableCardListEntry", {vm: this, data: {is_all: "Y", is_show_entry_settings: 'Y'},})
@@ -226,7 +225,7 @@ export default {
226
225
 
227
226
  handleAllUnBindCard(){
228
227
  this.$xdConfirm({
229
- $vm: this,
228
+ styles: this.styles,
230
229
  content: "您确定要解除绑定所有票券吗?",
231
230
  title: "系统提示",
232
231
  width: "80%",
@@ -259,7 +258,7 @@ export default {
259
258
 
260
259
  handleUnBindCard(item) {
261
260
  this.$xdConfirm({
262
- $vm: this,
261
+ styles: this.styles,
263
262
  content: "您确定要解除绑定票券吗?",
264
263
  title: "系统提示",
265
264
  width: "80%",
@@ -76,6 +76,7 @@
76
76
  :style="{ background: noticeBackgroundColor }"
77
77
  >
78
78
  <xd-notice-bar
79
+ style="width: 100%"
79
80
  :showIcon="true"
80
81
  :scrollable="true"
81
82
  :speed="20"
@@ -37,15 +37,13 @@
37
37
  :placeholder="card_pwd_placeholder"
38
38
  />
39
39
  <xd-font-icon
40
- @click="isPassword = !isPassword"
40
+ @click="handleIcon()"
41
41
  :icon="isPassword ? 'iconbiyan' : 'iconchakan'"
42
42
  ></xd-font-icon>
43
43
  </view>
44
44
  </view>
45
45
  <view class="jfb-base-card-info__body-footer" :style="prod_bottom">
46
- <xd-button type="primary" width="360rpx" @click="handleGetInfo"
47
- >确认</xd-button
48
- >
46
+ <xd-button type="primary" width="360rpx" @click="handleGetInfo">确认</xd-button>
49
47
  </view>
50
48
  </view>
51
49
 
@@ -53,7 +51,7 @@
53
51
  <view>
54
52
  <view
55
53
  class="jfb-base-card-info__body-info"
56
- v-for="(item, index) in valueKey"
54
+ v-for="(item, index) in showValueKey"
57
55
  :key="index"
58
56
  >
59
57
  <view class="jfb-base-card-info__body-info-label">{{item.label}}</view>
@@ -78,15 +76,12 @@
78
76
  <view
79
77
  v-if="info.other_card_point && info.card_point_type !== 1"
80
78
  class="jfb-base-card-info__body-residue-reach"
81
- >购买其他物品可抵:{{ info.other_card_point }}</view
82
- >
79
+ >购买其他物品可抵:{{ info.other_card_point }}</view>
83
80
  </view>
84
81
  <view
85
82
  class="jfb-base-card-info__body-residue-business"
86
83
  v-if="info.card_point_type !== 1"
87
- >
88
- 所属业务线:{{ info.main_business_code_name }}
89
- </view>
84
+ >所属业务线:{{ info.main_business_code_name }}</view>
90
85
  </view>
91
86
  <view :style="{ height: '100rpx' }"></view>
92
87
  </view>
@@ -129,18 +124,10 @@ export default {
129
124
  label: "票券号码",
130
125
  key: "card_number",
131
126
  },
132
- // {
133
- // label: "票券类型",
134
- // key: "unit",
135
- // },
136
127
  {
137
128
  label: "票券状态",
138
129
  key: "card_status_name",
139
130
  },
140
- // {
141
- // label: "票券转换",
142
- // key: "is_exchange_name",
143
- // },
144
131
  {
145
132
  label: "有效期",
146
133
  key: "end_time",
@@ -175,10 +162,19 @@ export default {
175
162
  return this.is_show_balance === "Y";
176
163
  }
177
164
  return true;
165
+ },
166
+ showValueKey(){
167
+ if(this.info && this.info.is_expired === "Y"){
168
+ return this.valueKey.filter(item => item.key !== "end_time");
169
+ }
170
+ return this.valueKey;
178
171
  }
179
172
  },
180
173
  created() {},
181
174
  methods: {
175
+ handleIcon(){
176
+ this.isPassword = !this.isPassword
177
+ },
182
178
  toShowCouponDialog(){
183
179
  if(this.info){
184
180
  jfbRootFnExec(this, 'onCustomEvent')("@showBaseConDialog", {user_card_number: this.info.card_number})
@@ -250,7 +246,7 @@ export default {
250
246
  //卡券已被自己绑定时的弹框
251
247
  handleBindConfirm(){
252
248
  this.$xdConfirm({
253
- $vm: this,
249
+ styles: this.styles,
254
250
  width: '90%',
255
251
  content: '您已绑定该票券,无需再次绑定',
256
252
  confirmText: '我的票券',
@@ -287,6 +283,12 @@ export default {
287
283
  onJfbLoad(options) {
288
284
  this.init();
289
285
  this.qrcode = options.qrcode;
286
+ //#ifdef MP-WEIXIN
287
+ if(options.qrcode) {
288
+ this.qrcode = decodeURIComponent(options.qrcode);
289
+ }
290
+
291
+ //#endif
290
292
  if(options.inCallback) {
291
293
  this.inCallbackUrlOrg = options.inCallback;
292
294
  }
@@ -194,7 +194,7 @@ export default {
194
194
  handleToLink() {
195
195
  if(this.info.card_point===0) {
196
196
  this.$xdConfirm({
197
- $vm: this,
197
+ styles: this.styles,
198
198
  content: "票券余额为0,是否确认绑定?",
199
199
  width: "80%",
200
200
  success: (res) => {
@@ -269,7 +269,7 @@ export default {
269
269
  //卡券已被自己绑定时的弹框
270
270
  handleBindConfirm(){
271
271
  this.$xdConfirm({
272
- $vm: this,
272
+ styles: this.styles,
273
273
  width: '90%',
274
274
  content: '您已绑定该票券,无需再次绑定',
275
275
  confirmText: '我的票券',
@@ -308,6 +308,9 @@ export default {
308
308
  onJfbLoad(options) {
309
309
  this.init();
310
310
  this.qrcode = options.qrcode;
311
+ //#ifdef MP-WEIXIN
312
+ this.qrcode = decodeURIComponent(options.qrcode);
313
+ //#endif
311
314
  if(options.inCallback) {
312
315
  this.inCallbackUrlOrg = options.inCallback;
313
316
  }
@@ -203,7 +203,7 @@ export default {
203
203
  this.$xdConfirm({
204
204
  title: "是否确认合并卡",
205
205
  isHtml: true,
206
- $vm: this,
206
+ styles: this.styles,
207
207
  content: `转出卡号:${
208
208
  this.mergeForm.from_card_number
209
209
  }(剩余点数:${this.$xdUniHelper.divisionFloatNumber(
@@ -40,13 +40,14 @@
40
40
  </view>
41
41
  </view>
42
42
  <view class="merge-item" :style="{background: themeInStyle['color']}">
43
- <view class="merge-item-box" :style="{backgroundImage: `url(${themeInStyle})`}">
44
- <view class="merge-item-title">
43
+ <view class="merge-item-box" :style="{backgroundImage: `url(//img.jufubao.cn/component/card/mergbg.jpg)`}">
44
+ <view class="merge-item-title" :style="{background: themeOutStyle['color']}">
45
45
  <xd-font-icon icon="iconzhuanru"></xd-font-icon>
46
46
  <view>转入的票券</view>
47
47
  </view>
48
48
  <view>
49
49
  <xd-select
50
+ v-if="toListLoading"
50
51
  :disabled="toList.length === 0"
51
52
  :key="randomKey"
52
53
  :height="66"
@@ -88,10 +89,11 @@
88
89
  <view class="bottom_btn-mask"></view>
89
90
  <view class="bottom_btn" :style="prod_bottom">
90
91
  <xd-button
92
+ v-if="btnLoading"
91
93
  :key="disabledKey"
92
94
  :disabled="disabled"
93
95
  @click="handleToSubmit"
94
- width="90%"
96
+ style="width: 90%"
95
97
  :type="disabled ?'info': 'primary'"
96
98
  >合并</xd-button>
97
99
  </view>
@@ -137,9 +139,11 @@ export default {
137
139
  toList: [],
138
140
  fromSelect: null,
139
141
  toSelect: null,
140
- randomKey: Date.now(),
142
+ randomKey:'randomKey',
141
143
  valid_code:'',
142
144
  valid_token: 'valid_token',
145
+ toListLoading: true,
146
+ btnLoading: true,
143
147
 
144
148
 
145
149
  content: "",
@@ -178,7 +182,10 @@ export default {
178
182
  },
179
183
 
180
184
  disabled(){
181
- this.disabledKey = Date.now();
185
+ this.btnLoading = false;
186
+ setTimeout(()=>{
187
+ this.btnLoading = true;
188
+ },10)
182
189
  return this.fromSelect === null || this.toSelect === null;
183
190
  },
184
191
  },
@@ -194,7 +201,6 @@ export default {
194
201
  this.switchValidToken();
195
202
  this.validImageAPIUrl = this.brandInfo["api_host"] + "/common/v1/valid_code/image/show";
196
203
  this.contentBackgroundColor = Color(this.warningColor).alpha(0.2).toString();
197
-
198
204
  },
199
205
  methods: {
200
206
  onJfbLoad(options) {
@@ -251,14 +257,6 @@ export default {
251
257
  },
252
258
 
253
259
  handleToSubmit() {
254
- // if (!this.valid_code) {
255
- // uni.showToast({
256
- // title: "验证码不能为空!",
257
- // icon: "none",
258
- // });
259
- // return;
260
- // }
261
-
262
260
  let outPrice = this.$xdUniHelper.divisionFloatNumber(this.fromSelect.card_point, 100);
263
261
  let outHtml = `${this.fromSelect.value}(剩余:${outPrice})`;
264
262
  let inPrice = this.$xdUniHelper.divisionFloatNumber(this.toSelect.card_point, 100);
@@ -266,7 +264,7 @@ export default {
266
264
  this.$xdConfirm({
267
265
  title: "是否确认合并票券",
268
266
  isHtml: true,
269
- $vm: this,
267
+ styles: this.styles,
270
268
  content: `<div class="label-value"><div><span>转出票券:</span><span>${outHtml}</span></div><div><span>转入票券:</span><span>${inHtml}</span></div></div>`,
271
269
  success: (action) => {
272
270
  let params = {
@@ -295,6 +293,8 @@ export default {
295
293
  });
296
294
  },
297
295
  handleChangeFrom(select) {
296
+ this.toListLoading = false;
297
+ this.randomKey = null;
298
298
  this.fromSelect = select.item;
299
299
  jfbRootExec("toCardListEntry", {vm: this, data: {card_number: select.item.value,},})
300
300
  .then((res) => {
@@ -308,7 +308,11 @@ export default {
308
308
  name: item.card_type_name
309
309
  };
310
310
  });
311
- this.randomKey = Date.now();
311
+ this.randomKey = this.$xdUniHelper.randomChar(20);
312
+ setTimeout(()=>{
313
+ this.toListLoading = true;
314
+ },50)
315
+
312
316
  })
313
317
  .catch((err) => {
314
318
  this.$xdLog.catch(err)
@@ -159,7 +159,7 @@ export default {
159
159
  this.$xdConfirm({
160
160
  title: "是否确认转换",
161
161
  isHtml: true,
162
- $vm: this,
162
+ styles: this.styles,
163
163
  content:content,
164
164
  success:(action)=>{
165
165
  if(action.confirm) {
@@ -219,7 +219,7 @@ export default {
219
219
  this.$xdConfirm({
220
220
  title: "是否确认转换",
221
221
  isHtml: true,
222
- $vm: this,
222
+ styles: this.styles,
223
223
  content:content,
224
224
  success:(action)=>{
225
225
  if(action.confirm) {
@@ -20,7 +20,7 @@
20
20
  <view>
21
21
  <view
22
22
  class="jfb-base-card-sweep-info__body-info"
23
- v-for="(item, index) in valueKey"
23
+ v-for="(item, index) in showValueKey"
24
24
  :key="index"
25
25
  >
26
26
  <view class="jfb-base-card-sweep-info__body-info-label">{{item.label}}</view>
@@ -129,6 +129,12 @@ export default {
129
129
  return this.is_show_balance === "Y";
130
130
  }
131
131
  return true;
132
+ },
133
+ showValueKey(){
134
+ if(this.info.is_expired === "Y"){
135
+ return this.valueKey.filter(item => item.key !== "end_time");
136
+ }
137
+ return this.valueKey;
132
138
  }
133
139
  },
134
140
  created() {
@@ -82,22 +82,13 @@
82
82
  </view>
83
83
  <view class="jfb-base-card__body-card-item-right-bottom">
84
84
  <view class="jfb-base-card__body-card-item-right-bottom-info">
85
- <view
86
- class="jfb-base-card__body-card-item-right-bottom-info-residue"
87
- >
88
- 剩余{{ item.unit }}数:{{ item.card_point }}{{ item.unit }}
89
- </view>
90
- <view
91
- class="jfb-base-card__body-card-item-right-bottom-info-deduction"
92
- >
93
- 购买其他物品可抵:{{ item.other_card_point }}
94
- </view>
85
+ <view class="jfb-base-card__body-card-item-right-bottom-info-residue">剩余{{ item.unit }}数:{{ item.card_point }}{{ item.unit }}</view>
86
+ <view class="jfb-base-card__body-card-item-right-bottom-info-deduction">购买其他物品可抵:{{ item.other_card_point }}</view>
95
87
  </view>
96
88
  <view
97
89
  @click.stop="toDetail(item)"
98
90
  :style="{ background: mainColor }"
99
- >查看</view
100
- >
91
+ >查看</view>
101
92
  </view>
102
93
  </view>
103
94
  </view>
@@ -106,8 +97,14 @@
106
97
  <view :style="{height:'128rpx'}"></view>
107
98
  <view class="bottom_fix" :style="button_bottom">
108
99
  <view>
100
+ <!-- #ifdef MP-WEIXIN-->
101
+ <view><xd-button type="primary" @click="toBindCard">绑定新卡</xd-button></view>
102
+ <view><xd-button type="primary" @click="toOrderList">我的订单</xd-button></view>
103
+ <!-- #endif-->
104
+ <!-- #ifdef H5-->
109
105
  <xd-button type="primary" @click="toBindCard">绑定新卡</xd-button>
110
106
  <xd-button type="primary" @click="toOrderList">我的订单</xd-button>
107
+ <!-- #endif-->
111
108
  </view>
112
109
  </view>
113
110
  </view>
@@ -123,6 +120,7 @@
123
120
  import componentsMixins from "@/mixins/componentsMixins";
124
121
  import extsMixins from "@/mixins/extsMixins";
125
122
  import {Base64} from "js-base64";
123
+ import {mapState} from "vuex";
126
124
 
127
125
  export default {
128
126
  name: "JfbBaseCardV2",
@@ -137,6 +135,7 @@
137
135
  return {
138
136
  cardList: [],
139
137
  inCallback: "",
138
+
140
139
  //面板
141
140
  cardInfoPath: "", //卡券详情
142
141
  cardBindPath: "",
@@ -154,11 +153,14 @@
154
153
  }
155
154
  },
156
155
  watch: {
157
- container(value) {
158
- this.init(value)
159
- }
156
+ container(value,oldValue) {
157
+ if(JSON.stringify(value) === JSON.stringify(oldValue)) return;
158
+ if (this.$configProject['isPreview']) this.init(value)
159
+ },
160
160
  },
161
161
  computed: {
162
+ ...mapState(['jfbAuthorize']),
163
+
162
164
  button_bottom() {
163
165
  return this.fixedStyle({paddingBottom: 0, zIndex: 111})
164
166
  },
@@ -204,6 +206,7 @@
204
206
  }).filter((item) => item["is_valid"] === "Y");
205
207
  })
206
208
  },
209
+
207
210
  /**
208
211
  * @description 监听事件变化
209
212
  * @param container {object} 业务组件对象自己
@@ -215,6 +218,7 @@
215
218
  this.login_name = getContainerPropsValue(container, "content.login_name", "登录");
216
219
  this.margin = getContainerPropsValue(container, 'content.margin', {top: 0, left: 0, bottom: 0, right: 0});
217
220
  },
221
+
218
222
  handleBindLogin(item){
219
223
  this.$xdShowLoading({});
220
224
  jfbRootExec("loginCardBind", {
@@ -222,8 +226,8 @@
222
226
  data: { card_number: item["card_number"] },
223
227
  })
224
228
  .then((res) => {
225
- console.log(res);
226
229
  this.$xdHideLoading();
230
+
227
231
  //#ifdef MP-WEIXIN
228
232
  if (this.jfbAuthorize !== null) {
229
233
  this.jfbAuthorize.setCardToken(res);
@@ -232,13 +236,16 @@
232
236
 
233
237
  if (this.$configProject.isPreview) {
234
238
  console.log("handleBindLogin", "预览模式不跳转", this.inCallback);
235
- } else {
239
+ }
240
+ else {
241
+ console.warn(`handleBindLogin: ${this.inCallback}`);
236
242
  this.$xdUniHelper.redirectTo({
237
243
  url: this.inCallback,
238
244
  });
239
245
  }
240
246
  })
241
247
  .catch((res) => {
248
+ console.error(res);
242
249
  this.$xdHideLoading();
243
250
  });
244
251
  },
@@ -284,13 +291,22 @@
284
291
  box-shadow: 0px 0px 8rpx 0px rgba(179, 193, 196, 0.5);
285
292
  z-index: 111;
286
293
 
287
- &>view {
294
+ & > view {
288
295
  width: 100%;
289
296
  display: flex;
290
297
  justify-content: center;
291
298
  align-items: center;
292
299
  padding: unit(24, rpx);
293
300
  box-sizing: border-box;
301
+
302
+ /* #ifdef MP-WEIXIN */
303
+ & > view {
304
+ flex: 1;
305
+ display: flex;
306
+ justify-content: center;
307
+ align-items: center;
308
+ }
309
+ /* #endif */
294
310
  }
295
311
  }
296
312
  }
@@ -7,6 +7,28 @@ export default {
7
7
  style: [],
8
8
  content: (data) => {
9
9
  return [
10
+ {
11
+ label: '选择综合入口类型:',
12
+ ele: 'xd-site-select-list',
13
+ valueKey: 'entryType',
14
+ value: data['entryType'],
15
+ placeholder: '请选择综合入口类型',
16
+ multiple: false,
17
+ groupKey:'content',
18
+ className: 'input50',
19
+ rules: [
20
+ {required: true, message: '请选择综合入口类型', trigger: ['blur', 'change']}
21
+ ],
22
+ handleCustom({action, data}) {
23
+ XdBus.getParentApi('getEntryGroupOption')({key: Date.now()})
24
+ .then(res => {
25
+ data.cb(res.list)
26
+ })
27
+ .catch(error => {
28
+ console.error(error);
29
+ });
30
+ },
31
+ },
10
32
  {
11
33
  label: '每行显示数量',
12
34
  ele: 'xd-radio',
@@ -49,7 +49,7 @@
49
49
  import componentsMixins from "@/mixins/componentsMixins";
50
50
  import extsMixins from "@/mixins/extsMixins";
51
51
  import getServiceUrl from "@/common/getServiceUrl";
52
- import {base64} from 'js-base64';
52
+ import {mapState} from "vuex";
53
53
  export default {
54
54
  name: "JfbBaseEntry",
55
55
  components: {
@@ -66,9 +66,11 @@
66
66
  paddingInput: 20,
67
67
  loadingList: true,
68
68
  margin: {},
69
+ entryType: '',
69
70
  }
70
71
  },
71
72
  computed: {
73
+ ...mapState(['brandInfo']),
72
74
  bodyStyle(){
73
75
  return {
74
76
  backgroundColor: this.bgcolor,
@@ -111,17 +113,67 @@
111
113
  this.rowNum = getContainerPropsValue(container, 'content.rowNum', 1);
112
114
  this.paddingInput = getContainerPropsValue(container, 'content.paddingInput', 20);
113
115
  this.margin = getContainerPropsValue(container, 'content.margin', {});
116
+ this.entryType = getContainerPropsValue(container, 'content.entryType', 'default');
117
+ },
118
+
119
+ getCardPath(custom_redirect_data = {}){
120
+ //#ifdef H5
121
+ return null;
122
+ //#endif
123
+ //#ifdef MP-WEIXIN
124
+ const dir = custom_redirect_data.dir;
125
+ const actDir = this.projectAttr['deploy_dir'];
126
+ if(custom_redirect_data.appType === 'wxmp') {
127
+ if(dir === actDir) {
128
+ return {
129
+ cardPath: custom_redirect_data.path,
130
+ cardSelf: 'wxmp',
131
+ };
132
+ }
133
+ else return null;
134
+ }
135
+ else if(custom_redirect_data.appType === 'h5'){
136
+ return {
137
+ cardPath: custom_redirect_data.site_url,
138
+ cardSelf: 'h5',
139
+ };
140
+ }
141
+ else return null;
142
+ //#endif
114
143
  },
115
144
  getEntrySetting(){
116
145
  this.$xdShowLoading({});
117
146
  jfbRootExec("getEntrySetting", {
118
147
  vm: this,
119
- data: {}
148
+ data: {
149
+ group_id:this.entryType || 'default'
150
+ }
120
151
  }).then(res => {
121
152
  this.loadingList = false;
122
153
  this.$xdHideLoading();
123
- this.entryList = res.list.map(item => {
124
- const {dir, path, host} = item['redirect_data'];
154
+ let isH5FilterEntryList = [];
155
+ let isMpFilterEntryList = [];
156
+ this.entryList = res.list.filter(item=>{
157
+ //#ifdef H5
158
+ //在H5平台应用中不可跳转到微信小程序应用
159
+ if(item.redirect_data.appType === 'wxmp'){
160
+ isH5FilterEntryList.push(item)
161
+ }
162
+ return item.redirect_data.appType !== 'wxmp';
163
+ //#endif
164
+
165
+ //#ifdef MP-WEIXIN
166
+ const dir = item['redirect_data'].dir;
167
+ const actDir = this.projectAttr['deploy_dir'];
168
+ if(item.redirect_data.appType === 'wxmp') {
169
+ if(dir !== actDir) isMpFilterEntryList.push(item)
170
+ return dir === actDir;
171
+ }
172
+ return true
173
+ //#endif
174
+ }).map(item => {
175
+ const {dir, path, host,appType} = item['redirect_data'];
176
+ if(appType === undefined) item.redirect_data.appType = 'h5';
125
177
  item['image_url'] = getServiceUrl(item.image_url);
126
178
  item['image_url2'] = item.image_url2 ? getServiceUrl(item.image_url2) : "";
127
179
  item['image_url3'] = item.image_url3 ? getServiceUrl(item.image_url3) : "";
@@ -139,24 +191,35 @@
139
191
  let jumpUrl = path;
140
192
 
141
193
  //域名相同并且应用路径不相同时候处理
142
- if(host === this.projectAttr.host
143
- && this.projectAttr['deploy_dir'] !== dir
144
- ){
194
+ if(host === this.projectAttr.host && this.projectAttr['deploy_dir'] !== dir){
145
195
  jumpUrl = `//${host}/${dir}${path}`;
146
196
  //#ifdef MP-WEIXIN
147
197
  jumpUrl = `https:${jumpUrl}`;
148
198
  //#endif
149
199
  }
150
200
 
151
- if(item['redirect_data']['fixed_business_code'] === '') {
152
- item['redirect_data']['path'] = `${jumpUrl}?x-common=${nsp}&vs=${new Date().getTime()}`
153
- }
154
- else{
155
- item['redirect_data']['path'] = `${jumpUrl}?x-common=${nsp}&vs=${new Date().getTime()}`
201
+ //获取自定义卡券登录地址(微信小程序跳转到H5平台起作用)
202
+ let cardPathStr = '';
203
+ //#ifdef MP-WEIXIN
204
+ if(item.redirect_data.appType === 'h5') {
205
+ const custom_redirect_data = this.$xdUniHelper.checkVarType(item['custom_redirect_data']) === 'object'?item['custom_redirect_data']:{};
206
+ const cardPathObject = this.getCardPath(custom_redirect_data);
207
+ if(cardPathObject !== null) {
208
+ const {cardPath, cardSelf} =cardPathObject
209
+ if(cardPath) cardPathStr = `&card-login=${encodeURIComponent(cardPath)}&cardSelf=${cardSelf}`
210
+ }
156
211
  }
212
+ //#endif
213
+ item['redirect_data']['path'] = `${jumpUrl}?x-common=${nsp}&vs=${new Date().getTime()}${cardPathStr}`
157
214
  return item;
158
215
  });
159
- console.log( this.entryList)
216
+ //#ifdef MP-WEIXIN
217
+ console.warn(`微信小程序端被过滤的入口列表:${JSON.stringify(isMpFilterEntryList.map(item=> `${item.redirect_data.appType}:${item.entry_name}:${item.redirect_data['frontPath']}`),null,2)}`)
218
+ //#endif
219
+ //#ifdef H5
220
+ console.warn(`H5端被过滤的入口列表:${JSON.stringify(isH5FilterEntryList.map(item=> `${item.redirect_data.appType}:${item.entry_name}:${item.redirect_data['frontPath']}`),null,2)}`)
221
+ //#endif
222
+ console.warn(`福利入口链接列表:${JSON.stringify(this.entryList.map(item=> `${item.redirect_data.appType}:${item.redirect_data['path']}`),null,2)}`);
160
223
  if(res.list.length === 1) this.toLink(this.entryList[0]);
161
224
  if(res.list.length === 0) {
162
225
  this.$xdAlert({content: '当前票券暂无支持服务'})