<template>
	<view class="page">
		<view class="mainBody">
			<scroll-view class="scroll-view_H" scroll-x="true" @scroll="scroll" scroll-left="0">
				<view class="item" :class="{'active':tab===0}" @click="checkTab(0)">
					<text class="left">全部</text>
					<view class="line"></view>
				</view>
				<view class="item" :class="{'active':tab===item.id}" @click="checkTab(item.id)"
					v-for="(item,index) in cate" :key="index">
					<text class="left">{{item.name}}</text>
					<view class="line"></view>
				</view>
			</scroll-view>

		</view>
		<view class="list_info">
			<block v-for="(item,index) in list" :key="index">
				<view class="item" @click="goDetail(item)">
					<view class="avator">
						<image class="icon" :src="item.image" mode="aspectFill">
						</image>
					</view>
					<view class="tit">
						<view class="name">{{item.name}}</view>
						<view class="desc">市场价：¥{{item.price}}</view>
					</view>
					<view class="list_mem">
						<image class="icon" v-for="(item2,index2) in item.mem_list" :src="item2.avator"
							mode="aspectFill" />
					</view>

				</view>
			</block>

			<view class="blankHeight"></view>
		</view>

		<DialogBox ref="DialogBox"></DialogBox>
		<ToastW3 ref="ToastW3"></ToastW3>
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				tab: 0,
				scrollTop: 0,
				old: {
					scrollTop: 0
				},
				list: [],
				cate: ["消息","评论和赞"],
			}
		},
		onLoad() {},
		onShow() {
			this.loadData();
		},
		onNavigationBarButtonTap(e) {
			if (e.index === 0) {
				// uni.navigateTo({
				// 	url: '/pages/my/wishList'
				// });
			}
		},
		methods: {
			onBack() {},
			checkTab(tab) {
				this.tab = tab;
				this.loadData();
			},
			scroll: function(e) {
				console.log(e)
				this.old.scrollTop = e.detail.scrollTop
			},
			goDetail(item) {
				// uni.navigateTo({
				// 	url: '/pages/my/wishDetail?id=' + item.id,
				// })
			},
			loadData() {
				// uni.request({
				// 	url: this.$apiHost + '/Wish/getList',
				// 	data: {
				// 		uuid: getApp().globalData.uuid,
				// 		cid: this.tab,
				// 	},
				// 	header: {
				// 		'content-type': 'application/json'
				// 	},
				// 	success: (res) => {
				// 		console.log("res", res.data)
				// 		this.list = res.data.list;
				// 		this.cate = res.data.cate;
				// 	}
				// });
			},
		}
	}
</script>

<style scoped lang="scss">
	@import 'mailMessage.scss';
</style>