Browse Source

feat:新增学员督学消息的显示

xuqiaoying 3 years ago
parent
commit
d7c62a19f6
2 changed files with 38 additions and 7 deletions
  1. 8 1
      pages2/msg/detail.vue
  2. 30 6
      pages2/msg/index.vue

+ 8 - 1
pages2/msg/detail.vue

@@ -2,7 +2,7 @@
 	<view>
 		<nav-bar title="消息详情"></nav-bar>
 		<view class="item">
-			<view class="title">{{ listData.systemStatus === 2 ? listData.informVo.informName : listData.systemStatus === 1 ? listData.remind : '' }}</view>
+			<view class="title">{{ getTitleName()  }}</view>
 			<view class="time">{{ $method.timestampToTime(listData.sendTime, false) }}</view>
 			<view v-if="listData.systemStatus === 2" class="content" v-html="listData.informVo.affiche" style="width: 100%;"></view>
 			<view v-if="listData.systemStatus === 1" class="content" style="width: 100%;">{{ listData.text }}</view>
@@ -70,6 +70,13 @@ export default {
 		};
 	},
 	methods: {
+		getTitleName() {
+			if ([28,29,30,31,32].includes(+this.listData.remindId)) { // 要先判断督学消息的显示
+				return this.listData.remind
+			} else {
+				return this.listData.systemStatus === 2 ? this.listData.informVo.informName : this.listData.systemStatus === 1 ? this.listData.remind : ''
+			}
+		},
 		/**
 		 * 获取系统当前时间
 		 */

+ 30 - 6
pages2/msg/index.vue

@@ -4,12 +4,14 @@
 		<view v-if="!listData.length"><u-empty text="消息列表为空" mode="message"></u-empty></view>
 		<view v-else v-for="(item, index) in listData" :key="index" style="padding-bottom: 20rpx;">
 			<navigator hover-class="none" :url="`/pages2/msg/detail?id=${item.id}&orderGoodsId=${item.orderGoodsId}&goodsId=${item.goodsId}`" class="item" :style="item.receiptStatus === 1 ? 'opacity: 0.7' : ''">
-				<view style="display: flex;justify-content: space-between;align-items: center;height: 60rpx;">
-					<view style="color: #333333;font-size: 30rpx;font-weight: bold;display: flex;align-items: center;">
+				<view class="headers">
+					<view class="header_left">
 						<image :src="item.systemStatus === 1 ? img1 : img2" style="width: 40rpx;height: 40rpx;margin-right: 10rpx;"></image>
-						{{item.systemStatus === 1 ? '系统通知' : '教务通知'}}
+						<text class="msgTitle">
+							{{ [28, 29, 30, 31,32].includes(+item.remindId) ? item.remind : (item.systemStatus === 1 ? '系统通知' : '教务通知')}}
+						</text>
 					</view>
-					<view style="color: #999999;font-size: 24rpx;">{{ $method.timestampToTime(item.sendTime, false) }}</view>
+					<view class="header_right">{{ $method.timestampToTime(item.sendTime, false) }}</view>
 				</view>
 				<u-line color="#D6D6DB" />
 				<view style="display: flex;justify-content: space-between;padding: 25rpx;color: #666666;">
@@ -78,7 +80,6 @@ export default {
 		// this.getInfo();
 	},
 	onShareAppMessage(res) {
-		var self = this;
 		return {
 			title: '中正',
 			path: `/pages/index/index?inviteCode=` + userInfo == null ? '' : userInfo.userAccount
@@ -122,7 +123,7 @@ page {
 	background: #eaeef1;
 }
 </style>
-<style scoped>
+<style lang="scss" scoped>
 .btn2 {
 	width: 144rpx;
 	height: 48rpx;
@@ -171,4 +172,27 @@ page {
 	align-items: center;
 	padding: 0 30rpx;
 }
+.headers {
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+	height: 60rpx;
+	.header_left {
+		color: #333333;
+		font-size: 30rpx;
+		font-weight: bold;
+		display: flex;
+		align-items: center;
+	}
+	.header_right {
+		color: #999999;
+		font-size: 24rpx;
+	}
+}
+.msgTitle {
+	width: 420rpx;
+	overflow: hidden;
+	text-overflow:ellipsis; 
+	white-space: nowrap;
+}
 </style>