瀏覽代碼

首页新增推荐课程
底部导航增加课程按钮

tanxue 1 月之前
父節點
當前提交
6666987b3b

+ 12 - 0
api/shouye.js

@@ -12,6 +12,18 @@ export function getAppIndexInfo(data = {}) {
   })
 }
 
+export function getIndexKechengList(data = {}) {
+  return request({
+    'url': '/app/index/kecheng/list',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
+}
+
 export function getAppNoticeList(data = {}) {
   return request({
     'url': '/app/notice/list',

+ 34 - 18
common/styles/global/pages.scss

@@ -125,8 +125,10 @@
 	}
 }
 .admin-shouye-page{
-	width: 100%;height: 100vh;background-color: #f8f9fd;
-	box-sizing: border-box;padding-bottom: 120rpx;overflow: auto;
+	width: 100%;background-color: #f8f9fd;box-sizing: border-box;padding-bottom: 120rpx;overflow: auto;
+	/*  #ifdef  APP-PLUS  */
+	height: 100vh;
+	/*  #endif  */
 	.shouye-head-box{
 		width: 100%;height: 376rpx;text-align: center;font-size: 34rpx;color: #fff;
 		box-sizing: border-box;font-weight: 600;
@@ -139,34 +141,48 @@
 		height: 376rpx;padding-top: 100rpx;
 		/*  #endif  */
 	}
+	
+	// banner
+	.index-banner-default{width: 718rpx;height: 281rpx;margin: 0 auto;@include ezy-no-repeat-cover;
+	background-image: url("@/static/images/index/index-banner.png");margin-top: -180rpx;}
+	.shouye-swiper-box{
+		margin-top: -180rpx;overflow: unset!important;
+		.index-banner-img{width: 718rpx;height: 281rpx;margin: 0 auto;display: block;}
+	}
+	
+	.tj-btn-box{
+		width: 100%;box-sizing: border-box;padding:0 20rpx;margin-top: 50rpx;
+		text{font-size: 26rpx;padding:4rpx;margin-right: 24rpx;display: inline-block;color:#333;}
+		.active{border-bottom: 2rpx solid #3fd2a1;color:#3fd2a1;}
+	}
+	
+	.index-tj-row{width: 100%;display: flex;box-sizing: border-box;padding:6rpx 16rpx;}
 	.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;display: inline-block;
-			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;}
+		width: 400rpx;height: 150rpx;@include ezy-no-repeat-cover(right);background-image: url("@/static/images/index/tj-bj.png");
+		border-radius: 25rpx;padding: 16rpx 30rpx;box-sizing:border-box;flex-shrink: 0;
+		.tj-num-box{font-size: 48rpx;color:#fff;margin: 12rpx 0 6rpx;font-weight: bold;}
+		.tj-tip-box{font-size: 24rpx;color:#fff;}
 	}
 	.index-tongzhi-box{
-		display: flex;justify-content: space-between;align-items: center;margin: 16rpx;
-		background-color: #fff;border-radius: 8rpx;padding:10rpx 24rpx;box-sizing:border-box;
+		display: flex;justify-content: space-between;align-items: center;margin:8rpx  0 8rpx 10rpx;
+		background-color: #fff;border-radius: 12rpx;padding:10rpx 24rpx;box-sizing:border-box;
+		box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);flex: 1;
 		.tongzhi-num{
-			width: 80rpx;height: 80rpx;color: #3fd2a1;@include ezy-no-repeat-cover;text-align: center;flex-shrink: 0;
+			width: 80rpx;height: 80rpx;color: #3fd2a1;@include ezy-no-repeat-contain;text-align: center;flex-shrink: 0;
 			background-image: url("@/static/images/index/tz-icon.png");padding-top: 42rpx;box-sizing:border-box;
-			font-size: 28rpx;
+			font-size: 28rpx;font-weight: bold;
 			}
 		.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;
-			display: flex;align-items: center;word-wrap: break-word;flex-wrap: wrap;word-break: break-all;
+			height: 84rpx;padding:0 10rpx 0 20rpx;box-sizing: border-box;line-height: 1.5;flex: 1;
+			@include ezy-rich-text();@include multi-line-ellipsis(2);font-size: 26rpx;color:#333;
+			display: flex;align-items: center;margin: 16rpx 0;
+			>div,p{@include multi-line-ellipsis(2);}
 		}
 		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-title{width: 100%;font-size: 28rpx;color: #33a366;font-weight: 600;margin-bottom: 24rpx;}
 	.card-list-box{
 		display: flex;flex-wrap: wrap;box-sizing: border-box;padding:16rpx;margin: 16rpx;
 		background-color: #fff;border-radius: 8rpx;margin-bottom: 16rpx;}

+ 6 - 0
components/custom-tabbar/custom-tabbar-admin.vue

@@ -34,6 +34,12 @@
 						activePath: getStaticUrl('static/images/tabbar/select/jz-icon.png'),
 					},
 					{
+						text: '课程',
+						path: '/pages/admin/Kecheng/list',
+						iconPath: getStaticUrl('static/images/tabbar/unselect/kc-icon.png'),
+						activePath: getStaticUrl('static/images/tabbar/select/kc-icon.png'),
+					},
+					{
 						text: '我的',
 						path: `/pages/admin/my/index`,
 						iconPath: getStaticUrl('static/images/tabbar/unselect/my-icon.png'),

+ 12 - 3
pages/admin/Kecheng/study.vue

@@ -65,17 +65,26 @@
 				zyName: '',
 				zyLevelName: '',
 				operId: '', // 课程
+				pageFrom:'',
 			}
 		},
 		onLoad(options) {
 			this.kcId = options.kcId;
+			this.pageFrom = options.from;
 			this.init();
 		},
 		methods: {
 			goUpPage() {
-				uni.redirectTo({
-					url: '/pages/admin/Kecheng/list'
-				})
+				if(this.pageFrom==='shouye'){
+					uni.redirectTo({
+						url: '/pages/admin/ShouYe/shouye'
+					})
+				}else{
+					uni.redirectTo({
+						url: '/pages/admin/Kecheng/list'
+					})
+				}
+				
 			},
 			onClickItem(e) {
 				if (this.current !== e.currentIndex) {

+ 51 - 14
pages/admin/ShouYe/shouye.vue

@@ -1,19 +1,30 @@
 <template>
   <view class="admin-shouye-page">
 	  <view class="shouye-head-box">{{indexInfoData.jzName}}</view>
-	  <view class="index-tj-box">
-		  <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 == 0}" @click="tjBtnClick(0)">全部</text>
-		  </view>
-		  <view class="tj-num-box">{{indexInfoData.bzCount}}/{{indexInfoData.jzCount}}</view>
-		  <view class="tj-tip-box">考证人员/家政人员</view>
+	  <view class="index-banner-default" v-if="!swiperInfo.length>0"></view>
+	  <uni-swiper-dot v-else class="shouye-swiper-box" :info="swiperInfo" :current="current" field="content" mode="dot" :dots-styles="dotStyle">
+	  	<swiper class="swiper-box" @change="change" >
+			<!-- autoplay circular interval="3000" -->
+	  		<swiper-item v-for="(item ,index) in swiperInfo" :key="index">
+				<img class="index-banner-img" :src="item.pic" @click="gotoKc(item)"/>
+	  		</swiper-item>
+	  	</swiper>
+	  </uni-swiper-dot>
+	  <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 == 0}" @click="tjBtnClick(0)">全部</text>
 	  </view>
-	  <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 class="index-tj-row">
+		 <view class="index-tj-box">
+		 		  <view class="tj-num-box">{{indexInfoData.bzCount}}/{{indexInfoData.jzCount}}</view>
+		 		  <view class="tj-tip-box">考证人员/家政人员</view>
+		 </view>
+		 <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>
 	  <view class="card-list-box">
 		 <view class="card-list-title">管理家政人员</view>
@@ -54,29 +65,55 @@
 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,getGlIndexInfo} from '@/api/shouye.js'
+import {getAppNoticeList,getAppNoticeWait,getGlIndexInfo,getIndexKechengList} from '@/api/shouye.js'
 
 const tjBtn = ref(1);
 const tzNum = ref(0);
 const tzContent = ref('');
 const searchType = ref('');
+const current = ref(0);
 let indexInfoData = reactive({
 		searchType:1,
 		bzCount: 0,
 		jzCount: 0,
 		jzName: '',
 	});
+const swiperInfo = ref([]);
+const dotStyle = reactive({
+	width:'8',
+	height:'8',
+	bottom:'-12',
+	backgroundColor: 'rgba(226,230,236)',
+	border: '1px rgb(226,230,236) solid',
+	selectedBackgroundColor: 'rgb(92, 192, 147)',
+	selectedBorder: '1px rgb(92, 192, 147) solid'
+});
+
+function change(e) {
+				current.value = e.detail.current
+			}
+			
+function gotoKc(item){
+	uni.navigateTo({
+		url: `/pages/admin/Kecheng/study?kcId=${item.kcId}&from=shouye`
+	})
+}
 
 onLoad((options) => {
 		initPage();
 })
 
 function initPage() {
+	getKcTg();
 	getTzNum();
 	getTzlist();
 	getIndexInfo();
 }	
-
+function getKcTg(){
+	getIndexKechengList({}).then(res => {
+		swiperInfo.value = res.data.data;
+	})
+}
 function getTzNum(){
 	getAppNoticeWait({}).then(res => {
 		tzNum.value = res.data;

+ 1 - 1
pages/admin/my/index.vue

@@ -36,7 +36,7 @@
 			</view>
 		</view>
 		<!-- 底部区域 -->
-		<customTabbarClient :currentTab="2"></customTabbarClient>
+		<customTabbarClient :currentTab="3"></customTabbarClient>
 		<common-dialog ref="commonDialogRef" :title="exitTitle" :content="exitContent" @confirm-btn="exitBtn"></common-dialog>
 		<shexiangDialogVue ref="shexiangRef" title="摄像头说明"></shexiangDialogVue>
 		<password-dialog ref="passwordDialogRef" @confirm-btn="passwordBtn"></password-dialog>