Преглед изворни кода

Merge branch 'master' of http://47.98.226.240:3000/twt/college

* 'master' of http://47.98.226.240:3000/twt/college:
  首页 列表页
guo пре 3 година
родитељ
комит
13d00d8fd2

+ 147 - 0
components/pcNav/pcNav.vue

@@ -0,0 +1,147 @@
+<template>
+	<view>
+		<view class="nav">
+			<view class="navCont">
+				<view class="logo">
+					<image src="../../static/pcimg/nav_logo@2x.png" mode="" class="logoImg"></image>
+				</view>
+				<view class="navTitle">门店学院</view>
+				<view class="indexNav">首页</view>
+				<view class="allCategory">
+					<view class="allCategoryLine" v-for="(item,index) in allCategory" v-if="index<4">{{item.name}}</view>
+				    <view class="allCategoryMore" v-if="allCategory.length>1">
+					 <span @click="moreBtn">更多</span> 
+					 <image @click="moreBtn" src="../../static/pcimg/icon_arrow_xia@2x.png" mode="widthFix" class="navmoreImg"></image>
+					 <view class="navMoret" v-show="navMoret">
+					 	<view class="navMoreTline" v-for="(item,index) in allCategory" v-if="index>3">{{item.name}}</view>
+					 </view>
+					
+					</view>
+					
+				</view>
+				<view class="navSs">
+					<image src="../../static/pcimg/icon_search@2x.png" mode="widthFix" class="navSsimg"></image>
+				</view>
+			</view>
+		</view>
+
+	</view>
+</template>
+
+<script>
+	export default {
+		name: "searchBox",
+		props: {
+			
+		},
+		data() {
+			return {
+				allCategory:[],
+				navMoret:false,
+			};
+		},
+		onLoad() {
+			 
+		},
+		created(){
+			this.getallCategory();
+		},
+		methods:{
+			getallCategory(){
+				this.$http('/trainingOpenApi/allCategory', {}, 'GET').then(res => {
+					this.allCategory = res.data
+				})
+			},
+			moreBtn(){
+				this.navMoret=!this.navMoret
+			},
+		}
+	}
+</script>
+
+<style scoped>
+	.nav{
+		width: 100%;
+		height: 72px;
+		background: #FFFFFF;
+		box-shadow: 0px 4px 10px 0px rgba(153, 153, 153, 0.12);
+		display: flex;
+		justify-content: center;
+		position: fixed;
+		left: 0;
+		top: 0;
+		z-index: 11;
+	}
+	.navCont{
+		width: 1200px;
+		display: flex;
+		position: relative;
+	}
+	.logoImg{
+		width: 86px;
+		height: 36px;
+		margin-top: 19px;
+	}
+	.navTitle{
+		line-height: 72px;
+		font-weight: 500;
+		color: #3C3C3C;
+		font-size: 24px;
+		padding-left: 24px;
+	}
+	.indexNav{
+		line-height: 72px;
+		font-weight: 500;
+		color: #FF4F00;
+		font-size: 20px;
+		padding-left: 54px;
+	}
+	.allCategory{
+		display: flex;
+		line-height: 72px;
+	}
+	.allCategoryLine{
+		padding-left: 44px;
+		color: #3C3C3C;
+		font-size: 20px;
+		cursor: pointer;
+	}
+	.allCategoryMore{
+		padding-left: 44px;
+		color: #3C3C3C;
+		font-size: 20px;
+		display: flex;
+		cursor: pointer;
+		position: relative;
+	}
+	.navMoret{
+		position: absolute;
+		width: 160px;
+		background: #FFFFFF;
+		box-shadow: 0px 4px 10px 0px rgba(153, 153, 153, 0.12);
+		border-radius: 6px;
+		top: 72px;
+		left:0 ;
+	}
+	.navMoreTline{
+		width: 160px;
+		text-align: center;
+		font-size: 20px;
+	}
+	.navmoreImg{
+		width: 12px;
+		height: 8px;
+		margin-top: 32px;
+		margin-left: 10px;
+	}
+	.navSsimg{
+		width: 24px;
+		height: 24px;
+	}
+	.navSs{
+		position: absolute;
+		cursor: pointer;
+		top:24px;
+		right: 0;
+	}
+</style>

+ 7 - 1
pages.json

@@ -59,7 +59,13 @@
                 
             }
             
-        }
+        },
+		{
+			"path": "pages/pc/list",
+			"style": {
+				"navigationStyle": "custom"
+			}
+		}
     ],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",

+ 329 - 16
pages/pc/index.vue

@@ -1,48 +1,361 @@
 <template>
 	<view class="content">
-		<view class="nav">
-			<view class="navCont">
-				<view class="logo">
-					<image src="../../static/pcimg/nav_logo@2x.png" mode="" class="logoImg"></image>
+		<pcNav></pcNav>
+		<view style="height: 72px;"></view>
+		<view class="swiperBox">
+			<view class="swiperCont">
+				<view class="tuijbox">
+					<image src="../../static/pcimg/icon_tuijian@2x.png" mode="" class="tuijImg"></image>
+					<span class="tuijTitle">推荐文章</span>
 				</view>
-				<view class="navTitle">门店学院</view>
+				 <swiper class="swiper"  :autoplay="false"   :circular="true" :current="swpIndex">
+					<swiper-item v-for="(item,index) in recommendList" v-if="(index+1)%2!=0">
+						<view class="swpCont">
+							<view class="swiper-item" >
+								<view class="swpimgBox swpBr">
+									<image :src="item.logoImg" mode="" class="swpimg"></image>
+								</view>
+								<view class="swpTitleBox">
+									<view class="swpTitle">{{item.title}}</view>
+									<view class="categoryName">{{item.categoryName}}</view>
+								</view>
+								
+							</view>
+							<view class="swiper-item" v-if="(index+1)<recommendList.length">
+								<view class="swpimgBox swpBr">
+								   <image :src="recommendList[index+1].logoImg" mode="" class="swpimg"></image>
+								</view>
+								<view class="swpTitleBox">
+									<view class="swpTitle">{{recommendList[index+1].title}}</view>
+									<view class="categoryName">{{recommendList[index+1].categoryName}}</view>
+								</view>
+							</view>
+						</view>
+						
+					</swiper-item>
+					
+				</swiper>
+				<image src="../../static/pcimg/icon_arrow_zuo_sel@2x.png" mode="" class="swpImgleft" @click="swpBtnLeft"></image>
+				<image src="../../static/pcimg/legtspx.png" mode="" class="swpImgright" @click="swpBtnRight"></image>
 			</view>
 		</view>
+		
+		<view class="main">
+			<view class="mainCont">
+				<view class="mainline" v-for="(item,index) in indexData.categoryList">
+					<view class="mainlineTop">
+						<view class="mainlineTopleft">
+							<view class="mainlineTitle">{{item.name}}</view>
+							<view class="mainlinecount">共{{item.count}}篇文章</view>
+						</view>
+						<view class="mainlineMore" @click="mainMore(item)">查看更多></view>
+					</view>
+					<view class="mainwzbox" >
+						<view class="mainwzline" v-for="(wz,wzindex) in item.children" v-if="wzindex<4" :class="{'mainwzlineR':wzindex!=3}">
+							<view class="mainwzImgBox">
+							  <img :src="wz.logoImg" alt="" class="mainwzImg">	
+							</view>
+							<view class="wztitle">{{wz.title}}</view>
+						</view>
+						
+					</view>
+					
+					
+				</view>
+				
+				
+			</view>
+			
+		</view>
+		
+		
+		<view class="gotop" @click="gotoTop">
+			<image src="../../static/pcimg/btn_top@2x.png" mode="" class="gotopImg"></image>
+		</view>
+		
+		
+		
+		<!-- <view>
+			<a class="table-btn" href="http://phone.66km.cn:8088/marketing/training/940C4BF0A2E04542A1A1AD244EAFB6E2.xlsx" target='_blank'>下载入口</a>
+		</view> -->
+		
+		
+		
 	</view>
 </template>
 
 <script>
+	import pcNav from '../../components/pcNav/pcNav.vue'
 	export default {
+		components: {
+			pcNav,
+		},
 		data() {
 			return {
-				title: 'Hello'
+				title: 'Hello',
+				allCategory:[],
+				navMoret:false,
+				swpIndex:0,
+				indexData:'',
+				recommendList:[],
 			}
 		},
 		onLoad() {
           
+		   this.getindexData()
 		},
 		methods: {
-
+			gotoTop(){
+				uni.pageScrollTo({ 
+				      scrollTop: 0, duration: 300 
+				    }); 
+			},
+			
+			swpBtnRight(){
+				var length=this.recommendList.length
+				var num=Math.ceil(length/2)
+				if(this.swpIndex<num){
+					this.swpIndex++
+				}
+				
+			},
+			swpBtnLeft(){
+				if(this.swpIndex==0){
+					
+				}else{
+					this.swpIndex--
+				}
+				
+			},
+           
+			getindexData(){
+				uni.showLoading({
+					title: '加载中'
+				})
+				this.$http('/trainingOpenApi/indexData', {}, 'GET').then(res => {
+					uni.hideLoading();
+					this.indexData = res.data;
+					this.recommendList=this.indexData.recommendList
+				})
+			},
+			mainMore(item){
+				console.log(item)
+				uni.navigateTo({
+					url:'list?code='+item.code+'&topName='+item.name+'&comment='+item.comment
+				})
+			}
 		}
 	}
 </script>
 
 <style scoped>
-	.nav{
+	
+	.swiperBox{
+		height: 356px;
+		background: #F3F8FF;
 		width: 100%;
-		height: 72px;
+	}
+	.swiperCont{
+		width: 1200px;
+		margin: 0 auto;
+		position: relative;
+	}
+	.tuijImg{
+		width: 24px;height: 24px;
+	}
+	.tuijbox{
+		display: flex;padding-top: 44px;padding-bottom: 30px;
+	}
+	.tuijTitle{
+		font-size: 24px;
+		font-family: PingFangSC-Medium, PingFang SC;
+		font-weight: 500;
+		color: #111111;
+		padding-left: 7px;
+		line-height: 24px;
+	}
+	.swpImgleft{
+		width: 44px;
+		height: 44px;
+		position: absolute;
+		top: 150px;
+		left: -50px;
+		cursor: pointer;
+	}
+	.swpImgright{
+		width: 44px;
+		height: 44px;
+		position: absolute;
+		top: 150px;
+		right: -50px;
+		cursor: pointer;
+	}
+	.swiper-item{
+		width: 576px;
+		height: 184px;
 		background: #FFFFFF;
-		box-shadow: 0px 4px 10px 0px rgba(153, 153, 153, 0.12);
+		box-shadow: 0px 0px 16px 0px rgba(153, 153, 153, 0.2);
+		border-radius: 9px;
+		margin-top: 14px;
+		position: relative;
+		cursor: pointer;
+	}
+	.swpCont{
 		display: flex;
-		justify-content: center;
+		height: 200px;
+		justify-content: space-between;
+	}
+	.swpimg{
+		width: 276px;
+		height: 184px;
+	}
+	.swpimgBox{
+		width: 276px;
+		height: 184px;
+		position: absolute;
+		left: 0;
+		top: -14px;
+		
+	}
+	.swpBr{
+		width: 276px;
+		height: 184px;
+		border-radius: 10px;
+		overflow: hidden;
+	}
+	.swiper{
+		height: 200px;
+	}
+	.swpTitleBox{
+		padding-left: 296px;
+		display: flex;
+		flex-direction: column;
+		justify-content: space-between;
+		height: 160px;
+		padding-top: 10px;
+		
+	}
+	
+	.swpTitle{
+		width: 260px;
+		height: 44px;
+		font-size: 16px;
+		font-weight: 500;
+		color: #3C3C3C;
+		line-height: 22px;
+		 text-overflow: -o-ellipsis-lastline;
+		  overflow: hidden;
+		  text-overflow: ellipsis;
+		  display: -webkit-box;
+		  -webkit-line-clamp: 2;
+		  line-clamp: 2;
+		  -webkit-box-orient: vertical;
 	}
-	.navCont{
+	.swpTitleBox:hover .swpTitle{
+		color: #FF4F00;
+	}
+	.categoryName{
+		line-height: 24px;
+		width: 84px;
+		height: 24px;
+		background: rgba(63, 144, 247, 0.1);
+		border-radius: 14px;
+		font-size: 12px;
+		color: #3F90F7;
+		text-align: center;
+		white-space: nowrap; 
+		overflow: hidden; 
+		text-overflow: ellipsis; 
+	}
+	.mainCont{
 		width: 1200px;
+		margin: 0 auto;
+	}
+	.mainline{
+		padding-top: 48px;
+	}
+	.mainlineTop{
+		display: flex;
+		justify-content: space-between;
+	}
+	.mainlineTopleft{
+		display: flex;
+	}
+	.mainlineTitle{
+		font-size: 24px;
+		font-weight: 500;
+		color: #111111;
+		line-height: 33px;
+	}
+	.mainlinecount{
+		font-size: 14px;
+		font-weight: 400;
+		color: #999999;
+        line-height: 33px;
+		padding-left: 16px;
+	}
+	.mainlineMore{
+		font-size: 14px;
+		color: #333333;
+	}
+	.mainwzbox{
 		display: flex;
+		padding-top: 30px;
+		
+	}
+	.mainwzImg{
+		width: 276px;
+		height: 184px;
+	}
+	.mainwzImgBox{
+		border-radius: 15px;
+	    overflow: hidden;
+	}
+	.mainwzline{
+		width: 276px;
+		height: 260px;
+		background: #FFFFFF;
+	}
+	.mainwzlineR{
+	  margin-right: 32px;	
+	}
+	.wztitle{
+		width: 250px;
+		font-size: 16px;
+		color: #333333;
+		line-height: 22px;
+		height: 44px;
+		text-overflow: -o-ellipsis-lastline;
+		 overflow: hidden;
+		 text-overflow: ellipsis;
+		 display: -webkit-box;
+		 -webkit-line-clamp: 2;
+		 line-clamp: 2;
+		 -webkit-box-orient: vertical;
+		 padding-top: 16px;
+		 padding:0 13px ;
+	}
+	.mainwzline:hover{
+		background: #FFFFFF;
+		box-shadow: 0px 0px 16px 0px rgba(153, 153, 153, 0.2);
+		border-radius: 6px;
+		cursor: pointer;
+	}
+	.mainwzline:hover .wztitle{
+		color: #FF4F00;
+	}
+	.mainlineMore:hover{
+		color: #FF4F00;
+		cursor: pointer;
+	}
+	.gotopImg{
+		width: 60px;
+		height: 60px;
 	}
-	.logoImg{
-		width: 86px;
-		height: 36px;
-		margin-top: 19px;
+	.gotop{
+		position: fixed;
+		right:15vh ;
+		bottom: 100px;
+		cursor: pointer;
 	}
 </style>

+ 246 - 0
pages/pc/list.vue

@@ -0,0 +1,246 @@
+<template>
+	<view class="content">
+		<pcNav></pcNav>
+		<view style="height: 72px;"></view>
+	
+		
+		<view class="gotop" @click="gotoTop">
+			<image src="../../static/pcimg/btn_top@2x.png" mode="" class="gotopImg"></image>
+		</view>
+		<view class="top">
+			<view class="topName">{{topName}}</view>
+			<view class="comment">{{comment}}</view>
+		</view>
+		<view class="main">
+			<view class="dynamicCol">
+				<view class="dynamicColLeft">
+					<view class="dynamicColLIne" :class="{'activeTab':tabIndex==index}" v-for="(item,index) in dynamicCol" @click="tabBtn(index)">{{item.name}}</view>
+				</view>
+				<view class="dynamicColRight">
+					<image src="../../static/pcimg/icon_kapian_def@2x.png" v-show="qhIndex==2" class="qhImg" @click="qhIndex=1"></image>
+					<image src="../../static/pcimg/icon_kapian_sel@2x.png" v-show="qhIndex==2" class="qhImg"></image>
+				    <image src="../../static/pcimg/icon_liebiao_sel@2x.png" v-show="qhIndex==1" class="qhImg" ></image>
+				    <image src="../../static/pcimg/qh2.png" v-show="qhIndex==1" class="qhImg" @click="qhIndex=2"></image>
+				</view>
+			</view>
+			<view class="cont2">
+				<view class="contf" v-if="qhIndex==2">
+					<view class="mainwzline" v-for="(wz,wzindex) in list"  :class="{'mainwzlineR':wzindex%3==0&&wzindex!=0}">
+						<view class="mainwzImgBox">
+						  <img :src="wz.LogoImg" alt="" class="mainwzImg">	
+						</view>
+						<view class="wztitle">{{wz.Title}}</view>
+					</view>
+				</view>
+				<view class="contL" v-if="qhIndex==1">
+					<view class="wxLine" v-for="(wz,wzindex) in list">
+						<view class="wzLineLeft">
+							<image :src="wz.LogoImg" class="wzLeftIMg"></image>
+						</view>
+						<view class="wzLineRight">
+							<view class="wzTitle">{{wz.Name}}</view>
+							<view class="wzComment">{{wz.Comment}}</view>
+						</view>
+					</view>
+				</view>
+			</view>
+			
+		</view>
+		
+		<!-- <view>
+			<a class="table-btn" href="http://phone.66km.cn:8088/marketing/training/940C4BF0A2E04542A1A1AD244EAFB6E2.xlsx" target='_blank'>下载入口</a>
+		</view> -->
+		
+		
+		
+	</view>
+</template>
+
+<script>
+	import pcNav from '../../components/pcNav/pcNav.vue'
+	export default {
+		components: {
+			pcNav,
+		},
+		data() {
+			return {
+				list:[],
+				comment:'',
+				topName:'',
+				parentCode:'',
+				topCode:'',
+				page:1,
+				dynamicCol:[],
+				qhIndex:1,
+				tabIndex:0,
+			}
+		},
+		onLoad(opt) {
+           this.topName=opt.topName;
+		   this.comment=opt.comment;
+		   this.topCode='';
+		   this.parentCode=opt.code;
+		   this.getcategoryPageData()
+		},
+		methods: {
+			gotoTop(){
+				uni.pageScrollTo({ 
+				   scrollTop: 0, duration: 300 
+				}); 
+			},
+			tabBtn(index){
+				this.tabIndex=index
+			},
+			getcategoryPageData(){
+				var params={
+					parentCode:this.parentCode,
+					topCode:this.topCode,
+					limit:20,
+					page:this.page,
+				}
+				this.$http('/trainingOpenApi/categoryPageData', params, 'GET').then(res => {
+					this.list=res.data.Items;
+					var arr=[
+						{
+							'name':'全部','code':'',
+						}	
+					]
+					
+					this.dynamicCol=arr.concat(res.data.dynamicCol);
+					
+				})
+			}
+		}
+	}
+</script>
+
+<style scoped>
+	
+	*{
+		padding: 0;
+		margin: 0;
+	}
+	.gotopImg{
+		width: 60px;
+		height: 60px;
+	}
+	.gotop{
+		position: fixed;
+		right:15vh ;
+		bottom: 100px;
+		cursor: pointer;
+	}
+	.topName{
+		text-align: center;
+		font-size: 24px;
+		font-weight: 500;
+		color: #3C3C3C;
+		line-height: 33px;
+		padding-top: 30px;
+	}
+	.comment{
+		text-align: center;
+		font-size: 14px;
+		font-weight: 400;
+		color: #999999;
+		line-height: 20px;
+		width: 500px;
+		padding-top: 10px;
+		margin: 0 auto;
+	}
+	.main{
+		width: 1200px;
+		margin: 0 auto;
+		padding-top: 30px;
+	}
+	.dynamicColLeft{
+		display: flex;
+	}
+	.dynamicColLIne{
+		padding-right: 44px;
+		font-size: 16px;
+		color: #3C3C3C;
+		cursor: pointer;
+	}
+	.qhImg{
+		width: 28px;
+		height: 28px;
+		margin-left: 8px;
+		cursor: pointer;
+	}
+	.dynamicCol{
+		display: flex;
+		justify-content: space-between;
+	}
+	.activeTab{
+		color: #FF4F00;
+	}
+	.mainwzImg{
+		width: 276px;
+		height: 184px;
+	}
+	.mainwzImgBox{
+		border-radius: 15px;
+	    overflow: hidden;
+	}
+	.contf{
+		display: flex;
+	}
+	.mainwzline{
+		width: 276px;
+		height: 260px;
+		background: #FFFFFF;
+		margin-right: 32px;	
+		padding-top: 33px;
+		cursor: pointer;
+	}
+	.mainwzlineR{
+	  margin-right: 0px;	
+	}
+	.wztitle{
+		width: 250px;
+		font-size: 16px;
+		color: #333333;
+		line-height: 22px;
+		height: 44px;
+		text-overflow: -o-ellipsis-lastline;
+		 overflow: hidden;
+		 text-overflow: ellipsis;
+		 display: -webkit-box;
+		 -webkit-line-clamp: 2;
+		 line-clamp: 2;
+		 -webkit-box-orient: vertical;
+		 padding-top: 16px;
+		 padding:0 13px ;
+	}
+	.wzLeftIMg{
+		width: 200px;
+		height: 132px;
+	}
+	.wxLine{
+		display: flex;
+		padding-top: 30px;
+	}
+	.wzLineLeft{
+		border-radius: 10px;
+		overflow: hidden;
+		width: 200px;
+		height: 132px;
+	}
+	.wzLineRight{
+		padding-left: 16px;
+	}
+	.wzTitle{
+		font-size: 16px;
+		font-weight: 500;
+		color: #3C3C3C;
+	}
+	.wzComment{
+		font-size: 12px;
+		font-family: PingFangSC-Regular, PingFang SC;
+		font-weight: 400;
+		color: #999999;
+		line-height: 17px;
+		padding-top: 10px;
+	}
+</style>

BIN
static/pcimg/btn_top@2x.png


BIN
static/pcimg/icon_arrow_xia@2x.png


BIN
static/pcimg/icon_arrow_you_def@2x.png


BIN
static/pcimg/icon_arrow_zuo_def@2x.png


BIN
static/pcimg/icon_arrow_zuo_sel@2x.png


BIN
static/pcimg/icon_kapian_def@2x.png


BIN
static/pcimg/icon_kapian_sel@2x.png


BIN
static/pcimg/icon_liebiao_sel@2x.png


BIN
static/pcimg/icon_list_arrow_def@2x.png


BIN
static/pcimg/icon_list_arrow_sel@2x.png


BIN
static/pcimg/icon_tuijian@2x.png


BIN
static/pcimg/legtspx.png


BIN
static/pcimg/qh2.png