Complete core mini program flows
This commit is contained in:
@@ -9,15 +9,23 @@ Page({
|
||||
},
|
||||
onLoad(options) {
|
||||
this.token = options.token;
|
||||
if (!this.token) this.setData({ status: "分享链接无效" });
|
||||
},
|
||||
onShow() {
|
||||
if (!this.token) return;
|
||||
this.load();
|
||||
clearInterval(this.timer);
|
||||
this.timer = setInterval(() => this.load(), 15000);
|
||||
},
|
||||
onHide() {
|
||||
clearInterval(this.timer);
|
||||
},
|
||||
onUnload() {
|
||||
clearInterval(this.timer);
|
||||
},
|
||||
async load() {
|
||||
try {
|
||||
const p = await request("/share/walk/" + this.token);
|
||||
const p = await request("/share/walk/" + this.token, "GET", null, false);
|
||||
this.setData({
|
||||
latitude: p.latitude,
|
||||
longitude: p.longitude,
|
||||
|
||||
Reference in New Issue
Block a user