浏览代码

首页开发

tanxue 2 月之前
父节点
当前提交
1d9c521fbb
共有 4 个文件被更改,包括 109 次插入33 次删除
  1. 12 0
      api/shouye.js
  2. 40 16
      common/styles/global/pages.scss
  3. 57 16
      pages/admin/ShouYe/shouye.vue
  4. 0 1
      pages/admin/tongzhi/details.vue

+ 12 - 0
api/shouye.js

@@ -34,4 +34,16 @@ export function getAppNoticeInfo(data = {}) {
     data,
     timeout: 20000
   })
+}
+
+export function getAppNoticeWait(data = {}) {
+  return request({
+    'url': '/app/notice/wait',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
 }

+ 40 - 16
common/styles/global/pages.scss

@@ -124,29 +124,53 @@
 	}
 }
 .admin-shouye-page{
-	width: 100%;height: 100vh;box-sizing: border-box;padding:0 16rpx;background-color: #f8f9fd;
-	.index-tj-box{background-color: #fff;border-radius: 8rpx;margin-bottom: 16rpx;}
+	width: 100%;height: 100vh;background-color: #f8f9fd;
+	.shouye-head-box{
+		width: 100%;height: 376rpx;text-align: center;font-size: 34rpx;color: #fff;
+		box-sizing: border-box;padding-top: 100rpx;font-weight: 600;
+		background-image: url("@/static/images/index/index-head-bj.png");@include ezy-no-repeat-cover(bottom);
+	}
+	.index-tj-box{
+		background-color: #fff;border-radius: 12rpx;margin: 16rpx;padding: 24rpx;box-sizing:border-box;margin-top: -180rpx;
+		.tj-btn-box{
+			text{font-size: 24rpx;padding:6rpx 16rpx;margin-right: 16rpx;
+			border: 1rpx solid #3fd2a1;color:#3fd2a1;border-radius: 6rpx;}
+			.active{background-color:#3fd2a1;color:#fff;}
+		}
+		.tj-num-box{font-size: 48rpx;color:#3fd2a1;margin: 24rpx 0 12rpx;}
+		.tj-tip-box{font-size: 24rpx;color:#8f8f8f;}
+	}
 	.index-tongzhi-box{
-		display: flex;justify-content: space-between;align-items: center;
-		background-color: #fff;border-radius: 8rpx;margin-bottom: 16rpx;
-		.tongzhi-num{width: 100rpx;height: 100rpx;color: #3fd2a1;border: 1rpx solid #3fd2a1;}
-		icon{width: 30rpx;height: 30rpx;@include ezy-no-repeat-cover;
+		display: flex;justify-content: space-between;align-items: center;margin: 16rpx;
+		background-color: #fff;border-radius: 8rpx;padding:10rpx 24rpx;box-sizing:border-box;
+		.tongzhi-num{
+			width: 80rpx;height: 80rpx;color: #3fd2a1;@include ezy-no-repeat-cover;text-align: center;flex-shrink: 0;
+			background-image: url("@/static/images/index/tz-icon.png");padding-top: 36rpx;box-sizing:border-box;
+			}
+		.tongzhi-content{
+			height: 84rpx;padding:0 10rpx 0 20rpx;box-sizing: border-box;@include multi-line-ellipsis(2);line-height: 1.5;
+			@include ezy-rich-text();font-size: 28rpx;color:#333;flex: 1;overflow: hidden;margin: 16rpx 0;
+		}
+		icon{width: 30rpx;height: 30rpx;@include ezy-no-repeat-cover;flex-shrink: 0;
 			background-image: url("@/static/images/common/nav-bar-jt-bottom.svg");
 			transform: rotate(270deg);margin-left: 4rpx;}
 	}
 	.card-list-title{width: 100%;font-size: 28rpx;color: #000;font-weight: 600;margin-bottom: 24rpx;}
 	.card-list-box{
-		display: flex;flex-wrap: wrap;box-sizing: border-box;padding:16rpx;
+		display: flex;flex-wrap: wrap;box-sizing: border-box;padding:16rpx;margin: 16rpx;
 		background-color: #fff;border-radius: 8rpx;margin-bottom: 16rpx;}
 	.card-item-box{
 		width: 25%;display: flex;flex-direction: column;align-items: center;
 		font-size: 24rpx;color: #333;
-		icon{width: 100rpx;height: 100rpx;background-color: #3fd2a1;}
-	}
-	.card-item-box:nth-child(5) ~ *{margin-top: 24rpx;}
-	.index-tongzhi-box{
-		
-	}
+		.index-icon{width: 100rpx;height: 100rpx;@include ezy-no-repeat-cover;margin-bottom: 6rpx;}
+	}
+	.card-item-box:nth-child(5) ~ *{margin-top: 30rpx;}
+	.jz-icon{background-image: url("@/static/images/index/jz-icon.png");}
+	.kz-icon{background-image: url("@/static/images/index/kz-icon.png");}
+	.ks-icon{background-image: url("@/static/images/index/ks-icon.png");}
+	.cj-icon{background-image: url("@/static/images/index/cj-icon.png");}
+	.lx-icon{background-image: url("@/static/images/index/lx-icon.png");}
+	.kc-icon{background-image: url("@/static/images/index/kc-icon.png");}
 }
 /*** 考试页面***/
 .phone-list-page{
@@ -430,7 +454,7 @@
 	.jzgs-name-box{
 		width: 100%;height: 376rpx;text-align: center;font-size: 34rpx;color: #fff;
 		box-sizing: border-box;padding-top: 100rpx;font-weight: 600;
-		background-image: url("@/static/images/my/admin-my-bj.png");@include ezy-no-repeat-cover(top);
+		background-image: url("@/static/images/my/admin-my-bj.png");@include ezy-no-repeat-cover(bottom);
 	}
 	
 	// num
@@ -588,8 +612,8 @@
 			transform: rotate(270deg);margin-left:4rpx;}
 	}
 	.card-content{
-		width: 100%;height: 98rpx;padding:16rpx 20rpx;box-sizing: border-box;@include multi-line-ellipsis(2);line-height: 1.4;
-		@include ezy-rich-text();font-size: 28rpx;color:#8e8e8e;
+		width: 100%;height: 84rpx;padding:0 20rpx;box-sizing: border-box;@include multi-line-ellipsis(2);line-height: 1.5;
+		@include ezy-rich-text();font-size: 28rpx;color:#666;margin: 16rpx 0;
 	}
 }
 

+ 57 - 16
pages/admin/ShouYe/shouye.vue

@@ -1,47 +1,47 @@
 <template>
   <view class="admin-shouye-page">
-	  <view>家政公司名称</view>
+	  <view class="shouye-head-box">家政公司名称</view>
 	  <view class="index-tj-box">
-		  <view>
-			  <text>本周</text>
-			  <text>本月</text>
-			  <text>本年</text>
+		  <view class="tj-btn-box">
+			  <text :class="{active: tjBtn == 1}" @click="tjBtnClick(1)">本周</text>
+			  <text :class="{active: tjBtn == 2}" @click="tjBtnClick(2)">本月</text>
+			  <text :class="{active: tjBtn == 3}" @click="tjBtnClick(3)">全部</text>
 		  </view>
-		  <view>0/0</view>
-		  <view>考证人员/家政人员</view>
+		  <view class="tj-num-box">0/0</view>
+		  <view class="tj-tip-box">考证人员/家政人员</view>
 	  </view>
-	  <view class="index-tongzhi-box">
-		  <text class="tongzhi-num">6</text>
-		  <text></text>
+	  <view class="index-tongzhi-box" @click="goToPage('tz')">
+		  <text class="tongzhi-num">{{tzNum}}</text>
+		  <rich-text :nodes="tzContent" class="tongzhi-content"></rich-text>
 		  <icon></icon>
 	  </view>
 	  <view class="card-list-box">
 		 <view class="card-list-title">管理家政人员</view>
 		 <view @click="goToPage('jz')" class="card-item-box">
-		 	<icon></icon>
+		 	<icon class="index-icon jz-icon"></icon>
 		 	<text>家政人员</text>
 		 </view> 
 	  </view>
 	  <view class="card-list-box">  
 		<view class="card-list-title">管理考证人员</view>
 		<view @click="goToPage('kz')" class="card-item-box">
-			<icon></icon>
+			<icon class="index-icon kz-icon"></icon>
 			<text>考证管理</text>
 		</view>
 		<view @click="goToPage('ks')" class="card-item-box">
-			<icon></icon>
+			<icon class="index-icon ks-icon"></icon>
 			<text>考试管理</text>
 		</view>
 		<view @click="goToPage('cj')" class="card-item-box">
-			<icon></icon>
+			<icon class="index-icon cj-icon"></icon>
 			<text>成绩管理</text>
 		</view>
 		<view @click="goToPage('lc')" class="card-item-box">
-			<icon></icon>
+			<icon class="index-icon lx-icon"></icon>
 			<text>练习管理</text>
 		</view>
 		<view @click="goToPage('kc')" class="card-item-box">
-			<icon></icon>
+			<icon class="index-icon kc-icon"></icon>
 			<text>课程管理</text>
 		</view>
 	</view>	
@@ -51,7 +51,43 @@
 </template>
 
 <script setup>
+import {onLoad,onShow} from '@dcloudio/uni-app';
+import {reactive,ref} from "vue";
 import customTabbarAdminVue from "@/components/custom-tabbar/custom-tabbar-admin.vue";
+import {getAppNoticeList,getAppNoticeWait} from '@/api/shouye.js'
+
+const tjBtn = ref(1);
+const tzNum = ref(0);
+const tzContent = ref('');
+
+onLoad((options) => {
+		initPage();
+})
+
+function initPage() {
+	getTzNum();
+	getTzlist();
+}	
+
+function getTzNum(){
+	getAppNoticeWait({}).then(res => {
+		tzNum.value = res.data;
+	})
+}
+function getTzlist(){
+	const opt = {
+		page: 1,
+		size: 10, // 固定查询10条
+	}
+	getAppNoticeList(opt).then(res => {
+		tzContent.value = res.data.data[0].content;
+	})
+}
+
+// 按钮切换
+function tjBtnClick(data){
+	tjBtn.value = data;
+}
 // 获取用户头像
 	function goToPage(data){
 		switch (data) {
@@ -80,6 +116,11 @@ import customTabbarAdminVue from "@/components/custom-tabbar/custom-tabbar-admin
 			    	url:'/pages/admin/Kecheng/list'
 			    })
 			    break;
+			case 'tz':
+			    uni.redirectTo({
+			    	url:'/pages/admin/tongzhi/list'
+			    })
+			    break;
 		}
 	}
 </script>

+ 0 - 1
pages/admin/tongzhi/details.vue

@@ -22,7 +22,6 @@
 		content: '',
 	})
 	onLoad((options) => {
-		console.log(options,'options');
 		initPage(options);
 	})
 	function goUpPage(){