|
|
|
@ -26,8 +26,8 @@ Page({ |
|
|
|
loging: false, |
|
|
|
regist: false, |
|
|
|
metaData: null, |
|
|
|
code: null |
|
|
|
// code: '?mark=ztb_saas&QrCodeRecordId=589851945913683968'
|
|
|
|
// code: null
|
|
|
|
code: '?mark=ztb_saas&QrCodeRecordId=595295714456768512' |
|
|
|
}, |
|
|
|
/************************************** 初始化登录流程 ********************************************/ |
|
|
|
onLoad: function (options) { |
|
|
|
@ -102,6 +102,7 @@ Page({ |
|
|
|
if(enterpriseInfo.factoryInfos && enterpriseInfo.factoryInfos.length){ |
|
|
|
factoryId = enterpriseInfo.factoryInfos[enterpriseInfo.factoryInfos.length - 1].factoryId |
|
|
|
} |
|
|
|
app.userInfo.factoryId = factoryId |
|
|
|
} |
|
|
|
if(factoryId){ |
|
|
|
headerFactoryId(app.userInfo.factoryId) |
|
|
|
@ -152,7 +153,7 @@ Page({ |
|
|
|
for (let n = 0; n < element.factoryInfos.length; n++) { |
|
|
|
const item = element.factoryInfos[n] |
|
|
|
if(applicationStatus == -1){ |
|
|
|
applicationStatus = item.applicationStatus |
|
|
|
applicationStatus = item.type ? 1 : 0 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -385,15 +386,14 @@ Page({ |
|
|
|
}) |
|
|
|
}, |
|
|
|
submitForm: function(){ |
|
|
|
if(!this.data.metaData){ |
|
|
|
util.showToast('您的申请已经提交,不要重复提交') |
|
|
|
return |
|
|
|
} |
|
|
|
this.setData({loging: true}) |
|
|
|
if(this.data.metaData.qrPage == '/page/index/yaoqing'){ |
|
|
|
bindingAdmin(this.data.metaData).then(result => { |
|
|
|
storage.put('Authorization', app.globalData.token) |
|
|
|
app.userInfo.factoryId = this.data.metaData.factoryId |
|
|
|
app.userInfo.factoryName = this.data.metaData.factoryName |
|
|
|
this.data.metaData = null |
|
|
|
this.setData({loging: false}) |
|
|
|
wx.redirectTo({ url: '/pages/index/index' }) |
|
|
|
this.fetchUserInfo(app.globalData.token) |
|
|
|
}).catch(error => { |
|
|
|
this.setData({loging: false}) |
|
|
|
util.showToast(error) |
|
|
|
|