首页完成

This commit is contained in:
luyuan 2020-06-02 16:45:02 +08:00
parent 2d9af1ba45
commit 8162188b03
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3
2 changed files with 36 additions and 26 deletions

View File

@ -115,7 +115,8 @@
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "uni-app" "navigationBarTitleText": "首页",
"navigationStyle": "custom"
} }
} }
], ],

View File

@ -3,13 +3,20 @@
<view class="top"> <view class="top">
<view class="sosuo"></view> <view class="sosuo"></view>
<view class="tabs"> <view class="tabs">
<view class="xuanzhong ">发现</view> <u-tabs :is-scroll="false" bar-width="70" ref="tabs" :list="list" :current="num" :bar-style="{
<view>直播</view> 'background-color':'#FF780F',
<view>关注</view> 'bottom':'10rpx'
}"
inactive-color="#333"
:active-item-style="{
'color':'#333'
}"
:bold="false"
@change="dianji"></u-tabs>
</view> </view>
<view class="sosuo"></view> <view class="sosuo"></view>
</view> </view>
<swiper class="card"> <swiper class="card" @change="dianji" :current="num">
<swiper-item> <swiper-item>
<scroll-view style="width:100%;height:100%" scroll-y="true"> <scroll-view style="width:100%;height:100%" scroll-y="true">
<view class="box"> <view class="box">
@ -93,29 +100,12 @@
.sosuo{ .sosuo{
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
} }
.tabs{ .tabs{
display: flex; width: 334rpx;
width: 294upx; /deep/ .u-tab-item{
justify-content: space-between;
>view{
font-size: 36upx;
color: #333;
font-weight: bold; font-weight: bold;
position: relative;
}
>view::before{
content: "";
display: block;
position: absolute;
background-color: #FF780F;
width: 0;
height: 4rpx;
bottom: -10rpx;
left: 25%;
}
.xuanzhong::before{
width: 50%;
} }
} }
} }
@ -179,7 +169,16 @@ export default {
name:"index", name:"index",
data(){ data(){
return { return {
list:[
{
name: '发现'
}, {
name: '直播'
}, {
name: '关注'
}
],
num:0
} }
}, },
components:{ components:{
@ -187,6 +186,16 @@ export default {
zhiboItem, zhiboItem,
indexad, indexad,
darenItem darenItem
},
methods:{
dianji(a){
console.log(a)
if(typeof a == "object"){
this.num = a.detail.current
}else{
this.num = a
}
}
} }
} }
</script> </script>