Browse Source

新增志愿者活动申请功能;

feature/optimise
ZhaoTongYao 5 years ago
parent
commit
0580a9e596
  1. 5
      app.json
  2. 148
      components/DateTimePicker/index.js
  3. 4
      components/DateTimePicker/index.json
  4. 39
      components/DateTimePicker/index.wxml
  5. 45
      components/DateTimePicker/index.wxss
  6. BIN
      images/heart/apply.png
  7. 18
      pages/heartNew/heartNew.js
  8. 3
      pages/heartNew/heartNew.json
  9. 11
      pages/heartNew/heartNew.wxml
  10. 34
      pages/heartNew/heartNew.wxss
  11. 17
      project.config.json
  12. BIN
      subpages/heart/images/my-applys.png
  13. BIN
      subpages/heart/images/submit-bk.png
  14. BIN
      subpages/heart/images/time.png
  15. 203
      subpages/heart/pages/myApply/myApply.js
  16. 6
      subpages/heart/pages/myApply/myApply.json
  17. 48
      subpages/heart/pages/myApply/myApply.wxml
  18. 102
      subpages/heart/pages/myApply/myApply.wxss
  19. 76
      subpages/heart/pages/myApplyDetail/myApplyDetail.js
  20. 4
      subpages/heart/pages/myApplyDetail/myApplyDetail.json
  21. 46
      subpages/heart/pages/myApplyDetail/myApplyDetail.wxml
  22. 41
      subpages/heart/pages/myApplyDetail/myApplyDetail.wxss
  23. 133
      subpages/heart/pages/myApplyList/myApplyList.js
  24. 4
      subpages/heart/pages/myApplyList/myApplyList.json
  25. 15
      subpages/heart/pages/myApplyList/myApplyList.wxml
  26. 74
      subpages/heart/pages/myApplyList/myApplyList.wxss
  27. 11
      subpages/oneKeyService/pages/laobingzaixian/laobingzaixian.js
  28. 24
      utils/api.js
  29. 4
      utils/config.js

5
app.json

@ -111,7 +111,10 @@
"pages/signed/signed", "pages/signed/signed",
"pages/refusedOrEndedDetail/refusedOrEndedDetail", "pages/refusedOrEndedDetail/refusedOrEndedDetail",
"pages/cancelDetail/cancelDetail", "pages/cancelDetail/cancelDetail",
"pages/noticeDetail/noticeDetail" "pages/noticeDetail/noticeDetail",
"pages/myApply/myApply",
"pages/myApplyList/myApplyList",
"pages/myApplyDetail/myApplyDetail"
] ]
}, },
{ {

148
components/DateTimePicker/index.js

@ -0,0 +1,148 @@
"use strict";
var date = new Date();
var years = [];
var months = [];
var days = [];
var hours = [];
var minutes = [];
for (var i = date.getFullYear(); i > (date.getFullYear() - 3); i--) {
years.push(i + "年");
}
for (var i = 1; i <= 12; i++) {
months.push(i + "月");
}
for (var i = 1; i <= 31; i++) {
days.push(i + "日");
}
for (var i = 0; i <= 23; i++) {
hours.push(i + "");
}
for (var i = 0; i <= 59; i++) {
minutes.push(i + "");
}
var mGetDate = function (year, month) {
var d = new Date(year, month, 0);
return d.getDate();
};
var getDate = function (year, month, day, hour, minute) {
var newyear = year.substr(0, year.length - 1);
var setmonth = month.substr(0, month.length - 1);
var newmonth = setmonth < 10 ? '0' + setmonth : setmonth;
var setday = day.substr(0, day.length - 1);
var newday = setday < 10 ? '0' + setday : setday;
var newhour = hour < 10 ? '0' + hour : hour;
var newminute = minute < 10 ? '0' + minute : minute;
return newyear + '-' + newmonth + '-' + newday + ' ' + newhour + ":" + newminute + ":00";
};
var getInitDate = function (initTime) {
var t = initTime.split(' ');
var date = t[0].split('-');
var time = t[1].split(':');
var y = 0;
var m = 0;
var d = 0;
var h = 0;
var M = 0;
years.forEach(function (item, index) {
if (item == (date[0] + '年')) {
y = index;
}
});
months.forEach(function (item, index) {
if (item == (parseInt(date[1]) + '月')) {
m = index;
}
});
days.forEach(function (item, index) {
if (item == (parseInt(date[2]) + '日')) {
d = index;
}
});
hours.forEach(function (item, index) {
if (item == parseInt(time[0])) {
h = index;
}
});
minutes.forEach(function (item, index) {
if (item == parseInt(time[1])) {
M = index;
}
});
return [y, m, d, h, M];
};
Component({
properties: {
initTime: {
type: String,
observer: function (newTime) {
this.data.timevalue = getInitDate(newTime);
this.setData({
timevalue: this.data.timevalue
});
}
}
},
observers: {},
data: {
timevalue: [],
years: years,
months: months,
days: days,
hours: hours,
minutes: minutes,
year: '',
month: '',
day: '',
hour: '',
minute: ''
},
lifetimes: {
attached: function () {
var year = this.data.years[0];
var month = this.data.months[0];
var day = this.data.days[0];
var hour = this.data.hours[0];
var minute = this.data.minutes[0];
this.setData({
year: year,
month: month,
day: day,
hour: hour,
minute: minute,
});
},
detached: function () {
},
},
methods: {
cancel: function () {
this.triggerEvent("cancel");
},
confirm: function () {
var _a = this.data, year = _a.year, month = _a.month, day = _a.day, hour = _a.hour, minute = _a.minute;
var time = getDate(year, month, day, hour, minute);
this.triggerEvent("confirm", { time: time });
},
fnbindChange: function (e) {
var val = e.detail.value;
var year = this.data.years[val[0]];
var month = this.data.months[val[1]];
var day = this.data.days[val[2]];
var hour = this.data.hours[val[3]];
var minute = this.data.minutes[val[4]];
var days = [];
var daynum = mGetDate(year.substr(0, year.length - 1), month.substr(0, month.length - 1));
for (var i = 1; i <= daynum; i++) {
days.push(i + "日");
}
this.setData({
days: days,
year: year,
month: month,
day: day,
hour: hour,
minute: minute,
});
}
}
});

4
components/DateTimePicker/index.json

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

39
components/DateTimePicker/index.wxml

@ -0,0 +1,39 @@
<!-- 组件模板 -->
<view class="wrapper">
<slot></slot>
<view >{{title}}</view>
<!-- 日期模态框 -->
<view class="modelboxbg"></view>
<view class="modelbox">
<view class = "model_picker">
<view class = "button_model">
<text catchtap='cancel' >取消</text>
<text catchtap='confirm' >确定</text>
</view>
<view class = "cont_model">
<picker-view indicator-style="height: 50px;" style="width: 100%; height: 300px;" value="{{timevalue}}" catchchange="fnbindChange">
<!-- 年 -->
<picker-view-column wx:if="{{years.length > 0}}">
<view wx:for="{{years}}" wx:key="index" style="line-height: 50px">{{item}}</view>
</picker-view-column>
<!-- 月 -->
<picker-view-column wx:if="{{months.length > 0}}">
<view wx:for="{{months}}" wx:key="index" style="line-height: 50px">{{item}}</view>
</picker-view-column>
<!-- 日 -->
<picker-view-column wx:if="{{days.length > 0}}">
<view wx:for="{{days}}" wx:key="index" style="line-height: 50px">{{item}}</view>
</picker-view-column>
<!-- 时 -->
<picker-view-column wx:if="{{hours.length > 0}}">
<view wx:for="{{hours}}" wx:key="index" style="line-height: 50px">{{item}}</view>
</picker-view-column>
<!-- 分 -->
<picker-view-column wx:if="{{minutes.length > 0}}">
<view wx:for="{{minutes}}" wx:key="index" style="line-height: 50px">{{item}}</view>
</picker-view-column>
</picker-view>
</view>
</view>
</view>
</view>

45
components/DateTimePicker/index.wxss

@ -0,0 +1,45 @@
/* 模态框开始 */
/* 蒙层 */
.modelboxbg{
position:absolute;
top:0;
z-index:10000;
width:100%;
height: 100%;
background: #000;
opacity: 0.3;
}
.modelbox{
position: fixed;
bottom:0;
z-index:999999;
width:100%;
background: #fff;
}
picker-view-column{
text-align: center;
}
view.model_picker{
position: relative;
}
.button_model{
height: 80rpx;
width: 100%;
background: #fff;
position: relative;
border-bottom: 1px solid #d9d9d9;
}
.button_model text{
color: #007aff;
position: absolute;
background:transparent;
border: none;
line-height: 80rpx;
}
.button_model text:first-child{
left: 32rpx;
}
.button_model text:last-child{
right: 32rpx;
}
/* 模态框结束 */

BIN
images/heart/apply.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

18
pages/heartNew/heartNew.js

@ -37,7 +37,9 @@ Page({
getImgUrl:"", getImgUrl:"",
ifClickImage:false,//因为志友多多点击图片查看大图,会出现列表刷新的bug,所以加这个字段进行控制 ifClickImage:false,//因为志友多多点击图片查看大图,会出现列表刷新的bug,所以加这个字段进行控制
tabFixed: false, tabFixed: false,
searchName: '' searchName: '',
infoCompleted: 0, //是否完善了用户信息
completeInfoDialogVisible: false,
}, },
/** /**
@ -49,6 +51,7 @@ Page({
this.setData({ this.setData({
statusHeight: app.globalData.deviceInfo.statusHeight, statusHeight: app.globalData.deviceInfo.statusHeight,
navigationHeight: app.globalData.deviceInfo.navigationHeight, navigationHeight: app.globalData.deviceInfo.navigationHeight,
infoCompleted: app.globalData.infoCompleted
}) })
let parms = { let parms = {
@ -432,5 +435,18 @@ Page({
tabFixed: false tabFixed: false
}) })
} }
},
//跳转到我要提交页面
myApply () {
if (this.data.infoCompleted == 0) {
this.setData({
completeInfoDialogVisible: !this.data.completeInfoDialogVisible
})
return false
}
wx.navigateTo({
url: "/subpages/heart/pages/myApply/myApply"
})
} }
}) })

3
pages/heartNew/heartNew.json

@ -8,7 +8,8 @@
"activity": "../../components/activity/activity", "activity": "../../components/activity/activity",
"load-more": "../../components/loadMore/loadMore", "load-more": "../../components/loadMore/loadMore",
"no-data": "../../components/nodata/nodata", "no-data": "../../components/nodata/nodata",
"volunteer-list":"./components/volunteer/volunteer" "volunteer-list":"./components/volunteer/volunteer",
"completeInfo-dialog": "../../components/completeInfoDialog/completeInfoDialog"
}, },
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
"backgroundColor": "#f8f8f8", "backgroundColor": "#f8f8f8",

11
pages/heartNew/heartNew.wxml

@ -97,4 +97,15 @@
<view class="details-top" hidden="{{jingcai}}"> <view class="details-top" hidden="{{jingcai}}">
<activity bind:toActDetail="toActDetailDown" id="state-2" state="2"></activity> <activity bind:toActDetail="toActDetailDown" id="state-2" state="2"></activity>
</view> </view>
<movable-area class="movable-area">
<movable-view class="movable-view" direction="all" inertia="true" friction="10">
<view class="my-apply" bindtap="myApply">
<image src="../../images/heart/apply.png" />
</view>
</movable-view>
</movable-area>
<load-more loadMoreVisible="{{loadMoreVisible}}" loadMoreType="{{loadMoreType}}"></load-more> <load-more loadMoreVisible="{{loadMoreVisible}}" loadMoreType="{{loadMoreType}}"></load-more>
<completeInfo-dialog completeInfoDialogVisible="{{completeInfoDialogVisible}}"></completeInfo-dialog>

34
pages/heartNew/heartNew.wxss

@ -462,3 +462,37 @@ button:last-child {
border: none; border: none;
} }
/* 搜索志愿者 end */ /* 搜索志愿者 end */
/* 悬浮按钮 start */
.movable-area{
pointer-events:none;
z-index: 999;
width: 100%;
height: 90%;
position: fixed;
top: 120rpx;
left: 0;
right: 0;
bottom: 0;
}
.movable-view{
pointer-events:auto;
width: 208rpx;
height: 122rpx;
transform: translateX(560rpx) translateY(680rpx) translateZ(0rpx) scale(1);
transform-origin: center center;
will-change: auto;
position: absolute;
top: 850rpx;
left: 520rpx;
}
.my-apply {
width: 208rpx;
height: 122rpx;
}
.my-apply image {
width: 100%;
height: 100%;
object-fit: cover;
}
/* 悬浮按钮 end */

17
project.config.json

@ -44,27 +44,16 @@
}, },
"scripts": {}, "scripts": {},
"condition": { "condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"plugin": { "plugin": {
"current": -1,
"list": [] "list": []
}, },
"game": { "game": {
"list": [] "list": []
}, },
"gamePlugin": { "gamePlugin": {
"current": -1,
"list": [] "list": []
}, },
"miniprogram": { "miniprogram": {
"current": -1,
"list": [ "list": [
{ {
"id": 0, "id": 0,
@ -128,6 +117,12 @@
"pathName": "subpages/heart/pages/leaderboardNew/leaderboardNew", "pathName": "subpages/heart/pages/leaderboardNew/leaderboardNew",
"query": "", "query": "",
"scene": null "scene": null
},
{
"name": "subpages/heart/pages/myApplyDetail/myApplyDetail",
"pathName": "subpages/heart/pages/myApplyDetail/myApplyDetail",
"query": "",
"scene": null
} }
] ]
} }

BIN
subpages/heart/images/my-applys.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
subpages/heart/images/submit-bk.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
subpages/heart/images/time.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

203
subpages/heart/pages/myApply/myApply.js

@ -0,0 +1,203 @@
// subpages/heart/pages/myApply/myApply.js
const api = require("../../../../utils/api")
Page({
/**
* 页面的初始数据
*/
data: {
showPicker: false, //是否显示底部时间选择器插件
dataForm: {
actTitle: '',
actContent: '',
actAddress: '',
actStartTime: '', //起始时间
actEndTime: '', //结束时间
actPeopleNum: 0,
actContacts: '',
actTel: ''
},
curCode: '', //区分是start还是end
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
// onShareAppMessage: function () {
// }
onInputTitle (e) {
this.setData({
'dataForm.actTitle': e.detail.value
})
},
onInputContent (e) {
this.setData({
'dataForm.actContent': e.detail.value
})
},
onInputAddress (e) {
this.setData({
'dataForm.actAddress': e.detail.value
})
},
onInputPeopleNum (e) {
this.setData({
'dataForm.actPeopleNum': parseInt(e.detail.value)
})
},
onInputContacts (e) {
this.setData({
'dataForm.actContacts': e.detail.value
})
},
onInputTel (e) {
this.setData({
'dataForm.actTel': e.detail.value
})
},
pickerCancel () {
console.log('取消日期选择')
this.setData({
showPicker: false
})
},
pickerConfirm (e) {
console.log('选择日期', e.detail.time)
if (this.data.curCode == 'start') {
this.setData({
showPicker: false,
'dataForm.actStartTime': e.detail.time
})
} else if (this.data.curCode == 'end') {
this.setData({
showPicker: false,
'dataForm.actEndTime': e.detail.time
})
if (this.data.dataForm.actStartTime > this.data.dataForm.actEndTime) {
wx.showToast({
title: '结束时间应该大于起始时间',
icon: 'none',
duration: 2000
})
}
}
},
//日期选择插件显示入口
selectTime (e) {
this.data.showPicker = !this.data.showPicker
this.setData({
showPicker: this.data.showPicker,
curCode: e.currentTarget.dataset.code
})
},
//提交申请
submitApply () {
if (!this.data.dataForm.actTitle) {
this.showToast("请填写活动标题")
return false
}
if (!this.data.dataForm.actContent) {
this.showToast("请填写活动内容")
return false
}
if (!this.data.dataForm.actAddress) {
this.showToast("请填写活动地址")
return false
}
if (!this.data.dataForm.actStartTime) {
this.showToast("请填写开始时间")
return false
}
if (!this.data.dataForm.actEndTime) {
this.showToast("请填写结束时间")
return false
}
if (!this.data.dataForm.actPeopleNum) {
this.showToast("请填写需要人数")
return false
}
if (!this.data.dataForm.actContacts) {
this.showToast("请填写联系人")
return false
}
if (!this.data.dataForm.actTel) {
this.showToast("请填写联系人电话")
return false
}
const para = { ...this.data.dataForm }
console.log('submit apply', para)
// api.applyAct(para).then(res => {
// console.log(res.data)
// })
},
//简化提示
showToast (title) {
wx.showToast({
title: title,
icon: "none",
duration: 2000
})
},
//跳转到我提交的申请列表
toApplyList () {
wx.navigateTo({
url: "/subpages/heart/pages/myApplyList/myApplyList"
})
},
})

6
subpages/heart/pages/myApply/myApply.json

@ -0,0 +1,6 @@
{
"navigationBarTitleText": "我要申请",
"usingComponents": {
"date-time-picker": "../../../../components/DateTimePicker/index"
}
}

48
subpages/heart/pages/myApply/myApply.wxml

@ -0,0 +1,48 @@
<!--subpages/heart/pages/myApply/myApply.wxml-->
<view class="my-apply">
<view class="apply-list">
<view class="my-apply-img" bindtap="toApplyList">
<image src="../../images/my-applys.png" />
</view>
<view class="apply-item">
<view class="item-title">志愿服务标题</view>
<input type="text" class="item-content" placeholder="请输入标题" value="{{dataForm.actTitle}}" bindinput="onInputTitle"></input>
</view>
<view class="apply-item text-item">
<view class="item-title">志愿服务内容</view>
<textarea class="item-content text-content" placeholder="请输入内容..." value="{{dataForm.actContent}}" bindinput="onInputContent"></textarea>
</view>
<view class="apply-item">
<view class="item-title">地点</view>
<input type="text" class="item-content" placeholder="请输入活动地点" value="{{dataForm.actAddress}}" bindinput="onInputAddress"></input>
</view>
<view class="apply-item">
<view class="item-title">时间</view>
<view class="time-group">
<view class="select-time" data-code="start" bindtap="selectTime"><image src="../../images/time.png" />{{dataForm.actStartTime||'开始时间'}}</view>
<view class="select-time" data-code="end" bindtap="selectTime"><image src="../../images/time.png" />{{dataForm.actEndTime||'结束时间'}}</view>
</view>
</view>
<view class="apply-item">
<view class="item-title">人数</view>
<input type="text" class="item-content" placeholder="请输入需要人数" value="{{dataForm.actPeopleNum}}" bindinput="onInputPeopleNum"></input>
</view>
<view class="apply-item">
<view class="item-title">联系人</view>
<input type="text" class="item-content" placeholder="请输入联系人" value="{{dataForm.actContacts}}" bindinput="onInputContacts"></input>
</view>
<view class="apply-item">
<view class="item-title">电话</view>
<input type="text" class="item-content" placeholder="请输入电话" value="{{dataForm.actTel}}" bindinput="onInputTel"></input>
</view>
</view>
<view class="submit" bindtap="submitApply">
<image class="submit-bk" src="../../images/submit-bk.png" />
<view class="submit-text">提交</view>
</view>
</view>
<view wx:if="{{showPicker}}">
<date-time-picker bind:cancel="pickerCancel" bind:confirm="pickerConfirm" init-time="{{typeTime.start}}"></date-time-picker>
</view>

102
subpages/heart/pages/myApply/myApply.wxss

@ -0,0 +1,102 @@
/* subpages/heart/pages/myApply/myApply.wxss */
page {
width: 100%;
height: auto;
overflow-y: auto;
background: #f7f7f7;
}
.apply-list {
}
.apply-list .my-apply-img {
position: absolute;
right: -10rpx;
}
.apply-list .my-apply-img image {
width: 208rpx;
height: 76rpx;
}
.apply-list .apply-item {
width: 100%;
height: 170rpx;
background-color: white;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
padding: 0rpx 30rpx;
margin-top: 16rpx;
box-sizing: border-box;
}
.apply-list .text-item {
height: 220rpx;
}
.apply-list .apply-item .item-title {
height: 50rpx;
line-height: 50rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
margin-bottom: 28rpx;
}
.apply-list .apply-item .item-content {
width: 100%;
height: 44rpx;
line-height: 44rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #999999;
}
.apply-list .apply-item .text-content {
height: 88rpx;
color: #666666;
}
.submit {
width: 592rpx;
height: 116rpx;
position: relative;
margin: 78rpx auto 0rpx;
}
.submit .submit-bk {
width: 100%;
height: 100%;
position: absolute;
z-index: -1;
}
.submit .submit-text {
font-size: 34rpx;
font-family: PingFang SC;
font-weight: 500;
color: #FFFFFF;
height: 100rpx;
line-height: 100rpx;
text-align: center;
}
.time-group {
width: 100%;
display: flex;
justify-content: space-around;
align-items: center;
}
.time-group .select-time {
width: 304rpx;
height: 50rpx;
/* background: #F7F7F7; */
border-radius: 25rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
}
.time-group .select-time image {
width: 26rpx;
height: 26rpx;
opacity: 0.76;
margin-right: 20rpx;
}

76
subpages/heart/pages/myApplyDetail/myApplyDetail.js

@ -0,0 +1,76 @@
// subpages/heart/pages/myApplyDetail/myApplyDetail.js
const api = require("../../../../utils/api")
Page({
/**
* 页面的初始数据
*/
data: {
applyId: '',
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
applyId: options.id
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
getApplyDetail () {
// api.applyActDetail(this.data.applyId).then(res => {
// console.log(res.data)
// })
},
})

4
subpages/heart/pages/myApplyDetail/myApplyDetail.json

@ -0,0 +1,4 @@
{
"navigationBarTitleText": "详情",
"usingComponents": {}
}

46
subpages/heart/pages/myApplyDetail/myApplyDetail.wxml

@ -0,0 +1,46 @@
<!--subpages/heart/pages/myApplyDetail/myApplyDetail.wxml-->
<view class="my-apply">
<view class="apply-detail">
<view class="apply-item">
<view class="item-title">志愿服务标题</view>
<view class="item-content">组织环保志愿服务队</view>
</view>
<view class="apply-item">
<view class="item-title">活动内容</view>
<view class="item-content">
1.卫生大扫除、清洗护城河、清洗乱涂画和“小广告”、清理卫生死角、捡拾垃圾 (果皮、纸屑)等活动
</view>
<view class="item-content">
2.组织志愿者植树、美化绿化小区
</view>
<view class="item-content">
3.计划生育志愿服务 组织开展自我教育
</view>
</view>
<view class="apply-item">
<view class="item-title">活动地点</view>
<view class="item-content">平阴县锦水街道</view>
</view>
<view class="apply-item">
<view class="item-title">活动时间</view>
<view class="item-content">2020-10-22 13:30 至 2020-10-24 12:30</view>
</view>
<view class="apply-item">
<view class="item-title">活动人数</view>
<view class="item-content">28</view>
</view>
<view class="apply-item">
<view class="item-title">活动联系人</view>
<view class="item-content">王宇</view>
</view>
<view class="apply-item">
<view class="item-title">联系人电话</view>
<view class="item-content">18888888888</view>
</view>
<view class="apply-item">
<view class="item-title">审核状态</view>
<view class="item-content">未通过</view>
<view class="item-content">原因:不符合要求</view>
</view>
</view>
</view>

41
subpages/heart/pages/myApplyDetail/myApplyDetail.wxss

@ -0,0 +1,41 @@
/* subpages/heart/pages/myApplyDetail/myApplyDetail.wxss */
page {
width: 100%;
height: auto;
overflow-y: auto;
background: #f7f7f7;
}
.apply-detail {
}
.apply-detail .apply-item {
width: 100%;
background-color: white;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
padding: 40rpx 30rpx;
margin-top: 16rpx;
box-sizing: border-box;
}
.apply-detail .apply-item .item-title {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
}
.apply-detail .apply-item .item-content {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #666666;
margin-top: 28rpx;
}
.apply-detail .apply-item .line {
width: 100%;
height: 1px;
background: #F2F2F2;
border-radius: 1px;
margin: 28rpx 0rpx;
}

133
subpages/heart/pages/myApplyList/myApplyList.js

@ -0,0 +1,133 @@
// subpages/heart/pages/myApplyList/myApplyList.js
const api = require("../../../../utils/api")
Page({
/**
* 页面的初始数据
*/
data: {
pageIndex: 1,
pageSize: 10,
nodata: false,
loadMoreType: 'none',
loadMoreVisible: false,
applylist: [
{
"id": "73290",
"actTitle": "洁美家园行动 组织开展以改善社区环境卫生",
"createdTime": "2020-10-22 15:20:00",
"actStatus": "0"
},
{
"id": "73291",
"actTitle": "组织开展以改善社区环境卫生为主内容的志愿活动,集中整治脏、乱、差现象",
"createdTime": "2020-10-22 15:20:00",
"actStatus": "1"
},
{
"id": "73292",
"actTitle": "便民服务中心志愿者",
"createdTime": "2020-10-22 15:20:00",
"actStatus": "2"
}
]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// this.getApplyList()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.setData({
loadMoreVisible: true
})
if (this.data.loadMoreType === "loading") {
this.setData({
pageIndex: this.data.pageIndex + 1
})
this.getApplyList()
}
},
/**
* 用户点击右上角分享
*/
// onShareAppMessage: function () {
// }
getApplyList () {
const para = {
pageIndex: this.data.pageIndex,
pageSize: this.data.pageSize
}
api.applyRecord(para).then(res => {
console.log(res)
this.setData({
applylist: [...this.data.applylist,...res.data],
loadMoreType: res.data.length === this.data.pageSize ? 'loading' : 'none',
loadMoreVisible: res.data.length === this.data.pageSize ? false : true
})
if (this.data.applylist.length == 0) {
this.setData({
nodata: true,
loadMoreType: 'none',
loadMoreVisible: false,
})
}
}).catch(err => {
this.setData({
applylist: [],
nodata: true,
loadMoreType: 'none',
loadMoreVisible: false,
})
console.log(err)
})
},
//跳转到申请信息详情
toApplyDetail (e) {
console.log('toApplyDetail', e.currentTarget.dataset.id)
}
})

4
subpages/heart/pages/myApplyList/myApplyList.json

@ -0,0 +1,4 @@
{
"navigationBarTitleText": "申请记录",
"usingComponents": {}
}

15
subpages/heart/pages/myApplyList/myApplyList.wxml

@ -0,0 +1,15 @@
<!--subpages/heart/pages/myApplyList/myApplyList.wxml-->
<view class="my-apply">
<view class="apply-list">
<view class="apply-item" data-id="{{item.id}}" bindtap="toApplyDetail" wx:for="{{applylist}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="item-title">{{item.actTitle}}</view>
<view class="line"></view>
<view class="item-time">提交时间:{{item.createdTime}}</view>
<view class="item-state">审核状态:<text class="state-{{item.actStatus}}">{{item.actStatus == '0' ? '待审核' : (item.actStatus == '1' ? '通过' : '未通过')}}</text></view>
</view>
</view>
</view>
<load-more loadMoreType="{{loadMoreType}}" loadMoreVisible="{{loadMoreVisible}}"></load-more>
<no-data isShow="{{nodata}}"></no-data>

74
subpages/heart/pages/myApplyList/myApplyList.wxss

@ -0,0 +1,74 @@
/* subpages/heart/pages/myApplyList/myApplyList.wxss */
page {
width: 100%;
height: auto;
overflow-y: auto;
background: #f7f7f7;
}
.apply-list {
}
.apply-list .my-apply-img {
position: absolute;
right: -10rpx;
}
.apply-list .my-apply-img image {
width: 208rpx;
height: 76rpx;
}
.apply-list .apply-item {
width: 100%;
background-color: white;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
padding: 0rpx 30rpx;
margin-top: 16rpx;
box-sizing: border-box;
}
.apply-list .text-item {
height: 220rpx;
}
.apply-list .apply-item .item-title {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
margin-top: 32rpx;
}
.apply-list .apply-item .item-content {
width: 100%;
height: 44rpx;
line-height: 44rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #999999;
}
.apply-list .apply-item .text-content {
height: 88rpx;
color: #666666;
}
.apply-list .apply-item .line {
width: 100%;
height: 1px;
background: #F2F2F2;
border-radius: 1px;
margin: 28rpx 0rpx;
}
.apply-list .apply-item .item-state {
margin: 26rpx 0rpx 28rpx;
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 400;
}
.apply-list .apply-item .item-state .state-0 {
color: #FB9F00;
}
.apply-list .apply-item .item-state .state-1 {
color: #666666;
}
.apply-list .apply-item .item-state .state-2 {
color: #D80000;
}

11
subpages/oneKeyService/pages/laobingzaixian/laobingzaixian.js

@ -75,6 +75,17 @@ Page({
this.setData({ this.setData({
deptList: res.data, deptList: res.data,
}) })
if (this.data.deptList.length == 0) {
this.setData({
nodata: true
})
}
}).catch(err => {
this.setData({
deptList: [],
nodata: true
})
console.log(err)
}) })
// api.getFullDictInfo(dictType).then(res => { // api.getFullDictInfo(dictType).then(res => {
// console.log(res) // console.log(res)

24
utils/api.js

@ -48,6 +48,9 @@ module.exports = {
completeInfoV2: completeInfoV2, completeInfoV2: completeInfoV2,
getTokenV3: getTokenV3, getTokenV3: getTokenV3,
getWxPhone: getWxPhone, getWxPhone: getWxPhone,
applyAct: applyAct,
applyRecord: applyRecord,
applyActDetail: applyActDetail,
completeResidentInfoV2: completeResidentInfoV2, completeResidentInfoV2: completeResidentInfoV2,
completePartyInfoV2: completePartyInfoV2, completePartyInfoV2: completePartyInfoV2,
userPointsRankinglist:userPointsRankinglist, userPointsRankinglist:userPointsRankinglist,
@ -483,6 +486,27 @@ function getWxPhone ({ wxCode, encryptedData, iv }) {
iv iv
}) })
} }
// 志愿者去哪儿-我要申请
function applyAct (para) {
return fly.post("heart/applyAct", para)
}
// 志愿者去哪儿-申请记录
function applyRecord ({
pageIndex,
pageSize
}) {
return fly.get("heart/applyRecord", {
pageIndex,
pageSize
})
}
// 志愿者去哪儿-活动详情
function applyActDetail (id) {
return fly.get(`heart/applyActDetail/${id}`)
}
// *****************************爱心互助接口***************************end // *****************************爱心互助接口***************************end
// 获取默认网格信息 // 获取默认网格信息
function getDefaultGridInfo () { function getDefaultGridInfo () {

4
utils/config.js

@ -6,8 +6,8 @@ module.exports = {
}; };
function BASEURL() { function BASEURL() {
// return 'https://eug-test.elinkit.com.cn/js/epdc-api/api/' // 锦水测试环境 return 'https://eug-test.elinkit.com.cn/js/epdc-api/api/' // 锦水测试环境
return 'https://epdc-jinshui.elinkservice.cn/epdc-api/api/' // 锦水正式环境接口地址 // return 'https://epdc-jinshui.elinkservice.cn/epdc-api/api/' // 锦水正式环境接口地址
// return 'http://192.168.43.19:9094/epdc-api/api/' // return 'http://192.168.43.19:9094/epdc-api/api/'
} }

Loading…
Cancel
Save