diff --git a/api/interfaces/recruit.js b/api/interfaces/recruit.js index 68a8f4f..179c9cd 100644 --- a/api/interfaces/recruit.js +++ b/api/interfaces/recruit.js @@ -12,8 +12,9 @@ const index = data => req({ }) // 申请前置接口 -const Enroll = (experience_id) => req({ - url : "experiences/enroll/" + experience_id +const Enroll = (experience_id, data) => req({ + url : "experiences/enroll/" + experience_id, + data: data }) // 申请前置接口 @@ -23,8 +24,45 @@ const recruitAdd = (data) => req({ data: data }) +//小程序入库用户数据(微信授权) +const wechatMini = (data) => req({ + url : "user/socialite/login/wechat/mini/add", + method: "POST", + data: data +}) + +// 活动打卡日历 +const signCalendar = (data) => req({ + url : "experiences/sign_calendar", + data: data +}) + +// 活动打卡操作 +const signLabor = (data) => req({ + url : "experiences/signs", + method: "POST", + data: data +}) + +// 打卡记录 +const signList = (data) => req({ + url : "experiences/signs", + data: data +}) + +// 体验官第一次和第二次比对 +const skinDiff = (data) => req({ + url : "ai/skin/diff", + data: data +}) + export default ({ index, Enroll, - recruitAdd + recruitAdd, + wechatMini, + signCalendar, + signLabor, + signList, + skinDiff }) \ No newline at end of file diff --git a/api/request.js b/api/request.js index c2e3077..950802d 100644 --- a/api/request.js +++ b/api/request.js @@ -9,8 +9,9 @@ import {updToken} from './updateToken' // 请求方式配置 // https://api.shui.shuiganying.com/api //正式地址 // https://shuitest.shuiganying.com/api //测试地址 -// wx6bd4fcc040bfa025 正式appid -// wx3056ec23196eaf02 测试appid +// wx6bd4fcc040bfa025 水感应 正式appid +// wx9ae0c63d0c58caeb 测试appid 三猿 +// wx3056ec23196eaf02 水感应 测试 // const api = "https://api.shui.shuiganying.com/api/" // 正式环境 const api = "https://shuitest.shuiganying.com/api/" // 测试环境 const header = { @@ -91,6 +92,9 @@ const req = (obj, noToken) => { */ const upload = (obj) => { + + console.log(obj) + // header header.Authorization = wx.getStorageSync("token") || "" // 处理上传信息 diff --git a/app.js b/app.js index 8048a6b..73ec06c 100644 --- a/app.js +++ b/app.js @@ -45,6 +45,18 @@ App({ } }) + if(wx.getStorageSync("openid") == '') { + // 获取code + wx.login({ + success: res => { + // 存储openid + api.auth.codeOpenid({code: res.code}).then(openidRes => { + wx.setStorageSync('openid', openidRes.data) + }).catch(err => {}) + } + }) + } + // 挂载api wx.$api = api }, @@ -52,7 +64,8 @@ App({ isUser : false, userInfo : null, barHeight : '', - inviteText : '', // 邀请好友临时存储 - isExperience: '' // 体验官身份 + inviteText : '', // 邀请好友临时存储 + isExperience: '', // 体验官身份 + experienceAreaId: '' // 体验官区域 } }) \ No newline at end of file diff --git a/app.json b/app.json index 22c354d..c74c359 100644 --- a/app.json +++ b/app.json @@ -31,7 +31,9 @@ "pages/mall/webView/webView", "pages/order/logistic/logistic", "pages/recruit/index", - "pages/recruit/referto/referto" + "pages/recruit/referto/referto", + "pages/recruit/signWrite/signWrite", + "pages/recruit/writeList/writeList" ], "window": { "backgroundTextStyle": "light", diff --git a/pages/index-老版/assess/assess.js b/pages/index-老版/assess/assess.js index 069e0c4..90468cd 100644 --- a/pages/index-老版/assess/assess.js +++ b/pages/index-老版/assess/assess.js @@ -6,7 +6,6 @@ Page({ data: { barHeight : getApp().globalData.barHeight, // 状态栏高度 - openId : '', nameValue : '', // 姓名 nameStatus: false, // 姓名填写弹框 Analyze : '', // 是否交钱 @@ -16,9 +15,6 @@ Page({ }, onLoad(options) { - this.setData({ - openId: options.code - }) }, onShow() { diff --git a/pages/index-老版/index.js b/pages/index-老版/index.js index 7e372f5..121058e 100644 --- a/pages/index-老版/index.js +++ b/pages/index-老版/index.js @@ -5,8 +5,6 @@ Page({ data: { - payCode : '', // code获取openid - openId : '', // openid disabled : false, // 支付按钮 payStatus : false, // 支付弹框 catchtouchmove: false @@ -16,26 +14,6 @@ Page({ if(options.invite != undefined) { getApp().globalData.inviteText = options.invite } - wx.login({ - success: res => { - this.setData({ - payCode: res.code - }) - // 获取openid - this.openInfo() - } - }) - }, - - /** - * openid - */ - openInfo() { - wx.$api.auth.codeOpenid({code: this.data.payCode}).then(res => { - this.setData({ - openId: res.data - }) - }).catch(err => {}) }, /** @@ -44,7 +22,7 @@ Page({ assessGo(){ if(wx.getStorageSync("token") != ''){ wx.navigateTo({ - url: '/pages/index/assess/assess?code=' + this.data.openId + url: '/pages/index/assess/assess?code=' + wx.getStorageSync("openid") }) return } diff --git a/pages/index/assess/assess.js b/pages/index/assess/assess.js index dfe348f..87d759b 100644 --- a/pages/index/assess/assess.js +++ b/pages/index/assess/assess.js @@ -6,7 +6,6 @@ Page({ data: { barHeight : getApp().globalData.barHeight, // 状态栏高度 - openId : '', nameValue : '', // 姓名 testTitle : '', nameStatus : false, // 姓名填写弹框 @@ -20,19 +19,8 @@ Page({ onLoad(options) { // 体验官 type=1或者type=2 直接面检,不用交钱 this.setData({ - refertoType: options.type + refertoType: options.type || 0 }) - this.setData({ - openId: options.code - }) - if(options) { - wx.login({ - success: res => { - // 获取openid - this.openInfo(res.code) - } - }) - } }, onShow() { @@ -47,18 +35,6 @@ Page({ this.ifAnalyze(); }, - - /** - * openid - */ - openInfo(code) { - wx.$api.auth.codeOpenid({code: code}).then(res => { - this.setData({ - openId: res.data - }) - }).catch(err => {}) - }, - /** * 是否可检测 */ @@ -192,11 +168,12 @@ Page({ * 确认支付1元 */ payBtn(orderid) { + wx.showLoading({ title: '支付中...', mask : true }) - wx.$api.index.skinPay(orderid,{type: 'miniapp', openid: this.data.openId}).then(res=>{ + wx.$api.index.skinPay(orderid,{type: 'miniapp', openid: wx.getStorageSync("openid")}).then(res=>{ wx.hideLoading() let payInfo = JSON.parse(res.data.wechat) wx.requestPayment({ diff --git a/pages/index/index.js b/pages/index/index.js index 35db3a7..e3ef5e8 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -5,8 +5,6 @@ Page({ data: { - payCode : '', // code获取openid - openId : '', // openid userLogin : false, // 是否登录 testTitle : '', // 检测文字 disabled : false, // 支付按钮 @@ -21,16 +19,6 @@ Page({ }, onShow() { - wx.login({ - success: res => { - this.setData({ - payCode: res.code - }) - // 获取openid - this.openInfo() - } - }) - // 获取登录状态 if(wx.getStorageSync("token") != ''){ this.setData({ @@ -46,17 +34,6 @@ Page({ }) }, - /** - * openid - */ - openInfo() { - wx.$api.auth.codeOpenid({code: this.data.payCode}).then(res => { - this.setData({ - openId: res.data - }) - }).catch(err => {}) - }, - /** * 是否可检测 */ diff --git a/pages/login/index.js b/pages/login/index.js index 55c5d32..7e451a9 100644 --- a/pages/login/index.js +++ b/pages/login/index.js @@ -19,7 +19,21 @@ Page({ onShow() { // 获取code - this.gainCode(); + wx.login({ + success: res => { + this.setData({ + loginCode : res.code + }) + } + }) + }, + + + /** + * openid + */ + openInfo(code) { + }, /** @@ -36,8 +50,6 @@ Page({ * 微信授权手机号码 */ userPhone(e){ - // 获取code - this.gainCode(); if(e.detail.errMsg == "getPhoneNumber:ok"){ this.setData({ loading: true @@ -53,16 +65,6 @@ Page({ this.setData({ loading: false }) - // 登录过期重新获取code - wx.login({ - success: res=>{ - this.setData({ - loginCode: res.code - }) - // 登录 - this.userLogin(iv,enData) - } - }) } }) }else{ @@ -84,6 +86,9 @@ Page({ invite : getApp().globalData.inviteText || '', is_experience : getApp().globalData.isExperience || '' }).then(res=>{ + // 存储openid + wx.setStorageSync('openid', res.data.openid) + // 存储登录信息 wx.setStorage({ key : 'token', @@ -109,19 +114,6 @@ Page({ }).catch(err=>{}) }, - /** - * 获取code - */ - gainCode() { - wx.login({ - success: res => { - this.setData({ - loginCode : res.code - }) - } - }) - }, - // 勾选协议 radioChange() { this.setData({ diff --git a/pages/pay/index.js b/pages/pay/index.js index 704fcf9..cdac2b5 100644 --- a/pages/pay/index.js +++ b/pages/pay/index.js @@ -5,8 +5,6 @@ Page({ data: { - payCode : '', // code获取openid - openId : '', // openid orderNo : '', // 订单编号 total : '', // 订单金额 paySuccess : false, // 兑换成功显示 @@ -20,29 +18,7 @@ Page({ }) }, - onShow() { - wx.login({ - success: res => { - this.setData({ - payCode: res.code - }) - - // 获取openid - this.openInfo() - } - }) - }, - - /** - * openid - */ - openInfo() { - wx.$api.auth.codeOpenid({code: this.data.payCode}).then(res => { - this.setData({ - openId: res.data - }) - }).catch(err => {}) - }, + onShow() {}, /** * 确认支付 @@ -53,7 +29,7 @@ Page({ mask : true }) let that = this - wx.$api.mall.mallPay(this.data.orderNo,{type: 'miniapp', openid: this.data.openId}).then(res=>{ + wx.$api.mall.mallPay(this.data.orderNo,{type: 'miniapp', openid: wx.getStorageSync("openid")}).then(res=>{ wx.hideLoading() this.setData({ disabled: false diff --git a/pages/recruit/index.js b/pages/recruit/index.js index dc7af11..62f8936 100644 --- a/pages/recruit/index.js +++ b/pages/recruit/index.js @@ -4,7 +4,20 @@ Page({ * 页面的初始数据 */ data: { - recruitData: '' + recruitData : '', + type : 'flowPath', //flowPath 参与流程 clockIn 打卡 + + followState : false, + loginCode : '', + + calendarData : [], //日历表 + canSign : '', //是否可以签到 + selectMonth : '', //当前月 + lastMonth : '', //选择下个月 + nextMonth : '', //选择上个月 + signDayNumber : '', //累计打卡天数 + signDayCount : '', //总打卡天数 + signWaterNumber: '', //总打卡给水滴 }, /** @@ -18,12 +31,23 @@ Page({ if(options.is_experience != undefined) { getApp().globalData.isExperience = options.is_experience } + if(options.experience_area_id != undefined) { + getApp().globalData.experienceAreaId = options.experience_area_id + } }, /** * 生命周期函数--监听页面显示 */ onShow() { + wx.login({ + success: res => { + this.setData({ + loginCode: res.code + }) + } + }) + // 获取体验官首页 this.recruitInfo(); }, @@ -39,6 +63,25 @@ Page({ this.setData({ recruitData: res.data }) + + // 0可以申请 1需要面检测 5签收-查看物流 6打卡 7第二次面 + if(res.data.can.status == 6) { + // 获取日历 + this.signInfo(); + + // 显示打卡数据 + this.setData({ + type : 'clockIn' + }) + } + + // if(res.data.can.status == 7) { + // // 获取两次报告对比 + // this.skinInfo(); + // } + + // 获取两次报告对比 + this.skinInfo(); }).catch(err => {}) }, @@ -47,11 +90,22 @@ Page({ */ applyGo() { if(wx.getStorageSync("token") != ''){ + // 0可以申请 1需要面检测 5签收-查看物流 6打卡 7第二次面 if(this.data.recruitData.can.status == 0) { + // 申请体验官 wx.navigateTo({ url: './referto/referto?id=' + this.data.recruitData.experience_id }) - } else{ + } else if(this.data.recruitData.can.status == 5) { + var data = JSON.stringify(this.data.recruitData.express) + // 查看物流 + wx.navigateTo({ + url: `/pages/order/logistic/logistic?newData=` + encodeURIComponent(data) + }) + } else if(this.data.recruitData.can.status == 6) { + // 日历打卡 + } else { + // 面部检测 wx.navigateTo({ url: '/pages/index/assess/assess?type=1' }) @@ -72,5 +126,106 @@ Page({ content: this.data.recruitData.can.remark, success: res => {} }) + }, + + /** + * 获取code + */ + followCode() { + wx.getUserProfile({ + desc : "获取你的昵称、头像、地区及性别", + success : e => { + if(e.errMsg == "getUserProfile:ok"){ + wx.$api.recruit.wechatMini({ + code :this.data.loginCode, + iv : e.iv, + encryptedData: e.encryptedData + }).then(res => { + // subscribe == 0未关注公众号 + if (res.data.subscribe == 0) { + this.setData({ + followState: true + }) + return + } + // 获取首页数据 subscribe == 1已 关注公众号 + this.mallData(); + + }).catch(err => {}) + } + }, + fail: err => { + return; + } + }) + }, + + /** + * 日历 + */ + signInfo() { + wx.$api.recruit.signCalendar({ + date : this.data.selectMonth, + experience_id: this.data.recruitData.experience_id + }).then(res => { + this.setData({ + calendarData : res.data.calendar, + lastMonth : res.data.lastMonth, + nextMonth : res.data.nextMonth, + selectMonth : res.data.nowMonth, + canSign : res.data.canSign, + signDayNumber: res.data.signDayNumber, + signDayCount : res.data.signDayCount, + signWaterNumber : res.data.signWaterNumber + }) + }).catch(err => {}) + }, + + /** + * 日历数量加减 + */ + couponNumber(e){ + let val = e.currentTarget.dataset.type + if (val == 'plus'){ + this.setData({ + selectMonth: this.data.lastMonth + }) + }else{ + this.setData({ + selectMonth: this.data.nextMonth + }) + } + + // 获取日历 + this.signInfo(); + }, + + /** + * 签到弹出 + */ + tapPop() { + if(!this.data.canSign) { + wx.navigateTo({ + url: './signWrite/signWrite?experienceId=' + this.data.recruitData.experience_id + '&signDayNumber=' + this.data.signDayNumber + }) + } + }, + + /** + * 两次报告对比 + */ + skinInfo() { + wx.$api.recruit.skinDiff().then(res => { + console.log(res) + }).catch(err => {}) + }, + + /** + * 公众号弹出 + */ + followHide() { + this.setData({ + followState: !this.data.followState + }) } }) \ No newline at end of file diff --git a/pages/recruit/index.wxml b/pages/recruit/index.wxml index eab8bc2..5f68954 100644 --- a/pages/recruit/index.wxml +++ b/pages/recruit/index.wxml @@ -1,34 +1,179 @@ - - - - + + + + + + + + + + + + + + + 招募人数 + {{recruitData.total}}人 + + + + + 招募时间 + {{recruitData.start_at}} + + 即日起开始报名{{recruitData.total}}人,人满为止 + + + + 招募时间 + + 剩余名额 + + + + {{item}} + + + + + + + + + + + + + + + + + + + + + + + {{recruitData.can.text}} + {{recruitData.can.text}} + + + + 暂无邀请人,无法申请体验 + + + 查看驳回原因 + + + + + + + 水感应·好“雾”星球 + + + + + + + + + + + + + + - - - - - - 招募人数 - {{recruitData.total}}人 + + + Hi!张张 + 今天是你打卡的第{{signDayNumber}} + + + + + + {{selectMonth}} + + + + + + 日 + + + 一 + + + 二 + + + 三 + + + 四 + + + 五 + + + 六 + + + + + {{item.day}} + + {{item.day}} + + + - - - 招募时间 - {{recruitData.start_at}} + + + + 每日打卡获得{{signWaterNumber}}水滴,累积打卡 + {{signDayCount}}天,可再次兑换1瓶水感应喷雾 - 即日起开始报名{{recruitData.total}}人,人满为止 + {{canSign ? '打卡': '已打卡'}} - - - 招募时间 + + + + + + + + + + + VS + + + + + 衰老度分析 + + 抬头纹:10处 + 抬头纹:10处 + + + 鱼尾纹:8处 + 鱼尾纹:2处 + - 剩余名额 - - - - {{item}} + + 衰老度分析 + + 抬头纹:10处 + 抬头纹:10处 + + + 鱼尾纹:8处 + 鱼尾纹:2处 @@ -36,31 +181,21 @@ - - - - - - - + + + + + 日常分享 + + + 体验心得 + - - - - - {{recruitData.can.text}} - {{recruitData.can.text}} - - - - 暂无邀请人,无法申请体验 - - - 查看驳回原因 - + + @@ -68,4 +203,16 @@ 水感应·好“雾”星球 - \ No newline at end of file + + + + + + + + 关注公众号 + + + 截图扫码,关注公众号 + + diff --git a/pages/recruit/index.wxss b/pages/recruit/index.wxss index 82d3b16..c8e758c 100644 --- a/pages/recruit/index.wxss +++ b/pages/recruit/index.wxss @@ -2,10 +2,12 @@ width: 100%; } -.recruit { +.recruit, +.clockIn { margin: 10rpx 0; position: relative; width: 100%; + z-index: 9; } .recruit-back { @@ -202,4 +204,410 @@ /* .reject-tips image { width: 38rpx; display: inline-block; -} */ \ No newline at end of file +} */ + + +/* 打卡 */ +.clockImg { + width: 100%; +} + +.clockIn-tool { + display: flex; + margin: 80rpx -20rpx 40rpx; + height: 100rpx; + line-height: 100rpx; +} + +.clockIn-btn { + flex: 2; + text-align: center; + position: relative; + margin: 0 20rpx; +} + +.clockIn-btn-img, +.clockIn-btn-text { + position: absolute; + left: 0; + top: 0; + width: 100%; +} + +.clockIn-btn-text { + color: #ffffff; + font-size: 34rpx; + text-shadow: 4rpx 4rpx 4rpx rgba(0, 0, 0, .3); +} + + +/* 公众号关注 */ +.followPop { + position: fixed; + width: 100%; + height: 100%; + left: 0; + top: 0; + z-index: 99; + background-color: rgba(0, 0, 0, .4); + display: none; +} + +.followPop.active{ + display: block; +} + +.followCont { + width: 100%; + height: 100%; + left: 0; + top: 0; + position: fixed; + z-index: 100; + display: none; +} + +.followCont.active{ + display: block; +} + +.followText { + position: absolute; + left: 50%; + top: 50%; + width: 500rpx; + margin-left: -250rpx; + margin-top: -260rpx; + border-radius: 20rpx; + overflow: hidden; + background-color: #ffffff; + text-align: center; +} + +.followText.active { + width: 300px; + height: 250rpx; + margin-top: -130rpx; + margin-left: -150px; +} + + +.weChat-close { + position: absolute; + right: 30rpx; + top: 25rpx; + width: 38rpx; + height: 38rpx; +} + +.weChat-img { + width: 60%; + margin: 30rpx auto 0; +} + +.weChat-title { + height: 90rpx; + line-height: 90rpx; + border-bottom: 2rpx dashed rgb(236, 236, 236); + font-weight: 600; +} + +.weChat-text { + font-size: 28rpx; + color: #9d9d9d; + line-height: 60rpx; + padding-bottom: 30rpx; +} + +.clockInTitle { + color: #ffffff; + margin-bottom: 30rpx; +} + +.clockInTitle-user { + font-size: 36rpx; + margin-bottom: 15rpx; +} + +.clockInTitle-text { + font-size: 26rpx; + display: flex; +} + +.clockInTitle-day { + position: relative; + padding: 0 15rpx; + margin: 0 15rpx; +} + +.clockInTitle-day text { + font-size: 44rpx; + position: absolute; + left: 0; + top: -20rpx; + font-style: italic; + font-weight: 600; + z-index: 2; +} + +.clockInTitle-day::after { + position: absolute; + content: ''; + left: 0; + bottom: 0; + width: 100%; + height: 16rpx; + background-color: #87b2f7; +} + +.clockInDate { + background-color: #ffffff; + border-radius: 30rpx; + position: relative; +} + +.clockInDate-img { + position: absolute; + top: -128rpx; + right: 0; + width: 140rpx; +} + +.date { + padding: 30rpx; + box-sizing: border-box; + display: flex; + width: 100%; +} + +.arrow-left { + width: calc(50% - 100rpx); + text-align: center; +} + +.arrow-left image { + width: 26rpx; + height: 26rpx; +} + +.arrow-left image { + transform: rotate(180deg); +} + +.arrow-right image { + transform: rotate(-360deg); +} + +.arrow-moon { + width: 200rpx; + text-align: center; +} + +.list { + padding: 30rpx; + box-sizing: border-box; + border-top: 2rpx solid #d6d6d6; + border-bottom: 2rpx solid #d6d6d6; +} + +.week { + display: flex; +} + +.week-label { + text-align: center; + font-size: 26rpx; + width: 14.28%; + padding-bottom: 30rpx; +} + +.total { + padding: 30rpx; + box-sizing: border-box; + font-size: 24rpx; + display: flex; +} + +.clockIn-border { + padding: 30rpx; +} + +.total-left { + flex: 1; +} + +.total-left-text text { + color: #ff9000; +} + +.total-btn { + background-color: #5390f4; + color: #ffffff; + border-radius: 80rpx; + line-height: 64rpx; + padding: 0 40rpx; + font-size: 26rpx; +} + +.total-btn.active { + background-color: #b3b3b3; +} + +/* 报告对比 */ +.backImg { + width: 100%; + position: absolute; + top: 50%; + left: 0; + z-index: 0; +} + +.ratio-title { + margin: 80rpx 0 30rpx; + width: 100%; + text-align: center; +} + +.ratio-title image { + width: 50%; +} + +.recruit-photo { + display: flex; + padding: 20rpx 60rpx 50rpx; + box-sizing: border-box; +} + +.recruit-photo-img { + background-color: #ffffff; + border-radius: 20rpx; + padding: 10rpx; + box-sizing: border-box; + width: 140rpx; + height: 140rpx; +} + +.recruit-photo-img image { + width: 100%; + height: 100%; +} + +.recruit-photo-text { + width: calc(100% - 280rpx); + text-align: center; + color: #ffffff; + font-weight: 600; + font-size: 56rpx; + line-height: 140rpx; +} + +.recruit-data { + background-color: #ffffff; + border-radius: 30rpx; + overflow: hidden; + padding: 0 40rpx 30rpx; + position: relative; +} + +.recruit-data::after { + position: absolute; + content: ''; + left: 0; + top: 0; + height: 50rpx; + background-image: linear-gradient(to top, transparent, #ebf3ff); + width: 100%; +} + +.recruit-list { + margin-top: 30rpx; +} + +.recruit-list-name { + color: #508df4; + text-align: center; + font-size: 34rpx; + margin-bottom: 20rpx; +} + +.recruit-list-item { + box-sizing: border-box; + flex-wrap: wrap; + justify-content: flex-start; + width: 100%; +} + +.recruit-list-label { + width: 50%; + display: inline-block; + line-height: 80rpx; + font-size: 26rpx; + color: #999999; + position: relative; + padding-left: 20rpx; + box-sizing: border-box; +} + +.recruit-list-label::after { + position: absolute; + content: ''; + left: 0; + top: calc(50% - 4rpx); + width: 8rpx; + height: 8rpx; + background-color: #999999; + border-radius: 50%; +} + +.recruit-list-label:last-child { + color: #000000; +} + +.recruit-list-label image { + width: 28rpx; + vertical-align: -4rpx; + margin-left: 10rpx; +} + +.day { + flex-wrap: wrap; + display: flex; +} + +.day-label { + width: 14.28%; + text-align: center; + line-height: 80rpx; + font-size: 28rpx; +} + +.label-block { + background-color: #ffffff; + text-align: center; +} + +.label-block.active { + color: #c4c4c4; +} + +.label-block.current { + color: #5893f4; + position: relative; +} + +.label-block.current::after { + border: 2rpx solid #5893f4; + position: absolute; + content: ''; + left: calc(50% - 24rpx); + top: calc(50% - 26rpx); + width: 52rpx; + height: 52rpx; + border-radius: 50%; + box-sizing: border-box; +} + +.label-success { + width: 52rpx; + vertical-align: -16rpx; +} \ No newline at end of file diff --git a/pages/recruit/referto/referto.js b/pages/recruit/referto/referto.js index eabcb71..5b2d46e 100644 --- a/pages/recruit/referto/referto.js +++ b/pages/recruit/referto/referto.js @@ -48,7 +48,9 @@ Page({ * 申请前置接口 */ recruitInfo(id) { - wx.$api.recruit.Enroll(id).then(res => { + wx.$api.recruit.Enroll(id, { + experience_area_id: getApp().globalData.experienceAreaId + }).then(res => { let areas = [ { city: "请选择城市", @@ -146,7 +148,8 @@ Page({ // district_id : this.data.regiId, experience_id : this.data.experienceId, experience_area_id : this.data.cityArr[this.data.cityIndex].experience_area_id, - experience_type_id : this.data.typesArr[this.data.typesIndex].experience_type_id + experience_type_id : this.data.typesArr[this.data.typesIndex].experience_type_id, + invite : getApp().globalData.inviteText } this.setData({ disabled: true diff --git a/pages/recruit/signWrite/signWrite.js b/pages/recruit/signWrite/signWrite.js new file mode 100644 index 0000000..b99b934 --- /dev/null +++ b/pages/recruit/signWrite/signWrite.js @@ -0,0 +1,143 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + albumArr : [], //商品轮播图 + experienceId : '', //活动id + signDayNumber: '', //累计打卡天数-携带 + etciData : '', //打卡心得 + bidData : '', //产品建议 + refertoStatus: false,//打卡成功弹出 + signDayNumber: '', //累计打卡天数-最新 + signWaterNumber: ' '//累计打卡水滴 + }, + + /** + * 生命周期函数--监听页面加载 + */ + // 个人使用喷雾主要还是以清洁、舒爽为目的,洗脸之后喷上一层喷雾,稍微呆上30s,心理上的幸福感高于它的功能,如果想要利用喷雾来明显改善皮肤状态,要持续使用 + // 保湿喷雾最基本的就是一定要安全、健康,通常保湿喷雾会在国家药监局有备案。若是不确定是否成分安全健康,大家可以登录国家药监局官网查询备案。 + + onLoad(options) { + this.setData({ + experienceId : options.experienceId, + signDayNumber: Number(options.signDayNumber) + 1 + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 上传商品封面图片 + */ + addAlbum(){ + let count = 9 - this.data.albumArr.length + wx.chooseImage({ + count : count, + success : res=>{ + // 上传图片 + if (res.tempFilePaths){ + let pathArr = res.tempFilePaths + wx.showLoading({ + title: '上传中', + }) + for (let i = 0; i < pathArr.length; i++){ + wx.$api.file.uploadImg(pathArr[i], {}).then(res=>{ + let albumArr = this.data.albumArr + albumArr.push({ + path: res.path, + showpath: res.url + }) + this.setData({ + albumArr + }) + }) + + if (i == pathArr.length - 1) { + wx.hideLoading() + } + } + }else{ + wx.showToast({ + title: '上传图片失败', + icon : 'none' + }) + } + } + }) + }, + + /** + * 删除商品封面图片 + */ + removeAlbum(e){ + wx.showLoading({ + title: '加载中' + }) + let index = e.currentTarget.dataset.index, + atalbum = this.data.albumArr + + wx.showToast({ + title: '删除成功', + icon : 'none' + }) + atalbum.splice(index,1) + this.setData({ + albumArr : atalbum + }) + }, + + /** + * 心得 + */ + etcinput(e) { + this.setData({ + etciData: e.detail.value + }) + }, + + /** + * 产品建议 + */ + bidinput(e) { + this.setData({ + bidData: e.detail.value + }) + }, + + /** + * 签到提交 + */ + tapSign() { + let newPictures = [] + for (let pictures of this.data.albumArr){ + newPictures.push(pictures.path) + } + + wx.$api.recruit.signLabor({ + experience_id : this.data.experienceId, + describe : this.data.etciData, + images : newPictures, + suggest : this.data.bidData + }).then(res => { + console.log(res) + this.setData({ + refertoStatus: true, + signDayNumber: res.data.signDayNumber, + signWaterNumber: res.data.signWaterNumber + }) + }).catch(err => {}) + }, +}) \ No newline at end of file diff --git a/pages/recruit/signWrite/signWrite.json b/pages/recruit/signWrite/signWrite.json new file mode 100644 index 0000000..74a4c3b --- /dev/null +++ b/pages/recruit/signWrite/signWrite.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "体验官签到" +} \ No newline at end of file diff --git a/pages/recruit/signWrite/signWrite.wxml b/pages/recruit/signWrite/signWrite.wxml new file mode 100644 index 0000000..4c28b9b --- /dev/null +++ b/pages/recruit/signWrite/signWrite.wxml @@ -0,0 +1,67 @@ + + + + + + + + + #使用心得##第{{signDayNumber}}天# + + + + + + 删除 + + + + + + 上传图片 + + + + + + #产品建议# + + + + + + + + + + 返回 + + + + 发布 + + + + + + + + + 水感应·好“雾”星球 + + + + + + + + + 已累计打卡{{signDayNumber}} + + +{{signWaterNumber}}水滴 + + + 我知道了 + + + diff --git a/pages/recruit/signWrite/signWrite.wxss b/pages/recruit/signWrite/signWrite.wxss new file mode 100644 index 0000000..9faab56 --- /dev/null +++ b/pages/recruit/signWrite/signWrite.wxss @@ -0,0 +1,236 @@ +.recruit-title { + width: 100%; +} + +.recruit-padding { + padding: 30rpx; + box-sizing: border-box; +} + +.recruit-block { + background-color: #5390f4; + border-radius: 50rpx; + padding: 20rpx; + box-sizing: border-box; +} + +.recruit-border { + border: 4rpx solid #000000; + border-radius: 50rpx; + padding: 50rpx; + box-sizing: border-box; +} + +.recruit-img { + width: 100%; +} + +.recruit-white { + background-color: white; + border-radius: 40rpx; + padding: 5rpx 35rpx; + box-sizing: border-box; + margin-top: 30rpx; + position: relative; +} + +.clockIn-tool { + display: flex; + margin: 80rpx -20rpx 40rpx; + height: 100rpx; + line-height: 100rpx; +} + +.clockIn-btn { + flex: 2; + text-align: center; + position: relative; + margin: 0 20rpx; +} + +.clockIn-btn-img, +.clockIn-btn-text { + position: absolute; + left: 0; + top: 0; + width: 100%; +} + +.clockIn-btn-text { + color: #ffffff; + font-size: 34rpx; + text-shadow: 4rpx 4rpx 4rpx rgba(0, 0, 0, .3); +} + + +.recruit-bottom { + position: relative; + height: 180rpx; +} + +.recruit-bottom-img { + position: absolute; + left: 0; + top: 0; + width: 100%; +} + +.recruit-bottom-text { + position: absolute; + left: 0; + bottom: 0; + width: 100%; + z-index: 9; + color: #ffffff; + text-align: center; + font-size: 28rpx; +} + +.frame { + border-top: 4rpx dotted #ffffff; + border-bottom: 4rpx dotted #ffffff; + padding: 30rpx 0; + box-sizing: border-box; +} + +/* 图片上传 */ + +.album-list{ + display: flex; + flex-wrap:wrap; + margin: 30rpx -10rpx 0; +} + +.album-list-li{ + position: relative; + width: 30%; + padding-top: 30%; + box-sizing: border-box; + margin: 10rpx; +} + +.album-list-img, +.album-list-li-add{ + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: #a1c5ff; + border-radius: 6rpx; +} + +.album-list-li-add{ + text-align: center; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-box-pack: center; + color: #ffffff; + font-size: 26rpx; +} + +.album-list-add-icon{ + width: 78rpx; + height: 78rpx; +} + +.album-remove{ + position: absolute; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, .5); + color: white; + font-size: 28rpx; + text-align: center; + line-height: 50rpx; + width: 100%; + z-index: 9; +} + +.frame-write-name { + color: #ffcb5c; + margin-bottom: 20rpx; +} + +.frame-write-text { + color: #cde0ff; + line-height: 44rpx; + max-height: 120rpx; + font-size: 26rpx; +} + +/* 弹出 */ +/* 弹出 */ +.refertoEject { + position: fixed; + width: 100vw; + height: 100vh; + left: 0; + top: 0; + background-color: rgba(0, 0, 0, .6); + z-index: 10000; + 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: 100000; + padding: 0 15%; + box-sizing: border-box; + text-align: center; + display: none; +} + +.refertoCont.active { + display: -webkit-box; +} + +.refertoCont-text { + background-color: #ffffff; + border-radius: 0 0 20rpx 20rpx; + padding: 40rpx; + box-sizing: border-box; + position: relative; +} + +.refertoCont-img { + width: 100%; + display: block; +} + +.refertoCont-tips { + margin: 30rpx 0; + color: #4284fd; + line-height: 50rpx; +} + +.refertoCont-icon { + width: 50rpx; + vertical-align: -10rpx; + margin-right: 10rpx; +} + +.refertoCont-tips text { + font-size: 44rpx; + padding-right: 10rpx; +} + +.refertoCont-btn { + background-color: #4284fd; + color: #ffffff; + line-height: 90rpx; + border-radius: 80rpx; + display: inline-block; + padding: 0 60rpx; + margin-top: 20rpx; +} \ No newline at end of file diff --git a/pages/recruit/writeList/writeList.js b/pages/recruit/writeList/writeList.js new file mode 100644 index 0000000..cfb4099 --- /dev/null +++ b/pages/recruit/writeList/writeList.js @@ -0,0 +1,70 @@ + /* + * 手太欠 + * 愿这世界都如故事里一样 美好而动人~ + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + listsArr : [], // 订单列表 + page : {}, // 分页信息 + lodingStats : false,// 加载状态 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + onShow() { + // 获取订单列表 + this.listInfo() + }, + + /** + * 订单列表 + */ + listInfo(page) { + wx.$api.recruit.signList({page : page || 1}).then(res => { + console.log(res) + let listArr = this.data.listsArr, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data.data) + this.setData({ + listsArr : newData, + page : res.data.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }).catch(err => {}) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + // 获取订单列表 + this.listInfo(); + }, + + /** + * 上拉加载 + */ + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取订单列表 + this.listInfo(pageNumber); + } + } +}) \ No newline at end of file diff --git a/pages/recruit/writeList/writeList.json b/pages/recruit/writeList/writeList.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/pages/recruit/writeList/writeList.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/recruit/writeList/writeList.wxml b/pages/recruit/writeList/writeList.wxml new file mode 100644 index 0000000..639a03c --- /dev/null +++ b/pages/recruit/writeList/writeList.wxml @@ -0,0 +1,59 @@ + + + + + + + + + + #使用心得##第{{item.day_number}}天# + {{item.describe}} + + + + + + + + + #产品建议# + {{item.suggest}} + + + + + + + 加载中... + + + 没有更多了~ + + + + + + + + 返回 + + + + 报告 + + + + + + + + + 水感应·好“雾”星球 + + + + + + 暂无数据 + \ No newline at end of file diff --git a/pages/recruit/writeList/writeList.wxss b/pages/recruit/writeList/writeList.wxss new file mode 100644 index 0000000..c08f9aa --- /dev/null +++ b/pages/recruit/writeList/writeList.wxss @@ -0,0 +1,159 @@ +.recruit-title { + width: 100%; +} + +.recruit-padding { + padding: 30rpx; + box-sizing: border-box; +} + +.recruit-block { + background-color: #5390f4; + border-radius: 50rpx; + padding: 20rpx; + box-sizing: border-box; + margin-bottom: 30rpx; +} + +.recruit-border { + border: 4rpx solid #000000; + border-radius: 50rpx; + padding: 50rpx; + box-sizing: border-box; +} + +.recruit-img { + width: 100%; +} + +.recruit-white { + background-color: white; + border-radius: 40rpx; + padding: 5rpx 35rpx; + box-sizing: border-box; + margin-top: 30rpx; + position: relative; +} + +.clockIn-tool { + display: flex; + margin: 80rpx -20rpx 40rpx; + height: 100rpx; + line-height: 100rpx; +} + +.clockIn-btn { + flex: 2; + text-align: center; + position: relative; + margin: 0 20rpx; +} + +.clockIn-btn-img, +.clockIn-btn-text { + position: absolute; + left: 0; + top: 0; + width: 100%; +} + +.clockIn-btn-text { + color: #ffffff; + font-size: 34rpx; + text-shadow: 4rpx 4rpx 4rpx rgba(0, 0, 0, .3); +} + + +.recruit-bottom { + position: relative; + height: 180rpx; +} + +.recruit-bottom-img { + position: absolute; + left: 0; + top: 0; + width: 100%; +} + +.recruit-bottom-text { + position: absolute; + left: 0; + bottom: 0; + width: 100%; + z-index: 9; + color: #ffffff; + text-align: center; + font-size: 28rpx; +} + +.frame { + border-top: 4rpx dotted #ffffff; + border-bottom: 4rpx dotted #ffffff; + padding: 30rpx 0; + box-sizing: border-box; +} + +/* 图片上传 */ + +.album-list{ + display: flex; + flex-wrap:wrap; + margin: 20rpx -10rpx 0; +} + +.album-list-li{ + position: relative; + width: 30%; + padding-top: 30%; + box-sizing: border-box; + margin: 10rpx; +} + +.album-list-img, +.album-list-li-add{ + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: #a1c5ff; + border-radius: 6rpx; +} + +.album-list-li-add{ + text-align: center; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-box-pack: center; + color: #ffffff; + font-size: 26rpx; +} + +.album-list-add-icon{ + width: 78rpx; + height: 78rpx; +} + +.album-remove{ + position: absolute; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, .5); + color: white; + font-size: 28rpx; + text-align: center; + line-height: 50rpx; + width: 100%; + z-index: 9; +} + +.frame-write-name { + color: #ffcb5c; + margin-bottom: 20rpx; +} + +.frame-write-text { + color: #cde0ff; + line-height: 48rpx; +} diff --git a/pages/report/index.js b/pages/report/index.js index 5c4a1cf..4702bca 100644 --- a/pages/report/index.js +++ b/pages/report/index.js @@ -10,33 +10,19 @@ Page({ page : {}, // 分页信息 lodingStats : false, // 加载状态 disabled : false, // 支付按钮 - payCode : '', // code获取openid - openId : '', // openid payStatus : false, // 支付弹框 catchtouchmove: false }, - onLoad(options) { - }, + onLoad(options) {}, onShow() { - wx.login({ - success: res => { - this.setData({ - payCode: res.code - }) - // 获取openid - this.openInfo() - } - }) - // 获取登录状态 if(wx.getStorageSync("token") != ''){ this.setData({ userLogin: true, disabled : false }) - // 获取检测结果列表 this.aiInfo(); } else { @@ -66,24 +52,13 @@ Page({ }).catch(err => { }) }, - /** - * openid - */ - openInfo() { - wx.$api.auth.codeOpenid({code: this.data.payCode}).then(res => { - this.setData({ - openId: res.data - }) - }).catch(err => {}) - }, - /** * 处理未登录时的转跳 */ assessGo(){ if(wx.getStorageSync("token") != ''){ wx.navigateTo({ - url: '/pages/index/assess/assess?code=' + this.data.openId + url: '/pages/index/assess/assess?code=' + wx.getStorageSync("openid") }) }else{ // 去登录 diff --git a/project.private.config.json b/project.private.config.json index 56f1921..3910f25 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -10,14 +10,14 @@ "list": [ { "name": "", - "pathName": "pages/report/detail/detail", + "pathName": "pages/recruit/index", "query": "", "launchMode": "default", "scene": null }, { "name": "", - "pathName": "pages/report/index", + "pathName": "pages/recruit/signWrite/signWrite", "query": "", "launchMode": "default", "scene": null diff --git a/static/icons/circle_add.png b/static/icons/circle_add.png new file mode 100644 index 0000000..f81b481 Binary files /dev/null and b/static/icons/circle_add.png differ diff --git a/static/icons/drop.png b/static/icons/drop.png new file mode 100644 index 0000000..fc4dd0f Binary files /dev/null and b/static/icons/drop.png differ diff --git a/static/icons/flat.png b/static/icons/flat.png new file mode 100644 index 0000000..6b1a09a Binary files /dev/null and b/static/icons/flat.png differ diff --git a/static/icons/uricacidClose.png b/static/icons/uricacidClose.png new file mode 100644 index 0000000..aee1c19 Binary files /dev/null and b/static/icons/uricacidClose.png differ diff --git a/static/imgs/weChat_code.jpg b/static/imgs/weChat_code.jpg new file mode 100644 index 0000000..2f44d56 Binary files /dev/null and b/static/imgs/weChat_code.jpg differ