Merge pull request 'gdpaoup' (#157) from gyh into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/157
This commit was merged in pull request #157.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="status_bar"></view>
|
||||
<view class="index">
|
||||
<view class="index" @touchmove.stop.prevent="moveHandle">
|
||||
<view class="top">
|
||||
<view class="sosuo" @click="goSearch">
|
||||
<u-icon name="search" color="#555" size="34rpx"></u-icon>
|
||||
@@ -20,7 +20,7 @@
|
||||
</view>
|
||||
<swiper class="card" @change="dianji" :current="num">
|
||||
<swiper-item>
|
||||
<scroll-view style="width:100%;height:100%" scroll-y="true" lower-threshold="200" @scrolltolower="swiperBottom">
|
||||
<scroll-view style="width:100%;height:100%" scroll-y="true" lower-threshold="200" upper-threshold="100" @scrolltolower="swiperBottom" @scrolltoupper="swiperTop">
|
||||
<view class="box">
|
||||
<!-- <indexad style="width:690rpx"></indexad> -->
|
||||
<u-swiper mode="dot" :list="indexImageSwiper" name="adv_code" @click="clickFImage"></u-swiper>
|
||||
@@ -91,17 +91,24 @@
|
||||
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background-color: #fff;
|
||||
}
|
||||
.index {
|
||||
width: 750rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
/* #ifdef APP-PLUS */
|
||||
padding-bottom: 100rpx;
|
||||
padding-bottom: 88rpx;
|
||||
/* #endif */
|
||||
overflow: hidden;
|
||||
|
||||
.top {
|
||||
z-index: 10000;
|
||||
position: fixed;
|
||||
top: var(--status-bar-height);
|
||||
left: 0;
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
@@ -109,6 +116,7 @@
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
padding: 0 30rpx;
|
||||
background-color: #fff;
|
||||
|
||||
.sosuo {
|
||||
width: 32rpx;
|
||||
@@ -126,8 +134,9 @@
|
||||
}
|
||||
|
||||
.card {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin-top: 88rpx;
|
||||
// pointer-events: none;
|
||||
|
||||
.box {
|
||||
@@ -138,6 +147,8 @@
|
||||
|
||||
.list {
|
||||
display: flex;
|
||||
padding-bottom: 50rpx;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -229,7 +240,7 @@
|
||||
name: '关注'
|
||||
}],
|
||||
num: 0,
|
||||
page: 0, // 0即第一页
|
||||
page: 1, // 0即第一页
|
||||
follow_page: 0, //
|
||||
articleList: [],
|
||||
recommendList: [], // 推荐达人
|
||||
@@ -254,12 +265,18 @@
|
||||
darenItem
|
||||
},
|
||||
onShow() {
|
||||
this.articleList = [];
|
||||
this.page = 0;
|
||||
this.getArticlelist();
|
||||
this.getSwiper();
|
||||
this.page = 1;
|
||||
if (this.page != 1) {
|
||||
this.articleList = [];
|
||||
}
|
||||
this.getArticlelist();
|
||||
if (this.hasLogin) {
|
||||
this.isNewmembervoucher();
|
||||
}
|
||||
},
|
||||
onLoad(){
|
||||
this.getSwiper();
|
||||
// 优惠券
|
||||
if(this.$store.state.hasLogin){
|
||||
this.isNewmembervoucher();
|
||||
const user = uni.getStorageSync('user_info');
|
||||
@@ -278,10 +295,14 @@
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.page = 1;
|
||||
this.getArticlelist();
|
||||
// this.getManicureList({ load: 'reload' });
|
||||
},
|
||||
methods: {
|
||||
moveHandle() {
|
||||
return;
|
||||
},
|
||||
// 直播列表
|
||||
tabLiveList() {
|
||||
this.$u.api.tabLiveList().then((res) => {
|
||||
@@ -328,7 +349,8 @@
|
||||
// 状态请求
|
||||
if (a.type == "change") { // 强制请求一次
|
||||
if (this.num == 0) {
|
||||
this.page = 0;
|
||||
this.page = 1;
|
||||
this.articleList = [];
|
||||
this.status = "loadmore";
|
||||
this.getArticlelist();
|
||||
this.getSwiper();
|
||||
@@ -347,23 +369,30 @@
|
||||
},
|
||||
// 发现别表
|
||||
getArticlelist() {
|
||||
uni.showLoading({
|
||||
title: "loading..."
|
||||
})
|
||||
this.$u.api.getArticlelist({
|
||||
page: this.page,
|
||||
is_video_img: 0, // 查询视频1 图文2 都查0
|
||||
}).then(res => {
|
||||
// uni.stopPullDownRefresh();
|
||||
this.status = "loading";
|
||||
if (res.errCode == 0) {
|
||||
// uni.stopPullDownRefresh();
|
||||
// console.log('37647744ghj', res)
|
||||
if (this.page == 0) {
|
||||
uni.hideLoading();
|
||||
if (this.page == 1) {
|
||||
this.articleList = res.data.list;
|
||||
this.status = "loadmore";
|
||||
} else if (res.data.length == 0 && this.page > 0) {
|
||||
} else if (res.data.length == 0 && this.page > 1) {
|
||||
this.status = "nomore";
|
||||
} else {
|
||||
this.articleList = this.articleList.concat(res.data.list);
|
||||
}
|
||||
this.page++;
|
||||
if (res.data.length == 0 && this.page > 1) {
|
||||
console.log(111);
|
||||
} else {
|
||||
this.page++;
|
||||
}
|
||||
} else {
|
||||
this.status = "nomore"
|
||||
}
|
||||
@@ -371,8 +400,7 @@
|
||||
},
|
||||
// 屏蔽更新列表
|
||||
updateList() {
|
||||
console.log(111);
|
||||
this.page = 0;
|
||||
this.page = 1;
|
||||
this.getArticlelist();
|
||||
},
|
||||
// 发现下拉加载
|
||||
@@ -380,6 +408,10 @@
|
||||
this.getArticlelist();
|
||||
// console.log(e);
|
||||
},
|
||||
swiperTop() {
|
||||
// uni.startPullDownRefresh();
|
||||
},
|
||||
// 关注下拉
|
||||
followBotton(e) {
|
||||
this.getFollowList();
|
||||
// console.log(e);
|
||||
|
||||
Reference in New Issue
Block a user