<!--packageE/stationNotice/stationNotice.wxml-->
<view class="tool" wx:if="{{messageType.length!=0 || weekMessage.length!=0}}">
	<text>{{unreadCount}}条未读消息</text>
	<icon class="iconfont icon-massage_clean"></icon>
	<text style="margin-left:0.313rem;flex:1;" bindtap="setMessageRead">全部已读</text>
	<icon style="color:#666;" bindtap="gotoSetting" class="iconfont icon-massage_set"></icon>
</view>
<view class="tool emptyTool" wx:else>
	<icon style="color:#666;" bindtap="gotoSetting" class="iconfont icon-massage_set"></icon>
</view>

<view class="items" wx:if="{{messageType.length!=0}}">
	<view class="item" wx:for="{{messageType}}" wx:key="id" bindtap="gotoMessagePage" data-index="{{index}}"  data-url="{{item.class_name}}">
		<view class="face">
			<view class="img {{item.class_name}}">
				<icon class="iconfont {{item.icon}}"></icon>
			</view>
		</view>
		<view class="content">
			<view class="c1">
				<view class="name">{{item.name}}</view>
				<view class="time">{{item.last_time}}</view>
			</view>
			<view class="c2">
				<view class="desc">{{item.desc}}</view>
				<view class="count" wx:if="{{item.no_read>0}}">{{item.no_read}}</view>
			</view>
		</view>
	</view>
</view>


<view class="weekList" wx:if="{{weekMessage.length!=0}}">
	<view class="week">最近一周消息</view>
	<view class="weekItem" wx:for="{{weekMessage}}" wx:key="_id" bindtap="gotoPages" data-index="{{index}}" data-item="{{item}}" data-page="{{item.mini_url}}" >
		<view class="wrapper">
			<view class="face">
				<view class="img {{item.class_name}}">
					<view class="unread" wx:if="{{item.is_read==1}}"></view>
					<icon class="iconfont {{item.icon}}"></icon>
				</view>
			</view>
			<view class="content">
				<view class="head">
					<view class="name">{{item.title}}</view>
					<view class="time">{{item.created_at}}</view>
				</view>
				<view class="c1 ca">{{item.desc}}</view>
				<view class="text" wx:if="{{item.type_id!=1 && item.type_id!=3 && item.type_id!=6}}">
					<view class="c2 ca" wx:for="{{item.msg_body}}" wx:for-item="item2" wx:for-index="key2" wx:key="type_id">{{msg_body_types[item.type_id][key2]}}:{{item2}}</view>
				</view>
				<view class="anchor" wx:elif="{{item.msg_body!=null && item.msg_body.length!=0}}">
					<view class="face">
						<image src="{{item.msg_body.img}}"></image>
					</view>
					<view class="desc">
						<view class="name">{{item.msg_body.title}}</view>
						<view wx:if="{{item.type_id==1}}">快递单号：{{item.msg_body.desc}}</view>
						<view class="tips" wx:elif="{{item.type_id==3}}">{{item.msg_body.desc}}</view>
						<view class="tips" wx:elif="{{item.type_id==6}}">点击查看</view>
					</view>
				</view>
				
			</view>
		</view>
		<view class="botm">
			<text>查看详情</text>
			<icon class="iconfont icon-advertise-next"></icon>
		</view>
	</view>
</view>

<view class="empty" wx:if="{{messageType.length==0 && weekMessage.length==0}}">
	<view class="img">
		<image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/massage_blankpage@3x.png"></image>
	</view>
	<view class="text">还没有消息哟</view>
</view>