From a8aa8d296136bf66f4c48531d5b39d01af121522 Mon Sep 17 00:00:00 2001 From: ZhaoTongYao <531131322@qq.com> Date: Mon, 6 Sep 2021 18:07:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC1.7.19=20=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=A4=9A=E5=A4=9A=E7=B2=BE=E5=BD=A9=E8=AF=B4=E8=AF=B4=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=A2=9E=E5=8A=A0=E4=B8=BB=E5=8A=9E=E6=96=B9=E7=AD=9B?= =?UTF-8?q?=E9=80=89=EF=BC=9B=E6=B4=BB=E5=8A=A8=E6=8A=A5=E5=90=8D=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=97=B6=E9=97=B4=E6=AE=B5=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/heartNew/heartNew.js | 57 +++++++++-- pages/heartNew/heartNew.wxml | 44 +++++++-- pages/heartNew/heartNew.wxss | 16 ++- pages/toRegister/toRegister.js | 2 +- subpages/heart/images/zhubanfang.png | Bin 0 -> 4283 bytes .../heart/pages/heartDetail/heartDetail.js | 92 ++++++++++++++++-- .../heart/pages/heartDetail/heartDetail.wxml | 37 ++++++- .../heart/pages/heartDetail/heartDetail.wxss | 72 ++++++++++++++ .../companyInformation/companyInformation.js | 2 +- .../companyInformation.wxml | 4 +- utils/api.js | 10 +- 11 files changed, 302 insertions(+), 34 deletions(-) create mode 100644 subpages/heart/images/zhubanfang.png diff --git a/pages/heartNew/heartNew.js b/pages/heartNew/heartNew.js index a3c129d..55c64c7 100644 --- a/pages/heartNew/heartNew.js +++ b/pages/heartNew/heartNew.js @@ -54,6 +54,8 @@ Page({ shouye: {}, scanBtn: {}, // 扫码签到改为可配置 applyBtn: {}, // 申请发单按钮改为可配置, + searchActive: '', // + searchJingcai: '', }, /** @@ -76,6 +78,7 @@ Page({ timestamp: getTimestamp(), actType: 0, qkdat: true, + sponsor: this.data.searchActive, selectedTab:this.data.selectedTab } this.selectComponent("#state-0").getActivityList(parms) @@ -137,6 +140,7 @@ Page({ timestamp: getTimestamp(), actType: 0,//活动列表类型(0-招募令,1-精彩活动) qkdat: true, + sponsor: this.data.searchActive, selectedTab:this.data.selectedTab } this.selectComponent("#state-0").getActivityList(parms) @@ -156,6 +160,8 @@ Page({ loadMoreVisible: false, loadMoreType: "none", indexPage: 1, + searchActive: '', + searchJingcai: '' }) if (e.currentTarget.dataset.tab == "tab0") { this.setData({ @@ -168,6 +174,7 @@ Page({ timestamp: getTimestamp(), actType: 0,//活动列表类型(0-招募令,1-精彩活动) qkdat: true, + sponsor: this.data.searchActive, selectedTab:e.currentTarget.dataset.tab } this.selectComponent("#state-0").getActivityList(parms) @@ -197,6 +204,7 @@ Page({ timestamp: getTimestamp(), actType: 1,//活动列表类型(0-招募令,1-精彩活动) qkdat: true, + sponsor: this.data.searchJingcai, selectedTab:e.currentTarget.dataset.tab } this.selectComponent("#state-2").getActivityList(parms) @@ -223,6 +231,7 @@ Page({ timestamp: getTimestamp(), actType: 0, actId: this.data.actId, + sponsor: this.data.searchActive, selectedTab:this.data.selectedTab } this.selectComponent("#state-0").updateActivityList(params) @@ -233,6 +242,7 @@ Page({ timestamp: getTimestamp(), actType: 1, actId: this.data.actId, + sponsor: this.data.searchJingcai, selectedTab:this.data.selectedTab } this.selectComponent("#state-2").updateActivityList(params) @@ -320,18 +330,43 @@ Page({ } this.volunteerlist(parms) }, - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - + + bindInputValueActive (e) { + if ((this.data.selectedTab === "tab0")) { + this.setData({ + searchActive: e.detail.value.trim('') + }) + } else if (this.data.selectedTab === "tab2") { + this.setData({ + searchJingcai: e.detail.value.trim('') + }) + } }, - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - + searchActive () { + if ((this.data.selectedTab === "tab0")) { + let params = { + pageIndex: 1, + pageSize: 10, + timestamp: getTimestamp(), + actType: 0, + qkdat: true, + sponsor: this.data.searchActive, + selectedTab:this.data.selectedTab + } + this.selectComponent("#state-0").getActivityList(params) + } else if (this.data.selectedTab === "tab2") { + let params = { + pageIndex: 1, + pageSize: 10, + timestamp: getTimestamp(), + actType: 1, + qkdat: true, + sponsor: this.data.searchJingcai, + selectedTab:this.data.selectedTab + } + this.selectComponent("#state-2").getActivityList(params) + } }, /** @@ -390,6 +425,7 @@ Page({ pageSize: this.data.pageSize, timestamp: getTimestamp(), actType: 0, + sponsor: this.data.searchActive, selectedTab:this.data.selectedTab } this.selectComponent("#state-0").getActivityList(parms) @@ -413,6 +449,7 @@ Page({ pageSize: this.data.pageSize, timestamp: getTimestamp(), actType: 1, + sponsor: this.data.searchJingcai, selectedTab:this.data.selectedTab } this.selectComponent("#state-2").getActivityList(parms) diff --git a/pages/heartNew/heartNew.wxml b/pages/heartNew/heartNew.wxml index 7bea906..c5d4f64 100644 --- a/pages/heartNew/heartNew.wxml +++ b/pages/heartNew/heartNew.wxml @@ -84,6 +84,20 @@ @@ -91,14 +105,16 @@ 志愿者注册数:{{volunteerCount}} - - - - - + + + + + + + + - - + @@ -114,6 +130,20 @@ KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf zVxhe-O!X z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^jz)rRYwaaY4 ze(nJRiw;=Qb^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0&?iWU-~ZK3RwusgD8l-Ymy)T1#~%*ajgMi(OAa5G)sw4=pM?jY_Gv3Wy170laR@ zKV!^nvP4VIwg;K{ojd?o1YnO%$B5`|(pt9wc+BRDL}Z`qx_9OQ!fpU}Sq7nzwAQ-- zEVeuo;5bfQJRbLQhyzQA=(8dSE$fN~0ui+-rLv;ssZ^>;L=K8bZLvVGz8pffhnW{= zu?#i=c%m2%4K9ab1jeknLy-sN|G;Q_iyS6Uz9u4D5{X1Alp`z@k(B_J7tBZyX49GNy-PN2RZB27fC@pyb+DwUdQ zjQKf>b~Vg=A|t5G1+WOfOlt|0rBwQF0L{$&(hz~~Z2+qQv>Ic+4DpEdnUUG+y6&QI zn~si-iM_qOn*cm&EtQT~RM|N&Fwk6AS9f$65;U8Lz6H?1%ripZNG4i0D5VY!!yl#^ zV|D|W5xJ-mp}clTMCQ7#+cOFe*hfS&lv34U5Qyj-rPQ1(*yJBXbVY%&;7oZf({aH< zD-k7>QvPVq1wqgxA{&|ck}wF4<1C5CE0sStdr)0JJgl zq|k3|%v_g4a`icY1qJwfuH;_m;R_M1QA)j;!$)in3ocsg)w!hGK@dDFBAfGccj&{H zj3ap;!x7OhwWnT~TV(jcOvN~!o5 zfN%`J%{lm)U6Dqn^YSj&0WK77g;`m7m+*xmczG9dhT=ncm-U9W&GIhr4#kM_F7+R@ zvcL2Zni1uF{pYNJxju6ft|TskiAYPnwGbDs1meQw(C9!2ZKdUVO?Vi#S)LchN7!0R d`mY228vqZ`Rg5>At&so#002ovPDHLkV1k5P9`FDF literal 0 HcmV?d00001 diff --git a/subpages/heart/pages/heartDetail/heartDetail.js b/subpages/heart/pages/heartDetail/heartDetail.js index 09e319c..c911c9f 100644 --- a/subpages/heart/pages/heartDetail/heartDetail.js +++ b/subpages/heart/pages/heartDetail/heartDetail.js @@ -30,7 +30,11 @@ Page({ pageIndex: 1, pageSize: 10, curSize: 0, // 当前页码获取的活动条数 - isPreviewImage: false //是否从图片预览返回 + isPreviewImage: false, //是否从图片预览返回 + showPeriodDialog: false, // 是否显示选择时间段对话框 + dialogTips: '', + sponsor: '', // 主办方 + periodList: [], // 时间段 }, onLoad: function (options) { console.log("当前时间" + getTimestamp()) @@ -48,6 +52,8 @@ Page({ // } // 获取默认网格 this.getDefaultGridInfo() + // 获取活动时间段 + this.getActPeriods() }, onReachBottom () { if (this.data.curSize == this.data.pageSize) { @@ -72,7 +78,8 @@ Page({ actEndTime: res.data.actEndTime.substring(0, 16), signupEndTime: res.data.signupEndTime.substring(0, 16), timeJudge: getTimestamp() > res.data.actEndTime.substring(0, 16) ? true : false, - preloadVisible: false + preloadVisible: false, + sponsor: res.data.sponsor }) } }).catch(err => { @@ -106,7 +113,8 @@ Page({ url: `../clockIn/clockIn?id=${id}¤tUserStatus=${currentUserStatus}` }) }, - goVolunteer (e) { //我要报名 用户认证志愿者标识(0-未认证,1-已认证) + goVolunteer (e) { + //我要报名 用户认证志愿者标识(0-未认证,1-已认证) // 0-待审核 提醒用户志愿者身份认证审核中,不能报名也不用去认证 // 1 - 认证通过 直接报名 // 2 - 待认证 提示用户去认证 @@ -124,7 +132,9 @@ Page({ // dialogCancelText: '' // }) this.setData({ - dialogVisible: !this.data.dialogVisible, + // dialogVisible: this.data.periodList.length == 0 ? true : false, + showPeriodDialog: !this.data.showPeriodDialog, + dialogTips: `报名时间截止之前可取消,缺席活动扣除${this.data.detail.punishmentPoints}积分,是否确定报名`, dialogTitle: "报名提醒", dialogContent: ["报名时间截止之前可取消", `缺席活动扣除${this.data.detail.punishmentPoints}积分,是否确定报名`], dialogConfirmText: "是", @@ -132,7 +142,9 @@ Page({ }) } else if (uservolunteerflag == 1) { this.setData({ - dialogVisible: !this.data.dialogVisible, + // dialogVisible: this.data.periodList.length == 0 ? true : false, + showPeriodDialog: !this.data.showPeriodDialog, + dialogTips: `报名时间截止之前可取消,缺席活动扣除${this.data.detail.punishmentPoints}积分,是否确定报名`, dialogTitle: "报名提醒", dialogContent: ["报名时间截止之前可取消", `缺席活动扣除${this.data.detail.punishmentPoints}积分,是否确定报名`], dialogConfirmText: "是", @@ -204,8 +216,11 @@ Page({ console.log("::::::" + this.data.uservolunteerflag.length) if (this.data.uservolunteerflag.length > 0) { if (this.data.uservolunteerflag == 0 || this.data.uservolunteerflag == 1) { - let id = this.data.id - api.signup(id).then(res => { + let param = { + actId: this.data.id, + actPeriodId: this.data.actPeriodId + } + api.signup(param).then(res => { if (res.code == 0) { this.setData({ dialogVisible: !this.data.dialogVisible, @@ -277,5 +292,68 @@ Page({ title: "活动详情", path: `/pages/indexNew/indexNew?shareType=heartDetail&id=${this.data.id}&defaultGridId=${this.data.defaultGridId}` } + }, + + checkboxChange (e) { + console.log(e.detail.value) + // let actPeriodId = [] + // if (e.detail.value.length > 0) { + // e.detail.value.forEach(item => { + // let ob = { + // id: item + // } + // actPeriodId.push(ob) + // }) + // } + this.setData({ + actPeriodId: e.detail.value + }) + }, + onCancelPeriod () { + this.setData({ + showPeriodDialog: false, + actPeriodId: [] + }) + }, + onConfirmPeriod () { + console.log("::::::" + this.data.uservolunteerflag.length) + if (this.data.uservolunteerflag.length > 0) { + if (this.data.uservolunteerflag == 0 || this.data.uservolunteerflag == 1) { + let param = { + actId: this.data.id, + actPeriodId: this.data.actPeriodId + } + api.signup(param).then(res => { + if (res.code == 0) { + this.setData({ + showPeriodDialog: !this.data.showPeriodDialog, + dialogVisible: !this.data.dialogVisible, + dialogTitle: "报名成功", + dialogContent: ["正在审核中", "请耐心等待消息通知!"], + dialogConfirmText: "确定", + dialogCancelText: "", + uservolunteerflag: "" + }) + this.getDetail() + } else { //点击我要报名,刚好已经报满,此时弹出已报满的提示框,点击确定后,我要报名按钮变成已报满按钮(置灰) + this.getDetail() + } + }) + } else if (this.data.uservolunteerflag == 2) { + wx.navigateTo({ + url: "/subpages/heart/pages/volunteer/volunteer" + }) + } + } else { + console.log("报名成功以后不进行操作") + } + }, + getActPeriods () { + api.getActPeriods(this.data.id).then(res => { + console.log(res.data) + this.setData({ + periodList: res.data + }) + }) } }) \ No newline at end of file diff --git a/subpages/heart/pages/heartDetail/heartDetail.wxml b/subpages/heart/pages/heartDetail/heartDetail.wxml index 0f3bef4..5bebd74 100644 --- a/subpages/heart/pages/heartDetail/heartDetail.wxml +++ b/subpages/heart/pages/heartDetail/heartDetail.wxml @@ -32,6 +32,15 @@ + + + + 主办方 + + + {{sponsor}} + + @@ -361,4 +370,30 @@ - \ No newline at end of file + + + + + 请选择时间段 + + + + + + + {{dialogTips}} + + + 取消 + 确定 + + + \ No newline at end of file diff --git a/subpages/heart/pages/heartDetail/heartDetail.wxss b/subpages/heart/pages/heartDetail/heartDetail.wxss index e09217f..5936bc7 100644 --- a/subpages/heart/pages/heartDetail/heartDetail.wxss +++ b/subpages/heart/pages/heartDetail/heartDetail.wxss @@ -364,3 +364,75 @@ page{ rich-text{ line-height: 75rpx; } + +/* 时间段start */ +.period { + width: 100%; + height: 100%; + position: fixed; + left: 0; + top: 0; + z-index: 1000; + background-color: rgba(0, 0, 0, 0.6); + display: flex; + align-items: center; + justify-content: center; +} +.period .period-dialog { + width: 600rpx; + background-color: #fff; + border-radius: 10rpx; +} +.period-dialog .period-title { + height: 80rpx; + line-height: 80rpx; + text-align: center; + font-size: 36rpx; +} +.period-dialog .period-content { + height: 400rpx; + padding: 20rpx 30rpx; + box-sizing: border-box; +} +.period-dialog .period-content .checkbox-group { + height: 100%; + /* overflow: auto; */ +} +.checkbox-group .checkbox-item { + display: flex; + width: 100%; + height: 120rpx; + align-items: center; + justify-content: space-around; +} +.checkbox-item .item-labels { + display: flex; + flex-direction: column; +} +.checkbox-item .item-label { + width: 370rpx; +} +.period-dialog .tips { + padding: 0rpx 60rpx; +} +.period-dialog .period-footer { + height: 100rpx; + width: 100%; + display: flex; + align-items: center; + justify-content: space-around; +} +.period-footer .footer-cancel { + width: 200rpx; + height: 80rpx; + line-height: 80rpx; + text-align: center; + color: #aaa; +} +.period-footer .footer-confirm { + width: 200rpx; + height: 80rpx; + line-height: 80rpx; + text-align: center; + color: #04BCA0; +} \ No newline at end of file diff --git a/subpages/oneKeyService/pages/companyInformation/companyInformation.js b/subpages/oneKeyService/pages/companyInformation/companyInformation.js index 57b64e2..a228500 100644 --- a/subpages/oneKeyService/pages/companyInformation/companyInformation.js +++ b/subpages/oneKeyService/pages/companyInformation/companyInformation.js @@ -326,7 +326,7 @@ Page({ } }).catch(err => { console.log('err',err) - wx.hideLoading() + // wx.hideLoading() this.setData({ lock: false }) diff --git a/subpages/oneKeyService/pages/companyInformation/companyInformation.wxml b/subpages/oneKeyService/pages/companyInformation/companyInformation.wxml index 0875970..c6da75f 100644 --- a/subpages/oneKeyService/pages/companyInformation/companyInformation.wxml +++ b/subpages/oneKeyService/pages/companyInformation/companyInformation.wxml @@ -45,8 +45,8 @@ - 营业收入 - + 1-本季度营业收入(万元) + 用工人数 diff --git a/utils/api.js b/utils/api.js index 76b3f0a..a7ef28b 100755 --- a/utils/api.js +++ b/utils/api.js @@ -80,6 +80,8 @@ module.exports = { getFullDictInfo, getEnterpriseReportList, getEnterpriseReportDetail, + // + getActPeriods } function getToken (wxCode) { @@ -441,8 +443,8 @@ function authenticate (data) { * 活动报名 */ -function signup (actId) { - return fly.post(`heart/act/signup?actId=${actId}`) +function signup (param) { + return fly.post(`heart/act/signup`, param) } /** @@ -664,4 +666,8 @@ function getEnterpriseReportList (para) { // 企业详情 function getEnterpriseReportDetail (id) { return fly.get(`custom/getEnterpriseReportDetail/${id}`) +} +// 活动参与时间段列表接口 +function getActPeriods (actId) { + return fly.get(`heart/act/getActPeriods`, {actId: actId}) } \ No newline at end of file