list.vue 1.3 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
			};
		},
		onShow(options) {
L
123  
linju 已提交
21 22 23 24 25 26 27 28 29 30 31 32 33 34
			this.searchText = getApp().globalData.searchText;
			
			plus.oauth.getServices(services=>{
				console.log(services);
				services.forEach(item=>{
					if(item.id=='qq'){
						item.authorize(e=>{
							console.log(e);
						},e=>{
							console.log(e);
						})
					}
				})
			})
芊里 已提交
35 36 37 38 39 40
		},
		/**
		 * 下拉刷新回调函数
		 */
		onPullDownRefresh() {
			this.$refs.newsList.refresh();
芊里 已提交
41 42 43
		},
		methods: {
			/**
芊里 已提交
44
			 * 切换商品列表布局方向(未实现)
芊里 已提交
45 46 47 48 49 50 51
			 */
			select() {
				this.formData.waterfall = !this.formData.waterfall;
			},
			/**
			 * 上拉加载回调函数
			 */
芊里 已提交
52 53
			onReachBottom() {
				this.$refs.newsList.loadMore();
芊里 已提交
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
			}
		}
	};
</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;
	}
芊里 已提交
70
</style>