Browse Source

热门知识样式

彭宇 1 year ago
parent
commit
4c1990099e
3 changed files with 47 additions and 17 deletions
  1. 17 7
      pages/highServer/knowledge/knowledge.vue
  2. 13 2
      pages/index/index.vue
  3. 17 8
      pages/me/myPayKnow/myPayKnow.vue

+ 17 - 7
pages/highServer/knowledge/knowledge.vue

@@ -3,12 +3,22 @@
 	<view class="container">
 		<view class="rnwdList">
 			<view class="list" @tap="goDetails(item)" v-for="(item, index1) in dataSource" :key="index1">
-				<span class="listTitle">{{ item.titleName }}</span>
+        <span class="lb">{{ item.popular == '1' ? '热门' : '非热门' }}</span>
+        <span class="listTitle" v-if="item.imgUrlList != null">{{ item.titleName }}</span>
+        <view class="onePic" v-if="item.imgUrlList != null && item.imgUrlList.split(',').length == 1">
+          <image :src="loadImgSrcLocalhost(itemurl)" v-for="(itemurl, index1) in item.imgUrlList.split(',')" :key="index1">
+          </image>
+        </view>
 
-				<view class="onePic" v-if="item.imgUrlList != null">
-					<image :src="loadImgSrcLocalhost(item.imgUrlList)">
-					</image>
-				</view>
+        <view class="twoPic" v-if="item.imgUrlList != null && item.imgUrlList.split(',').length == 2">
+          <image :src="loadImgSrcLocalhost(itemurl)" v-for="(itemurl, index1) in item.imgUrlList.split(',')" :key="index1">
+          </image>
+        </view>
+
+        <view class="threePic" v-if="item.imgUrlList != null && item.imgUrlList.split(',').length == 3">
+          <image :src="loadImgSrcLocalhost(itemurl)" v-for="(itemurl, index1) in item.imgUrlList.split(',')" :key="index1">
+          </image>
+        </view>
 
 				<view class="jlSj">
 					<span style="color: #07c160;font-size: 24rpx;">
@@ -32,7 +42,7 @@
 <script>
 	import {
 		list,
-		knowledgePay 
+		knowledgePay
 	} from '@/api/knowledge/knowledge.js';
 	export default {
 		data() {
@@ -130,4 +140,4 @@
 
 <style>
 	@import './knowledge.css';
-</style>
+</style>

+ 13 - 2
pages/index/index.vue

@@ -193,8 +193,19 @@
 			</view>
       <view class="list" @tap="goKnowledgeDetails(item)" v-for="(item, index) in dataSource" :key="index">
         <span class="listTitle">{{ item.titleName }}</span>
-        <view class="onePic" v-if="item.imgUrlList != null">
-          <image  :src="loadImgSrcLocalhost(item.imgUrlList)"></image>
+        <view class="onePic" v-if="item.imgUrlList != null && item.imgUrlList.split(',').length == 1">
+          <image :src="loadImgSrcLocalhost(itemurl)" v-for="(itemurl, index1) in item.imgUrlList.split(',')" :key="index1">
+          </image>
+        </view>
+
+        <view class="twoPic" v-if="item.imgUrlList != null && item.imgUrlList.split(',').length == 2">
+          <image :src="loadImgSrcLocalhost(itemurl)" v-for="(itemurl, index1) in item.imgUrlList.split(',')" :key="index1">
+          </image>
+        </view>
+
+        <view class="threePic" v-if="item.imgUrlList != null && item.imgUrlList.split(',').length == 3">
+          <image :src="loadImgSrcLocalhost(itemurl)" v-for="(itemurl, index1) in item.imgUrlList.split(',')" :key="index1">
+          </image>
         </view>
         <view class="jlSj">
 						<span class="jf">

+ 17 - 8
pages/me/myPayKnow/myPayKnow.vue

@@ -5,13 +5,22 @@
 		<view class="rnwdList">
 			<view class="list" @tap="goDetails(item)" v-for="(item, index1) in wb" :key="index1">
 				<span class="lb">{{ item.popular == '1' ? '热门' : '非热门' }}</span>
-				<span class="listTitle">{{ item.titleName }}</span>
-	
-				<view class="onePic" v-if="item.imgUrlList != null">
-					<image :src="loadImgSrcLocalhost(item.imgUrlList)">
-					</image>
-				</view>
-	
+        <span class="listTitle">{{ item.titleName }}</span>
+        <view class="onePic" v-if="item.imgUrlList != null && item.imgUrlList.split(',').length == 1">
+          <image :src="loadImgSrcLocalhost(itemurl)" v-for="(itemurl, index1) in item.imgUrlList.split(',')" :key="index1">
+          </image>
+        </view>
+
+        <view class="twoPic" v-if="item.imgUrlList != null && item.imgUrlList.split(',').length == 2">
+          <image :src="loadImgSrcLocalhost(itemurl)" v-for="(itemurl, index1) in item.imgUrlList.split(',')" :key="index1">
+          </image>
+        </view>
+
+        <view class="threePic" v-if="item.imgUrlList != null && item.imgUrlList.split(',').length == 3">
+          <image :src="loadImgSrcLocalhost(itemurl)" v-for="(itemurl, index1) in item.imgUrlList.split(',')" :key="index1">
+          </image>
+        </view>
+
 				<view class="jlSj">
 					<span style="color: #07c160;font-size: 24rpx;">
 					   {{ item.createTime }}
@@ -109,4 +118,4 @@
 </script>
 <style>
 	@import 'myPayKnow.css';
-</style>
+</style>