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 +1 -1
- package/src/components/XdBar/XdBar.vue +22 -2
- package/src/components/XdButton/XdButton.vue +0 -1
- package/src/components/XdCardPayChose/XdCardPayChose.vue +13 -1
- package/src/components/XdCardV2/XdCardV2.vue +9 -0
- package/src/components/XdContentXss/XdContentXss.vue +26 -1
- package/src/components/XdFontIcon/XdFontIcon.vue +2 -2
- package/src/components/XdLayout/XdLayout.vue +13 -1
- package/src/components/XdNoData/XdNoData.vue +6 -1
- package/src/components/XdNoticeBar/XdNoticeBar.vue +22 -6
- package/src/components/XdSearchHistory/XdSearchHistory.vue +15 -13
- package/src/components/XdSelect/XdSelect.vue +3 -8
- package/src/components/XdWalletChose/XdWalletChose.vue +11 -2
- package/src/install.js +12 -0
- package/src/mixins/colorCardMixins.js +65 -11
- package/src/utils/helper.js +77 -15
- package/src/utils/xd.base.js +24 -0
- package/src/utils/xdWxLog.js +3 -1
package/package.json
CHANGED
|
@@ -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="
|
|
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
|
-
// #
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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"
|
|
3
|
-
<
|
|
4
|
-
<view class="
|
|
5
|
-
|
|
6
|
-
<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
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
</
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
29
|
-
let imgLen =
|
|
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' ?
|
|
34
|
-
image:
|
|
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
|
|
115
|
+
return this.colorObj.disableColor
|
|
62
116
|
},
|
|
63
117
|
getMergBg(disabled = 'Y'){
|
|
64
|
-
return disabled === 'Y' ?
|
|
65
|
-
:
|
|
118
|
+
return disabled === 'Y' ? this.colorObj['mergIcon'][1]
|
|
119
|
+
: this.colorObj['mergIcon'][0]
|
|
66
120
|
},
|
|
67
121
|
getNoData(){
|
|
68
|
-
return this
|
|
122
|
+
return this.colorObj.nodata
|
|
69
123
|
}
|
|
70
124
|
}
|
|
71
125
|
}
|
package/src/utils/helper.js
CHANGED
|
@@ -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(/^([^\/])/,
|
|
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
|
-
|
|
816
|
-
|
|
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
|
-
//#
|
|
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.
|
|
976
|
-
if (type)
|
|
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
|
|
1012
|
+
else{
|
|
1013
|
+
console.warn(`${type?'navigateTo.jump': 'redirectTo'}: ${JSON.stringify(obj)}`);
|
|
1014
|
+
uni.redirectTo(obj);
|
|
1015
|
+
}
|
|
988
1016
|
// #endif
|
|
989
1017
|
|
|
990
|
-
//#
|
|
991
|
-
|
|
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:\/\/)|(
|
|
1111
|
+
let regHttp = /^(\/\/)|(http:\/\/)|(https:\/\/).+/;
|
|
1050
1112
|
//需要转化的特殊访问地址
|
|
1051
1113
|
if(reg.test(obj.url)){
|
|
1052
1114
|
if(!regHttp.test(obj.url)) {
|
package/src/utils/xd.base.js
CHANGED
|
@@ -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
|
|
package/src/utils/xdWxLog.js
CHANGED