提交 fd45e8b8 编写于 作者: 芊里

首页搜索栏目调整

上级 a73b07da
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
"pages": [{ "pages": [{
"path": "pages/list/list", "path": "pages/list/list",
"style": { "style": {
"navigationStyle":"custom" "navigationStyle":"custom",
"enablePullDownRefresh":true
} }
}, { }, {
"path":"pages/grid/grid", "path":"pages/grid/grid",
......
<template> <template>
<view style="overflow: hidden;"> <view style="overflow: hidden;">
<status-bar></status-bar> <!-- 搜索栏 -->
<news-search-title></news-search-title>
<!-- 页面主列表 --> <!-- 页面主列表 -->
<news-list ref="newsList" :searchText="searchText"></news-list> <news-list ref="newsList" :searchText="searchText"></news-list>
</view> </view>
...@@ -8,11 +9,11 @@ ...@@ -8,11 +9,11 @@
<script> <script>
import newsList from './news-list.vue'; import newsList from './news-list.vue';
import statusBar from '@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-status-bar.vue'; import newsSearchTitle from './news-search-title.vue';
export default { export default {
components:{ components:{
newsList, newsList,
statusBar newsSearchTitle
}, },
data() { data() {
return { return {
...@@ -25,6 +26,13 @@ ...@@ -25,6 +26,13 @@
}, },
onShow(options) { onShow(options) {
this.searchText = getApp().globalData.searchText; this.searchText = getApp().globalData.searchText;
},
/**
* 下拉刷新回调函数
*/
onPullDownRefresh() {
console.log('refresh');
this.$refs.newsList.refresh();
}, },
methods: { methods: {
/** /**
...@@ -33,17 +41,12 @@ ...@@ -33,17 +41,12 @@
select() { select() {
this.formData.waterfall = !this.formData.waterfall; this.formData.waterfall = !this.formData.waterfall;
}, },
/**
* 下拉刷新回调函数
*/
onPullDownRefresh() {
this.$refs.newsList.onPullDownRefresh();
},
/** /**
* 上拉加载回调函数 * 上拉加载回调函数
*/ */
onReachBottom() { onReachBottom() {
this.$refs.newsList.onReachBottom(); console.log('load_more');
this.$refs.newsList.loadMore();
} }
}, },
watch: { watch: {
......
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
/** /**
* 下拉刷新回调函数 * 下拉刷新回调函数
*/ */
onPullDownRefresh() { refresh() {
this.tipShow = true this.tipShow = true
this.formData.status = 'more' this.formData.status = 'more'
this.$refs.udb.loadData({ this.$refs.udb.loadData({
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
/** /**
* 上拉加载回调函数 * 上拉加载回调函数
*/ */
onReachBottom() { loadMore() {
this.$refs.udb.loadMore() this.$refs.udb.loadMore()
}, },
load(data, ended) { load(data, ended) {
......
<template>
<view>
<status-bar></status-bar>
</view>
</template>
<script>
import statusBar from '@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-status-bar.vue';
export default {
components: {
statusBar
},
}
</script>
<style>
</style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册