<template>
	<view class="app-content">
		<view class="title-box">{{navname}}</view>
		<uni-list :border="true" class="messageList">
			<uni-list-chat title="app" avatar="static/shuai.png" note="您收到一条新的消息" time="2020-02-02 20:20" ></uni-list-chat>
			<uni-list-chat title="app" avatar="static/shuai.png" note="您收到一条新的消息" time="2020-02-02 20:20" badge-positon="left" badge-text="dot"></uni-list-chat>
		</uni-list>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				navname:"消息"
			}
		},
		onShow() {
			uni.$on("scancodemsg", (data) => {
				if (data.msg.length > 9) {
					uni.navigateTo({
						url: "/pages/detail/index?luggageNum=" + data.msg
					})
				}
			});
		},
		onLoad(){
		},
		onUnload() {
			uni.$off("scancodemsg");
		},
		onHide() {
			uni.$off("scancodemsg");
		},
		methods: {
			scan(){
				uni.scanCode({
					onlyFromCamera: true,
					success: function (res) {
						if (res.result.length > 9) {
							uni.navigateTo({
								url: "/pages/detail/index?luggageNum=" + res.result
							})
						}
					}
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
.app-content {
		position: relative;
		background: rgb(49, 85, 99);
		padding-top: 3.6rem;
		box-sizing: border-box;
		height: 100vh;
		>.title-box{
			width: 100%;
			height: 2.375rem;
			display: flex;
			justify-content: center;
			align-items: center;
			padding-top: 1.25rem;
			color: rgb(255, 255, 255);
			font-family: Noto Sans SC;
			font-size: 1rem;
			position: fixed;
			top: 0;
			left: 0;
			z-index: 1000;
		}
		>.messageList{
			width: 100%;
			height: 100%;
			overflow-x: hidden;
			overflow-y: auto;
		}
}
</style>
