付宇航 vor 1 Jahr
Ursprung
Commit
b5631d4bde
2 geänderte Dateien mit 36 neuen und 16 gelöschten Zeilen
  1. 17 7
      pages/fuwu/fuwu.vue
  2. 19 9
      pages/toLegal/toLegal.vue

+ 17 - 7
pages/fuwu/fuwu.vue

@@ -1,24 +1,25 @@
 <template>
     <!-- pages/me.wxml -->
 	<view class="container">
-		<uni-search-bar @confirm="search" :focus="true" v-model="searchValue" @blur="search"  @input="search"
+		<uni-search-bar  :focus="true" v-model="searchValue"  @input="search"
 		style="width: 100%;"
 			@cancel="cancel">
 		</uni-search-bar>
 	    <view class="rnwdList">
 	        <view class="list" @tap="goDetails(item)" v-for="(item, index1) in qbwd" :key="index1">
+				<span v-if="index1 < 3" style="color: red;">[置顶]</span>
 	            <span class="listTitle">{{ item.titleName }}</span>
 	
-	            <view class="onePic" v-if="item.urls.length == 1">
+	            <view class="onePic" v-if="index1 >2  ? item.urls.length == 1 : false ">
 	                <image :src="loadImgSrc(item.urls[index2])" v-for="(v, index2) in item.urls" :key="index2">
 					</image>
 	            </view>
-	            <view class="twoPic" v-if="item.urls.length == 2">
+	            <view class="twoPic" v-if="index1 >2 ? item.urls.length == 2 : false">
 	                <image :src="loadImgSrc(item.urls[index2])" v-for="(v, index2) in item.urls" :key="index2">
 					</image>
 	            </view>
 	
-	            <view class="threePic" v-if="item.urls.length == 3">
+	            <view class="threePic" v-if="index1 >2 ? item.urls.length == 3 : false">
 	                <image :src="loadImgSrc(item.urls[index2])" v-for="(v, index2) in item.urls" :key="index2">
 					</image>
 	            </view>
@@ -65,14 +66,20 @@ export default {
 			  type: 12,
 			  flag:''
 			},
+			topList:[],
 			total:0,
 			searchValue:''
 		};
     },
 	created(){
-		this.getList()
 		// 查置顶
-		listWx({}).then(e => {
+		listWx({
+			type:12,
+			isTop:1
+		}).then(e => {
+			this.topList = e.data
+			this.qbwd = this.topList
+			this.getList()
 		})
 	},
 	onReachBottom(){
@@ -90,12 +97,15 @@ export default {
 		}
 	},
 	methods:{
+		cancel(){
+			this.listParams.titleName = ''
+		},
 		search(){
 			this.listParams.titleName = this.searchValue
-			this.qbwd = []
 			this.getList()
 		},
 		getList(){
+			this.qbwd = this.topList
 			listWxs(this.listParams).then(res => {
 				this.qbwd = [...this.qbwd,...res.rows]
 				this.total = res.total

+ 19 - 9
pages/toLegal/toLegal.vue

@@ -1,24 +1,25 @@
 <template>
     <!-- pages/me.wxml -->
 	<view class="container">
-		<uni-search-bar @confirm="search" :focus="true" v-model="searchValue" @blur="search"  @input="search"
+		<uni-search-bar  :focus="true" v-model="searchValue"  @input="search"
 		style="width: 100%;"
 			@cancel="cancel">
 		</uni-search-bar>
 	    <view class="rnwdList">
 	        <view class="list" @tap="goDetails(item)" v-for="(item, index1) in qbwd" :key="index1">
+				<span v-if="index1 < 3" style="color: red;">[置顶]</span>
 	            <span class="listTitle">{{ item.titleName }}</span>
 	
-	            <view class="onePic" v-if="item.urls.length == 1">
+	            <view class="onePic" v-if="index1 >2  ? item.urls.length == 1 : false ">
 	                <image :src="loadImgSrc(item.urls[index2])" v-for="(v, index2) in item.urls" :key="index2">
 					</image>
 	            </view>
-	            <view class="twoPic" v-if="item.urls.length == 2">
+	            <view class="twoPic" v-if="index1 >2 ? item.urls.length == 2 : false">
 	                <image :src="loadImgSrc(item.urls[index2])" v-for="(v, index2) in item.urls" :key="index2">
 					</image>
 	            </view>
 	
-	            <view class="threePic" v-if="item.urls.length == 3">
+	            <view class="threePic" v-if="index1 >2 ? item.urls.length == 3 : false">
 	                <image :src="loadImgSrc(item.urls[index2])" v-for="(v, index2) in item.urls" :key="index2">
 					</image>
 	            </view>
@@ -62,17 +63,23 @@ export default {
 			  pageNum: 1,
 			  pageSize: 7,
 			  titleName: '',
-			  type: 11,
+			  type: 12,
 			  flag:''
 			},
+			topList:[],
 			total:0,
 			searchValue:''
 		};
     },
 	created(){
-		this.getList()
 		// 查置顶
-		listWx({}).then(e => {
+		listWx({
+			type:12,
+			isTop:1
+		}).then(e => {
+			this.topList = e.data
+			this.qbwd = this.topList
+			this.getList()
 		})
 	},
 	onReachBottom(){
@@ -90,12 +97,15 @@ export default {
 		}
 	},
 	methods:{
+		cancel(){
+			this.listParams.titleName = ''
+		},
 		search(){
 			this.listParams.titleName = this.searchValue
-			this.qbwd = []
 			this.getList()
 		},
 		getList(){
+			this.qbwd = this.topList
 			listWxs(this.listParams).then(res => {
 				this.qbwd = [...this.qbwd,...res.rows]
 				this.total = res.total
@@ -103,7 +113,7 @@ export default {
 		},
 		goDetails(e) {
 			let id = e.id || ''
-			let type = 11
+			let type = 12
 		    uni.navigateTo({
 		        url: `../informationDetail/informationDetail?id=${id}&type=${type}`
 		    });