|
|
|
// pages/release/index.js
|
|
|
|
const app = getApp();
|
|
|
|
|
|
|
|
Page({
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 页面的初始数据
|
|
|
|
*/
|
|
|
|
data: {
|
|
|
|
userInfo: {},
|
|
|
|
authStatus: 0,
|
|
|
|
authType: null,
|
|
|
|
completeState: null,
|
|
|
|
authInfo:{}
|
|
|
|
},
|
|
|
|
back(){
|
|
|
|
wx.switchTab({
|
|
|
|
url: '/pages/index/index',
|
|
|
|
})
|
|
|
|
},
|
|
|
|
toPersonlAuth(){
|
|
|
|
if(this.data.authStatus == 0){
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/pages/release/personAuth/index',
|
|
|
|
})
|
|
|
|
} else if(this.data.authStatus == 3){
|
|
|
|
let authInfo = encodeURIComponent(JSON.stringify(this.data.authInfo));
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/pages/release/personAuth/index?authInfo=' + authInfo,
|
|
|
|
})
|
|
|
|
} else if(this.data.authStatus == 1){
|
|
|
|
wx.showToast({
|
|
|
|
title: '认证申请审核中,请等待!',
|
|
|
|
icon: 'none'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
toCompanyAuth(){
|
|
|
|
if(this.data.authStatus == 0){
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/pages/release/companyAuth/index',
|
|
|
|
})
|
|
|
|
} else if(this.data.authStatus == 3){
|
|
|
|
let authInfo = encodeURIComponent(JSON.stringify(this.data.authInfo));
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/pages/release/companyAuth/index?authInfo=' + authInfo,
|
|
|
|
})
|
|
|
|
} else if(this.data.authStatus == 1){
|
|
|
|
wx.showToast({
|
|
|
|
title: '认证申请审核中,请等待!',
|
|
|
|
icon: 'none'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
*/
|
|
|
|
onLoad: function (options) {
|
|
|
|
|
|
|
|
},
|
|
|
|
isAuthentication(){
|
|
|
|
app.http('get','user/isAuthentication').then((res)=>{
|
|
|
|
if(res.data.success){
|
|
|
|
this.setData({
|
|
|
|
authStatus: res.data.data.authenticationState,
|
|
|
|
authType: res.data.data.authorizationType,
|
|
|
|
completeState: res.data.data.completeState,
|
|
|
|
authInfo: res.data.data.authInfo
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
toResources(){
|
|
|
|
let that = this;
|
|
|
|
console.log(this.data.authStatus,'authStatus')
|
|
|
|
console.log(this.data.authType,'authType')
|
|
|
|
console.log(this.data.completeState,'completeState')
|
|
|
|
if(this.data.authStatus == 2 && this.data.authType == 1 && this.data.completeState == true){
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/pages/user/editNeeds/index?type=1',
|
|
|
|
})
|
|
|
|
} else if(this.data.authStatus == 2 && this.data.authType == 1 && this.data.completeState == false){
|
|
|
|
wx.showModal({
|
|
|
|
title: '提示!',
|
|
|
|
content: '您还未完善企业信息,点击确定去完善吧~',
|
|
|
|
success(res){
|
|
|
|
if(res.confirm){
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/pages/release/perfectCompanyInfo/index',
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
} else if(this.data.authStatus == 0 && (this.data.authType == 1 || this.data.authType == 0) && this.data.completeState == false){
|
|
|
|
wx.showModal({
|
|
|
|
title: '提示!',
|
|
|
|
content: '您还未完成企业认证,点击确定去认证吧~',
|
|
|
|
success(res){
|
|
|
|
if(res.confirm){
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/pages/release/companyAuth/index',
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
toNeeds(){
|
|
|
|
if(this.data.authStatus == 2 && (this.data.authType == 2 || this.data.authType == 0) && this.data.completeState == true){
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/pages/user/editNeeds/index?type=2',
|
|
|
|
})
|
|
|
|
} else if(this.data.authStatus == 2 && (this.data.authType == 2 || this.data.authType == 0) && this.data.completeState == false){
|
|
|
|
wx.showModal({
|
|
|
|
title: '提示!',
|
|
|
|
content: '您还未完善个人信息,点击确定去完善吧~',
|
|
|
|
success(res){
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/pages/release/perfectPersonInfo/index',
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
} else if(this.data.authStatus == 0 && (this.data.authType == 2 || this.data.authType == 0) && this.data.completeState == false){
|
|
|
|
wx.showModal({
|
|
|
|
title: '提示!',
|
|
|
|
content: '您还未完成认证,点击上方按钮去认证吧!',
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面显示
|
|
|
|
*/
|
|
|
|
onShow: function () {
|
|
|
|
let userInfo = wx.getStorageSync('userInfo')
|
|
|
|
if(userInfo.phone && userInfo.phone != ''){
|
|
|
|
this.isAuthentication();
|
|
|
|
} else{
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/pages/login/index',
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面隐藏
|
|
|
|
*/
|
|
|
|
onHide: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面卸载
|
|
|
|
*/
|
|
|
|
onUnload: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
|
|
*/
|
|
|
|
onPullDownRefresh: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
|
*/
|
|
|
|
onReachBottom: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 用户点击右上角分享
|
|
|
|
*/
|
|
|
|
onShareAppMessage: function () {
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|