1f3f2378
起风了
我的第一次
|
1
2
3
|
<template>
<view class="page-total">
<view class="tab-list">
|
755ce1c7
起风了
修改
|
4
|
<!-- 普通用户 -->
|
1f3f2378
起风了
我的第一次
|
5
6
7
8
9
10
11
|
<view class="list" v-for="(item,index) in TabBarList" v-if="qxshow"
@click="onTabBar(item,item.index)"
:key="index">
<image :src="item.acImg" mode="widthFix" v-show="tabBarShow === item.index"></image>
<image :src="item.img" mode="widthFix" v-show="tabBarShow != item.index"></image>
<text :class="{'action':tabBarShow===item.index}">{{item.name}}</text>
</view>
|
755ce1c7
起风了
修改
|
12
13
14
15
16
17
18
19
20
21
|
<!-- 司机收敛工 -->
<view class="list" v-for="(item,index) in TabBarList1" v-if="sjshow"
@click="onTabBar(item,item.index)"
:key="index">
<image :src="item.acImg" mode="widthFix" v-show="tabBarShow === item.index"></image>
<image :src="item.img" mode="widthFix" v-show="tabBarShow != item.index"></image>
<text :class="{'action':tabBarShow===item.index}">{{item.name}}</text>
</view>
<!-- 登记底部 -->
<view class="list" v-for="(item,index) in TabBarList2" v-if="ddshow"
|
1f3f2378
起风了
我的第一次
|
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
@click="onTabBar(item,item.index)"
:key="index">
<image :src="item.acImg" mode="widthFix" v-show="tabBarShow === item.index"></image>
<image :src="item.img" mode="widthFix" v-show="tabBarShow != item.index"></image>
<text :class="{'action':tabBarShow===item.index}">{{item.name}}</text>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
TabBarList:[
{
index: 0,
name: '首页',
img: '/static/tabBar/tab_01.png',
acImg: '/static/tabBar/tab_02.png'
},
{
index: 3,
name: '我的',
img: '/static/tabBar/tab_07.png',
acImg: '/static/tabBar/tab_08.png'
}
],
TabBarList1:[
{
index: 3,
name: '我的',
img: '/static/tabBar/tab_07.png',
acImg: '/static/tabBar/tab_08.png'
}
],
|
755ce1c7
起风了
修改
|
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
TabBarList2:[
// {
// index: 3,
// name: '我的',
// img: '/static/tabBar/tab_07.png',
// acImg: '/static/tabBar/tab_08.png'
// },
{
index: 4,
name: '报丧登记',
img: '/static/tabBar/tab_07.png',
acImg: '/static/tabBar/tab_08.png'
}
],
|
1f3f2378
起风了
我的第一次
|
72
73
74
75
|
codeheight: 0,
isOverall: 0,
phoneModel: '',
qxshow:true,
|
755ce1c7
起风了
修改
|
76
77
|
ddshow:false,
sjshow:false
|
1f3f2378
起风了
我的第一次
|
78
79
80
81
82
83
84
85
86
87
88
|
};
},
props:{
tabBarShow: {
type: Number,
default: 0,
}
},
mounted() {
try {
console.log("角色",uni.getStorageSync('userjs'));
|
755ce1c7
起风了
修改
|
89
90
91
92
|
if(uni.getStorageSync('userjs') != '普通用户' && uni.getStorageSync('userjs') != '调度员'){
this.sjshow = true
}else{
this.sjshow = false
|
1f3f2378
起风了
我的第一次
|
93
94
95
|
}
if(uni.getStorageSync('userjs') == '普通用户'){
this.qxshow = true
|
755ce1c7
起风了
修改
|
96
97
98
99
100
101
102
|
}else{
this.qxshow = false
}
if(uni.getStorageSync('userjs') == '调度员'){
this.ddshow = true
}else{
this.ddshow = false
|
1f3f2378
起风了
我的第一次
|
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
}
const res = uni.getSystemInfoSync();
let that = this;
// 获取系统信息
uni.getSystemInfo({
success(res) {
console.log(res.brand) //手机牌子
console.log(res.model) //手机型号
console.log(res.screenWidth) //屏幕宽度
console.log(res.screenHeight) //屏幕高度
that.codeheight = Math.round(res.screenHeight);
that.phoneModel =res.model
if(res.model.search('iPhone')){
that.isOverall = 0;
}else if(Math.round(res.screenHeight)>740){
that.isOverall = 1;
}
console.log(that.isOverall);
}
});
} catch (e) {
// error
}
},
methods:{
/**
* @param {Object} item
* @param {Number} index
*/
onTabBar(item,index){
this.tabBarShow = index;
switch (index){
case 0:
wx.switchTab({
url:'/pages/funeral/funeral'
})
break;
case 1:
wx.switchTab({
url:'/pages/institution/institution'
})
break;
case 2:
wx.switchTab({
url:'/pages/mall/mall'
})
break;
case 3:
wx.switchTab({
url:'/pages/my/my'
})
break;
|
755ce1c7
起风了
修改
|
155
156
157
158
159
160
161
162
|
case 4:
uni.navigateTo({
url:'/pages/funeralreport/funeralreport'
})
// wx.switchTab({
// url:'/pages/funeralreport/funeralreport'
// })
break;
|
1f3f2378
起风了
我的第一次
|
163
164
165
166
167
168
169
170
171
|
}
}
}
}
</script>
<style scoped lang="scss">
@import 'TabBar.scss';
</style>
|