@tang_weiteng 2 years ago
parent
commit
3cdb45e574
4 changed files with 101 additions and 35 deletions
  1. 5 5
      common/request.js
  2. 4 3
      components/pcNav/pcNav.vue
  3. 91 26
      pages/pc/indexNew.vue
  4. 1 1
      pages/pc/list.vue

+ 5 - 5
common/request.js

@@ -1,15 +1,15 @@
  //测试地址
-/* const baseURL = 'http://api.dms.66km.com.cn/' 
- const burl2='http://api.dms.66km.com.cn/' */
+ const baseURL = 'http://api.dms.66km.com.cn/' 
+ const burl2='http://api.dms.66km.com.cn/' 
 //66正式
- const baseURL = 'https://api.dms.66km.com/' 
- const burl2='https://api.dms.66km.com/' 
+/* const baseURL = 'https://api.dms.66km.com/' 
+ const burl2='https://api.dms.66km.com/' */
 //欧洲维修
 /* const baseURL = 'http://edms.eurorepar.cn/' 
  const burl2='http://edms.eurorepar.cn/ ' */
 // import md5 from './MD5.js'
 
-
+ 
 const fetchPost = (url = '', params = {}, header = {
 }) => {
     return new Promise((resolve, reject) => {

+ 4 - 3
components/pcNav/pcNav.vue

@@ -3,13 +3,14 @@
 		<view class="nav">
 			<view class="navCont">
 				<view class="logo">
-					<image :src="info.logo" mode="" class="logoImg "></image><!-- euroreparIMg -->
+					<!-- <image src="../../static/pcimg/111.png" mode="" class="logoImg euroreparIMg"></image> -->
+				<image :src="info.logo" mode="" class="logoImg "></image><!-- euroreparIMg -->
 				</view>
 				<view class="navTitle">{{info.title}}</view>
 				<view class="indexNav" :class="{'indexActive':data=='index'}" @click="goIndex">首页</view>
 				<view class="allCategory">
-					<view class="allCategoryLine" :class="{'indexActive':itemName==item.name}" v-for="(item,index) in allCategory" v-if="index<5" @click="goItem(item)">{{item.name}}</view>
-				    <view class="allCategoryMore" v-if="allCategory.length>5">
+					<view class="allCategoryLine" :class="{'indexActive':itemName==item.name}" v-for="(item,index) in allCategory" v-if="index<7" @click="goItem(item)">{{item.name}}</view>
+				    <view class="allCategoryMore" v-if="allCategory.length>7">
 					 <span @click="moreBtn" class="moreBtn">更多</span> 
 					 <image @click="moreBtn" src="../../static/pcimg/icon_arrow_xia@2x.png" mode="widthFix" class="navmoreImg"></image>
 					 <image  src="../../static/pcimg/mores.png" mode="widthFix" class="navmoreImg2"></image>

+ 91 - 26
pages/pc/indexNew.vue

@@ -13,8 +13,38 @@
 					<span class="tuijTitle">推荐文章</span>
 				</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">
+					<swiper-item v-for="(item,index) in recommendList" v-if="(index+1)%4!=0">
+						<view class="mainwzbox" >
+							<view class="mainwzline" @click="goDetailswp(recommendList[index])"  >
+								<view class="mainwzImgBox">
+								  <img :src="item.logoImg" alt="" class="mainwzImg">	
+								</view>
+								<view class="wztitle">{{item.name}}</view>
+								<view class="wztime"></view>
+							</view>
+							<view class="mainwzline" v-if="recommendList[index+1]" @click="goDetail3(recommendList[index+1])"  >
+								<view class="mainwzImgBox">
+								  <img :src="recommendList[index+1].logoImg" alt="" class="mainwzImg">	
+								</view>
+								<view class="wztitle">{{recommendList[index+1].name}}</view>
+								<view class="wztime"></view>
+							</view>
+							<view class="mainwzline" v-if="recommendList[index+2]" @click="goDetail3(recommendList[index+2])" >
+								<view class="mainwzImgBox">
+								  <img :src="recommendList[index+2].logoImg" alt="" class="mainwzImg">	
+								</view>
+								<view class="wztitle">{{recommendList[index+2].name}}</view>
+								<view class="wztime"></view>
+							</view>
+							<view class="mainwzline mainwzlineR" v-if="recommendList[index+3]" @click="goDetail3(recommendList[index+3])" >
+								<view class="mainwzImgBox">
+								  <img :src="recommendList[index+3].logoImg" alt="" class="mainwzImg">	
+								</view>
+								<view class="wztitle">{{recommendList[index+3].name}}</view>
+								<view class="wztime"></view>
+							</view>
+						</view> 
+					<!-- 	<view class="swpCont">
 							<view class="swiper-item" @click="goDetail(item)">
 								<view class="swpimgBox swpBr">
 									<image :src="item.logoImg" mode="" class="swpimg"></image>
@@ -34,7 +64,7 @@
 									<view class="categoryName">{{recommendList[index+1].categoryName.substring(0,5)}}</view>
 								</view>
 							</view>
-						</view>
+						</view> -->
 						
 					</swiper-item>
 					
@@ -128,8 +158,6 @@
 				</view>
 				
 			</view>
-			
-			<!-- -->
 			<view class="pageView" v-show="TotalSize">
 				<page-pagination :pageSize="pageSize" :size="'small'" :total="TotalSize" :numAround="true" @change="pageChange"></page-pagination>
 			</view>
@@ -233,6 +261,7 @@
 					this.comment=item.comment;
 					this.topCode=item.code;
 					this.parentCode=item.code;
+					//this.parentCode='';
 					this.getcategoryPageData();
 					uni.setNavigationBarTitle({
 					    title: this.topName
@@ -359,6 +388,22 @@
 				this.newsearchShow=false;
 				this.newgroupingdata=newgroupingdata
 			},
+			goDetailswp(item){
+				
+				this.indexShow=false;
+				this.listShow=false;
+				this.newDetailShow=true;
+				this.newgroupingListShow=false;
+				this.newsearchShow=false;
+				this.newDetailID=item.id;
+				var item={
+					categoryName:item.categoryName,
+					twoName:'',
+					comment:item.comment,
+					code:item.code
+				}
+				this.newDetailItem=item;
+			},
 			gotoTop(){
 				uni.pageScrollTo({ 
 				   scrollTop: 0, duration: 300 
@@ -367,7 +412,7 @@
 			
 			swpBtnRight(){
 				var length=this.recommendList.length;
-				var num=Math.ceil(length/2)-1
+				var num=Math.ceil(length/4)-1
 				console.log(num+'---'+this.swpIndex)
 				if(this.swpIndex<num){
 					this.swpIndex++
@@ -401,7 +446,6 @@
 				}) */
 			},
 			
-				
 				gotoTop(){
 					uni.pageScrollTo({ 
 					   scrollTop: 0, duration: 300 
@@ -409,7 +453,7 @@
 				},
 				tabBtn(index,item){
 					this.tabIndex=index;
-					//console.log(item)
+					console.log(item)
 					this.parentCode=item.code;
 					this.getcategoryPageData()
 				},
@@ -420,27 +464,47 @@
 					
 				},
 				getcategoryPageData(){
-					var params={
-						parentCode:this.parentCode,
-						topCode:this.topCode,
-						limit:this.pageSize,
-						page:this.page,
+					console.log(this.parentCode)
+					if(this.parentCode){
+						var params={
+							parentCode:this.parentCode,
+							topCode:this.topCode,
+							limit:this.pageSize,
+							page:this.page,
+						}
+						var url='trainingOpenApi/categoryPageDataNew'
+						this.$http(url, params, 'GET').then(res => {
+							uni.hideLoading();
+							this.list=res.data.Items;
+							this.TotalSize=res.data.TotalSize;
+							var arr=[
+								{
+									'name':'全部','code':'',
+								}	
+							]
+							this.dynamicCol=arr.concat(res.data.dynamicCol);
+							
+						})
+					}else{
+						var params = {
+								page: this.page,
+								limit: 10,
+								parentCode: this.topCode,
+							}
+							var url='trainingOpenApi/groupPageData'
+							this.$http(url, params, 'GET').then(res => {
+								uni.hideLoading();
+								this.list=res.data.Items;
+								this.TotalSize=res.data.TotalSize;
+								
+							})
 					}
+					
 					uni.showLoading({
 						title: '加载中'
 					})
-					this.$http('/trainingOpenApi/categoryPageData', params, 'GET').then(res => {
-						uni.hideLoading();
-						this.list=res.data.Items;
-						this.TotalSize=res.data.TotalSize;
-						var arr=[
-							{
-								'name':'全部','code':'',
-							}	
-						]
-						this.dynamicCol=arr.concat(res.data.dynamicCol);
-						
-					})
+					//trainingOpenApi/categoryPageData
+					
 				}
 			}
 		
@@ -452,6 +516,7 @@
 		background: #F4F5F7;
 		min-height: 100vh;
 		font-family: PingFangSC-Regular, PingFang SC;
+		min-width: 1200px;
 	}
 	.swiperBox{
 		/* height: 280px; */
@@ -533,7 +598,7 @@
 		overflow: hidden;
 	}
 	.swiper{
-		height: 190px;
+		height: 290px;
 	}
 	.swpTitleBox{
 		padding-left: 304px;

+ 1 - 1
pages/pc/list.vue

@@ -152,7 +152,7 @@
 				uni.showLoading({
 					title: '加载中'
 				})
-				this.$http('/trainingOpenApi/categoryPageData', params, 'GET').then(res => {
+				this.$http('/trainingOpenApi/categoryPageDataNew', params, 'GET').then(res => {
 					uni.hideLoading();
 					this.list=res.data.Items;
 					this.TotalSize=res.data.TotalSize;