【bug】注释掉合同点击的判断

This commit is contained in:
fengachen
2021-11-01 18:34:40 +08:00
parent 74bff8532f
commit e4d1c2c440
+39 -29
View File
@@ -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'
// })
// }
},
/**
* 生命周期函数--监听页面加载