bayi 2 éve
szülő
commit
faf4fb32d8

+ 1 - 0
app.json

@@ -3,6 +3,7 @@
     "pages/index/index",
     "pages/activity/index",
     "pages/message/index",
+    "pages/like/index",
     "pages/match/index",
     "pages/pkResult/index",
     "pages/medalStore/index",

+ 66 - 0
pages/like/index.js

@@ -0,0 +1,66 @@
+// pages/like/index.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 4 - 0
pages/like/index.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "点赞"
+}

+ 1 - 0
pages/like/index.less

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

+ 1 - 0
pages/like/index.wxml

@@ -0,0 +1 @@
+<view class="like"></view>

+ 1 - 0
pages/like/index.wxss

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

+ 16 - 0
pages/message/index.js

@@ -1,6 +1,7 @@
 const app = getApp()
 Page({
   data: {
+    messageId: '',
     menu: {
       show: false,
       top: 0,
@@ -30,6 +31,7 @@ Page({
     let wFlag = remainingW - 145 > 0
     let hFlag = remainingH - 200 > 0
     this.setData({
+      messageId: currentTarget.dataset.id,
       menu: {
         show: true,
         top: hFlag ? touches[0].clientY : touches[0].clientY - 100,
@@ -41,5 +43,19 @@ Page({
     this.setData({
       'menu.show': false
     })
+  },
+  setIsTop() {},
+  delMessage() {
+    this.setData({
+      'menu.show': false
+    })
+  },
+  jump({
+    currentTarget
+  }) {
+    console.log(currentTarget);
+    wx.navigateTo({
+      url: `/pages/${currentTarget.dataset.url}/index`,
+    })
   }
 })

+ 6 - 5
pages/message/index.wxml

@@ -18,7 +18,7 @@
         <view class="unread">10</view>
       </view>
     </view>
-    <view class="base authority">
+    <view class="base authority" bindtap="jump" data-url='like'>
       <image src="/static/zan.png" class="avatar" />
       <view class="body">
         <view class="name">赞</view>
@@ -31,7 +31,7 @@
         <view class="unread">10</view>
       </view>
     </view>
-    <view class="base authority">
+    <view class="base authority" bindtap="jump" data-url='notice'>
       <image src="/static/notice.png" class="avatar" />
       <view class="body">
         <view class="name">通知</view>
@@ -41,7 +41,8 @@
         <view class="unread">10</view>
       </view>
     </view>
-    <view class="base user" wx:for="{{16}}" wx:key="index" bind:longpress="onLongPress" hover-class='pressHover'>
+    <view class="base user" wx:for="{{16}}" wx:key="index" data-id='10' bind:longpress="onLongPress"
+      hover-class='pressHover'>
       <image src="/static/message3.png" class="avatar" />
       <view class="body">
         <view class="name textOver">帅气小男孩</view>
@@ -57,10 +58,10 @@
   </view>
   <view class="menuBg" bind:touchstart="cancelMenu" wx:if="{{menu.show}}"></view>
   <view class="menu" wx:if="{{menu.show}}" style="top:{{menu.top}}px;left:{{menu.left}}px">
-    <view class="menu-one">
+    <view class="menu-one" bindtap="setIsTop">
       <image src="/static/istop.png" class="icon" /> 置顶该聊天
     </view>
-    <view>
+    <view bindtap="delMessage">
       <image src="/static/del.png" class="icon" />
       删除该聊天
     </view>