gxd-uni-library-editx 1.0.8-beta151 → 1.0.8-beta152
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
|
@@ -103,16 +103,23 @@
|
|
|
103
103
|
let timer = null;
|
|
104
104
|
let time = 3000;
|
|
105
105
|
let status = false;
|
|
106
|
+
let startTime = new Date().getTime();
|
|
107
|
+
let startTimeLocal = new Date().toLocaleString();
|
|
108
|
+
let logCityInfo = JSON.parse(JSON.stringify(this.$settings.defaultCity));
|
|
109
|
+
|
|
106
110
|
return new Promise((resolve, reject)=>{
|
|
107
111
|
//定位成功
|
|
108
112
|
if (this.stateLocation) {
|
|
109
|
-
|
|
110
113
|
//接口3秒无返回结果
|
|
111
114
|
timer = setTimeout(()=>{
|
|
115
|
+
this.$xdLog.setARMSCustomError(`api_location_timeout_${time}`,{
|
|
116
|
+
...logCityInfo,
|
|
117
|
+
startTime,
|
|
118
|
+
startTimeLocal,
|
|
119
|
+
errMsg: 'request:fail timeout'
|
|
120
|
+
});
|
|
121
|
+
|
|
112
122
|
let cityInfo = this.$settings.defaultCity;
|
|
113
|
-
this.$xdLog.setARMSCustomError(`api_location_timeout_${time}`,
|
|
114
|
-
JSON.parse(JSON.stringify({...cityInfo, errMsg: 'request:fail timeout'}))
|
|
115
|
-
);
|
|
116
123
|
this.setCityInfo(cityInfo);
|
|
117
124
|
status = true;
|
|
118
125
|
resolve()
|
|
@@ -122,7 +129,7 @@
|
|
|
122
129
|
.then(cityInfo => {
|
|
123
130
|
//返回数据中没有city_code和city_name
|
|
124
131
|
if (!cityInfo.city_code || !cityInfo.city_name) {
|
|
125
|
-
this.$xdLog.setARMSCustomError('api_location_back_value_fail',
|
|
132
|
+
this.$xdLog.setARMSCustomError('api_location_back_value_fail', {cityInfo, logCityInfo, startTime, startTimeLocal});
|
|
126
133
|
cityInfo = this.$settings.defaultCity;
|
|
127
134
|
}
|
|
128
135
|
this.setCityInfo(cityInfo);
|
|
@@ -131,7 +138,13 @@
|
|
|
131
138
|
})
|
|
132
139
|
.catch(error => {
|
|
133
140
|
if (status) return;
|
|
134
|
-
this.$xdLog.
|
|
141
|
+
this.$xdLog.setARMSCustomError('api_location_fail', {
|
|
142
|
+
error,
|
|
143
|
+
logCityInfo,
|
|
144
|
+
startTime,
|
|
145
|
+
useTime: new Date().getTime() - startTime,
|
|
146
|
+
startTimeLocal
|
|
147
|
+
});
|
|
135
148
|
let cityInfo = this.$settings.defaultCity;
|
|
136
149
|
this.setCityInfo(cityInfo);
|
|
137
150
|
clearTimeout(timer);
|
|
@@ -243,7 +243,7 @@ export default {
|
|
|
243
243
|
contentAlign
|
|
244
244
|
} = this.form;
|
|
245
245
|
this.labelPos = this.labelPosition ? this.labelPosition : labelPosition;
|
|
246
|
-
this.contentAlign = contentAlign;
|
|
246
|
+
//this.contentAlign = contentAlign;
|
|
247
247
|
|
|
248
248
|
if(this.label){
|
|
249
249
|
this.labelWid = (this.labelWidth ? this.labelWidth : (labelWidth||140))
|
|
@@ -112,6 +112,11 @@
|
|
|
112
112
|
<xd-tips v-if="getLayoutInfo" :get-layout-info="getLayoutInfo"></xd-tips>
|
|
113
113
|
<view class="xd-Layout__padding" id="xd-Layout__padding"></view>
|
|
114
114
|
<view class="xd-Layout__padding-placeholder" :style="{backgroundColor: background}"></view>
|
|
115
|
+
<xd-city-show-api
|
|
116
|
+
v-if="open"
|
|
117
|
+
:get-city-info-by-location="getCityInfoByLocation"
|
|
118
|
+
@done="handleLocationDone"
|
|
119
|
+
></xd-city-show-api>
|
|
115
120
|
</view>
|
|
116
121
|
</template>
|
|
117
122
|
|
|
@@ -122,6 +127,9 @@
|
|
|
122
127
|
import XdConfirm from "@/components/XdConfirm/XdConfirm";
|
|
123
128
|
import XdLoading from "@/components/XdLoading/XdLoading";
|
|
124
129
|
import XdTips from "@/components/XdTips/XdTips";
|
|
130
|
+
import XdCityShowApi from "@/components/XdCityShowApi/XdCityShowApi";
|
|
131
|
+
import locationMixins from "@/mixins/locationMixins";
|
|
132
|
+
import XdAppClass from "@/XdAppClass";
|
|
125
133
|
import {mapState} from 'vuex';
|
|
126
134
|
|
|
127
135
|
|
|
@@ -158,7 +166,9 @@
|
|
|
158
166
|
XdFontIcon,
|
|
159
167
|
XdFooterTabbar,
|
|
160
168
|
XdBar,
|
|
169
|
+
XdCityShowApi
|
|
161
170
|
},
|
|
171
|
+
mixins: [locationMixins],
|
|
162
172
|
props: {
|
|
163
173
|
topHeight: {
|
|
164
174
|
type: Number,
|
|
@@ -246,7 +256,12 @@
|
|
|
246
256
|
},
|
|
247
257
|
data() {
|
|
248
258
|
return {
|
|
259
|
+
//定位
|
|
260
|
+
open: false,
|
|
261
|
+
layoutLoading: false,
|
|
249
262
|
startTime: new Date().getTime(),
|
|
263
|
+
|
|
264
|
+
|
|
250
265
|
startAnimation : false, //开始动画效果
|
|
251
266
|
doneAnimation: false, //完成动画效果
|
|
252
267
|
defaultImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MDM4QTUyMkNDRUQyMTFFQzkzRTZDOUJBNTFBNTA3RDUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MDM4QTUyMkRDRUQyMTFFQzkzRTZDOUJBNTFBNTA3RDUiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDozMkE3N0VGRkNFRDAxMUVDOTNFNkM5QkE1MUE1MDdENSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDozMkE3N0YwMENFRDAxMUVDOTNFNkM5QkE1MUE1MDdENSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PliHXlsAAAAQSURBVHjaYvj//z8DQIABAAj8Av7bok0WAAAAAElFTkSuQmCC',
|
|
@@ -347,7 +362,6 @@
|
|
|
347
362
|
return bgImg
|
|
348
363
|
},
|
|
349
364
|
|
|
350
|
-
|
|
351
365
|
getBottom(){
|
|
352
366
|
return this.footerHeight
|
|
353
367
|
},
|
|
@@ -419,12 +433,31 @@
|
|
|
419
433
|
},
|
|
420
434
|
logs(value){
|
|
421
435
|
this.uiLogs = value;
|
|
436
|
+
},
|
|
437
|
+
|
|
438
|
+
//框架加载完成
|
|
439
|
+
layoutLoading(){
|
|
440
|
+
this.doneLayoutAndLocation()
|
|
441
|
+
},
|
|
442
|
+
|
|
443
|
+
//定位完成
|
|
444
|
+
locationStatus(){
|
|
445
|
+
this.doneLayoutAndLocation()
|
|
422
446
|
}
|
|
423
447
|
},
|
|
424
448
|
|
|
425
449
|
created() {
|
|
450
|
+
uni.showNavigationBarLoading();
|
|
426
451
|
this.wiewType = this.$configProject.isPreview;
|
|
427
452
|
this.systemInfoSyn = uni.getSystemInfoSync();
|
|
453
|
+
|
|
454
|
+
if (this.$configProject.isPreview === false
|
|
455
|
+
&& this.$configProject.extras
|
|
456
|
+
&& this.$configProject.extras.is_open_location === 'Y'
|
|
457
|
+
) {
|
|
458
|
+
this.open = true;
|
|
459
|
+
}
|
|
460
|
+
else this.locationStatus = true;
|
|
428
461
|
|
|
429
462
|
//切换页面之后数据清空
|
|
430
463
|
this.uiErrorLogs = this.errorLogs;
|
|
@@ -485,6 +518,19 @@
|
|
|
485
518
|
},
|
|
486
519
|
|
|
487
520
|
methods: {
|
|
521
|
+
doneLayoutAndLocation(){
|
|
522
|
+
if (this.locationStatus && this.layoutLoading) {
|
|
523
|
+
getApp().globalData.$vm = this;
|
|
524
|
+
let xdApp = getApp().globalData.$xd = XdAppClass(this);
|
|
525
|
+
xdApp.xdInit((app) => {
|
|
526
|
+
console.log(app)
|
|
527
|
+
});
|
|
528
|
+
this.$emit('onDone', this.getLayoutInfo);
|
|
529
|
+
this.$emit('done', this.getLayoutInfo);
|
|
530
|
+
this.$xdLog.setProject('Layout.init.done', {...this.getLayoutInfo, time: new Date().getTime() - this.startTime})
|
|
531
|
+
}
|
|
532
|
+
},
|
|
533
|
+
|
|
488
534
|
/**
|
|
489
535
|
* @description 获取胶囊相关数据
|
|
490
536
|
*/
|
|
@@ -629,8 +675,7 @@
|
|
|
629
675
|
},
|
|
630
676
|
|
|
631
677
|
doneEvent(){
|
|
632
|
-
this
|
|
633
|
-
this.$emit('done', this.getLayoutInfo);
|
|
678
|
+
this.layoutLoading = true;
|
|
634
679
|
},
|
|
635
680
|
|
|
636
681
|
}
|
package/src/utils/xdh5log.js
CHANGED
|
@@ -134,17 +134,7 @@ class Logs {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
//减少上报
|
|
137
|
-
|
|
138
|
-
if(reg.test(eventName)) {
|
|
139
|
-
if(cookie.get('jfb_' + eventName)) return;
|
|
140
|
-
let status = __bl.custom({data: params, c1: eventName});
|
|
141
|
-
if(status) {
|
|
142
|
-
setTimeout(() => {
|
|
143
|
-
cookie.set('jfb_' + eventName, true);
|
|
144
|
-
}, 1000)
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
else __bl.custom({data: params, c1: eventName})
|
|
137
|
+
__bl.custom({data: params, c1: eventName})
|
|
148
138
|
}
|
|
149
139
|
|
|
150
140
|
setProject(pos, params){
|
|
@@ -155,7 +145,7 @@ class Logs {
|
|
|
155
145
|
date: new Date().toLocaleString(),
|
|
156
146
|
...params
|
|
157
147
|
}, 'project_init');
|
|
158
|
-
cookie.set('jfb_' + pos, true);
|
|
148
|
+
cookie.set('jfb_' + pos, true, {expires: 1/6});
|
|
159
149
|
}
|
|
160
150
|
|
|
161
151
|
getARMS(){
|