Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
tswj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2022-05-31 18:16:33 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c07af0c617669b032b436a784239510430b78a43
c07af0c6
1 parent
0d174961
✨ feat: 快捷进入组件调整排行榜入口功能
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
27 deletions
src/components/ShortcutFixed/index.vue
src/composables/useShortcutBar.js
src/components/ShortcutFixed/index.vue
View file @
c07af0c
<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: 12
rem;
bottom: 14
rem;
width: 3rem;
height: 3rem;
}
.icon-me {
}
.icon-me {
z-index: 169;
position: fixed;
right: 2rem;
bottom: 8
rem;
bottom: 10
rem;
width: 3rem;
height: 3rem;
}
}
.icon-rank {
z-index: 169;
position: fixed;
right: 2rem;
bottom: 6rem;
width: 3rem;
height: 3rem;
}
</style>
...
...
src/composables/useShortcutBar.js
View file @
c07af0c
...
...
@@ -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
([]);
...
...
Please
register
or
login
to post a comment