소스 검색

comment user center

xiaoyi 4 달 전
부모
커밋
5ca0b80084
2개의 변경된 파일8개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 0
      pages/today/today.js
  2. 3 3
      pages/today/today.wxml

+ 5 - 0
pages/today/today.js

@@ -264,6 +264,11 @@ Page({
   pushToday(e){
     $push.pushToday(e.currentTarget.dataset)
   },
+  userCenter(e){
+    wx.navigateTo({
+      url: '../homepage/homepage?user_id=' + e.currentTarget.dataset.id,
+    })
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 3 - 3
pages/today/today.wxml

@@ -135,13 +135,13 @@
 </view>
 <view class="content" wx:if='{{comment_list}}'>
   <view class="list" wx:for="{{comment_list}}">
-    <image src="{{item.user_avatar}}" ></image>
+    <image src="{{item.user_avatar}}" data-id="{{item.user_id}}" bind:tap="userCenter" ></image>
       <view class="msg">
-          <text class="_name">{{item.user_name}}</text>
+          <text class="_name" data-id="{{item.user_id}}" bind:tap="userCenter">{{item.user_name}}</text>
           <view class="_content">{{item.content}}</view>
           <view class="answer" wx:if="{{item.children.length>0}}">
               <view  wx:for="{{item.children}}" wx:for-item='i'>
-              <text>{{i.user_name}}:</text>
+              <text data-id="{{i.user_id}}" bind:tap="userCenter">{{i.user_name}}:</text>
               {{i.content}}</view>
           </view>
           <view class="addr">