zhengkaixin 3 years ago
parent
commit
be52310a1d
3 changed files with 17 additions and 7 deletions
  1. 6 0
      pages/article/articleDetails.vue
  2. 6 0
      pages/article/details.vue
  3. 5 7
      pages/article/newsNotice.vue

+ 6 - 0
pages/article/articleDetails.vue

@@ -43,6 +43,12 @@
 				newsApi.newsInfoDetail(this.id).then((res) => {
 					uni.hideLoading()					
 					this.newsDetail = res.data;
+					this.$nextTick(()=>{
+					    var list =document.getElementsByClassName("news-content")[0].getElementsByTagName("img");
+					    for(var i=0;i<list.length;i++){
+					        list[i].style='width: 100%;height: 100%;'
+					    }
+					})
 				}).catch(error => {
 					uni.showToast({
 						title: error,

+ 6 - 0
pages/article/details.vue

@@ -38,6 +38,12 @@
 				}).then((res) => {
 					uni.hideLoading()					
 					this.newsDetail = res.data;
+					this.$nextTick(()=>{
+					    var list =document.getElementsByClassName("news-content")[0].getElementsByTagName("img");
+					    for(var i=0;i<list.length;i++){
+					        list[i].style='width: 100%;height: 100%;'
+					    }
+					})
 				}).catch(error => {
 					uni.showToast({
 						title: error,

+ 5 - 7
pages/article/newsNotice.vue

@@ -8,12 +8,14 @@
 			</view>
 		</view>
 		
-		<view class="swiper-box" v-if="list.length">
-			<u-swiper  :list="list" @click="clickBanner" :img-mode="'aspectFit'" :name="'picUrl'" >
+		<view class="swiper-box" 
+		style="margin-bottom: 20px;"
+		v-if="list.length">
+			<u-swiper  bg-color="#fff" :list="list" @click="clickBanner" height="292" :img-mode="'aspectFit'" :name="'picUrl'" >
 		</u-swiper>
 		</view>
 		
-		<view class="news">
+		<view class="news" >
 			<view class="news-content" v-for="(item,index) in newsList" :key="item.id" @click="gotoUrl('pages/article/articleDetails?id=' + item.id)">
 				<view class="content-text">
 					{{item.title}}
@@ -153,11 +155,7 @@
 		margin: 0px 16px ;
 	}
 	.swiper-box{
-	
-		height: 146px;
 		margin: 0 16px;
-	
-		
 	}
 	.news {
 		background-color: #fff;