Browse Source

志愿先锋增加详情页;志愿团队调整样式;

master
ZhaoTongYao 4 years ago
parent
commit
e725f953a7
  1. 3
      app.json
  2. 4
      pages/heartNew/heartNew.wxml
  3. 29
      subpages/heart/pages/leaderboardDetail/leaderboardDetail.js
  4. 6
      subpages/heart/pages/leaderboardDetail/leaderboardDetail.json
  5. 3
      subpages/heart/pages/leaderboardDetail/leaderboardDetail.wxml
  6. 4
      subpages/heart/pages/leaderboardDetail/leaderboardDetail.wxss
  7. 12
      subpages/heart/pages/leaderboardNew/leaderboardNew.js
  8. 8
      subpages/heart/pages/leaderboardNew/leaderboardNew.wxml
  9. 38
      subpages/heart/pages/teamIntroduction/teamIntroduction.js
  10. 17
      subpages/heart/pages/teamIntroduction/teamIntroduction.wxml
  11. 53
      subpages/heart/pages/teamIntroduction/teamIntroduction.wxss
  12. 6
      subpages/heart/pages/volunteerTeam/volunteerTeam.js

3
app.json

@ -67,7 +67,8 @@
"pages/allianceList/allianceList", "pages/allianceList/allianceList",
"pages/volunteerTeam/volunteerTeam", "pages/volunteerTeam/volunteerTeam",
"pages/teamIntroduction/teamIntroduction", "pages/teamIntroduction/teamIntroduction",
"pages/allianceDetail/allianceDetail" "pages/allianceDetail/allianceDetail",
"pages/leaderboardDetail/leaderboardDetail"
] ]
}, },
{ {

4
pages/heartNew/heartNew.wxml

@ -56,13 +56,13 @@
</view> </view>
<view class="tab-left"> <view class="tab-left">
<view class="tab" wx:for="{{tabLeftList}}" wx:key="index" data-title="{{item.remark}}" data-code="{{item.imgCode||item.categoryCode}}" bindtap="toJumpPage"> <view class="tab" wx:for="{{tabLeftList}}" wx:key="index" data-title="{{item.remark}}" data-code="{{item.imgCode||item.categoryCode}}" bindtap="toJumpPage">
<image src="{{item.imgUrl}}" class="{{item.imgCode == 'ptg' || item.imgCode == 'sds' ? 'image-big' : 'image-small'}}"/> <image src="{{item.imgUrl}}" class="image-small"/>
<view class="tab-text"></view> <view class="tab-text"></view>
</view> </view>
</view> </view>
<view class="tab-right"> <view class="tab-right">
<view class="tab" wx:for="{{tabRightList}}" wx:key="index" data-title="{{item.remark}}" data-code="{{item.imgCode||item.categoryCode}}" bindtap="toJumpPage"> <view class="tab" wx:for="{{tabRightList}}" wx:key="index" data-title="{{item.remark}}" data-code="{{item.imgCode||item.categoryCode}}" bindtap="toJumpPage">
<image src="{{item.imgUrl}}" class="{{item.imgCode == 'ptg' || item.imgCode == 'sds' ? 'image-big' : 'image-small'}}"/> <image src="{{item.imgUrl}}" class="image-small"/>
<view class="tab-text"></view> <view class="tab-text"></view>
</view> </view>
</view> </view>

29
subpages/heart/pages/leaderboardDetail/leaderboardDetail.js

@ -0,0 +1,29 @@
Page({
data: {
noticeObj: '',
noticeObjContent: ''
},
onLoad: function (options) {
if (options.name) {
wx.setNavigationBarTitle({
title: options.name
})
}
this.getVolunteerPioneerDetail()
},
onUnload () {
wx.removeStorage({
key: 'pioneerDetail',
success (res) {
console.log(res)
}
})
},
// 获取详情
getVolunteerPioneerDetail() {
let html = wx.getStorageSync('pioneerDetail')
this.setData({
noticeObjContent: html
})
}
})

6
subpages/heart/pages/leaderboardDetail/leaderboardDetail.json

@ -0,0 +1,6 @@
{
"navigationBarTitleText": "",
"usingComponents": {
"parser": "../../../../components/parser/parser"
}
}

3
subpages/heart/pages/leaderboardDetail/leaderboardDetail.wxml

@ -0,0 +1,3 @@
<view class="alliance-detail">
<parser html="{{noticeObjContent}}"></parser>
</view>

4
subpages/heart/pages/leaderboardDetail/leaderboardDetail.wxss

@ -0,0 +1,4 @@
.alliance-detail {
padding: 20rpx;
box-sizing: border-box;
}

12
subpages/heart/pages/leaderboardNew/leaderboardNew.js

@ -337,11 +337,13 @@ Page({
} }
}, },
/** // 跳转志愿先锋详情
* 用户点击右上角分享 toLeaderboardDetail (e) {
*/ wx.removeStorage('pioneerDetail')
onShareAppMessage: function () { wx.setStorageSync('pioneerDetail', e.currentTarget.dataset.html)
wx.navigateTo({
url: `../leaderboardDetail/leaderboardDetail?name=${e.currentTarget.dataset.name}`
})
}, },
//选择排序列 //选择排序列

8
subpages/heart/pages/leaderboardNew/leaderboardNew.wxml

@ -22,19 +22,19 @@
<view class="pioneer-list"> <view class="pioneer-list">
<view class="list-left"> <view class="list-left">
<block wx:for="{{pioneerList}}" wx:key="index"> <block wx:for="{{pioneerList}}" wx:key="index">
<view class="pioneer-item" wx:if="{{index % 2 == 0}}"> <view class="pioneer-item" wx:if="{{index % 2 == 0}}" bindtap="toLeaderboardDetail" data-html="{{item.content}}" data-name="{{item.realName}}">
<image class="pioneer-img" src="{{item.imgUrl}}" /> <image class="pioneer-img" src="{{item.imgUrl}}" />
<view class="pioneer-name">{{item.realName}}</view> <view class="pioneer-name">{{item.realName}}</view>
<view class="pioneer-intro">{{filter.getHtmlContent(item.content)}}</view> <!-- <view class="pioneer-intro">{{filter.getHtmlContent(item.content)}}</view> -->
</view> </view>
</block> </block>
</view> </view>
<view class="list-right"> <view class="list-right">
<block wx:for="{{pioneerList}}" wx:key="index"> <block wx:for="{{pioneerList}}" wx:key="index">
<view class="pioneer-item" wx:if="{{index % 2 == 1}}"> <view class="pioneer-item" wx:if="{{index % 2 == 1}}" bindtap="toLeaderboardDetail" data-html="{{item.content}}" data-name="{{item.realName}}">
<image class="pioneer-img" src="{{item.imgUrl}}" /> <image class="pioneer-img" src="{{item.imgUrl}}" />
<view class="pioneer-name">{{item.realName}}</view> <view class="pioneer-name">{{item.realName}}</view>
<view class="pioneer-intro">{{filter.getHtmlContent(item.content)}}</view> <!-- <view class="pioneer-intro">{{filter.getHtmlContent(item.content)}}</view> -->
</view> </view>
</block> </block>
</view> </view>

38
subpages/heart/pages/teamIntroduction/teamIntroduction.js

@ -18,6 +18,10 @@ Page({
dialogContent: "", dialogContent: "",
dialogConfirmText: "", dialogConfirmText: "",
dialogCancelText: "", dialogCancelText: "",
content: '',
shortContent: '',
isShowAll: true, // 是否显示全部内容
isShowButton: false, // 是否显示 展开-收起 按钮
}, },
onLoad: function (options) { onLoad: function (options) {
this.setData({ this.setData({
@ -30,6 +34,12 @@ Page({
}) })
this.getAppTeamDetail() this.getAppTeamDetail()
} }
if (this.data.selectTab == 'tab1') {
this.setData({
list: [],
})
this.getTeamVolunteerList()
} else {
let params = { let params = {
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
@ -40,9 +50,15 @@ Page({
teamId: this.data.teamId teamId: this.data.teamId
} }
this.selectComponent("#state-0").getActivityList(params) this.selectComponent("#state-0").getActivityList(params)
}
}, },
onShow: function () { onShow: function () {
},
onUnload: function () {
this.setData({
isShowAll: false
})
}, },
onReachBottom: function () { onReachBottom: function () {
this.setData({ this.setData({
@ -125,7 +141,7 @@ Page({
pageIndex: 1 pageIndex: 1
}) })
if (e.currentTarget.dataset.tab == "tab1") { if (e.currentTarget.dataset.tab == "tab2") {
this.setData({ this.setData({
list: [], list: [],
nodata: false nodata: false
@ -164,11 +180,29 @@ Page({
// 团队详情 // 团队详情
getAppTeamDetail () { getAppTeamDetail () {
api.getAppTeamDetail({ id: this.data.teamId }).then(res => { api.getAppTeamDetail({ id: this.data.teamId }).then(res => {
let html = res.data.content.replace(/<\/?.+?>/g, '').replace(/[&nbsp;]/g, '')
this.setData({
teamDetail: res.data,
content: html
}, () => {
let query = wx.createSelectorQuery().in(this)
query.select('.top-text-desc').boundingClientRect()
query.exec(res => {
// console.log(res[0].height)
this.setData({ this.setData({
teamDetail: res.data isShowButton: res[0].height > 70,
shortContent: res[0].height > 70 ? this.data.content.substring(0, 62) : this.data.content,
isShowAll: !this.data.isShowAll
})
})
}) })
}) })
}, },
showAll () {
this.setData({
isShowAll: !this.data.isShowAll
})
},
// 团队成员列表 // 团队成员列表
// 获取团队列表 // 获取团队列表

17
subpages/heart/pages/teamIntroduction/teamIntroduction.wxml

@ -10,25 +10,28 @@
</view> </view>
</view> </view>
</view> </view>
<view class="top" style="margin-top: {{statusHeight + navigationHeight}}px"> <view class="top" style="margin-top: {{statusHeight + navigationHeight}}px; height: {{ isShowAll ? 'auto' : '320rpx' }};">
<view class="top-bg">
<image class="top-bg-img" src="../../images/team-top-bg.png" /> <image class="top-bg-img" src="../../images/team-top-bg.png" />
<image class="top-button" src="../../images/join-team.png" bindtap="joinTeam" wx:if="{{!teamDetail.joinFlag}}"/>
<view class="top-text"> <view class="top-text">
<view class="top-text-title">{{teamDetail.teamName}}</view> <view class="top-text-title">{{teamDetail.teamName}}</view>
<view class="top-text-desc">{{filter.getHtmlContent(teamDetail.content)}}</view> <view class="top-text-desc" wx:if="{{isShowAll}}">{{content}}
<text class="show-all" bindtap="showAll" wx:if="{{isShowButton}}">{{'<< 收起'}}</text>
</view>
<view class="top-text-desc" wx:else>{{shortContent}}
<text class="show-all" bindtap="showAll" wx:if="{{isShowButton}}">{{'... 展开'}}</text>
</view> </view>
<image class="top-button" src="../../images/join-team.png" bindtap="joinTeam" wx:if="{{!teamDetail.joinFlag}}"/>
</view> </view>
</view> </view>
<view class="content"> <view class="content">
<!-- tabbar --> <!-- tabbar -->
<view class="tab-bar"> <view class="tab-bar">
<view class="tab tab1 {{selectTab === 'tab1' ? 'select-tab' : ''}}" data-tab="tab1" bindtap="onTabChange">团队活动</view> <view class="tab tab1 {{selectTab === 'tab1' ? 'select-tab' : ''}}" data-tab="tab1" bindtap="onTabChange">团队成员</view>
<view class="tab tab2 {{selectTab === 'tab2' ? 'select-tab' : ''}}" data-tab="tab2" bindtap="onTabChange">团队成员</view> <view class="tab tab2 {{selectTab === 'tab2' ? 'select-tab' : ''}}" data-tab="tab2" bindtap="onTabChange">团队活动</view>
<view class="select-bar {{selectTab}}"></view> <view class="select-bar {{selectTab}}"></view>
</view> </view>
<view class="team-active-list" wx:if="{{selectTab === 'tab1'}}"> <view class="team-active-list" wx:if="{{selectTab === 'tab2'}}">
<activity bind:toActDetail="toActDetailDown" id="state-0" state="0"></activity> <activity bind:toActDetail="toActDetailDown" id="state-0" state="0"></activity>
</view> </view>
<view class="team-member-list" wx:else> <view class="team-member-list" wx:else>

53
subpages/heart/pages/teamIntroduction/teamIntroduction.wxss

@ -47,52 +47,47 @@ page {
/* 自定义标题栏 end */ /* 自定义标题栏 end */
.top { .top {
width: 100%; width: 100%;
} height: 320rpx;
.top-bg {
width: 100%;
height: 280rpx;
box-sizing: border-box;
padding-top: 16rpx;
position: relative; position: relative;
} }
.top-bg .top-bg-img { .top .show-all {
/* background-image: linear-gradient(135deg, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0.6) 75%, rgba(255, 255, 255, 1) 100%); */
/* background-size: 100% 100%; */
color: #9abded;
}
.top .top-bg-img {
position: absolute;
width: 100%; width: 100%;
height: 110%; height: 110%;
position: absolute; z-index: -1;
top: 0;
left: 0;
} }
.top-bg .top-text { .top-text {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 10;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: flex-start;
justify-content: center; justify-content: flex-start;
padding: 0 30rpx; padding: 0 30rpx 20rpx;
box-sizing: border-box;
} }
.top-bg .top-text .top-text-title { .top-text .top-text-title {
width: 690rpx;
font-size: 52rpx; font-size: 52rpx;
color: #ffffff; color: #ffffff;
margin-bottom: 48rpx; margin: 18rpx 0;
height: 136rpx;
display: flex;
align-items: center;
justify-content: center;
} }
.top-bg .top-text .top-text-desc { .top-text .top-text-desc {
width: 690rpx;
font-size: 30rpx; font-size: 30rpx;
color: #ffffff; color: #ffffff;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; line-height: 40rpx;
word-wrap:break-word;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
display: -webkit-box;
} }
.top-bg .top-button { .top-button {
width: 140rpx; width: 140rpx;
height: 60rpx; height: 60rpx;
position: absolute; position: absolute;

6
subpages/heart/pages/volunteerTeam/volunteerTeam.js

@ -14,9 +14,6 @@ Page({
typeCode: '', // 当前类别code typeCode: '', // 当前类别code
}, },
onLoad: function (options) { onLoad: function (options) {
},
onShow: function () {
this.setData({ this.setData({
pageIndex: 1, pageIndex: 1,
volunteerTeamList: [] volunteerTeamList: []
@ -37,6 +34,9 @@ Page({
} }
}) })
},
onShow: function () {
}, },
onReachBottom: function () { onReachBottom: function () {
this.setData({ this.setData({

Loading…
Cancel
Save