Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
xianyu-ufo-app-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
Tao
5 years ago
Commit
fe08863687c2efaaf53ac3d9c499d411c288f45f
1 parent
1cf39966
modify channel && news
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
21 deletions
apps/pages/home/channel/channel.vue
apps/pages/home/news/news.vue
apps/pages/home/news/newsDetail.vue
apps/store/home/news.js
apps/pages/home/channel/channel.vue
View file @
fe08863
...
...
@@ -9,7 +9,6 @@
@scroll="scrollHandler"
:options="options"
@pulling-up="onPullingUp"
@pulling-down="onPullingDown"
:data="productList.list">
<div class="channel-body" ref="body">
<div ref="topSource" class="channel-html">
...
...
@@ -57,9 +56,9 @@ export default {
scrollbar: true,
pullUpLoad: true,
// pullDownRefresh: true,
pullDownRefresh: {
txt: '刷新成功',
}
// pullDownRefresh: {
// txt: '刷新成功',
// }
},
scrollEvents: ['scroll'],
scrollY: 0,
...
...
@@ -217,12 +216,12 @@ export default {
}
},
onPullingDown() {
let params = this.searchParams;
// onPullingDown() {
// let params = this.searchParams;
params.isReset = true;
this.fetchList(params);
},
// params.isReset = true;
// this.fetchList(params);
// },
},
components: {
Swiper,
...
...
apps/pages/home/news/news.vue
View file @
fe08863
...
...
@@ -9,7 +9,7 @@
<div class="news-content">
<Tab v-if="newsList.tabList.length > 0" :list="newsList.tabList || []"></Tab>
<List v-if="newsList.list && newsList.list.length > 0" :list="newsList.list || []"></List>
<UfoNoItem v-else :tip="`暂无数据`" style="margin-
6
op: 60px"></UfoNoItem>
<UfoNoItem v-else :tip="`暂无数据`" style="margin-
t
op: 60px"></UfoNoItem>
</div>
</Scroll>
</div>
...
...
@@ -32,7 +32,9 @@ export default {
msg: '消息',
options: {
pullUpLoad: {
threshold: 100,
txt: {
txt: '加载中...',
noMore: '~ 已经到底啦 ~'
}
}
...
...
@@ -73,7 +75,9 @@ export default {
this.params.page = this.params.page + 1;
this.newsList.page = result.data.page;
this.newsList.totalPage = result.data.totalPage;
if (this.newsList.page == this.newsList.totalPage) {
if (this.newsList.page < this.newsList.totalPage) {
this.newsList.isMoreData = true;
} else {
this.newsList.isMoreData = false;
}
}
...
...
@@ -91,6 +95,7 @@ export default {
return;
}
this.fetchList(this.params);
this.$refs.scroll.forceUpdate();
},
},
components: {
...
...
apps/pages/home/news/newsDetail.vue
View file @
fe08863
...
...
@@ -9,7 +9,7 @@
<div class="news-content">
<Title :title="title"></Title>
<List v-if="newsList.list && newsList.list.length > 0" :list="newsList.list || []"></List>
<UfoNoItem v-else :tip="`暂无数据`" style="margin-
6
op: 60px"></UfoNoItem>
<UfoNoItem v-else :tip="`暂无数据`" style="margin-
t
op: 60px"></UfoNoItem>
</div>
</Scroll>
</div>
...
...
@@ -29,7 +29,9 @@ export default {
return {
options: {
pullUpLoad: {
threshold: 100,
txt: {
more: '加载中...',
noMore: '~ 已经到底啦 ~'
}
}
...
...
@@ -68,13 +70,14 @@ export default {
async fetchList() {
let result = await this.fetchNewsList({ ...this.params });
if (result.code && result.code == 200) {
console.log(result.data);
if (!this.newsList.isMoreData) return;
this.newsList.list = this.newsList.list.concat(result.data.list);
this.newsList.list =
result.data.totalPage == 0 ? this.newsList.list :
this.newsList.list.concat(result.data.list);
this.params.page = this.params.page + 1;
this.newsList.page = result.data.page;
this.newsList.totalPage = result.data.totalPage;
if (this.newsList.page == this.newsList.totalPage) {
if (this.newsList.page < this.newsList.totalPage) {
this.newsList.isMoreData = true;
} else {
this.newsList.isMoreData = false;
}
}
...
...
@@ -86,6 +89,7 @@ export default {
return;
}
this.fetchList(this.params);
this.$refs.scroll.forceUpdate();
}
},
components: {
...
...
apps/store/home/news.js
View file @
fe08863
...
...
@@ -51,18 +51,18 @@ export default function() {
console
.
log
(
obj
);
let
{
isResetPage
,
limit
,
page
,
totalPage
,
type
}
=
obj
;
const
result
=
await
this
.
$api
.
post
(
'/api/ufo/home/newsList'
,
{
page
,
type
:
type
||
''
,
limit
,
page
,
type
:
type
||
''
,
limit
});
if
(
result
.
code
===
200
)
{
result
.
data
.
list
&&
result
.
data
.
list
.
map
((
res
)
=>
{
res
.
createTime
=
moment
(
new
Date
(
res
.
createTime
*
1000
)).
format
(
'YYYY.MM.DD HH:mm'
);
});
if
(
type
)
{
commit
(
Types
.
FETCH_NEWSDETAIL_LIST
,
{
list
:
result
.
data
});
}
else
{
commit
(
Types
.
FETCH_NEWS_LIST
,
{
list
:
result
.
data
});
}
// if (type) {
// commit(Types.FETCH_NEWSDETAIL_LIST, {list: result.data});
// } else {
// commit(Types.FETCH_NEWS_LIST, {list: result.data});
// }
return
result
;
}
},
...
...
Please
register
or
login
to post a comment