邹能昇 hace 2 meses
padre
commit
5ad83729e4
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  1. 5 2
      nova-werun/pages/home/sport/sport-start/index.js

+ 5 - 2
nova-werun/pages/home/sport/sport-start/index.js

@@ -316,8 +316,7 @@ Page({
                 // 这里可以处理位置变化的逻辑
                 console.log('位置已更新:', res);
             });
-            that.progressdate()
-            that.progressActivitydate()
+
         }, 1000);
 
         this.setData({
@@ -475,6 +474,10 @@ Page({
             // 更新总距离
             const totalDistance = parseFloat((Number(this.data.distance) + Number(distance)).toFixed(3));
 
+            if(totalDistance!=this.data.distance){
+                this.progressdate()
+                this.progressActivitydate()
+            }
             // 计算卡路里
             const calorie = this.getCalorie(60, totalDistance); // 假设体重为60kg