hookehuyr

✨ feat: 快捷进入组件调整排行榜入口功能

<template>
<div>
<img v-if="isHome" @click="toHome" class="icon-home" referrerpolicy="no-referrer" :src="icon_home" />
<img v-if="isMe" @click="toMe" class="icon-me" referrerpolicy="no-referrer" :src="icon_me" />
<van-image v-if="isHome" class="icon-home" :src="icon_home" @click="toHome" />
<van-image v-if="isMe" class="icon-me" :src="icon_me" @click="toMe" />
<van-image v-if="isRank" class="icon-rank" :src="icon_rank" @click="toRank" />
</div>
</template>
<script setup>
import Cookies from 'js-cookie'
import icon_me from '@images/icon-my@2x.png'
import icon_home from '@images/icon-home@2x.png'
import { ref, reactive, onMounted } from 'vue'
// const props = defineProps({
// type: String
// })
const emit = defineEmits(['on-click']);
const handle = () => {
emit('on-click', '')
}
import { icon_me, icon_home, icon_rank } from '@/utils/generateIcons.js'
</script>
<script>
// FIXME: VUE2写法
export default {
props: ['type', 'item'],
data () {
data() {
return {
userType: Cookies.get('userType') ? Cookies.get('userType') : ''
}
},
computed: {
isHome () {
isHome() {
return this.item.indexOf('home') !== -1 ? true : false
},
isMe () {
isMe() {
return this.item.indexOf('me') !== -1 ? true : false
},
isRank() {
return this.item.indexOf('rank') !== -1 ? true : false
},
mounted () {
},
mounted() {
},
methods: {
toHome () {
toHome() {
// 返回首页
if (this.type === 'B') { // 服务端判断
this.$router.push({
......@@ -68,7 +61,7 @@ export default {
}
}
},
toMe () {
toMe() {
if (this.type === 'B') { // 服务端判断
this.$router.push({
path: '/business/me'
......@@ -78,26 +71,41 @@ export default {
path: '/me/index'
});
}
},
toRank () {
this.$router.push({
path: '/client/rankList'
});
}
}
}
</script>
<style lang="less" scoped>
.icon-home {
.icon-home {
z-index: 169;
position: fixed;
right: 2rem;
bottom: 12rem;
bottom: 14rem;
width: 3rem;
height: 3rem;
}
.icon-me {
}
.icon-me {
z-index: 169;
position: fixed;
right: 2rem;
bottom: 8rem;
bottom: 10rem;
width: 3rem;
height: 3rem;
}
}
.icon-rank {
z-index: 169;
position: fixed;
right: 2rem;
bottom: 6rem;
width: 3rem;
height: 3rem;
}
</style>
......
......@@ -6,7 +6,7 @@ export const useShortcutBar = (item) => {
const $route = useRoute();
const path = $route.path;
const isClient = Cookies.get('userType') === 'client' ? true : false; // 判断C端入口位置,访客/客户
const case1 = ['home', 'me'];
const case1 = ['home', 'me', 'rank'];
const case2 = ['home'];
const case3 = ['me'];
const shortcutItem = ref([]);
......