Browse Source

no message

feature/v1.6
xpz2018 4 years ago
parent
commit
594e5219c6
2 changed files with 9 additions and 1 deletions
  1. 8
      pages/index/index.js
  2. 2
      pages/index/index.wxml

8
pages/index/index.js

@ -27,6 +27,7 @@ Scene({
items: [], items: [],
mActiveIndex: 0, mActiveIndex: 0,
factoryId: '', factoryId: '',
arrow: false,
visible: false visible: false
}, },
/************************************** 初始化流程 ********************************************/ /************************************** 初始化流程 ********************************************/
@ -42,11 +43,17 @@ Scene({
const element = app.userInfo.enterpriseInfos[mIndex] const element = app.userInfo.enterpriseInfos[mIndex]
var enterprise = { text: element.enterpriseName } var enterprise = { text: element.enterpriseName }
var children = [] var children = []
if(mIndex >= 1){
this.data.arrow = true
}
for (let nIndex = 0; n < element.factoryInfos.length; nIndex++) { for (let nIndex = 0; n < element.factoryInfos.length; nIndex++) {
const item = element.factoryInfos[nIndex] const item = element.factoryInfos[nIndex]
if(item.factoryId == app.userInfo.factoryId){ if(item.factoryId == app.userInfo.factoryId){
this.data.mActiveIndex = mIndex this.data.mActiveIndex = mIndex
} }
if(nIndex >= 1){
this.data.arrow = true
}
var factory = { id: item.factoryId } var factory = { id: item.factoryId }
if(item.applicationStatus == 0 && !element.isAdmin){ if(item.applicationStatus == 0 && !element.isAdmin){
factory.text = item.factoryName + '(申请中)' factory.text = item.factoryName + '(申请中)'
@ -65,6 +72,7 @@ Scene({
mActiveIndex: this.data.mActiveIndex, mActiveIndex: this.data.mActiveIndex,
factoryId: app.userInfo.factoryId, factoryId: app.userInfo.factoryId,
factoryName: app.userInfo.factoryName, factoryName: app.userInfo.factoryName,
arrow: this.data.arrow,
customBar: app.globalData.CustomBar || (app.globalData.isIos ? 64 : 60), customBar: app.globalData.CustomBar || (app.globalData.isIos ? 64 : 60),
fragment: (app.globalData.safeFragmentHeight + app.globalData.statusBarHeight), fragment: (app.globalData.safeFragmentHeight + app.globalData.statusBarHeight),
safeBottom: app.globalData.safeBottom safeBottom: app.globalData.safeBottom

2
pages/index/index.wxml

@ -2,7 +2,7 @@
<cu-custom bgColor="bg-blue" wx:if="{{tabIndex != 3}}"> <cu-custom bgColor="bg-blue" wx:if="{{tabIndex != 3}}">
<view slot="right" class="flex flex-center" style="padding-left:32rpx" bindtap="showFactoryList"> <view slot="right" class="flex flex-center" style="padding-left:32rpx" bindtap="showFactoryList">
<text class="text-white text-xl" style="margin-right: 12rpx">{{ userInfo ? (factoryName || '未注册工厂') : ''}}</text> <text class="text-white text-xl" style="margin-right: 12rpx">{{ userInfo ? (factoryName || '未注册工厂') : ''}}</text>
<van-icon name="{{visible ? 'arrow-up' : 'arrow-down'}}" size="36rpx" color="white" />
<van-icon name="{{visible ? 'arrow-up' : 'arrow-down'}}" size="36rpx" color="white" wx:if="{{arrow}}"/>
</view> </view>
</cu-custom> </cu-custom>

Loading…
Cancel
Save