Browse Source

志愿团队

master
ZhaoTongYao 4 years ago
parent
commit
9026ca67e4
  1. 6
      app.json
  2. 8
      pages/heartNew/heartNew.js
  3. BIN
      subpages/heart/images/join-team.png
  4. BIN
      subpages/heart/images/team-top-bar.png
  5. BIN
      subpages/heart/images/team-top-bg.png
  6. 23
      subpages/heart/pages/allianceDetail/allianceDetail.js
  7. 6
      subpages/heart/pages/allianceDetail/allianceDetail.json
  8. 3
      subpages/heart/pages/allianceDetail/allianceDetail.wxml
  9. 4
      subpages/heart/pages/allianceDetail/allianceDetail.wxss
  10. 67
      subpages/heart/pages/allianceList/allianceList.js
  11. 7
      subpages/heart/pages/allianceList/allianceList.json
  12. 13
      subpages/heart/pages/allianceList/allianceList.wxml
  13. 37
      subpages/heart/pages/allianceList/allianceList.wxss
  14. 41
      subpages/heart/pages/leaderboardNew/leaderboardNew.js
  15. 30
      subpages/heart/pages/leaderboardNew/leaderboardNew.wxml
  16. 54
      subpages/heart/pages/leaderboardNew/leaderboardNew.wxss
  17. 205
      subpages/heart/pages/teamIntroduction/teamIntroduction.js
  18. 11
      subpages/heart/pages/teamIntroduction/teamIntroduction.json
  19. 62
      subpages/heart/pages/teamIntroduction/teamIntroduction.wxml
  20. 193
      subpages/heart/pages/teamIntroduction/teamIntroduction.wxss
  21. 143
      subpages/heart/pages/volunteer/volunteer.js
  22. 38
      subpages/heart/pages/volunteer/volunteer.wxml
  23. 142
      subpages/heart/pages/volunteerTeam/volunteerTeam.js
  24. 7
      subpages/heart/pages/volunteerTeam/volunteerTeam.json
  25. 32
      subpages/heart/pages/volunteerTeam/volunteerTeam.wxml
  26. 91
      subpages/heart/pages/volunteerTeam/volunteerTeam.wxss
  27. 57
      subpages/heart/utils/api.js
  28. 8
      utils/activity.js
  29. 9
      utils/api.js
  30. 7
      utils/filter.wxs
  31. 29
      utils/heartBehavior.js

6
app.json

@ -63,7 +63,11 @@
"pages/dropByPublish/dropByPublish",
"pages/noticeNewDetail/noticeNewDetail",
"pages/noticeNewList/noticeNewList",
"pages/scanCodeSignin/scanCodeSignin"
"pages/scanCodeSignin/scanCodeSignin",
"pages/allianceList/allianceList",
"pages/volunteerTeam/volunteerTeam",
"pages/teamIntroduction/teamIntroduction",
"pages/allianceDetail/allianceDetail"
]
},
{

8
pages/heartNew/heartNew.js

@ -547,6 +547,14 @@ Page({
wx.navigateTo({
url: `/subpages/heart/pages/dropByList/dropByList?title=${e.currentTarget.dataset.title}`
})
} else if (e.currentTarget.dataset.code == 'zyzqn_zytd') {
wx.navigateTo({
url: `/subpages/heart/pages/volunteerTeam/volunteerTeam`
})
} else if (e.currentTarget.dataset.code == 'zyzqn_gjlm') {
wx.navigateTo({
url: `/subpages/heart/pages/allianceList/allianceList`
})
} else if (e.currentTarget.dataset.code == 'volunteer_sqfd') {
this.myApply()
} else if (e.currentTarget.dataset.code == 'shouye') {

BIN
subpages/heart/images/join-team.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
subpages/heart/images/team-top-bar.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
subpages/heart/images/team-top-bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

23
subpages/heart/pages/allianceDetail/allianceDetail.js

@ -0,0 +1,23 @@
const api = require("../../utils/api")
import util from "../../../../utils/util"
Page({
data: {
noticeObj: '',
noticeObjContent: ''
},
onLoad: function (options) {
if (options.id) {
this.getVolunteerUnionDetail(options.id)
}
},
getVolunteerUnionDetail (id) {
api.getVolunteerUnionDetail({ id }).then(res => {
this.setData({
noticeObj: res.data,
noticeObjContent: util.formatRichText(res.data.content)
})
}).catch(err => {
console.log(err)
})
}
})

6
subpages/heart/pages/allianceDetail/allianceDetail.json

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

3
subpages/heart/pages/allianceDetail/allianceDetail.wxml

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

4
subpages/heart/pages/allianceDetail/allianceDetail.wxss

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

67
subpages/heart/pages/allianceList/allianceList.js

@ -0,0 +1,67 @@
const api = require("../../utils/api")
Page({
data: {
pageIndex: 1,
pageSize: 10,
nodata: false,
loadMoreType: 'none',
loadMoreVisible: false,
allianceList: [], // 联盟列表
},
onLoad: function (options) {
this.setData({
pageIndex: 1,
dropbylist: []
})
this.getVolunteerUnionList()
},
onReachBottom: function () {
this.setData({
loadMoreVisible: true
})
if (this.data.loadMoreType === "loading") {
this.setData({
pageIndex: this.data.pageIndex + 1
})
this.getVolunteerUnionList()
}
},
// 前往联盟详情
toAllianceDetail (e) {
let id = e.currentTarget.dataset.id
wx.navigateTo({
url: `../allianceDetail/allianceDetail?id=${id}`
})
},
//
getVolunteerUnionList () {
const para = {
pageIndex: this.data.pageIndex,
pageSize: this.data.pageSize
}
api.getVolunteerUnionList(para).then(res => {
console.log(res)
this.setData({
allianceList: [...this.data.allianceList,...res.data],
loadMoreType: res.data.length === this.data.pageSize ? 'loading' : 'none',
loadMoreVisible: res.data.length === this.data.pageSize ? false : true,
nodata: false,
})
if (this.data.allianceList.length == 0) {
this.setData({
nodata: true,
loadMoreType: 'none',
loadMoreVisible: false,
})
}
}).catch(err => {
this.setData({
allianceList: [],
nodata: true,
loadMoreType: 'none',
loadMoreVisible: false,
})
console.log(err)
})
},
})

7
subpages/heart/pages/allianceList/allianceList.json

@ -0,0 +1,7 @@
{
"navigationBarTitleText": "共建联盟",
"usingComponents": {
"load-more": "/components/loadMore/loadMore",
"no-data": "/components/nodata/nodata"
}
}

13
subpages/heart/pages/allianceList/allianceList.wxml

@ -0,0 +1,13 @@
<view class="alliance-list">
<block wx:for="{{allianceList}}" wx:key="index">
<view class="alliance-item" bindtap="toAllianceDetail" data-id="{{item.id}}">
<view class="alliance-title">{{item.unionName}}</view>
<image class="alliance-icon" src="../../images/ic_jinruxiayiye@2x.png"/>
</view>
<view class="list-line" wx:if="{{index < allianceList.length - 1}}"></view>
</block>
</view>
<load-more loadMoreType="{{loadMoreType}}" loadMoreVisible="{{loadMoreVisible}}"></load-more>
<no-data isShow="{{nodata}}"></no-data>

37
subpages/heart/pages/allianceList/allianceList.wxss

@ -0,0 +1,37 @@
page {
background-color: #f7f7f7;
}
.alliance-list {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: #fff;
margin-top: 20rpx;
}
.alliance-list .alliance-item {
width: 690rpx;
height: 110rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.alliance-list .alliance-item .alliance-title {
width: 650rpx;
font-size: 34rpx;
color: #333333;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
.alliance-list .alliance-item .alliance-icon {
width: 22rpx;
height: 22rpx;
}
.alliance-list .list-line {
width: 690rpx;
height: 1px;
background-color: #eeeeee;
border-radius: 1px;
opacity: 0.5;
}

41
subpages/heart/pages/leaderboardNew/leaderboardNew.js

@ -62,7 +62,8 @@ Page({
id: '3',
label: '公益积分记录'
}
]
],
pioneerList: []
},
// tab 切换
onTabChange (e) {
@ -71,12 +72,18 @@ Page({
pageNo: 1
})
if (e.currentTarget.dataset.tab == "tab2") {
if (e.currentTarget.dataset.tab == "tab3") {
this.setData({
jilu: false,
signedList: []
})
this.getSignedList()
} else if (e.currentTarget.dataset.tab == 'tab2') {
this.setData({
jilu: true,
pioneerList: []
})
this.getVolunteerPioneerList()
} else {
this.setData({
jilu: true,
@ -156,12 +163,32 @@ Page({
})
},
// 获取志愿先锋 列表
getVolunteerPioneerList() {
let params = {
pageIndex: this.data.pageNo,
pageSize: this.data.pageSize
}
api.getVolunteerPioneerList(params).then(res => {
this.setData({
pioneerList: [ ...this.data.pioneerList, ...res.data ],
loadMoreType: res.data.length === 10 ? "loading" : "none",
preloadVisible: false
})
}).catch(() => {
this.setData({
pioneerList: [],
loadMoreType: "none",
preloadVisible: false
})
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
if(this.data.selectTab == "tab2"){
if(this.data.selectTab == "tab3"){
this.pulldownRefresh()
}
if (!app.globalData.previewImage) {
@ -214,7 +241,7 @@ Page({
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
onReachBottom: function () {
this.setData({
loadMoreVisible: true
})
@ -222,10 +249,12 @@ Page({
this.setData({
pageNo: this.data.pageNo + 1
})
if(this.data.selectTab == "tab2"){
if(this.data.selectTab == "tab3") {
this.getSignedList()
} else {
} else if(this.data.selectTab == 'tab1') {
this.loadLoveRanking()
} else if(this.data.selectTab == 'tab2') {
this.getVolunteerPioneerList()
}
}
},

30
subpages/heart/pages/leaderboardNew/leaderboardNew.wxml

@ -1,3 +1,4 @@
<wxs module="filter" src="../../../../utils/filter.wxs"></wxs>
<view class="banner" wx:if="{{banner.length > 0}}">
<swiper class="swiper">
<swiper-item class="swiper-item" wx:for="{{banner}}" wx:for-item="item" wx:for-index="index" wx:key="index" wx:if="{{index%2==0&&(index+1)%2==1}}">
@ -10,10 +11,35 @@
<view class="tab-bar">
<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 class="tab tab2 {{selectTab === 'tab2' ? 'select-tab' : ''}}" data-tab="tab2" bindtap="onTabChange">志愿先锋
</view>
<view class="select-bar {{selectTab === 'tab1' ? 'tab1' : 'tab2'}}"></view>
<view class="tab tab3 {{selectTab === 'tab3' ? 'select-tab' : ''}}" data-tab="tab3" bindtap="onTabChange">参与记录
</view>
<view class="select-bar {{selectTab}}"></view>
</view>
<!-- 志愿先锋 -->
<block wx:if="{{selectTab === 'tab2'}}">
<view class="pioneer-list">
<view class="list-left">
<block wx:for="{{pioneerList}}" wx:key="index">
<view class="pioneer-item" wx:if="{{index % 2 == 0}}">
<image class="pioneer-img" src="{{item.imgUrl}}" />
<view class="pioneer-name">{{item.realName}}</view>
<view class="pioneer-intro">{{filter.getHtmlContent(item.content)}}</view>
</view>
</block>
</view>
<view class="list-right">
<block wx:for="{{pioneerList}}" wx:key="index">
<view class="pioneer-item" wx:if="{{index % 2 == 1}}">
<image class="pioneer-img" src="{{item.imgUrl}}" />
<view class="pioneer-name">{{item.realName}}</view>
<view class="pioneer-intro">{{filter.getHtmlContent(item.content)}}</view>
</view>
</block>
</view>
</view>
</block>
<!-- 积分排行 -->
<block wx:if="{{selectTab === 'tab1'}}">
<scroll-view scroll-x="{{true}}" class="scroll-tag">

54
subpages/heart/pages/leaderboardNew/leaderboardNew.wxss

@ -39,15 +39,19 @@ page {
}
.tab-bar .select-bar.tab1 {
left: calc(25% - 15rpx);
left: calc(16% - 15rpx);
transition: left linear 0.4s;
}
.tab-bar .select-bar.tab2 {
left: calc(75% - 15rpx);
left: calc(50% - 15rpx);
transition: left linear 0.4s;
}
.tab-bar .select-bar.tab3 {
left: calc(82% - 15rpx);
transition: left linear 0.4s;
}
/* 参与记录 */
.tab-item {
background: #fff;
@ -342,4 +346,48 @@ button::after {
}
.bottom .list-item-2 .act-desc .option-red {
color: #da433d;
}
}
/* 志愿先锋 start */
.pioneer-list {
display: flex;
padding: 0 25rpx;
}
.pioneer-item {
width: 320rpx;
min-height: 282rpx;
margin: 20rpx 15rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: #fff;
border-radius: 20rpx;
}
.pioneer-item .pioneer-img {
width: 110rpx;
height: 110rpx;
background-color: #909090;
margin-top: 40rpx;
border-radius: 50%;
}
.pioneer-item .pioneer-name {
font-size: 30rpx;
color: #333333;
margin-top: 20rpx;
}
.pioneer-item .pioneer-intro {
font-size: 26rpx;
color: #c1c1c1;
margin: 18rpx 0 36rpx;
width: 85%;
text-align: center;
/* overflow: hidden;
text-overflow: ellipsis;
word-wrap:break-word;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
display: -webkit-box; */
}
/* 志愿先锋 end */

205
subpages/heart/pages/teamIntroduction/teamIntroduction.js

@ -0,0 +1,205 @@
const api = require('../../utils/api')
import { getTimestamp } from "../../../../utils/common"
const app = getApp()
Page({
data: {
statusHeight: 0, // 自定义头部状态栏高度
navigationHeight: 0, // 自定义头部导航栏高度
selectTab: "tab1",
pageIndex: 1,
pageSize: 10,
loadMoreVisible: false,
loadMoreType: "none",
list: [], // 团队成员列表
teamDetail: {},
teamId: '',
dialogVisible: false,
dialogTitle: "",
dialogContent: "",
dialogConfirmText: "",
dialogCancelText: "",
},
onLoad: function (options) {
this.setData({
statusHeight: app.globalData.deviceInfo.statusHeight,
navigationHeight: app.globalData.deviceInfo.navigationHeight
})
if (options.id) {
this.setData({
teamId: options.id
})
this.getAppTeamDetail()
}
let params = {
pageIndex: 1,
pageSize: 10,
timestamp: getTimestamp(),
actType: 0,
qkdat: true,
selectedTab: 'tab0',
teamId: this.data.teamId
}
this.selectComponent("#state-0").getActivityList(params)
},
onShow: function () {
},
onReachBottom: function () {
this.setData({
loadMoreVisible: true
})
if (this.data.loadMoreType === "loading") {
this.setData({
pageIndex: this.data.pageIndex + 1
})
this.getTeamVolunteerList()
}
},
// 返回上一级
goback () {
wx.navigateBack({
delta: 1
})
},
// 志愿者认证
confirmDialog () {
wx.navigateTo({
url: "/subpages/heart/pages/volunteer/volunteer"
})
},
// 加入团队
joinTeam () {
let that = this
api.getVolunteerVerify().then(res => {
if (res.code == 0) {
if (res.data && res.data.id) {
let param = {
volunteerId: this.data.teamDetail.volunteerId,
teamId: this.data.teamId
}
wx.showModal({
content: '请确认加入团队',
confirmColor: '#04BCA0',
success (res) {
if (res.confirm) {
console.log('用户点击确定')
api.joinTeam(param).then(res => {
if (res.code == 0 && res.msg == 'success') {
wx.showToast({
title: '加入成功',
icon: 'none',
durantion: 2000
})
that.getAppTeamDetail()
} else {
wx.showToast({
title: res.msg,
icon: 'none',
durantion: 2000
})
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
} else {
this.setData({
dialogVisible: !this.data.dialogVisible,
dialogTitle: "志愿者认证",
dialogContent: ["是否前往认证志愿者"],
dialogConfirmText: "是",
dialogCancelText: "否"
})
}
}
}).catch(err => {
console.log(err)
})
},
// tab 切换
onTabChange (e) {
this.setData({
selectTab: e.currentTarget.dataset.tab,
pageIndex: 1
})
if (e.currentTarget.dataset.tab == "tab1") {
this.setData({
list: [],
nodata: false
})
let params = {
pageIndex: 1,
pageSize: 10,
timestamp: getTimestamp(),
actType: 0,
qkdat: true,
sponsor: '',
selectedTab: 'tab0',
teamId: this.data.teamId
}
this.selectComponent("#state-0").getActivityList(params)
} else {
this.setData({
list: [],
})
this.getTeamVolunteerList()
}
},
// 通过判断列表的长度断定是否显示加载中
toActDetailDown (e) {
if (e.detail.listLength !== this.data.pageSize) {
this.setData({
loadMoreVisible: true,
loadMoreType: "none",
})
}
this.setData({
actId: e.detail.actId,
listLength: e.detail.listLength
})
},
// 团队详情
getAppTeamDetail () {
api.getAppTeamDetail({ id: this.data.teamId }).then(res => {
this.setData({
teamDetail: res.data
})
})
},
// 团队成员列表
// 获取团队列表
getTeamVolunteerList () {
const para = {
pageIndex: this.data.pageIndex,
pageSize: this.data.pageSize,
id: this.data.teamId
}
api.getTeamVolunteerList(para).then(res => {
this.setData({
list: [...this.data.list,...res.data],
loadMoreType: res.data.length === this.data.pageSize ? 'loading' : 'none',
loadMoreVisible: res.data.length === this.data.pageSize ? false : true,
nodata: false,
})
if (this.data.list.length == 0) {
this.setData({
nodata: true,
loadMoreType: 'none',
loadMoreVisible: false,
})
}
}).catch(err => {
this.setData({
list: [],
nodata: true,
loadMoreType: 'none',
loadMoreVisible: false,
})
console.log(err)
})
}
})

11
subpages/heart/pages/teamIntroduction/teamIntroduction.json

@ -0,0 +1,11 @@
{
"navigationBarTitleText": "团队介绍",
"navigationStyle": "custom",
"navigationBarTextStyle": "white",
"usingComponents": {
"activity": "/components/activity/activity",
"coverview-dialog": "../../components/coverViewDialog/coverViewDialog",
"load-more": "/components/loadMore/loadMore",
"no-data": "/components/nodata/nodata"
}
}

62
subpages/heart/pages/teamIntroduction/teamIntroduction.wxml

@ -0,0 +1,62 @@
<wxs module="filter" src="../../../../utils/filter.wxs"></wxs>
<view class="header" style="height: {{statusHeight + navigationHeight}}px;">
<image class="header-bg" src="../../images/team-top-bar.png" />
<view class="navigation" style="height: {{navigationHeight}}px; top: {{statusHeight}}px;">
<view class="goback" bindtap="goback">
<image src="../../images/goback.png" />
</view>
<view class="title" bindtap="goback">
<view class="title-right">团队介绍</view>
</view>
</view>
</view>
<view class="top" style="margin-top: {{statusHeight + navigationHeight}}px">
<view class="top-bg">
<image class="top-bg-img" src="../../images/team-top-bg.png" />
<view class="top-text">
<view class="top-text-title">{{teamDetail.teamName}}</view>
<view class="top-text-desc">{{filter.getHtmlContent(teamDetail.content)}}</view>
</view>
<image class="top-button" src="../../images/join-team.png" bindtap="joinTeam" wx:if="{{!teamDetail.joinFlag}}"/>
</view>
</view>
<view class="content">
<!-- tabbar -->
<view class="tab-bar">
<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="select-bar {{selectTab}}"></view>
</view>
<view class="team-active-list" wx:if="{{selectTab === 'tab1'}}">
<activity bind:toActDetail="toActDetailDown" id="state-0" state="0"></activity>
</view>
<view class="team-member-list" wx:else>
<view class="list-left">
<block wx:for="{{list}}" wx:key="index">
<view class="member-item" wx:if="{{index % 2 == 0}}">
<image class="member-img" src="{{item.faceImg}}" />
<view class="member-name">{{item.realName}}</view>
<view class="member-intro">{{item.introduce}}</view>
</view>
</block>
</view>
<view class="list-right">
<block wx:for="{{list}}" wx:key="index">
<view class="member-item" wx:if="{{index % 2 == 1}}">
<image class="member-img" src="{{item.faceImg}}" />
<view class="member-name">{{item.realName}}</view>
<view class="member-intro">{{item.introduce}}</view>
</view>
</block>
</view>
</view>
</view>
<coverview-dialog bind:confirm="confirmDialog" dialogVisible="{{dialogVisible}}" title="{{dialogTitle}}"
content="{{dialogContent}}" confirmText="{{dialogConfirmText}}" cancelText="{{dialogCancelText}}">
</coverview-dialog>
<load-more loadMoreType="{{loadMoreType}}" loadMoreVisible="{{loadMoreVisible}}"></load-more>
<no-data isShow="{{nodata}}"></no-data>

193
subpages/heart/pages/teamIntroduction/teamIntroduction.wxss

@ -0,0 +1,193 @@
page {
background-color: #f7f7f7;
}
/* 自定义标题栏 start */
.header {
position: fixed;
width: 100%;
top: 0;
left: 0;
z-index: 999;
}
.header .header-bg {
width: 100%;
height: 100%;
position: absolute;
z-index: 10;
left: 0;
top: 0;
}
.header .navigation {
display: flex;
align-items: center;
position: relative;
z-index: 100;
}
.header .navigation .goback {
width: 40rpx;
padding-left: 14rpx;
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.header .navigation .goback image {
width: 16rpx;
height: 28rpx;
}
.header .navigation .title {
display: flex;
align-items: center;
width: calc(100% - 46rpx);
margin-left: 46rpx;
color: rgba(255, 255, 255, 0.9);
font-size: 32rpx;
letter-spacing: 2rpx;
}
/* 自定义标题栏 end */
.top {
width: 100%;
}
.top-bg {
width: 100%;
height: 280rpx;
box-sizing: border-box;
padding-top: 16rpx;
position: relative;
}
.top-bg .top-bg-img {
width: 100%;
height: 110%;
position: absolute;
top: 0;
left: 0;
}
.top-bg .top-text {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 10;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 0 30rpx;
box-sizing: border-box;
}
.top-bg .top-text .top-text-title {
font-size: 52rpx;
color: #ffffff;
margin-bottom: 48rpx;
}
.top-bg .top-text .top-text-desc {
font-size: 30rpx;
color: #ffffff;
overflow: hidden;
text-overflow: ellipsis;
word-wrap:break-word;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
display: -webkit-box;
}
.top-bg .top-button {
width: 140rpx;
height: 60rpx;
position: absolute;
right: 0;
z-index: 11;
}
/* tab bar start */
.tab-bar {
width: 100%;
height: 90rpx;
background: #fff;
display: flex;
justify-content: space-around;
position: relative;
padding: 0 40rpx;
box-sizing: border-box;
border-radius: 16rpx 16rpx 0rpx 0rpx;
margin-bottom: 18rpx;
}
.tab-bar .tab {
flex: 1;
height: 90rpx;
line-height: 90rpx;
text-align: center;
width: 50%;
font-size: 32rpx;
font-weight: 500;
color: rgba(153, 153, 153, 1);
}
.tab-bar .select-tab {
color: #E50F00;
font-size: 32rpx;
font-weight: bold;
}
.tab-bar .select-bar {
width: 40rpx;
height: 8rpx;
border-radius: 5rpx;
background: #E50F00;
position: absolute;
bottom: 0rpx;
}
.tab-bar .select-bar.tab1 {
left: 25%;
transition: left linear 0.4s;
}
.tab-bar .select-bar.tab2 {
left: calc(75% - 35rpx);
transition: left linear 0.4s;
}
/* tab bar end */
.content .team-member-list {
display: flex;
padding: 0 25rpx;
}
.team-member-list .member-item {
width: 320rpx;
min-height: 282rpx;
margin: 20rpx 15rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: #fff;
border-radius: 20rpx;
}
.member-item .member-img {
width: 110rpx;
height: 110rpx;
background-color: #909090;
margin-top: 40rpx;
border-radius: 50%;
}
.member-item .member-name {
font-size: 30rpx;
color: #333333;
margin-top: 20rpx;
}
.member-item .member-intro {
font-size: 26rpx;
color: #c1c1c1;
margin: 18rpx 0 36rpx;
width: 85%;
text-align: center;
/* overflow: hidden;
text-overflow: ellipsis;
word-wrap:break-word;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
display: -webkit-box; */
}

143
subpages/heart/pages/volunteer/volunteer.js

@ -1,4 +1,5 @@
const api = require("../../../../utils/api")
const new_api = require('../../utils/api')
const app = getApp()
import { $wuxActionSheet } from "../../../../dist/index"
const config = require("../../../../utils/config")
@ -51,6 +52,21 @@ Page({
id: ''
}],
deptIndex: 0,
teamNames: [], //
teamType: {}, //志愿者团队分类
teamTypeList: [{
typeName: '请选择',
typeCode: '',
id: ''
}],
teamTypeIndex: 0,
team: {}, //志愿者团队名称
teamList: [{
teamName: '请选择',
teamType: '',
id: ''
}],
teamIndex: 0,
},
onLoad: function () {
this.setData({
@ -60,8 +76,13 @@ Page({
this.getImgUrl()
this.getPrepareComplete().then(() => {
this.getGridList()
this.getVolunteerTags()
this.getVolunteerDepts()
// this.getVolunteerTags()
// this.getVolunteerDepts()
// this.getTeamTypeList().then(res => {
// if (this.data.team.id) {
// this.getTeamTypeName()
// }
// })
})
this.checkWxUnionId()
this.getWxCode()
@ -235,7 +256,9 @@ Page({
volunteerSignature:res.data.volunteerSignature,
volunteerFaceImg:res.data.volunteerFaceImg,
'volunteerTag.id': res.data.volunteerTagId || '0',
'volunteerDept.id': res.data.volunteerDeptId || '0'
'volunteerDept.id': res.data.volunteerDeptId || '0',
'team.id': res.data.teamId || '',
teamNames: res.data.teamNames
// introduce:res.data.introduce
})
resolve(true)
@ -350,8 +373,9 @@ Page({
volunteerFaceImg:this.data.volunteerFaceImg,
volunteerNickname:this.data.volunteerNickname.trim(''),
volunteerSignature:this.data.volunteerSignature,
volunteerTagId: this.data.volunteerTag.id,
volunteerDeptId: this.data.volunteerDept.id,
// volunteerTagId: this.data.volunteerTag.id,
// volunteerDeptId: this.data.volunteerDept.id,
// teamId: this.data.team.id || '',
wxCode: this.data.unionIdStatus === "1" ? "" : this.data.wxCode,
encryptedData: this.data.unionIdStatus === "1" ? "" : this.data.encryptedData,
iv: this.data.unionIdStatus === "1" ? "" : this.data.iv
@ -608,4 +632,113 @@ Page({
'volunteerDept.dept': this.data.deptList[index].deptName
})
},
//
chooseTeamType (e) {
let index = e.detail.value
this.setData({
teamTypeIndex: index,
'teamType.typeName': this.data.teamTypeList[index].typeName,
'teamType.typeCode': this.data.teamTypeList[index].typeCode,
'teamType.id': this.data.teamTypeList[index].id,
teamList: [],
teamIndex: 0,
team: {}
})
this.getAppTeamListByType()
},
//
chooseTeamName (e) {
let index = e.detail.value
this.setData({
teamIndex: index,
'team.teamName': this.data.teamList[index].teamName,
'team.teamType': this.data.teamList[index].teamType,
'team.id': this.data.teamList[index].id
})
},
// 获取团队类别列表
getTeamTypeList () {
let param = {
pageSize : 99,
pageIndex : 1,
teamId: ''
}
return new Promise((resolve, reject) => {
new_api.getTeamTypeList(param).then(res => {
if (res.code == 0 && res.msg == 'success') {
this.setData({
teamTypeList: this.data.teamTypeList.concat(res.data)
})
}
resolve()
}).catch(err => { reject() })
})
},
getTeamTypeName () {
let param = {
pageSize : 99,
pageIndex : 1,
teamId: this.data.team.id
}
new_api.getTeamTypeList(param).then(res => {
if (res.code == 0 && res.msg == 'success') {
console.log(this.data.teamTypeList)
this.data.teamTypeList.forEach((item, key) => {
if (item.id == res.data[0].id) {
this.setData({
'teamType.typeName': item.typeName,
'teamType.typeCode': item.typeCode,
teamTypeIndex: parseInt(key),
'teamType.id': item.id
})
this.getAppTeamListByType()
}
})
}
}).catch(err => {})
},
// 获取团队列表
getAppTeamListByType () {
if (!this.data.teamType.typeCode) {
this.setData({
teamList: [{
teamName: '请选择',
teamType: '',
id: ''
}]
})
return
}
const para = {
pageIndex: 1,
pageSize: 99,
typeCode: this.data.teamType.typeCode
}
new_api.getAppTeamListByType(para).then(res => {
if (this.data.team.id) {
res.data.forEach((item, key) => {
if (this.data.team.id == item.id) {
this.setData({
teamList: this.data.teamList.concat(res.data),
'team.teamName': item.teamName,
'team.teamType': item.teamType,
teamIndex: parseInt(key)+1,
})
}
})
} else {
this.setData({
teamList: this.data.teamList.concat(res.data),
'team.teamName': res.data[0].teamName,
'team.teamType': res.data[0].teamType,
'team.id': res.data[0].id,
})
}
}).catch(err => {
this.setData({
teamList: []
})
console.log(err)
})
}
})

38
subpages/heart/pages/volunteer/volunteer.wxml

@ -89,24 +89,38 @@
<input class="nicknameinput" bindblur="nickname" bindinput="nickname" value="{{volunteerNickname}}" placeholder-class="placeholder-style" placeholder="请输入您的昵称" />
</view>
</view>
<view class="head-portrait">
<!-- <view class="head-portrait">
<view class="head-portrait-name">选择小组</view>
<!-- <view class="time">{{volunteerTag.tag}}</view> -->
<picker bindchange="choosePicker" value="{{tagIndex}}" range="{{tagList}}" range-key="tagName">
<view class="picker">
{{tagList[tagIndex].tagName}}
</view>
</picker>
</view>
<view class="head-portrait"> <!-- 2021.07.20 暂时不上线该功能 -->
<view class="head-portrait" >
<view class="head-portrait-name">选择部门</view>
<!-- <view class="time">{{volunteerTag.tag}}</view> -->
<picker bindchange="choosePicker2" value="{{deptIndex}}" range="{{deptList}}" range-key="deptName">
<view class="picker">
{{deptList[deptIndex].deptName}}
</view>
</picker>
</view> -->
<!-- <view class="head-portrait" >
<view class="head-portrait-name">选择团队分类</view>
<picker bindchange="chooseTeamType" value="{{teamTypeIndex}}" range="{{teamTypeList}}" range-key="typeName">
<view class="picker">
{{teamTypeList[teamTypeIndex].typeName}}
</view>
</picker>
</view>
<view class="head-portrait" >
<view class="head-portrait-name">选择团队名称</view>
<picker bindchange="chooseTeamName" value="{{teamIndex}}" range="{{teamList}}" range-key="teamName">
<view class="picker">
{{teamList[teamIndex].teamName}}
</view>
</picker>
</view> -->
<view class="head-portrait-last">
<view class="head-portrait-name-last">格言</view>
</view>
@ -118,7 +132,21 @@
</view>
<!-- 已加入团队 -->
<view class="info magin-top" wx:if="{{teamNames.length > 0}}">
<view class="info-box">
<view class="info-left header-title">
已加入团队
</view>
<view class="clear"></view>
</view>
<view class="info-box">
<view class="address name">
<view wx:for="{{teamNames}}" wx:key="index">{{item}}</view>
</view>
<view class="clear"></view>
</view>
</view>
<!-- 居住地址 -->
<view class="info magin-top">
<view class="info-box">

142
subpages/heart/pages/volunteerTeam/volunteerTeam.js

@ -0,0 +1,142 @@
const api = require('../../utils/api')
const typePageSize = 99
const typePageIndex = 1
Page({
data: {
pageIndex: 1,
pageSize: 10,
nodata: false,
loadMoreType: 'none',
loadMoreVisible: false,
selectBarLeft: 0,
teamCategoryList: [],
volunteerTeamList: [],
typeCode: '', // 当前类别code
},
onLoad: function (options) {
},
onShow: function () {
this.setData({
pageIndex: 1,
volunteerTeamList: []
})
const _this = this
const query = wx.createSelectorQuery().in(this)
this.getTeamTypeList().then(getType => {
if (getType) {
query.select('#item1').boundingClientRect()
query.exec(function(res){
_this.setData({
selectBarLeft: res[0].width/2
})
console.log(_this.data.selectBarLeft)
})
this.getAppTeamListByType()
} else {
}
})
},
onReachBottom: function () {
this.setData({
loadMoreVisible: true
})
if (this.data.loadMoreType === "loading") {
this.setData({
pageIndex: this.data.pageIndex + 1
})
this.getAppTeamListByType()
}
},
// 前往团队介绍
toTeamDetail (e) {
let id = e.currentTarget.dataset.id
wx.navigateTo({
url: `../teamIntroduction/teamIntroduction?id=${id}`
})
},
// 分类导航切换
onChangeClassifyTab (e) {
let code = e.currentTarget.dataset.code
this.data.teamCategoryList.forEach((item, index) => {
if (index === e.currentTarget.dataset.tab) {
item.select = true
const _this = this
const query = wx.createSelectorQuery().in(this)
query.select(`#item${index + 1}`).boundingClientRect()
query.exec(function(res){
_this.setData({
selectBarLeft: res[0].width/2
})
console.log(_this.data.selectBarLeft)
})
} else {
item.select = false
}
})
this.setData({
teamCategoryList: this.data.teamCategoryList,
typeCode: code,
pageIndex: 1,
volunteerTeamList: []
}, () => {
this.getAppTeamListByType()
})
},
// 获取团队类别列表
getTeamTypeList () {
let param = {
pageSize : typePageSize,
pageIndex : typePageIndex,
teamId: ''
}
return new Promise ((resolve, reject) => {
api.getTeamTypeList(param).then(res => {
if (res.code == 0 && res.msg == 'success') {
res.data[0].select = true
this.setData({
teamCategoryList: res.data,
typeCode: res.data[0].typeCode
})
resolve(true)
}
reject(false)
}).catch(err => {
reject(false)
})
})
},
// 获取团队列表
getAppTeamListByType () {
const para = {
pageIndex: this.data.pageIndex,
pageSize: this.data.pageSize,
typeCode: this.data.typeCode
}
api.getAppTeamListByType(para).then(res => {
console.log(res)
this.setData({
volunteerTeamList: [...this.data.volunteerTeamList,...res.data],
loadMoreType: res.data.length === this.data.pageSize ? 'loading' : 'none',
loadMoreVisible: res.data.length === this.data.pageSize ? false : true,
nodata: false,
})
if (this.data.volunteerTeamList.length == 0) {
this.setData({
nodata: true,
loadMoreType: 'none',
loadMoreVisible: false,
})
}
}).catch(err => {
this.setData({
volunteerTeamList: [],
nodata: true,
loadMoreType: 'none',
loadMoreVisible: false,
})
console.log(err)
})
}
})

7
subpages/heart/pages/volunteerTeam/volunteerTeam.json

@ -0,0 +1,7 @@
{
"navigationBarTitleText": "志愿团队",
"usingComponents": {
"load-more": "/components/loadMore/loadMore",
"no-data": "/components/nodata/nodata"
}
}

32
subpages/heart/pages/volunteerTeam/volunteerTeam.wxml

@ -0,0 +1,32 @@
<view class="volunteer-team">
<scroll-view class="classify-tab" scroll-x="{{true}}">
<view class="tab-list">
<view
class="item {{item.select ? 'select' : ''}}"
id="{{'item' + (index + 1)}}"
wx:for="{{teamCategoryList}}"
wx:for-item="item"
wx:for-index="index"
data-tab="{{index}}"
data-code="{{item.typeCode}}"
bindtap="onChangeClassifyTab"
wx:key="index">
{{item.typeName}}
<view style="left: calc({{selectBarLeft}}px - 15rpx)" wx:if="{{item.select}}" class="select-bar"></view>
</view>
</view>
</scroll-view>
<view class="volunteer-list">
<block wx:for="{{volunteerTeamList}}" wx:key="index">
<view class="volunteer-item" bindtap="toTeamDetail" data-id="{{item.id}}">
<view class="volunteer-title">{{item.teamName}}</view>
<image class="volunteer-icon" src="../../images/ic_jinruxiayiye@2x.png"/>
</view>
<view class="list-line" wx:if="{{index < volunteerTeamList.length - 1}}"></view>
</block>
</view>
</view>
<load-more loadMoreType="{{loadMoreType}}" loadMoreVisible="{{loadMoreVisible}}"></load-more>
<no-data isShow="{{nodata}}"></no-data>

91
subpages/heart/pages/volunteerTeam/volunteerTeam.wxss

@ -0,0 +1,91 @@
page {
background-color: #f7f7f7;
}
.classify-tab {
width: 100%;
height: 90rpx;
border-bottom: 1rpx solid #eaeaea;
background-color: #fff;
padding: 0rpx 20rpx;
box-sizing: border-box;
}
::-webkit-scrollbar{
width: 0;
height: 0;
color: transparent;
display:none;
}
.classify-tab .tab-list {
width: auto;
min-width: 100%;
height: 90rpx;
display: flex;
}
.tab-list .item {
height: 90rpx;
color: #ababab;
font-size: 30rpx;
margin: 0 20rpx;
line-height: 90rpx;
flex-shrink: 0;
position: relative;
width: 150rpx;
text-align: center;
}
.tab-list .item.select {
color: #FF4848;
font-size: 32rpx;
font-weight: bold;
}
.tab-list .item:first-child {
margin-left: 0;
}
.tab-list .item:last-child {
margin-right: 0;
}
.classify-tab .tab-list .item .select-bar {
width: 30rpx;
height: 8rpx;
border-radius: 4rpx;
background: #FF4848;
position: absolute;
bottom: 0;
left: 0;
}
/* list */
.volunteer-list {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: #fff;
margin-top: 20rpx;
}
.volunteer-list .volunteer-item {
width: 690rpx;
height: 110rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.volunteer-list .volunteer-item .volunteer-title {
width: 650rpx;
font-size: 34rpx;
color: #333333;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
.volunteer-list .volunteer-item .volunteer-icon {
width: 22rpx;
height: 22rpx;
}
.volunteer-list .list-line {
width: 690rpx;
height: 1px;
background-color: #eeeeee;
border-radius: 1px;
opacity: 0.7;
}

57
subpages/heart/utils/api.js

@ -22,7 +22,14 @@ module.exports = {
signUpOrCancel,
getResidentConfig,
noticelist,
noticeDetail
noticeDetail,
getVolunteerUnionList,
getVolunteerUnionDetail,
getTeamTypeList,
getAppTeamListByType,
getAppTeamDetail,
getTeamVolunteerList,
joinTeam
}
//顺道捎-首页列表
@ -157,4 +164,52 @@ function noticelist (params) {
// 通知详情
function noticeDetail (noticeId) {
return fly.get(`news/notice/detail/${noticeId}`)
}
// 共建联盟-列表
function getVolunteerUnionList ({ pageIndex, pageSize }) {
return fly.get("heart/volunteer/getVolunteerUnionList", {
pageIndex,
pageSize
})
}
// 共建联盟-详情
function getVolunteerUnionDetail ({ id }) {
return fly.get("heart/volunteer/getVolunteerUnionDetail", {
id
})
}
// 志愿团队类别-列表
function getTeamTypeList ({ pageIndex, pageSize, teamId }) {
return fly.get("heart/volunteer/getTeamTypeList", {
pageIndex,
pageSize,
teamId
})
}
// 志愿团队-列表
function getAppTeamListByType ({ pageIndex, pageSize, typeCode }) {
return fly.get("heart/volunteer/getAppTeamListByType", {
pageIndex,
pageSize,
typeCode
})
}
// 志愿团队-详情
function getAppTeamDetail ({ id }) {
return fly.get("heart/volunteer/getAppTeamDetail", {
id
})
}
// 志愿团队-详情-成员列表
function getTeamVolunteerList ({ pageIndex, pageSize, id }) {
return fly.get("heart/volunteer/getTeamVolunteerList", {
pageIndex,
pageSize,
id
})
}
// 志愿团队-加入团队
function joinTeam (para) {
return fly.post("heart/volunteer/joinTeam", para)
}

8
utils/activity.js

@ -13,7 +13,8 @@ module.exports = {
getVolunteerVerify,
getResidentConfig,
moduleCategory,
getImgUrlList
getImgUrlList,
getAppTeamActList
}
function getActivityList (params) {
@ -87,4 +88,9 @@ function moduleCategory(params) {
// 获取图片配置列表 优化
function getImgUrlList (params) {
return fly.get('imgConfig/getImgUrlList', params)
}
// 志愿团队-详情-活动列表
function getAppTeamActList (params) {
return fly.get('heart/volunteer/getAppTeamActList', params)
}

9
utils/api.js

@ -76,7 +76,9 @@ module.exports = {
getCharityPoints: getCharityPoints,
//
getActPeriods,
getSignInActPeriods
getSignInActPeriods,
//
getVolunteerPioneerList
}
function getToken (wxCode) {
@ -649,4 +651,9 @@ function getActPeriods (actId) {
// 取消报名时间段列表接口
function getSignInActPeriods (actId) {
return fly.get(`heart/act/getSignInActPeriods`, {actId: actId})
}
// 志愿先锋-列表
function getVolunteerPioneerList({ pageIndex, pageSize }) {
return fly.get('heart/volunteer/getVolunteerPioneerList', { pageIndex, pageSize })
}

7
utils/filter.wxs

@ -27,8 +27,11 @@ var formatTime = function (strDate, format = "yyyy-MM-dd hh:mm:ss") {
var getTags = function (tags=[]) {
return tags.join(' ')
}
var getHtmlContent = function (html) {
return html.replace(getRegExp('<\/?.+?\/?>|[&nbsp;]', 'g'), '')
}
module.exports = {
formatTime: formatTime,//日期格式化
getTags: getTags
getTags: getTags,
getHtmlContent: getHtmlContent
}

29
utils/heartBehavior.js

@ -28,12 +28,12 @@ module.exports = Behavior ({
loadBehavior () {
console.log('load heartBehavior')
Promise.all([this.getModuleList(), this.getImgUrl()]).then( () => {
let newArr = group(this.data.tabList.sort(compare('sort')), 2)
this.setData({
tabLeftList: newArr[1],
tabRightList: newArr[0]
})
// 2021.07.09 左右菜单互换位置
// let newArr = group(this.data.tabList.sort(compare('sort')), 2)
// this.setData({
// tabLeftList: newArr[1],
// tabRightList: newArr[0]
// })
// 2021.11.17 取消排序
})
},
// 获取模块信息
@ -67,7 +67,7 @@ module.exports = Behavior ({
getImgUrl:function (){
return new Promise((resolve, reject) => {
let params = {
imageTypes: '0, 5, 8, 9'
imageTypes: '0, 5, 8, 9, 11, 12'
}
api.getImgUrlList(params).then(res => {
res.data.forEach( item => {
@ -76,9 +76,14 @@ module.exports = Behavior ({
getImgUrl: item
})
} else if (item.imgType == '5' && (item.imgCode == 'ptg' || item.imgCode == 'sds')) {
this.data.tabList.push(item)
// 2021.11.17 取消排序
// this.data.tabList.push(item)
// this.setData({
// tabList: this.data.tabList
// })
this.data.tabRightList.push(item)
this.setData({
tabList: this.data.tabList
tabRightList: this.data.tabRightList
})
} else if (item.imgType == '8') {
this.setData({
@ -90,6 +95,12 @@ module.exports = Behavior ({
// tabList: this.data.tabList
applyBtn: item
})
} else if (item.imgType == '11' || item.imgType == '12') {
// 2021.11.17 左侧固定 志愿团队 共建联盟
this.data.tabLeftList.push(item)
this.setData({
tabLeftList: this.data.tabLeftList.sort(compare('imgType'))
})
}
})
resolve()

Loading…
Cancel
Save