File tree Expand file tree Collapse file tree 4 files changed +86
-3
lines changed
Expand file tree Collapse file tree 4 files changed +86
-3
lines changed Original file line number Diff line number Diff line change 11Page ( {
22 data : {
33 bIsReady : false , // 页面是否准备就绪
4+ nActiveTabIndex : 0 ,
45 aTabBar : [
56 {
67 active : true ,
@@ -20,6 +21,13 @@ Page({
2021 this . fnGetUserProfile ( options . name ) ;
2122 }
2223 } ,
24+ // 点击切换tab
25+ fnClickSwitchTab ( e ) {
26+ let oDataSet = e . currentTarget . dataset ;
27+ this . setData ( {
28+ nActiveTabIndex : oDataSet . index
29+ } ) ;
30+ } ,
2331 // 获取用户资料
2432 fnGetUserProfile ( sUserName ) {
2533 // 显示标题栏加载效果
Original file line number Diff line number Diff line change 1313 <view class="user-activity-wrap">
1414 <!-- tabbar -->
1515 <view class="tabbar-wrap ta-c">
16- <view class="tab {{item.active ? 'tab-active color-white' : 'color-grey'}}" wx:for="{{aTabBar}}" wx:key="{{index}}">
16+ <view
17+ class="tab {{index === nActiveTabIndex ? 'tab-active color-white' : 'color-grey'}}"
18+ wx:for="{{aTabBar}}"
19+ wx:key="{{index}}"
20+ data-index="{{index}}"
21+ bindtap="fnClickSwitchTab"
22+ >
1723 <view>{{item.text}}</view>
1824 </view>
1925 </view>
20- <!-- TODO: tab对应的列表 -->
26+ <!-- 最近回复列表 -->
27+ <block wx:if="{{nActiveTabIndex === 0}}">
28+ <view class="recent-reply-list" >
29+ <!-- TODO: 点击头像跳转用户资料页,点击文字跳转话题详情 -->
30+ <view class="reply-item" wx:for="{{oUserProfile.recent_replies}}" wx:key="{{index}}">
31+ <image class="reply-left inbl vtal-top rounded-p50" src="{{item.author.avatar_url}}"/>
32+ <view class="reply-right inbl vtal-top">
33+ <view class="reply-topic-title text-ellipsis">{{item.title}}</view>
34+ <view class="clf color-grey">
35+ <view class="fl-left">{{item.author.loginname}}</view>
36+ <view class="fl-right">{{item.last_reply_at}}</view>
37+ </view>
38+ </view>
39+ </view>
40+ </view>
41+ </block>
42+ <!-- TODO: 最新发布列表 -->
43+ <block wx:elif="{{nActiveTabIndex === 1}}">
44+ <view class="recent-topic-list ta-c">
45+ <view>敬请期待</view>
46+ </view>
47+ </block>
48+ <!-- TODO: 话题收藏列表 -->
49+ <block wx:elif="{{nActiveTabIndex === 2}}">
50+ <view class="topic-collection-list ta-c">
51+ <view>敬请期待</view>
52+ </view>
53+ </block>
2154 </view>
2255</view>
Original file line number Diff line number Diff line change 2828 height: 100rpx;
2929 line-height: 100rpx;
3030 font-size: 28rpx;
31+ border-bottom: 6rpx solid #2e3331;
32+ box-sizing: border-box;
3133}
3234.tabbar-wrap .tab.tab-active {
33- border-bottom: 6rpx solid #80bd01;
35+ border-color: #80bd01;
36+ }
37+ /* 最近回复列表 */
38+ .recent-reply-list {
39+ padding: 30rpx 20rpx;
40+ }
41+ .reply-item {
42+ padding: 30rpx;
43+ margin-bottom: 10rpx;
44+ /* border-bottom: 0.01rem solid #7c7c7c; */
45+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
46+ border-radius: 8rpx;
47+ }
48+ .reply-left {
49+ width: 100rpx;
50+ height: 100rpx;
51+ }
52+ .reply-right {
53+ width: 520rpx;
54+ margin-left: 30rpx;
55+ font-size: 28rpx;
56+ }
57+ .reply-topic-title {
58+ margin-bottom: 20rpx;
59+ font-size: 32rpx;
60+ }
61+ /* 最近话题列表 */
62+ .recent-topic-list {
63+ padding: 30rpx 20rpx;
64+ font-size: 28rpx;
65+ }
66+ /* 话题收藏列表 */
67+ .topic-collection-list {
68+ padding: 30rpx 20rpx;
69+ font-size: 28rpx;
3470}
Original file line number Diff line number Diff line change 7777.color-green {
7878 color: #80bd01;
7979}
80+ /* 文本溢出隐藏 */
81+ .text-ellipsis {
82+ overflow: hidden;
83+ text-overflow: ellipsis;
84+ white-space: nowrap;
85+ }
8086/* 谈入谈出 */
8187.fadein-init {
8288 opacity: 0;
You can’t perform that action at this time.
0 commit comments