Browse Source

订单多多精彩说说列表增加主办方筛选;活动报名增加时间段;

master
ZhaoTongYao 4 years ago
parent
commit
0f8bd08516
  1. 47
      pages/heartNew/heartNew.js
  2. 42
      pages/heartNew/heartNew.wxml
  3. 15
      pages/heartNew/heartNew.wxss
  4. BIN
      subpages/heart/images/zhubanfang.png
  5. 92
      subpages/heart/pages/heartDetail/heartDetail.js
  6. 37
      subpages/heart/pages/heartDetail/heartDetail.wxml
  7. 72
      subpages/heart/pages/heartDetail/heartDetail.wxss
  8. 12
      utils/api.js

47
pages/heartNew/heartNew.js

@ -62,6 +62,8 @@ Page({
scanBtn: {}, // 扫码签到改为可配置 scanBtn: {}, // 扫码签到改为可配置
shouye: {}, shouye: {},
applyBtn: {}, // 申请发单改为可配置 applyBtn: {}, // 申请发单改为可配置
searchActive: '', //
searchJingcai: '',
}, },
/** /**
@ -164,6 +166,8 @@ Page({
loadMoreVisible: false, loadMoreVisible: false,
loadMoreType: "none", loadMoreType: "none",
indexPage: 1, indexPage: 1,
searchActive: '',
searchJingcai: ''
}) })
if (e.currentTarget.dataset.tab == "tab0") { if (e.currentTarget.dataset.tab == "tab0") {
this.setData({ this.setData({
@ -328,18 +332,43 @@ Page({
} }
this.volunteerlist(parms) this.volunteerlist(parms)
}, },
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
bindInputValueActive (e) {
if ((this.data.selectedTab === "tab0")) {
this.setData({
searchActive: e.detail.value.trim('')
})
} else if (this.data.selectedTab === "tab2") {
this.setData({
searchJingcai: e.detail.value.trim('')
})
}
}, },
/** searchActive () {
* 生命周期函数--监听页面卸载 if ((this.data.selectedTab === "tab0")) {
*/ let params = {
onUnload: function () { pageIndex: 1,
pageSize: 10,
timestamp: getTimestamp(),
actType: 0,
qkdat: true,
sponsor: this.data.searchActive,
selectedTab:this.data.selectedTab
}
this.selectComponent("#state-0").getActivityList(params)
} else if (this.data.selectedTab === "tab2") {
let params = {
pageIndex: 1,
pageSize: 10,
timestamp: getTimestamp(),
actType: 1,
qkdat: true,
sponsor: this.data.searchJingcai,
selectedTab:this.data.selectedTab
}
this.selectComponent("#state-2").getActivityList(params)
}
}, },
/** /**

42
pages/heartNew/heartNew.wxml

@ -85,6 +85,20 @@
</view> </view>
<!-- 订单多多列表 --> <!-- 订单多多列表 -->
<view class="details-top" hidden="{{dingdan}}"> <view class="details-top" hidden="{{dingdan}}">
<view class="top-box">
<view class="">活动主办方:</view>
<view class="search-long">
<view class="search">
<view class="item-all">
<view class="item-left">
<image src="../../images/search.png"></image>
<input placeholder-class="placeholder-style" placeholder="输入关键字" bindinput="bindInputValueActive" value="{{searchActive}}"></input>
</view>
<button class="item-right" bindtap="searchActive" hover-class="none">搜索</button>
</view>
</view>
</view>
</view>
<activity bind:toActDetail="toActDetailDown" id="state-0" state="0"></activity> <activity bind:toActDetail="toActDetailDown" id="state-0" state="0"></activity>
</view> </view>
<!-- 志友朵朵 --> <!-- 志友朵朵 -->
@ -92,13 +106,15 @@
<view class="details-top"> <view class="details-top">
<view class="top-box"> <view class="top-box">
<view class="reg-count">志愿者注册数:{{volunteerCount}}</view> <view class="reg-count">志愿者注册数:{{volunteerCount}}</view>
<view class="search"> <view class="search-short">
<view class="item-all"> <view class="search">
<view class="item-left"> <view class="item-all">
<image src="../../images/search.png"></image> <view class="item-left">
<input placeholder-class="placeholder-style" placeholder="输入昵称关键字" bindinput="bindInputValue" value="{{searchName}}"></input> <image src="../../images/search.png"></image>
<input placeholder-class="placeholder-style" placeholder="输入昵称关键字" bindinput="bindInputValue" value="{{searchName}}"></input>
</view>
<button class="item-right" bindtap="searchName" hover-class="none">搜索</button>
</view> </view>
<button class="item-right" bindtap="searchName" hover-class="none">搜索</button>
</view> </view>
</view> </view>
<scroll-view scroll-x="{{true}}" class="scroll-tag"> <scroll-view scroll-x="{{true}}" class="scroll-tag">
@ -115,6 +131,20 @@
</block> </block>
<!-- 精彩说说 --> <!-- 精彩说说 -->
<view class="details-top" hidden="{{jingcai}}"> <view class="details-top" hidden="{{jingcai}}">
<view class="top-box">
<view class="">活动主办方:</view>
<view class="search-long">
<view class="search">
<view class="item-all">
<view class="item-left">
<image src="../../images/search.png"></image>
<input placeholder-class="placeholder-style" placeholder="输入关键字" bindinput="bindInputValueActive" value="{{searchJingcai}}"></input>
</view>
<button class="item-right" bindtap="searchActive" hover-class="none">搜索</button>
</view>
</view>
</view>
</view>
<activity bind:toActDetail="toActDetailDown" id="state-2" state="2"></activity> <activity bind:toActDetail="toActDetailDown" id="state-2" state="2"></activity>
</view> </view>
<move-btn <move-btn

15
pages/heartNew/heartNew.wxss

@ -439,6 +439,7 @@ button:last-child {
background-color: #fff; background-color: #fff;
padding: 0 20rpx; padding: 0 20rpx;
box-sizing: border-box; box-sizing: border-box;
margin-bottom: 10rpx;
} }
.reg-count { .reg-count {
font-size: 28rpx; font-size: 28rpx;
@ -494,17 +495,27 @@ button:last-child {
color: #C5C5C5; color: #C5C5C5;
} }
.search-short {
height: 66rpx;
width: 410rpx;
margin-top: 26rpx;
}
.search-long {
width: 500rpx;
padding: 20rpx 0rpx;
box-sizing: border-box;
background-color: #fff;
}
/* 搜索志愿者 start */ /* 搜索志愿者 start */
.search { .search {
/* margin-top: 17rpx; */ /* margin-top: 17rpx; */
height: 66rpx; height: 66rpx;
width: 410rpx; width: 100%;
background: #f7f7f7; background: #f7f7f7;
border-radius: 33rpx; border-radius: 33rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-top: 26rpx;
} }
.search .item-all { .search .item-all {

BIN
subpages/heart/images/zhubanfang.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

92
subpages/heart/pages/heartDetail/heartDetail.js

@ -30,7 +30,11 @@ Page({
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
curSize: 0, // 当前页码获取的活动条数 curSize: 0, // 当前页码获取的活动条数
isPreviewImage: false //是否从图片预览返回 isPreviewImage: false, //是否从图片预览返回
showPeriodDialog: false, // 是否显示选择时间段对话框
dialogTips: '',
sponsor: '', // 主办方
periodList: [], // 时间段
}, },
onLoad: function (options) { onLoad: function (options) {
console.log("当前时间" + getTimestamp()) console.log("当前时间" + getTimestamp())
@ -48,6 +52,8 @@ Page({
// } // }
// 获取默认网格 // 获取默认网格
this.getDefaultGridInfo() this.getDefaultGridInfo()
// 获取活动时间段
this.getActPeriods()
}, },
onReachBottom () { onReachBottom () {
if (this.data.curSize == this.data.pageSize) { if (this.data.curSize == this.data.pageSize) {
@ -72,7 +78,8 @@ Page({
actEndTime: res.data.actEndTime.substring(0, 16), actEndTime: res.data.actEndTime.substring(0, 16),
signupEndTime: res.data.signupEndTime.substring(0, 16), signupEndTime: res.data.signupEndTime.substring(0, 16),
timeJudge: getTimestamp() > res.data.actEndTime.substring(0, 16) ? true : false, timeJudge: getTimestamp() > res.data.actEndTime.substring(0, 16) ? true : false,
preloadVisible: false preloadVisible: false,
sponsor: res.data.sponsor
}) })
} }
}).catch(err => { }).catch(err => {
@ -106,7 +113,8 @@ Page({
url: `../clockIn/clockIn?id=${id}&currentUserStatus=${currentUserStatus}` url: `../clockIn/clockIn?id=${id}&currentUserStatus=${currentUserStatus}`
}) })
}, },
goVolunteer (e) { //我要报名 用户认证志愿者标识(0-未认证,1-已认证) goVolunteer (e) {
// 我要报名 用户认证志愿者标识(0-未认证,1-已认证)
// 0-待审核 提醒用户志愿者身份认证审核中,不能报名也不用去认证 // 0-待审核 提醒用户志愿者身份认证审核中,不能报名也不用去认证
// 1 - 认证通过 直接报名 // 1 - 认证通过 直接报名
// 2 - 待认证 提示用户去认证 // 2 - 待认证 提示用户去认证
@ -124,7 +132,9 @@ Page({
// dialogCancelText: '' // dialogCancelText: ''
// }) // })
this.setData({ this.setData({
dialogVisible: !this.data.dialogVisible, // dialogVisible: !this.data.dialogVisible,
showPeriodDialog: !this.data.showPeriodDialog,
dialogTips: `报名时间截止之前可取消,缺席活动扣除${this.data.detail.punishmentPoints}积分,是否确定报名`,
dialogTitle: "报名提醒", dialogTitle: "报名提醒",
dialogContent: ["报名时间截止之前可取消", `缺席活动扣除${this.data.detail.punishmentPoints}积分,是否确定报名`], dialogContent: ["报名时间截止之前可取消", `缺席活动扣除${this.data.detail.punishmentPoints}积分,是否确定报名`],
dialogConfirmText: "是", dialogConfirmText: "是",
@ -132,7 +142,9 @@ Page({
}) })
} else if (uservolunteerflag == 1) { } else if (uservolunteerflag == 1) {
this.setData({ this.setData({
dialogVisible: !this.data.dialogVisible, // dialogVisible: !this.data.dialogVisible,
showPeriodDialog: !this.data.showPeriodDialog,
dialogTips: `报名时间截止之前可取消,缺席活动扣除${this.data.detail.punishmentPoints}积分,是否确定报名`,
dialogTitle: "报名提醒", dialogTitle: "报名提醒",
dialogContent: ["报名时间截止之前可取消", `缺席活动扣除${this.data.detail.punishmentPoints}积分,是否确定报名`], dialogContent: ["报名时间截止之前可取消", `缺席活动扣除${this.data.detail.punishmentPoints}积分,是否确定报名`],
dialogConfirmText: "是", dialogConfirmText: "是",
@ -204,8 +216,11 @@ Page({
console.log("::::::" + this.data.uservolunteerflag.length) console.log("::::::" + this.data.uservolunteerflag.length)
if (this.data.uservolunteerflag.length > 0) { if (this.data.uservolunteerflag.length > 0) {
if (this.data.uservolunteerflag == 0 || this.data.uservolunteerflag == 1) { if (this.data.uservolunteerflag == 0 || this.data.uservolunteerflag == 1) {
let id = this.data.id let param = {
api.signup(id).then(res => { actId: this.data.id,
actPeriodId: this.data.actPeriodId
}
api.signup(param).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.setData({ this.setData({
dialogVisible: !this.data.dialogVisible, dialogVisible: !this.data.dialogVisible,
@ -277,5 +292,68 @@ Page({
title: "活动详情", title: "活动详情",
path: `/pages/heartNew/heartNew?shareType=heartDetail&id=${this.data.id}&defaultGridId=${this.data.defaultGridId}` path: `/pages/heartNew/heartNew?shareType=heartDetail&id=${this.data.id}&defaultGridId=${this.data.defaultGridId}`
} }
},
checkboxChange (e) {
console.log(e.detail.value)
// let actPeriodId = []
// if (e.detail.value.length > 0) {
// e.detail.value.forEach(item => {
// let ob = {
// id: item
// }
// actPeriodId.push(ob)
// })
// }
this.setData({
actPeriodId: e.detail.value
})
},
onCancelPeriod () {
this.setData({
showPeriodDialog: false,
actPeriodId: []
})
},
onConfirmPeriod () {
console.log("::::::" + this.data.uservolunteerflag.length)
if (this.data.uservolunteerflag.length > 0) {
if (this.data.uservolunteerflag == 0 || this.data.uservolunteerflag == 1) {
let param = {
actId: this.data.id,
actPeriodId: this.data.actPeriodId
}
api.signup(param).then(res => {
if (res.code == 0) {
this.setData({
showPeriodDialog: !this.data.showPeriodDialog,
dialogVisible: !this.data.dialogVisible,
dialogTitle: "报名成功",
dialogContent: ["正在审核中", "请耐心等待消息通知!"],
dialogConfirmText: "确定",
dialogCancelText: "",
uservolunteerflag: ""
})
this.getDetail()
} else { //点击我要报名,刚好已经报满,此时弹出已报满的提示框,点击确定后,我要报名按钮变成已报满按钮(置灰)
this.getDetail()
}
})
} else if (this.data.uservolunteerflag == 2) {
wx.navigateTo({
url: "/subpages/heart/pages/volunteer/volunteer"
})
}
} else {
console.log("报名成功以后不进行操作")
}
},
getActPeriods () {
api.getActPeriods(this.data.id).then(res => {
console.log(res.data)
this.setData({
periodList: res.data
})
})
} }
}) })

37
subpages/heart/pages/heartDetail/heartDetail.wxml

@ -32,6 +32,15 @@
</view> </view>
</view> </view>
<view class="info-box">
<view class="info-left">
<image src="../../images/zhubanfang.png"></image>
<view class="info-font display-inline">主办方</view>
</view>
<view class="info-right color">
{{sponsor}}
</view>
</view>
<view class="info-box"> <view class="info-box">
<view class="info-left"> <view class="info-left">
<image src="../../images/didian.png"></image> <image src="../../images/didian.png"></image>
@ -361,4 +370,30 @@
<cancel-signup-dialog title="取消报名" cancelText="否" confirmText="是" tipVisible="{{cancelSignupTipVisible}}" <cancel-signup-dialog title="取消报名" cancelText="否" confirmText="是" tipVisible="{{cancelSignupTipVisible}}"
tipValue="{{cancelSignupTipValue}}" bind:confirm="cancelSignupCallback" cancelSignupVisible="{{cancelSignupVisible}}"> tipValue="{{cancelSignupTipValue}}" bind:confirm="cancelSignupCallback" cancelSignupVisible="{{cancelSignupVisible}}">
</cancel-signup-dialog> </cancel-signup-dialog>
<view class="period" wx:if="{{showPeriodDialog}}">
<view class="period-dialog">
<view class="period-title">请选择时间段</view>
<scroll-view class="period-content" scroll-y enhanced show-scrollbar>
<checkbox-group bindchange="checkboxChange" class="checkbox-group">
<label class="checkbox-item" wx:for="{{periodList}}" wx:key="index">
<view class="item-labels">
<view class="item-label">{{item.actPeriodStartTime}} 至</view>
<view class="item-label">{{item.actPeriodEndTime}}</view>
</view>
<view class="item-value">
<checkbox value="{{item.id}}" checked="{{item.checked}}"/>
</view>
</label>
</checkbox-group>
</scroll-view>
<view class="tips">
{{dialogTips}}
</view>
<view class="period-footer">
<view class="footer-cancel" bindtap="onCancelPeriod">取消</view>
<view class="footer-confirm" bindtap="onConfirmPeriod">确定</view>
</view>
</view>
</view>

72
subpages/heart/pages/heartDetail/heartDetail.wxss

@ -364,3 +364,75 @@ page{
rich-text{ rich-text{
line-height: 75rpx; line-height: 75rpx;
} }
/* 时间段start */
.period {
width: 100%;
height: 100%;
position: fixed;
left: 0;
top: 0;
z-index: 1000;
background-color: rgba(0, 0, 0, 0.6);
display: flex;
align-items: center;
justify-content: center;
}
.period .period-dialog {
width: 600rpx;
background-color: #fff;
border-radius: 10rpx;
}
.period-dialog .period-title {
height: 80rpx;
line-height: 80rpx;
text-align: center;
font-size: 36rpx;
}
.period-dialog .period-content {
height: 400rpx;
padding: 20rpx 30rpx;
box-sizing: border-box;
}
.period-dialog .period-content .checkbox-group {
height: 100%;
/* overflow: auto; */
}
.checkbox-group .checkbox-item {
display: flex;
width: 100%;
height: 120rpx;
align-items: center;
justify-content: space-around;
}
.checkbox-item .item-labels {
display: flex;
flex-direction: column;
}
.checkbox-item .item-label {
width: 370rpx;
}
.period-dialog .tips {
padding: 0rpx 60rpx;
}
.period-dialog .period-footer {
height: 100rpx;
width: 100%;
display: flex;
align-items: center;
justify-content: space-around;
}
.period-footer .footer-cancel {
width: 200rpx;
height: 80rpx;
line-height: 80rpx;
text-align: center;
color: #aaa;
}
.period-footer .footer-confirm {
width: 200rpx;
height: 80rpx;
line-height: 80rpx;
text-align: center;
color: #04BCA0;
}

12
utils/api.js

@ -73,7 +73,9 @@ module.exports = {
suggestDictList: suggestDictList, suggestDictList: suggestDictList,
suggestDetail: suggestDetail, suggestDetail: suggestDetail,
getVolunteerDepts: getVolunteerDepts, getVolunteerDepts: getVolunteerDepts,
getCharityPoints: getCharityPoints getCharityPoints: getCharityPoints,
//
getActPeriods
} }
function getToken (wxCode) { function getToken (wxCode) {
@ -435,8 +437,8 @@ function authenticate (data) {
* 活动报名 * 活动报名
*/ */
function signup (actId) { function signup (param) {
return fly.post(`heart/act/signup?actId=${actId}`) return fly.post(`heart/act/signup`, param)
} }
/** /**
@ -637,4 +639,8 @@ function getVolunteerDepts () {
//志愿者银行-公益积分记录 //志愿者银行-公益积分记录
function getCharityPoints (para) { function getCharityPoints (para) {
return fly.get(`points/charityPoints`, para) return fly.get(`points/charityPoints`, para)
}
// 活动参与时间段列表接口
function getActPeriods (actId) {
return fly.get(`heart/act/getActPeriods`, {actId: actId})
} }
Loading…
Cancel
Save