diff --git a/pages/projectDetail/projectDetail.js b/pages/projectDetail/projectDetail.js index e31670d..109d626 100644 --- a/pages/projectDetail/projectDetail.js +++ b/pages/projectDetail/projectDetail.js @@ -50,42 +50,52 @@ Page({ contractDetail(){ const that = this console.log(this.data.form) - if(this.data.form.contractId) { // 关联了合同才能去合同详情 - UserApi.contractDetail({id:this.data.form.contractId}).then(res=>{ - console.log(res) - if(res.success){ - this.setData({ - signedContactsId: res.result.signedContactsId - }) - wx.getStorage({ - key:'userInfo', - success(res){ - that.setData({ - currentId:res.data.id - }) - // 判断当前登录人是否是合同企业签订联系人 - console.log('that.data.currentId === that.data.signedContactsId',that.data.currentId === that.data.signedContactsId); - if(that.data.currentId === that.data.signedContactsId){ - wx.navigateTo({ - url: `../contractDetail/contractDetail?id=${that.data.form.contractId}`, - }) - }else{ - wx.showToast({ - title: '当前登录人不是合同签订企业联系人', - icon: 'none' - }) - } - } - }) - } + if(this.data.form.contractId){ + wx.navigateTo({ + url: `../contractDetail/contractDetail?id=${that.data.form.contractId}`, }) - // }else{ wx.showToast({ title: '未关联合同', icon: 'none' }) } + // if(this.data.form.contractId) { // 关联了合同才能去合同详情 + // UserApi.contractDetail({id:this.data.form.contractId}).then(res=>{ + // console.log(res) + // if(res.success){ + // this.setData({ + // signedContactsId: res.result.signedContactsId + // }) + // wx.getStorage({ + // key:'userInfo', + // success(res){ + // that.setData({ + // currentId:res.data.id + // }) + // // 判断当前登录人是否是合同企业签订联系人 + // console.log('that.data.currentId === that.data.signedContactsId',that.data.currentId === that.data.signedContactsId); + // if(that.data.currentId === that.data.signedContactsId){ + // wx.navigateTo({ + // url: `../contractDetail/contractDetail?id=${that.data.form.contractId}`, + // }) + // }else{ + // wx.showToast({ + // title: '当前登录人不是合同签订企业联系人', + // icon: 'none' + // }) + // } + // } + // }) + // } + // }) + // // + // }else{ + // wx.showToast({ + // title: '未关联合同', + // icon: 'none' + // }) + // } }, /** * 生命周期函数--监听页面加载