|
|
@ -27,6 +27,7 @@ Scene({ |
|
|
factoryName: '', |
|
|
factoryName: '', |
|
|
items: [], |
|
|
items: [], |
|
|
mActiveIndex: 0, |
|
|
mActiveIndex: 0, |
|
|
|
|
|
popIndex: 0, |
|
|
factoryId: '', |
|
|
factoryId: '', |
|
|
arrow: false, |
|
|
arrow: false, |
|
|
visible: false |
|
|
visible: false |
|
|
@ -74,6 +75,7 @@ Scene({ |
|
|
enterprise.children = children |
|
|
enterprise.children = children |
|
|
this.data.items.push(enterprise) |
|
|
this.data.items.push(enterprise) |
|
|
} |
|
|
} |
|
|
|
|
|
this.data.popIndex = this.data.mActiveIndex |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
userInfo: app.userInfo, |
|
|
userInfo: app.userInfo, |
|
|
items: this.data.items, |
|
|
items: this.data.items, |
|
|
@ -123,7 +125,10 @@ Scene({ |
|
|
this.setData({zIndex: detail}) |
|
|
this.setData({zIndex: detail}) |
|
|
}, |
|
|
}, |
|
|
showFactoryList: function(){ |
|
|
showFactoryList: function(){ |
|
|
this.setData({ visible: !this.data.visible }) |
|
|
|
|
|
|
|
|
if(!this.data.arrow){ |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.setData({ visible: !this.data.visible, mActiveIndex: this.data.popIndex }) |
|
|
if (this.data.tabIndex == 0) { |
|
|
if (this.data.tabIndex == 0) { |
|
|
var pageView = this.selectComponent('#' + this.data.tabList[this.data.tabIndex].value) |
|
|
var pageView = this.selectComponent('#' + this.data.tabList[this.data.tabIndex].value) |
|
|
pageView.onClose() |
|
|
pageView.onClose() |
|
|
@ -133,7 +138,7 @@ Scene({ |
|
|
this.setData({ visible: false }) |
|
|
this.setData({ visible: false }) |
|
|
}, |
|
|
}, |
|
|
onClickNav({ detail }) { |
|
|
onClickNav({ detail }) { |
|
|
this.setData({ mActiveIndex: detail.index || 0 }); |
|
|
|
|
|
|
|
|
this.setData({ mActiveIndex: detail.index || 0 }) |
|
|
}, |
|
|
}, |
|
|
changeFactory({ detail }) { |
|
|
changeFactory({ detail }) { |
|
|
if(app.userInfo.factoryId == detail.id){ |
|
|
if(app.userInfo.factoryId == detail.id){ |
|
|
@ -143,6 +148,7 @@ Scene({ |
|
|
wx.showLoading({ title: '正在切换', mask: true }) |
|
|
wx.showLoading({ title: '正在切换', mask: true }) |
|
|
app.userInfo.factoryId = detail.id |
|
|
app.userInfo.factoryId = detail.id |
|
|
storage.put('X-FACTORY-ID' + app.userInfo.userId, detail.id) |
|
|
storage.put('X-FACTORY-ID' + app.userInfo.userId, detail.id) |
|
|
|
|
|
this.data.popIndex = this.data.mActiveIndex |
|
|
const element = app.userInfo.enterpriseInfos[this.data.mActiveIndex] |
|
|
const element = app.userInfo.enterpriseInfos[this.data.mActiveIndex] |
|
|
if(element.isEnterprisePrimary){ |
|
|
if(element.isEnterprisePrimary){ |
|
|
app.userInfo.type = 'ADMIN' |
|
|
app.userInfo.type = 'ADMIN' |
|
|
|