12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <template>
- <view class="ezy-custom-tabbar">
- <view class="tabbar-item-box">
- <view class="tabbar-item" v-for="(item, index) in tabList" :key="index" @click="switchTab(item.path)"
- :style="{backgroundImage: 'url(' + item.iconPath + ')'}"></view>
- </view>
- </view>
- </template>
- <script>
- import {
- useTabBarHistory
- } from '@/utils/emitEvents.js';
- import cacheManager from "@/utils/cacheManager.js";
- import {
- toast,getUserIdentity
- } from "@/utils/common";
- export default {
- data() {
- return {
- tabList: [{
- iconPath: 'static/images/tabbar/unselect/plan-sj.png',
- path: `/pages/study/index`
- },
- {
- iconPath: 'static/images/tabbar/unselect/partner-sj.png',
- path: '/pages/game/index'
- },
- {
- iconPath: 'static/images/tabbar/unselect/my-sj.png',
- path: `/pages/my/index`
- },
- ],
- };
- },
- props: {
- nianji: {
- type: String,
- },
- cardId: {
- type: String,
- },
- zhangId: {
- type: String,
- },
-
- },
- methods: {
- switchTab(path, params = {}) {
-
- if(path =='/pages/game/index'){
- toast("功能暂未开放!")
- return false
- }
-
- if (getUserIdentity() == 'Visitor') {
- uni.redirectTo({
- url: path + '?nianji=' + this.nianji + '&cardId=' + this.cardId + '&zhangId=' + this
- .zhangId
- });
- }else{
- uni.redirectTo({
- url: path
- });
- }
- },
- },
- created() {
- console.log(this.nianji);
- }
- }
- </script>
- <style scoped>
- .custom-tabbar {
- display: flex;
- justify-content: space-around;
- align-items: center;
- /* 其他样式 */
- }
- .tab-item {
- flex: 1;
- /* 样式 */
- }
- .tab-icon {
- /* 图标样式 */
- }
- </style>
|