diff --git a/app.json b/app.json index 30ced87..bfa8119 100644 --- a/app.json +++ b/app.json @@ -111,7 +111,10 @@ "pages/signed/signed", "pages/refusedOrEndedDetail/refusedOrEndedDetail", "pages/cancelDetail/cancelDetail", - "pages/noticeDetail/noticeDetail" + "pages/noticeDetail/noticeDetail", + "pages/myApply/myApply", + "pages/myApplyList/myApplyList", + "pages/myApplyDetail/myApplyDetail" ] }, { diff --git a/components/DateTimePicker/index.js b/components/DateTimePicker/index.js new file mode 100644 index 0000000..3400efd --- /dev/null +++ b/components/DateTimePicker/index.js @@ -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, + }); + } + } +}); diff --git a/components/DateTimePicker/index.json b/components/DateTimePicker/index.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/DateTimePicker/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/DateTimePicker/index.wxml b/components/DateTimePicker/index.wxml new file mode 100644 index 0000000..a0ea10b --- /dev/null +++ b/components/DateTimePicker/index.wxml @@ -0,0 +1,39 @@ + + + + {{title}} + + + + + + 取消 + 确定 + + + + + + {{item}} + + + + {{item}} + + + + {{item}} + + + + {{item}} + + + + {{item}} + + + + + + \ No newline at end of file diff --git a/components/DateTimePicker/index.wxss b/components/DateTimePicker/index.wxss new file mode 100644 index 0000000..b45faaa --- /dev/null +++ b/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; +} +/* 模态框结束 */ \ No newline at end of file diff --git a/images/heart/apply.png b/images/heart/apply.png new file mode 100644 index 0000000..9a32682 Binary files /dev/null and b/images/heart/apply.png differ diff --git a/pages/heartNew/heartNew.js b/pages/heartNew/heartNew.js index 7cc5ef9..e2f30d7 100644 --- a/pages/heartNew/heartNew.js +++ b/pages/heartNew/heartNew.js @@ -37,7 +37,9 @@ Page({ getImgUrl:"", ifClickImage:false,//因为志友多多点击图片查看大图,会出现列表刷新的bug,所以加这个字段进行控制 tabFixed: false, - searchName: '' + searchName: '', + infoCompleted: 0, //是否完善了用户信息 + completeInfoDialogVisible: false, }, /** @@ -49,6 +51,7 @@ Page({ this.setData({ statusHeight: app.globalData.deviceInfo.statusHeight, navigationHeight: app.globalData.deviceInfo.navigationHeight, + infoCompleted: app.globalData.infoCompleted }) let parms = { @@ -432,5 +435,18 @@ Page({ tabFixed: false }) } + }, + + //跳转到我要提交页面 + myApply () { + if (this.data.infoCompleted == 0) { + this.setData({ + completeInfoDialogVisible: !this.data.completeInfoDialogVisible + }) + return false + } + wx.navigateTo({ + url: "/subpages/heart/pages/myApply/myApply" + }) } }) \ No newline at end of file diff --git a/pages/heartNew/heartNew.json b/pages/heartNew/heartNew.json index 5cb8d09..791eee5 100644 --- a/pages/heartNew/heartNew.json +++ b/pages/heartNew/heartNew.json @@ -8,7 +8,8 @@ "activity": "../../components/activity/activity", "load-more": "../../components/loadMore/loadMore", "no-data": "../../components/nodata/nodata", - "volunteer-list":"./components/volunteer/volunteer" + "volunteer-list":"./components/volunteer/volunteer", + "completeInfo-dialog": "../../components/completeInfoDialog/completeInfoDialog" }, "enablePullDownRefresh": true, "backgroundColor": "#f8f8f8", diff --git a/pages/heartNew/heartNew.wxml b/pages/heartNew/heartNew.wxml index 80f0191..423c205 100644 --- a/pages/heartNew/heartNew.wxml +++ b/pages/heartNew/heartNew.wxml @@ -97,4 +97,15 @@ - \ No newline at end of file + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/heartNew/heartNew.wxss b/pages/heartNew/heartNew.wxss index 662a677..f898731 100644 --- a/pages/heartNew/heartNew.wxss +++ b/pages/heartNew/heartNew.wxss @@ -461,4 +461,38 @@ button:last-child { border-radius: 0px; border: none; } -/* 搜索志愿者 end */ \ No newline at end of file +/* 搜索志愿者 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 */ \ No newline at end of file diff --git a/subpages/heart/components/notice/notice.js b/subpages/heart/components/notice/notice.js new file mode 100644 index 0000000..90d0c31 --- /dev/null +++ b/subpages/heart/components/notice/notice.js @@ -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 () { + + } + } +}) \ No newline at end of file diff --git a/subpages/heart/components/notice/notice.json b/subpages/heart/components/notice/notice.json new file mode 100644 index 0000000..d3738ed --- /dev/null +++ b/subpages/heart/components/notice/notice.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "wux-icon": "../../../../dist/icon/index" + } +} \ No newline at end of file diff --git a/subpages/heart/components/notice/notice.wxml b/subpages/heart/components/notice/notice.wxml new file mode 100644 index 0000000..351156f --- /dev/null +++ b/subpages/heart/components/notice/notice.wxml @@ -0,0 +1,16 @@ + + + + + + {{title}} + + {{item}} + + + + {{cancelText}} + {{confirmText}} + + + \ No newline at end of file diff --git a/subpages/heart/components/notice/notice.wxss b/subpages/heart/components/notice/notice.wxss new file mode 100644 index 0000000..1e34473 --- /dev/null +++ b/subpages/heart/components/notice/notice.wxss @@ -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; +} diff --git a/subpages/heart/images/goback.png b/subpages/heart/images/goback.png new file mode 100644 index 0000000..9d3eb63 Binary files /dev/null and b/subpages/heart/images/goback.png differ diff --git a/subpages/heart/images/my-applys.png b/subpages/heart/images/my-applys.png new file mode 100644 index 0000000..2e861cd Binary files /dev/null and b/subpages/heart/images/my-applys.png differ diff --git a/subpages/heart/images/submit-bk.png b/subpages/heart/images/submit-bk.png new file mode 100644 index 0000000..c081477 Binary files /dev/null and b/subpages/heart/images/submit-bk.png differ diff --git a/subpages/heart/images/time.png b/subpages/heart/images/time.png new file mode 100644 index 0000000..3e52fc1 Binary files /dev/null and b/subpages/heart/images/time.png differ diff --git a/subpages/heart/pages/myApply/myApply.js b/subpages/heart/pages/myApply/myApply.js new file mode 100644 index 0000000..536e5e9 --- /dev/null +++ b/subpages/heart/pages/myApply/myApply.js @@ -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" + }) + } +}) \ No newline at end of file diff --git a/subpages/heart/pages/myApply/myApply.json b/subpages/heart/pages/myApply/myApply.json new file mode 100644 index 0000000..4a7fc4a --- /dev/null +++ b/subpages/heart/pages/myApply/myApply.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "我要申请", + "usingComponents": { + "date-time-picker": "../../../../components/DateTimePicker/index", + "notice": "../../components/notice/notice" + } +} \ No newline at end of file diff --git a/subpages/heart/pages/myApply/myApply.wxml b/subpages/heart/pages/myApply/myApply.wxml new file mode 100644 index 0000000..67279eb --- /dev/null +++ b/subpages/heart/pages/myApply/myApply.wxml @@ -0,0 +1,49 @@ + + + + + + + + 志愿服务标题 + + + + 志愿服务内容 + + + + 地点 + + + + 时间 + + {{dataForm.actStartTime||'开始时间'}} + 至 + {{dataForm.actEndTime||'结束时间'}} + + + + 人数 + + + + 联系人 + + + + 电话 + + + + + + 提交 + + + + + + + diff --git a/subpages/heart/pages/myApply/myApply.wxss b/subpages/heart/pages/myApply/myApply.wxss new file mode 100644 index 0000000..1abe692 --- /dev/null +++ b/subpages/heart/pages/myApply/myApply.wxss @@ -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; +} \ No newline at end of file diff --git a/subpages/heart/pages/myApplyDetail/myApplyDetail.js b/subpages/heart/pages/myApplyDetail/myApplyDetail.js new file mode 100644 index 0000000..69d3ff3 --- /dev/null +++ b/subpages/heart/pages/myApplyDetail/myApplyDetail.js @@ -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 + }) + }) + }, +}) \ No newline at end of file diff --git a/subpages/heart/pages/myApplyDetail/myApplyDetail.json b/subpages/heart/pages/myApplyDetail/myApplyDetail.json new file mode 100644 index 0000000..61f0f4a --- /dev/null +++ b/subpages/heart/pages/myApplyDetail/myApplyDetail.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "详情", + "usingComponents": {} +} \ No newline at end of file diff --git a/subpages/heart/pages/myApplyDetail/myApplyDetail.wxml b/subpages/heart/pages/myApplyDetail/myApplyDetail.wxml new file mode 100644 index 0000000..d6eea20 --- /dev/null +++ b/subpages/heart/pages/myApplyDetail/myApplyDetail.wxml @@ -0,0 +1,40 @@ + + + + + 活动标题 + {{applyDetails.actTitle}} + + + 活动内容 + + {{applyDetails.actContent}} + + + + 活动地点 + {{applyDetails.actAddress}} + + + 活动时间 + {{applyDetails.actStartTime}} 至 {{applyDetails.actEndTime}} + + + 活动人数 + {{applyDetails.actPeopleNum}} + + + 活动联系人 + {{applyDetails.actContacts}} + + + 联系人电话 + {{applyDetails.actTel}} + + + 审核状态 + {{applyDetails.actStatus}} + 原因:{{applyDetails.noPassReason}} + + + diff --git a/subpages/heart/pages/myApplyDetail/myApplyDetail.wxss b/subpages/heart/pages/myApplyDetail/myApplyDetail.wxss new file mode 100644 index 0000000..bfbba63 --- /dev/null +++ b/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 { + 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; +} \ No newline at end of file diff --git a/subpages/heart/pages/myApplyList/myApplyList.js b/subpages/heart/pages/myApplyList/myApplyList.js new file mode 100644 index 0000000..0c7f608 --- /dev/null +++ b/subpages/heart/pages/myApplyList/myApplyList.js @@ -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}` + }) + } +}) \ No newline at end of file diff --git a/subpages/heart/pages/myApplyList/myApplyList.json b/subpages/heart/pages/myApplyList/myApplyList.json new file mode 100644 index 0000000..aa4bbe7 --- /dev/null +++ b/subpages/heart/pages/myApplyList/myApplyList.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "申请记录", + "usingComponents": { + "load-more": "/components/loadMore/loadMore", + "no-data": "/components/nodata/nodata" + } +} \ No newline at end of file diff --git a/subpages/heart/pages/myApplyList/myApplyList.wxml b/subpages/heart/pages/myApplyList/myApplyList.wxml new file mode 100644 index 0000000..1e7a98b --- /dev/null +++ b/subpages/heart/pages/myApplyList/myApplyList.wxml @@ -0,0 +1,15 @@ + + + + + {{item.actTitle}} + + 提交时间:{{item.createdTime}} + 审核状态:{{item.actStatus == '0' ? '待审核' : (item.actStatus == '1' ? '通过' : '未通过')}} + + + + + + + diff --git a/subpages/heart/pages/myApplyList/myApplyList.wxss b/subpages/heart/pages/myApplyList/myApplyList.wxss new file mode 100644 index 0000000..7d01ef5 --- /dev/null +++ b/subpages/heart/pages/myApplyList/myApplyList.wxss @@ -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; +} \ No newline at end of file diff --git a/subpages/heart/pages/volunteer/volunteer.js b/subpages/heart/pages/volunteer/volunteer.js index 0726aeb..b976176 100644 --- a/subpages/heart/pages/volunteer/volunteer.js +++ b/subpages/heart/pages/volunteer/volunteer.js @@ -8,6 +8,9 @@ Page({ * 页面的初始数据 全部为必填项 */ data: { + statusHeight: 0, // 自定义头部状态栏高度 + navigationHeight: 0, // 自定义头部导航栏高度 + getImgUrl: '', //后台配置背景 realName: "", //真实姓名 mobile: "", //手机号 identityNo: "", //身份证号码 @@ -37,12 +40,23 @@ Page({ disabled:false }, onLoad: function () { + this.setData({ + statusHeight: app.globalData.deviceInfo.statusHeight, + navigationHeight: app.globalData.deviceInfo.navigationHeight + }) + this.getImgUrl() this.getPrepareComplete().then(() => { this.getGridList() }) this.checkWxUnionId() this.getWxCode() }, + //返回上一级 + goback () { + wx.navigateBack({ + delta: 1 + }) + }, bindRealNameInput (e) { this.setData({ realName: e.detail.value @@ -97,6 +111,15 @@ Page({ volunteerSignature: e.detail.value }) }, + // 获取配置图片 + getImgUrl:function (){//0:咨询热线 + let that = this + api.getImgUrl("4").then(function (res) { + that.setData({ + getImgUrl: res.data[0] + }) + }) + }, // 查看用户是否完善个人信息 checkWxUnionId () { api.checkWxUnionId().then(res => { diff --git a/subpages/heart/pages/volunteer/volunteer.json b/subpages/heart/pages/volunteer/volunteer.json index c001ecc..61cd0be 100644 --- a/subpages/heart/pages/volunteer/volunteer.json +++ b/subpages/heart/pages/volunteer/volunteer.json @@ -1,5 +1,6 @@ { "navigationBarTitleText": "志愿者认证", + "navigationStyle": "custom", "usingComponents": { "wux-dialog": "../../../../dist/dialog/index", "coverview-dialog": "../../components/coverViewDialog/coverViewDialog", diff --git a/subpages/heart/pages/volunteer/volunteer.wxml b/subpages/heart/pages/volunteer/volunteer.wxml index 96dc13d..26fd3e6 100644 --- a/subpages/heart/pages/volunteer/volunteer.wxml +++ b/subpages/heart/pages/volunteer/volunteer.wxml @@ -1,13 +1,25 @@ - + + + + + + + + 志愿者去哪儿 + + + + + - + - + 基本信息 @@ -93,7 +105,7 @@ - + 居住地址 diff --git a/subpages/heart/pages/volunteer/volunteer.wxss b/subpages/heart/pages/volunteer/volunteer.wxss index 1d66626..6c3c819 100644 --- a/subpages/heart/pages/volunteer/volunteer.wxss +++ b/subpages/heart/pages/volunteer/volunteer.wxss @@ -2,23 +2,81 @@ page { background: #f7f7f7; } +.header { + position: fixed; + width: 100%; + top: 0; + left: 0; + z-index: 999; +} + +.header .header-bg { + width: 100%; + height: 100%; + position: absolute; + z-index: 10; + left: 0; + top: 0; +} + + + +.header .navigation { + /* width: calc(100% - 46rpx); + margin-left: 46rpx; */ + display: flex; + align-items: center; + /* justify-content: center; */ + position: relative; + z-index: 100; +} + +.header .navigation .goback { + width: 40rpx; + padding-left: 14rpx; + display: flex; + align-items: center; + justify-content: center; + height: 100%; +} + +.header .navigation .goback image { + width: 16rpx; + height: 28rpx; +} + +.header .navigation .title { + display: flex; + align-items: center; + /* justify-content: center; */ + width: calc(100% - 46rpx); + margin-left: 46rpx; + color: rgba(255, 255, 255, 0.9); + font-size: 32rpx; + letter-spacing: 2rpx; +} + +.header .navigation .title .title-right { + /* margin-right: 46rpx; */ +} .container { width: 100%; + position: relative; } .top-bg { width: 100%; - height: 354rpx; + height: 454rpx; } .top-bg image { width: 100%; - height: 290rpx; + height: 460rpx; } .position-absolute { position: absolute; - top: 225rpx; + top: 400rpx; left: 20rpx; right: 20rpx; } @@ -281,7 +339,7 @@ textarea { line-height: 62rpx; } -.header { +.header-title { color: #333; font-size: 34rpx; font-weight: bold; diff --git a/subpages/oneKeyService/pages/laobingzaixian/laobingzaixian.js b/subpages/oneKeyService/pages/laobingzaixian/laobingzaixian.js index 06b5c28..8d77221 100644 --- a/subpages/oneKeyService/pages/laobingzaixian/laobingzaixian.js +++ b/subpages/oneKeyService/pages/laobingzaixian/laobingzaixian.js @@ -75,6 +75,17 @@ Page({ this.setData({ 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 => { // console.log(res) diff --git a/utils/api.js b/utils/api.js index 520fd82..c614b9b 100644 --- a/utils/api.js +++ b/utils/api.js @@ -48,6 +48,10 @@ module.exports = { completeInfoV2: completeInfoV2, getTokenV3: getTokenV3, getWxPhone: getWxPhone, + applyAct: applyAct, + applyRecord: applyRecord, + applyActDetail: applyActDetail, + getImgUrl: getImgUrl, completeResidentInfoV2: completeResidentInfoV2, completePartyInfoV2: completePartyInfoV2, userPointsRankinglist:userPointsRankinglist, @@ -484,6 +488,31 @@ function getWxPhone ({ wxCode, encryptedData, iv }) { iv }) } + +// 志愿者去哪儿-我要申请 +function applyAct (para) { + return fly.post("heart/actApply/applyAct", para) +} +// 志愿者去哪儿-申请记录 +function applyRecord ({ + pageIndex, + pageSize +}) { + return fly.get("heart/actApply/applyRecord", { + pageIndex, + pageSize + }) +} +// 志愿者去哪儿-活动详情 +function applyActDetail (id) { + return fly.get(`heart/actApply/applyActDetail/${id}`) +} + +// 获取配置图片 +function getImgUrl (imgType) { + return fly.get(`imgConfig/getImgUrl/${imgType}`) +} + // *****************************爱心互助接口***************************end // 获取默认网格信息 function getDefaultGridInfo () { diff --git a/utils/config.js b/utils/config.js index e94fe91..d099316 100644 --- a/utils/config.js +++ b/utils/config.js @@ -6,8 +6,8 @@ module.exports = { }; function BASEURL() { - // return 'https://eug-test.elinkit.com.cn/js/epdc-api/api/' // 锦水测试环境 - return 'https://epdc-jinshui.elinkservice.cn/epdc-api/api/' // 锦水正式环境接口地址 + return 'https://eug-test.elinkit.com.cn/js/epdc-api/api/' // 锦水测试环境 + // return 'https://epdc-jinshui.elinkservice.cn/epdc-api/api/' // 锦水正式环境接口地址 // return 'http://192.168.43.19:9094/epdc-api/api/' }