邹能昇 2 月之前
父節點
當前提交
d4052dc12b

+ 3 - 1
app.json

@@ -21,7 +21,9 @@
                 "pages/home/integral/index",
                 "pages/my/my-profile/index",
                 "pages/home/step/index",
-                "pages/my/feedback/index"
+                "pages/my/feedback/index",
+                "pages/activity/index",
+                "pages/activity/detail-activity/index"
             ]
         },
         {

+ 10 - 1
nova-werun/components/circle/index.js

@@ -142,6 +142,14 @@ Component({
                 url: `${url}` // 目标页面的路径
             });
         },
+        //跳转活动
+        goactivity(e){
+            const url = e.currentTarget.dataset.url
+            const acid = e.currentTarget.dataset.acid
+            wx.navigateTo({
+                url: `${url}?id=` + acid // 目标页面的路径
+            });
+        },
         //判断是否有部门
         //    async  iddepe(){
         //         const currentUser = Parse.User.current();
@@ -175,6 +183,7 @@ Component({
             this.setData({
                 ActivityList,
             });
-        }
+        },
+
     }
 })

+ 2 - 2
nova-werun/components/circle/index.wxml

@@ -12,12 +12,12 @@
             <view class="titlebox">
                 <view class="title">热门活动</view>
                 <view class="alltitlebox">
-                    <view class="all-text">全部活动</view>
+                    <view class="all-text"  bindtap="gourl" data-url="../../pages/activity/index">全部活动</view>
                     <image src="https://file-cloud.fmode.cn/qpFbRRSZrO/20241224/1llau7102344568.png?imageView2/1/w/200/h/200"></image>
                 </view>
             </view>
             <view class="acbox">
-                <view class="ac-picbox" wx:for="{{ActivityList}}">
+                <view class="ac-picbox" wx:for="{{ActivityList}}" bindtap="goactivity" data-url="../../pages/activity/detail-activity/index" data-acid="{{item.objectId}}">
                     <image src="{{item.cover[0]}}"></image>
                     <view class="picbox">
                         <view class="pic-tex">立即报名</view>

+ 96 - 0
nova-werun/pages/activity/detail-activity/index.js

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

+ 3 - 0
nova-werun/pages/activity/detail-activity/index.json

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

+ 4 - 0
nova-werun/pages/activity/detail-activity/index.less

@@ -0,0 +1,4 @@
+/* nova-werun/pages/activity/detail-activity/index.wxss */
+.all{
+    width: 100vw;
+}

+ 5 - 0
nova-werun/pages/activity/detail-activity/index.wxml

@@ -0,0 +1,5 @@
+<!--nova-werun/pages/activity/detail-activity/index.wxml-->
+<nav type="back" title="活动详情" background-color="{{'#4F9AF7'}}" front-color="{{'#ffffff'}}"></nav>
+<view class="all" style="height: {{contentHeight}}rpx;">
+
+</view>

+ 1 - 0
nova-werun/pages/activity/detail-activity/index.wxss

@@ -0,0 +1 @@
+.all{width:100vw}

+ 89 - 0
nova-werun/pages/activity/index.js

@@ -0,0 +1,89 @@
+// nova-werun/pages/activity/index.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        statusBarHeight: 0, // 状态栏高度
+        screenHeight: 0, // 屏幕高度
+        customHeight: 0, // 自定义导航栏高度(如小程序右上角胶囊按钮)
+        bottomNavHeight: 0, // 底部导航栏高度
+        contentHeight: 0, // 可用内容高度
+        contentHeight2: 0,
+        contentpadding: 0, //顶部padding高度
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    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 () {
+
+    }
+})

+ 3 - 0
nova-werun/pages/activity/index.json

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

+ 4 - 0
nova-werun/pages/activity/index.less

@@ -0,0 +1,4 @@
+/* nova-werun/pages/activity/index.wxss */
+.all{
+    width: 100vw;
+}

+ 6 - 0
nova-werun/pages/activity/index.wxml

@@ -0,0 +1,6 @@
+<!--nova-werun/pages/activity/index.wxml-->
+<nav type="back" title="全部活动" background-color="{{'#4F9AF7'}}" front-color="{{'#ffffff'}}"></nav>
+<view class="all" style="height: {{contentHeight}}rpx;">
+
+</view>
+

+ 1 - 0
nova-werun/pages/activity/index.wxss

@@ -0,0 +1 @@
+.all{width:100vw}