体验官打卡

This commit is contained in:
2023-07-17 17:33:54 +08:00
parent 3ecd1fefa7
commit 38391e46a1
18 changed files with 389 additions and 56 deletions

View File

@@ -4,6 +4,8 @@ Page({
* 页面的初始数据
*/
data: {
userLogin : false,
recruitData : '',
type : 'flowPath', //flowPath 参与流程 clockIn 打卡
@@ -47,6 +49,10 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
this.setData({
followState: false
})
wx.login({
success: res => {
this.setData({
@@ -54,9 +60,22 @@ Page({
})
}
})
// 获取体验官首页
this.recruitInfo();
// 获取登录状态
if(wx.getStorageSync("token") != ''){
this.setData({
userLogin: true
})
return
}
this.setData({
type: 'flowPath',
followState: false
})
},
/**
@@ -70,19 +89,18 @@ Page({
this.setData({
recruitData: res.data
})
// 0可以申请 1需要面检测 5签收-查看物流 6打卡 7第二次面 8完成
if(res.data.can.status == 6 || res.data.can.status == 7 || res.data.can.status == 8) {
// 显示打卡数据
this.setData({
type : 'clockIn'
})
// 获取日历
this.signInfo();
// 获取日常任务
this.dailyInfo();
// 显示打卡数据
this.setData({
type : 'clockIn'
})
}
if(res.data.can.status == 8) {
@@ -97,12 +115,16 @@ Page({
*/
applyGo() {
if(wx.getStorageSync("token") != ''){
this.setData({
followStype : 'experience'
})
// 0可以申请 1需要面检测 5签收-查看物流 6打卡 7第二次面
if(this.data.recruitData.can.status == 0) {
this.setData({
followStype : 'experience'
})
if(!this.data.recruitData.is_subscribe) {
// 微信公众号入库
this.followCode();
this.setData({
followState: true
})
@@ -113,13 +135,25 @@ Page({
url: './referto/referto?id=' + this.data.recruitData.experience_id
})
} 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)
url: "/pages/recruit/expressTrack/expressTrack?id=" + this.data.recruitData.experience_id
})
} else if(this.data.recruitData.can.status == 6) {
// 日历打卡
if(!this.data.recruitData.is_subscribe) {
// 微信公众号入库
this.followCode();
this.setData({
followState: true
})
return
}
// 填写打卡心得
wx.navigateTo({
url: './signWrite/signWrite?experienceId=' + this.data.recruitData.experience_id + '&signDayNumber=' + this.data.signDayNumber
})
} else {
// 面部检测
wx.navigateTo({
@@ -130,6 +164,9 @@ Page({
}
// 去登录
this.setData({
followState: false
})
wx.navigateTo({
url: "/pages/login/index"
})
@@ -148,6 +185,14 @@ Page({
* 获取code
*/
followCode() {
wx.login({
success: res => {
this.setData({
loginCode: res.code
})
}
})
wx.getUserProfile({
desc : "获取你的昵称、头像、地区及性别",
success : e => {
@@ -215,7 +260,13 @@ Page({
* 签到弹出
*/
tapPop() {
this.setData({
followStype : 'experience'
})
if(!this.data.recruitData.is_subscribe) {
// 微信公众号入库
this.followCode();
this.setData({
followState: true
})
@@ -236,21 +287,27 @@ Page({
})
return
}
// 微信公众号入库
this.followCode();
this.setData({
followState: !this.data.followState
})
if(this.data.followStype == 'experience') {
// 0可以申请 1需要面检测 5签收-查看物流 6打卡 7第二次面
if(this.data.recruitData.can.status == 0) {
this.setData({
followState: false
})
// 申请体验官
wx.navigateTo({
url: './referto/referto?id=' + this.data.recruitData.experience_id
})
} else {
} else if(this.data.recruitData.can.status == 6) {
// 填写打卡心得
wx.navigateTo({
url: './signWrite/signWrite?experienceId=' + this.data.recruitData.experience_id + '&signDayNumber=' + this.data.signDayNumber
})
this.setData({
followState: false
})
}
},
@@ -355,9 +412,22 @@ Page({
* 公众号弹出
*/
followHide() {
// 微信公众号入库
this.followCode();
this.setData({
followState: !this.data.followState,
followStype: 'close'
})
},
/**
* 第二次免检
*/
tapSecond() {
// 面部检测
wx.navigateTo({
url: '/pages/index/assess/assess?type=2'
})
}
})