gxd-uni-library-editx 1.0.87 → 1.0.88-beta2

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": "gxd-uni-library-editx",
3
- "version": "1.0.87",
3
+ "version": "1.0.88-beta2",
4
4
  "private": false,
5
5
  "description": "聚福宝基础插件专用库",
6
6
  "main": "index.js",
@@ -24,7 +24,7 @@
24
24
  <!--返回上一个界元素-->
25
25
  <view class="xd-custom-bar__fixed-content-icon" @click.stop="back" v-if="!isSlotTopBar">
26
26
  <xd-font-icon
27
- v-if="noPrevToIndex && showBack && isPrev !== null"
27
+ v-if="isTopIcon"
28
28
  :icon="isPrev ? 'iconxiangzuo_xian' : 'iconshouye_mian'"
29
29
  :color="uiTextColor"
30
30
  :size="uiIconSize"
@@ -157,7 +157,7 @@
157
157
  // #ifdef H5
158
158
  return isThirdLogin().isICB && !this.isPrev
159
159
  // #endif
160
- // #ifndef H5
160
+ // #ifdef MP-WEIXIN
161
161
  return false
162
162
  // #endif
163
163
  },
@@ -177,6 +177,18 @@
177
177
  return bgc;
178
178
 
179
179
  },
180
+ isTopIcon(){
181
+ // #ifdef H5
182
+ return this.noPrevToIndex && this.showBack && this.isPrev !== null
183
+ // #endif
184
+ // #ifdef MP-WEIXIN
185
+ //自定义导航并且不显示导航设置
186
+ if(this.$parent.navigationStyle && !this.showBack) {
187
+ return this.noPrevToIndex && this.isPrev !== null
188
+ }
189
+ return this.noPrevToIndex && this.showBack && this.isPrev !== null
190
+ // #endif
191
+ }
180
192
  },
181
193
  created(){
182
194
  this.noPrevToIndex = this.$settings['noPrevPageToIndex'] === undefined ? false : this.$settings['noPrevPageToIndex'];
@@ -270,6 +282,14 @@
270
282
  },
271
283
 
272
284
  back(){
285
+ // #ifdef MP-WEIXIN
286
+ //自定义导航并且不显示导航设置
287
+ if(this.$parent.navigationStyle && !this.showBack) {
288
+ this.$xdUniHelper.navigateBack();
289
+ return;
290
+ }
291
+ // #endif
292
+
273
293
  if(!this.showBack) return;
274
294
 
275
295
  //临时兼容
@@ -210,7 +210,6 @@
210
210
  let pageStyle = this.systemStyle || {};
211
211
  let style = await getParentsStyles(this.$parent);
212
212
  style = Object.assign({}, JSON.parse(JSON.stringify(style)) , pageStyle);
213
- console.log('getPageStyles.created', style, pageStyle)
214
213
  this.btnBtnColor = {
215
214
  subPrimary: style.$subMainColor,
216
215
  primary: style.$mainColor,
@@ -421,8 +421,13 @@ export default {
421
421
  return time;
422
422
  },
423
423
  getList(){
424
+ let callThis = this;
425
+ // #ifdef MP
426
+ callThis = this.$parent;
427
+ // #endif
428
+
424
429
  //获取卡券列表
425
- this.getSettleListCards((cardList) => {
430
+ callThis.getSettleListCards((cardList) => {
426
431
  this.$xdLog.setARMSInfo(this.filterMGinfo(cardList), 'init_binded_list');
427
432
  this.cardList = cardList;
428
433
  })
@@ -521,8 +526,15 @@ export default {
521
526
  this.cardList = this.cardList.filter(item => item.card_number != ticket.card_number);
522
527
  this.selectedCardList = this.selectedCardList.filter(item => item.card_number != ticket.card_number);
523
528
  }
529
+ // #ifdef MP
530
+ if(ticket.card_use_price) this.cardPayPrice = this.cardPayPrice - ticket.card_use_price;
531
+ if(ticket.card_use_point) this.cardPayPoint = this.cardPayPoint - ticket.card_use_point;
532
+ // #endif
533
+ // #ifdef H5
524
534
  this.cardPayPrice = this.cardPayPrice - ticket.card_use_price;
525
535
  this.cardPayPoint = this.cardPayPoint - ticket.card_use_point;
536
+ // #endif
537
+
526
538
  this.renderChecked = Date.now();
527
539
  }
528
540
 
@@ -89,10 +89,19 @@ export default {
89
89
  }
90
90
  },
91
91
  loginStyleUI(){
92
+ //#ifdef MP-WEIXIN
93
+ return this.styleObjectToString({
94
+ backgroundColor:this.mainColor,
95
+ ...this.loginStyle
96
+ })
97
+ //#endif
98
+ //#ifdef H5
92
99
  return {
93
100
  backgroundColor:this.mainColor,
94
101
  ...this.loginStyle
95
102
  }
103
+ //#endif
104
+
96
105
  }
97
106
  },
98
107
  data(){
@@ -81,9 +81,34 @@
81
81
  // #endif
82
82
 
83
83
  // #ifndef H5
84
- this.vhtml = this.html;
84
+ this.vhtml = this.getMpHtml(this.html);
85
85
  // #endif
86
86
  }
87
+ },
88
+ methods:{
89
+ getMpHtml(html){
90
+ html = html.replace(/<img[^>]*>/gi, function(match, capture) {
91
+ match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
92
+ match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
93
+ match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, '');
94
+ return match;
95
+ });
96
+ html = html.replace(/style="[^"]+"/gi, function(match, capture) {
97
+ match = match
98
+ .replace(/<p>/gi, '<p class="p_class">')
99
+ .replace(/width:[^;]+;/gi, 'max-width:100%;')
100
+ .replace(/width:[^;]+;/gi, 'max-width:100%;');
101
+ return match;
102
+ });
103
+ html = html.replace(/<br[^>]*\/>/gi, "");
104
+ html = html.replace(/<a>/gi, '<a class="a_class "');
105
+ html= html.replace(/<li>/gi, '<li class="li_class "');
106
+ html = html.replace(/\<p/gi, '<p class="p_class "');
107
+ html= html.replace(/\<span/gi, '<span class="span_class "');
108
+ html = html.replace(/<div/gi, '<div class="div_class "');
109
+ html = html.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;margin-top:0;margin-bottom:0;"');
110
+ return html;
111
+ }
87
112
  }
88
113
  }
89
114
  </script>
@@ -110,7 +110,7 @@
110
110
  else {
111
111
  size = this.$isPortrait ? size : size / this.$portrait;
112
112
  }
113
-
113
+
114
114
  temp += `font-size:${size}rpx`;
115
115
  }
116
116
  if(this.width) {
@@ -121,7 +121,7 @@
121
121
  temp += `;width:${width}rpx`;
122
122
  }
123
123
  if (this.height) {
124
- let height = this.width;
124
+ let height = this.height;
125
125
  if (helper.checkVarType(this.height) === 'string') {
126
126
  height = Number(this.height);
127
127
  }
@@ -288,7 +288,13 @@
288
288
 
289
289
  startAnimation : false, //开始动画效果
290
290
  doneAnimation: false, //完成动画效果
291
- defaultImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MDM4QTUyMkNDRUQyMTFFQzkzRTZDOUJBNTFBNTA3RDUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MDM4QTUyMkRDRUQyMTFFQzkzRTZDOUJBNTFBNTA3RDUiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDozMkE3N0VGRkNFRDAxMUVDOTNFNkM5QkE1MUE1MDdENSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDozMkE3N0YwMENFRDAxMUVDOTNFNkM5QkE1MUE1MDdENSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PliHXlsAAAAQSURBVHjaYvj//z8DQIABAAj8Av7bok0WAAAAAElFTkSuQmCC',
291
+ // #ifdef H5
292
+ defaultImage: '//img.jufubao.cn/common/empty.png?ver=1',
293
+ //#endif
294
+ //#ifdef MP-WEIXIN
295
+ defaultImage: 'https://img.jufubao.cn/common/empty.png?ver=1',
296
+ //#endif
297
+
292
298
  bgImage: '',
293
299
  barBgColor: '', //bar背景颜色
294
300
  systemInfoSyn: null,
@@ -325,7 +331,13 @@
325
331
  //底部是否插槽模式
326
332
  isFooterSolt: true,
327
333
  wiewType: false,
334
+
335
+ // #ifdef H5
328
336
  loadingUrl: '//img.jufubao.cn/loading-block.jpg?v=1',
337
+ //#endif
338
+ //#ifdef MP-WEIXIN
339
+ loadingUrl: 'https://img.jufubao.cn/loading-block.jpg?v=1',
340
+ //#endif
329
341
 
330
342
  //自定义背景
331
343
  customBg: null,
@@ -41,7 +41,12 @@
41
41
  paddingBottom: 0,
42
42
  uiHeight: 0,
43
43
 
44
- image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKwAAACACAMAAAChgXKnAAACB1BMVEUAAACZpbmXo7fr7vbY3+nr7/bZ3+rZ3+ra4Orc4urZ3+rd5OzZ4uvZ3+uZpLja4OvZ4OvZ3+ri4u3Z3+rZ3+rZ3+rZ3+ra3+rZ3+rZ3+vZ3+ra4OuZpbjZ3+va3+vZ3+rX3ena4Ova3+rb3unZ4OjZ3+qZpLjZ3+ra4OvZ4OqZpLnZ3+ra3+rZ3+ra4OrZ4Ora3+vb4OuZpLjZ4OuZpLnZ3ura3+rZ3+ra4Ord4+2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eJwFiXdWy1EuvECYrU2G1oEtsnMrbXOrZNPdD6sYPPCjSLbRIZW2cdqxzihjFAEvisMY2tJWI4qRcLsjyF1WOASKuFZbGNQu++qi1jm5RrJwxUCopk81giSh27obHwnt37Y6Bi813AYvuI0HsaN99hthMNNi2axpYTUWrYWx+L2C52AtPI51nZWiJ2H/S9tz4W0F+oEWm5Z38K/Zirwvrqu9+tPSUwNpPrAmZUaGyj+Y24+ujAjVpbgIlCI53DIrcBcbFa443wlSrGUSsZmDQ05BL6aUzDEDW9qK2mDOrIAp+daGikvuU7EaaWmj3mGFS/2kcNu9+jcEPt47Wdb3W9mYQxyjTqnA06qOodBkgEVQJK4qaMK2Bx+yvHqEpz1WU7A35SbSgBq2Vq2tRBq67soYxB7WGYoDQK5fihBrlHvgxUV751tVIdb1C1GAKloByszZp6Z5MJWmGSFtfZF1TtqhjQlbkMpeiqo1q9b5D6Y2fdyMxYMLApOx6l6PpEJ6jq9a5j+3BA7byUWDATVpiHMrwZ7f1UXzVMW+vrWn46kWkP2M+nwUrE+iicLs0BtS/BWljRGvwnF+PS12YkJBYUrStOzYrOTgu328PDd6e9yI6JXp+VmlpSfGTdjqLCguSkbQlbM+LXRsVvK9hRkhWTZg9bSSc4BTxyY5KWYtBsWwqiSxdEbIJJu7Bkkr85GrshJWMVclq1dmf2AlAJql0CwYgNT03Ov4TGbEvzk7PsESDK+dUWS2udHJYWnbpu8dao9HlxkXk2zItLj08sTIkOP6OpFFx7CkLb3oVq62oIdX61zyHknf1TexpmAFa7cvr/PA2XjZ7ahTOk1WPRIvD3Gy818fGDvb6HAAAAAElFTkSuQmCC',
44
+ // #ifdef H5
45
+ image: '//img.jufubao.cn/common/nodata.png?v=1',
46
+ //#endif
47
+ //#ifdef MP-WEIXIN
48
+ image: 'https://img.jufubao.cn/common/nodata.png?v=1',
49
+ //#endif
45
50
  }
46
51
  },
47
52
 
@@ -1,5 +1,11 @@
1
1
  <template>
2
- <view v-if="show" class="uni-noticebar" :style="{ backgroundColor: uiBackgroundColor }" @click="onClick">
2
+ <view
3
+ v-if="show"
4
+ class="uni-noticebar"
5
+ :class="{isMp:isMp}"
6
+ :style="{ backgroundColor: uiBackgroundColor }"
7
+ @click="onClick"
8
+ >
3
9
  <!-- #ifdef MP-ALIPAY -->
4
10
  <view
5
11
  v-if="showClose === true || showClose === 'true'"
@@ -218,19 +224,24 @@
218
224
  animationDuration: 'none',
219
225
  animationPlayState: 'paused',
220
226
  animationDelay: '0s',
221
-
222
-
227
+
228
+
223
229
  uiColor: '', //文字颜色
224
230
  uiBackgroundColor: '', //背景颜色
231
+
232
+ isMp: false,
225
233
  }
226
234
  },
227
-
235
+
228
236
  async created() {
229
237
  this.uiColor = await getParentsStyle(this.$parent, '$warningColor');
230
238
  if(this.isNoBgc) this.uiBackgroundColor = Color(this.uiColor).alpha(0.2).toString();
231
239
  else this.uiBackgroundColor = 'rgba(0,0,0,0)';
232
-
233
-
240
+
241
+ //#ifdef MP-WEIXIN
242
+ this.isMp = true;
243
+ //#endif
244
+
234
245
  // #ifdef APP-PLUS
235
246
  var pages = getCurrentPages();
236
247
  var page = pages[pages.length - 1];
@@ -414,6 +425,7 @@
414
425
  flex: 1;
415
426
  flex-direction: column;
416
427
  overflow: hidden;
428
+ width: 100%;
417
429
  }
418
430
 
419
431
  .uni-noticebar__content-wrapper--single {
@@ -521,4 +533,8 @@
521
533
  transform: translate3d(-100%, 0, 0);
522
534
  }
523
535
  }
536
+
537
+ .isMp {
538
+ width: 100%;
539
+ }
524
540
  </style>
@@ -1,19 +1,21 @@
1
1
  <template>
2
- <view class="xd-search-history" v-show="historyList.length">
3
- <view class="header">
4
- <view class="title">搜索历史</view>
5
- <view v-if="isEdit" class="clear_edit">
6
- <view class="clear_all" @click="clearAll">全部清空</view> | <view class="clear_comp" @click="isEdit=false">完成</view>
2
+ <view class="xd-search-history">
3
+ <template v-if="historyList.length">
4
+ <view class="header">
5
+ <view class="title">搜索历史</view>
6
+ <view v-if="isEdit" class="clear_edit">
7
+ <view class="clear_all" @click="clearAll">全部清空</view> | <view class="clear_comp" @click="isEdit=false">完成</view>
8
+ </view>
9
+ <view v-else class="clear" @click="clearHistory">清空</view>
7
10
  </view>
8
- <view v-else class="clear" @click="clearHistory">清空</view>
9
- </view>
10
- <view class="content">
11
- <view class="history_item" v-for="(item,index) in historyList" :key="index"
12
- @click="handleClick(item)">
13
- <view class="text">{{item}}</view>
14
- <xd-font-icon v-show="isEdit" icon="icondanchuangguanbi_xian" size="18"></xd-font-icon>
11
+ <view class="content">
12
+ <view class="history_item" v-for="(item,index) in historyList" :key="index"
13
+ @click="handleClick(item)">
14
+ <view class="text">{{item}}</view>
15
+ <xd-font-icon v-show="isEdit" icon="icondanchuangguanbi_xian" size="18"></xd-font-icon>
16
+ </view>
15
17
  </view>
16
- </view>
18
+ </template>
17
19
  </view>
18
20
  </template>
19
21
  <script>
@@ -30,7 +30,6 @@
30
30
  width: width,
31
31
  opacity: disabled ? 0.8: 1
32
32
  }"
33
-
34
33
  @click="bindPickerClick(true)"
35
34
  >
36
35
  <text
@@ -39,8 +38,7 @@
39
38
  'margin': margin,
40
39
  'color': color
41
40
  }"
42
- >{{getSelectName}}
43
- </text>
41
+ >{{getSelectName}}</text>
44
42
  <view>
45
43
  <slot :status="isUp">
46
44
  <xd-font-icon
@@ -49,7 +47,6 @@
49
47
  :color="color"
50
48
  ></xd-font-icon>
51
49
  </slot>
52
-
53
50
  </view>
54
51
  </view>
55
52
  </view>
@@ -225,13 +222,11 @@
225
222
  list(value) {
226
223
  if (this.mode === 'selector') this.init(value);
227
224
  if (this.mode === 'multiSelector') this.multiInit(value)
228
- }
225
+ },
229
226
  },
230
-
227
+
231
228
  async created() {
232
229
  this.styleMainColor = await getParentsStyle(this.$parent, '$mainColor');
233
-
234
- console.log('flimTypeList', this.mode)
235
230
  this.uiColor = this.styleMainColor;
236
231
  this.uiFontSize = this.fontSize;
237
232
  if (this.borderColor) this.uiColor = this.borderColor;
@@ -113,7 +113,12 @@
113
113
  }
114
114
  },
115
115
  created(){
116
- this.getUserWalletList((res) => {
116
+ let callThis = this;
117
+ // #ifdef MP
118
+ callThis = this.$parent;
119
+ // #endif
120
+
121
+ callThis.getUserWalletList((res) => {
117
122
  console.log("getUserWalletList", res.walletList);
118
123
  this.walletList = res.list.map(item => {
119
124
  item.checked = false;
@@ -141,8 +146,12 @@
141
146
  console.log(flag);
142
147
  console.log(this.walletList);
143
148
  if(flag){
149
+ let callThis = this;
150
+ // #ifdef MP
151
+ callThis = this.$parent;
152
+ // #endif
144
153
  this.$xdShowLoading({})
145
- this.useBindedWallet({
154
+ callThis.useBindedWallet({
146
155
  wallet_type: row.wallet_type,
147
156
  selected_wallet_list_json: JSON.stringify(this.selectedWalletList),
148
157
  }, (res) => {
package/src/install.js CHANGED
@@ -39,6 +39,12 @@ const install = (Vue, options = {}) => {
39
39
  *
40
40
  */
41
41
  Vue.prototype.$xdConfirm = (obj) => {
42
+ //#ifdef MP-WEIXIN
43
+ if(obj.$vm !== undefined && helper.checkVarType(obj.$vm) === 'object') {
44
+ if(obj.$vm.styles) obj['styles'] = helper.cloneDeep(obj.$vm.styles);
45
+ obj.$vm = null;
46
+ }
47
+ //#endif
42
48
  obj['radius'] = obj['radius'] === undefined ? '10rpx' : obj['radius'];
43
49
  store.commit('setXdInputConfirm', obj);
44
50
  };
@@ -64,6 +70,12 @@ const install = (Vue, options = {}) => {
64
70
  *
65
71
  */
66
72
  Vue.prototype.$xdAlert = (obj) => {
73
+ //#ifdef MP-WEIXIN
74
+ if(obj.$vm !== undefined && helper.checkVarType(obj.$vm) === 'object') {
75
+ if(obj.$vm.styles) obj['styles'] = helper.cloneDeep(obj.$vm.styles);
76
+ obj.$vm = null;
77
+ }
78
+ //#endif
67
79
  obj['radius'] = obj['radius'] === undefined ? '30rpx' : obj['radius'];
68
80
  store.commit('setTips', obj);
69
81
  };
@@ -6,13 +6,12 @@ import getServiceUrl from "@/common/getServiceUrl";
6
6
  export default {
7
7
  data() {
8
8
  return {
9
-
9
+ colorObj : {},
10
10
  }
11
11
  },
12
12
 
13
13
  created(){
14
- // console.log(this.$colorConfig)
15
- // debugger
14
+ this.colorObj = this.$colorConfig || getApp().globalData.$colorConfig;
16
15
  },
17
16
 
18
17
  methods: {
@@ -25,13 +24,13 @@ export default {
25
24
  return result;
26
25
  },
27
26
  getCardThemes(name , disabled='N') {
28
- let colorLen = this.$colorConfig.cardThemesColor.length;
29
- let imgLen = this.$colorConfig.cardThemesImage.length;
27
+ let colorLen = this.colorObj.cardThemesColor.length;
28
+ let imgLen = this.colorObj.cardThemesImage.length;
30
29
  let colorIndex = this.stringToNumber(name) % colorLen;
31
30
  let imgIndex = this.stringToNumber(name) % imgLen;
32
31
  return {
33
- color: disabled === 'N' ? this.$colorConfig.cardThemesColor[colorIndex]: this.getDisabledColor(),
34
- image: this.$colorConfig.cardThemesImage[imgIndex],
32
+ color: disabled === 'N' ? this.colorObj.cardThemesColor[colorIndex]: this.getDisabledColor(),
33
+ image: this.colorObj.cardThemesImage[imgIndex],
35
34
  }
36
35
  },
37
36
  getEntry(codes = [], allEntry = []) {
@@ -49,6 +48,60 @@ export default {
49
48
  });
50
49
  return support
51
50
  },
51
+
52
+ filterNotSupportEntry(allEntry){
53
+ let isH5FilterEntryList = [];
54
+ let isMpFilterEntryList = [];
55
+ allEntry = allEntry.map(item=>{
56
+ try {
57
+ if(!item.redirect_data) item.redirect_data = null;
58
+ else {
59
+ item.redirect_data = JSON.parse(item.redirect_data);
60
+ item.redirect_data.appType = item.redirect_data.appType || 'h5';
61
+ }
62
+ }catch (e){
63
+ item.redirect_data = null
64
+ }
65
+ return item;
66
+ })
67
+ .filter(item=>{
68
+ //地址不存在
69
+ if(!item.redirect_data) return false
70
+
71
+ //#ifdef H5
72
+ //在H5平台应用中不可跳转到微信小程序应用
73
+ if(item.redirect_data.appType === 'wxmp'){
74
+ isH5FilterEntryList.push(item)
75
+ }
76
+ return item.redirect_data.appType !== 'wxmp';
77
+ //#endif
78
+
79
+ //#ifdef MP-WEIXIN
80
+ const dir = item['redirect_data'].dir;
81
+ const actDir = this.projectAttr['deploy_dir'];
82
+ if(item.redirect_data.appType === 'wxmp') {
83
+ if(dir !== actDir) isMpFilterEntryList.push(item)
84
+ return dir === actDir;
85
+ }
86
+ return true
87
+ //#endif
88
+
89
+ });
90
+ console.log(isH5FilterEntryList)
91
+ console.log(isMpFilterEntryList);
92
+ console.log(allEntry)
93
+
94
+ //#ifdef MP-WEIXIN
95
+ console.warn(`微信小程序端被过滤的入口列表:${JSON.stringify(isMpFilterEntryList.map(item=> `${item.redirect_data.appType}:${item.entry_name}:${item.redirect_data['frontPath']}`),null,2)}`)
96
+ //#endif
97
+ //#ifdef H5
98
+ console.warn(`H5端被过滤的入口列表:${JSON.stringify(isH5FilterEntryList.map(item=> `${item.redirect_data.appType}:${item.entry_name}:${item.redirect_data['frontPath']}`),null,2)}`)
99
+ //#endif
100
+ console.warn(`福利入口链接列表:${JSON.stringify(allEntry.map(item=> `${item.redirect_data.appType}:${item.redirect_data['path']}`),null,2)}`);
101
+
102
+ return allEntry
103
+ },
104
+
52
105
  getCardGroupItem(list, allEntry, disabled='N') {
53
106
  list.map(item => {
54
107
  //设置卡片样式
@@ -57,15 +110,16 @@ export default {
57
110
  });
58
111
  return list
59
112
  },
113
+
60
114
  getDisabledColor(){
61
- return this.$colorConfig.disableColor
115
+ return this.colorObj.disableColor
62
116
  },
63
117
  getMergBg(disabled = 'Y'){
64
- return disabled === 'Y' ? this.$colorConfig['mergIcon'][1]
65
- : this.$colorConfig['mergIcon'][0]
118
+ return disabled === 'Y' ? this.colorObj['mergIcon'][1]
119
+ : this.colorObj['mergIcon'][0]
66
120
  },
67
121
  getNoData(){
68
- return this.$colorConfig.nodata
122
+ return this.colorObj.nodata
69
123
  }
70
124
  }
71
125
  }
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+
2
3
  import {Base64} from 'js-base64';
3
4
  import {
4
5
  PLATFORM_PARAM_SETTING
@@ -512,14 +513,15 @@ class Helpers {
512
513
  pathname = url.split('?')[0];
513
514
  search = url.split('?')[1];
514
515
  }
515
-
516
+ let partReplaceStr = '/$1';
517
+ if(/(\/\/|http:\/\/|https:\/\/).+$/.test(url)) partReplaceStr = '$1';
516
518
  return{
517
519
  source: url,
518
520
  query: search,
519
521
  params: params(search),
520
522
  relative: url,
521
523
  segments: pathname.replace(/^\//, '').split('/'),
522
- path: pathname.replace(/^([^\/])/, '/$1'),
524
+ path: pathname.replace(/^([^\/])/, partReplaceStr),
523
525
  file: (pathname.match(/\/([^\/?#]+)$/i) || [, ''])[1],
524
526
  }
525
527
  //#endif
@@ -812,16 +814,31 @@ class Helpers {
812
814
  }
813
815
 
814
816
  replacePathForDir(url){
815
- //#ifndef H5
816
- return url
817
+ let dir = '';
818
+ let host = '';
819
+ if(store.state.brandInfo) {
820
+ dir = store.state.brandInfo.deploy_dir
821
+ host = store.state.brandInfo.host;
822
+ }
823
+
824
+ //#ifdef MP-WEIXIN
825
+ //带有应用部署目录处理
826
+ if(/@site_domain@\//.test(url)) {
827
+ let indexReg = new RegExp(`@site_domain@/${dir}`);
828
+ //相同应用处理
829
+ if(indexReg.test(url)) {
830
+ return url.replace(indexReg,'');
831
+ }
832
+ //不同应用处理
833
+ else{
834
+ return `https://${host}${url.replace('@site_domain@','')}`;
835
+ }
836
+ }
837
+ else return url;
817
838
  //#endif
818
839
 
819
840
  //#ifdef H5
820
841
  let siteDomain = `${window.location.protocol}//${window.location.host}`;
821
- let dir = '';
822
- if(store.state.brandInfo && store.state.brandInfo.deploy_dir) {
823
- dir = store.state.brandInfo.deploy_dir
824
- }
825
842
  let reg = new RegExp(`@site_domain@`); //检查是否为站点下其他应用的链接地址
826
843
  let selfReg = new RegExp(`@site_domain@/${dir}`); //检查是否为自己内部链接
827
844
  let relfRedirectReg = new RegExp(`^/${dir}\/.+$`); //检查是否带有内容部署目录地址
@@ -962,7 +979,7 @@ class Helpers {
962
979
  else window.location.href = obj['url'];
963
980
  // #endif
964
981
 
965
- //#ifndef H5
982
+ //#ifdef MP-WEIXIN
966
983
  let fn = 'navigateTo';
967
984
  if (!type) fn = 'redirectTo';
968
985
  console.warn(`webview:/pages/webview/webview?seatUrl=${encodeURIComponent(obj['url'])}`)
@@ -972,8 +989,16 @@ class Helpers {
972
989
  // #endif
973
990
  }
974
991
  else {
975
- console.warn(`${type?'navigateTo.jump': 'redirectTo'}: ${JSON.stringify(obj)}`);
976
- if (type) uni.navigateTo(obj);
992
+ console.log(type, obj)
993
+ if (type){
994
+ //#ifdef H5
995
+ console.warn(`${type?'navigateTo.jump': 'redirectTo'}: ${JSON.stringify(obj)}`);
996
+ uni.navigateTo(obj);
997
+ //#endif
998
+ //#ifdef MP-WEIXIN
999
+ this.handleWxTo(type, obj)
1000
+ //#endif
1001
+ }
977
1002
  else {
978
1003
  //#ifdef H5
979
1004
  if(notHistory){
@@ -984,16 +1009,53 @@ class Helpers {
984
1009
  }
985
1010
  window.location.replace(`${dir}${obj.url}`);
986
1011
  }
987
- else uni.redirectTo(obj);
1012
+ else{
1013
+ console.warn(`${type?'navigateTo.jump': 'redirectTo'}: ${JSON.stringify(obj)}`);
1014
+ uni.redirectTo(obj);
1015
+ }
988
1016
  // #endif
989
1017
 
990
- //#ifndef H5
991
- uni.redirectTo(obj);
1018
+ //#ifdef MP-WEIXIN
1019
+ this.handleWxTo(type, obj)
992
1020
  // #endif
993
1021
  }
994
1022
  }
995
1023
  }
996
1024
 
1025
+ /**
1026
+ * @description 微信跳转
1027
+ * @param type
1028
+ * @param obj {object}
1029
+ * @param obj.url {string}
1030
+ */
1031
+ handleWxTo(type, obj) {
1032
+ let fnName = 'navigateTo';
1033
+ if (!type) fnName = 'redirectTo';
1034
+
1035
+ //带有@site_domain@设置标识
1036
+ if(obj.url.indexOf('@site_domain@') === 0) {
1037
+ const {host,deploy_dir} = store.state.brandInfo;
1038
+ let url = obj.url.replace(/@site_domain@/,'');
1039
+ //相同应用
1040
+ if(url.indexOf(`/${deploy_dir}/`) === 0){
1041
+ obj.url = url.replace(`/${deploy_dir}/`,'/');
1042
+ uni[fnName](obj)
1043
+ }
1044
+ //不同应用
1045
+ else {
1046
+ url = `https://${host}${url}`;
1047
+ console.warn(`webview:/pages/webview/webview?seatUrl=${encodeURIComponent(url)}`)
1048
+ uni[fnName]({
1049
+ url: `/pages/webview/webview?seatUrl=${Base64.encodeURI(url)}`
1050
+ });
1051
+ }
1052
+
1053
+ }
1054
+ else{
1055
+ uni[fnName](obj)
1056
+ }
1057
+ }
1058
+
997
1059
  /**
998
1060
  * @description 返回处理
999
1061
  * @param type {boolean} 跳转类型 true=>navigateTo false=>redirectTo
@@ -1046,7 +1108,7 @@ class Helpers {
1046
1108
  */
1047
1109
  async specialApiTransform(obj, cb){
1048
1110
  let reg = /(-apiuri\/v)/;
1049
- let regHttp = /^(\/\/)|(http:\/\/)|(http:\/\/).+/;
1111
+ let regHttp = /^(\/\/)|(http:\/\/)|(https:\/\/).+/;
1050
1112
  //需要转化的特殊访问地址
1051
1113
  if(reg.test(obj.url)){
1052
1114
  if(!regHttp.test(obj.url)) {
@@ -775,6 +775,30 @@ export function isQrCode($vm,isOpen=true){
775
775
  return false
776
776
  }
777
777
 
778
+ /**
779
+ * @description 小驼峰,大驼峰 转 数组
780
+ * @param str
781
+ * @return {*[]}
782
+ */
783
+ export function spStrToArray(str){
784
+ let temp=[]
785
+ let reg = /[A-Z]/;
786
+ let word = '';
787
+ str.split('').map((char, index) => {
788
+ if (index === 0) {
789
+ word = char.toLocaleLowerCase();
790
+ } else {
791
+ if (reg.test(char)) {
792
+ temp.push(word);
793
+ word = char.toLocaleLowerCase();
794
+ } else {
795
+ word += char;
796
+ if (index === (str.length - 1)) temp.push(word);
797
+ }
798
+ }
799
+ });
800
+ return temp
801
+ }
778
802
 
779
803
 
780
804
 
@@ -66,7 +66,9 @@ class Logs {
66
66
  console.warn(`setConfig:${uid}`)
67
67
  }
68
68
 
69
-
69
+ setARMSInfo(params, eventName='default'){
70
+ console.log('setARMSInfo',eventName, params)
71
+ }
70
72
 
71
73
  checkApiHost() {
72
74
  if (typeof getApp !== 'function') return false;