From 1b718cd28ebd1f974d04c4d05de46df77e1c5328 Mon Sep 17 00:00:00 2001 From: zhangjing Date: Thu, 20 Jul 2023 17:44:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E9=A9=B3=E5=9B=9E=E6=93=8D?= =?UTF-8?q?=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/interfaces/recruit.js | 16 +- api/request.js | 4 +- app.json | 3 +- pages/recruit/index.js | 9 + pages/recruit/index.wxml | 11 +- pages/recruit/refertoEdit/refertoEdit.js | 133 ++++++++ pages/recruit/refertoEdit/refertoEdit.json | 4 + pages/recruit/refertoEdit/refertoEdit.wxml | 70 ++++ pages/recruit/refertoEdit/refertoEdit.wxss | 354 +++++++++++++++++++++ project.config.json | 2 +- 10 files changed, 598 insertions(+), 8 deletions(-) create mode 100644 pages/recruit/refertoEdit/refertoEdit.js create mode 100644 pages/recruit/refertoEdit/refertoEdit.json create mode 100644 pages/recruit/refertoEdit/refertoEdit.wxml create mode 100644 pages/recruit/refertoEdit/refertoEdit.wxss diff --git a/api/interfaces/recruit.js b/api/interfaces/recruit.js index 9ca5f3c..2e2aa1a 100644 --- a/api/interfaces/recruit.js +++ b/api/interfaces/recruit.js @@ -17,13 +17,25 @@ const Enroll = (experience_id, data) => req({ data: data }) -// 申请前置接口 +// 申请前置接口-提交 const recruitAdd = (data) => req({ url : "experiences/enroll", method: "POST", data: data }) +// 编辑报名前置接口 +const Edit = (enroll_id) => req({ + url : "experiences/enroll/" + enroll_id + "/edit" +}) + +// 编辑报名资料-提交 +const EditPut = (enroll_id, data) => req({ + url : "experiences/enroll/" + enroll_id, + method: "PUT", + data: data +}) + //小程序入库用户数据(微信授权) const wechatMini = (data) => req({ url : "user/socialite/login/wechat/mini/add", @@ -94,6 +106,8 @@ export default ({ index, Enroll, recruitAdd, + Edit, + EditPut, wechatMini, signCalendar, signLabor, diff --git a/api/request.js b/api/request.js index 72fcf21..950802d 100644 --- a/api/request.js +++ b/api/request.js @@ -12,8 +12,8 @@ import {updToken} from './updateToken' // wx6bd4fcc040bfa025 水感应 正式appid // wx9ae0c63d0c58caeb 测试appid 三猿 // wx3056ec23196eaf02 水感应 测试 -const api = "https://api.shui.shuiganying.com/api/" // 正式环境 -// const api = "https://shuitest.shuiganying.com/api/" // 测试环境 +// const api = "https://api.shui.shuiganying.com/api/" // 正式环境 +const api = "https://shuitest.shuiganying.com/api/" // 测试环境 const header = { "Accept" : "application/json" } diff --git a/app.json b/app.json index 6eb63ca..948874c 100644 --- a/app.json +++ b/app.json @@ -37,7 +37,8 @@ "pages/recruit/dailyList/dailyList", "pages/water/index", "pages/recruit/expressTrack/expressTrack", - "pages/recruit/unveil/unveil" + "pages/recruit/unveil/unveil", + "pages/recruit/refertoEdit/refertoEdit" ], "window": { "backgroundTextStyle": "light", diff --git a/pages/recruit/index.js b/pages/recruit/index.js index 8c37d7f..f2435c7 100644 --- a/pages/recruit/index.js +++ b/pages/recruit/index.js @@ -172,6 +172,15 @@ Page({ }) }, + /** + * 编辑申请 + */ + editGo() { + wx.navigateTo({ + url: './refertoEdit/refertoEdit?id=' + this.data.recruitData.experience_id + }) + }, + rejectGo() { wx.showModal({ title: '驳回原因提示', diff --git a/pages/recruit/index.wxml b/pages/recruit/index.wxml index 6ee48c6..267cb24 100644 --- a/pages/recruit/index.wxml +++ b/pages/recruit/index.wxml @@ -57,9 +57,14 @@ - + + - {{recruitData.can.text}} + {{recruitData.can.text}} + + {{recruitData.can.text}},重新编辑报名 + {{recruitData.can.text}} + {{recruitData.can.text}} @@ -410,7 +415,7 @@ 关注公众号 - + 请关注”水感应“公众号以便收到活动通知 请截图保存二维码识别关注 diff --git a/pages/recruit/refertoEdit/refertoEdit.js b/pages/recruit/refertoEdit/refertoEdit.js new file mode 100644 index 0000000..df8b9c5 --- /dev/null +++ b/pages/recruit/refertoEdit/refertoEdit.js @@ -0,0 +1,133 @@ +// pages/recruit/referto/referto.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + enrollData : '', + paySuccess : false, + experienceId: '', + typesArr : [], + typesIndex : 0, + refertoStatus: false, + checkStatus : false, + + // 市级选择 + cityArr : [], + cityId : 0, + cityIndex : 0, + + // 区域选择 + regiArr : [], + regiId : 0, + regiIndex : 0 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + experienceId: options.id + }) + // 编辑报名前置接口 + this.eitInfo(options.id); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { }, + + /** + * 申请前置接口 + */ + eitInfo(id) { + wx.$api.recruit.Edit(id).then(res => { + let typeValue = res.data.types.findIndex(val=> val.experience_type_id == res.data.enroll.experience_type.experience_type_id), + cityValue = res.data.areas.findIndex(val=> val.city_id == res.data.enroll.experience_area.city_id) + this.setData({ + enrollData: res.data.enroll, + typesIndex: typeValue, + cityIndex : cityValue, + typesArr : res.data.types, + cityArr : res.data.areas, + }) + }).catch(err => {}) + }, + + /** + * 市级下拉筛选 + */ + cityDrop(e) { + let city = this.data.cityArr, + index = e.detail.value, + citycode = city[index].city_id + if (index != this.data.cityIndex) { + this.setData({ + cityIndex : index, + cityId : citycode + }) + } + }, + + /** + * 体验内容筛选 + */ + tasteDrop(e) { + let newIndex = e.detail.value + this.setData({ + typesIndex : newIndex + }) + }, + + /** + * 提交表单 + */ + siteform(e) { + let value = e.detail.value + + let data = { + name : value.name, + address : value.address, + experience_type_id : this.data.typesArr[this.data.typesIndex].experience_type_id + } + this.setData({ + disabled: true + }) + wx.$api.recruit.EditPut(this.data.enrollData.experience_area_enroll_id,data).then(res => { + this.setData({ + checkStatus: true + }) + }).catch(() =>{ + this.setData({ + disabled: false + }) + }) + }, + + /** + * 关闭弹框,跳转首页 + */ + refertoTap() { + this.setData({ + refertoStatus: false + }) + wx.switchTab({ + url: '/pages/recruit/index' + }) + }, + + /** + * 申请体验官成功后,弹出 + */ + checkTap() { + this.setData({ + checkStatus: false + }) + wx.switchTab({ + url: '/pages/recruit/index' + }) + } +}) \ No newline at end of file diff --git a/pages/recruit/refertoEdit/refertoEdit.json b/pages/recruit/refertoEdit/refertoEdit.json new file mode 100644 index 0000000..38bf84d --- /dev/null +++ b/pages/recruit/refertoEdit/refertoEdit.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "申请体验官 编辑" +} \ No newline at end of file diff --git a/pages/recruit/refertoEdit/refertoEdit.wxml b/pages/recruit/refertoEdit/refertoEdit.wxml new file mode 100644 index 0000000..06e3ed1 --- /dev/null +++ b/pages/recruit/refertoEdit/refertoEdit.wxml @@ -0,0 +1,70 @@ + + + + + + + + + 活动报名 + activity + +
+ + + + + {{ typesArr[typesIndex].name }} + + {{ typesArr[typesIndex].remark }} + + + + + + + + + + + + {{ cityArr[cityIndex].city }} + + + + + + + + + + + + 剩余名额为0,不可申请 + +
+ +
+
+
+ + + + + + + + 修改成功,等待审核 + 水漾肌肤天然滋润,足量使用,效果更佳! + 知道了 + + + \ No newline at end of file diff --git a/pages/recruit/refertoEdit/refertoEdit.wxss b/pages/recruit/refertoEdit/refertoEdit.wxss new file mode 100644 index 0000000..1d14dac --- /dev/null +++ b/pages/recruit/refertoEdit/refertoEdit.wxss @@ -0,0 +1,354 @@ +page { + background-image: linear-gradient(to top, #6fbaf0, #6fbaf0); + padding-bottom: 50rpx; +} + +.referto-img { + width: 100%; +} + +.referto-cont { + padding: 0 30rpx; + box-sizing: border-box; +} + +.referto-blue { + background-color: #0e55ad; + border-radius: 20rpx; + position: relative; + top: -20rpx; + z-index: 9; +} + +.referto-blue::after, +.referto-blue::before { + position: absolute; + content: ''; + background-color: rgba(14, 85, 173, .2); + left: 20rpx; + border-radius: 20rpx 20rpx 0 0; +} +.referto-blue::after { + z-index: -2; + width: calc(100% - 40rpx); + left: 20rpx; + top: -20rpx; + height: 20rpx; +} +.referto-blue::before { + z-index: -1; + width: calc(100% - 80rpx); + left: 40rpx; + top: -40rpx; + height: 40rpx; +} + +.referto-drop { + padding: 30rpx; + box-sizing: border-box; + position: relative; +} + +.referto-drop image { + width: 40rpx; + position: absolute; + right: 30rpx; +} + +.referto-drop text { + display: inline-block; + width: 20rpx; + height: 20rpx; + border-radius: 50%; + background-color: #ffaf59; + margin-right: 20rpx; +} + +.referto-drop text:nth-child(2) { + background-color: #7fe2ff; +} + +.referto-drop text:nth-child(3) { + background-color: #ffffff; +} + +.referto-white { + background: white; + border-radius: 20rpx; + padding: 30rpx; + position: relative; +} + + +.referto-back { + position: absolute; + bottom: 0; + right: 0; + width: 50%; +} + +.referto-title { + margin-bottom: 30rpx; + display: flex; +} + +.referto-title-name { + flex: 1; + display: inline-block; +} + +.referto-title-name text { + background-color: #1e6dce; + padding: 0 30rpx; + line-height: 68rpx; + font-size: 34rpx; + border-radius: 20rpx 0 20rpx 0; + color: #fff; + display: inline-block; +} + +.referto-title-tips { + text-transform: uppercase; + font-size: 44rpx; + line-height: 68rpx; + color: #eef6ff; +} + +.site-form { + display: block; +} + +.site-input { + position: relative; + line-height: 90rpx; + margin-bottom: 30rpx; +} + +.site-input label text { + color: #ee291b; +} + +.picker-text { + color: #ee291b; + font-size: 26rpx; + margin-top: 20rpx; +} + +.picker-remark picker { + position: relative; + width: 100%; + background-color: #f9fcff; + padding: 30rpx 80rpx 30rpx 30rpx; + box-sizing: border-box; + margin-top: 30rpx; +} + +.picker-remark image { + width: 44rpx; + height: 44rpx; + position: absolute; + right: 20rpx; + top: calc(50% - 22rpx); +} + + +.site-input input, +.site-input picker { + width: 100%; + height: 90rpx; + background-color: #f9fcff; + padding: 0 30rpx; + box-sizing: border-box; +} + +.site-input image { + width: 44rpx; + height: 44rpx; + position: absolute; + right: 20rpx; + top: calc(50% + 22rpx); +} + +.site-btn { + padding: 20rpx 30rpx; + margin: 60rpx 0; + text-align: center; + position: relative; + z-index: 2; +} + +.site-btn button[size="mini"], +.site-btn text { + display: inline-block; + background: #1e6dce; + border-radius: 80rpx; + height: 88rpx; + line-height: 88rpx; + font-size: 30rpx; + color: white; + padding: 0 80rpx; +} + +.site-btn.active text { + background: #b4b4b4; +} + +.site-btn button[disabled] { + background: #7789ff !important; + color: #fff !important; +} + +.site-switch { + font-size: 32rpx; + margin: 30rpx; + display: flex; + line-height: 40rpx; +} + +.site-switch text { + flex: 1; +} + +.site-switch-active { + color: #797979; +} + +.site-input textarea { + background-color: #f9fcff; + padding: 30rpx; + width: 100%; + box-sizing: border-box; + min-height: 40rpx; +} + +.refertoEject { + position: fixed; + width: 100vw; + height: 100vh; + left: 0; + top: 0; + background-color: rgba(0, 0, 0, .6); + z-index: 1000; + display: none; +} + +.refertoEject.active { + display: block; +} + +.refertoCont { + -webkit-box-orient: vertical; + -webkit-box-pack: center; + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: 10000; + padding: 0 10%; + box-sizing: border-box; + text-align: center; + display: none; +} + +.refertoCont.active { + display: -webkit-box; +} + +.refertoCont-name { + width: 100%; + /* background-image: linear-gradient(to bottom, #ffb70a, #ff7e1c); + color: #fff; */ + display: inline-block; + margin-bottom: 50rpx; + /* padding: 0 60rpx; */ + /* border: 4rpx solid #ffffff; */ + line-height: 80rpx; + /* border-radius: 90rpx; */ + /* font-size: 34rpx; */ +} + +.refertoCont-name image, +.refertoCont-img { + width: 100%; +} + +.refertoCont-close { + width: 68rpx; + display: block; + margin: 0 auto; +} + +/* 申请成功弹出 */ +.checkEject { + position: fixed; + width: 100vw; + height: 100vh; + left: 0; + top: 0; + background-color: rgba(0, 0, 0, .6); + z-index: 1000; + display: none; +} + +.checkEject.active { + display: block; +} + +.checkCont { + -webkit-box-orient: vertical; + -webkit-box-pack: center; + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: 10000; + box-sizing: border-box; + text-align: center; + display: none; +} + +.checkCont.active { + display: -webkit-box; +} + +.checkCont-img, +.checkCont-name { + position: absolute; + width: 80%; + left: 10%; + top: 30%; +} + +.checkCont-name { + z-index: 9; + padding: 120rpx 140rpx; + box-sizing: border-box; +} + +.checkCont-name image { + width: 70%; +} + +.checkCont-text { + margin-top: 20rpx; +} + +.checkCont-text-title { + font-weight: 600; + font-size: 34rpx; +} + +.checkCont-text-tips { + color: #666666; + line-height: 44rpx; + margin: 25rpx 0; +} + +.checkCont-text-go { + background-color: #ff4751; + color: #fff; + border-radius: 80rpx; + line-height: 74rpx; +} \ No newline at end of file diff --git a/project.config.json b/project.config.json index bfdbf9f..ea72c51 100644 --- a/project.config.json +++ b/project.config.json @@ -45,7 +45,7 @@ }, "compileType": "miniprogram", "libVersion": "2.17.0", - "appid": "wx6bd4fcc040bfa025", + "appid": "wx9ae0c63d0c58caeb", "projectname": "miniprogram-92", "condition": {}, "editorSetting": {