1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <template>
- <view>
- <u-tabbar :value="selectedIndex" @change="name=>change(name)" :fixed="true" :placeholder="true" :safeAreaInsetBottom="true">
- <u-tabbar-item name='home' :text="this.$t('tabbar.home')" icon="home"></u-tabbar-item>
- <u-tabbar-item name='info' :text="this.$t('tabbar.my')" icon="account"></u-tabbar-item>
-
- </u-tabbar>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- selectedIndex: getApp().globalData.tabIndex,
- isAuditUser:uni.getStorageSync('isAuditUser'),
- isDealerUser:uni.getStorageSync('isDealerUser'),
- }
- },
- computed: {
- },
- onReady() {
- console.log("golbalData.tabIndex",getApp().globalData.tabIndex);
- },
- methods: {
- change(e) {
- console.log(e,'----------------');
- getApp().globalData.tabIndex=e;
- var address= "";
- if(e=='home'){
- address= "/pages/home/home";
- }
- else if(e=='report'){
- address= "/pages/report/report";
- }
- else if(e=='info'){
- address= "/pages/info/info";
- }
- else if(e=='approval'){
- address= "/pages/approval/approvallist";
- }
- if(!address){
- uni.showToast({
- title: '不支持该功能,请核实',
- icon: 'none',
- duration: 3000,
- })
- return;
- }
- console.log("当前索引,", e)
- console.log(address);
- uni.switchTab({
- url: address
- })
- }
- }
- }
- </script>
- <style>
- </style>
|