Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高淑倩
7-Eleven
Commits
b4c8bf43
Commit
b4c8bf43
authored
Aug 28, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: 首页分类
parent
2fd0a794
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
53 deletions
+62
-53
tabSort.js
src/component/tabSort/tabSort.js
+8
-31
tabSort.wxml
src/component/tabSort/tabSort.wxml
+5
-8
userCenter.js
src/pages/userCenter/userCenter.js
+1
-1
userCenter.wxml
src/pages/userCenter/userCenter.wxml
+48
-13
No files found.
src/component/tabSort/tabSort.js
View file @
b4c8bf43
...
...
@@ -10,44 +10,19 @@ Component({
* 组件的属性列表
*/
properties
:
{
categorys
:{
type
:
Array
,
value
:
[]
}
},
attached
()
{
},
/**
* 组件的初始数据
*/
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
{
...
...
src/component/tabSort/tabSort.wxml
View file @
b4c8bf43
<!--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"
...
...
src/pages/userCenter/userCenter.js
View file @
b4c8bf43
...
...
@@ -27,7 +27,7 @@ wxService.page({
baseUserInfo
:
null
,
// cardMember: null,
pageBackgroundColor
:
0
,
guidePageModalShow
:
tru
e
guidePageModalShow
:
fals
e
},
/**
* 生命周期函数--监听页面加载
...
...
src/pages/userCenter/userCenter.wxml
View file @
b4c8bf43
<!--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 />
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment