Merge branch 'master' of http://git.luyuan.tk/luyuan/deming into xbx
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
<view class="status_bar"></view>
|
||||
<view class="index">
|
||||
<view class="top">
|
||||
<view class="sosuo"></view>
|
||||
<view class="sosuo" @click="goSearch">
|
||||
<u-icon name="search" color="#555" size="34rpx"></u-icon>
|
||||
</view>
|
||||
<view class="tabs">
|
||||
<u-tabs :is-scroll="false" bar-width="70" ref="tabs" :list="list" :current="num" :bar-style="{
|
||||
'background-color':'#FF780F',
|
||||
@@ -93,18 +95,17 @@
|
||||
height: 100vh;
|
||||
|
||||
.top {
|
||||
padding: 0 30rpx;
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
padding: 0 30rpx;
|
||||
|
||||
.sosuo {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
|
||||
}
|
||||
|
||||
.tabs {
|
||||
@@ -122,6 +123,7 @@
|
||||
|
||||
.box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
|
||||
@@ -191,6 +193,7 @@
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import videoItem from "@/components/index/video-item/index"
|
||||
import zhiboItem from "@/components/index/zhibo-item/index"
|
||||
import indexad from "@/components/index/ad/index"
|
||||
@@ -198,6 +201,9 @@
|
||||
|
||||
export default {
|
||||
name: "index",
|
||||
computed: {
|
||||
...mapState(["hasLogin"])
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: [{
|
||||
@@ -225,11 +231,7 @@
|
||||
},
|
||||
onShow() {
|
||||
this.getArticlelist();
|
||||
this.getRecommendList();
|
||||
this.getSwiper();
|
||||
this.getZhiBoSwiper();
|
||||
this.tabLiveList();
|
||||
this.getFollowList();
|
||||
},
|
||||
onLoad(){
|
||||
if(this.$store.state.hasLogin){
|
||||
@@ -253,7 +255,7 @@
|
||||
// this.getManicureList({ load: 'reload' });
|
||||
},
|
||||
methods: {
|
||||
// 列表
|
||||
// 直播列表
|
||||
tabLiveList() {
|
||||
this.$u.api.tabLiveList().then((res) => {
|
||||
console.log(res)
|
||||
@@ -289,12 +291,25 @@
|
||||
},
|
||||
// 切换导航
|
||||
dianji(a) {
|
||||
console.log(a);
|
||||
// console.log(a);
|
||||
if (typeof a == "object") {
|
||||
this.num = a.detail.current
|
||||
} else {
|
||||
this.num = a
|
||||
}
|
||||
// 状态请求
|
||||
if (this.num == 0) {
|
||||
this.getArticlelist();
|
||||
this.getSwiper();
|
||||
} else if (this.num == 1) {
|
||||
this.getZhiBoSwiper(); // 直播轮播
|
||||
this.tabLiveList();
|
||||
} else if (this.num == 2) {
|
||||
if (this.hasLogin) {
|
||||
this.getFollowList(); // 关注列表
|
||||
}
|
||||
this.getRecommendList(); // 推荐达人
|
||||
}
|
||||
},
|
||||
// 发现别表
|
||||
getArticlelist() {
|
||||
@@ -312,7 +327,7 @@
|
||||
// 达人列表
|
||||
getRecommendList() {
|
||||
this.$u.api.getRecommendList().then(res => {
|
||||
console.log(res)
|
||||
console.log(res);
|
||||
if (res.errCode == 0) {
|
||||
this.recommendList = res.data.list;
|
||||
}
|
||||
@@ -330,7 +345,6 @@
|
||||
})
|
||||
},
|
||||
toSearchPage() {
|
||||
console.log("22");
|
||||
uni.navigateTo({
|
||||
url: '/pageB/follow/index'
|
||||
});
|
||||
@@ -371,6 +385,9 @@
|
||||
params: params
|
||||
})
|
||||
},
|
||||
goSearch() {
|
||||
this.$u.route("/pageB/search/index");
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user