jufubao-base 1.0.169-beta9 → 1.0.169
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/JfbBaseLogin/Attr.js +510 -1147
- package/src/components/JfbBaseLogin/JfbBaseLogin.vue +63 -364
- package/src/components/JfbBaseMapSearch/MapSearchMp.vue +1 -1
- package/src/components/JfbBaseTfkCardBind/Api.js +30 -49
- package/src/components/JfbBaseTfkCardBind/Attr.js +38 -635
- package/src/components/JfbBaseTfkCardBind/JfbBaseTfkCardBind.vue +22 -589
- package/src/components/JfbBaseTfkCardBind/Mock.js +9 -19
- package/src/components/JfbBaseTfkCardDetail/Api.js +32 -19
- package/src/components/JfbBaseTfkCardDetail/Attr.js +33 -692
- package/src/components/JfbBaseTfkCardDetail/JfbBaseTfkCardDetail.vue +23 -630
- package/src/components/JfbBaseTfkCardDetail/Mock.js +11 -151
- package/src/components/JfbBaseTfkCardLogin/Api.js +34 -19
- package/src/components/JfbBaseTfkCardLogin/Attr.js +33 -885
- package/src/components/JfbBaseTfkCardLogin/JfbBaseTfkCardLogin.vue +16 -729
- package/src/components/JfbBaseTfkCardLogin/Mock.js +11 -721
- package/src/components/JfbBaseTfkSearch/Api.js +42 -11
- package/src/components/JfbBaseTfkSearch/Attr.js +33 -143
- package/src/components/JfbBaseTfkSearch/JfbBaseTfkSearch.vue +22 -171
- package/src/components/JfbBaseTfkSearch/Mock.js +11 -90
- package/src/mixins/colorCardMixins.js +9 -71
- package/src/mixins/componentsMixins.js +23 -346
- package/src/components/JfbBaseTfkCardLogin/XdCouponItem.vue +0 -271
- package/src/components/JfbBaseTfkSearch/AllList.vue +0 -231
- package/src/components/JfbBaseTfkSearch/ContentCinema.vue +0 -157
- package/src/components/JfbBaseTfkSearch/ContentFilm.vue +0 -179
- package/src/components/JfbBaseTfkSearch/ContentProduct.vue +0 -308
- package/src/components/JfbBaseTfkSearch/ContentShop.vue +0 -184
- package/src/components/JfbBaseTfkSearch/CusAttr.js +0 -203
- package/src/components/JfbBaseTfkSearch/CustomList.vue +0 -401
- package/src/components/JfbBaseTfkSearch/SkeletonCinema.vue +0 -45
- package/src/components/JfbBaseTfkSearch/SkeletonFilm.vue +0 -109
- package/src/components/JfbBaseTfkSearch/SkeletonProduct.vue +0 -246
- package/src/components/JfbBaseTfkSearch/SkeletonShop.vue +0 -81
- package/src/components/JfbBaseTfkSearch/handleKeyword.js +0 -24
- package/src/components/JfbBaseTfkSearch/listMixins.js +0 -151
- package/src/components/JfbBaseTfkSearch/search.js +0 -293
|
@@ -6,12 +6,12 @@ import getServiceUrl from "@/common/getServiceUrl";
|
|
|
6
6
|
export default {
|
|
7
7
|
data() {
|
|
8
8
|
return {
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
|
|
13
13
|
created(){
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
},
|
|
16
16
|
|
|
17
17
|
methods: {
|
|
@@ -23,14 +23,14 @@ export default {
|
|
|
23
23
|
}
|
|
24
24
|
return result;
|
|
25
25
|
},
|
|
26
|
-
getCardThemes(name
|
|
27
|
-
let colorLen = this.
|
|
28
|
-
let imgLen =
|
|
26
|
+
getCardThemes(name) {
|
|
27
|
+
let colorLen = this.cardThemesColor.length;
|
|
28
|
+
let imgLen = this.cardThemesImage.length;
|
|
29
29
|
let colorIndex = this.stringToNumber(name) % colorLen;
|
|
30
30
|
let imgIndex = this.stringToNumber(name) % imgLen;
|
|
31
31
|
return {
|
|
32
|
-
color:
|
|
33
|
-
image:
|
|
32
|
+
color: this.cardThemesColor[colorIndex],
|
|
33
|
+
image: this.cardThemesImage[imgIndex],
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
getEntry(codes = [], allEntry = []) {
|
|
@@ -48,75 +48,13 @@ export default {
|
|
|
48
48
|
});
|
|
49
49
|
return support
|
|
50
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
|
-
|
|
91
|
-
//#ifdef MP-WEIXIN
|
|
92
|
-
console.warn(`微信小程序端被过滤的入口列表:${JSON.stringify(isMpFilterEntryList.map(item=> `${item.redirect_data.appType}:${item.entry_name}:${item.redirect_data['frontPath']}`),null,2)}`)
|
|
93
|
-
//#endif
|
|
94
|
-
//#ifdef H5
|
|
95
|
-
console.warn(`H5端被过滤的入口列表:${JSON.stringify(isH5FilterEntryList.map(item=> `${item.redirect_data.appType}:${item.entry_name}:${item.redirect_data['frontPath']}`),null,2)}`)
|
|
96
|
-
//#endif
|
|
97
|
-
console.warn(`福利入口链接列表:${JSON.stringify(allEntry.map(item=> `${item.redirect_data.appType}:${item.redirect_data.appType === 'h5'?(item.redirect_data['site_url'] || item.redirect_data['path']) :item.redirect_data['path']}`),null,2)}`);
|
|
98
|
-
|
|
99
|
-
return allEntry
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
getCardGroupItem(list, allEntry, disabled='N') {
|
|
51
|
+
getCardGroupItem(list, allEntry) {
|
|
103
52
|
list.map(item => {
|
|
104
53
|
//设置卡片样式
|
|
105
|
-
item['theme'] = this.getCardThemes(item['card_type_name']
|
|
54
|
+
item['theme'] = this.getCardThemes(item['card_type_name']);
|
|
106
55
|
item['entries'] = this.getEntry(item['business_codes'], allEntry)
|
|
107
56
|
});
|
|
108
57
|
return list
|
|
109
58
|
},
|
|
110
|
-
|
|
111
|
-
getDisabledColor(){
|
|
112
|
-
return this.colorObj.disableColor
|
|
113
|
-
},
|
|
114
|
-
getMergBg(disabled = 'Y'){
|
|
115
|
-
return disabled === 'Y' ? this.colorObj['mergIcon'][1]
|
|
116
|
-
: this.colorObj['mergIcon'][0]
|
|
117
|
-
},
|
|
118
|
-
getNoData(){
|
|
119
|
-
return this.colorObj.nodata
|
|
120
|
-
}
|
|
121
59
|
}
|
|
122
60
|
}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
import {getContainerFnPropsValue, getContainerPropsValue
|
|
4
|
-
import {Base64} from 'js-base64';
|
|
5
|
-
import {mapActions,mapState, mapMutations} from "vuex";
|
|
6
|
-
import helper from "@/utils/helper";
|
|
7
|
-
import store from "@/store/index";
|
|
3
|
+
import {getContainerFnPropsValue, getContainerPropsValue} from "@/utils/xd.base";
|
|
8
4
|
|
|
9
5
|
export default {
|
|
10
6
|
props: {
|
|
@@ -113,55 +109,11 @@ export default {
|
|
|
113
109
|
subMainColor: '',
|
|
114
110
|
infoColor: '',
|
|
115
111
|
defaultColor: '',
|
|
116
|
-
dangerColor: ''
|
|
117
|
-
mainGradient: '',
|
|
118
|
-
subGradient: '',
|
|
119
|
-
|
|
120
|
-
//test
|
|
121
|
-
posterTest:{
|
|
122
|
-
"content_id": "KpBbUKdj4aBejwe7Fh1ki",
|
|
123
|
-
"position_id": "QCk3PmoyQmOWRP1SxnYR3",
|
|
124
|
-
"partner_id": 0,
|
|
125
|
-
"site_id": "",
|
|
126
|
-
"content_name": "测试.",
|
|
127
|
-
"image_url": "//dummyimage.com/200x200",
|
|
128
|
-
"redirect_type": "EMP",
|
|
129
|
-
"redirect_type_name": "无链接",
|
|
130
|
-
"redirect_data": "",
|
|
131
|
-
"sort": "",
|
|
132
|
-
"status": "",
|
|
133
|
-
"start_time": "",
|
|
134
|
-
"end_time": "",
|
|
135
|
-
"op_user_id": "",
|
|
136
|
-
"created_time": 0,
|
|
137
|
-
"updated_time": 0
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
|
|
142
|
-
destroyed() {
|
|
143
|
-
console.warn('componentsMixins.destroyed.my(timeer|timer)');
|
|
144
|
-
if (this.timeer && typeof this.timeer === "number") {
|
|
145
|
-
clearTimeout(this.timeer);
|
|
146
|
-
console.warn('componentsMixins.destroyed.my.timeer');
|
|
147
|
-
}
|
|
148
|
-
if (this.timer && typeof this.timer === "number") {
|
|
149
|
-
clearTimeout(this.timer);
|
|
150
|
-
console.warn('componentsMixins.destroyed.my.timer');
|
|
112
|
+
dangerColor: ''
|
|
151
113
|
}
|
|
152
|
-
|
|
153
|
-
//卸载页面
|
|
154
|
-
if(typeof this.onJfbUnload === "function") {
|
|
155
|
-
console.warn('componentsMixins.destroyed.exec.onJfbUnload');
|
|
156
|
-
this.onJfbUnload()
|
|
157
|
-
}
|
|
158
|
-
|
|
159
114
|
},
|
|
160
|
-
|
|
161
115
|
created(){
|
|
162
|
-
|
|
163
|
-
if (this.$vnode && this.$vnode.tag) tag = this.$vnode.tag;
|
|
164
|
-
this.$xdLog.setProject('App.components.start', `App.components.vnode.name.${tag}`);
|
|
116
|
+
console.warn(`init.components._uid:${this._uid},vnode.name=${this.$vnode.tag}`);
|
|
165
117
|
|
|
166
118
|
//设置插件cid
|
|
167
119
|
if (this.cid) {
|
|
@@ -170,14 +122,9 @@ export default {
|
|
|
170
122
|
this.containerId = this.$xdUniHelper.randomChar(20);
|
|
171
123
|
}
|
|
172
124
|
|
|
173
|
-
//保存到vuex
|
|
174
|
-
console.log('setStyleCommon',this)
|
|
175
|
-
this.setStyleCommon(this.styles);
|
|
176
|
-
|
|
177
125
|
//初始化风格
|
|
178
126
|
this.initThemesToData();
|
|
179
127
|
|
|
180
|
-
|
|
181
128
|
//#ifdef H5
|
|
182
129
|
//监听用户点击状态显示虚框
|
|
183
130
|
XdBus.addEvent('select', ({containerId}) => {
|
|
@@ -205,120 +152,35 @@ export default {
|
|
|
205
152
|
|
|
206
153
|
//#ifdef H5
|
|
207
154
|
mounted() {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
let elx =
|
|
155
|
+
if (this.$configProject.isPreview) {
|
|
156
|
+
let that = this;
|
|
157
|
+
function handle() {
|
|
158
|
+
let className = `${that.cssRoot}__body-mask`;
|
|
159
|
+
if (document.getElementsByClassName(className).length === 0) {
|
|
160
|
+
let elx = document.getElementsByClassName(`${that.cssRoot}__body`);
|
|
214
161
|
if (elx.length === 0) {
|
|
215
162
|
setTimeout(() => {
|
|
216
163
|
handle()
|
|
217
|
-
},
|
|
164
|
+
}, 100)
|
|
218
165
|
} else {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
166
|
+
const mask = document.createElement("div");
|
|
167
|
+
mask.className = 'jfb-mask';
|
|
168
|
+
mask.style.position = 'absolute';
|
|
169
|
+
mask.style.left = '0px';
|
|
170
|
+
mask.style.right = '0px';
|
|
171
|
+
mask.style.top = '0px';
|
|
172
|
+
mask.style.bottom = '0px';
|
|
173
|
+
mask.style.zIndex = 9999;
|
|
174
|
+
elx.item(0).appendChild(mask);
|
|
225
175
|
}
|
|
226
176
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
//模式不显示虚线
|
|
232
|
-
if(this.$configProject.type === 'test'
|
|
233
|
-
&& this.$configProject.NODE_ENV === 'development'
|
|
234
|
-
&& this.$configProject.viewType === 'pack'
|
|
235
|
-
){
|
|
236
|
-
this.isEditx = false;
|
|
177
|
+
}
|
|
178
|
+
handle()
|
|
237
179
|
}
|
|
238
|
-
|
|
239
180
|
},
|
|
240
181
|
// #endif
|
|
241
182
|
|
|
242
|
-
computed:{
|
|
243
|
-
...mapState({
|
|
244
|
-
pageNamespace: state=> state.pageBusinessCode,
|
|
245
|
-
})
|
|
246
|
-
},
|
|
247
|
-
|
|
248
|
-
watch:{
|
|
249
|
-
active(val){
|
|
250
|
-
if(this.$configProject.isPreview && val) this.autoHideMask();
|
|
251
|
-
},
|
|
252
|
-
},
|
|
253
|
-
|
|
254
183
|
methods:{
|
|
255
|
-
...mapActions(['setXNamespace','setStyleCommon']),
|
|
256
|
-
...mapMutations(['setCurrentStyle']),
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* @description 自动生成调试模式
|
|
260
|
-
*/
|
|
261
|
-
autoHideMask(){
|
|
262
|
-
if(this.$configProject.isPreview && this.hideMask === true){
|
|
263
|
-
this.$nextTick(()=>{
|
|
264
|
-
let className = this.$el.classList;
|
|
265
|
-
if(!className.contains('gHideMask')) {
|
|
266
|
-
className.add("gHideMask")
|
|
267
|
-
}
|
|
268
|
-
})
|
|
269
|
-
}
|
|
270
|
-
},
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* @description 检查是否同域名
|
|
274
|
-
* @param url
|
|
275
|
-
* @param dir {String} 部署目录
|
|
276
|
-
* @returns {*}
|
|
277
|
-
*/
|
|
278
|
-
//#ifdef H5
|
|
279
|
-
getSameSiteAndDomain(url, dir) {
|
|
280
|
-
let regDir = new RegExp(`^/${dir}/\.*$`);
|
|
281
|
-
let host = window.location.host;
|
|
282
|
-
let pages = this.$xdUniHelper.parseURL(url);
|
|
283
|
-
|
|
284
|
-
//域名相同并且部署目录相同
|
|
285
|
-
if (host === pages.host && regDir.test(pages.path)) {
|
|
286
|
-
return pages.relative;
|
|
287
|
-
}
|
|
288
|
-
return url;
|
|
289
|
-
},
|
|
290
|
-
// #endif
|
|
291
|
-
|
|
292
|
-
setNameSpace(options){
|
|
293
|
-
this.xnamespace = this.xnamespace || this.pageNamespace;
|
|
294
|
-
if(!this.xnamespace && !this.$configProject.isPreview){
|
|
295
|
-
this.$xdAlert({content: '未设置业务编码',type:'error'});
|
|
296
|
-
throw new Error('请配置业务编码')
|
|
297
|
-
}
|
|
298
|
-
this.setXNamespace(this.xnamespace)
|
|
299
|
-
},
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* @description 自动计算列数的宽和间距 (父节点需要设置110%)不兼容微信小程序(废弃)
|
|
303
|
-
* @param index {number} 当前索引值
|
|
304
|
-
* @param cell {number} 当前索引值
|
|
305
|
-
* @param jfbSpacing {number}
|
|
306
|
-
* @returns {{marginRight: string, overflow: string, width: string, marginTop: string}}
|
|
307
|
-
*/
|
|
308
|
-
itemStyle(index, cell, jfbSpacing ) {
|
|
309
|
-
if(this.$xdUniHelper.checkVarType(jfbSpacing) === 'string') jfbSpacing = Number(jfbSpacing);
|
|
310
|
-
let maxW = 100 / cell;
|
|
311
|
-
let padding = Math.floor(this.$rpxNum * jfbSpacing + this.$rpxNum * (jfbSpacing / cell))
|
|
312
|
-
return {
|
|
313
|
-
marginTop: jfbSpacing + 'rpx',
|
|
314
|
-
marginRight: (index + 1) % cell === 0 ? '0' : jfbSpacing + 'rpx',
|
|
315
|
-
width: `calc(${maxW}vw - ${padding}px)`,
|
|
316
|
-
overflow: 'hidden'
|
|
317
|
-
};
|
|
318
|
-
},
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
184
|
/**
|
|
323
185
|
* @description 获取吸顶样式
|
|
324
186
|
* @param options {Object} 样式参数
|
|
@@ -330,23 +192,15 @@ export default {
|
|
|
330
192
|
* @param options.height 距离底部距离(paddingBottom和height选其一即可)
|
|
331
193
|
* @param options.zIndex
|
|
332
194
|
* @param type {String} 吸顶类型 其值:bottom/top
|
|
333
|
-
* @param fixed {Boolean} 是否吸顶或者占位
|
|
334
195
|
* @return {String}
|
|
335
196
|
*/
|
|
336
|
-
fixedStyle(options = {}, type = 'bottom'
|
|
197
|
+
fixedStyle(options = {}, type = 'bottom') {
|
|
337
198
|
let paddingBottom = options.paddingBottom || options.height || 0;
|
|
338
199
|
if (options.paddingBottom) delete options.paddingBottom;
|
|
339
200
|
if (options.height) delete options.height;
|
|
340
201
|
let obj = Object.assign({}, {
|
|
341
202
|
top: 0, left: 0, right: 0, bottom: 0, zIndex: 100,
|
|
342
203
|
}, options);
|
|
343
|
-
if (!fixed) {
|
|
344
|
-
let padding = (this.layoutInfo.bottomHeight + this.layoutInfo.footerHeight + paddingBottom) * this.$rpxNum;
|
|
345
|
-
let sy = `padding-bottom:calc(${padding}px + constant(safe-area-inset-bottom));`;
|
|
346
|
-
sy = `${style}; padding-bottom:calc(${padding}px + env(safe-area-inset-bottom));`;
|
|
347
|
-
return sy;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
204
|
let style = 'position: fixed';
|
|
351
205
|
style = `${style};left:${obj.left}rpx`;
|
|
352
206
|
style = `${style};right:${obj.right}rpx`;
|
|
@@ -363,7 +217,6 @@ export default {
|
|
|
363
217
|
return style;
|
|
364
218
|
},
|
|
365
219
|
|
|
366
|
-
|
|
367
220
|
/**
|
|
368
221
|
* 检查插件是否加载成功
|
|
369
222
|
*/
|
|
@@ -373,15 +226,10 @@ export default {
|
|
|
373
226
|
* @description 业务组件风格map到data中
|
|
374
227
|
*/
|
|
375
228
|
initThemesToData() {
|
|
376
|
-
let current = {};
|
|
377
229
|
Object.keys(this.styles).map(key => {
|
|
378
230
|
let k = key.replace('$', '');
|
|
379
|
-
if (this[k] !== undefined)
|
|
380
|
-
this[k] = this.styles[key];
|
|
381
|
-
current[k] = this.styles[key];
|
|
382
|
-
}
|
|
231
|
+
if (this[k] !== undefined) this[k] = this.styles[key];
|
|
383
232
|
});
|
|
384
|
-
this.setCurrentStyle(helper.cloneDeep(current))
|
|
385
233
|
},
|
|
386
234
|
|
|
387
235
|
/**
|
|
@@ -397,7 +245,6 @@ export default {
|
|
|
397
245
|
* @description 点击删除操作按钮
|
|
398
246
|
*/
|
|
399
247
|
delEdit() {
|
|
400
|
-
if(this.isReferenceTemplate) return;
|
|
401
248
|
XdBus.send('onDelPackage', {
|
|
402
249
|
containerId: this.containerId,
|
|
403
250
|
componentAtrr: this.componentAtrr,
|
|
@@ -453,176 +300,6 @@ export default {
|
|
|
453
300
|
})
|
|
454
301
|
//#endif
|
|
455
302
|
},
|
|
456
|
-
|
|
457
|
-
checkValue(value, dValue = 0){
|
|
458
|
-
if(value === undefined || value === '' || value === null) return dValue;
|
|
459
|
-
return Number(value || 0);
|
|
460
|
-
},
|
|
461
|
-
|
|
462
|
-
getXdShadow(defaultObj, newObj){
|
|
463
|
-
if(newObj.type === 'N' || this.$xdUniHelper.isEmpty(newObj)) return `0 0 0 rgba(0,0,0,0)`;
|
|
464
|
-
let width = defaultObj.width;
|
|
465
|
-
let color = defaultObj.color;
|
|
466
|
-
if(newObj.value !== null) {
|
|
467
|
-
if(newObj.value.width) width = newObj.value.width;
|
|
468
|
-
if(newObj.value.color) color = newObj.value.color
|
|
469
|
-
}
|
|
470
|
-
return `0 0 ${width}rpx ${color}`;
|
|
471
|
-
},
|
|
472
|
-
|
|
473
|
-
getXdBorder(defaultObj, newObj){
|
|
474
|
-
if(newObj.type === 'N' || this.$xdUniHelper.isEmpty(newObj)) return `0`
|
|
475
|
-
let width = defaultObj.width;
|
|
476
|
-
let color = defaultObj.color;
|
|
477
|
-
if(newObj.value !== null) {
|
|
478
|
-
if(newObj.value.width) width = newObj.value.width
|
|
479
|
-
if(newObj.value.color) color = newObj.value.color
|
|
480
|
-
}
|
|
481
|
-
return `${width}rpx solid ${color}`;
|
|
482
|
-
},
|
|
483
|
-
|
|
484
|
-
getUrlCallback(path){
|
|
485
|
-
if(this.inCallbackUrlOrg) {
|
|
486
|
-
if(path.indexOf('?') === -1) path = `${path}?inCallback=${this.inCallbackUrlOrg}`;
|
|
487
|
-
else path = `${path}&inCallback=${this.inCallbackUrlOrg}`;
|
|
488
|
-
}
|
|
489
|
-
return path
|
|
490
|
-
},
|
|
491
|
-
|
|
492
|
-
baiduTogcj(bd_lng, bd_lat) {//坐标第转换
|
|
493
|
-
const x_PI = 3.14159265358979324 * 3000.0 / 180.0;
|
|
494
|
-
const x = bd_lng - 0.0065;
|
|
495
|
-
const y = bd_lat - 0.006;
|
|
496
|
-
const z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_PI);
|
|
497
|
-
const theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_PI);
|
|
498
|
-
const gg_lng = z * Math.cos(theta);
|
|
499
|
-
const gg_lat = z * Math.sin(theta);
|
|
500
|
-
return [gg_lng, gg_lat]
|
|
501
|
-
},
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
//#ifdef H5
|
|
505
|
-
webChatEnvOpenLocation({latitude,longitude,name, address}, cb){
|
|
506
|
-
store.dispatch('getH5WxAuthorize',{jsApiList: ['openLocation', 'getLocation']})
|
|
507
|
-
.then(({jwxSDK})=>{
|
|
508
|
-
let zb = this.baiduTogcj(latitude, longitude)
|
|
509
|
-
jwxSDK.openLocation({
|
|
510
|
-
latitude: zb[0],
|
|
511
|
-
longitude:zb[1],
|
|
512
|
-
name: name || '我的位置',
|
|
513
|
-
address: address||'',
|
|
514
|
-
scale: 15,
|
|
515
|
-
infoUrl: ''
|
|
516
|
-
});
|
|
517
|
-
})
|
|
518
|
-
.catch(err=>{
|
|
519
|
-
console.error(err)
|
|
520
|
-
this.$xdAlert({
|
|
521
|
-
content:'暂时不支持唤起APP导航功能',
|
|
522
|
-
time:5000,
|
|
523
|
-
})
|
|
524
|
-
})
|
|
525
|
-
},
|
|
526
|
-
//#endif
|
|
527
|
-
|
|
528
|
-
handleOpenLocation({latitude,longitude, name, address}, cb){
|
|
529
|
-
//latitude = latitude||39.961521814959795;
|
|
530
|
-
//longitude = longitude || 116.84499635227222
|
|
531
|
-
|
|
532
|
-
if(typeof latitude === 'string') latitude = Number(latitude);
|
|
533
|
-
if(typeof longitude === 'string') longitude = Number(longitude);
|
|
534
|
-
|
|
535
|
-
//#ifdef MP-WEIXIN
|
|
536
|
-
let zb = this.baiduTogcj(latitude, longitude);
|
|
537
|
-
uni.openLocation({
|
|
538
|
-
latitude: zb[0],
|
|
539
|
-
longitude: zb[1],
|
|
540
|
-
name: name || '我的位置',
|
|
541
|
-
scale: 15,
|
|
542
|
-
address: address ||'',
|
|
543
|
-
success: function () {
|
|
544
|
-
if(typeof cb === 'function') {
|
|
545
|
-
cb();
|
|
546
|
-
}
|
|
547
|
-
console.log('success');
|
|
548
|
-
}
|
|
549
|
-
});
|
|
550
|
-
//#endif
|
|
551
|
-
//#ifdef H5
|
|
552
|
-
if(isWechat()) this.webChatEnvOpenLocation({latitude,longitude, name, address}, cb);
|
|
553
|
-
else {
|
|
554
|
-
let params = '';
|
|
555
|
-
params = `${params}&location=${latitude},${longitude}`;
|
|
556
|
-
params = `${params}&title=${encodeURIComponent(name)}`;
|
|
557
|
-
params = `${params}&content=${encodeURIComponent(address)}&output=html&zoom=15`;
|
|
558
|
-
window.location.href = `http://api.map.baidu.com/marker?${params}`;
|
|
559
|
-
}
|
|
560
|
-
//#endif
|
|
561
|
-
},
|
|
562
|
-
|
|
563
|
-
getUrlHasSpStr(pathDir){
|
|
564
|
-
if(pathDir.indexOf('@site_domain@/') === 0) {
|
|
565
|
-
return pathDir.replace('@site_domain@/','').split('/')[0]
|
|
566
|
-
}
|
|
567
|
-
return ''
|
|
568
|
-
},
|
|
569
|
-
|
|
570
|
-
/**
|
|
571
|
-
* @description 过滤不可以用
|
|
572
|
-
* 当前项目未H5时,过滤所有小程序应用
|
|
573
|
-
* 当前项目未小程序时,过滤所有非当前小程序应用
|
|
574
|
-
* 站外地址直接返回
|
|
575
|
-
* 站内地址未选值直接返回
|
|
576
|
-
* 预览模式全过
|
|
577
|
-
* @param url {object}
|
|
578
|
-
*/
|
|
579
|
-
checkUrlIsValid(url){
|
|
580
|
-
if(!url) return null;
|
|
581
|
-
try {
|
|
582
|
-
|
|
583
|
-
}catch (e){
|
|
584
|
-
return null;
|
|
585
|
-
}
|
|
586
|
-
// let content = list.filter(item=>{
|
|
587
|
-
// //预览模式
|
|
588
|
-
// if(this.$configProject.isPreview) return true;
|
|
589
|
-
//
|
|
590
|
-
// //非内部应用
|
|
591
|
-
// if(item.redirect_type !== 'INN') return true
|
|
592
|
-
//
|
|
593
|
-
// //没有配置链接
|
|
594
|
-
// if(!item.redirect_data) return true;
|
|
595
|
-
//
|
|
596
|
-
// //内部应用
|
|
597
|
-
// else {
|
|
598
|
-
// let redirect_data;
|
|
599
|
-
// try {
|
|
600
|
-
// redirect_data = JSON.parse(item.redirect_data);
|
|
601
|
-
// if(!item['app_type']) item['app_type']= 'h5';
|
|
602
|
-
//
|
|
603
|
-
// //#ifdef H5
|
|
604
|
-
// return item['app_type'] !== 'wxmp';
|
|
605
|
-
// //#endif
|
|
606
|
-
//
|
|
607
|
-
// //#ifdef MP-WEIXIN
|
|
608
|
-
// let actDir = this.$parent.projectAttr.deploy_dir;
|
|
609
|
-
// let dir = this.getPathDir(redirect_data.page);
|
|
610
|
-
// if(item['app_type'] === 'wxmp'){
|
|
611
|
-
// return actDir === dir;
|
|
612
|
-
// }
|
|
613
|
-
// else if(item['app_type'] === 'h5') return true;
|
|
614
|
-
// else return true
|
|
615
|
-
// //#endif
|
|
616
|
-
// }
|
|
617
|
-
// catch (e) {
|
|
618
|
-
// return true
|
|
619
|
-
// }
|
|
620
|
-
// }
|
|
621
|
-
// });
|
|
622
|
-
// console.warn(`PostersList:${JSON.stringify(content.map(item=>`${item.app_type}:${item.content_name}:${item.redirect_data}`), null,2)}`)
|
|
623
|
-
// return content;
|
|
624
|
-
|
|
625
|
-
},
|
|
626
303
|
}
|
|
627
304
|
}
|
|
628
305
|
|