29 changed files with 1101 additions and 18 deletions
@ -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, |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
}); |
@ -0,0 +1,4 @@ |
|||||
|
{ |
||||
|
"component": true, |
||||
|
"usingComponents": {} |
||||
|
} |
@ -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> |
@ -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; |
||||
|
} |
||||
|
/* 模态框结束 */ |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 8.6 KiB |
After Width: | Height: | Size: 2.7 KiB |
@ -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" |
||||
|
}) |
||||
|
}, |
||||
|
}) |
@ -0,0 +1,6 @@ |
|||||
|
{ |
||||
|
"navigationBarTitleText": "我要申请", |
||||
|
"usingComponents": { |
||||
|
"date-time-picker": "../../../../components/DateTimePicker/index" |
||||
|
} |
||||
|
} |
@ -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> |
||||
|
|
@ -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; |
||||
|
} |
@ -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)
|
||||
|
// })
|
||||
|
}, |
||||
|
}) |
@ -0,0 +1,4 @@ |
|||||
|
{ |
||||
|
"navigationBarTitleText": "详情", |
||||
|
"usingComponents": {} |
||||
|
} |
@ -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> |
@ -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; |
||||
|
} |
@ -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) |
||||
|
} |
||||
|
}) |
@ -0,0 +1,4 @@ |
|||||
|
{ |
||||
|
"navigationBarTitleText": "申请记录", |
||||
|
"usingComponents": {} |
||||
|
} |
@ -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> |
@ -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; |
||||
|
} |
Loading…
Reference in new issue