You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
168 lines
4.1 KiB
168 lines
4.1 KiB
// pages/release/index.js |
|
const app = getApp(); |
|
|
|
Page({ |
|
|
|
/** |
|
* 页面的初始数据 |
|
*/ |
|
data: { |
|
userInfo: {}, |
|
authStatus: 0, |
|
authType: null, |
|
completeState: null |
|
}, |
|
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 == 1){ |
|
wx.showToast({ |
|
title: '认证申请审核中,请等待!', |
|
icon: 'none' |
|
}) |
|
} |
|
}, |
|
toCompanyAuth(){ |
|
if(this.data.authStatus == 0){ |
|
wx.navigateTo({ |
|
url: '/pages/release/companyAuth/index', |
|
}) |
|
} else if(this.data.authStatus == 1){ |
|
wx.showToast({ |
|
title: '认证申请审核中,请等待!', |
|
icon: 'none' |
|
}) |
|
} |
|
}, |
|
/** |
|
* 生命周期函数--监听页面加载 |
|
*/ |
|
onLoad: function (options) { |
|
|
|
}, |
|
isAuthentication(){ |
|
app.http('get','user/isAuthentication').then((res)=>{ |
|
console.log(res) |
|
if(res.data.success){ |
|
this.setData({ |
|
authStatus: res.data.data.authenticationState, |
|
authType: res.data.data.authorizationType, |
|
completeState: res.data.data.completeState |
|
}) |
|
} |
|
}) |
|
}, |
|
toResources(){ |
|
let that = this; |
|
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?status=' + that.data.authStatus, |
|
}) |
|
} |
|
|
|
} |
|
}) |
|
} else if(this.data.authStatus == 3 && this.data.authType == 1 && this.data.completeState == false){ |
|
wx.showModal({ |
|
title: '提示!', |
|
content: '您提交的企业信息未通过审核,点击确定去修改吧~', |
|
success(res){ |
|
wx.navigateTo({ |
|
url: '/pages/release/perfectCompanyInfo/index?status=' + that.data.authStatus, |
|
}) |
|
} |
|
}) |
|
} |
|
}, |
|
toNeeds(){ |
|
if(this.data.authStatus == 2 && (this.data.authType == 2 || this.data.authType == 1) && this.data.completeState == true){ |
|
wx.navigateTo({ |
|
url: '/pages/user/editNeeds/index?type=2', |
|
}) |
|
} else if((this.data.authStatus == 2 || this.data.authStatus == 3) && this.data.authType == 2 && this.data.completeState == false){ |
|
wx.showModal({ |
|
title: '提示!', |
|
content: '您还未完善个人信息,点击确定去完善吧~', |
|
success(res){ |
|
wx.navigateTo({ |
|
url: '/pages/release/perfectPersonInfo/index', |
|
}) |
|
} |
|
}) |
|
} else if((this.data.authStatus == 2 || this.data.authStatus == 3) && this.data.authType == 1 && this.data.completeState == false){ |
|
wx.showModal({ |
|
title: '提示!', |
|
content: '您还未完善企业信息,点击确定去完善吧~', |
|
success(res){ |
|
wx.navigateTo({ |
|
url: '/pages/release/perfectCompanyInfo/index', |
|
}) |
|
} |
|
}) |
|
} |
|
}, |
|
/** |
|
* 生命周期函数--监听页面显示 |
|
*/ |
|
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 () { |
|
|
|
} |
|
}) |