Commit b4c8bf43 by 高淑倩

add: 首页分类

parent 2fd0a794
......@@ -10,7 +10,10 @@ Component({
* 组件的属性列表
*/
properties: {
categorys:{
type: Array,
value: []
}
},
attached() {
......@@ -19,35 +22,7 @@ Component({
* 组件的初始数据
*/
data: {
currentTab: 0,
navData: [{
label: '分类1'
},
{
label: '分类2'
},
{
label: '分类3'
},
{
label: '分类4'
},
{
label: '分类5'
},
{
label: '分类6'
},
{
label: '分类7'
},
{
label: '分类8'
},
{
label: '分类9'
}
]
currentTab: 0
},
/**
* 组件的方法列表
......@@ -57,6 +32,8 @@ Component({
switchNav(event) {
const ev = event.currentTarget.dataset;
let cur = ev.current
let redirectid = ev.redirectid
console.log('redirectid', redirectid)
if (this.data.currentTab == cur) {
return false
} else {
......
<!--component/tabSort/tabSort.wxml-->
<view class="tab-sort" wx:if="{{navData}}">
<view class="tab-sort" wx:if="{{categorys}}">
<scroll-view scroll-x class="scroll-view_H" scroll-with-animation="{{true}}">
<block
wx:for="{{navData}}"
wx:for="{{categorys}}"
wx:for-index="idx"
wx:for-item="navItem"
wx:key="idx"
......@@ -11,13 +11,10 @@
class="scroll-view-item {{currentTab == idx ?'active':''}}"
style="width:{{navItemWidth}}%"
data-current="{{idx}}"
data-startTimeStr="{{navItem.startTimeStr}}"
data-endTimeStr="{{navItem.endTimeStr}}"
data-btnText="{{navItem.buttonText}}"
data-id="{{navItem.id}}"
data-redirectId ="{{navItem.redirectId}}"
bindtap="switchNav"
>
<view>{{navItem.label}}</view>
<view>{{navItem.title}}</view>
</view>
</block>
</scroll-view>
......@@ -34,7 +31,7 @@
bindchange="switchTab"
>
<swiper-item
wx:for="{{navData}}"
wx:for="{{categorys}}"
wx:for-item="navItem"
wx:for-index="idx"
wx:key="idx"
......
......@@ -27,7 +27,7 @@ wxService.page({
baseUserInfo: null,
// cardMember: null,
pageBackgroundColor: 0,
guidePageModalShow:true
guidePageModalShow: false
},
/**
* 生命周期函数--监听页面加载
......
<!--pages/userCenter.wxml-->
<view class='user-center' style="background: {{pageBackgroundColor == 1? '#eee': '#fff'}};min-height: {{outoHeigth}}px">
<!-- 1 轮播 2 个人中心 3 图片导航 4 底部-->
<!-- 分类Tab -->
<tab-sort/>
<view class="page-bgc">
<!-- 轮播 -->
<!-- 1 轮播 2 个人中心 3 图片导航 4 底部左划 5 底部 Tab 6 公告 7 分类 8 关注公众号 9 plus(9/5-权重高)-->
<block wx:for="{{pages}}" wx:key="{{index}}" wx:for-item="pItem">
{{pItem.type}}
<view wx:if="{{pItem.type == 1}}">
<image-swiper/>
</view>
<view class="" wx:if="{{pItem.type == 2}}">
<person-center/>
</view>
<view class="" wx:if="{{pItem.type == 3}}">
<pic-nav/>
</view>
<view class="" wx:if="{{pItem.type == 4}}">
<bottom />
</view>
<view class="" wx:if="{{pItem.type == 5}}">
<bottom-tabs/>
</view>
<view class="" wx:if="{{pItem.type == 6}}">
<announcement/>
</view>
<view class="" wx:if="{{pItem.type == 7}}">
<tab-sort categorys="{{pItem.categoryType.categorys}}"/>
</view>
<view class="" wx:if="{{pItem.type == 8}}">
<attention/>
</view>
<view class="" wx:if="{{pItem.type == 9}}">
<attention/>
</view>
</block>
<!--
<tab-sort/>
<view class="page-bgc">
<image-swiper/>
<!--公告-->
<announcement/>
<!-- 导航图标 -->
<icon-swiper/>
<!-- 图片导航 -->
<pic-nav/>
</view>
<view class="person-hot border_box">
......@@ -18,14 +53,14 @@
<span class="hot border_box">HOT -</span>
</view>
<!-- 商品活动 人气hot -->
<hot-item/>
<!-- 关注 -->
<attention/>
<!-- 图片广告 -->
<bannerAd/>
<bannerAd/>-->
<!-- <block wx:for="{{pages}}" wx:key="{{index}}" wx:for-item="pItem">
<view class="pd1530" wx:if="{{pItem.type == 1}}">
......@@ -52,4 +87,4 @@
<!--<authorization-modal isAuthorization='{{isAuthorization}}' />-->
<guide-page-modal show="{{guidePageModalShow}}" />
<bottom-tabs />
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment