|
@@ -1,9 +1,7 @@
|
|
|
<script setup lang="ts">
|
|
|
import TabbarEvo from '@/components/tabbar-evo.vue'
|
|
|
import { iconCamera, iconWallet } from '../core/libs/pngs'
|
|
|
-import {
|
|
|
- readCount
|
|
|
-} from '../core/libs/requests'
|
|
|
+import { readCount } from '../core/libs/requests'
|
|
|
import {
|
|
|
home,
|
|
|
homeActive,
|
|
@@ -18,7 +16,7 @@ import {
|
|
|
import { currRoute } from '../utils'
|
|
|
import { defaultThemeVars } from '../core/themes/default'
|
|
|
import { useRouter } from '../core/utils/router'
|
|
|
-import HonorDialog from "@/pages/home/components/honor-dialog/honor-dialog.vue";
|
|
|
+import HonorDialog from '@/pages/home/components/honor-dialog/honor-dialog.vue'
|
|
|
|
|
|
const router = useRouter()
|
|
|
const publishState = ref(false)
|
|
@@ -47,7 +45,7 @@ const items = [
|
|
|
title: '消息',
|
|
|
iconPath: message,
|
|
|
selectedIconPath: messageActive,
|
|
|
- notice:messageCount,
|
|
|
+ notice: messageCount,
|
|
|
path: '/pages/messages/index',
|
|
|
},
|
|
|
{
|
|
@@ -60,36 +58,43 @@ const items = [
|
|
|
const handleTabbarItemClick = (path: string) => {
|
|
|
if (path === '/pages-sub/publish/index') {
|
|
|
publishState.value = true
|
|
|
+ uni.$emit('clickTabbar', publishState.value)
|
|
|
return
|
|
|
}
|
|
|
getMessageNotice()
|
|
|
router.push(path, true)
|
|
|
// uni.switchTab({ url: path })
|
|
|
}
|
|
|
-const getMessageNotice = async () =>{
|
|
|
- let value = await readCount();
|
|
|
- if(value?.data?.length > 0){
|
|
|
- let count = 0
|
|
|
- for(let i in value.data){
|
|
|
- count += value.data[i].quantity
|
|
|
- }
|
|
|
- if(count > 0){
|
|
|
- messageCount.value = true
|
|
|
- }else{
|
|
|
- messageCount.value = false
|
|
|
- }
|
|
|
- }
|
|
|
+const getMessageNotice = async () => {
|
|
|
+ let value = await readCount()
|
|
|
+ if (value?.data?.length > 0) {
|
|
|
+ let count = 0
|
|
|
+ for (let i in value.data) {
|
|
|
+ count += value.data[i].quantity
|
|
|
+ }
|
|
|
+ if (count > 0) {
|
|
|
+ messageCount.value = true
|
|
|
+ } else {
|
|
|
+ messageCount.value = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+const handlePublishState = () => {
|
|
|
+ publishState.value = false
|
|
|
+ uni.$emit('clickTabbar', publishState.value)
|
|
|
}
|
|
|
-onShow(async ()=>{
|
|
|
- await getMessageNotice()
|
|
|
+onShow(async () => {
|
|
|
+ await getMessageNotice()
|
|
|
})
|
|
|
const toPublishMoment = () => {
|
|
|
router.push('/pages-sub/publish/moment/index?circleType=1')
|
|
|
publishState.value = false
|
|
|
+ uni.$emit('clickTabbar', publishState.value)
|
|
|
}
|
|
|
const toPublishCase = () => {
|
|
|
router.push('/pages-sub/publish/moment/index?circleType=2')
|
|
|
publishState.value = false
|
|
|
+ uni.$emit('clickTabbar', publishState.value)
|
|
|
}
|
|
|
</script>
|
|
|
|
|
@@ -135,7 +140,7 @@ const toPublishCase = () => {
|
|
|
custom-class="mt-15"
|
|
|
type="icon"
|
|
|
icon="close"
|
|
|
- @click="publishState = false"
|
|
|
+ @click="handlePublishState"
|
|
|
></wd-button>
|
|
|
</div>
|
|
|
</div>
|