Kaynağa Gözat

搭建消息页面

bayi 2 yıl önce
ebeveyn
işleme
f0e1e9b29d

+ 5 - 1
app.json

@@ -2,6 +2,7 @@
   "pages": [
     "pages/index/index",
     "pages/activity/index",
+    "pages/message/index",
     "pages/match/index",
     "pages/pkResult/index",
     "pages/medalStore/index",
@@ -32,7 +33,10 @@
     }, {
       "pagePath": "pages/works/index",
       "text": "作品"
-    }, {
+    },  {
+      "pagePath": "pages/message/index",
+      "text": "消息"
+    },{
       "pagePath": "pages/my/index",
       "text": "我的"
     }]

+ 5 - 0
custom-tab-bar/index.js

@@ -42,6 +42,11 @@ Component({
       "iconPath": "/static/zp.png",
       "selectedIconPath": "/static/zp2.png"
     }, {
+      "pagePath": "/pages/message/index",
+      "text": "消息",
+      "iconPath": "/static/zp.png",
+      "selectedIconPath": "/static/zp2.png"
+    }, {
       "pagePath": "/pages/my/index",
       "text": "我的",
       "iconPath": "/static/my.png",

+ 55 - 0
pages/message/index.js

@@ -0,0 +1,55 @@
+// pages/message/index.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+  onLoad(options) {
+
+  },
+  onShow() {
+    if (typeof this.getTabBar === 'function') {
+      this.getTabBar().setData({
+        selected: 3
+      })
+    }
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 6 - 0
pages/message/index.json

@@ -0,0 +1,6 @@
+{
+  "usingComponents": {
+    "navigationBar": "/components/navigationBar/index"
+  },
+  "navigationStyle": "custom"
+}

+ 1 - 0
pages/message/index.less

@@ -0,0 +1 @@
+/* pages/message/index.wxss */

+ 1 - 0
pages/message/index.wxml

@@ -0,0 +1 @@
+<navigationBar></navigationBar>

+ 1 - 0
pages/message/index.wxss

@@ -0,0 +1 @@
+/* pages/message/index.wxss */

+ 1 - 1
pages/my/index.js

@@ -40,7 +40,7 @@ Page({
   async onShow() {
     if (typeof this.getTabBar === 'function') {
       this.getTabBar().setData({
-        selected: 3
+        selected: 4
       })
     }
     let uid = wx.getStorageSync('uid') || ''