Browse Source

完善首页样式设置和图标

littleblue55 1 week ago
parent
commit
41061f5ea0

+ 32 - 16
pages/index/index.vue

@@ -1,6 +1,6 @@
 <template>
-	<view class="container">
-		<u-navbar :is-back="false" title="" :background="{ background: '#f7f7f7' }" :border-bottom="false">
+	<view class="container" :style="{backgroundColor: `${backgroundColor}`}">
+		<u-navbar :is-back="false" title="" :style="{backgroundColor: `${backgroundColor}`}" :border-bottom="false">
 			<view class="slot-wrap">
 				<image src="https://sylwt.top/api/visitor/resources/image?name=/ydl/menber-center/login-icon.png"
 					mode="aspectFit" style="width: 300rpx;"></image>
@@ -16,11 +16,12 @@
 			</swiper>
 			<u-grid :col="4" :border="false" style="margin: 10rpx 0 ;">
 				<template v-for="(item,index) in navList" :key="index">
-					<u-grid-item bg-color="none" @click="jumpToPage(item)">
-						<image
+					<u-grid-item bg-color="none" @click="jumpToPage(item)" class="menu-item">
+						<!-- <image
 							:src="`https://sylwt.top/api/visitor/resources/image?name=/ydl/menber-center/index-icon/${item.image}.png`"
 							style="height: 70rpx;width: 70rpx;">
-						</image>
+						</image> -->
+						<i :class="['iconfont', `${item.icon}`]" :style="{ color: `${tabbarActiveColor}` }"></i>
 						<view class="grid-text">{{item.title}}</view>
 					</u-grid-item>
 				</template>
@@ -108,7 +109,10 @@
 			</view>
 		</u-modal>
 		<!-- 与包裹页面所有内容的元素u-page同级,且在它的下方 -->
-		<u-tabbar v-model="tabbarCurrentIndex" :list="tabbarList" icon-size="50" :active-color="tabbarActiveColor" :inactive-color="tabbarInactiveColor"></u-tabbar>
+		<u-tabbar v-model="tabbarCurrentIndex" 
+		:list="tabbarList" icon-size="50" 
+		:active-color="tabbarActiveColor" 
+		:inactive-color="tabbarInactiveColor"></u-tabbar>
 	</view>
 </template>
 
@@ -150,6 +154,10 @@
 	const tabbarActiveColor = computed(() => {
 		return tabbarStore.activeColor
 	})
+	
+	const backgroundColor = computed(() => {
+		return tabbarStore.backgroundColor
+	})
 	// 底部导航栏未选中颜色
 	const tabbarInactiveColor = computed(() => {
 		return tabbarStore.inactiveColor
@@ -207,7 +215,7 @@
 	const navList = ref([{
 			id: 'notice',
 			title: '通知公告',
-			image: 'notice',
+			icon: 'icon-xiaoxitongzhi',
 			url: '/pages/notice/notice/notice',
 			toOtherApp: false,
 			otherAppId: '其他小程序的appid'
@@ -215,7 +223,7 @@
 		{
 			id: 'dynamic',
 			title: '协会动态',
-			image: 'dynamic',
+			icon: 'icon-xinxisousuo-01',
 			url: '/pages/dynamic/dynamic/dynamic',
 			toOtherApp: false,
 			otherAppId: '其他小程序的appid'
@@ -223,7 +231,7 @@
 		{
 			id: 'guide',
 			title: '办事指引',
-			image: 'guide',
+			icon: 'icon-caidanguanli',
 			url: '/pages/guide/guide/guide',
 			toOtherApp: false,
 			otherAppId: '其他小程序的appid'
@@ -231,7 +239,7 @@
 		{
 			id: 'edu',
 			title: '继续教育',
-			image: 'edu',
+			icon: 'icon-xueshimao1',
 			url: '/pages/goOnEdu/index',
 			toOtherApp: false,
 			otherAppId: '其他小程序的appid'
@@ -239,7 +247,7 @@
 		{
 			id: 'level',
 			title: '水平认证',
-			image: 'level',
+			icon: 'icon-zhengshu-copy',
 			url: '跳转页面的路径',
 			toOtherApp: true,
 			otherAppId: '其他小程序的appid'
@@ -247,7 +255,7 @@
 		{
 			id: 'report',
 			title: '研究报告',
-			image: 'report',
+			icon: 'icon-circular',
 			url: '/pages/researchReport/reportHome/reportHome',
 			toOtherApp: false,
 			otherAppId: '其他小程序的appid'
@@ -255,7 +263,7 @@
 		{
 			id: 'index',
 			title: '经理人指数',
-			image: 'index',
+			icon: 'icon-zhishu',
 			url: '跳转页面的路径',
 			toOtherApp: true,
 			otherAppId: '其他小程序的appid'
@@ -263,7 +271,7 @@
 		{
 			id: 'pay',
 			title: '会费缴交',
-			image: 'pay',
+			icon: 'icon-jinqian-jiage',
 			url: '跳转页面的路径',
 			toOtherApp: true,
 			otherAppId: '其他小程序的appid'
@@ -388,6 +396,9 @@
 	})
 	onLoad(() => {
 		init()
+		// uni.setBackgroundColor({
+		//     backgroundColor: '#ffff7f',
+		// });
 		// initUser()
 	})
 	onShow(() => {
@@ -403,20 +414,25 @@
 				isMember.value = authStore.userInfo.isMember==='0'?false:true;
 			}
 		}
+		
 	})
 </script>
 
 <style lang="scss" scoped>	
 	.container {
 		width: 100vw;
-		background-color: $uni-bg-color;
+		// background-color: $uni-bg-color;
 		padding: 0 20rpx 5rpx;
 	}
 
 	.slot-wrap {
 		padding-left: 20rpx;
 	}
-
+	.menu-item{
+		.iconfont{
+			font-size: 60rpx;
+		}
+	}
 	.grid-text {
 		font-size: 28rpx;
 		margin-top: 4rpx;

File diff suppressed because it is too large
+ 0 - 2
static/fonts/iconfont.css


File diff suppressed because it is too large
+ 0 - 0
static/fonts/iconfont.js


+ 63 - 0
static/fonts/iconfont.json

@@ -6,6 +6,69 @@
   "description": "",
   "glyphs": [
     {
+      "icon_id": "31086242",
+      "name": "信息搜索-01",
+      "font_class": "xinxisousuo-01",
+      "unicode": "e6c8",
+      "unicode_decimal": 59080
+    },
+    {
+      "icon_id": "970759",
+      "name": "证书",
+      "font_class": "zhengshu-copy",
+      "unicode": "e641",
+      "unicode_decimal": 58945
+    },
+    {
+      "icon_id": "1411035",
+      "name": "6指数",
+      "font_class": "zhishu",
+      "unicode": "e620",
+      "unicode_decimal": 58912
+    },
+    {
+      "icon_id": "8213827",
+      "name": "文档搜索",
+      "font_class": "wendangsousuo",
+      "unicode": "e601",
+      "unicode_decimal": 58881
+    },
+    {
+      "icon_id": "8286865",
+      "name": "菜单管理",
+      "font_class": "caidanguanli",
+      "unicode": "e686",
+      "unicode_decimal": 59014
+    },
+    {
+      "icon_id": "9014953",
+      "name": "学士帽",
+      "font_class": "xueshimao1",
+      "unicode": "e602",
+      "unicode_decimal": 58882
+    },
+    {
+      "icon_id": "11891761",
+      "name": "circular",
+      "font_class": "circular",
+      "unicode": "e667",
+      "unicode_decimal": 58983
+    },
+    {
+      "icon_id": "22779612",
+      "name": "金钱-价格",
+      "font_class": "jinqian-jiage",
+      "unicode": "e65f",
+      "unicode_decimal": 58975
+    },
+    {
+      "icon_id": "39859392",
+      "name": "通知公告",
+      "font_class": "xiaoxitongzhi",
+      "unicode": "e608",
+      "unicode_decimal": 58888
+    },
+    {
       "icon_id": "1115073",
       "name": "收藏",
       "font_class": "shoucang1",

BIN
static/fonts/iconfont.ttf


BIN
static/fonts/iconfont.woff


BIN
static/fonts/iconfont.woff2


+ 2 - 1
store/tabbarStore.js

@@ -32,7 +32,8 @@ export const useTabbarStore = defineStore('tabbar', {
 			},
 		],
 		activeColor: "#0069f6",
-		inactiveColor: '#606266'
+		inactiveColor: '#606266',
+		backgroundColor: '#f7f7f7'
 	}),
 	actions: {
 		setMessageCount(count) {

Some files were not shown because too many files changed in this diff