Commit c7556e20 by 杨北旺

攻略专区添加攻略分类

1 parent 30fb72d1
......@@ -6,6 +6,9 @@ Page({
*/
data: {
strategyList: [],
categoryList:[1,2,3,4,5,6,7,8,9,10],
currentCateIndex:0,
toCate:'to-0'
},
/**
......@@ -16,12 +19,19 @@ Page({
this.shareTitle = "攻略专区"
},
navbarReady(e) {
let {
height
} = e.detail
// navbarReady(e) {
// let {
// height
// } = e.detail
// this.setData({
// user_box_style: `padding-top:${height + 15}px`
// })
// },
selectCate(e){
const {index} = e.currentTarget.dataset
this.setData({
user_box_style: `padding-top:${height + 15}px`
currentCateIndex:index,
toCate:`to-${index}`
})
},
......
{
"navigationStyle": "custom",
"usingComponents": {}
"usingComponents": {},
"navigationBarTitleText": "攻略专区"
}
\ No newline at end of file
......@@ -11,6 +11,46 @@
padding: 30rpx;
background: #F8F8F8;
.category_wrap {
width: 100%;
margin-bottom: 30rpx;
overflow: hidden;
white-space: nowrap;
.cate_itm {
display: inline-block;
margin-right: 60rpx;
position: relative;
.cate_text {
font-weight: 400;
font-size: 32rpx;
color: #333333;
}
.cate_text_active {
font-weight: 600;
font-size: 36rpx;
color: #333333;
}
.cate_active_line {
width: 144rpx;
height: 12rpx;
background-image: linear-gradient(90deg, #61a5ff00 0%, #2699FD 100%);
border-radius: 6rpx;
position: absolute;
right: 0rpx;
bottom: 0rpx;
}
}
.cate_itm:last-child {
margin-right: 0;
}
}
.strategy-item {
width: 690rpx;
background: #ffffff;
......
<view class="navigation-bar">
<!-- <view class="navigation-bar">
<navigation-bar bindnavbarReady="navbarReady" page-title="攻略专区">攻略专区</navigation-bar>
</view>
<view class="strategy-box" style="{{user_box_style}}">
</view> -->
<view class="strategy-box">
<view class="category_wrap">
<scroll-view scroll-into-view="{{toCate}}" enhanced scroll-with-animation scroll-x show-scrollbar="{{false}}">
<block wx:for="{{categoryList}}" wx:key="index">
<view id="to-{{index}}" class="cate_itm" bind:tap="selectCate" data-index="{{index}}">
<view class="cate_text {{currentCateIndex==index?'cate_text_active':''}}">攻略分类</view>
<view wx:if="{{currentCateIndex==index}}" class="cate_active_line"></view>
</view>
</block>
</scroll-view>
</view>
<view class="strategy-item" wx:for="{{strategyList}}" wx:key="index" data-item="{{item}}" bind:tap="selectStrategy">
<image mode="aspectFill" webp src="{{item.strategyImg}}" class="strategy-img"></image>
<view class="strategy-detail">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!