2020-05-29 03:13:55 +00:00
|
|
|
|
<template>
|
2020-07-31 00:45:30 +00:00
|
|
|
|
<view>
|
|
|
|
|
<view class="status_bar"></view>
|
2020-08-13 02:09:49 +00:00
|
|
|
|
<view class="index">
|
2020-07-31 00:45:30 +00:00
|
|
|
|
<view class="top">
|
2020-08-06 12:42:03 +00:00
|
|
|
|
<view class="sosuo" @click="goSearch">
|
|
|
|
|
<u-icon name="search" color="#555" size="34rpx"></u-icon>
|
|
|
|
|
</view>
|
2020-07-31 00:45:30 +00:00
|
|
|
|
<view class="tabs">
|
|
|
|
|
<u-tabs :is-scroll="false" bar-width="70" ref="tabs" :list="list" :current="num" :bar-style="{
|
2020-06-02 08:45:02 +00:00
|
|
|
|
'background-color':'#FF780F',
|
|
|
|
|
'bottom':'10rpx'
|
|
|
|
|
}"
|
2020-07-31 00:45:30 +00:00
|
|
|
|
inactive-color="#333" :active-item-style="{
|
2020-06-02 08:45:02 +00:00
|
|
|
|
'color':'#333'
|
2020-07-17 00:36:53 +00:00
|
|
|
|
}" :bold="false"
|
2020-08-10 11:06:47 +00:00
|
|
|
|
@change="dianji($event)"></u-tabs>
|
2020-07-31 00:45:30 +00:00
|
|
|
|
</view>
|
|
|
|
|
<view class="sosuo"></view>
|
2020-07-17 00:36:53 +00:00
|
|
|
|
</view>
|
2020-08-13 02:09:49 +00:00
|
|
|
|
<swiper class="card" @change="dianji" :current="num" @touchmove.stop.prevent="moveHandle">
|
2020-07-31 00:45:30 +00:00
|
|
|
|
<swiper-item>
|
2020-08-11 14:15:58 +00:00
|
|
|
|
<scroll-view style="width:100%;height:100%" scroll-y="true" lower-threshold="200" upper-threshold="100" @scrolltolower="swiperBottom" @scrolltoupper="swiperTop">
|
2020-07-31 00:45:30 +00:00
|
|
|
|
<view class="box">
|
|
|
|
|
<!-- <indexad style="width:690rpx"></indexad> -->
|
2020-08-04 06:36:35 +00:00
|
|
|
|
<u-swiper mode="dot" :list="indexImageSwiper" name="adv_code" @click="clickFImage"></u-swiper>
|
2020-07-31 00:45:30 +00:00
|
|
|
|
<view class="list">
|
|
|
|
|
<view>
|
2020-08-07 11:56:47 +00:00
|
|
|
|
<videoItem v-for="(item,id) in articleList.filter((_, index) => !(index&1))" :key="id" :item="item"
|
2020-08-11 03:12:32 +00:00
|
|
|
|
@updateList="updateList"></videoItem>
|
2020-07-31 00:45:30 +00:00
|
|
|
|
</view>
|
|
|
|
|
<view style="margin-left:20rpx">
|
2020-08-07 11:56:47 +00:00
|
|
|
|
<videoItem v-for="(item,id) in articleList.filter((_, index) => index&1)" :key="id" :item="item"
|
2020-08-11 03:12:32 +00:00
|
|
|
|
@updateList="updateList"></videoItem>
|
2020-07-31 00:45:30 +00:00
|
|
|
|
</view>
|
2020-07-17 00:36:53 +00:00
|
|
|
|
</view>
|
2020-08-09 11:08:12 +00:00
|
|
|
|
<u-loadmore class="load-size" color="#999999" :status="status" icon-type="iconType" margin-top="50" margin-bottom="50" :load-text="loadText" />
|
2020-07-17 00:36:53 +00:00
|
|
|
|
</view>
|
2020-08-03 06:37:02 +00:00
|
|
|
|
</scroll-view>
|
|
|
|
|
</swiper-item>
|
|
|
|
|
<swiper-item>
|
2020-08-20 03:09:49 +00:00
|
|
|
|
<scroll-view style="width:100%;height:100%" scroll-y="true" @scrolltolower="swiperBottomLive(e)" :refresher-enabled="true" @refresherrefresh="dianji(1)" :refresher-triggered="refresher" @refresherpulling="onPulling"
|
2020-08-20 02:16:40 +00:00
|
|
|
|
@refresherrestore="onRestore" @refresherabort="onAbort">
|
2020-08-03 06:37:02 +00:00
|
|
|
|
<view class="box">
|
2020-08-13 08:21:53 +00:00
|
|
|
|
<u-swiper mode="dot" :list="zhiboImageSwiper" name="adv_code" @click="clickSImage($event, 2)"></u-swiper>
|
2020-08-03 06:37:02 +00:00
|
|
|
|
<view class="list">
|
|
|
|
|
<view>
|
|
|
|
|
<zhiboItem v-for="item in tabLiveLists.filter((_, index) => !(index&1))" :zid="item.live_id" :rid="item.chatroom_id"
|
2020-08-14 01:26:59 +00:00
|
|
|
|
:key="item.live_id" :name="item.room_name" :image="item.cover_img" :url="item.url" :item="item" @updateList="updateList"></zhiboItem>
|
2020-08-03 06:37:02 +00:00
|
|
|
|
</view>
|
|
|
|
|
<view style="margin-left:20rpx">
|
|
|
|
|
<zhiboItem v-for="item in tabLiveLists.filter((_, index) => index&1)" :zid="item.live_id" :rid="item.chatroom_id"
|
2020-08-14 01:26:59 +00:00
|
|
|
|
:key="item.live_id" :name="item.room_name" :image="item.cover_img" :url="item.url" :item="item" @updateList="updateList"></zhiboItem>
|
2020-08-03 06:37:02 +00:00
|
|
|
|
</view>
|
2020-07-17 00:36:53 +00:00
|
|
|
|
</view>
|
2020-08-17 09:49:18 +00:00
|
|
|
|
<view style="height:600rpx" v-if="tabLiveLists.length == 0">
|
|
|
|
|
<u-empty text="暂无直播信息" mode="list"></u-empty>
|
|
|
|
|
</view>
|
|
|
|
|
<u-loadmore class="load-size" color="#999999" :status="status" v-if="tabLiveLists.length !=0" icon-type="iconType" margin-top="50" margin-bottom="50" :load-text="loadText" />
|
2020-07-17 00:36:53 +00:00
|
|
|
|
</view>
|
2020-08-17 09:49:18 +00:00
|
|
|
|
|
2020-07-31 00:45:30 +00:00
|
|
|
|
</scroll-view>
|
|
|
|
|
</swiper-item>
|
|
|
|
|
<swiper-item>
|
2020-08-07 11:56:47 +00:00
|
|
|
|
<scroll-view style="width:100%;height:100%" scroll-y="true" @scrolltolower="followBotton" lower-threshold="200">
|
2020-07-31 00:45:30 +00:00
|
|
|
|
<view class="box">
|
|
|
|
|
<view class="tuijian">
|
|
|
|
|
<view class="title" @click="toSearchPage">
|
|
|
|
|
<view class="left">
|
|
|
|
|
<view></view>
|
|
|
|
|
<text>推荐达人</text>
|
|
|
|
|
</view>
|
2020-08-05 13:06:29 +00:00
|
|
|
|
<u-icon name="arrow-right" color="#666" size="28"></u-icon>
|
2020-07-17 00:36:53 +00:00
|
|
|
|
</view>
|
2020-07-31 00:45:30 +00:00
|
|
|
|
<view class="tuijianlist">
|
|
|
|
|
<!-- <darenItem style="margin-right:23rpx"></darenItem>
|
2020-06-30 10:06:50 +00:00
|
|
|
|
<darenItem style="margin-right:23rpx"></darenItem> -->
|
2020-07-31 00:45:30 +00:00
|
|
|
|
<darenItem v-for="item in recommendList.slice(0,3)" :key="item.id" :info="item" v-on:pChangeType="changeType"></darenItem>
|
|
|
|
|
</view>
|
2020-07-17 00:36:53 +00:00
|
|
|
|
</view>
|
2020-08-05 13:06:29 +00:00
|
|
|
|
<view class="rec-list">
|
|
|
|
|
<view class="rec-box">
|
|
|
|
|
<!-- {{ fansList }} -->
|
2020-08-07 11:56:47 +00:00
|
|
|
|
<view class="item">
|
|
|
|
|
<videoItem isguanzhu="true" v-for="(item,id) in fansList" :key="id" :item="item"></videoItem>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="no-data" v-if="!fansList.length">您还没有关注哦,赶紧去点点关注!</view>
|
2020-08-13 02:09:49 +00:00
|
|
|
|
<u-loadmore class="load-size" v-else :status="status_1" icon-type="iconType" margin-top="50" :load-text="loadText" />
|
2020-07-31 00:45:30 +00:00
|
|
|
|
</view>
|
2020-07-17 00:36:53 +00:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2020-07-31 00:45:30 +00:00
|
|
|
|
</scroll-view>
|
|
|
|
|
</swiper-item>
|
|
|
|
|
</swiper>
|
|
|
|
|
</view>
|
2020-07-17 00:36:53 +00:00
|
|
|
|
</view>
|
2020-05-29 03:13:55 +00:00
|
|
|
|
|
2020-06-02 00:47:57 +00:00
|
|
|
|
</template>
|
2020-05-29 09:10:25 +00:00
|
|
|
|
<style lang="scss" scoped>
|
2020-08-11 14:15:58 +00:00
|
|
|
|
page {
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
}
|
2020-07-17 00:36:53 +00:00
|
|
|
|
.index {
|
|
|
|
|
width: 750rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
|
|
|
|
.top {
|
2020-08-11 14:15:58 +00:00
|
|
|
|
z-index: 10000;
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: var(--status-bar-height);
|
|
|
|
|
left: 0;
|
2020-07-17 00:36:53 +00:00
|
|
|
|
display: flex;
|
2020-08-06 12:42:03 +00:00
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
align-items: center;
|
2020-07-17 00:36:53 +00:00
|
|
|
|
justify-content: space-between;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 88rpx;
|
2020-08-06 12:42:03 +00:00
|
|
|
|
padding: 0 30rpx;
|
2020-08-11 14:15:58 +00:00
|
|
|
|
background-color: #fff;
|
2020-07-17 00:36:53 +00:00
|
|
|
|
|
|
|
|
|
.sosuo {
|
|
|
|
|
width: 32rpx;
|
|
|
|
|
height: 32rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tabs {
|
|
|
|
|
width: 334rpx;
|
2020-08-10 11:06:47 +00:00
|
|
|
|
// pointer-events: none;
|
|
|
|
|
|
2020-07-17 00:36:53 +00:00
|
|
|
|
/deep/ .u-tab-item {
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.card {
|
|
|
|
|
width: 100%;
|
2020-08-12 14:00:01 +00:00
|
|
|
|
height: calc(100vh - 150rpx);
|
2020-08-13 02:09:49 +00:00
|
|
|
|
margin-top: 100rpx;
|
2020-08-12 14:00:01 +00:00
|
|
|
|
// padding-top: 100rpx;
|
2020-07-17 00:36:53 +00:00
|
|
|
|
|
|
|
|
|
.box {
|
|
|
|
|
width: 100%;
|
2020-08-06 12:42:03 +00:00
|
|
|
|
height: 100%;
|
2020-08-12 14:00:01 +00:00
|
|
|
|
padding: 0 30rpx 0;
|
2020-08-13 02:09:49 +00:00
|
|
|
|
// margin-top: 30rpx;
|
2020-07-17 00:36:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.list {
|
|
|
|
|
display: flex;
|
2020-08-13 02:09:49 +00:00
|
|
|
|
// height: 100vh;
|
|
|
|
|
// padding-bottom: 100rpx;
|
|
|
|
|
// margin-bottom: 50rpx;
|
2020-07-17 00:36:53 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tuijian {
|
|
|
|
|
width: 750rpx;
|
2020-08-13 02:09:49 +00:00
|
|
|
|
padding: 30rpx;
|
2020-07-17 00:36:53 +00:00
|
|
|
|
margin-left: -30rpx;
|
|
|
|
|
height: 400rpx;
|
|
|
|
|
background-color: #ececec;
|
|
|
|
|
|
|
|
|
|
.title {
|
|
|
|
|
width: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
|
|
|
|
.left {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
>view {
|
|
|
|
|
width: 6rpx;
|
|
|
|
|
height: 30rpx;
|
|
|
|
|
background-color: #FF780F;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
>text {
|
|
|
|
|
font-size: 30rpx;
|
|
|
|
|
color: 30rpx;
|
|
|
|
|
margin-left: 14rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.right {
|
|
|
|
|
width: 14rpx;
|
|
|
|
|
height: 24rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tuijianlist {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 282rpx;
|
|
|
|
|
margin-top: 30rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
|
|
>view:not(:last-child) {
|
|
|
|
|
margin-right: 23rpx;
|
|
|
|
|
}
|
2020-06-30 10:06:50 +00:00
|
|
|
|
}
|
2020-07-17 00:36:53 +00:00
|
|
|
|
}
|
2020-08-05 13:06:29 +00:00
|
|
|
|
.rec-list {
|
|
|
|
|
width: 100%;
|
|
|
|
|
.rec-box {
|
2020-08-07 11:56:47 +00:00
|
|
|
|
width: 100%;
|
|
|
|
|
.item {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
justify-content: space-between;
|
2020-08-05 13:06:29 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-07-17 00:36:53 +00:00
|
|
|
|
}
|
2020-08-07 11:56:47 +00:00
|
|
|
|
.no-data {
|
|
|
|
|
margin: 200rpx auto 0;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
2020-08-10 09:38:54 +00:00
|
|
|
|
|
2020-08-09 11:08:12 +00:00
|
|
|
|
|
2020-06-02 00:47:57 +00:00
|
|
|
|
</style>
|
|
|
|
|
<script>
|
2020-08-19 08:59:06 +00:00
|
|
|
|
import common from '@/static/js/common.js';
|
2020-08-06 12:42:03 +00:00
|
|
|
|
import { mapState } from 'vuex'
|
2020-07-17 00:36:53 +00:00
|
|
|
|
import videoItem from "@/components/index/video-item/index"
|
|
|
|
|
import zhiboItem from "@/components/index/zhibo-item/index"
|
|
|
|
|
import indexad from "@/components/index/ad/index"
|
|
|
|
|
import darenItem from "@/components/index/daren-item/index"
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "index",
|
2020-08-06 12:42:03 +00:00
|
|
|
|
computed: {
|
|
|
|
|
...mapState(["hasLogin"])
|
|
|
|
|
},
|
2020-07-17 00:36:53 +00:00
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
list: [{
|
2020-06-02 08:45:02 +00:00
|
|
|
|
name: '发现'
|
|
|
|
|
}, {
|
|
|
|
|
name: '直播'
|
|
|
|
|
}, {
|
|
|
|
|
name: '关注'
|
2020-07-17 00:36:53 +00:00
|
|
|
|
}],
|
|
|
|
|
num: 0,
|
2020-08-11 14:15:58 +00:00
|
|
|
|
page: 1, // 0即第一页
|
2020-08-07 11:56:47 +00:00
|
|
|
|
follow_page: 0, //
|
2020-08-17 08:57:23 +00:00
|
|
|
|
live_page: 1, //
|
2020-07-17 00:36:53 +00:00
|
|
|
|
articleList: [],
|
|
|
|
|
recommendList: [], // 推荐达人
|
|
|
|
|
indexImageSwiper: [],
|
|
|
|
|
zhiboImageSwiper: [],
|
2020-08-05 13:06:29 +00:00
|
|
|
|
tabLiveLists: [],
|
|
|
|
|
fansList: [], // 关注的发现列表
|
2020-08-07 11:56:47 +00:00
|
|
|
|
status: 'loadmore',
|
|
|
|
|
status_1: 'loadmore',
|
2020-08-17 12:32:11 +00:00
|
|
|
|
status_live: 'loadmore',
|
2020-08-07 11:56:47 +00:00
|
|
|
|
iconType: 'circle',
|
|
|
|
|
loadText: {
|
|
|
|
|
loadmore: '轻轻上拉',
|
|
|
|
|
loading: '努力加载中',
|
|
|
|
|
nomore: '实在没有了'
|
2020-08-10 09:38:54 +00:00
|
|
|
|
},
|
2020-08-27 04:15:55 +00:00
|
|
|
|
refresher:true,
|
|
|
|
|
zqie:false
|
2020-07-17 00:36:53 +00:00
|
|
|
|
}
|
2020-07-15 08:21:43 +00:00
|
|
|
|
},
|
2020-07-17 00:36:53 +00:00
|
|
|
|
components: {
|
|
|
|
|
videoItem,
|
|
|
|
|
zhiboItem,
|
|
|
|
|
indexad,
|
|
|
|
|
darenItem
|
2020-06-29 09:24:57 +00:00
|
|
|
|
},
|
2020-07-17 00:36:53 +00:00
|
|
|
|
onShow() {
|
2020-09-15 08:44:03 +00:00
|
|
|
|
console.log(this.imService.status,this.$store.state.hasLogin)
|
2020-08-18 07:08:42 +00:00
|
|
|
|
if(!this.imService.status && this.$store.state.hasLogin){
|
2020-08-07 03:40:13 +00:00
|
|
|
|
const user = uni.getStorageSync('user_info');
|
2020-08-11 07:38:43 +00:00
|
|
|
|
// console.log(user)
|
2020-08-07 03:40:13 +00:00
|
|
|
|
this.imService.login(user.member.member_id,user.member.member_nickname,user.member.member_avatar)
|
2020-08-18 07:08:42 +00:00
|
|
|
|
this.imService.connectIM()
|
2020-08-15 07:47:29 +00:00
|
|
|
|
|
2020-08-18 07:08:42 +00:00
|
|
|
|
}else if(!this.imService.status){
|
|
|
|
|
this.$u.api.getDefaultAvatar().then((res)=>{
|
2020-08-15 07:47:29 +00:00
|
|
|
|
console.log(res)
|
|
|
|
|
uni.setStorageSync("morenimg",res.data.avatar)
|
|
|
|
|
this.imService.login(new Date().getTime(),"123",res.data.avatar)
|
2020-08-18 07:08:42 +00:00
|
|
|
|
this.imService.connectIM()
|
2020-08-17 01:44:47 +00:00
|
|
|
|
console.log("用户信息")
|
2020-08-15 07:47:29 +00:00
|
|
|
|
})
|
2020-08-17 01:44:47 +00:00
|
|
|
|
console.log("链接")
|
2020-08-15 07:47:29 +00:00
|
|
|
|
}
|
2020-08-18 02:43:15 +00:00
|
|
|
|
|
2020-08-18 07:08:42 +00:00
|
|
|
|
// if(!this.imService.status && !this.imService.lianjie){
|
|
|
|
|
// console.log("1212")
|
|
|
|
|
// this.imService.lianjie = true
|
|
|
|
|
// let that = this
|
|
|
|
|
// setTimeout(function(){
|
|
|
|
|
// that.imService.disconnect()
|
|
|
|
|
// console.log("guanbi")
|
|
|
|
|
// },1000)
|
|
|
|
|
// setTimeout(function(){
|
|
|
|
|
// console.log("lianjie")
|
|
|
|
|
// that.imService.connectIM()
|
|
|
|
|
// },2000)
|
|
|
|
|
// }
|
2020-08-20 02:25:58 +00:00
|
|
|
|
// 新人优惠券
|
|
|
|
|
if (this.$store.state.showCoupons) {
|
|
|
|
|
this.isNewmembervoucher();
|
2020-09-08 00:55:09 +00:00
|
|
|
|
}
|
|
|
|
|
this.getRecommendList();
|
2020-08-18 02:43:15 +00:00
|
|
|
|
},
|
|
|
|
|
async onLoad(){
|
|
|
|
|
this.articleList = [];
|
|
|
|
|
this.getArticlelist();
|
2020-08-18 07:08:42 +00:00
|
|
|
|
this.getSwiper();
|
2020-08-18 02:43:15 +00:00
|
|
|
|
// 优惠券
|
|
|
|
|
// if(this.$store.state.hasLogin){
|
|
|
|
|
// const user = uni.getStorageSync('user_info');
|
|
|
|
|
// // console.log(user)
|
|
|
|
|
// this.imService.login(user.member.member_id,user.member.member_nickname,user.member.member_avatar)
|
|
|
|
|
// await this.imService.connectIM()
|
|
|
|
|
|
|
|
|
|
// }else{
|
|
|
|
|
// await this.$u.api.getDefaultAvatar().then((res)=>{
|
|
|
|
|
// console.log(res)
|
|
|
|
|
// uni.setStorageSync("morenimg",res.data.avatar)
|
|
|
|
|
// this.imService.login(new Date().getTime(),"123",res.data.avatar)
|
|
|
|
|
// console.log("用户信息")
|
|
|
|
|
// })
|
|
|
|
|
// console.log("链接")
|
|
|
|
|
// await this.imService.connectIM()
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
// console.log("1212")
|
|
|
|
|
// let that = this
|
|
|
|
|
// setTimeout(function(){
|
|
|
|
|
// that.imService.disconnect()
|
|
|
|
|
// console.log("guanbi")
|
|
|
|
|
// },1000)
|
|
|
|
|
// setTimeout(function(){
|
|
|
|
|
// console.log("lianjie")
|
|
|
|
|
// that.imService.connectIM()
|
|
|
|
|
// },2000)
|
2020-08-07 03:40:13 +00:00
|
|
|
|
},
|
2020-08-01 08:36:48 +00:00
|
|
|
|
onPullDownRefresh() {
|
2020-08-11 14:15:58 +00:00
|
|
|
|
this.page = 1;
|
2020-08-04 14:13:50 +00:00
|
|
|
|
this.getArticlelist();
|
2020-08-01 08:36:48 +00:00
|
|
|
|
// this.getManicureList({ load: 'reload' });
|
|
|
|
|
},
|
2020-07-17 00:36:53 +00:00
|
|
|
|
methods: {
|
2020-08-11 14:15:58 +00:00
|
|
|
|
moveHandle() {
|
|
|
|
|
return;
|
|
|
|
|
},
|
2020-08-06 12:42:03 +00:00
|
|
|
|
// 直播列表
|
2020-07-31 00:45:30 +00:00
|
|
|
|
tabLiveList() {
|
2020-08-13 08:21:53 +00:00
|
|
|
|
uni.showLoading({
|
|
|
|
|
title: "loading..."
|
2020-08-27 04:15:55 +00:00
|
|
|
|
})
|
|
|
|
|
if(this.zqie){
|
|
|
|
|
return ;
|
|
|
|
|
}
|
|
|
|
|
this.zqie = true;
|
2020-08-17 08:57:23 +00:00
|
|
|
|
this.$u.api.tabLiveList({page:this.live_page}).then((res) => {
|
2020-08-13 03:52:05 +00:00
|
|
|
|
// uni.stopPullDownRefresh();
|
2020-08-17 12:32:11 +00:00
|
|
|
|
this.status_live = "loading";
|
2020-08-20 02:16:40 +00:00
|
|
|
|
this.refresher = false;
|
2020-08-14 01:26:59 +00:00
|
|
|
|
console.log(res)
|
2020-08-13 03:52:05 +00:00
|
|
|
|
if (res.errCode == 0) {
|
|
|
|
|
uni.hideLoading();
|
2020-08-17 08:57:23 +00:00
|
|
|
|
if (this.live_page == 1) {
|
2020-08-13 03:52:05 +00:00
|
|
|
|
this.tabLiveLists = res.data.data;
|
2020-08-17 12:32:11 +00:00
|
|
|
|
this.status_live = "loadmore";
|
2020-08-17 11:33:55 +00:00
|
|
|
|
if (res.data.data.length < 4) {
|
2020-08-17 12:32:11 +00:00
|
|
|
|
this.status_live = "nomore";
|
2020-08-17 08:57:23 +00:00
|
|
|
|
}
|
|
|
|
|
} else if (res.data.data.length == 0 && this.live_page > 1) {
|
2020-08-17 12:32:11 +00:00
|
|
|
|
this.status_live = "nomore";
|
2020-08-13 03:52:05 +00:00
|
|
|
|
} else {
|
2020-08-27 04:15:55 +00:00
|
|
|
|
console.log(this.live_page,1223)
|
2020-08-13 08:21:53 +00:00
|
|
|
|
this.tabLiveLists = this.tabLiveLists.concat(res.data.data);
|
|
|
|
|
console.log(this.tabLiveLists)
|
2020-08-13 03:52:05 +00:00
|
|
|
|
}
|
2020-08-17 08:57:23 +00:00
|
|
|
|
if (res.data.data.length == 0 && this.live_page > 1) {
|
2020-08-13 03:52:05 +00:00
|
|
|
|
} else {
|
2020-08-17 08:57:23 +00:00
|
|
|
|
this.live_page++;
|
2020-08-13 03:52:05 +00:00
|
|
|
|
}
|
|
|
|
|
} else {
|
2020-08-17 12:32:11 +00:00
|
|
|
|
this.status_live = "nomore"
|
2020-08-13 08:21:53 +00:00
|
|
|
|
}
|
2020-08-27 04:15:55 +00:00
|
|
|
|
this.zqie = false;
|
|
|
|
|
|
2020-08-13 08:21:53 +00:00
|
|
|
|
|
2020-07-18 08:10:14 +00:00
|
|
|
|
})
|
|
|
|
|
},
|
2020-08-05 13:06:29 +00:00
|
|
|
|
// 轮播图
|
2020-07-17 00:36:53 +00:00
|
|
|
|
getSwiper() {
|
|
|
|
|
this.$u.api.getIndexSwiper().then(res => {
|
|
|
|
|
if (res.errCode == 0) {
|
|
|
|
|
this.indexImageSwiper = res.data;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
2020-08-05 13:06:29 +00:00
|
|
|
|
// 关注
|
2020-07-31 00:45:30 +00:00
|
|
|
|
changeType(member_id) {
|
2020-08-11 07:38:43 +00:00
|
|
|
|
// console.log(member_id);
|
2020-08-05 13:06:29 +00:00
|
|
|
|
// this.$emit("pChangeType");
|
2020-07-18 11:52:47 +00:00
|
|
|
|
this.$u.api.attentionMember({
|
|
|
|
|
member_id: member_id
|
2020-07-31 00:45:30 +00:00
|
|
|
|
}).then((res) => {
|
2020-08-07 11:56:47 +00:00
|
|
|
|
this.follow_page = 0;
|
2020-08-20 06:32:01 +00:00
|
|
|
|
// this.getRecommendList(); // 关注列表
|
|
|
|
|
for(let i in this.recommendList){
|
|
|
|
|
if(this.recommendList[i].member_id == member_id){
|
|
|
|
|
this.recommendList[i].is_attention == 1 ? this.recommendList[i].is_attention = 0 : this.recommendList[i].is_attention = 1
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-08-05 13:06:29 +00:00
|
|
|
|
this.getFollowList(); // 刷新发现的列表
|
2020-07-18 11:52:47 +00:00
|
|
|
|
})
|
|
|
|
|
},
|
2020-07-17 00:36:53 +00:00
|
|
|
|
getZhiBoSwiper() {
|
|
|
|
|
this.$u.api.getZhiBoSwiper().then(res => {
|
|
|
|
|
if (res.errCode == 0) {
|
|
|
|
|
this.zhiboImageSwiper = res.data;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
2020-08-05 13:06:29 +00:00
|
|
|
|
// 切换导航
|
2020-07-17 00:36:53 +00:00
|
|
|
|
dianji(a) {
|
2020-08-20 02:16:40 +00:00
|
|
|
|
console.log(a);
|
|
|
|
|
|
2020-08-10 11:06:47 +00:00
|
|
|
|
if (a.type == "change") {
|
2020-08-19 11:24:14 +00:00
|
|
|
|
this.num = a.detail.current;
|
2020-08-10 11:06:47 +00:00
|
|
|
|
} else {
|
|
|
|
|
this.num = a;
|
|
|
|
|
}
|
|
|
|
|
// console.log(this.num);
|
2020-08-06 12:42:03 +00:00
|
|
|
|
// 状态请求
|
2020-08-20 02:16:40 +00:00
|
|
|
|
if (a.type == "change" || this.num == 1) { // 强制请求一次
|
2020-08-10 11:06:47 +00:00
|
|
|
|
if (this.num == 0) {
|
2020-08-11 14:15:58 +00:00
|
|
|
|
this.page = 1;
|
|
|
|
|
this.articleList = [];
|
2020-08-19 11:24:14 +00:00
|
|
|
|
this.status = "nomore";
|
2020-08-10 11:06:47 +00:00
|
|
|
|
this.getArticlelist();
|
|
|
|
|
this.getSwiper();
|
|
|
|
|
} else if (this.num == 1) {
|
2020-08-17 08:57:23 +00:00
|
|
|
|
this.live_page = 1;
|
2020-08-19 11:24:14 +00:00
|
|
|
|
this.status_live = "nomore";
|
2020-08-10 11:06:47 +00:00
|
|
|
|
this.getZhiBoSwiper(); // 直播轮播
|
2020-08-20 02:16:40 +00:00
|
|
|
|
this.tabLiveList();
|
2020-08-10 11:06:47 +00:00
|
|
|
|
} else if (this.num == 2) {
|
|
|
|
|
this.follow_page = 0;
|
|
|
|
|
this.fansList = [];
|
2020-08-19 11:24:14 +00:00
|
|
|
|
this.status_1 = "nomore";
|
2020-08-10 11:06:47 +00:00
|
|
|
|
if (this.hasLogin) {
|
|
|
|
|
this.getFollowList(); // 关注列表
|
|
|
|
|
}
|
|
|
|
|
this.getRecommendList(); // 推荐达人
|
2020-08-06 12:42:03 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2020-07-17 00:36:53 +00:00
|
|
|
|
},
|
2020-08-15 11:14:12 +00:00
|
|
|
|
// 发现列表
|
2020-07-17 00:36:53 +00:00
|
|
|
|
getArticlelist() {
|
|
|
|
|
this.$u.api.getArticlelist({
|
|
|
|
|
page: this.page,
|
|
|
|
|
is_video_img: 0, // 查询视频1 图文2 都查0
|
|
|
|
|
}).then(res => {
|
2020-08-15 11:14:12 +00:00
|
|
|
|
uni.stopPullDownRefresh();
|
2020-08-07 11:56:47 +00:00
|
|
|
|
this.status = "loading";
|
|
|
|
|
if (res.errCode == 0) {
|
2020-08-11 14:15:58 +00:00
|
|
|
|
if (this.page == 1) {
|
2020-08-17 11:33:55 +00:00
|
|
|
|
this.articleList = res.data.list;
|
|
|
|
|
if (!res.data.length) {
|
2020-08-17 08:57:23 +00:00
|
|
|
|
this.status = "nomore";
|
|
|
|
|
}
|
2020-08-17 11:33:55 +00:00
|
|
|
|
} else if (res.data.length == 0) {
|
2020-08-07 11:56:47 +00:00
|
|
|
|
this.status = "nomore";
|
|
|
|
|
} else {
|
|
|
|
|
this.articleList = this.articleList.concat(res.data.list);
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-07-17 00:36:53 +00:00
|
|
|
|
})
|
2020-08-19 11:24:14 +00:00
|
|
|
|
console.log(this.page);
|
2020-07-17 00:36:53 +00:00
|
|
|
|
},
|
2020-08-11 03:12:32 +00:00
|
|
|
|
// 屏蔽更新列表
|
|
|
|
|
updateList() {
|
2020-08-11 14:15:58 +00:00
|
|
|
|
this.page = 1;
|
2020-08-17 08:57:23 +00:00
|
|
|
|
this.articleList = [];
|
2020-08-13 02:04:50 +00:00
|
|
|
|
this.getArticlelist();
|
2020-08-17 08:57:23 +00:00
|
|
|
|
this.tabLiveList();
|
2020-08-11 03:12:32 +00:00
|
|
|
|
},
|
2020-08-07 11:56:47 +00:00
|
|
|
|
// 发现下拉加载
|
|
|
|
|
swiperBottom(e) {
|
2020-08-19 11:24:14 +00:00
|
|
|
|
this.page++;
|
|
|
|
|
this.getArticlelist();
|
|
|
|
|
},
|
|
|
|
|
swiperBottomLive() {
|
|
|
|
|
this.tabLiveList();
|
2020-08-07 11:56:47 +00:00
|
|
|
|
},
|
2020-08-11 14:15:58 +00:00
|
|
|
|
swiperTop() {
|
|
|
|
|
// uni.startPullDownRefresh();
|
|
|
|
|
},
|
|
|
|
|
// 关注下拉
|
2020-08-07 11:56:47 +00:00
|
|
|
|
followBotton(e) {
|
|
|
|
|
this.getFollowList();
|
|
|
|
|
// console.log(e);
|
|
|
|
|
},
|
2020-08-05 13:06:29 +00:00
|
|
|
|
// 达人列表
|
2020-07-17 00:36:53 +00:00
|
|
|
|
getRecommendList() {
|
|
|
|
|
this.$u.api.getRecommendList().then(res => {
|
2020-08-06 12:42:03 +00:00
|
|
|
|
console.log(res);
|
2020-07-17 00:36:53 +00:00
|
|
|
|
if (res.errCode == 0) {
|
|
|
|
|
this.recommendList = res.data.list;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
2020-08-05 13:06:29 +00:00
|
|
|
|
// 关注发现列表
|
|
|
|
|
getFollowList() {
|
|
|
|
|
this.$u.post("article/attentionArticleList",{
|
2020-08-07 11:56:47 +00:00
|
|
|
|
page: this.follow_page,
|
2020-08-05 13:06:29 +00:00
|
|
|
|
}).then(res => {
|
2020-08-07 11:56:47 +00:00
|
|
|
|
this.status_1 = "loading";
|
2020-08-05 13:06:29 +00:00
|
|
|
|
if (res.errCode == 0) {
|
2020-08-10 11:06:47 +00:00
|
|
|
|
if (this.fansList.length < 4) {
|
|
|
|
|
this.status_1 = "nomore";
|
|
|
|
|
}
|
2020-08-07 11:56:47 +00:00
|
|
|
|
// uni.stopPullDownRefresh();
|
|
|
|
|
// console.log('37647744ghj', res)
|
|
|
|
|
if (this.follow_page == 0) {
|
|
|
|
|
this.fansList = res.data.list;
|
2020-08-10 11:06:47 +00:00
|
|
|
|
// this.status_1 = "loadmore";
|
2020-08-07 11:56:47 +00:00
|
|
|
|
} else if (res.data.list.length == 0 && this.follow_page > 0) {
|
|
|
|
|
this.status_1 = "nomore";
|
|
|
|
|
} else {
|
|
|
|
|
this.fansList = this.fansList.concat(res.data.list);
|
|
|
|
|
}
|
|
|
|
|
this.follow_page++;
|
|
|
|
|
} else {
|
|
|
|
|
this.status_1 = "nomore"
|
2020-08-05 13:06:29 +00:00
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
2020-07-17 00:36:53 +00:00
|
|
|
|
toSearchPage() {
|
2020-07-31 00:45:30 +00:00
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: '/pageB/follow/index'
|
|
|
|
|
});
|
2020-07-17 00:36:53 +00:00
|
|
|
|
},
|
2020-07-30 12:33:16 +00:00
|
|
|
|
clickFImage(index) {
|
|
|
|
|
const item = this.indexImageSwiper[index];
|
2020-08-19 08:59:06 +00:00
|
|
|
|
// console.log(item);
|
|
|
|
|
this.jumpPage({
|
2020-08-03 06:37:02 +00:00
|
|
|
|
type: item.url_type,
|
2020-09-04 09:29:45 +00:00
|
|
|
|
id: item.info_id,
|
|
|
|
|
adv_id: item.adv_id,
|
2020-08-03 06:37:02 +00:00
|
|
|
|
});
|
2020-07-30 12:33:16 +00:00
|
|
|
|
},
|
|
|
|
|
clickSImage(index) {
|
|
|
|
|
const item = this.zhiboImageSwiper[index];
|
2020-08-19 08:59:06 +00:00
|
|
|
|
// console.log(item);
|
|
|
|
|
this.jumpPage({
|
2020-08-03 06:37:02 +00:00
|
|
|
|
type: item.url_type,
|
2020-09-04 09:29:45 +00:00
|
|
|
|
id: item.info_id,
|
|
|
|
|
adv_id: item.adv_id,
|
2020-08-03 06:37:02 +00:00
|
|
|
|
});
|
2020-07-30 12:33:16 +00:00
|
|
|
|
},
|
2020-09-04 09:29:45 +00:00
|
|
|
|
goSearch() {
|
|
|
|
|
this.$u.route("/pageB/search/index", {
|
2020-08-09 10:29:36 +00:00
|
|
|
|
type: 2,
|
2020-08-11 10:27:19 +00:00
|
|
|
|
curent:2
|
2020-08-09 06:23:59 +00:00
|
|
|
|
});
|
2020-08-10 09:38:54 +00:00
|
|
|
|
},
|
|
|
|
|
// 是否显示新人优惠券
|
|
|
|
|
isNewmembervoucher() {
|
2020-08-20 02:25:58 +00:00
|
|
|
|
this.$store.commit('updateShowCoupons', false);
|
2020-08-10 09:38:54 +00:00
|
|
|
|
this.$u.api.isNewmembervoucher().then(res => {
|
|
|
|
|
if(res.errCode == 0) {
|
2020-08-11 07:38:43 +00:00
|
|
|
|
this.$u.route('/pageB/coupon/index');
|
2020-08-10 09:38:54 +00:00
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
2020-08-20 02:16:40 +00:00
|
|
|
|
onPulling(e) {
|
2020-09-04 09:29:45 +00:00
|
|
|
|
console.log("onpulling", e);
|
|
|
|
|
},
|
|
|
|
|
onRestore() {
|
|
|
|
|
this.refresher = 'restore'; // 需要重置
|
|
|
|
|
console.log("onRestore");
|
|
|
|
|
},
|
|
|
|
|
onAbort() {
|
|
|
|
|
console.log("onAbort");
|
|
|
|
|
},
|
2020-08-19 08:59:06 +00:00
|
|
|
|
jumpPage(uri) {
|
|
|
|
|
// console.log(uri);
|
2020-09-04 09:29:45 +00:00
|
|
|
|
this.$u.api.advClick({ adv_id: uri.adv_id });
|
2020-08-19 08:59:06 +00:00
|
|
|
|
common.jumpPage({ type: uri.type, id: uri.id });
|
|
|
|
|
}
|
2020-07-01 09:32:36 +00:00
|
|
|
|
},
|
2020-07-17 00:36:53 +00:00
|
|
|
|
}
|
2020-08-07 03:40:13 +00:00
|
|
|
|
</script>
|