list.vue 1.1 KB
Newer Older
芊里 已提交
1
<template>
芊里 已提交
2
	<view style="overflow: hidden;">
芊里 已提交
3
		<!-- 页面主列表 -->
芊里 已提交
4
		<news-list ref="newsList" :canSearch="canSearch" :currentText="searchText"></news-list>
芊里 已提交
5 6 7
	</view>
</template>

芊里 已提交
8 9 10 11
<script>
	import newsList from './news-list.vue';
	export default {
		components:{
芊里 已提交
12
			newsList
芊里 已提交
13
		},
芊里 已提交
14 15
		data() {
			return {
芊里 已提交
16
				searchText: '',
芊里 已提交
17
				canSearch:true
芊里 已提交
18 19 20 21
			};
		},
		onShow(options) {
			this.searchText = getApp().globalData.searchText;
芊里 已提交
22 23 24 25 26 27
		},
		/**
		 * 下拉刷新回调函数
		 */
		onPullDownRefresh() {
			this.$refs.newsList.refresh();
芊里 已提交
28 29 30
		},
		methods: {
			/**
芊里 已提交
31
			 * 切换商品列表布局方向(未实现)
芊里 已提交
32 33 34 35 36 37 38
			 */
			select() {
				this.formData.waterfall = !this.formData.waterfall;
			},
			/**
			 * 上拉加载回调函数
			 */
芊里 已提交
39 40
			onReachBottom() {
				this.$refs.newsList.loadMore();
芊里 已提交
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
			}
		}
	};
</script>

<style lang="scss" scoped>
	@import '@/common/uni-ui.scss';

	page {
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		background-color: #efeff4;
		min-height: 100%;
		height: auto;
	}
芊里 已提交
57
</style>