123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- <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,index)"
- :style="{ backgroundImage: 'url(' + (currentTab == index ? item.activePath : item.iconPath) + ')' }">
- </view>
- </view>
- </view>
- <tip-big-dialog ref="youkeDialogRef" @confirm-btn="ykConfirm" imgShow="false"></tip-big-dialog>
-
- </template>
- <script>
- import {
- MESSAGE_VISITER_TO_LOGIN
- } from "@/utils/constant.js"
- import tipMiddleDialog from '@/components/dialog/tipMiddleDialog.vue';
- import tipBigDialog from '@/components/dialog/tipBigDialog.vue';
- import {
- useTabBarHistory
- } from '@/utils/emitEvents.js';
- import cacheManager from "@/utils/cacheManager.js";
- import {
- toast,
- getUserIdentity
- } from "@/utils/common";
- import {
- nextTick,
- } from "vue";
- export default {
- components: {
- tipMiddleDialog,
- tipBigDialog
- },
- data() {
- return {
- tabList: [{
- iconPath: 'static/images/tabbar/unselect/plan-sj.png',
- activePath: 'static/images/tabbar/select/plan-sj.png',
- path: `/pages/study/index`
- },
- {
- iconPath: 'static/images/tabbar/unselect/partner-sj.png',
- activePath: 'static/images/tabbar/select/partner-sj.png',
- path: '/pages/game/index'
- },
- {
- iconPath: 'static/images/tabbar/unselect/my-sj.png',
- activePath: 'static/images/tabbar/select/my-sj.png',
- path: `/pages/my/index`
- },
- ],
- currentTab: 0,
- MESSAGE_VISITER_TO_LOGIN
- };
- },
- props: {
- nianji: {
- type: String,
- },
- cardId: {
- type: String,
- },
- zhangId: {
- type: String,
- },
- currentTabNumber: {
- type: Number,
- },
- tipFlag: {
- type: String,
- },
- },
- methods: {
- // 游客弹窗---确定
- ykConfirm() {
- uni.redirectTo({
- url: '/pages/login/index'
- });
- },
- switchTab(path, index) {
- if (path !== '/pages/game/index') {
- this.currentTab = index;
- }
- if (getUserIdentity() == 'Visitor') {
- if (path === '/pages/game/index') {
- this.$refs.youkeDialogRef.handleShow();
- return;
- }
- uni.redirectTo({
- url: path + '?nianji=' + this.nianji + '&cardId=' + this.cardId + '&zhangId=' +
- this.zhangId+ '&tipFlag=' + this.tipFlag
- });
- } else {
- if (path === '/pages/game/index') {
- // 游戏需要返回功能
- uni.navigateTo({
- url: path,
- "animationType": "fade-in",
- "animationDuration":0
- });
- return;
- }
- uni.navigateTo({
- url: path,
- "animationType": "fade-in",
- "animationDuration":0
- });
- }
- },
- },
- created() {
- this.currentTab =this.currentTabNumber
- }
- }
- </script>
|