Переглянути джерело

消息更新

修改消息数据和样式
RegMs If 4 роки тому
батько
коміт
ceff488074

+ 8 - 4
miniprogram/components/itemmyNews/itemmyNews.wxml

@@ -1,14 +1,18 @@
 <!-- 为消息-我的消息里通知的组件,组件中数据来自data:newNewsData.js -->
 <view class="card">
   <view class="top">
-    <view class="profile" wx:if="{{item.publishType=='回复'}}">
-      <text class="publisher-name">{{item.publisherName}}</text><text class="primary-text-color"
-        style="font-size:24rpx;">对您的评论进行了回复</text>
+    <view class="profile" wx:if="{{item.publishType == '回复'}}">
+      <text class="primary-text-color" style="font-size: 24rpx;"><text class="publisher-name"
+          style="color: #000000;">{{item.publisherName}}</text> 对您的评论进行了回复</text>
+    </view>
+    <view class="profile" wx:if="{{item.publishType == '动态'}}">
+      <text class="primary-text-color" style="font-size: 24rpx;">您收藏的信息 <text class="publisher-name"
+          style="color: #000000;">{{item.publisherName}}</text> 有新动态</text>
     </view>
     <text class="primary-text-color detail">查看</text>
   </view>
   <view class="bottom">
     <view class="title secondary-text-color">{{item.title}}</view>
-    <text class="primary-text-color detail">回复</text>
+    <text class="primary-text-color detail" wx:if="{{item.publishType == '回复'}}">回复</text>
   </view>
 </view>

+ 7 - 5
miniprogram/components/itemmyNews/itemmyNews.wxss

@@ -2,7 +2,7 @@
   height: auto;
   margin: 30rpx 20rpx 0rpx 20rpx;
   background-color: #ffffff;
-  box-shadow: 5rpx 5rpx 8rpx 0rpx rgba(0,0,0,0.16);
+  box-shadow: 5rpx 5rpx 8rpx 0rpx rgba(0, 0, 0, 0.16);
   border-radius: 20rpx;
   padding-top: 20rpx;
 }
@@ -20,11 +20,11 @@
   display: flex;
   flex-direction: row;
   justify-content: space-between;
-  align-items: center;
+  align-items: flex-end;
   margin: 0rpx 30rpx 0rpx 30rpx;
 }
 
-.bottom{
+.bottom {
   display: flex;
   flex-direction: row;
   justify-content: space-between;
@@ -33,12 +33,14 @@
   padding-bottom: 20rpx;
 }
 
-.profile {
+/* .profile {
   display: flex;
   flex-direction: row;
   align-items: center;
-}
+} */
 
 .detail {
+  width: 100rpx;
   font-size: 24rpx;
+  text-align: right;
 }

+ 12 - 15
miniprogram/data/newMessageData.js

@@ -1,26 +1,23 @@
 // 消息-关注动态中组件itemfollowNews的数据
-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":"蓝田文体发展中心",
-    "publishType":"活动",
+    "publisherName": "蓝田文体发展中心",
+    "publishType": "活动",
     //动态类型
-    "title":"紫金新生达人秀|期待你的精彩",
-    "subTitle":"紫金新生达人秀现面向全校学生开启报名通道,报名即有综素加分,通过初赛就有二课!",
+    "title": "是的,只要线上报名就可以了哦,具体内容我们会以短信形式通知~",
   },
   {
-    "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":"蓝田文体发展中心",
-    "publishType":"活动",
-    "title":"紫金新生达人秀|期待你的精彩",
-    "subTitle":"紫金新生达人秀现面向全校学生开启报名通道,报名即有综素加分,通过初赛就有二课!",
+    "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": "蓝田文体发展中心",
+    "publishType": "活动",
+    "title": "紫金新生达人秀|期待你的精彩",
   }
 ]
 
 module.exports = {
-  newMessage:json
+  newMessage: json
 }

+ 12 - 15
miniprogram/data/newNewsData.js

@@ -1,26 +1,23 @@
 // 消息-我的消息中组件itemmyNews的数据
-var json=[
-  {
-    "id":"1",
+var json = [{
+    "id": "1",
     // 消息的编号
-    "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":"蓝田文体发展中心",
-    "publishType":"回复",
+    "publisherName": "蓝田文体发展中心",
+    "publishType": "回复",
     // 消息类型
-    "title":"紫金新生达人秀|期待你的精彩",
-    "subTitle":"紫金新生达人秀现面向全校学生开启报名通道,报名即有综素加分,通过初赛就有二课!",
+    "title": "是的,只要线上报名就可以了哦,具体内容我们会以短信形式通知~",
   },
   {
-    "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":"蓝田文体发展中心",
-    "publishType":"回复",
-    "title":"紫金新生达人秀|期待你的精彩",
-    "subTitle":"紫金新生达人秀现面向全校学生开启报名通道,报名即有综素加分,通过初赛就有二课!",
+    "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": "慎远杯",
+    "publishType": "动态",
+    "title": "报名时间延长啦,大家快来报名吧~",
   }
 ]
 
 module.exports = {
-  newNews:json
+  newNews: json
 }