guhongwei 2 năm trước cách đây
mục cha
commit
58b3b3b6ee

+ 1 - 0
app.json

@@ -8,6 +8,7 @@
         "pages/topic/index",
         "pages/my/index",
         "pages/my/userInfo",
+        "pages/usermymatch/index",
         "pages/test/index"
     ],
     "usingComponents": {

+ 11 - 5
pages/my/index.js

@@ -6,17 +6,23 @@ Page({
      */
     data: {
         frameStyle: { useTop: true, name: '我的', leftArrow: false, useBar: true },
-        icon: '/image/icon.jpg'
+        icon: '/image/icon.jpg',
+        btnList: [
+            { title: '我的赛事', route: 'usermymatch' },
+            { title: '账号设置', route: 'setting' }
+        ]
     },
     // 跳转菜单
     tabPath(e) {
         let { route } = e.detail.detail;
         if (route) wx.redirectTo({ url: `/${route}` })
     },
-    // 详细信息
-    toView: function (e) {
-        const { item } = e.currentTarget.dataset;
-        wx.navigateTo({ url: `/pages/my/userInfo` })
+    toCommon: function (e) {
+        const { route, type } = e.currentTarget.dataset;
+        // 自定义路径
+        if (type == '0') { wx.navigateTo({ url: `${route}` }) }
+        // 默认路径
+        else if (type == '1') { wx.navigateTo({ url: `/pages/${route}/index` }) }
     },
     /**
      * 生命周期函数--监听页面加载

+ 26 - 1
pages/my/index.less

@@ -75,7 +75,32 @@
     }
 
     .two {
-        background-color: #ff0000;
+        display: flex;
+        flex-direction: column;
+
+        .list {
+            display: flex;
+            flex-direction: row;
+            justify-content: space-between;
+            background-color: #fff;
+            margin: 0 0 2vw 0;
+            border-bottom: 1px solid #858585;
+            padding: 2vw;
+
+            .list_1 {
+                .icon {
+                    margin: 0 2vw 0 0;
+                }
+
+                .title {
+                    font-size: 14px;
+                }
+            }
+
+            .list_2 {
+                color: #858585;
+            }
+        }
     }
 
 }

+ 9 - 2
pages/my/index.wxml

@@ -13,13 +13,20 @@
                     </view>
                 </view>
                 <view class="r">
-                    <text bindtap="toView">详细</text>
+                    <text bindtap="toCommon" data-route="/pages/my/userInfo" data-type="0">详细</text>
                     <van-icon name="arrow" />
                 </view>
             </view>
         </view>
         <view class="zero two">
-            按钮
+            <view class="list" wx:for="{{btnList}}" wx:key="item" bindtap="toCommon" data-route="{{item.route}}" data-type="1">
+                <view class="list_1 textOver">
+                    <van-icon class="icon" name="like-o" /><text class="title">{{item.title}}</text>
+                </view>
+                <view class="list_2">
+                    <van-icon name="arrow" />
+                </view>
+            </view>
         </view>
     </view>
 </mobile-main>

+ 20 - 1
pages/my/index.wxss

@@ -63,5 +63,24 @@
   color: #858585;
 }
 .main .two {
-  background-color: #ff0000;
+  display: flex;
+  flex-direction: column;
+}
+.main .two .list {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  background-color: #fff;
+  margin: 0 0 2vw 0;
+  border-bottom: 1px solid #858585;
+  padding: 2vw;
+}
+.main .two .list .list_1 .icon {
+  margin: 0 2vw 0 0;
+}
+.main .two .list .list_1 .title {
+  font-size: 14px;
+}
+.main .two .list .list_2 {
+  color: #858585;
 }

+ 70 - 0
pages/topic copy/index.js

@@ -0,0 +1,70 @@
+const app = getApp()
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        frameStyle: { useTop: true, name: '话题', leftArrow: false, useBar: true },
+    },
+    // 跳转菜单
+    tabPath(e) {
+        let { route } = e.detail.detail;
+        if (route) wx.redirectTo({ url: `/${route}` })
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        const that = this;
+
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 6 - 0
pages/topic copy/index.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "mobile-main": "/commpents/mobile-frame/index"
+  }
+}

+ 4 - 0
pages/topic copy/index.less

@@ -0,0 +1,4 @@
+.main {
+    height: 80.8vh;
+    background-color: #ff0000;
+}

+ 5 - 0
pages/topic copy/index.wxml

@@ -0,0 +1,5 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back" bind:tabPath="tabPath">
+    <view slot="info" class="container main">
+        话题
+    </view>
+</mobile-main>

+ 4 - 0
pages/topic copy/index.wxss

@@ -0,0 +1,4 @@
+.main {
+  height: 80.8vh;
+  background-color: #ff0000;
+}

+ 68 - 0
pages/usermymatch/index.js

@@ -0,0 +1,68 @@
+const app = getApp()
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        frameStyle: { useTop: true, name: '我的赛事', leftArrow: true, useBar: false },
+    },
+    back: function () {
+        wx.navigateBack({ delta: 1 })
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        const that = this;
+
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 6 - 0
pages/usermymatch/index.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+      "mobile-main": "/commpents/mobile-frame/index"
+    }
+  }

+ 4 - 0
pages/usermymatch/index.less

@@ -0,0 +1,4 @@
+.main {
+    height: 88vh;
+    background-color: #ff0000;
+}

+ 5 - 0
pages/usermymatch/index.wxml

@@ -0,0 +1,5 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="container main">
+        我的赛事
+    </view>
+</mobile-main>

+ 4 - 0
pages/usermymatch/index.wxss

@@ -0,0 +1,4 @@
+.main {
+  height: 88vh;
+  background-color: #ff0000;
+}