37 changed files with 1407 additions and 15 deletions
@ -0,0 +1,151 @@ |
|||||
|
"use strict"; |
||||
|
var date = new Date(); |
||||
|
var years = []; |
||||
|
var months = []; |
||||
|
var days = []; |
||||
|
var hours = []; |
||||
|
var minutes = []; |
||||
|
for (var i = date.getFullYear(); i < (date.getFullYear() + 2); i++) { |
||||
|
years.push(i + "年"); |
||||
|
} |
||||
|
// 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 |
@ -0,0 +1,65 @@ |
|||||
|
Component({ |
||||
|
data: { |
||||
|
visible: false |
||||
|
}, |
||||
|
properties: { |
||||
|
dialogVisible: { |
||||
|
type: Boolean, |
||||
|
value: false, |
||||
|
observer: function () { |
||||
|
this.setData({ |
||||
|
visible: !this.data.visible |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
title: { |
||||
|
type: String, |
||||
|
value: "" |
||||
|
}, |
||||
|
content: { |
||||
|
type: Array, |
||||
|
value: [] |
||||
|
}, |
||||
|
confirmText: { |
||||
|
type: String, |
||||
|
value: "" |
||||
|
}, |
||||
|
cancelText: { |
||||
|
type: String, |
||||
|
value: "" |
||||
|
} |
||||
|
}, |
||||
|
pageLifetimes: { |
||||
|
show () { |
||||
|
|
||||
|
}, |
||||
|
hide () { |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
lifetimes: { |
||||
|
attached () { |
||||
|
|
||||
|
}, |
||||
|
detached () { |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
close () { |
||||
|
this.triggerEvent("close") |
||||
|
this.setData({ |
||||
|
visible: false |
||||
|
}) |
||||
|
}, |
||||
|
confirm () { |
||||
|
this.triggerEvent("confirm") |
||||
|
this.setData({ |
||||
|
visible: false |
||||
|
}) |
||||
|
}, |
||||
|
catchmove () { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
}) |
@ -0,0 +1,6 @@ |
|||||
|
{ |
||||
|
"component": true, |
||||
|
"usingComponents": { |
||||
|
"wux-icon": "../../../../dist/icon/index" |
||||
|
} |
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
<cover-view class="notice" wx:if="{{visible}}" catchmove="catchmove"> |
||||
|
<cover-view class="box"> |
||||
|
<cover-view class="close"> |
||||
|
<cover-image bindtap="close" src="../../images/delete.png" /> |
||||
|
</cover-view> |
||||
|
<cover-view class="title">{{title}}</cover-view> |
||||
|
<cover-view class="content"> |
||||
|
<cover-view wx:for="{{content}}" wx:key="index" wx:for-item="item" wx:for-index="index">{{item}}</cover-view> |
||||
|
</cover-view> |
||||
|
<cover-view wx:if="{{cancelText !== '' || confirmText !== ''}}" class="border"></cover-view> |
||||
|
<cover-view class="operation"> |
||||
|
<cover-view wx:if="{{cancelText !== ''}}" class="cancel" bindtap="close">{{cancelText}}</cover-view> |
||||
|
<cover-view wx:if="{{confirmText !== ''}}" class="confirm" bindtap="confirm">{{confirmText}}</cover-view> |
||||
|
</cover-view> |
||||
|
</cover-view> |
||||
|
</cover-view> |
@ -0,0 +1,84 @@ |
|||||
|
.notice { |
||||
|
width: 100%; |
||||
|
height: 100vh; |
||||
|
position: fixed; |
||||
|
z-index: 100; |
||||
|
left: 0; |
||||
|
top: 0; |
||||
|
background: rgba(0,0,0, 0.4); |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
} |
||||
|
.notice .box { |
||||
|
width: 490rpx; |
||||
|
background: #fff; |
||||
|
border-radius: 16rpx; |
||||
|
overflow: hidden; |
||||
|
padding: 0 20rpx; |
||||
|
position: relative; |
||||
|
} |
||||
|
.notice .box .close { |
||||
|
width:100%; |
||||
|
height: 60rpx; |
||||
|
display: flex; |
||||
|
justify-content: flex-end; |
||||
|
align-items: center; |
||||
|
} |
||||
|
.notice .box .close cover-image { |
||||
|
width: 40rpx; |
||||
|
height: 40rpx; |
||||
|
object-fit: cover; |
||||
|
} |
||||
|
.notice .box .title { |
||||
|
height: 60rpx; |
||||
|
line-height: 60rpx; |
||||
|
width: 100%; |
||||
|
text-align:center; |
||||
|
font-size: 36rpx; |
||||
|
color: #333; |
||||
|
margin-bottom: 23rpx; |
||||
|
} |
||||
|
.notice .box .content { |
||||
|
height: auto; |
||||
|
width: 100%; |
||||
|
padding-bottom: 35rpx; |
||||
|
} |
||||
|
.notice .box .content cover-view { |
||||
|
font-size: 30rpx; |
||||
|
line-height: 50rpx; |
||||
|
height: 50rpx; |
||||
|
width: 100%; |
||||
|
text-align: center; |
||||
|
color: #666; |
||||
|
} |
||||
|
.notice .box .border { |
||||
|
width: 100%; |
||||
|
height: 0; |
||||
|
border: 0.5rpx solid #eaeaea; |
||||
|
border-bottom: 1rpx solid transparent; |
||||
|
position: absolute; |
||||
|
left:0; |
||||
|
bottom: 105rpx; |
||||
|
} |
||||
|
.notice .box .operation { |
||||
|
width: calc(100% - 40rpx); |
||||
|
height: 75rpx; |
||||
|
padding: 15rpx 0; |
||||
|
display: flex; |
||||
|
justify-content: space-around; |
||||
|
align-items: center; |
||||
|
margin-left: 20rpx |
||||
|
} |
||||
|
.notice .box .operation cover-view { |
||||
|
flex: 1; |
||||
|
color: #999; |
||||
|
font-size: 36rpx; |
||||
|
width: 49%; |
||||
|
height: 100%; |
||||
|
line-height: 75rpx; |
||||
|
text-align:center; |
||||
|
} |
||||
|
.notice .box .operation .confirm{ |
||||
|
color: #04BCA0; |
||||
|
} |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 8.6 KiB |
After Width: | Height: | Size: 2.7 KiB |
@ -0,0 +1,237 @@ |
|||||
|
// subpages/heart/pages/myApply/myApply.js
|
||||
|
const api = require("../../../../utils/api") |
||||
|
import { getTimestamp } from "../../../../utils/common" |
||||
|
|
||||
|
Page({ |
||||
|
|
||||
|
/** |
||||
|
* 页面的初始数据 |
||||
|
*/ |
||||
|
data: { |
||||
|
showPicker: false, //是否显示底部时间选择器插件
|
||||
|
dataForm: { |
||||
|
actTitle: '', |
||||
|
actContent: '', |
||||
|
actAddress: '', |
||||
|
actStartTime: '', //起始时间
|
||||
|
actEndTime: '', //结束时间
|
||||
|
actPeopleNum: '', |
||||
|
actContacts: '', |
||||
|
actTel: '', |
||||
|
dialogVisible: false, //提示框
|
||||
|
}, |
||||
|
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': 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 |
||||
|
}) |
||||
|
|
||||
|
if (this.data.dataForm.actStartTime < getTimestamp()) { |
||||
|
this.showToast("开始时间应该大于当前时间") |
||||
|
} |
||||
|
} else if (this.data.curCode == 'end') { |
||||
|
this.setData({ |
||||
|
showPicker: false, |
||||
|
'dataForm.actEndTime': e.detail.time |
||||
|
}) |
||||
|
|
||||
|
if (this.data.dataForm.actStartTime > this.data.dataForm.actEndTime) { |
||||
|
this.showToast('结束时间应该大于起始时间') |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
//日期选择插件显示入口
|
||||
|
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.actStartTime < getTimestamp()) { |
||||
|
this.showToast("开始时间应该大于当前时间") |
||||
|
return false |
||||
|
} |
||||
|
if (!this.data.dataForm.actEndTime) { |
||||
|
this.showToast("请填写结束时间") |
||||
|
return false |
||||
|
} |
||||
|
if (this.data.dataForm.actStartTime > this.data.dataForm.actEndTime) { |
||||
|
this.showToast('结束时间应该大于起始时间') |
||||
|
return false |
||||
|
} |
||||
|
if (!this.data.dataForm.actPeopleNum) { |
||||
|
this.showToast("请填写需要人数") |
||||
|
return false |
||||
|
} |
||||
|
if (!(parseInt(this.data.dataForm.actPeopleNum) > 0)) { |
||||
|
this.showToast("请填写正确的人数") |
||||
|
return false |
||||
|
} |
||||
|
if (!this.data.dataForm.actContacts) { |
||||
|
this.showToast("请填写联系人") |
||||
|
return false |
||||
|
} |
||||
|
if (!this.data.dataForm.actTel) { |
||||
|
this.showToast("请填写联系人电话") |
||||
|
return false |
||||
|
} |
||||
|
this.setData({ |
||||
|
'dataForm.actPeopleNum': parseInt(this.data.dataForm.actPeopleNum) |
||||
|
}) |
||||
|
const para = { ...this.data.dataForm } |
||||
|
console.log('submit apply', para) |
||||
|
api.applyAct(para).then(res => { |
||||
|
if(res.code == '' && res.msg == 'success') { |
||||
|
this.setData({ |
||||
|
dialogVisible: !this.data.dialogVisible |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
//简化提示
|
||||
|
showToast (title) { |
||||
|
wx.showToast({ |
||||
|
title: title, |
||||
|
icon: "none", |
||||
|
duration: 2000 |
||||
|
}) |
||||
|
}, |
||||
|
//跳转到我提交的申请列表
|
||||
|
toApplyList () { |
||||
|
wx.navigateTo({ |
||||
|
url: "/subpages/heart/pages/myApplyList/myApplyList" |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 关闭弹框
|
||||
|
closeDialog () { |
||||
|
wx.navigateTo({ |
||||
|
url: "/pages/heartNew/heartNew" |
||||
|
}) |
||||
|
}, |
||||
|
// 弹框确定按钮
|
||||
|
confirmDialog () { |
||||
|
wx.navigateTo({ |
||||
|
url: "/pages/heartNew/heartNew" |
||||
|
}) |
||||
|
} |
||||
|
}) |
@ -0,0 +1,7 @@ |
|||||
|
{ |
||||
|
"navigationBarTitleText": "我要申请", |
||||
|
"usingComponents": { |
||||
|
"date-time-picker": "../../../../components/DateTimePicker/index", |
||||
|
"notice": "../../components/notice/notice" |
||||
|
} |
||||
|
} |
@ -0,0 +1,49 @@ |
|||||
|
<!--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="{{dataForm.actStartTime}}"></date-time-picker> |
||||
|
</view> |
||||
|
|
||||
|
<notice bind:close="closeDialog" bind:confirm="confirmDialog" dialogVisible="{{dialogVisible}}" title="待审核" content="{{['工作人员会尽快审核您的活动申请', '请耐心等待']}}" confirmText="知道了"></notice> |
@ -0,0 +1,103 @@ |
|||||
|
/* subpages/heart/pages/myApply/myApply.wxss */ |
||||
|
page { |
||||
|
width: 100%; |
||||
|
overflow-y: auto; |
||||
|
background: #f7f7f7; |
||||
|
} |
||||
|
.apply-list { |
||||
|
position: relative; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
.apply-list .my-apply-img { |
||||
|
position: absolute; |
||||
|
right: -10rpx; |
||||
|
top: 16rpx; |
||||
|
} |
||||
|
.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: #666666; |
||||
|
} |
||||
|
.apply-list .apply-item .text-content { |
||||
|
font-weight: 400; |
||||
|
height: 88rpx; |
||||
|
} |
||||
|
.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,81 @@ |
|||||
|
// subpages/heart/pages/myApplyDetail/myApplyDetail.js
|
||||
|
const api = require("../../../../utils/api") |
||||
|
|
||||
|
Page({ |
||||
|
|
||||
|
/** |
||||
|
* 页面的初始数据 |
||||
|
*/ |
||||
|
data: { |
||||
|
applyId: '', |
||||
|
applyDetails: {} |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面加载 |
||||
|
*/ |
||||
|
onLoad: function (options) { |
||||
|
this.setData({ |
||||
|
applyId: options.id |
||||
|
}) |
||||
|
this.getApplyDetail() |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面初次渲染完成 |
||||
|
*/ |
||||
|
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)
|
||||
|
this.setData({ |
||||
|
applyDetails: res.data |
||||
|
}) |
||||
|
}) |
||||
|
}, |
||||
|
}) |
@ -0,0 +1,4 @@ |
|||||
|
{ |
||||
|
"navigationBarTitleText": "详情", |
||||
|
"usingComponents": {} |
||||
|
} |
@ -0,0 +1,40 @@ |
|||||
|
<!--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">{{applyDetails.actTitle}}</view> |
||||
|
</view> |
||||
|
<view class="apply-item"> |
||||
|
<view class="item-title">活动内容</view> |
||||
|
<view class="item-content"> |
||||
|
{{applyDetails.actContent}} |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="apply-item"> |
||||
|
<view class="item-title">活动地点</view> |
||||
|
<view class="item-content">{{applyDetails.actAddress}}</view> |
||||
|
</view> |
||||
|
<view class="apply-item"> |
||||
|
<view class="item-title">活动时间</view> |
||||
|
<view class="item-content">{{applyDetails.actStartTime}} 至 {{applyDetails.actEndTime}}</view> |
||||
|
</view> |
||||
|
<view class="apply-item"> |
||||
|
<view class="item-title">活动人数</view> |
||||
|
<view class="item-content">{{applyDetails.actPeopleNum}}</view> |
||||
|
</view> |
||||
|
<view class="apply-item"> |
||||
|
<view class="item-title">活动联系人</view> |
||||
|
<view class="item-content">{{applyDetails.actContacts}}</view> |
||||
|
</view> |
||||
|
<view class="apply-item"> |
||||
|
<view class="item-title">联系人电话</view> |
||||
|
<view class="item-content">{{applyDetails.actTel}}</view> |
||||
|
</view> |
||||
|
<view class="apply-item"> |
||||
|
<view class="item-title">审核状态</view> |
||||
|
<view class="item-content">{{applyDetails.actStatus}}</view> |
||||
|
<view class="item-content" wx:if="{{applyDetails.noPassReason}}">原因:{{applyDetails.noPassReason}}</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 { |
||||
|
margin-bottom: 60rpx; |
||||
|
} |
||||
|
.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,118 @@ |
|||||
|
// subpages/heart/pages/myApplyList/myApplyList.js
|
||||
|
const { checkWxUnionId } = require("../../../../utils/api") |
||||
|
const api = require("../../../../utils/api") |
||||
|
|
||||
|
Page({ |
||||
|
|
||||
|
/** |
||||
|
* 页面的初始数据 |
||||
|
*/ |
||||
|
data: { |
||||
|
pageIndex: 1, |
||||
|
pageSize: 10, |
||||
|
nodata: false, |
||||
|
loadMoreType: 'none', |
||||
|
loadMoreVisible: false, |
||||
|
applylist: [] |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 生命周期函数--监听页面加载 |
||||
|
*/ |
||||
|
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('跳转申请详情', e.currentTarget.dataset.id) |
||||
|
wx.navigateTo({ |
||||
|
url: `/subpages/heart/pages/myApplyDetail/myApplyDetail?id=${e.currentTarget.dataset.id}` |
||||
|
}) |
||||
|
} |
||||
|
}) |
@ -0,0 +1,7 @@ |
|||||
|
{ |
||||
|
"navigationBarTitleText": "申请记录", |
||||
|
"usingComponents": { |
||||
|
"load-more": "/components/loadMore/loadMore", |
||||
|
"no-data": "/components/nodata/nodata" |
||||
|
} |
||||
|
} |
@ -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,81 @@ |
|||||
|
/* 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-time { |
||||
|
font-size: 30rpx; |
||||
|
font-family: PingFang SC; |
||||
|
font-weight: 400; |
||||
|
color: #666666; |
||||
|
} |
||||
|
.apply-list .apply-item .item-state { |
||||
|
margin: 26rpx 0rpx 28rpx; |
||||
|
font-size: 30rpx; |
||||
|
font-family: PingFang SC; |
||||
|
font-weight: 400; |
||||
|
color: #666666; |
||||
|
} |
||||
|
.apply-list .apply-item .item-state .state-0 { |
||||
|
color: #FB9F00; |
||||
|
} |
||||
|
.apply-list .apply-item .item-state .state-1 { |
||||
|
color: #28C896; |
||||
|
} |
||||
|
.apply-list .apply-item .item-state .state-2 { |
||||
|
color: #D80000; |
||||
|
} |
Loading…
Reference in new issue