Browse Source

开发消息页面

bayi 2 years ago
parent
commit
b400e9b454
5 changed files with 94 additions and 74 deletions
  1. 0 1
      pages/match/index.js
  2. 43 22
      pages/message/index.less
  3. 10 29
      pages/message/index.wxml
  4. 34 15
      pages/message/index.wxss
  5. 7 7
      utils/request.js

+ 0 - 1
pages/match/index.js

@@ -70,7 +70,6 @@ Page({
       grade: this.data.userInfo.grade,
       activityId: this.data.activityId
     })
-    console.log(modelList);
     this.setData({
       modelList
     })

+ 43 - 22
pages/message/index.less

@@ -23,6 +23,45 @@ page {
     padding: 0rpx 36rpx 250rpx;
     box-sizing: border-box;
 
+    .fixed {
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      padding: 20rpx 0rpx;
+      border-bottom: 1rpx solid #D8D8D8;
+
+      .authority {
+        position: relative;
+        display: flex;
+        align-items: center;
+
+        .avatar {
+          border-radius: 50rpx;
+          width: 80rpx;
+          height: 80rpx;
+          margin-right: 14rpx;
+        }
+
+        .name {
+          font-size: 30rpx;
+        }
+
+        .unread {
+          top: -4rpx;
+          left: 60rpx;
+          position: absolute;
+          width: 32rpx;
+          height: 32rpx;
+          line-height: 32rpx;
+          border-radius: 550rpx;
+          color: white;
+          font-size: 20rpx;
+          text-align: center;
+          background-color: #FF0000;
+        }
+      }
+    }
+
     .base {
       display: flex;
       align-items: center;
@@ -72,26 +111,6 @@ page {
       }
     }
 
-    .authority {
-      .body {
-        display: flex;
-        justify-content: space-between;
-        padding-right: 50rpx;
-
-        .avatars {
-          display: flex;
-
-          .miniAvatar {
-            width: 38rpx;
-            height: 38rpx;
-            border-radius: 50rpx;
-            margin-left: 4rpx;
-            background-color: #E4E1E1;
-          }
-        }
-      }
-    }
-
     .user {
       .info {
         margin-top: 4rpx;
@@ -146,11 +165,13 @@ page {
       }
     }
   }
-  .skeleton{
+
+  .skeleton {
     width: 100%;
     height: 80vh;
     position: relative;
-    .messageList{
+
+    .messageList {
       padding: 0rpx;
     }
   }

+ 10 - 29
pages/message/index.wxml

@@ -6,39 +6,20 @@
     查找昵称/学号/手机号
   </view>
   <view class="messageList">
-    <view class="base authority" bindtap="jump" data-url='comment' wx:if="{{authorityMsg.postsCount>0}}">
-      <image src="/static/message3.png" class="avatar" />
-      <view class="body">
-        <view class="name">评论</view>
-        <view class="avatars">
-          <image wx:for="{{authorityMsg.postsAvatarList}}" wx:key="index" src="{{item}}" class="miniAvatar" />
-        </view>
-      </view>
-      <view class="right">
-        <view class="date">{{filters.formatDate(authorityMsg.postsDate,5)}}</view>
-        <view class="unread">{{authorityMsg.postsCount}}</view>
-      </view>
-    </view>
-    <view class="base authority" bindtap="jump" data-url='like' wx:if="{{authorityMsg.likeCount>0}}">
-      <image src="/static/zan.png" class="avatar" />
-      <view class="body">
+    <view class="fixed">
+      <view class="authority" bindtap="jump" data-url='like'>
+        <image src="/static/zan.png" class="avatar" />
         <view class="name">赞</view>
-        <view class="avatars">
-          <image wx:for="{{authorityMsg.likeAvatarList}}" wx:key="index" src="{{item}}" class="miniAvatar" />
-        </view>
+        <view class="unread" wx:if="{{authorityMsg.likeCount>0}}">{{authorityMsg.likeCount}}</view>
       </view>
-      <view class="right">
-        <view class="date">{{filters.formatDate(authorityMsg.likeDate,5)}}</view>
-        <view class="unread">{{authorityMsg.likeCount}}</view>
+      <view class="authority" bindtap="jump" data-url='comment'>
+        <image src="/static/message3.png" class="avatar" />
+        <view class="name">评论</view>
+        <view class="unread" wx:if="{{authorityMsg.postsCount>0}}">{{authorityMsg.postsCount}}</view>
       </view>
-    </view>
-    <view class="base authority" bindtap="jump" data-url='notice'>
-      <image src="/static/notice.png" class="avatar" />
-      <view class="body">
+      <view class="authority" bindtap="jump" data-url='notice'>
+        <image src="/static/notice.png" class="avatar" />
         <view class="name">通知</view>
-      </view>
-      <view class="right">
-        <view class="date"></view>
         <view class="unread" wx:if="{{authorityMsg.messageCount>0}}">{{authorityMsg.messageCount}}</view>
       </view>
     </view>

+ 34 - 15
pages/message/index.wxss

@@ -225,6 +225,40 @@ page {
   padding: 0rpx 36rpx 250rpx;
   box-sizing: border-box;
 }
+.messagePage .messageList .fixed {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 20rpx 0rpx;
+  border-bottom: 1rpx solid #D8D8D8;
+}
+.messagePage .messageList .fixed .authority {
+  position: relative;
+  display: flex;
+  align-items: center;
+}
+.messagePage .messageList .fixed .authority .avatar {
+  border-radius: 50rpx;
+  width: 80rpx;
+  height: 80rpx;
+  margin-right: 14rpx;
+}
+.messagePage .messageList .fixed .authority .name {
+  font-size: 30rpx;
+}
+.messagePage .messageList .fixed .authority .unread {
+  top: -4rpx;
+  left: 60rpx;
+  position: absolute;
+  width: 32rpx;
+  height: 32rpx;
+  line-height: 32rpx;
+  border-radius: 550rpx;
+  color: white;
+  font-size: 20rpx;
+  text-align: center;
+  background-color: #FF0000;
+}
 .messagePage .messageList .base {
   display: flex;
   align-items: center;
@@ -267,21 +301,6 @@ page {
   text-align: center;
   background-color: #FF0000;
 }
-.messagePage .messageList .authority .body {
-  display: flex;
-  justify-content: space-between;
-  padding-right: 50rpx;
-}
-.messagePage .messageList .authority .body .avatars {
-  display: flex;
-}
-.messagePage .messageList .authority .body .avatars .miniAvatar {
-  width: 38rpx;
-  height: 38rpx;
-  border-radius: 50rpx;
-  margin-left: 4rpx;
-  background-color: #E4E1E1;
-}
 .messagePage .messageList .user .info {
   margin-top: 4rpx;
   width: 400rpx;

+ 7 - 7
utils/request.js

@@ -6,13 +6,13 @@ const {
     envVersion
   }
 } = wx.getAccountInfoSync();
-// if (envVersion == 'develop') {
-baseUrl = 'https://reader-api.efunbox.cn/wx'
-oldUrl = 'https://reader-api.efunbox.cn'
-// } else {
-// baseUrl = 'https://reader-api.ai160.com/wx'
-// oldUrl = 'https://reader-api.ai160.com'
-// }
+if (envVersion == 'develop') {
+  baseUrl = 'https://reader-api.efunbox.cn/wx'
+  oldUrl = 'https://reader-api.efunbox.cn'
+} else {
+  baseUrl = 'https://reader-api.ai160.com/wx'
+  oldUrl = 'https://reader-api.ai160.com'
+}
 
 function request(url, method, data, oldBaseUrl = false) {
   let header = {