소스 검색

change file

邹能昇 4 달 전
부모
커밋
e35866052b

+ 2 - 1
app.json

@@ -10,7 +10,8 @@
                 "pages/index/index",
                 "pages/circle/circle-detail/index",
                 "pages/circle/my-circle/index",
-                "pages/circle/send-circle/index"
+                "pages/circle/send-circle/index",
+                "pages/home/signin/index"
             ]
         },
         {

+ 52 - 14
nova-werun/components/home/index.js

@@ -17,18 +17,50 @@ Component({
         customHeight: 0, // 自定义导航栏高度(如小程序右上角胶囊按钮)
         bottomNavHeight: 0, // 底部导航栏高度
         contentHeight: 0, // 可用内容高度
-        contentpadding:0,//顶部padding高度
+        contentpadding: 0, //顶部padding高度
         //选择
-        rows:[
-            {image:'https://file-cloud.fmode.cn/qpFbRRSZrO/20241102/3l5p1v041343137.png?imageView2/1/w/200/h/200',text:'签到打卡'},
-            {image:'https://file-cloud.fmode.cn/qpFbRRSZrO/20241102/v6p4fm041343296.png?imageView2/1/w/200/h/200',text:'排行榜'},
-            {image:'https://file-cloud.fmode.cn/qpFbRRSZrO/20241102/mcu488041343362.png?imageView2/1/w/200/h/200',text:'转发分享'},
-            {image:'https://file-cloud.fmode.cn/qpFbRRSZrO/20241102/pqln61041343428.png?imageView2/1/w/200/h/200',text:'我的勋章'},
-            {image:'https://file-cloud.fmode.cn/qpFbRRSZrO/20241102/9crt85041343498.png?imageView2/1/w/200/h/200',text:'步行'},
-           
-            {image:'https://file-cloud.fmode.cn/qpFbRRSZrO/20241102/71svpg041343669.png?imageView2/1/w/200/h/200',text:'跑步'},
-            {image:'https://file-cloud.fmode.cn/qpFbRRSZrO/20241102/uk13u1041343733.png?imageView2/1/w/200/h/200',text:'我的统计'},
-            {image:'https://file-cloud.fmode.cn/qpFbRRSZrO/20241104/k1q4no034958681.png?imageView2/1/w/200/h/200',text:'积分'},
+        rows: [{
+                image: 'https://file-cloud.fmode.cn/qpFbRRSZrO/20241102/3l5p1v041343137.png?imageView2/1/w/200/h/200',
+                text: '签到打卡',
+                url: '../../pages/home/signin/index'
+            },
+            {
+                image: 'https://file-cloud.fmode.cn/qpFbRRSZrO/20241102/v6p4fm041343296.png?imageView2/1/w/200/h/200',
+                text: '排行榜',
+                url: ''
+            },
+            {
+                image: 'https://file-cloud.fmode.cn/qpFbRRSZrO/20241102/mcu488041343362.png?imageView2/1/w/200/h/200',
+                text: '转发分享',
+                url: ''
+                
+            },
+            {
+                image: 'https://file-cloud.fmode.cn/qpFbRRSZrO/20241102/pqln61041343428.png?imageView2/1/w/200/h/200',
+                text: '我的勋章',
+                url: ''
+            },
+            {
+                image: 'https://file-cloud.fmode.cn/qpFbRRSZrO/20241102/9crt85041343498.png?imageView2/1/w/200/h/200',
+                text: '步行',
+                url: ''
+            },
+
+            {
+                image: 'https://file-cloud.fmode.cn/qpFbRRSZrO/20241102/71svpg041343669.png?imageView2/1/w/200/h/200',
+                text: '跑步',
+                url: ''
+            },
+            {
+                image: 'https://file-cloud.fmode.cn/qpFbRRSZrO/20241102/uk13u1041343733.png?imageView2/1/w/200/h/200',
+                text: '我的统计',
+                url: ''
+            },
+            {
+                image: 'https://file-cloud.fmode.cn/qpFbRRSZrO/20241104/k1q4no034958681.png?imageView2/1/w/200/h/200',
+                text: '积分',
+                url: ''
+            },
         ]
     },
     lifetimes: {
@@ -47,7 +79,7 @@ Component({
             const bottomNavHeight = systemInfo.screenHeight - systemInfo.safeArea.bottom || 0;
 
             const contentpadding = (statusBarHeight + customHeight) * 750 / systemInfo.windowWidth;
-            const contentHeight = (screenHeight - bottomNavHeight-50 - statusBarHeight - customHeight) * 750 / systemInfo.windowWidth;
+            const contentHeight = (screenHeight - bottomNavHeight - 50 - statusBarHeight - customHeight) * 750 / systemInfo.windowWidth;
             this.setData({
                 statusBarHeight,
                 screenHeight,
@@ -56,7 +88,7 @@ Component({
                 contentHeight,
                 contentpadding
             });
-            console.log('123',contentpadding);
+            console.log('123', contentpadding);
         },
     },
 
@@ -64,6 +96,12 @@ Component({
      * 组件的方法列表
      */
     methods: {
-        
+        //跳转
+        gourl(e) {
+            const url = e.currentTarget.dataset.url
+            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" >
+                    <view class="column" wx:for="{{rows}}" wx:key="index" data-url="{{item.url}}" bindtap="gourl">
                        <image src="{{item.image}}"></image>
                         <text class="item-text">{{item.text}}</text>
                     </view>

+ 97 - 0
nova-werun/pages/home/signin/index.js

@@ -0,0 +1,97 @@
+// nova-werun/pages/home/signin/index.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        //屏幕高度
+        statusBarHeight: 0, // 状态栏高度
+        screenHeight: 0, // 屏幕高度
+        customHeight: 0, // 自定义导航栏高度(如小程序右上角胶囊按钮)
+        bottomNavHeight: 0, // 底部导航栏高度
+        contentHeight: 0, // 可用内容高度
+        contentHeight2: 0,
+        contentpadding: 0, //顶部padding高度
+        //是否打卡
+        issigin:false,
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        // 计算
+        const systemInfo = wx.getSystemInfoSync();
+        const statusBarHeight = systemInfo.statusBarHeight || 0;
+        const screenHeight = systemInfo.screenHeight || 0;
+        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;
+        this.setData({
+            statusBarHeight,
+            screenHeight,
+            customHeight,
+            bottomNavHeight,
+            contentpadding,
+            contentHeight
+        });
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    },
+    submit(){
+        this.setData({
+            issigin:true
+        })
+    }
+})

+ 3 - 0
nova-werun/pages/home/signin/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

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

@@ -0,0 +1,75 @@
+/* nova-werun/pages/home/signin/index.wxss */
+.all{
+    width: 100vw;
+    .picture{
+        width: 100%;
+        height: 980rpx;
+        border: gray solid 1px;
+        image{
+            width: 100%;
+            height: 980rpx;
+        }
+    }
+    .textbox{
+        width: 100%;
+        height: 350rpx;
+        .text{
+            width: 100%;
+            height: 220rpx;
+            display: flex;
+            .chick {
+                width: 50%;
+                height: 220rpx;
+                display: flex;
+                flex-direction: column;
+                justify-content: center;
+                align-items: center;
+            
+                .chick-text {
+                    font-size: 30rpx;
+                    margin-bottom: 30rpx;
+                }
+            
+                .numberbox {
+                    display: flex;
+                    height: 80rpx;
+                    font-size: 28rpx;
+            
+                    .number {
+                        font-size: 46rpx;
+                        height: 80rpx;
+                        display: flex;
+                        align-items: flex-end; /* 确保数字靠下对齐 */
+                        margin: 0; /* 去掉默认的外边距 */
+                        padding: 0; /* 去掉默认的内边距 */
+                    }
+            
+                    .number-text {
+                        height: 80rpx;
+                        display: flex;
+                        align-items: flex-end; /* 确保文本靠下对齐 */
+                        margin: 0; /* 去掉默认的外边距 */
+                        padding: 0; /* 去掉默认的内边距 */
+                        padding-bottom: 6rpx;
+                    }
+                }
+            }
+        }
+        .submitbox{
+            width: 100%;
+            height: 120rpx;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            .submit{
+                width: 70%;
+                height: 86rpx;
+                display: flex;
+                justify-content: center;
+                align-items: center;
+                border-radius: 45rpx;
+                background-color: orange;
+            }
+        }
+    }
+}

+ 29 - 0
nova-werun/pages/home/signin/index.wxml

@@ -0,0 +1,29 @@
+<!--nova-werun/pages/home/signin/index.wxml-->
+<nav type="back" title="打卡签到" background-color="{{'#87ceeb'}}" front-color="{{'#ffffff'}}"></nav>
+<view class="all" style="height: {{contentHeight}}rpx;">
+        <view class="picture">
+            <image></image>
+        </view>
+        <view class="textbox">
+            <view class="text">
+                <view class="chick">
+                    <view class="chick-text">连续打卡</view>
+                    <view class="numberbox">
+                        <view class="number">77</view>
+                        <view class="number-text">天</view>
+                    </view>
+                </view>
+                <view class="chick">
+                    <view class="chick-text">累计打卡</view>
+                    <view class="numberbox">
+                        <view class="number">177</view>
+                        <view class="number-text">天</view>
+                    </view>
+                </view>
+            </view>
+            <view class="submitbox">
+                <view wx:if="{{!issigin}}" class="submit" bindtap="submit">立即打卡</view>
+                <view wx:if="{{issigin}}" class="submit">已打卡</view>
+            </view>
+        </view>
+</view>

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

@@ -0,0 +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}

+ 2 - 2
project.config.json

@@ -36,6 +36,7 @@
             "disablePlugins": [],
             "outputPath": ""
         },
+        "enableEngineNative": false,
         "useIsolateContext": true,
         "userConfirmedBundleSwitch": false,
         "packNpmManually": false,
@@ -44,8 +45,7 @@
         "disableUseStrict": false,
         "minifyWXML": true,
         "showES6CompileOption": false,
-        "useCompilerPlugins": false,
-        "ignoreUploadUnusedFiles": true
+        "useCompilerPlugins": false
     },
     "compileType": "miniprogram",
     "libVersion": "2.27.3",

+ 6 - 0
project.private.config.json

@@ -33,6 +33,12 @@
                     "pathName": "nova-werun/pages/send-circle/index",
                     "query": "",
                     "scene": null
+                },
+                {
+                    "name": "打卡签到",
+                    "pathName": "nova-werun/pages/home/signin/index",
+                    "query": "",
+                    "scene": null
                 }
             ]
         }