|
@@ -5,8 +5,7 @@
|
|
|
:customStyle="tabbarStyle">
|
|
|
<su-tabbar-item v-for="(item, index) in tabbar.items" :key="item.text" :text="item.text" :name="item.url"
|
|
|
:badge="item.badge" :dot="item.dot" :badgeStyle="{ ...tabbar.badgeStyle, paddingTop: '20px' }"
|
|
|
- :isCenter="getTabbarCenter(index)" :centerImage="sheep.$url.cdn(item.iconUrl)"
|
|
|
- @tap="sheep.$router.go(item.url)">
|
|
|
+ :isCenter="getTabbarCenter(index)" :centerImage="sheep.$url.cdn(item.iconUrl)" @tap="routerGo(item)">
|
|
|
<template v-slot:active-icon>
|
|
|
<image class="u-page__item__slot-icon" :src="sheep.$url.cdn(item.activeIconUrl)"></image>
|
|
|
</template>
|
|
@@ -23,7 +22,7 @@
|
|
|
import { computed, unref } from 'vue';
|
|
|
import sheep from '@/sheep';
|
|
|
import SuTabbar from '@/sheep/ui/su-tabbar/su-tabbar.vue';
|
|
|
-
|
|
|
+import CouponApi from '@/sheep/api/promotion/coupon';
|
|
|
const tabbar = computed(() => {
|
|
|
return sheep.$store('app').template.basic?.tabbar;
|
|
|
});
|
|
@@ -40,7 +39,18 @@ const tabbarStyle = computed(() => {
|
|
|
)}) no-repeat top center / 100% auto`,
|
|
|
};
|
|
|
});
|
|
|
-
|
|
|
+const userInfo = computed(() => sheep.$store('user').userInfo);
|
|
|
+const routerGo = (item) => {
|
|
|
+ if (item.url === '/pages/chat/index') {
|
|
|
+ CouponApi.getKefuConversationByRelID({
|
|
|
+ relID: 1
|
|
|
+ }).then((res) => {
|
|
|
+ sheep.$router.go('/pages/chat/index', { conversationId: res.data.id, relUserId: userInfo.value.id === res.data.relUserId ? res.data.userId : res.data.relUserId })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ sheep.$router.go(item.url)
|
|
|
+ }
|
|
|
+}
|
|
|
const getTabbarCenter = (index) => {
|
|
|
if (unref(tabbar).mode !== 2) return false;
|
|
|
return unref(tabbar).items % 2 > 0
|