<template>
	<view>
		<uni-list v-for="(item,index) in list" :key="index">
			<!-- 头像显示圆点 -->
			<uni-list-chat clickable="true" :title="item.msgTitle" avatar="/static/avatar-msg.png" :note="item.msgContent" :time="item.datetime" :badge-positon="item.position" badge-text="dot" @click="gotoDetail(item)"></uni-list-chat>
		</uni-list>
	</view>
</template>

<script>
	import badgeMix from '@/mixins/tabbar-badge.js'
	export default {
		mixins: [badgeMix],
		data() {
			return {
				list: {}
			};
		},
		onShow() {
			this.getMsgList()
		},
		methods: {
			async getMsgList() {
				const {data: result} = await uni.$http.get('/education/mp-inner-msg/queryMsg')
				this.list = result.data.list
			},
			gotoDetail(item) {
				uni.navigateTo({
					url: '/subpkg/my/message/my_message_detail?item='+encodeURIComponent(JSON.stringify(item))
				})
			}
		}
	}
</script>

<style lang="scss">

</style>
