邹能昇 3 months ago
parent
commit
1bad701ccd

+ 2 - 1
nova-werun/components/home/index.js

@@ -352,6 +352,7 @@ Component({
                     console.error("保存数据时出现错误:", error);
                 }
             }
+          
         },
         //切换
         change() {
@@ -465,6 +466,6 @@ Component({
                     console.log('month顺序');
                 }
             }
-        }
+        },
     }
 })

+ 14 - 2
nova-werun/pages/home/share/index.js

@@ -96,7 +96,7 @@ Page({
     async order() {
         const currentUser = Parse.User.current();
         let ActivityDataquery = new Parse.Query('ActivityData');
-        ActivityDataquery.equalTo('user', currentUser.id);
+        // ActivityDataquery.equalTo('user', currentUser.id);
         ActivityDataquery.equalTo('company', company);
         ActivityDataquery.equalTo('type', 'today');
         ActivityDataquery.notEqualTo('isDeleted', true);
@@ -112,8 +112,11 @@ Page({
         ActivityDataquery.lessThanOrEqualTo('createdAt', todayEnd);
         ActivityDataquery.include('user');
 
+        // 根据 steps 字段进行降序排序
+        ActivityDataquery.descending('steps');
+
         let r = await ActivityDataquery.find();
-        let sharList = r.map(item => {
+        let todayList = r.map(item => {
             let itemData = item.toJSON();
             // 获取当前时间并格式化
             const now = new Date();
@@ -121,6 +124,15 @@ Page({
             itemData.currentTime = formattedTime; // 将当前时间添加到 item 中
             return itemData;
         });
+        let sharList=[]
+        todayList.forEach((item, index) => {
+            if (item.user.objectId == currentUser.id) {
+                sharList.push({
+                    ...item, // 包含用户数据
+                    rank: index + 1 // 计算排名(index 从 0 开始,所以加 1)
+                });
+            }
+        })
 
         this.setData({
             sharList

+ 6 - 2
nova-werun/pages/home/share/index.less

@@ -7,11 +7,14 @@
     .box{
         width: 100%;
         height: 1100rpx;
-        border: solid #808080 1px;
+        border: solid #0178EE 1px;
         border-radius: 15rpx;
+        background: linear-gradient(to bottom, #4F9AF7, #FFFFFF);
+        color: #0178EE;
         .picture{
             width: 100%;
             height: 500rpx;
+            border-radius: 15rpx 15rpx 0 0; 
         }
         .namebox{
             height: 150rpx;
@@ -121,7 +124,7 @@
                     display: flex;
                     align-items: center;
                     justify-content: center;
-                    background-color: #808080;
+                    background-color: #4F9AF7;
                     .image{
                         width: 90rpx;
                         height: 90rpx;
@@ -133,6 +136,7 @@
                     display: flex;
                     justify-content: center;
                     margin-top: 10rpx;
+                    color: #4F9AF7;
                 }
             }
 

+ 3 - 3
nova-werun/pages/home/share/index.wxml

@@ -1,5 +1,5 @@
 <!--nova-werun/pages/home/share/index.wxml-->
-<nav type="back" title="转发分享" background-color="{{'#87ceeb'}}" front-color="{{'#ffffff'}}"></nav>
+<nav type="back" title="转发分享" background-color="{{'#73AEF9'}}" front-color="{{'#ffffff'}}"></nav>
 <view class="all" style="height: {{contentHeight}}rpx;">
     <view class="box">
         <image class="picture" src="https://file-cloud.fmode.cn//tmp/sBX4tFxdGjkk1fea2c9db35cbd67b50b01dd3bae1592.png?imageView2/1/w/200/h/200"></image>
@@ -15,7 +15,7 @@
         <view class="numberbox">
             <view class="num-tex">
                 <view class="nu-nam">今日排名</view>
-                <view class="num">7</view>
+                <view class="num">{{sharList[0].rank}}</view>
             </view>
             <view class="num-tex">
                 <view class="nu-nam">今日步数</view>
@@ -42,7 +42,7 @@
         <view class="share-picbox">
             <view class="share-pic">
                 <view class="share-pic-box">
-                    <image class="image" src="https://file-cloud.fmode.cn/qpFbRRSZrO/20241112/1djefq104546048.png?imageView2/1/w/200/h/200"></image>
+                    <image class="image"  src="https://file-cloud.fmode.cn/qpFbRRSZrO/20241112/1djefq104546048.png?imageView2/1/w/200/h/200"></image>
                 </view>
 
                 <view class="pic-tex">微信</view>

File diff suppressed because it is too large
+ 0 - 0
nova-werun/pages/home/share/index.wxss


+ 2 - 1
nova-werun/pages/home/signin/index.less

@@ -68,7 +68,8 @@
                 justify-content: center;
                 align-items: center;
                 border-radius: 45rpx;
-                background-color: orange;
+                color: white;
+                background-color: #69A9F8;
             }
             .submit2{
                 width: 70%;

+ 1 - 1
nova-werun/pages/home/signin/index.wxml

@@ -1,5 +1,5 @@
 <!--nova-werun/pages/home/signin/index.wxml-->
-<nav type="back" title="打卡签到" background-color="{{'#87ceeb'}}" front-color="{{'#ffffff'}}"></nav>
+<nav type="back" title="打卡签到" background-color="{{'#73AEF9'}}" front-color="{{'#ffffff'}}"></nav>
 <view class="all" style="height: {{contentHeight}}rpx;">
         <view class="picture">
             <image src="{{randomImage}}" mode="aspectFill"></image>

+ 1 - 1
nova-werun/pages/home/signin/index.wxss

@@ -1 +1 @@
-.all{width:100vw}.all .picture{width:100%;height:980rpx;border:gray solid 1px}.all .picture image{width:100%;height:980rpx}.all .textbox{width:100%;height:350rpx}.all .textbox .text{width:100%;height:220rpx;display:flex}.all .textbox .text .chick{width:50%;height:220rpx;display:flex;flex-direction:column;justify-content:center;align-items:center}.all .textbox .text .chick .chick-text{font-size:30rpx;margin-bottom:30rpx}.all .textbox .text .chick .numberbox{display:flex;height:80rpx;font-size:28rpx}.all .textbox .text .chick .numberbox .number{font-size:46rpx;height:80rpx;display:flex;align-items:flex-end;margin:0;padding:0}.all .textbox .text .chick .numberbox .number-text{height:80rpx;display:flex;align-items:flex-end;margin:0;padding:0;padding-bottom:6rpx}.all .textbox .submitbox{width:100%;height:120rpx;display:flex;justify-content:center;align-items:center}.all .textbox .submitbox .submit{width:70%;height:86rpx;display:flex;justify-content:center;align-items:center;border-radius:45rpx;background-color:orange}.all .textbox .submitbox .submit2{width:70%;height:86rpx;display:flex;justify-content:center;align-items:center;border-radius:45rpx;background-color:gray}
+.all{width:100vw}.all .picture{width:100%;height:980rpx;border:gray solid 1px}.all .picture image{width:100%;height:980rpx}.all .textbox{width:100%;height:350rpx}.all .textbox .text{width:100%;height:220rpx;display:flex}.all .textbox .text .chick{width:50%;height:220rpx;display:flex;flex-direction:column;justify-content:center;align-items:center}.all .textbox .text .chick .chick-text{font-size:30rpx;margin-bottom:30rpx}.all .textbox .text .chick .numberbox{display:flex;height:80rpx;font-size:28rpx}.all .textbox .text .chick .numberbox .number{font-size:46rpx;height:80rpx;display:flex;align-items:flex-end;margin:0;padding:0}.all .textbox .text .chick .numberbox .number-text{height:80rpx;display:flex;align-items:flex-end;margin:0;padding:0;padding-bottom:6rpx}.all .textbox .submitbox{width:100%;height:120rpx;display:flex;justify-content:center;align-items:center}.all .textbox .submitbox .submit{width:70%;height:86rpx;display:flex;justify-content:center;align-items:center;border-radius:45rpx;color:white;background-color:#69A9F8}.all .textbox .submitbox .submit2{width:70%;height:86rpx;display:flex;justify-content:center;align-items:center;border-radius:45rpx;background-color:gray}

+ 1 - 1
nova-werun/pages/home/sport/sport-home/index.wxml

@@ -1,5 +1,5 @@
 <!--nova-werun/pages/home/sport/sport-home/index.wxml-->
-<nav type="back" title="运动" background-color="{{'#87ceeb'}}" front-color="{{'#ffffff'}}"></nav>
+<nav type="back" title="运动" background-color="{{'#73AEF9'}}" front-color="{{'#ffffff'}}"></nav>
 <view class="all" style="height: {{contentHeight}}rpx;">
     <!-- 走路 -->
     <van-tabs tab-class='tab' active="{{ active }}" color='#87ceeb' title-active-color='#87ceeb' title-inactive-color='black'>

+ 1 - 1
nova-werun/pages/home/sport/sport-start/index.wxml

@@ -1,5 +1,5 @@
 <!--nova-werun/pages/home/sport/sport-start/index.wxml-->
-<nav type="back" title="{{title}}" background-color="{{'#87ceeb'}}" front-color="{{'#ffffff'}}"></nav>
+<nav type="back" title="{{title}}" background-color="{{'#73AEF9'}}" front-color="{{'#ffffff'}}"></nav>
 <view class="all" style="height: {{contentHeight}}rpx;">
     <view class="map">
         <map class="map" enable-zoom="ture" enable-scroll="ture" id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="18" markers="{{markers}}"></map>

Some files were not shown because too many files changed in this diff