|
|
@ -72,6 +72,7 @@ Page({ |
|
|
point: null, |
|
|
point: null, |
|
|
resolution: null, |
|
|
resolution: null, |
|
|
showBannerToast: false, |
|
|
showBannerToast: false, |
|
|
|
|
|
initCbs: [], |
|
|
}, |
|
|
}, |
|
|
async sendArriveMsg() { |
|
|
async sendArriveMsg() { |
|
|
try { |
|
|
try { |
|
|
@ -137,9 +138,24 @@ Page({ |
|
|
/** |
|
|
/** |
|
|
* 生命周期函数--监听页面加载 |
|
|
* 生命周期函数--监听页面加载 |
|
|
*/ |
|
|
*/ |
|
|
async onLoad({ e, searchType = 0 }) { |
|
|
|
|
|
|
|
|
async onLoad({ e, searchType = 0, q, floorId }) { |
|
|
this.hasArriveMsgSent = false; |
|
|
this.hasArriveMsgSent = false; |
|
|
this.frameIndex = 0; |
|
|
|
|
|
|
|
|
if (q) { |
|
|
|
|
|
console.log(q); |
|
|
|
|
|
try { |
|
|
|
|
|
q = decodeURIComponent(q); |
|
|
|
|
|
console.log(q); |
|
|
|
|
|
const kvs = q |
|
|
|
|
|
.split("?") |
|
|
|
|
|
.pop() |
|
|
|
|
|
.split("&") |
|
|
|
|
|
.map((kv) => kv.split("=")); |
|
|
|
|
|
e = kvs.find(([k]) => k === "e")[1]; |
|
|
|
|
|
floorId = kvs.find(([k]) => k === "floorId")[1]; |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.log("处理二维码参数失败", error); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
this.getSystemInfo(); |
|
|
this.getSystemInfo(); |
|
|
wx.setKeepScreenOn({ |
|
|
wx.setKeepScreenOn({ |
|
|
keepScreenOn: true, |
|
|
keepScreenOn: true, |
|
|
@ -161,6 +177,27 @@ Page({ |
|
|
searchType: Number(searchType), |
|
|
searchType: Number(searchType), |
|
|
}); |
|
|
}); |
|
|
this.initSDK(); |
|
|
this.initSDK(); |
|
|
|
|
|
if (floorId) { |
|
|
|
|
|
const floor = floors.find((floor) => floorId === floor.floorId); |
|
|
|
|
|
console.log("初始floorId:", floorId); |
|
|
|
|
|
if (!this.data.inited) { |
|
|
|
|
|
console.log("等待地图初始化"); |
|
|
|
|
|
await new Promise((resolve) => { |
|
|
|
|
|
this.setData({ initCbs: [...this.data.initCbs, resolve] }); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
console.log("地图初始化完成"); |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
gettingFloor: false, |
|
|
|
|
|
floorOrder: floor.floorOrder, |
|
|
|
|
|
point: null, |
|
|
|
|
|
floorId: floor.floorId, |
|
|
|
|
|
floorName: floor.name, |
|
|
|
|
|
state: STATES.startScan, |
|
|
|
|
|
}); |
|
|
|
|
|
return this.requestLocation(true); |
|
|
|
|
|
} |
|
|
|
|
|
if (this.data.floorId) this.requestLocation(true); |
|
|
}, |
|
|
}, |
|
|
initSDK() { |
|
|
initSDK() { |
|
|
this.SDK = new VPASSDK.SDKWrapper(configData); |
|
|
this.SDK = new VPASSDK.SDKWrapper(configData); |
|
|
@ -632,8 +669,10 @@ Page({ |
|
|
}, |
|
|
}, |
|
|
handleMap({ detail }) { |
|
|
handleMap({ detail }) { |
|
|
map = detail; |
|
|
map = detail; |
|
|
|
|
|
this.data.initCbs.forEach((cb) => cb(map)); |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
inited: true, |
|
|
inited: true, |
|
|
|
|
|
initCbs: [], |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
handleTabChange({ detail }) { |
|
|
handleTabChange({ detail }) { |
|
|
|