|
@@ -13,18 +13,21 @@ Page({
|
|
|
contentHeight: 0, // 可用内容高度
|
|
|
contentHeight2: 0,
|
|
|
contentpadding: 0, //顶部padding高度
|
|
|
+ navheight: 0,
|
|
|
//地图
|
|
|
longitude: 0,
|
|
|
latitude: 0,
|
|
|
markers: [],
|
|
|
//是否暂停
|
|
|
- isstop:false,
|
|
|
+ isstop: false,
|
|
|
//标题
|
|
|
- title:'',
|
|
|
+ title: '',
|
|
|
|
|
|
percentage: '',
|
|
|
timer: null,
|
|
|
startTime: 0,
|
|
|
+
|
|
|
+ show: false,
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -38,19 +41,19 @@ Page({
|
|
|
const custom = wx.getMenuButtonBoundingClientRect();
|
|
|
const customHeight = custom.height + 10 + 2 || 0;
|
|
|
const bottomNavHeight = systemInfo.screenHeight - systemInfo.safeArea.bottom || 0;
|
|
|
-
|
|
|
- const contentpadding = (statusBarHeight + customHeight) * 750 / systemInfo.windowWidth;
|
|
|
- const contentHeight = (screenHeight - bottomNavHeight - statusBarHeight - customHeight) * 750 / systemInfo.windowWidth;
|
|
|
+ const navheight = (statusBarHeight + customHeight) * 750 / systemInfo.windowWidth;
|
|
|
+ const contentHeight = (screenHeight - bottomNavHeight) * 750 / systemInfo.windowWidth;
|
|
|
this.setData({
|
|
|
statusBarHeight,
|
|
|
screenHeight,
|
|
|
customHeight,
|
|
|
bottomNavHeight,
|
|
|
- contentpadding,
|
|
|
- contentHeight
|
|
|
+ contentHeight,
|
|
|
+ navheight,
|
|
|
});
|
|
|
+ console.log(navheight);
|
|
|
this.setData({
|
|
|
- title:options.id
|
|
|
+ title: options.id
|
|
|
})
|
|
|
//地图
|
|
|
this.Getlocation()
|
|
@@ -169,13 +172,14 @@ Page({
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- stop(){
|
|
|
-
|
|
|
+ stop() {
|
|
|
+
|
|
|
this.setData({
|
|
|
- isstop:!this.data.isstop
|
|
|
+ isstop: !this.data.isstop
|
|
|
})
|
|
|
console.log(this.data.isstop);
|
|
|
},
|
|
|
+ //结束光环展示
|
|
|
startIncrease() {
|
|
|
// 记录开始时间
|
|
|
this.setData({
|
|
@@ -198,6 +202,17 @@ Page({
|
|
|
percentage: `conic-gradient(from 0deg, #015EEA ${percentage}%, white 0%)`,
|
|
|
});
|
|
|
|
|
|
+ if(percentage >= 100){
|
|
|
+ setTimeout(()=>{
|
|
|
+ wx.showToast({
|
|
|
+ title: '运动已结束',
|
|
|
+ icon: 'success',
|
|
|
+ duration: 500
|
|
|
+ });
|
|
|
+ },500)
|
|
|
+ this.onConfirm()
|
|
|
+ }
|
|
|
+
|
|
|
// 如果达到 100%,清除定时器
|
|
|
if (percentage >= 100) {
|
|
|
clearInterval(this.data.timer);
|
|
@@ -226,5 +241,25 @@ Page({
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ //点击返回按钮
|
|
|
+ goback() {
|
|
|
+ this.setData({
|
|
|
+ show: true,
|
|
|
+ isstop: false,
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //取消弹窗
|
|
|
+ onClose() {
|
|
|
+ this.setData({
|
|
|
+ show: false
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //确认返回
|
|
|
+ onConfirm(){
|
|
|
+ wx.navigateBack({
|
|
|
+ delta: 1 // 返回的页面层数,1 表示返回上一页
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
})
|