You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
103 lines
2.5 KiB
103 lines
2.5 KiB
<template>
|
|
<view :style="{paddingBottom: paddingB+'px'}">
|
|
<view class="cu-list menu" :class="['sm-border','card-menu margin-top']" v-if="compass().mode == 1">
|
|
<block v-for="(item,index) in sortedList" :key="item.order">
|
|
<view class="cu-item" :class="'arrow'" @tap="openApp(item)">
|
|
<view class="content">
|
|
<image :src="item.icon" class="png" mode="aspectFit"></image>
|
|
<text class="text-grey">{{item.name}}</text>
|
|
</view>
|
|
<view class="content_num" v-if="item.name=='朋友圈'&&count>0">{{count>99?'99+':count}}</view>
|
|
</view>
|
|
</block>
|
|
</view>
|
|
<view class="cu-list grid" :class="['col-3',' margin-top']" v-if="compass().mode == 2">
|
|
<block v-for="(item,index) in sortedList" :key="item.order">
|
|
<view class="cu-item" @tap="openApp(item)">
|
|
<view>
|
|
<image :src="item.icon" style="height:100rpx;width: 100rpx;"></image>
|
|
<view class="cu-tag badge" v-if="item.badge!=0">
|
|
<block v-if="item.badge!=1">{{item.badge>99?'99+':item.badge}}</block>
|
|
</view>
|
|
</view>
|
|
<text>{{item.name}}</text>
|
|
</view>
|
|
</block>
|
|
</view>
|
|
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import { useloginStore } from '@/store/login'
|
|
import pinia from '@/store/index'
|
|
import { storeToRefs } from 'pinia';
|
|
import { useMsgStore } from '@/store/message';
|
|
const loginStore = useloginStore(pinia)
|
|
|
|
const msgStore = useMsgStore(pinia)
|
|
const {NoticeCount} = storeToRefs(msgStore);
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
isCard: true,
|
|
userInfo:loginStore.userInfo,
|
|
paddingB:0,
|
|
count:NoticeCount
|
|
};
|
|
},
|
|
computed:{
|
|
sortedList() {
|
|
return this.compass()?.list
|
|
.filter(item => item.status == 1)
|
|
.sort((a, b) => a.order - b.order)
|
|
}
|
|
},
|
|
created:function(){
|
|
// #ifdef H5
|
|
this.paddingB=this.inlineTools;
|
|
// #endif
|
|
|
|
// #ifndef H5
|
|
this.paddingB=this.navBarHeight+this.inlineTools;
|
|
// #endif
|
|
},
|
|
methods: {
|
|
compass(){
|
|
return loginStore.globalConfig.compass
|
|
},
|
|
openApp(item) {
|
|
let url=item.url;
|
|
if(item.type==2){
|
|
url='/pages/mine/webview?title='+item.name+'&src='+encodeURIComponent(item.url)
|
|
}
|
|
uni.navigateTo({
|
|
url:url
|
|
})
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.im-friend-header{
|
|
width:100%;height:400rpx;position: relative;
|
|
.im-friend-bg{
|
|
width:100%;height:300rpx;overflow: hidden;
|
|
.im-friend-image{
|
|
width:100%;height:300rpx;
|
|
}
|
|
}
|
|
}
|
|
.im-user{
|
|
position: absolute;right:60rpx;top:210rpx;overflow: hidden;
|
|
}
|
|
.content_num{
|
|
color: #fff;
|
|
padding: 1px 5px;
|
|
border-radius: 50px;
|
|
text-align: center;
|
|
background-color: red;
|
|
}
|
|
</style>
|