Browse Source

CHORE

优化代码结构
RegMs If 4 năm trước cách đây
mục cha
commit
38d1abef5c
52 tập tin đã thay đổi với 1315 bổ sung1370 xóa
  1. 5 6
      miniprogram/app.json
  2. 0 6
      miniprogram/components/itemActivityComment/itemActivityComment.wxml
  3. 2 2
      miniprogram/components/itemCard/itemCard.js
  4. 2 2
      miniprogram/components/itemCard/itemCard.wxml
  5. 1 1
      miniprogram/components/itemCard/itemCard.wxss
  6. 25 25
      miniprogram/components/itemMessageQuestion/itemMessageQuestion.js
  7. 3 3
      miniprogram/components/itemMessageQuestion/itemMessageQuestion.json
  8. 6 0
      miniprogram/components/itemMessageQuestion/itemMessageQuestion.wxml
  9. 3 3
      miniprogram/components/itemMessageQuestion/itemMessageQuestion.wxss
  10. 2 2
      miniprogram/components/itemPublisher/itemPublisher.js
  11. 8 5
      miniprogram/components/itemPublisher/itemPublisher.wxml
  12. 1 1
      miniprogram/components/itemPublisher/itemPublisher.wxss
  13. 2 2
      miniprogram/components/itemmyLikeMessage/itemmyLikeMessage.js
  14. 1 1
      miniprogram/components/itemmyLikeMessage/itemmyLikeMessage.wxml
  15. 15 16
      miniprogram/data/activityCommentData.js
  16. 12 12
      miniprogram/data/activityInfoData.js
  17. 35 36
      miniprogram/data/mainData.js
  18. 6 6
      miniprogram/pages/aboutUs/aboutUs.wxml
  19. 1 1
      miniprogram/pages/aboutUs/aboutUs.wxss
  20. 0 295
      miniprogram/pages/activity/activity.js
  21. 0 6
      miniprogram/pages/activity/activity.json
  22. 0 75
      miniprogram/pages/activity/activity.wxml
  23. 0 174
      miniprogram/pages/activity/activity.wxss
  24. 5 4
      miniprogram/pages/main/main.wxml
  25. 3 5
      miniprogram/pages/main/main.wxss
  26. 282 7
      miniprogram/pages/message/message.js
  27. 2 2
      miniprogram/pages/message/message.json
  28. 71 4
      miniprogram/pages/message/message.wxml
  29. 171 1
      miniprogram/pages/message/message.wxss
  30. 246 246
      miniprogram/pages/messagePublish/messagePublish.js
  31. 5 5
      miniprogram/pages/messagePublish/messagePublish.json
  32. 189 189
      miniprogram/pages/messagePublish/messagePublish.wxml
  33. 80 80
      miniprogram/pages/messagePublish/messagePublish.wxss
  34. 43 43
      miniprogram/pages/myFavorite/myFavorite.js
  35. 4 4
      miniprogram/pages/myFavorite/myFavorite.json
  36. 7 0
      miniprogram/pages/myFavorite/myFavorite.wxml
  37. 10 0
      miniprogram/pages/myFavorite/myFavorite.wxss
  38. 0 66
      miniprogram/pages/myPublish/myPublish.js
  39. 0 3
      miniprogram/pages/myPublish/myPublish.json
  40. 0 2
      miniprogram/pages/myPublish/myPublish.wxml
  41. 0 1
      miniprogram/pages/myPublish/myPublish.wxss
  42. 20 0
      miniprogram/pages/notification/notification.js
  43. 6 0
      miniprogram/pages/notification/notification.json
  44. 7 0
      miniprogram/pages/notification/notification.wxml
  45. 4 0
      miniprogram/pages/notification/notification.wxss
  46. 2 2
      miniprogram/pages/publisherPage/publisherPage.js
  47. 3 2
      miniprogram/pages/publisherPage/publisherPage.wxml
  48. 3 3
      miniprogram/pages/search/search.js
  49. 1 1
      miniprogram/pages/search/search.wxml
  50. 2 2
      miniprogram/pages/user/user.js
  51. 7 8
      miniprogram/pages/user/user.wxml
  52. 12 10
      miniprogram/pages/user/user.wxss

+ 5 - 6
miniprogram/app.json

@@ -4,22 +4,21 @@
     "pages/publisher/publisher",
     "pages/publisherPage/publisherPage",
     "pages/user/user",
-    "pages/message/message",
+    "pages/notification/notification",
     "pages/search/search",
     "pages/setting/setting",
-    "pages/activity/activity",
+    "pages/message/message",
     "pages/myFollow/myFollow",
     "pages/publisherLogin/publisherLogin",
-    "pages/activityPublish/activityPublish",
+    "pages/messagePublish/messagePublish",
     "pages/myQuestion/myQuestion",
     "pages/publisherQuestion/publisherQuestion",
     "pages/publisherInfoChange/publisherInfoChange",
     "pages/aboutUs/aboutUs",
     "pages/opinion/opinion",
-    "pages/myPublish/myPublish",
     "pages/administratorSetting/administratorSetting",
     "pages/myColor/myColor",
-    "pages/myFavor/myFavor",
+    "pages/myFavorite/myFavorite",
     "pages/publisherDetail/publisherDetail"
   ],
   "window": {
@@ -48,7 +47,7 @@
         "selectedIconPath": "images/tabbar/2.2.png"
       },
       {
-        "pagePath": "pages/message/message",
+        "pagePath": "pages/notification/notification",
         "text": "消息",
         "iconPath": "images/tabbar/3.1.png",
         "selectedIconPath": "images/tabbar/3.2.png"

+ 0 - 6
miniprogram/components/itemActivityComment/itemActivityComment.wxml

@@ -1,6 +0,0 @@
-<view class="qa-text" style="display: flex;">
-  <view class="primary-text-color" style="margin-right: 30rpx;">{{comment.a_time}}</view>
-  <view class="secondary-text-color">{{comment.rank ? '置顶' : ''}}</view>
-</view>
-<view class="qa-text">Q: {{comment.question}}</view>
-<view class="qa-text">A: {{comment.answer}}</view>

+ 2 - 2
miniprogram/components/itemCard/itemCard.js

@@ -34,9 +34,9 @@ Component({
       })
     },
 
-    getActivityInfo: function () {
+    getMessageInfo: function () {
       wx.navigateTo({
-        url: '/pages/activity/activity',
+        url: '/pages/message/message',
         events: {
           deleteMessage: () => {
             this.setData({

+ 2 - 2
miniprogram/components/itemCard/itemCard.wxml

@@ -1,11 +1,11 @@
 <!-- 为首页消息通知的组件,数据在mainData.js -->
-<view wx:if="{{show}}" class="item-card" bindtap="getActivityInfo">
+<view wx:if="{{show}}" class="item-card" bindtap="getMessageInfo">
   <view class="profile">
     <view class="avatar-name" catchtap="getPublisherInfo">
       <image class="publisher-avatar" src="{{item.publisher.avatar}}" mode="aspectFill"></image>
       <view class="publisher-name">{{item.publisher.name}}</view>
     </view>
-    <view class="activity-attribute primary-background-color white-text-color" catchtap="filterMsgType">
+    <view class="message-attribute primary-background-color white-text-color" catchtap="filterMsgType">
       {{item.type[0]}}
     </view>
   </view>

+ 1 - 1
miniprogram/components/itemCard/itemCard.wxss

@@ -47,7 +47,7 @@
   font-size: 20rpx;
 }
 
-.activity-attribute {
+.message-attribute {
   font-size: 24rpx;
   align-self: center;
   padding-top: 5rpx;

+ 25 - 25
miniprogram/components/itemActivityComment/itemActivityComment.js → miniprogram/components/itemMessageQuestion/itemMessageQuestion.js

@@ -1,26 +1,26 @@
-Component({
-  options: {
-    styleIsolation: "apply-shared"
-  },
-
-  /**
-   * 组件的属性列表
-   */
-  properties: {
-    comment: Object
-  },
-
-  /**
-   * 组件的初始数据
-   */
-  data: {
-
-  },
-
-  /**
-   * 组件的方法列表
-   */
-  methods: {
-
-  }
+Component({
+  options: {
+    styleIsolation: "apply-shared"
+  },
+
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    question: Object
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+
+  }
 })

+ 3 - 3
miniprogram/components/itemActivityComment/itemActivityComment.json → miniprogram/components/itemMessageQuestion/itemMessageQuestion.json

@@ -1,4 +1,4 @@
-{
-  "component": true,
-  "usingComponents": {}
+{
+  "component": true,
+  "usingComponents": {}
 }

+ 6 - 0
miniprogram/components/itemMessageQuestion/itemMessageQuestion.wxml

@@ -0,0 +1,6 @@
+<view class="qa-text" style="display: flex;">
+  <view class="primary-text-color" style="margin-right: 30rpx;">{{question.a_time}}</view>
+  <view class="secondary-text-color">{{question.rank ? '置顶' : ''}}</view>
+</view>
+<view class="qa-text">Q: {{question.question}}</view>
+<view class="qa-text">A: {{question.answer}}</view>

+ 3 - 3
miniprogram/components/itemActivityComment/itemActivityComment.wxss → miniprogram/components/itemMessageQuestion/itemMessageQuestion.wxss

@@ -1,4 +1,4 @@
-.qa-text {
-  margin: 10rpx 0rpx;
-  font-size: 25rpx;
+.qa-text {
+  margin: 10rpx 0rpx;
+  font-size: 25rpx;
 }

+ 2 - 2
miniprogram/components/itemPublisher/itemPublisher.js

@@ -24,9 +24,9 @@ Component({
    * 组件的方法列表
    */
   methods: {
-    getActivityInfo: function () {
+    getMessageInfo: function () {
       wx.navigateTo({
-        url: "/pages/activity/activity?id=" + this.properties.item._id
+        url: "/pages/message/message?id=" + this.properties.item._id
       })
     }
   }

+ 8 - 5
miniprogram/components/itemPublisher/itemPublisher.wxml

@@ -1,16 +1,19 @@
 <!-- 为发布者详情界面中的活动卡片,数据在mainData.js 注:mainData.js在主界面和此界面都被引用 -->
-<view class="card" bindtap="getActivityInfo">
+<view class="card" bindtap="getMessageInfo">
   <view class="profile">
     <view style="display: flex;">
       <image class="publisher-avatar" src="{{item.publisherAvatar}}" mode="aspectFill"></image>
       <view class="publisher-name dark-primary-color-font">{{item.publisherName}}</view>
       <view class="time">{{item.time}}</view>
     </view>
-    <view class="activity-attribute accent-color white-text-color" catchtap="filterMsgType">{{item.attribute[0]}}</view>
+    <view class="message-attribute accent-color white-text-color" catchtap="filterMsgType">{{item.attribute[0]}}</view>
   </view>
   <view class="title">{{item.title}}</view>
   <view class="sub-title">{{item.subTitle}}</view>
-  <imagePicker wx:if="{{item.poster != ''}}" images="{{[item.poster]}}" max="1" image-width="700" image-height="365" readonly />
-  <imagePicker wx:if="{{item.poster == '' && item.photo.length != 0}}" images="{{item.photo}}" max="1" image-width="{{item.photo.length == 1 ? 700 : item.photo.length <= 4 ? 330 : 220}}" image-height="{{item.photo.length == 1 ? 700 : item.photo.length <= 4 ? 330 : 220}}" readonly />
+  <imagePicker wx:if="{{item.poster != ''}}" images="{{[item.poster]}}" max="1" image-width="700" image-height="365"
+    readonly />
+  <imagePicker wx:if="{{item.poster == '' && item.photo.length != 0}}" images="{{item.photo}}" max="1"
+    image-width="{{item.photo.length == 1 ? 700 : item.photo.length <= 4 ? 330 : 220}}"
+    image-height="{{item.photo.length == 1 ? 700 : item.photo.length <= 4 ? 330 : 220}}" readonly />
   <view class="line divider-color"></view>
-</view>
+</view>

+ 1 - 1
miniprogram/components/itemPublisher/itemPublisher.wxss

@@ -31,7 +31,7 @@
   align-self: center;
 }
 
-.activity-attribute{
+.message-attribute{
   font-size: 20rpx;
   align-self: center;
   padding-top: 5rpx;

+ 2 - 2
miniprogram/components/itemmyLikeMessage/itemmyLikeMessage.js

@@ -13,9 +13,9 @@ Component({
   },
 
   methods: {
-    getActivityInfo: function () {
+    getMessageInfo: function () {
       wx.navigateTo({
-        url: '/pages/activity/activity',
+        url: '/pages/message/message',
         events: {
           deleteMessage: () => {
             this.setData({

+ 1 - 1
miniprogram/components/itemmyLikeMessage/itemmyLikeMessage.wxml

@@ -1,5 +1,5 @@
 <!-- 为消息-关注动态里消息的组件,数据来自data: newMessageData.js-->
-<view wx:if="{{show}}" class="card" catchtap="getActivityInfo">
+<view wx:if="{{show}}" class="card" catchtap="getMessageInfo">
   <view class="profile">
     <view class="publisher-name primary-text-color" catchtap="getPublisherInfo">
       <image class="publisher-avatar" src="{{item.publisher.avatar}}" mode="aspectFill" />

+ 15 - 16
miniprogram/data/activityCommentData.js

@@ -1,21 +1,20 @@
-// 为活动详情中组件itemActivityComment的数据
-var json=[
-  {
-    "id":"1",
-    "userAvatar":"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1608131389634&di=bf796ce931cfbe3befff359069468b0f&imgtype=0&src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_match%2F0%2F162260862%2F0.jpg",
-    "user":"路人甲",
-    "time":"1分钟前",
-    "question":"哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈"
+// 为活动详情中组件itemMessageQuestion的数据
+var json = [{
+    "id": "1",
+    "userAvatar": "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1608131389634&di=bf796ce931cfbe3befff359069468b0f&imgtype=0&src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_match%2F0%2F162260862%2F0.jpg",
+    "user": "路人甲",
+    "time": "1分钟前",
+    "question": "哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈"
   },
   {
-    "id":"2",
-    "userAvatar":"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1608131389634&di=bf796ce931cfbe3befff359069468b0f&imgtype=0&src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_match%2F0%2F162260862%2F0.jpg",
-    "user":"路人甲",
-    "time":"1分钟前",
-    "question":"哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈"
+    "id": "2",
+    "userAvatar": "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1608131389634&di=bf796ce931cfbe3befff359069468b0f&imgtype=0&src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_match%2F0%2F162260862%2F0.jpg",
+    "user": "路人甲",
+    "time": "1分钟前",
+    "question": "哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈"
   }
 ]
 
-module.exports={
-  activityComment:json
-}
+module.exports = {
+  messageQuestion: json
+}

+ 12 - 12
miniprogram/data/activityInfoData.js

@@ -1,18 +1,18 @@
 // 为活动详情界面中的数据
-var json= {
-  "id":"1",
-  "activityPoster":"https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1180478225,661749625&fm=26&gp=0.jpg",
+var json = {
+  "id": "1",
+  "messagePoster": "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1180478225,661749625&fm=26&gp=0.jpg",
   // 活动照片
-  "activityAtrribute":"文艺活动",
-  "publisherAvatar":"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1608131389634&di=bf796ce931cfbe3befff359069468b0f&imgtype=0&src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_match%2F0%2F162260862%2F0.jpg",
-  "publisherName":"蓝田文体发展中心",
-  "activityName":"紫金新生达人秀|期待你的精彩",
-  "activityTime":"2020年12月18-20日晚1830-21:30",
-  "activityPlace":"浙江大学紫金港校区小剧场",
-  "activityDetail":"本次比赛可以分为五个阶段:初赛→复赛→特训→彩排→决赛。报名后具体比赛时间及场次将通过短信进一步通知。面向对象为全校学生,表演形式不限。可通过填写问卷星链接进行报名:www.xxxxx"
+  "messageAtrribute": "文艺活动",
+  "publisherAvatar": "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1608131389634&di=bf796ce931cfbe3befff359069468b0f&imgtype=0&src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_match%2F0%2F162260862%2F0.jpg",
+  "publisherName": "蓝田文体发展中心",
+  "messageName": "紫金新生达人秀|期待你的精彩",
+  "messageTime": "2020年12月18-20日晚1830-21:30",
+  "messagePlace": "浙江大学紫金港校区小剧场",
+  "messageDetail": "本次比赛可以分为五个阶段:初赛→复赛→特训→彩排→决赛。报名后具体比赛时间及场次将通过短信进一步通知。面向对象为全校学生,表演形式不限。可通过填写问卷星链接进行报名:www.xxxxx"
 }
 
 
-module.exports={
-  activityInfo:json
+module.exports = {
+  messageInfo: json
 }

+ 35 - 36
miniprogram/data/mainData.js

@@ -1,57 +1,56 @@
 //首页中组件itemCard的数据与发布者详情页面中itemPublisher中的数据
-var json=[
-  {
-    "id":"1",
+var json = [{
+    "id": "1",
     //此条通知对应id
-    "publisherAvatar":"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1608131389634&di=bf796ce931cfbe3befff359069468b0f&imgtype=0&src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_match%2F0%2F162260862%2F0.jpg", 
+    "publisherAvatar": "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1608131389634&di=bf796ce931cfbe3befff359069468b0f&imgtype=0&src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_match%2F0%2F162260862%2F0.jpg",
     //组织头像
-    "publisherName":"蓝田文体发展中心",
-    "publisherID":1,
+    "publisherName": "蓝田文体发展中心",
+    "publisherID": 1,
     //组织id(不同组织有不同标号)
-    "time":"1分钟前",
-    "title":"紫金新生达人秀|期待你的精彩",
+    "time": "1分钟前",
+    "title": "紫金新生达人秀|期待你的精彩",
     //主标题
-    "subTitle":"紫金新生达人秀现面向全校学生开启报名通道,报名即有综素加分,通过初赛就有二课!",
+    "subTitle": "紫金新生达人秀现面向全校学生开启报名通道,报名即有综素加分,通过初赛就有二课!",
     //副标题
-    "poster":[],
+    "poster": [],
     //图片(可以添加多张,所以是数组)
-    "activityAttribute":"7",
+    "messageAttribute": "7",
     //对应上栏-信息类型
-    "activitySource":"3",
+    "messageSource": "3",
     //对应上栏-发布来源
-    "additionPoint":""
+    "additionPoint": ""
     //对应上栏-智能筛选
   },
 
   {
-    "id":"2",
-    "publisherAvatar":"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1608131389634&di=bf796ce931cfbe3befff359069468b0f&imgtype=0&src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_match%2F0%2F162260862%2F0.jpg",
-    "publisherName":"蓝田文体发展中心",
-    "publisherID":2,
-    "time":"1分钟前",
-    "title":"紫金新生达人秀|期待你的精彩",
-    "subTitle":"紫金新生达人秀现面向全校学生开启报名通道,报名即有综素加分,通过初赛就有二课!",
-    "poster":["https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1180478225,661749625&fm=26&gp=0.jpg"],
-    "activityAttribute":"6",
-    "activitySource":"3",
-    "AdditionPoint":""
+    "id": "2",
+    "publisherAvatar": "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1608131389634&di=bf796ce931cfbe3befff359069468b0f&imgtype=0&src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_match%2F0%2F162260862%2F0.jpg",
+    "publisherName": "蓝田文体发展中心",
+    "publisherID": 2,
+    "time": "1分钟前",
+    "title": "紫金新生达人秀|期待你的精彩",
+    "subTitle": "紫金新生达人秀现面向全校学生开启报名通道,报名即有综素加分,通过初赛就有二课!",
+    "poster": ["https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1180478225,661749625&fm=26&gp=0.jpg"],
+    "messageAttribute": "6",
+    "messageSource": "3",
+    "AdditionPoint": ""
   },
 
   {
-    "id":"3",
-    "publisherAvatar":"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1608131389634&di=bf796ce931cfbe3befff359069468b0f&imgtype=0&src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_match%2F0%2F162260862%2F0.jpg",
-    "publisherName":"蓝田文体发展中心",
-    "publisherID":2,
-    "time":"1分钟前",
-    "title":"紫金新生达人秀|期待你的精彩",
-    "subTitle":"紫金新生达人秀现面向全校学生开启报名通道,报名即有综素加分,通过初赛就有二课!",
-    "poster":["https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1180478225,661749625&fm=26&gp=0.jpg"],
-    "activityAttribute":"5",
-    "activitySource":"3",
-    "AdditionPoint":""
+    "id": "3",
+    "publisherAvatar": "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1608131389634&di=bf796ce931cfbe3befff359069468b0f&imgtype=0&src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_match%2F0%2F162260862%2F0.jpg",
+    "publisherName": "蓝田文体发展中心",
+    "publisherID": 2,
+    "time": "1分钟前",
+    "title": "紫金新生达人秀|期待你的精彩",
+    "subTitle": "紫金新生达人秀现面向全校学生开启报名通道,报名即有综素加分,通过初赛就有二课!",
+    "poster": ["https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1180478225,661749625&fm=26&gp=0.jpg"],
+    "messageAttribute": "5",
+    "messageSource": "3",
+    "AdditionPoint": ""
   }
 ]
 
 module.exports = {
-  mainData:json
+  mainData: json
 }

+ 6 - 6
miniprogram/pages/aboutUs/aboutUs.wxml

@@ -27,27 +27,27 @@
   <view scroll-y style="height: {{winHeight - 60}}px;">
 
     <view class="sub-title primary-text-color">汇听建立的初衷</view>
-    <view class="activity-detail">
+    <view class="message-detail">
       <rich-text class="detail-text">
         “汇听”是一个为浙江大学各级各类学生组织、社团,发布活动、通知、纳新招募三种信息搭建的信息平台,用户可以在小程序上查看最新信息、检索自己需要的信息。
       </rich-text>
     </view>
-    <view class="activity-detail">
+    <view class="message-detail">
       <rich-text class="detail-text">
         想法诞生的来源,第一是目前学校各种社团组织发布信息的渠道不一,在qq空间发说说、在微信公众平台发推文、在朵朵校友圈发软广、在钉钉群发通知、qq邮箱发邮件、在文广等地宣传等等。很多时候,你完全不能知道所有的活动、通知、纳新招募,往往在感兴趣的活动过去了以后才惊觉还有这样的活动。
       </rich-text>
     </view>
-    <view class="activity-detail">
+    <view class="message-detail">
       <rich-text class="detail-text">
         第二是学校的各种信息过于零散,没有统一的分类。有的时候,我只想参加一个校内的志愿活动,但是要在各种公众号和qq群中,自主筛选信息,才能够找到适合我的活动。有的时候,我想在权服侠查阅一条选课通知,却要一直在小侠的空间手动查找,耗费过多时间。更难的是,有的时候我想要正常毕业或者评奖评优用的志愿者小时数、二课三课、综素、活动纪实,却不知道什么活动能给我带来这些。
       </rich-text>
     </view>
-    <view class="activity-detail">
+    <view class="message-detail">
       <rich-text class="detail-text">
         第三是信息的问答模块不够通畅。在qq空间发布的说说,谁都可以评论,可以看到一条正经的通知下面有很多没有营养的信息,刷掉了一些有意义的提问;而微信公众号方面,关闭留言版块后,发布者和用户的交流接近于零。
       </rich-text>
     </view>
-    <view class="activity-detail">
+    <view class="message-detail">
       <rich-text class="detail-text">
         在这些想法的激励下,汇听诞生了。
       </rich-text>
@@ -58,7 +58,7 @@
 <view wx:if="{{currentTab == 6}}">
   <view scroll-y style="height: {{winHeight - 60}}px;">
     <view class="sub-title primary-text-color">开发人员</view>
-    <view class="activity-detail">
+    <view class="message-detail">
       <text class="detail-text">
         程序猿:潘恩皓,冯忆馨,顾予晴\n 美工:刘燕燕
       </text>

+ 1 - 1
miniprogram/pages/aboutUs/aboutUs.wxss

@@ -4,7 +4,7 @@
   align-items: center;
 }
 
-.activity-detail {
+.message-detail {
   margin: 15rpx 50rpx;
   font-size: 30rpx;
 }

+ 0 - 295
miniprogram/pages/activity/activity.js

@@ -1,295 +0,0 @@
-const app = getApp()
-const util = require('../../utils/util.js')
-
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    hasUserInfo: false,
-    messageId: '',
-    activityInfo: {},
-    like: false,
-    loading: true,
-    showEdit: false,
-    pageToken: 0,
-    activityComment: [],
-    commentText: ''
-  },
-
-  getPublisherInfo: function () {
-    wx.navigateTo({
-      url: '/pages/publisher/publisher',
-    }).then(res => {
-      res.eventChannel.emit('loadCommonData', {
-        data: this.data.activityInfo.publisher
-      })
-    })
-  },
-
-  editActivity: function () {
-    wx.navigateTo({
-      url: '/pages/activityPublish/activityPublish?id=' + this.data.activityInfo.pub_id +
-        '&msg_id=' + this.data.messageId
-    })
-  },
-
-  deleteActivity: function () {
-    wx.showModal({
-      content: "确认删除信息?",
-      confirmColor: "#009195"
-    }).then(res => {
-      if (res.confirm) {
-        wx.showLoading({
-          title: '正在删除'
-        })
-        wx.cloud.callFunction({
-          name: 'deleteMessage',
-          data: {
-            msg_id: this.data.messageId
-          }
-        }).then(res => {
-          wx.hideLoading()
-          if (res.result.status !== 'OK') {
-            wx.showToast({
-              title: res.result.errMsg,
-              icon: 'none'
-            })
-            return
-          }
-          wx.navigateBack()
-          wx.showToast({
-            title: "删除成功",
-            icon: 'none'
-          })
-          const eventChannel = this.getOpenerEventChannel()
-          eventChannel.emit('deleteMessage')
-        })
-      }
-    })
-  },
-
-  toggleLike: function () {
-    if (this.data.loading) {
-      return
-    }
-    wx.showLoading({
-      title: this.data.like ? '取消收藏' : '收藏中'
-    })
-    wx.cloud.callFunction({
-      name: this.data.like ? 'deleteFavorite' : 'createFavorite',
-      data: {
-        msg_id: this.data.messageId
-      }
-    }).then(res => {
-      wx.hideLoading()
-      if (res.result.status !== 'OK') {
-        wx.showToast({
-          title: res.result.errMsg,
-          icon: 'none'
-        })
-        return
-      }
-      wx.showToast({
-        title: this.data.like ? '取消收藏成功' : '收藏成功',
-        icon: 'none'
-      })
-      this.setData({
-        like: !this.data.like
-      })
-    })
-  },
-
-  comment: function () {
-    if (this.data.commentText.length < 5) {
-      wx.showToast({
-        title: '提问字数至少为5',
-        icon: 'none'
-      })
-    } else {
-      wx.showLoading({
-        title: '正在发送'
-      })
-      wx.cloud.callFunction({
-        name: 'createQuestion',
-        data: {
-          msg_id: this.data.messageId,
-          question: this.data.commentText
-        }
-      }).then(res => {
-        wx.hideLoading()
-        if (res.result.status !== 'OK') {
-          wx.showToast({
-            title: res.result.errMsg,
-            icon: 'none'
-          })
-          return
-        }
-        wx.showToast({
-          title: '发送成功,请等待发布者回复',
-          icon: 'none'
-        })
-        this.setData({
-          commentText: ''
-        })
-      })
-    }
-  },
-
-  processCommonData: function (data) {
-    let edit = false
-    for (let i = 0; i < app.globalData.pubInfo.length; i++) {
-      if (data.pub_id === app.globalData.pubInfo[i].pub_id) {
-        edit = true
-      }
-    }
-    this.setData({
-      activityInfo: data,
-      showEdit: edit
-    })
-  },
-
-  loadExtraData: function () {
-    this.setData({
-      loading: true
-    })
-    wx.showNavigationBarLoading()
-    const arr = []
-    arr.push(wx.cloud.callFunction({
-      name: 'listQuestions',
-      data: {
-        msg_id: this.data.messageId,
-        page_token: this.data.pageToken,
-        page_size: 20
-      }
-    }))
-    arr.push(wx.cloud.callFunction({
-      name: 'getFavorite',
-      data: {
-        msg_id: this.data.messageId
-      }
-    }))
-    Promise.all(arr).then(res => {
-      wx.hideNavigationBarLoading()
-      if (res[0].result.status !== 'OK' || res[1].result.status !== 'OK') {
-        wx.showToast({
-          title: res[0].result.errMsg || res[1].result.errMsg,
-          icon: 'none'
-        })
-        return
-      }
-      for (let i = 0; i < res[0].result.list.length; i++) {
-        res[0].result.list[i].a_time = util.handleDate(res[0].result.list[i].a_time)
-      }
-      this.setData({
-        activityComment: this.data.activityComment.concat(res[0].result.list),
-        pageToken: res[0].result.next_page_token,
-        like: res[1].result.total === 1,
-        loading: false
-      })
-    })
-  },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {
-    this.setData({
-      hasUserInfo: app.globalData.hasUserInfo
-    })
-    if (options.id) {
-      this.setData({
-        messageId: options.id
-      })
-      wx.showLoading({
-        title: '正在加载'
-      })
-      wx.cloud.callFunction({
-        name: 'getMessage',
-        data: {
-          msg_id: this.data.messageId
-        }
-      }).then(res => {
-        wx.hideLoading()
-        if (res.result.status !== 'OK') {
-          wx.showToast({
-            title: res.result.errMsg,
-            icon: 'none'
-          })
-          return
-        }
-        res.result.data = util.dbToMsg(res.result.data)
-        this.processCommonData(res.result.data)
-        this.loadExtraData()
-      })
-    } else {
-      const eventChannel = this.getOpenerEventChannel()
-      eventChannel.on('loadCommonData', res => {
-        this.setData({
-          messageId: res.data._id,
-        })
-        this.processCommonData(res.data)
-        this.loadExtraData()
-        wx.cloud.callFunction({
-          name: 'createRead',
-          data: {
-            msg_id: this.data.messageId
-          }
-        })
-      })
-    }
-  },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh: function () {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {
-    if (this.data.loading) {
-      return
-    }
-    this.loadExtraData()
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function () {
-
-  }
-})

+ 0 - 6
miniprogram/pages/activity/activity.json

@@ -1,6 +0,0 @@
-{
-  "usingComponents": {
-    "itemActivityComment": "/components/itemActivityComment/itemActivityComment",
-    "imagePicker": "/components/imagePicker/imagePicker"
-  }
-}

+ 0 - 75
miniprogram/pages/activity/activity.wxml

@@ -1,75 +0,0 @@
-<!--为首页-信息详情页面-->
-<view class="page">
-  <view class="card">
-    <image wx:if="{{activityInfo.poster.length}}" class="activity-poster" src="{{activityInfo.poster[0]}}"
-      mode="aspectFill" />
-    <view style="width: 100%;">
-      <view class="profile">
-        <view class="avatar-name" bindtap="getPublisherInfo">
-          <image class="publisher-avatar" src="{{activityInfo.publisher.avatar}}"></image>
-          <view class="publisher-name">{{activityInfo.publisher.name}}</view>
-        </view>
-        <view class="activity-attribute primary-background-color white-text-color">
-          {{activityInfo.type[0]}}
-        </view>
-      </view>
-
-      <view class="title-time">
-        <view class="title">{{activityInfo.name}}</view>
-        <view class="time primary-text-color">{{activityInfo.publish_time}}</view>
-      </view>
-      <view wx:if="{{activityInfo.detail}}" class="text">
-        <text>{{activityInfo.detail}}</text>
-      </view>
-
-      <view class="line primary-background-color"></view>
-
-      <view wx:if="{{activityInfo.time}}" class="text">时间:{{activityInfo.time}}</view>
-      <view wx:if="{{activityInfo.place}}" class="text">地点:{{activityInfo.place}}</view>
-      <view wx:if="{{activityInfo.tag.length}}" class="text">活动提供:<text wx:for="{{activityInfo.tag}}" wx:for-item="tag"
-          wx:key="*this">{{tag}} </text></view>
-      <view wx:if="{{activityInfo.orient}}" class="text">面向对象:{{activityInfo.orient}}</view>
-      <view wx:if="{{activityInfo.contact}}" class="text">联系方式:{{activityInfo.contact}}</view>
-      <view wx:if="{{activityInfo.link}}" class="text">链接:{{activityInfo.link}}</view>
-
-      <imagePicker wx:if="{{activityInfo.photo.length}}" value="{{activityInfo.photo}}" max="1"
-        image-width="{{activityInfo.photo.length === 1 ? 698 : activityInfo.photo.length <= 4 ? 330 : 220}}"
-        image-height="{{activityInfo.photo.length === 1 ? 698 : activityInfo.photo.length <= 4 ? 330 : 220}}"
-        readonly />
-    </view>
-
-    <view class="bottom" wx:if="{{showEdit}}">
-      <view class="btn accent-background-color" bindtap="deleteActivity">
-        <image class="btn-icon" mode="aspectFit" src="/images/publisher/delete.png">
-        </image>
-        <view class="white-text-color">删除</view>
-      </view>
-      <view class="btn primary-background-color" bindtap="editActivity">
-        <image class="btn-icon" mode="aspectFit" src="/images/publisher/publish2.png">
-        </image>
-        <view class="white-text-color">修改</view>
-      </view>
-    </view>
-  </view>
-
-  <view class="message-block">
-    <view style="display: flex; justify-content: space-between;">
-      <view class="title2">{{activityComment.length === 0 ? "暂无问答" : "答疑区"}}</view>
-      <image wx:if="{{hasUserInfo}}" class="like" src="/images/like/{{like ? 'heart' : 'hollowheart'}}.png"
-        catchtap="toggleLike" />
-    </view>
-    <view class="card1" wx:for="{{activityComment}}" wx:for-item="comm" wx:key="_id">
-      <itemActivityComment comment="{{comm}}" />
-    </view>
-  </view>
-
-  <view wx:if="{{hasUserInfo}}" class="comment secondary-background-color">
-    <view class="comment-inside" style="display: flex; align-items: center;">
-      <icon type="info" size="20" color="#B0B0B0"></icon>
-      <input class="comment-input" style="width: 550rpx;" model:value="{{commentText}}" placeholder="提问"
-        confirm-type="send" bindconfirm="comment"></input>
-    </view>
-    <view class="comment-button {{commentText.length < 5 ? 'secondary-text-color' : 'primary-text-color'}}"
-      bindtap="comment">发送</view>
-  </view>
-</view>

+ 0 - 174
miniprogram/pages/activity/activity.wxss

@@ -1,174 +0,0 @@
-.page {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-}
-
-.card {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  width: 700rpx;
-  margin: 50rpx 0rpx;
-  padding-bottom: 20rpx;
-  background-color: #ffffff;
-  border-radius: 28rpx;
-  box-shadow: 5rpx 5rpx 8rpx 0rpx rgba(0, 0, 0, 0.16);
-}
-
-.card1 {
-  margin-top: 20rpx;
-}
-
-.avatar-name {
-  display: flex;
-  align-items: center;
-}
-
-.publisher-avatar {
-  width: 50rpx;
-  height: 50rpx;
-  border-radius: 25rpx;
-  margin-left: 10rpx;
-  z-index: 1;
-  border-color: #9E9E9E;
-  border-style: solid;
-  border-width: 2rpx;
-  background-color: #ffffff;
-}
-
-.profile {
-  display: flex;
-  justify-content: space-between;
-  position: relative;
-  top: -20rpx;
-  margin-right: 10rpx;
-}
-
-.publisher-name {
-  font-size: 24rpx;
-  background-color: #ffffff;
-  padding: 5rpx 20rpx 5rpx 30rpx;
-  margin-left: -20rpx;
-  border-radius: 20rpx;
-  box-shadow: 5rpx 5rpx 8rpx 0rpx rgba(0, 0, 0, 0.16);
-}
-
-.time {
-  margin-left: 10rpx;
-  font-size: 20rpx;
-}
-
-.activity-attribute {
-  font-size: 24rpx;
-  align-self: center;
-  padding-top: 5rpx;
-  padding-bottom: 5rpx;
-  padding-right: 20rpx;
-  padding-left: 20rpx;
-  border-radius: 28rpx;
-  box-shadow: 5rpx 5rpx 8rpx 0rpx rgba(0, 0, 0, 0.16);
-}
-
-.title {
-  font-size: 28rpx;
-}
-
-.title2 {
-  font-size: 32rpx;
-}
-
-.title-time {
-  margin-left: 50rpx;
-  margin-right: 30rpx;
-  margin-bottom: 20rpx;
-  display: flex;
-  justify-content: space-between;
-  align-items: flex-end;
-}
-
-.bottom-line {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  margin: 10rpx 10rpx 30rpx 10rpx;
-}
-
-.activity-poster {
-  height: 330rpx;
-  width: 700rpx;
-  border-radius: 20rpx 20rpx 0rpx 0rpx;
-}
-
-.message-block {
-  width: 650rpx;
-  padding-bottom: 100rpx;
-}
-
-.like {
-  height: 50rpx;
-  width: 50rpx;
-}
-
-.comment {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  height: 80rpx;
-  padding-left: 20rpx;
-  padding-right: 20rpx;
-  position: fixed;
-  bottom: 0rpx;
-  left: 0rpx;
-  right: 0rpx;
-}
-
-.comment-inside {
-  border-radius: 20rpx;
-  background: #dadada;
-}
-
-.comment-input {
-  font-size: 35rpx;
-}
-
-.comment-button {
-  height: 80rpx;
-  width: 100rpx;
-  line-height: 80rpx;
-  font-size: 30rpx;
-  text-align: center;
-}
-
-.text {
-  font-size: 24rpx;
-  margin-left: 50rpx;
-  margin-bottom: 20rpx;
-  margin-right: 20rpx;
-}
-
-.line {
-  height: 2rpx;
-  margin: 10rpx 20rpx 20rpx 20rpx;
-}
-
-.btn-icon {
-  height: 30rpx;
-  width: 30rpx;
-  margin-right: 10rpx;
-}
-
-.btn {
-  display: flex;
-  font-size: 24rpx;
-  padding: 5rpx 20rpx;
-  border-radius: 28rpx;
-  box-shadow: 5rpx 5rpx 8rpx 0rpx rgba(0, 0, 0, 0.16);
-  margin-right: 20rpx;
-}
-
-.bottom {
-  display: flex;
-  width: 100%;
-  justify-content: flex-end;
-}

+ 5 - 4
miniprogram/pages/main/main.wxml

@@ -3,23 +3,24 @@
 <view class="page">
   <view class="filter">
     <view class="filter-item secondary-text-color" data-filter-list="{{1}}" catchtap="toggleFilterList">
-      <text>{{filterItem[1] === '' ? filterName[1].title : filterItem[1]}}</text>
+      <text>{{filterItem[1] || filterName[1].title}}</text>
       <image class="filter-arrow" id="arrow1" mode="aspectFit" src="/images/arrow.png"></image>
     </view>
     <view class="filter-line"></view>
     <view class="filter-item secondary-text-color" data-filter-list="{{2}}" catchtap="toggleFilterList">
-      <text>{{filterItem[2] === '' ? filterName[2].title : filterItem[2]}}</text>
+      <text>{{filterItem[2] || filterName[2].title}}</text>
       <image class="filter-arrow" id="arrow2" mode="aspectFit" src="/images/arrow.png"></image>
     </view>
     <view class="filter-line"></view>
     <view class="filter-item secondary-text-color" data-filter-list="{{3}}" catchtap="toggleFilterList">
-      <text>{{filterItem[3] === '' ? filterName[3].title : filterItem[3]}}</text>
+      <text>{{filterItem[3] || filterName[3].title}}</text>
       <image class="filter-arrow" id="arrow3" mode="aspectFit" src="/images/arrow.png"></image>
     </view>
   </view>
   <view wx:if="{{filterList || tempFilterList}}" class="filter-block" catchtap="toggleEmpty">
     <view class="filter-lists">
-      <view wx:if="{{filterList === 1 || tempFilterList === 1}}" class="filter-list" id="list1">
+      <view wx:if="{{filterList === 1 || tempFilterList === 1}}" class="filter-list"
+        style="max-height: 500rpx; overflow-y: scroll;" id="list1">
         <view class="filter-list-item secondary-text-color" data-filter-item="{{''}}" catchtap="toggleFilterItem">全部
           <view wx:if="{{!filterItem[1]}}">✔</view>
         </view>

+ 3 - 5
miniprogram/pages/main/main.wxss

@@ -10,7 +10,7 @@
   align-items: center;
   height: 60rpx;
   width: 100%;
-  z-index: 100;
+  z-index: 2;
   background-color: #ffffff;
   box-shadow: 0rpx 0rpx 15rpx 0rpx rgba(0, 0, 0, 0.16);
 }
@@ -41,8 +41,7 @@
   position: fixed;
   top: 60rpx;
   bottom: 0rpx;
-  left: 0rpx;
-  right: 0rpx;
+  width: 100%;
   z-index: 2;
 }
 
@@ -56,8 +55,7 @@
   display: flex;
   flex-direction: column;
   width: 33%;
-  max-height: 500rpx;
-  overflow-y: scroll;
+  padding: 5rpx 0rpx;
   font-size: 25rpx;
   background: rgba(255, 255, 255, 0.95);
   opacity: 0;

+ 282 - 7
miniprogram/pages/message/message.js

@@ -1,20 +1,295 @@
-var newNews = require("../../data/newNewsData.js");
-Component({
+const app = getApp()
+const util = require('../../utils/util.js')
+
+Page({
+
+  /**
+   * 页面的初始数据
+   */
   data: {
-    newNews:{
+    hasUserInfo: false,
+    messageId: '',
+    messageInfo: {},
+    like: false,
+    loading: true,
+    showEdit: false,
+    pageToken: 0,
+    messageQuestion: [],
+    questionText: ''
+  },
+
+  getPublisherInfo: function () {
+    wx.navigateTo({
+      url: '/pages/publisher/publisher',
+    }).then(res => {
+      res.eventChannel.emit('loadCommonData', {
+        data: this.data.messageInfo.publisher
+      })
+    })
+  },
+
+  editMessage: function () {
+    wx.navigateTo({
+      url: '/pages/messagePublish/messagePublish?id=' + this.data.messageInfo.pub_id +
+        '&msg_id=' + this.data.messageId
+    })
+  },
+
+  deleteMessage: function () {
+    wx.showModal({
+      content: "确认删除信息?",
+      confirmColor: "#009195"
+    }).then(res => {
+      if (res.confirm) {
+        wx.showLoading({
+          title: '正在删除'
+        })
+        wx.cloud.callFunction({
+          name: 'deleteMessage',
+          data: {
+            msg_id: this.data.messageId
+          }
+        }).then(res => {
+          wx.hideLoading()
+          if (res.result.status !== 'OK') {
+            wx.showToast({
+              title: res.result.errMsg,
+              icon: 'none'
+            })
+            return
+          }
+          wx.navigateBack()
+          wx.showToast({
+            title: "删除成功",
+            icon: 'none'
+          })
+          const eventChannel = this.getOpenerEventChannel()
+          eventChannel.emit('deleteMessage')
+        })
+      }
+    })
+  },
+
+  toggleLike: function () {
+    if (this.data.loading) {
+      return
+    }
+    wx.showLoading({
+      title: this.data.like ? '取消收藏' : '收藏中'
+    })
+    wx.cloud.callFunction({
+      name: this.data.like ? 'deleteFavorite' : 'createFavorite',
+      data: {
+        msg_id: this.data.messageId
+      }
+    }).then(res => {
+      wx.hideLoading()
+      if (res.result.status !== 'OK') {
+        wx.showToast({
+          title: res.result.errMsg,
+          icon: 'none'
+        })
+        return
+      }
+      wx.showToast({
+        title: this.data.like ? '取消收藏成功' : '收藏成功',
+        icon: 'none'
+      })
+      this.setData({
+        like: !this.data.like
+      })
+    })
+  },
+
+  question: function () {
+    if (this.data.questionText.length < 5) {
+      wx.showToast({
+        title: '提问字数至少为5',
+        icon: 'none'
+      })
+    } else {
+      wx.showLoading({
+        title: '正在发送'
+      })
+      wx.cloud.callFunction({
+        name: 'createQuestion',
+        data: {
+          msg_id: this.data.messageId,
+          question: this.data.questionText
+        }
+      }).then(res => {
+        wx.hideLoading()
+        if (res.result.status !== 'OK') {
+          wx.showToast({
+            title: res.result.errMsg,
+            icon: 'none'
+          })
+          return
+        }
+        wx.showToast({
+          title: '发送成功,请等待发布者回复',
+          icon: 'none'
+        })
+        this.setData({
+          questionText: ''
+        })
+      })
+    }
+  },
 
+  processCommonData: function (data) {
+    let edit = false
+    for (let i = 0; i < app.globalData.pubInfo.length; i++) {
+      if (data.pub_id === app.globalData.pubInfo[i].pub_id) {
+        edit = true
+      }
     }
+    this.setData({
+      messageInfo: data,
+      showEdit: edit
+    })
   },
 
-  lifetimes: {
-    ready: function() {
+  loadExtraData: function () {
+    this.setData({
+      loading: true
+    })
+    wx.showNavigationBarLoading()
+    const arr = []
+    arr.push(wx.cloud.callFunction({
+      name: 'listQuestions',
+      data: {
+        msg_id: this.data.messageId,
+        page_token: this.data.pageToken,
+        page_size: 20
+      }
+    }))
+    arr.push(wx.cloud.callFunction({
+      name: 'getFavorite',
+      data: {
+        msg_id: this.data.messageId
+      }
+    }))
+    Promise.all(arr).then(res => {
+      wx.hideNavigationBarLoading()
+      if (res[0].result.status !== 'OK' || res[1].result.status !== 'OK') {
+        wx.showToast({
+          title: res[0].result.errMsg || res[1].result.errMsg,
+          icon: 'none'
+        })
+        return
+      }
+      for (let i = 0; i < res[0].result.list.length; i++) {
+        res[0].result.list[i].a_time = util.handleDate(res[0].result.list[i].a_time)
+      }
       this.setData({
-        newNews:newNews.newNews
+        messageQuestion: this.data.messageQuestion.concat(res[0].result.list),
+        pageToken: res[0].result.next_page_token,
+        like: res[1].result.total === 1,
+        loading: false
       })
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    this.setData({
+      hasUserInfo: app.globalData.hasUserInfo
+    })
+    if (options.id) {
+      this.setData({
+        messageId: options.id
+      })
+      wx.showLoading({
+        title: '正在加载'
+      })
+      wx.cloud.callFunction({
+        name: 'getMessage',
+        data: {
+          msg_id: this.data.messageId
+        }
+      }).then(res => {
+        wx.hideLoading()
+        if (res.result.status !== 'OK') {
+          wx.showToast({
+            title: res.result.errMsg,
+            icon: 'none'
+          })
+          return
+        }
+        res.result.data = util.dbToMsg(res.result.data)
+        this.processCommonData(res.result.data)
+        this.loadExtraData()
+      })
+    } else {
+      const eventChannel = this.getOpenerEventChannel()
+      eventChannel.on('loadCommonData', res => {
+        this.setData({
+          messageId: res.data._id,
+        })
+        this.processCommonData(res.data)
+        this.loadExtraData()
+        wx.cloud.callFunction({
+          name: 'createRead',
+          data: {
+            msg_id: this.data.messageId
+          }
+        })
+      })
+    }
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+    if (this.data.loading) {
+      return
     }
+    this.loadExtraData()
   },
 
-  methods: {
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
 
   }
 })

+ 2 - 2
miniprogram/pages/message/message.json

@@ -1,6 +1,6 @@
 {
-  "component":true,
   "usingComponents": {
-    "itemmyNews":"/components/itemmyNews/itemmyNews"
+    "itemMessageQuestion": "/components/itemMessageQuestion/itemMessageQuestion",
+    "imagePicker": "/components/imagePicker/imagePicker"
   }
 }

+ 71 - 4
miniprogram/pages/message/message.wxml

@@ -1,7 +1,74 @@
-<!-- 为消息的导航栏 两个component界面:“关注动态”followNews “我的消息”myNews-->
-<!-- 修改:将关注动态转移到首页,消息页面删除导航栏-->
+<!--为首页-信息详情页面-->
 <view class="page">
-  <view class="card" wx:for="{{newNews}}" wx:for-item="item" wx:key="_id" wx:index="index">
-    <itemmyNews item="{{item}}" />
+  <view class="card">
+    <image wx:if="{{messageInfo.poster.length}}" class="message-poster" src="{{messageInfo.poster[0]}}"
+      mode="aspectFill" />
+    <view style="width: 100%;">
+      <view class="profile">
+        <view class="avatar-name" bindtap="getPublisherInfo">
+          <image class="publisher-avatar" src="{{messageInfo.publisher.avatar}}"></image>
+          <view class="publisher-name">{{messageInfo.publisher.name}}</view>
+        </view>
+        <view class="message-attribute primary-background-color white-text-color">
+          {{messageInfo.type[0]}}
+        </view>
+      </view>
+
+      <view class="title-time">
+        <view class="title">{{messageInfo.name}}</view>
+        <view class="time primary-text-color">{{messageInfo.publish_time}}</view>
+      </view>
+      <view wx:if="{{messageInfo.detail}}" class="text">
+        <text>{{messageInfo.detail}}</text>
+      </view>
+
+      <view class="line primary-background-color"></view>
+
+      <view wx:if="{{messageInfo.time}}" class="text">时间:{{messageInfo.time}}</view>
+      <view wx:if="{{messageInfo.place}}" class="text">地点:{{messageInfo.place}}</view>
+      <view wx:if="{{messageInfo.tag.length}}" class="text">活动提供:<text wx:for="{{messageInfo.tag}}" wx:for-item="tag"
+          wx:key="*this">{{tag}} </text></view>
+      <view wx:if="{{messageInfo.orient}}" class="text">面向对象:{{messageInfo.orient}}</view>
+      <view wx:if="{{messageInfo.contact}}" class="text">联系方式:{{messageInfo.contact}}</view>
+      <view wx:if="{{messageInfo.link}}" class="text">链接:{{messageInfo.link}}</view>
+
+      <imagePicker wx:if="{{messageInfo.photo.length}}" value="{{messageInfo.photo}}" max="1"
+        image-width="{{messageInfo.photo.length === 1 ? 698 : messageInfo.photo.length <= 4 ? 330 : 220}}"
+        image-height="{{messageInfo.photo.length === 1 ? 698 : messageInfo.photo.length <= 4 ? 330 : 220}}" readonly />
+    </view>
+
+    <view class="bottom" wx:if="{{showEdit}}">
+      <view class="btn accent-background-color" bindtap="deleteMessage">
+        <image class="btn-icon" mode="aspectFit" src="/images/publisher/delete.png">
+        </image>
+        <view class="white-text-color">删除</view>
+      </view>
+      <view class="btn primary-background-color" bindtap="editMessage">
+        <image class="btn-icon" mode="aspectFit" src="/images/publisher/publish2.png">
+        </image>
+        <view class="white-text-color">修改</view>
+      </view>
+    </view>
+  </view>
+
+  <view class="message-block">
+    <view style="display: flex; justify-content: space-between;">
+      <view class="title2">{{messageQuestion.length === 0 ? "暂无问答" : "答疑区"}}</view>
+      <image wx:if="{{hasUserInfo}}" class="like" src="/images/like/{{like ? 'heart' : 'hollowheart'}}.png"
+        catchtap="toggleLike" />
+    </view>
+    <view class="card1" wx:for="{{messageQuestion}}" wx:for-item="comm" wx:key="_id">
+      <itemMessageQuestion question="{{comm}}" />
+    </view>
+  </view>
+
+  <view wx:if="{{hasUserInfo}}" class="question secondary-background-color">
+    <view class="question-inside" style="display: flex; align-items: center;">
+      <icon type="info" size="20" color="#B0B0B0"></icon>
+      <input class="question-input" style="width: 550rpx;" model:value="{{questionText}}" placeholder="提问"
+        confirm-type="send" bindconfirm="question"></input>
+    </view>
+    <view class="question-button {{questionText.length < 5 ? 'secondary-text-color' : 'primary-text-color'}}"
+      bindtap="question">发送</view>
   </view>
 </view>

+ 171 - 1
miniprogram/pages/message/message.wxss

@@ -1,4 +1,174 @@
-.page{
+.page {
   display: flex;
   flex-direction: column;
+  align-items: center;
 }
+
+.card {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  width: 700rpx;
+  margin: 50rpx 0rpx;
+  padding-bottom: 20rpx;
+  background-color: #ffffff;
+  border-radius: 28rpx;
+  box-shadow: 5rpx 5rpx 8rpx 0rpx rgba(0, 0, 0, 0.16);
+}
+
+.card1 {
+  margin-top: 20rpx;
+}
+
+.avatar-name {
+  display: flex;
+  align-items: center;
+}
+
+.publisher-avatar {
+  width: 50rpx;
+  height: 50rpx;
+  border-radius: 25rpx;
+  margin-left: 10rpx;
+  z-index: 1;
+  border-color: #9E9E9E;
+  border-style: solid;
+  border-width: 2rpx;
+  background-color: #ffffff;
+}
+
+.profile {
+  display: flex;
+  justify-content: space-between;
+  position: relative;
+  top: -20rpx;
+  margin-right: 10rpx;
+}
+
+.publisher-name {
+  font-size: 24rpx;
+  background-color: #ffffff;
+  padding: 5rpx 20rpx 5rpx 30rpx;
+  margin-left: -20rpx;
+  border-radius: 20rpx;
+  box-shadow: 5rpx 5rpx 8rpx 0rpx rgba(0, 0, 0, 0.16);
+}
+
+.time {
+  margin-left: 10rpx;
+  font-size: 20rpx;
+}
+
+.message-attribute {
+  font-size: 24rpx;
+  align-self: center;
+  padding-top: 5rpx;
+  padding-bottom: 5rpx;
+  padding-right: 20rpx;
+  padding-left: 20rpx;
+  border-radius: 28rpx;
+  box-shadow: 5rpx 5rpx 8rpx 0rpx rgba(0, 0, 0, 0.16);
+}
+
+.title {
+  font-size: 28rpx;
+}
+
+.title2 {
+  font-size: 32rpx;
+}
+
+.title-time {
+  margin-left: 50rpx;
+  margin-right: 30rpx;
+  margin-bottom: 20rpx;
+  display: flex;
+  justify-content: space-between;
+  align-items: flex-end;
+}
+
+.bottom-line {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin: 10rpx 10rpx 30rpx 10rpx;
+}
+
+.message-poster {
+  height: 330rpx;
+  width: 700rpx;
+  border-radius: 20rpx 20rpx 0rpx 0rpx;
+}
+
+.message-block {
+  width: 650rpx;
+  padding-bottom: 100rpx;
+}
+
+.like {
+  height: 50rpx;
+  width: 50rpx;
+}
+
+.question {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  height: 80rpx;
+  padding-left: 20rpx;
+  padding-right: 20rpx;
+  position: fixed;
+  bottom: 0rpx;
+  left: 0rpx;
+  right: 0rpx;
+}
+
+.question-inside {
+  border-radius: 20rpx;
+  background: #dadada;
+}
+
+.question-input {
+  font-size: 35rpx;
+}
+
+.question-button {
+  height: 80rpx;
+  width: 100rpx;
+  line-height: 80rpx;
+  font-size: 30rpx;
+  text-align: center;
+}
+
+.text {
+  font-size: 24rpx;
+  margin-left: 50rpx;
+  margin-bottom: 20rpx;
+  margin-right: 20rpx;
+}
+
+.line {
+  height: 2rpx;
+  margin: 10rpx 20rpx 20rpx 20rpx;
+}
+
+.btn-icon {
+  height: 30rpx;
+  width: 30rpx;
+  margin-right: 10rpx;
+}
+
+.btn {
+  display: flex;
+  font-size: 24rpx;
+  padding: 5rpx 20rpx;
+  border-radius: 28rpx;
+  box-shadow: 5rpx 5rpx 8rpx 0rpx rgba(0, 0, 0, 0.16);
+  margin-right: 20rpx;
+}
+
+.bottom {
+  display: flex;
+  width: 100%;
+  justify-content: flex-end;
+}

+ 246 - 246
miniprogram/pages/activityPublish/activityPublish.js → miniprogram/pages/messagePublish/messagePublish.js

@@ -1,247 +1,247 @@
-const util = require('../../utils/util.js')
-
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    publisherId: '',
-    messageId: '',
-    activityInfo: {},
-    currentTab: 0,
-    winWidth: 0,
-    winHeight: 0,
-    types1: [{
-      value: '志愿活动',
-      checked: false
-    }, {
-      value: '文艺活动',
-      checked: false
-    }, {
-      value: '体育活动',
-      checked: false
-    }, {
-      value: '学术活动',
-      checked: false
-    }, {
-      value: '素质拓展',
-      checked: false
-    }, {
-      value: '精品课程',
-      checked: false
-    }, {
-      value: '其他活动',
-      checked: false
-    }],
-    types2: [{
-      value: '二课分',
-      checked: false
-    }, {
-      value: '三课分',
-      checked: false
-    }, {
-      value: '四课分',
-      checked: false
-    }, {
-      value: '勤工助学',
-      checked: false
-    }, {
-      value: '志愿者小时数',
-      checked: false
-    }, {
-      value: '综素',
-      checked: false
-    }],
-    types3: [{
-      value: '水电通知',
-      checked: false
-    }, {
-      value: '缴费通知',
-      checked: false
-    }, {
-      value: '假期通知',
-      checked: false
-    }, {
-      value: '后勤通知',
-      checked: false
-    }, {
-      value: '图书馆通知',
-      checked: false
-    }, {
-      value: '选课通知',
-      checked: false
-    }, {
-      value: '竞赛通知',
-      checked: false
-    }, {
-      value: '考试通知',
-      checked: false
-    }, {
-      value: '其他通知',
-      checked: false
-    }]
-  },
-
-  switch1: function (e) {
-    this.setData({
-      currentTab: 1
-    })
-  },
-
-  switch2: function (e) {
-    this.setData({
-      currentTab: 2
-    })
-  },
-
-  switch3: function (e) {
-    this.setData({
-      currentTab: 3
-    })
-  },
-
-  switch4: function (e) {
-    const value = e.detail.value
-
-    if (this.data.currentTab === 2) {
-      value.type = ['纳新']
-    }
-
-    if (value.name === '' || value.type.length === 0 || this.data.detail === '') {
-      wx.showToast({
-        title: '请确认信息填写完整',
-        icon: 'none'
-      })
-      return
-    }
-
-    wx.showLoading({
-      title: '上传图片'
-    })
-    const arr = []
-    if (value.poster.length !== 0 && value.poster[0].substr(0, 8) !== 'cloud://') {
-      arr.push(wx.cloud.uploadFile({
-        cloudPath: `messagePoster/${util.randomString(16)}.jpg`,
-        filePath: value.poster[0]
-      }))
-    }
-    for (let i = 0; i < value.photo.length; i++) {
-      if (value.photo[i].substr(0, 8) !== 'cloud://') {
-        arr.push(wx.cloud.uploadFile({
-          cloudPath: `messagePhoto/${util.randomString(16)}.jpg`,
-          filePath: value.photo[i]
-        }))
-      }
-    }
-    Promise.all(arr).then(res => {
-      wx.hideLoading()
-      wx.showLoading({
-        title: '正在' + (this.data.messageId === '' ? '发布' : '修改')
-      })
-      if (this.data.messageId === '') {
-        value.pub_id = this.data.publisherId
-      } else {
-        value.msg_id = this.data.messageId
-      }
-      if (value.poster.length !== 0 && value.poster[0].substr(0, 8) !== 'cloud://') {
-        value.poster[0] = res[0].fileID
-        res.splice(0, 1)
-      }
-      for (let i = 0; i < value.photo.length; i++) {
-        if (value.photo[i].substr(0, 8) !== 'cloud://') {
-          value.photo[i] = res[0].fileID
-          res.splice(0, 1)
-        }
-      }
-      if (this.data.messageId === '') {
-        return wx.cloud.callFunction({
-          name: 'createMessage',
-          data: util.msgToDb(value)
-        })
-      } else {
-        return wx.cloud.callFunction({
-          name: 'updateMessage',
-          data: util.msgToDb(value)
-        })
-      }
-    }).then(res => {
-      wx.hideLoading()
-      if (res.result.status !== 'OK') {
-        wx.showToast({
-          title: res.result.errMsg,
-          icon: 'none'
-        })
-        return
-      }
-      this.setData({
-        currentTab: 4
-      })
-    })
-  },
-
-  returnToPublisher: function (e) {
-    wx.navigateBack()
-  },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {
-    this.setData({
-      publisherId: options.id
-    })
-    if (options.msg_id) {
-      this.setData({
-        messageId: options.msg_id,
-        currentTab: -1
-      })
-      wx.showLoading({
-        title: '正在加载'
-      })
-      wx.cloud.callFunction({
-        name: 'getMessage',
-        data: {
-          msg_id: this.data.messageId
-        }
-      }).then(res => {
-        wx.hideLoading()
-        if (res.result.status !== 'OK') {
-          wx.showToast({
-            title: res.result.errMsg,
-            icon: 'none'
-          })
-          return
-        }
-        res.result.data = util.dbToMsg(res.result.data)
-        const type = res.result.data.type[0].substr(res.result.data.type[0].length - 2)
-        for (let i = 0; i < this.data.types1.length; i++) {
-          this.data.types1[i].checked = res.result.data.type.indexOf(this.data.types1[i].value) !== -1
-        }
-        for (let i = 0; i < this.data.types2.length; i++) {
-          this.data.types2[i].checked = res.result.data.tag.indexOf(this.data.types2[i].value) !== -1
-        }
-        for (let i = 0; i < this.data.types3.length; i++) {
-          this.data.types3[i].checked = res.result.data.type.indexOf(this.data.types3[i].value) !== -1
-        }
-        this.setData({
-          types1: this.data.types1,
-          types2: this.data.types2,
-          types3: this.data.types3,
-          currentTab: type === '通知' ? 3 : type === '纳新' ? 2 : 1,
-          activityInfo: res.result.data
-        })
-      })
-    }
-    wx.getSystemInfo({
-      success: function (res) {
-        this.setData({
-          winWidth: res.windowWidth
-        })
-        this.setData({
-          winHeight: res.windowHeight
-        })
-      }.bind(this),
-    })
-  }
+const util = require('../../utils/util.js')
+
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    publisherId: '',
+    messageId: '',
+    messageInfo: {},
+    currentTab: 0,
+    winWidth: 0,
+    winHeight: 0,
+    types1: [{
+      value: '志愿活动',
+      checked: false
+    }, {
+      value: '文艺活动',
+      checked: false
+    }, {
+      value: '体育活动',
+      checked: false
+    }, {
+      value: '学术活动',
+      checked: false
+    }, {
+      value: '素质拓展',
+      checked: false
+    }, {
+      value: '精品课程',
+      checked: false
+    }, {
+      value: '其他活动',
+      checked: false
+    }],
+    types2: [{
+      value: '二课分',
+      checked: false
+    }, {
+      value: '三课分',
+      checked: false
+    }, {
+      value: '四课分',
+      checked: false
+    }, {
+      value: '勤工助学',
+      checked: false
+    }, {
+      value: '志愿者小时数',
+      checked: false
+    }, {
+      value: '综素',
+      checked: false
+    }],
+    types3: [{
+      value: '水电通知',
+      checked: false
+    }, {
+      value: '缴费通知',
+      checked: false
+    }, {
+      value: '假期通知',
+      checked: false
+    }, {
+      value: '后勤通知',
+      checked: false
+    }, {
+      value: '图书馆通知',
+      checked: false
+    }, {
+      value: '选课通知',
+      checked: false
+    }, {
+      value: '竞赛通知',
+      checked: false
+    }, {
+      value: '考试通知',
+      checked: false
+    }, {
+      value: '其他通知',
+      checked: false
+    }]
+  },
+
+  switch1: function (e) {
+    this.setData({
+      currentTab: 1
+    })
+  },
+
+  switch2: function (e) {
+    this.setData({
+      currentTab: 2
+    })
+  },
+
+  switch3: function (e) {
+    this.setData({
+      currentTab: 3
+    })
+  },
+
+  switch4: function (e) {
+    const value = e.detail.value
+
+    if (this.data.currentTab === 2) {
+      value.type = ['纳新']
+    }
+
+    if (value.name === '' || value.type.length === 0 || this.data.detail === '') {
+      wx.showToast({
+        title: '请确认信息填写完整',
+        icon: 'none'
+      })
+      return
+    }
+
+    wx.showLoading({
+      title: '上传图片'
+    })
+    const arr = []
+    if (value.poster.length !== 0 && value.poster[0].substr(0, 8) !== 'cloud://') {
+      arr.push(wx.cloud.uploadFile({
+        cloudPath: `messagePoster/${util.randomString(16)}.jpg`,
+        filePath: value.poster[0]
+      }))
+    }
+    for (let i = 0; i < value.photo.length; i++) {
+      if (value.photo[i].substr(0, 8) !== 'cloud://') {
+        arr.push(wx.cloud.uploadFile({
+          cloudPath: `messagePhoto/${util.randomString(16)}.jpg`,
+          filePath: value.photo[i]
+        }))
+      }
+    }
+    Promise.all(arr).then(res => {
+      wx.hideLoading()
+      wx.showLoading({
+        title: '正在' + (this.data.messageId === '' ? '发布' : '修改')
+      })
+      if (this.data.messageId === '') {
+        value.pub_id = this.data.publisherId
+      } else {
+        value.msg_id = this.data.messageId
+      }
+      if (value.poster.length !== 0 && value.poster[0].substr(0, 8) !== 'cloud://') {
+        value.poster[0] = res[0].fileID
+        res.splice(0, 1)
+      }
+      for (let i = 0; i < value.photo.length; i++) {
+        if (value.photo[i].substr(0, 8) !== 'cloud://') {
+          value.photo[i] = res[0].fileID
+          res.splice(0, 1)
+        }
+      }
+      if (this.data.messageId === '') {
+        return wx.cloud.callFunction({
+          name: 'createMessage',
+          data: util.msgToDb(value)
+        })
+      } else {
+        return wx.cloud.callFunction({
+          name: 'updateMessage',
+          data: util.msgToDb(value)
+        })
+      }
+    }).then(res => {
+      wx.hideLoading()
+      if (res.result.status !== 'OK') {
+        wx.showToast({
+          title: res.result.errMsg,
+          icon: 'none'
+        })
+        return
+      }
+      this.setData({
+        currentTab: 4
+      })
+    })
+  },
+
+  returnToPublisher: function (e) {
+    wx.navigateBack()
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    this.setData({
+      publisherId: options.id
+    })
+    if (options.msg_id) {
+      this.setData({
+        messageId: options.msg_id,
+        currentTab: -1
+      })
+      wx.showLoading({
+        title: '正在加载'
+      })
+      wx.cloud.callFunction({
+        name: 'getMessage',
+        data: {
+          msg_id: this.data.messageId
+        }
+      }).then(res => {
+        wx.hideLoading()
+        if (res.result.status !== 'OK') {
+          wx.showToast({
+            title: res.result.errMsg,
+            icon: 'none'
+          })
+          return
+        }
+        res.result.data = util.dbToMsg(res.result.data)
+        const type = res.result.data.type[0].substr(res.result.data.type[0].length - 2)
+        for (let i = 0; i < this.data.types1.length; i++) {
+          this.data.types1[i].checked = res.result.data.type.indexOf(this.data.types1[i].value) !== -1
+        }
+        for (let i = 0; i < this.data.types2.length; i++) {
+          this.data.types2[i].checked = res.result.data.tag.indexOf(this.data.types2[i].value) !== -1
+        }
+        for (let i = 0; i < this.data.types3.length; i++) {
+          this.data.types3[i].checked = res.result.data.type.indexOf(this.data.types3[i].value) !== -1
+        }
+        this.setData({
+          types1: this.data.types1,
+          types2: this.data.types2,
+          types3: this.data.types3,
+          currentTab: type === '通知' ? 3 : type === '纳新' ? 2 : 1,
+          messageInfo: res.result.data
+        })
+      })
+    }
+    wx.getSystemInfo({
+      success: function (res) {
+        this.setData({
+          winWidth: res.windowWidth
+        })
+        this.setData({
+          winHeight: res.windowHeight
+        })
+      }.bind(this),
+    })
+  }
 })

+ 5 - 5
miniprogram/pages/activityPublish/activityPublish.json → miniprogram/pages/messagePublish/messagePublish.json

@@ -1,6 +1,6 @@
-{
-  "usingComponents": {
-    "imagePicker": "/components/imagePicker/imagePicker",
-    "myButton": "/components/myButton/myButton"
-  }
+{
+  "usingComponents": {
+    "imagePicker": "/components/imagePicker/imagePicker",
+    "myButton": "/components/myButton/myButton"
+  }
 }

+ 189 - 189
miniprogram/pages/activityPublish/activityPublish.wxml → miniprogram/pages/messagePublish/messagePublish.wxml

@@ -1,190 +1,190 @@
-<!--为我的-信息发布页面-->
-<!-- 修改:信息发布页面移到首页-->
-
-<view class="title primary-text-color">信息{{messageId ? '修改' : '发布'}}</view>
-
-<view wx:if="{{currentTab === 0}}" class="con">
-  <view class="title2">信息发布类型</view>
-  <view class="buttons">
-    <myButton class="button" type="primary" bindtap="switch1">活动</myButton>
-    <myButton class="button" type="primary" bindtap="switch2">纳新</myButton>
-    <myButton class="button" type="primary" bindtap="switch3">通知</myButton>
-  </view>
-</view>
-
-<scroll-view wx:if="{{currentTab === 1}}" style="height: {{winHeight - 60}}px;" scroll-y>
-  <view class="sub-title">活动{{messageId ? '修改' : '发布'}}</view>
-  <form bindsubmit="switch4">
-    <view class="block">
-      <view class="cate">活动名称<span style="color: #FF0000">*</span></view>
-      <input class="input" placeholder="请填写" name="name" value="{{activityInfo.name}}" />
-    </view>
-    <view class="block">
-      <view class="cate" style="align-self: flex-start;">活动类型<span style="color: #FF0000">*</span></view>
-      <checkbox-group class="checkbox-group" name="type">
-        <label wx:for="{{types1}}" wx:for-item="item" wx:key="value">
-          <checkbox class="checkbox" value="{{item.value}}" checked="{{item.checked}}" color="#469298">{{item.value}}
-          </checkbox>
-        </label>
-      </checkbox-group>
-    </view>
-    <view class="block">
-      <view class="cate" style="align-self: flex-start;">活动简介</view>
-      <textarea class="input" style="height: 100rpx;" placeholder="请填写" name="brief"
-        value="{{activityInfo.brief}}"></textarea>
-    </view>
-    <view class="block" style="margin-bottom: 20rpx;">
-      <view class="cate" style="align-self: flex-start;">活动详情<span style="color: #FF0000">*</span></view>
-      <textarea class="input" style="height: 200rpx;" placeholder="请填写" name="detail"
-        value="{{activityInfo.detail}}"></textarea>
-    </view>
-    <view class="block">
-      <view class="cate" style="align-self: flex-start;">活动封图</view>
-      <imagePicker name="poster" max="1" image-width="450" image-height="215" value="{{activityInfo.poster}}" />
-    </view>
-    <view class="block" style="margin-bottom: 20rpx;">
-      <view class="cate" style="align-self: flex-start;">活动图片</view>
-      <imagePicker name="photo" max="9" image-width="145" image-height="145" value="{{activityInfo.photo}}" />
-    </view>
-    <view class="block">
-      <view class="cate" style="align-self: flex-start;">活动提供</view>
-      <checkbox-group class="checkbox-group" name="tag">
-        <label wx:for="{{types2}}" wx:for-item="item" wx:key="value">
-          <checkbox class="checkbox" value="{{item.value}}" checked="{{item.checked}}" color="#469298">
-            {{item.value}}</checkbox>
-        </label>
-      </checkbox-group>
-    </view>
-    <view class="block">
-      <view class="cate">面向对象</view>
-      <input class="input" placeholder="请填写" name="orient" value="{{activityInfo.orient}}" />
-    </view>
-    <view class="block">
-      <view class="cate">活动时间</view>
-      <input class="input" placeholder="请填写" name="time" value="{{activityInfo.time}}" />
-    </view>
-    <view class="block">
-      <view class="cate">活动地点</view>
-      <input class="input" placeholder="请填写" name="place" value="{{activityInfo.place}}" />
-    </view>
-    <view class="block">
-      <view class="cate">联系方式</view>
-      <input class="input" placeholder="请填写" name="contact" value="{{activityInfo.contact}}" />
-    </view>
-    <view class="block">
-      <view class="cate">链接</view>
-      <input class="input" placeholder="请填写" name="link" value="{{activityInfo.link}}" />
-    </view>
-    <view wx:if="{{messageId}}" class="block" style="margin-top: 20rpx;">
-      <view class="cate primary-text-color" style="align-self: flex-start;">消息通知</view>
-      <textarea class="input" style="height: 200rpx;" placeholder="提交后会以消息的形式通知关注者" name="notify"></textarea>
-    </view>
-    <myButton class="button" type="primary">提交</myButton>
-  </form>
-</scroll-view>
-
-<scroll-view wx:if="{{currentTab === 2}}" style="height: {{winHeight - 60}}px;" scroll-y>
-  <view class="sub-title">纳新{{messageId ? '修改' : '发布'}}</view>
-  <form bindsubmit="switch4">
-    <view class="block">
-      <view class="cate">纳新标题<span style="color: #FF0000">*</span></view>
-      <input class="input" placeholder="请填写" name="name" value="{{activityInfo.name}}" />
-    </view>
-    <view class="block">
-      <view class="cate" style="align-self: flex-start;">纳新简介</view>
-      <textarea class="input" style="height: 100rpx;" placeholder="请填写" name="brief"
-        value="{{activityInfo.brief}}"></textarea>
-    </view>
-    <view class="block" style="margin-bottom: 20rpx;">
-      <view class="cate" style="align-self: flex-start;">纳新详情<span style="color: #FF0000">*</span></view>
-      <textarea class="input" style="height: 200rpx;" placeholder="请填写" name="detail"
-        value="{{activityInfo.detail}}"></textarea>
-    </view>
-    <view class="block">
-      <view class="cate" style="align-self: flex-start;">纳新封图</view>
-      <imagePicker name="poster" max="1" image-width="450" image-height="215" value="{{activityInfo.poster}}" />
-    </view>
-    <view class="block" style="margin-bottom: 20rpx;">
-      <view class="cate" style="align-self: flex-start;">纳新图片</view>
-      <imagePicker name="photo" max="9" image-width="145" image-height="145" value="{{activityInfo.photo}}" />
-    </view>
-    <view class="block">
-      <view class="cate">面向对象</view>
-      <input class="input" placeholder="请填写" name="orient" value="{{activityInfo.orient}}" />
-    </view>
-    <view class="block">
-      <view class="cate">纳新时间</view>
-      <input class="input" placeholder="请填写" name="time" value="{{activityInfo.time}}" />
-    </view>
-    <view class="block">
-      <view class="cate">现宣信息</view>
-      <input class="input" placeholder="请填写" name="place" value="{{activityInfo.place}}" />
-    </view>
-    <view class="block">
-      <view class="cate">联系方式</view>
-      <input class="input" placeholder="请填写" name="contact" value="{{activityInfo.contact}}" />
-    </view>
-    <view class="block">
-      <view class="cate">链接</view>
-      <input class="input" placeholder="请填写" name="link" value="{{activityInfo.link}}" />
-    </view>
-    <view wx:if="{{messageId}}" class="block" style="margin-top: 20rpx;">
-      <view class="cate primary-text-color" style="align-self: flex-start;">消息通知</view>
-      <textarea class="input" style="height: 200rpx;" placeholder="提交后会以消息的形式通知关注者" name="notify"></textarea>
-    </view>
-    <myButton class="button" type="primary">提交</myButton>
-  </form>
-</scroll-view>
-
-<scroll-view wx:if="{{currentTab === 3}}" style="height: {{winHeight - 60}}px;" scroll-y>
-  <view class="sub-title">通知{{messageId ? '修改' : '发布'}}</view>
-  <form bindsubmit="switch4">
-    <view class="block">
-      <view class="cate">通知标题<span style="color: #FF0000">*</span></view>
-      <input class="input" placeholder="请填写" name="name" value="{{activityInfo.name}}" />
-    </view>
-    <view class="block">
-      <view class="cate" style="align-self: flex-start;">通知类型<span style="color: #FF0000">*</span></view>
-      <checkbox-group class="checkbox-group" name="type">
-        <label wx:for="{{types3}}" wx:for-item="item" wx:key="value">
-          <checkbox class="checkbox" value="{{item.value}}" checked="{{item.checked}}" color="#469298">{{item.value}}
-          </checkbox>
-        </label>
-      </checkbox-group>
-    </view>
-    <view class="block">
-      <view class="cate" style="align-self: flex-start;">通知简介</view>
-      <textarea class="input" style="height: 100rpx;" placeholder="请填写" name="brief"
-        value="{{activityInfo.brief}}"></textarea>
-    </view>
-    <view class="block" style="margin-bottom: 20rpx;">
-      <view class="cate" style="align-self: flex-start;">通知详情<span style="color: #FF0000">*</span></view>
-      <textarea class="input" style="height: 200rpx;" placeholder="请填写" name="detail"
-        value="{{activityInfo.detail}}"></textarea>
-    </view>
-    <view class="block">
-      <view class="cate" style="align-self: flex-start;">通知封图</view>
-      <imagePicker name="poster" max="1" image-width="450" image-height="215" value="{{activityInfo.poster}}" />
-    </view>
-    <view class="block" style="margin-bottom: 20rpx;">
-      <view class="cate" style="align-self: flex-start;">通知图片</view>
-      <imagePicker name="photo" max="9" image-width="145" image-height="145" value="{{activityInfo.photo}}" />
-    </view>
-    <view class="block">
-      <view class="cate">链接</view>
-      <input class="input" placeholder="请填写" name="link" value="{{activityInfo.link}}" />
-    </view>
-    <view wx:if="{{messageId}}" class="block" style="margin-top: 20rpx;">
-      <view class="cate primary-text-color" style="align-self: flex-start;">消息通知</view>
-      <textarea class="input" style="height: 200rpx;" placeholder="提交后会以消息的形式通知关注者" name="notify"></textarea>
-    </view>
-    <myButton class="button" type="primary">提交</myButton>
-  </form>
-</scroll-view>
-
-<view wx:if="{{currentTab === 4}}" class="con">
-  <view class="con1 primary-text-color">{{messageId ? '修改' : '发布'}}成功!</view>
-  <image class="success-icon" src="../../images/finish.png" mode="aspectFill" />
-  <!-- <view class="con2"></view> -->
-  <myButton class="button" type="primary" bindtap="returnToPublisher">返回</myButton>
+<!--为我的-信息发布页面-->
+<!-- 修改:信息发布页面移到首页-->
+
+<view class="title primary-text-color">信息{{messageId ? '修改' : '发布'}}</view>
+
+<view wx:if="{{currentTab === 0}}" class="con">
+  <view class="title2">信息发布类型</view>
+  <view class="buttons">
+    <myButton class="button" type="primary" bindtap="switch1">活动</myButton>
+    <myButton class="button" type="primary" bindtap="switch2">纳新</myButton>
+    <myButton class="button" type="primary" bindtap="switch3">通知</myButton>
+  </view>
+</view>
+
+<scroll-view wx:if="{{currentTab === 1}}" style="height: {{winHeight - 60}}px;" scroll-y>
+  <view class="sub-title">活动{{messageId ? '修改' : '发布'}}</view>
+  <form bindsubmit="switch4">
+    <view class="block">
+      <view class="cate">活动名称<span style="color: #FF0000">*</span></view>
+      <input class="input" placeholder="请填写" name="name" value="{{messageInfo.name}}" />
+    </view>
+    <view class="block">
+      <view class="cate" style="align-self: flex-start;">活动类型<span style="color: #FF0000">*</span></view>
+      <checkbox-group class="checkbox-group" name="type">
+        <label wx:for="{{types1}}" wx:for-item="item" wx:key="value">
+          <checkbox class="checkbox" value="{{item.value}}" checked="{{item.checked}}" color="#469298">{{item.value}}
+          </checkbox>
+        </label>
+      </checkbox-group>
+    </view>
+    <view class="block">
+      <view class="cate" style="align-self: flex-start;">活动简介</view>
+      <textarea class="input" style="height: 100rpx;" placeholder="请填写" name="brief"
+        value="{{messageInfo.brief}}"></textarea>
+    </view>
+    <view class="block" style="margin-bottom: 20rpx;">
+      <view class="cate" style="align-self: flex-start;">活动详情<span style="color: #FF0000">*</span></view>
+      <textarea class="input" style="height: 200rpx;" placeholder="请填写" name="detail"
+        value="{{messageInfo.detail}}"></textarea>
+    </view>
+    <view class="block">
+      <view class="cate" style="align-self: flex-start;">活动封图</view>
+      <imagePicker name="poster" max="1" image-width="450" image-height="215" value="{{messageInfo.poster}}" />
+    </view>
+    <view class="block" style="margin-bottom: 20rpx;">
+      <view class="cate" style="align-self: flex-start;">活动图片</view>
+      <imagePicker name="photo" max="9" image-width="145" image-height="145" value="{{messageInfo.photo}}" />
+    </view>
+    <view class="block">
+      <view class="cate" style="align-self: flex-start;">活动提供</view>
+      <checkbox-group class="checkbox-group" name="tag">
+        <label wx:for="{{types2}}" wx:for-item="item" wx:key="value">
+          <checkbox class="checkbox" value="{{item.value}}" checked="{{item.checked}}" color="#469298">
+            {{item.value}}</checkbox>
+        </label>
+      </checkbox-group>
+    </view>
+    <view class="block">
+      <view class="cate">面向对象</view>
+      <input class="input" placeholder="请填写" name="orient" value="{{messageInfo.orient}}" />
+    </view>
+    <view class="block">
+      <view class="cate">活动时间</view>
+      <input class="input" placeholder="请填写" name="time" value="{{messageInfo.time}}" />
+    </view>
+    <view class="block">
+      <view class="cate">活动地点</view>
+      <input class="input" placeholder="请填写" name="place" value="{{messageInfo.place}}" />
+    </view>
+    <view class="block">
+      <view class="cate">联系方式</view>
+      <input class="input" placeholder="请填写" name="contact" value="{{messageInfo.contact}}" />
+    </view>
+    <view class="block">
+      <view class="cate">链接</view>
+      <input class="input" placeholder="请填写" name="link" value="{{messageInfo.link}}" />
+    </view>
+    <view wx:if="{{messageId}}" class="block" style="margin-top: 20rpx;">
+      <view class="cate primary-text-color" style="align-self: flex-start;">消息通知</view>
+      <textarea class="input" style="height: 200rpx;" placeholder="提交后会以消息的形式通知关注者" name="notify"></textarea>
+    </view>
+    <myButton class="button" type="primary">提交</myButton>
+  </form>
+</scroll-view>
+
+<scroll-view wx:if="{{currentTab === 2}}" style="height: {{winHeight - 60}}px;" scroll-y>
+  <view class="sub-title">纳新{{messageId ? '修改' : '发布'}}</view>
+  <form bindsubmit="switch4">
+    <view class="block">
+      <view class="cate">纳新标题<span style="color: #FF0000">*</span></view>
+      <input class="input" placeholder="请填写" name="name" value="{{messageInfo.name}}" />
+    </view>
+    <view class="block">
+      <view class="cate" style="align-self: flex-start;">纳新简介</view>
+      <textarea class="input" style="height: 100rpx;" placeholder="请填写" name="brief"
+        value="{{messageInfo.brief}}"></textarea>
+    </view>
+    <view class="block" style="margin-bottom: 20rpx;">
+      <view class="cate" style="align-self: flex-start;">纳新详情<span style="color: #FF0000">*</span></view>
+      <textarea class="input" style="height: 200rpx;" placeholder="请填写" name="detail"
+        value="{{messageInfo.detail}}"></textarea>
+    </view>
+    <view class="block">
+      <view class="cate" style="align-self: flex-start;">纳新封图</view>
+      <imagePicker name="poster" max="1" image-width="450" image-height="215" value="{{messageInfo.poster}}" />
+    </view>
+    <view class="block" style="margin-bottom: 20rpx;">
+      <view class="cate" style="align-self: flex-start;">纳新图片</view>
+      <imagePicker name="photo" max="9" image-width="145" image-height="145" value="{{messageInfo.photo}}" />
+    </view>
+    <view class="block">
+      <view class="cate">面向对象</view>
+      <input class="input" placeholder="请填写" name="orient" value="{{messageInfo.orient}}" />
+    </view>
+    <view class="block">
+      <view class="cate">纳新时间</view>
+      <input class="input" placeholder="请填写" name="time" value="{{messageInfo.time}}" />
+    </view>
+    <view class="block">
+      <view class="cate">现宣信息</view>
+      <input class="input" placeholder="请填写" name="place" value="{{messageInfo.place}}" />
+    </view>
+    <view class="block">
+      <view class="cate">联系方式</view>
+      <input class="input" placeholder="请填写" name="contact" value="{{messageInfo.contact}}" />
+    </view>
+    <view class="block">
+      <view class="cate">链接</view>
+      <input class="input" placeholder="请填写" name="link" value="{{messageInfo.link}}" />
+    </view>
+    <view wx:if="{{messageId}}" class="block" style="margin-top: 20rpx;">
+      <view class="cate primary-text-color" style="align-self: flex-start;">消息通知</view>
+      <textarea class="input" style="height: 200rpx;" placeholder="提交后会以消息的形式通知关注者" name="notify"></textarea>
+    </view>
+    <myButton class="button" type="primary">提交</myButton>
+  </form>
+</scroll-view>
+
+<scroll-view wx:if="{{currentTab === 3}}" style="height: {{winHeight - 60}}px;" scroll-y>
+  <view class="sub-title">通知{{messageId ? '修改' : '发布'}}</view>
+  <form bindsubmit="switch4">
+    <view class="block">
+      <view class="cate">通知标题<span style="color: #FF0000">*</span></view>
+      <input class="input" placeholder="请填写" name="name" value="{{messageInfo.name}}" />
+    </view>
+    <view class="block">
+      <view class="cate" style="align-self: flex-start;">通知类型<span style="color: #FF0000">*</span></view>
+      <checkbox-group class="checkbox-group" name="type">
+        <label wx:for="{{types3}}" wx:for-item="item" wx:key="value">
+          <checkbox class="checkbox" value="{{item.value}}" checked="{{item.checked}}" color="#469298">{{item.value}}
+          </checkbox>
+        </label>
+      </checkbox-group>
+    </view>
+    <view class="block">
+      <view class="cate" style="align-self: flex-start;">通知简介</view>
+      <textarea class="input" style="height: 100rpx;" placeholder="请填写" name="brief"
+        value="{{messageInfo.brief}}"></textarea>
+    </view>
+    <view class="block" style="margin-bottom: 20rpx;">
+      <view class="cate" style="align-self: flex-start;">通知详情<span style="color: #FF0000">*</span></view>
+      <textarea class="input" style="height: 200rpx;" placeholder="请填写" name="detail"
+        value="{{messageInfo.detail}}"></textarea>
+    </view>
+    <view class="block">
+      <view class="cate" style="align-self: flex-start;">通知封图</view>
+      <imagePicker name="poster" max="1" image-width="450" image-height="215" value="{{messageInfo.poster}}" />
+    </view>
+    <view class="block" style="margin-bottom: 20rpx;">
+      <view class="cate" style="align-self: flex-start;">通知图片</view>
+      <imagePicker name="photo" max="9" image-width="145" image-height="145" value="{{messageInfo.photo}}" />
+    </view>
+    <view class="block">
+      <view class="cate">链接</view>
+      <input class="input" placeholder="请填写" name="link" value="{{messageInfo.link}}" />
+    </view>
+    <view wx:if="{{messageId}}" class="block" style="margin-top: 20rpx;">
+      <view class="cate primary-text-color" style="align-self: flex-start;">消息通知</view>
+      <textarea class="input" style="height: 200rpx;" placeholder="提交后会以消息的形式通知关注者" name="notify"></textarea>
+    </view>
+    <myButton class="button" type="primary">提交</myButton>
+  </form>
+</scroll-view>
+
+<view wx:if="{{currentTab === 4}}" class="con">
+  <view class="con1 primary-text-color">{{messageId ? '修改' : '发布'}}成功!</view>
+  <image class="success-icon" src="../../images/finish.png" mode="aspectFill" />
+  <!-- <view class="con2"></view> -->
+  <myButton class="button" type="primary" bindtap="returnToPublisher">返回</myButton>
 </view>

+ 80 - 80
miniprogram/pages/activityPublish/activityPublish.wxss → miniprogram/pages/messagePublish/messagePublish.wxss

@@ -1,81 +1,81 @@
-/* miniprogram/pages/logIn1/logIn1.wxss */
-.title {
-  font-size: 40rpx;
-  padding: 15px 20px;
-  height: 30px;
-  font-weight: 800;
-}
-
-.sub-title {
-  font-size: 35rpx;
-  margin: 20rpx 40rpx;
-}
-
-.checkbox {
-  transform: scale(0.8);
-  margin-left: 10rpx;
-}
-
-.checkbox-group {
-  width: 500rpx;
-}
-
-.text {
-  font-size: 30rpx;
-  margin: 10rpx 40rpx;
-}
-
-.buttons {
-  display: flex;
-  flex-direction: column;
-}
-
-.button {
-  margin: 20rpx;
-}
-
-.title2 {
-  align-self: center;
-  font-size: 35rpx;
-  margin-top: 100rpx;
-  margin-bottom: 70rpx;
-}
-
-.block {
-  display: flex;
-  align-items: center;
-  margin: 4rpx 0rpx;
-  padding: 20rpx 40rpx;
-  font-size: 30rpx;
-  background-color: #FFFFFF;
-}
-
-.cate {
-  width: 160rpx;
-}
-
-.input {
-  width: 500rpx;
-}
-
-.con {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-}
-
-.con1 {
-  margin: 40rpx;
-  font-size: 50rpx;
-  font-weight: 800;
-}
-
-.con2 {
-  font-size: 35rpx;
-  margin: 50rpx;
-}
-
-.success-icon {
-  width: 200rpx;
-  height: 200rpx;
+/* miniprogram/pages/logIn1/logIn1.wxss */
+.title {
+  font-size: 40rpx;
+  padding: 15px 20px;
+  height: 30px;
+  font-weight: 800;
+}
+
+.sub-title {
+  font-size: 35rpx;
+  margin: 20rpx 40rpx;
+}
+
+.checkbox {
+  transform: scale(0.8);
+  margin-left: 10rpx;
+}
+
+.checkbox-group {
+  width: 500rpx;
+}
+
+.text {
+  font-size: 30rpx;
+  margin: 10rpx 40rpx;
+}
+
+.buttons {
+  display: flex;
+  flex-direction: column;
+}
+
+.button {
+  margin: 20rpx;
+}
+
+.title2 {
+  align-self: center;
+  font-size: 35rpx;
+  margin-top: 100rpx;
+  margin-bottom: 70rpx;
+}
+
+.block {
+  display: flex;
+  align-items: center;
+  margin: 4rpx 0rpx;
+  padding: 20rpx 40rpx;
+  font-size: 30rpx;
+  background-color: #FFFFFF;
+}
+
+.cate {
+  width: 160rpx;
+}
+
+.input {
+  width: 500rpx;
+}
+
+.con {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+
+.con1 {
+  margin: 40rpx;
+  font-size: 50rpx;
+  font-weight: 800;
+}
+
+.con2 {
+  font-size: 35rpx;
+  margin: 50rpx;
+}
+
+.success-icon {
+  width: 200rpx;
+  height: 200rpx;
 }

+ 43 - 43
miniprogram/pages/myFavor/myFavor.js → miniprogram/pages/myFavorite/myFavorite.js

@@ -1,44 +1,44 @@
-const util = require('../../utils/util.js')
-
-Page({
-  data: {
-    pageToken: 0,
-    favorData: []
-  },
-
-  loadFavoriteData: function () {
-    wx.showNavigationBarLoading()
-    wx.cloud.callFunction({
-      name: 'listMessages',
-      data: {
-        favorite: true,
-        page_token: this.data.pageToken,
-        page_size: 20
-      }
-    }).then(res => {
-      wx.hideNavigationBarLoading()
-      if (res.result.status !== 'OK') {
-        wx.showToast({
-          title: res.result.errMsg,
-          icon: 'none'
-        })
-        return
-      }
-      for (let i = 0; i < res.result.list.length; i++) {
-        res.result.list[i] = util.dbToMsg(res.result.list[i])
-      }
-      this.setData({
-        favorData: this.data.favorData.concat(res.result.list),
-        pageToken: res.result.next_page_token
-      })
-    })
-  },
-
-  onLoad: function () {
-    this.loadFavoriteData()
-  },
-
-  onReachBottom: function () {
-    this.loadFavoriteData()
-  }
+const util = require('../../utils/util.js')
+
+Page({
+  data: {
+    pageToken: 0,
+    favorData: []
+  },
+
+  loadFavoriteData: function () {
+    wx.showNavigationBarLoading()
+    wx.cloud.callFunction({
+      name: 'listMessages',
+      data: {
+        favorite: true,
+        page_token: this.data.pageToken,
+        page_size: 20
+      }
+    }).then(res => {
+      wx.hideNavigationBarLoading()
+      if (res.result.status !== 'OK') {
+        wx.showToast({
+          title: res.result.errMsg,
+          icon: 'none'
+        })
+        return
+      }
+      for (let i = 0; i < res.result.list.length; i++) {
+        res.result.list[i] = util.dbToMsg(res.result.list[i])
+      }
+      this.setData({
+        favorData: this.data.favorData.concat(res.result.list),
+        pageToken: res.result.next_page_token
+      })
+    })
+  },
+
+  onLoad: function () {
+    this.loadFavoriteData()
+  },
+
+  onReachBottom: function () {
+    this.loadFavoriteData()
+  }
 })

+ 4 - 4
miniprogram/pages/myFavor/myFavor.json → miniprogram/pages/myFavorite/myFavorite.json

@@ -1,5 +1,5 @@
-{
-  "usingComponents": {
-    "itemmyLikeMessage": "/components/itemmyLikeMessage/itemmyLikeMessage"
-  }
+{
+  "usingComponents": {
+    "itemmyLikeMessage": "/components/itemmyLikeMessage/itemmyLikeMessage"
+  }
 }

+ 7 - 0
miniprogram/pages/myFavorite/myFavorite.wxml

@@ -0,0 +1,7 @@
+<!-- 消息-我的消息组件,含component:itemmyNews;含data:newNewsData -->
+<view wx:if="{{!favorData.length}}" class="empty-text primary-text-color">这里空空如也</view>
+<view class="page">
+  <view class="card" wx:for="{{favorData}}" wx:for-item="msg" wx:key="_id">
+    <itemmyLikeMessage item="{{msg}}" />
+  </view>
+</view>

+ 10 - 0
miniprogram/pages/myFavorite/myFavorite.wxss

@@ -0,0 +1,10 @@
+.empty-text {
+  margin: 20rpx 20rpx 10rpx 40rpx;
+  font-size: 35rpx;
+  text-align: center;
+}
+
+.page {
+  display: flex;
+  flex-direction: column;
+}

+ 0 - 66
miniprogram/pages/myPublish/myPublish.js

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

+ 0 - 3
miniprogram/pages/myPublish/myPublish.json

@@ -1,3 +0,0 @@
-{
-  "usingComponents": {}
-}

+ 0 - 2
miniprogram/pages/myPublish/myPublish.wxml

@@ -1,2 +0,0 @@
-<!--pages/myPublish/myPublish.wxml-->
-<text>pages/myPublish/myPublish.wxml</text>

+ 0 - 1
miniprogram/pages/myPublish/myPublish.wxss

@@ -1 +0,0 @@
-/* pages/myPublish/myPublish.wxss */

+ 20 - 0
miniprogram/pages/notification/notification.js

@@ -0,0 +1,20 @@
+var newNews = require("../../data/newNewsData.js");
+Component({
+  data: {
+    newNews:{
+
+    }
+  },
+
+  lifetimes: {
+    ready: function() {
+      this.setData({
+        newNews:newNews.newNews
+      })
+    }
+  },
+
+  methods: {
+
+  }
+})

+ 6 - 0
miniprogram/pages/notification/notification.json

@@ -0,0 +1,6 @@
+{
+  "component":true,
+  "usingComponents": {
+    "itemmyNews":"/components/itemmyNews/itemmyNews"
+  }
+}

+ 7 - 0
miniprogram/pages/notification/notification.wxml

@@ -0,0 +1,7 @@
+<!-- 为消息的导航栏 两个component界面:“关注动态”followNews “我的消息”myNews-->
+<!-- 修改:将关注动态转移到首页,消息页面删除导航栏-->
+<view class="page">
+  <view class="card" wx:for="{{newNews}}" wx:for-item="item" wx:key="_id" wx:index="index">
+    <itemmyNews item="{{item}}" />
+  </view>
+</view>

+ 4 - 0
miniprogram/pages/notification/notification.wxss

@@ -0,0 +1,4 @@
+.page{
+  display: flex;
+  flex-direction: column;
+}

+ 2 - 2
miniprogram/pages/publisherPage/publisherPage.js

@@ -31,9 +31,9 @@ Page({
     })
   },
 
-  activityPublish: function () {
+  messagePublish: function () {
     wx.navigateTo({
-      url: "/pages/activityPublish/activityPublish?id=" + this.data.pubInfo[this.data.pubIndex].pub_id,
+      url: "/pages/messagePublish/messagePublish?id=" + this.data.pubInfo[this.data.pubIndex].pub_id,
     })
   },
 

+ 3 - 2
miniprogram/pages/publisherPage/publisherPage.wxml

@@ -1,6 +1,7 @@
 <!-- 为发布者个人页面 -->
 <view class="card">
-  <image class="avatar" src="{{hasPubInfo ? pubInfo[pubIndex].publisher.avatar : '/images/user/user.png'}}" bindtap="previewAvatar">
+  <image class="avatar" src="{{hasPubInfo ? pubInfo[pubIndex].publisher.avatar : '/images/user/user.png'}}"
+    bindtap="previewAvatar">
   </image>
   <view wx:if="{{hasPubInfo}}" class="publisher-name">{{pubInfo[pubIndex].publisher.name}}</view>
 </view>
@@ -13,7 +14,7 @@
   <view>></view>
 </view>
 
-<view class="block" hover-class="btn-hover" bindtap="activityPublish">
+<view class="block" hover-class="btn-hover" bindtap="messagePublish">
   <view class="left">
     <image class="btn-icon" mode="aspectFit" src="/images/publisher/publish1.png"></image>
     <view>发布信息</view>

+ 3 - 3
miniprogram/pages/search/search.js

@@ -156,12 +156,12 @@ Page({
     })
   },
 
-  viewActivity: function (e) {
+  viewMessage: function (e) {
     wx.navigateTo({
-      url: '/pages/activity/activity'
+      url: '/pages/message/message'
     }).then(res => {
       res.eventChannel.emit('loadCommonData', {
-        data: e.currentTarget.dataset.activity
+        data: e.currentTarget.dataset.message
       })
     })
   },

+ 1 - 1
miniprogram/pages/search/search.wxml

@@ -28,7 +28,7 @@
   <view class="hot-bar-block">
     <text class="hot-bar-title primary-background-color white-text-color">实时热点</text>
     <view class="hot-bar" wx:for="{{hotBarData}}" wx:key="rank" wx:for-item="bar" wx:for-index="index" wx:key="_id"
-      data-activity="{{bar.message}}" bindtap="viewActivity">
+      data-message="{{bar.message}}" bindtap="viewMessage">
       <view class="hot-bar-text">
         <view class="primary-text-color" style="width: 20rpx; text-align: right;">{{index + 1}}</view>
         <view class="secondary-text-color" style="margin-left: 30rpx;">{{bar.message.hot_name}}</view>

+ 2 - 2
miniprogram/pages/user/user.js

@@ -89,9 +89,9 @@ Page({
     })
   },
 
-  myFavor: function () {
+  myFavorite: function () {
     wx.navigateTo({
-      url: '/pages/myFavor/myFavor',
+      url: '/pages/myFavorite/myFavorite',
     })
   },
 

+ 7 - 8
miniprogram/pages/user/user.wxml

@@ -32,7 +32,7 @@
     <view class="btn-text primary-text">我的提问</view>
   </view>
 
-  <view class="bottom">
+  <view class="bottom-bar">
     <view class="btn" bindtap="setting">
       <image class="btn-icon" mode="aspectFit" src="/images/user/setting.png"></image>
       <view>设置</view>
@@ -40,22 +40,21 @@
 
     <view class="btn" bindtap="aboutUs">
       <image class="btn-icon" mode="aspectFit" src="/images/user/about.png"></image>
-      <view>关于我们</view>
+      <view>关于</view>
     </view>
 
-    <view class="btn" bindtap="opinion">
+    <button class="btn" open-type="feedback">
       <image class="btn-icon" mode="aspectFit" src="/images/user/feedback.png"></image>
-      <view>意见反馈</view>
-    </view>
+      <view>反馈</view>
+    </button>
   </view>
 </view>
 
 <view wx:if="{{hasUserInfo}}">
-  <view wx:if="{{pubInfo.length === 0}}" class="publisher primary-background-color" hover-class="btn-hover"
-    bindtap="publisherLogin">
+  <view wx:if="{{pubInfo.length === 0}}" class="publisher primary-background-color" bindtap="publisherLogin">
     <text class="white-text-color">社团\n组织\n入驻</text>
   </view>
-  <view wx:else class="publisher primary-background-color" hover-class="btn-hover" bindtap="publisherPage">
+  <view wx:else class="publisher primary-background-color" bindtap="publisherPage">
     <text class="white-text-color">社团\n组织\n管理</text>
   </view>
 </view>

+ 12 - 10
miniprogram/pages/user/user.wxss

@@ -31,13 +31,15 @@
 }
 
 .btn {
-  display: flex;
-  margin-top: 20rpx;
+  display: flex !important;
+  justify-content: center;
   align-items: center;
-}
-
-.btn-hover {
-  background: #c0c0c0;
+  width: 200rpx !important;
+  margin: 20rpx 0rpx 0rpx 0rpx !important;
+  padding: 0rpx !important;
+  font-size: 25rpx !important;
+  font-weight: normal !important;
+  background-color: transparent !important;
 }
 
 .btn-icon {
@@ -63,15 +65,15 @@
   font-size: 35rpx;
 }
 
-.bottom {
-  bottom: 0rpx;
+.bottom-bar {
   position: absolute;
+  bottom: 0rpx;
   display: flex;
   justify-content: space-around;
   align-items: center;
+  z-index: 1;
   width: 100%;
-  z-index: 100;
-  background-color: #ffffff;
+  background-color: #FFFFFF;
   box-shadow: 0rpx -5rpx 15rpx 0rpx rgba(0, 0, 0, 0.16) inset;
   font-size: 24rpx;
   padding-bottom: 20rpx;