gxd-uni-library-editx 1.0.8-beta151 → 1.0.8-beta153
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,26 @@
|
|
|
103
103
|
let timer = null;
|
|
104
104
|
let time = 3000;
|
|
105
105
|
let status = false;
|
|
106
|
+
let startTime = new Date().getTime();
|
|
107
|
+
let startTimeLocalString = 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
|
+
let nowTime = new Date()
|
|
116
|
+
this.$xdLog.setARMSCustomError(`api_location_timeout_${time}`,{
|
|
117
|
+
...logCityInfo,
|
|
118
|
+
startTime,
|
|
119
|
+
startTimeLocalString,
|
|
120
|
+
endTime: nowTime.getTime(),
|
|
121
|
+
endTimeLocalString: nowTime.toLocaleString(),
|
|
122
|
+
errMsg: 'request:fail timeout'
|
|
123
|
+
});
|
|
124
|
+
|
|
112
125
|
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
126
|
this.setCityInfo(cityInfo);
|
|
117
127
|
status = true;
|
|
118
128
|
resolve()
|
|
@@ -122,7 +132,12 @@
|
|
|
122
132
|
.then(cityInfo => {
|
|
123
133
|
//返回数据中没有city_code和city_name
|
|
124
134
|
if (!cityInfo.city_code || !cityInfo.city_name) {
|
|
125
|
-
this.$xdLog.setARMSCustomError('api_location_back_value_fail',
|
|
135
|
+
this.$xdLog.setARMSCustomError('api_location_back_value_fail', {
|
|
136
|
+
cityInfo,
|
|
137
|
+
logCityInfo,
|
|
138
|
+
startTime,
|
|
139
|
+
startTimeLocalString
|
|
140
|
+
});
|
|
126
141
|
cityInfo = this.$settings.defaultCity;
|
|
127
142
|
}
|
|
128
143
|
this.setCityInfo(cityInfo);
|
|
@@ -131,7 +146,13 @@
|
|
|
131
146
|
})
|
|
132
147
|
.catch(error => {
|
|
133
148
|
if (status) return;
|
|
134
|
-
this.$xdLog.
|
|
149
|
+
this.$xdLog.setARMSCustomError('api_location_fail', {
|
|
150
|
+
error,
|
|
151
|
+
logCityInfo,
|
|
152
|
+
startTime,
|
|
153
|
+
useTime: new Date().getTime() - startTime,
|
|
154
|
+
startTimeLocalString
|
|
155
|
+
});
|
|
135
156
|
let cityInfo = this.$settings.defaultCity;
|
|
136
157
|
this.setCityInfo(cityInfo);
|
|
137
158
|
clearTimeout(timer);
|
|
@@ -143,7 +164,7 @@
|
|
|
143
164
|
else {
|
|
144
165
|
let cityInfo = this.$settings.defaultCity;
|
|
145
166
|
this.setCityInfo(cityInfo);
|
|
146
|
-
this.$xdLog.setARMSCustomError('
|
|
167
|
+
this.$xdLog.setARMSCustomError('three_location_fail', {stateLocation: this.stateLocation, cityInfo});
|
|
147
168
|
resolve()
|
|
148
169
|
}
|
|
149
170
|
})
|
|
@@ -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/IiBpZD0iVz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AAAAElFTkSuQmCC',
|
|
@@ -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;
|
|
@@ -461,6 +494,13 @@
|
|
|
461
494
|
this.getSafeBottom();
|
|
462
495
|
}
|
|
463
496
|
|
|
497
|
+
//初始化
|
|
498
|
+
getApp().globalData.$vm = getApp().globalData.$vm || this;
|
|
499
|
+
let xdApp = getApp().globalData.$xd = XdAppClass(this);
|
|
500
|
+
xdApp.xdInit((app) => {
|
|
501
|
+
console.log(app)
|
|
502
|
+
});
|
|
503
|
+
|
|
464
504
|
},
|
|
465
505
|
mounted(){
|
|
466
506
|
this.$nextTick(()=>{
|
|
@@ -485,6 +525,14 @@
|
|
|
485
525
|
},
|
|
486
526
|
|
|
487
527
|
methods: {
|
|
528
|
+
doneLayoutAndLocation(){
|
|
529
|
+
if (this.locationStatus && this.layoutLoading) {
|
|
530
|
+
this.$emit('onDone', this.getLayoutInfo);
|
|
531
|
+
this.$emit('done', this.getLayoutInfo);
|
|
532
|
+
this.$xdLog.setProject('Layout.init.done', {...this.getLayoutInfo, time: new Date().getTime() - this.startTime})
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
|
|
488
536
|
/**
|
|
489
537
|
* @description 获取胶囊相关数据
|
|
490
538
|
*/
|
|
@@ -629,8 +677,7 @@
|
|
|
629
677
|
},
|
|
630
678
|
|
|
631
679
|
doneEvent(){
|
|
632
|
-
this
|
|
633
|
-
this.$emit('done', this.getLayoutInfo);
|
|
680
|
+
this.layoutLoading = true;
|
|
634
681
|
},
|
|
635
682
|
|
|
636
683
|
}
|
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(){
|