Commit 7e1b81e3073e10ae2b2425a6f0061a2a07855c5d

Authored by vking
1 parent c1638503

测速上报

... ... @@ -70,6 +70,8 @@ Page({
hasGetLocation:false,//定位信息
hasAppHide:false,//app切至后台
onLoad: async function (options) {
this.reportTime=new Date()
this.hasOnLoad=true;
// this.qqmapsdk=new QQMapWX({
// key: 'SDEBZ-I74W4-QLGUX-XXYXU-HIR23-3QFBJ'
... ... @@ -130,6 +132,9 @@ Page({
},
mapDataLast:null,//最后一次成功视角,防止地图视角丢失
onReady: function () {
if (wx.canIUse('reportPerformance')) {
wx.reportPerformance(2002, new Date()-this.reportTime)
}
this.mapCtx = wx.createMapContext('map')
// this.mapCtx.moveToLocation({
// success:(res)=>{
... ...
... ... @@ -147,7 +147,8 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr
'content-type': 'application/x-www-form-urlencoded'
},
success: function (res) {
console.log('request.api[' + (new Date() - stime) + 'ms]==>', host + cache_key + '\nrequest.success', res.data);
let hs=(new Date() - stime)
console.log('request.api[' + hs + 'ms]==>', host + cache_key + '\nrequest.success', res.data);
// return;
//bot.msg({url: host + cache_key, res: res.data})
if (res.data) {
... ... @@ -193,6 +194,10 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr
}
},
complete: function () {
let hs=(new Date() - stime)
if (wx.canIUse('reportPerformance')) {
wx.reportPerformance(1001, hs)
}
wx.hideLoading();
}
})
... ...