<template>
	<view style="padding: 20rpx;">
		<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 :url="`/pages2/msg/detail?id=${item.id}`" 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;">
						<image :src="item.systemStatus === 1 ? img1 : img2" style="width: 40rpx;height: 40rpx;margin-right: 10rpx;"></image>
						系统通知
					</view>
					<view style="color: #999999;font-size: 24rpx;">{{ $method.timestampToTime(item.sendTime, false) }}</view>
				</view>
				<u-line color="#D6D6DB" />
				<view style="display: flex;justify-content: space-between;padding: 25rpx;color: #666666;">
					{{ item.systemStatus === 2 ? item.informVo.informName : item.systemStatus === 1 ? item.text : '接口异常' }}
				</view>
				<u-line color="#D6D6DB" />
				<view style="display: flex;justify-content: space-between;align-items: center;height: 50rpx;margin-top: 10rpx;padding: 0 25rpx;">
					<view class="color: #333333;font-size: 28rpx;">查看详情</view>
					<view><u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
				</view>
			</navigator>
		</view>
	</view>
</template>

<script>
import { mapGetters } from 'vuex';
export default {
	components: {},
	data() {
		return {
			list: [
				{
					name: '待支付'
				},
				{
					name: '已支付'
				},
				{
					name: '已取消'
				}
			],
			list1: [1, 2, 3, 4, 5, 6, 7],
			current: 0,
			img1: '/static/icon/msg_icon1.png',
			img2: '/static/icon/msg_icon2.png',
			listData: []
		};
	},
	onPullDownRefresh() {
		this.$api
			.getappinformUserlist()
			.then(res => {
				if (res.data.code === 200) {
					this.listData = res.data.rows;
				}
			})
			.finally(() => {
				uni.stopPullDownRefresh();
			});
	},
	onLoad(option) {},
	onShow() {
		this.getInfo();
	},
	onShareAppMessage(res) {
		var self = this;
		return {
			title: '中正',
			path: `/pages/index/index?inviteCode=` + userInfo == null ? '' : userInfo.userAccount
		};
	},
	methods: {
		getInfo() {
			this.$api.getappinformUserlist().then(res => {
				if (res.data.code === 200) {
					this.listData = res.data.rows;
				}
			});
		}
	},
	onReachBottom() {},
	computed: { ...mapGetters(['userInfo']) }
};
</script>
<style>
page {
	background: #eaeef1;
}
</style>
<style scoped>
.btn2 {
	width: 144rpx;
	height: 48rpx;
	background: #ffffff;
	border: 2rpx solid #007aff;
	border-radius: 16rpx;
	text-align: center;
	line-height: 48rpx;
	color: #007aff;
	margin: 0 8rpx;
}
.btn1 {
	width: 144rpx;
	height: 48rpx;
	background: #ffffff;
	border: 2rpx solid #999999;
	border-radius: 16rpx;
	text-align: center;
	line-height: 48rpx;
	color: #999999;
	margin: 0 8rpx;
}
.item {
	background: #ffffff;
	border-radius: 16rpx;
	padding: 15rpx;
}
.priceTag {
	font-size: 30rpx;
	font-family: PingFang SC;
	font-weight: bold;
	color: #ff2d55;
	display: flex;
	flex-direction: row-reverse;
}

.bottomBox {
	position: fixed;
	bottom: 0;
	width: 100%;
	left: 0;
	height: 98rpx;
	background-color: #ffffff;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0 30rpx;
}
</style>
