Browse Source

sport page

邹能昇 3 tháng trước cách đây
mục cha
commit
98dcb605a6

+ 16 - 5
nova-werun/components/home/index.js

@@ -43,13 +43,15 @@ Component({
             {
                 image: 'https://file-cloud.fmode.cn/qpFbRRSZrO/20241102/9crt85041343498.png?imageView2/1/w/200/h/200',
                 text: '步行',
-                url: '../../pages/home/sport/sport-home/index'
+                url: '../../pages/home/sport/sport-home/index',
+               
             },
 
             {
                 image: 'https://file-cloud.fmode.cn/qpFbRRSZrO/20241102/71svpg041343669.png?imageView2/1/w/200/h/200',
                 text: '跑步',
-                url: '../../pages/home/sport/sport-home/index'
+                url: '../../pages/home/sport/sport-home/index',
+                active:1
             },
             {
                 image: 'https://file-cloud.fmode.cn/qpFbRRSZrO/20241102/uk13u1041343733.png?imageView2/1/w/200/h/200',
@@ -99,9 +101,18 @@ Component({
         //跳转
         gourl(e) {
             const url = e.currentTarget.dataset.url
-            wx.navigateTo({
-                url: `${url}` // 目标页面的路径
-            });
+            const active = e.currentTarget.dataset.active
+            if(active){
+                wx.navigateTo({
+                    url: `${url}?id=`+active // 目标页面的路径
+                });
+                console.log(active);
+            }else{
+                wx.navigateTo({
+                    url: `${url}` // 目标页面的路径
+                });
+            }
+
         },
     }
 })

+ 1 - 1
nova-werun/components/home/index.wxml

@@ -29,7 +29,7 @@
 
         <view class="typebox">
             <view class="container">
-                    <view class="column" wx:for="{{rows}}" wx:key="index" data-url="{{item.url}}" bindtap="gourl">
+                    <view class="column" wx:for="{{rows}}" wx:key="index" data-url="{{item.url}}" bindtap="gourl" data-active="{{item.active}}">
                        <image src="{{item.image}}"></image>
                         <text class="item-text">{{item.text}}</text>
                     </view>

+ 9 - 0
nova-werun/pages/home/signin/index.less

@@ -70,6 +70,15 @@
                 border-radius: 45rpx;
                 background-color: orange;
             }
+            .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/signin/index.wxml

@@ -23,7 +23,7 @@
             </view>
             <view class="submitbox">
                 <view wx:if="{{!issigin}}" class="submit" bindtap="submit">立即打卡</view>
-                <view wx:if="{{issigin}}" class="submit">已打卡</view>
+                <view wx:if="{{issigin}}" class="submit2">已打卡</view>
             </view>
         </view>
 </view>

+ 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{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}

+ 18 - 4
nova-werun/pages/home/sport/sport-home/index.js

@@ -41,8 +41,13 @@ Page({
             customHeight,
             bottomNavHeight,
             contentpadding,
-            contentHeight
+            contentHeight,
         });
+        if(Number(options.id)){
+            this.setData({
+                active:Number(options.id)
+            })
+        }
         //地图
         this.Getlocation()
     },
@@ -163,8 +168,17 @@ Page({
     //跳转
     gourl(e) {
         const url = e.currentTarget.dataset.url
-        wx.navigateTo({
-            url: `${url}` // 目标页面的路径
-        });
+        if(this.data.active==0){
+            const title='步行'
+            wx.navigateTo({
+                url: `${url}?id=`+title // 目标页面的路径
+            });
+        }else{
+            const title='跑步'
+            wx.navigateTo({
+                url: `${url}?id=`+title // 目标页面的路径
+            });
+        }
+
     },
 })

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

@@ -12,7 +12,7 @@
                 <view class="map">
                     <map class="map" enable-zoom="ture" enable-scroll="ture" id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="18" markers="{{markers}}"></map>
                 </view>
-                <view class="button" data-url="../sport-start/index" bindtap="gourl">GO</view>
+                <view class="button" data-url="../sport-start/index"  bindtap="gourl">GO</view>
             </view>
         </van-tab>
         <!-- 跑步 -->
@@ -25,7 +25,7 @@
                 <view class="map">
                     <map class="map" enable-zoom="ture" enable-scroll="ture" id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="18" markers="{{markers}}"></map>
                 </view>
-                <view class="button">GO</view>
+                <view class="button" data-url="../sport-start/index"  bindtap="gourl">GO</view>
             </view>
         </van-tab>
     </van-tabs>

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

@@ -19,6 +19,8 @@ Page({
         markers: [],
         //是否暂停
         isstop:false,
+        //标题
+        title:''
     },
 
     /**
@@ -43,6 +45,9 @@ Page({
             contentpadding,
             contentHeight
         });
+        this.setData({
+            title:options.id
+        })
         //地图
         this.Getlocation()
     },

+ 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="跑步或走路" background-color="{{'#87ceeb'}}" front-color="{{'#ffffff'}}"></nav>
+<nav type="back" title="{{title}}" background-color="{{'#87ceeb'}}" 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>