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

Merge branch 'master' of http://192.168.10.18:3000/sooka_shop/sooka_consult_uniapp

付宇航 пре 1 година
родитељ
комит
fefdbfa8f0

+ 40 - 8
pages.json

@@ -126,8 +126,8 @@
 				"backgroundTextStyle": "dark",
 				"pullToRefresh": {
 					"support": true,
-					"color": "#000000", 	
-					"style": "circle" 	
+					"color": "#000000",
+					"style": "circle"
 				},
 				"navigationBarTitleText": "资讯"
 			}
@@ -148,6 +148,13 @@
 				"navigationBarBackgroundColor": "#07c160",
 				"navigationBarTextStyle": "white",
 				"enablePullDownRefresh": true,
+				"navigationBarTextStyle": "dark",
+				"backgroundTextStyle": "dark",
+				"pullToRefresh": {
+					"support": true,
+					"color": "#000000",
+					"style": "circle"
+				},
 				"navigationBarTitleText": "付费知识"
 			}
 		},
@@ -163,8 +170,8 @@
 				"backgroundTextStyle": "dark",
 				"pullToRefresh": {
 					"support": true,
-					"color": "#000000", 	
-					"style": "circle" 	
+					"color": "#000000",
+					"style": "circle"
 				}
 			}
 		},
@@ -322,8 +329,15 @@
 				"usingComponents": {},
 				"navigationBarBackgroundColor": "#07c160",
 				"navigationBarTextStyle": "white",
-				"navigationBarTitleText": "惠民通"
-
+				"navigationBarTitleText": "惠民通",
+				"enablePullDownRefresh": true,
+				"navigationBarTextStyle": "dark",
+				"backgroundTextStyle": "dark",
+				"pullToRefresh": {
+					"support": true,
+					"color": "#000000",
+					"style": "circle"
+				}
 			}
 		},
 		{
@@ -338,8 +352,8 @@
 				"backgroundTextStyle": "dark",
 				"pullToRefresh": {
 					"support": true,
-					"color": "#000000", 	
-					"style": "circle" 	
+					"color": "#000000",
+					"style": "circle"
 				},
 				"navigationBarTitleText": "法律下乡"
 
@@ -546,6 +560,24 @@
 				"navigationBarTextStyle": "white",
 				"navigationBarTitleText": "事项列表"
 			}
+		},
+		{
+			"path": "pages/topic/dept",
+			"style": {
+				"usingComponents": {},
+				"navigationBarBackgroundColor": "#07c160",
+				"navigationBarTextStyle": "white",
+				"navigationBarTitleText": "部门导航"
+			}
+		},
+		{
+			"path": "pages/gridQuery/mattercontent",
+			"style": {
+				"usingComponents": {},
+				"navigationBarBackgroundColor": "#07c160",
+				"navigationBarTextStyle": "white",
+				"navigationBarTitleText": "事项详情"
+			}
 		}
 	],
 	"easycom": {

+ 15 - 9
pages/gridQuery/gridQuery.vue

@@ -1,10 +1,13 @@
 <template>
 	<view>
 			<view >
-				<ul >
-					{{jobDescription}}
-				</ul>
+				<uni-title type="h3" :title="data.name+'职责:'"></uni-title><br/><br/>
 			</view>
+
+			<view>
+				<uni-title type="h5" :title="data.jobDescription" color="#666"></uni-title>
+
+				</view>
 	</view>
 
 </template>
@@ -17,20 +20,20 @@
 	export default {
 		data() {
 			return {
-				jobDescription:'',
+				data:{}
 			};
 		},
-		
+
 		onLoad(option){
 			    uni.setNavigationBarTitle({
 			      title: option.titleText
 			    });
-			  
+
 			const _that = this
 			const id = uni.getStorageSync('id');
-			console.log(id)
 			 getGridType(id).then(res =>{
-				 _that.jobDescription = res.data.jobDescription
+				 _that.data = res.data
+				 console.log(_that.data)
 			 })
 		},
 
@@ -40,6 +43,9 @@
 	}
 </script>
 <style scoped>
-
+.uni-divider {
+  height: 10rpx;
+  background-color: #eee;
+}
 </style>
 

+ 12 - 13
pages/gridQuery/mattercontent.vue

@@ -2,18 +2,18 @@
 
 	<view>
 		<view class="rnwdList">
-		
-		
+
+
 			<ul >
 				<li >
-					
+
 					<h3>{{matterlist.title }}</h3>
 				    <p>{{ matterlist.content }}</p>
 					   <button @click="toggleFavorite">{{ isFavorite ? '❤️' : '🤍' }}</button>
 				</li>
 				</ul>
-			
-			
+
+
 		</view>
 	</view>
 
@@ -22,7 +22,7 @@
 
 <script>
 	import {
-		 getDept, addsc, delDept, getsc 
+		 getDept, addsc, delDept, getsc
 	} from '@/api/handleAffairs/matter.js';
 
 	export default {
@@ -34,15 +34,14 @@
 		},
 		created() {
 		    this.getList();
-			
+
 		},
-		
-	
+
+
 		methods: {
 		      getList(){
 		        const _that = this;
 		        const id = uni.getStorageSync('id');
-				console.log(uni.getStorageSync('id'),"11111111")
 		        getDept(id).then(res =>{
 		          _that.matterlist = res.data
 					this.checkFavorite();
@@ -56,20 +55,20 @@
 		          });
 		        } else {
 					const userId = getApp().globalData.userId
-					const matterId = this.matterlist.id 
+					const matterId = this.matterlist.id
 		         addsc({ matterId:this.matterlist.id , userId }).then(() => {
 		             this.isFavorite = true;
 		         });
 		        }
 		      },
-		    
+
 		    checkFavorite() {
 				const userId = getApp().globalData.userId
 		      getsc(userId).then(res => {
 		        this.isFavorite = res.data;
 		      });
 		    },
-		  
+
 	},
 	}
 </script>

+ 107 - 7
pages/handleAffairs/handleAffairs.vue

@@ -45,6 +45,45 @@
 				</uni-col>
 			</uni-row>
 		</view>
+
+		<!-- ------------------------------------------------------------------------------------------------------------------------------------------ -->
+
+		<view>
+		    <!-- 使用分段器来切换推荐和收藏列表 -->
+		    <view class="segmented-control">
+		        <view class="segmented-control-item" :class="{ active: activeTab === 'recommend' }" @click="changeTab('recommend')">推荐</view>
+		        <view class="segmented-control-item" :class="{ active: activeTab === 'favorite' }" @click="changeTab('favorite')">收藏</view>
+		    </view>
+
+		    <!-- 根据选中的标签显示对应的列表 -->
+		    <view v-if="activeTab === 'recommend'">
+		        <view class="rnwdList">
+		            <ul>
+		               <!-- <li v-for="(item,index) in recommendList" :key="index">
+		                    <p @click="getmatter(item)">{{ item.title }}</p>
+		                </li> -->
+						<uni-list>
+							<uni-list-item  :title="item.title" v-for="(item,index) in recommendList" @click="getmatter(item)" clickable="true" ></uni-list-item>
+						</uni-list>
+		            </ul>
+		        </view>
+		    </view>
+		    <view v-if="activeTab === 'favorite'">
+		        <view class="rnwdList">
+		            <ul>
+		                <!-- <li v-for="(item,index) in favoriteList" :key="index">
+		                    <p @click="getmatter(item)">{{ item.title }}</p>
+		                </li> -->
+						<uni-list>
+							<uni-list-item  :title="item.title" v-for="(item,index) in favoriteList" @click="getmatter(item)" clickable="true" ></uni-list-item>
+						</uni-list>
+		            </ul>
+		        </view>
+		    </view>
+
+		</view>
+
+
 	</view>
 </template>
 
@@ -52,16 +91,23 @@
 	import {
 		listGridType
 	} from '@/api/handleAffairs/gridType.js';
-
+import { listDept,collectlist } from '@/api/handleAffairs/matter.js';
 	export default {
 		data() {
 			return {
 				title:"",
-				gridtType: [], //是一个list<map>数据 [{0,[1,2,3]}]
+				gridtType: [], //是一个list<map>数据 [[1,2,3]]
+
+				activeTab: 'recommend', // 默认选中推荐列表
+				recommendList: [], // 推荐列表数据
+				favoriteList: [], // 收藏列表数据
+				  userList: [], // 收藏列表数据
 			};
 		},
 		created() {
-			this.getList();
+			this.getListListGrid();
+			this.getListDept();
+			this.getListscolle();
 		},
 		methods: {
 			confirm(){
@@ -80,10 +126,7 @@
 					url: '/pages/topic/topic',
 				});
 			},
-			//部门导航跳转
-			dept(){
 
-			},
 			querygrid(item) {
 				console.log(item)
 				uni.setStorageSync('id', item.id)
@@ -92,7 +135,7 @@
 
 				});
 			},
-			getList() {
+			getListListGrid() {
 				const _that = this
 				let query = {
 					yesOrNoShow: "0"
@@ -111,6 +154,49 @@
 				});
 
 			},
+			getListDept() {
+			    const _that = this;
+			    let query = { yesOrNoShow: "0" };
+			    // 获取推荐列表数据
+			    listDept(query).then(res => {
+			        _that.recommendList = res.rows;
+
+			    });
+
+			},
+			getListscolle(){
+
+			   const userId = getApp().globalData.userId;
+			  collectlist(userId).then(res =>{
+			    this.favoriteList = res.rows
+
+			  })
+			},
+			getmatter(item) {
+			    uni.setStorageSync('id', item.id);
+			    uni.navigateTo({
+			        url: '/pages/gridQuery/mattercontent',
+			    });
+			},
+			addNewItem(item) {
+
+			    uni.navigateTo({
+			        url: '/pages/mattersAdd/mattersAdd',
+			    });
+			},
+			changeTab(tab) {
+			    this.activeTab = tab;
+
+				this.getListDept()
+
+				this.getListscolle()
+			},
+			dept(){
+
+				uni.navigateTo({
+					url: '/pages/topic/dept',
+				});
+			}
 		}
 	}
 </script>
@@ -145,4 +231,18 @@
 		margin: 7px 0;
 		line-height: $nav-height;
 	}
+	.segmented-control {
+	    display: flex;
+	    justify-content: space-around;
+	    background-color: #f0f0f0;
+	}
+
+	.segmented-control-item {
+	    padding: 10px;
+	    cursor: pointer;
+	}
+
+	.segmented-control-item.active {
+	    color: #007aff;
+	}
 </style>

+ 0 - 162
pages/handleAffairs/matter.vue

@@ -1,162 +0,0 @@
-<template>
-    <view>
-        <!-- 使用分段器来切换推荐和收藏列表 -->
-        <view class="segmented-control">
-            <view class="segmented-control-item" :class="{ active: activeTab === 'recommend' }" @click="changeTab('recommend')">推荐</view>
-            <view class="segmented-control-item" :class="{ active: activeTab === 'favorite' }" @click="changeTab('favorite')">收藏</view>
-        </view>
-
-        <!-- 根据选中的标签显示对应的列表 -->
-        <view v-if="activeTab === 'recommend'">
-            <view class="rnwdList">
-                <ul>
-                    <li v-for="(item,index) in recommendList" :key="index">
-                        <p @click="getmatter(item)">{{ item.title }}</p>
-                    </li>
-                </ul>
-            </view>
-        </view>
-        <view v-if="activeTab === 'favorite'">
-            <view class="rnwdList">
-                <ul>
-                    <li v-for="(item,index) in favoriteList" :key="index">
-                        <p @click="getmatter(item)">{{ item.title }}</p>
-                    </li>
-                </ul>
-            </view>
-        </view>
-        <!-- 新加一个加号点击事件 -->
-        <view class="add-button" @click="addNewItem">+</view>
-		<view>
-			<uni-row class="demo-uni-row" :width="nvueWidth">
-				<uni-col :span="120">
-					<button align="center" @click="dept">部门导航</button>
-				</uni-col>
-			</uni-row>
-		</view>
-    </view>
-</template>
-
-<script>
-import { listDept,collectlist } from '@/api/handleAffairs/matter.js';
-
-
-export default {
-    data() {
-        return {
-            activeTab: 'recommend', // 默认选中推荐列表
-            recommendList: [], // 推荐列表数据
-            favoriteList: [], // 收藏列表数据
-			  userList: [], // 收藏列表数据
-        };
-    },
-    created() {
-        this.getList();
-		this.getLists();
-		
-    },
-    methods: {
-        getmatter(item) {
-            uni.setStorageSync('id', item.id);
-            uni.navigateTo({
-                url: '/pages/gridQuery/mattercontent',
-            });
-        },
-		addNewItem(item) {
-		  
-		    uni.navigateTo({
-		        url: '/pages/mattersAdd/mattersAdd',
-		    });
-		},
-        changeTab(tab) {
-            this.activeTab = tab;
-			
-			this.getList()
-			
-			this.getLists()
-        },
-		dept(){
-		
-			uni.navigateTo({
-				url: '/pages/topic/dept',
-			});
-		},
-        getList() {
-            const _that = this;
-            let query = { yesOrNoShow: "0" };
-            // 获取推荐列表数据
-            listDept(query).then(res => {
-                _that.recommendList = res.rows;
-		
-            });
-        
-        },
-		getLists(){
-		   
-		   const userId = getApp().globalData.userId;
-		  collectlist(userId).then(res =>{
-			  console.log("00000000000000000",res)
-		    this.favoriteList = res.rows
-			console.log("777777777777777", this.favoriteList)
-
-		  })
-		}
-				
-		  
-    }
-}
-</script>
-
-<style scoped>
-.segmented-control {
-    display: flex;
-    justify-content: space-around;
-    background-color: #f0f0f0;
-}
-
-.segmented-control-item {
-    padding: 10px;
-    cursor: pointer;
-}
-
-.segmented-control-item.active {
-    color: #007aff;
-}
-
-.rnwdList {
-    width: 100%;
-    display: flex;
-    justify-content: space-between;
-    margin: 20rpx 0;
-}
-.uni-header-image {
-
-		width: 30px;
-		height: 30px;
-		display: block;
-		margin: 0 auto;
-	}
-
-	/* 主导航 */
-	.mainNav {
-		width: 100%;
-		background: #fff;
-
-	}
-
-	.input-view {
-		/* #ifndef APP-PLUS-NVUE */
-		display: flex;
-		/* #endif */
-		flex-direction: row;
-		// width: 500rpx;
-		flex: 1;
-		background-color: #f8f8f8;
-		height: $nav-height;
-		border-radius: 15px;
-		padding: 0 15px;
-		flex-wrap: nowrap;
-		margin: 7px 0;
-		line-height: $nav-height;
-	}
-</style>

+ 33 - 6
pages/index/announcementList.vue

@@ -1,10 +1,13 @@
 <template>
 	<view class="list">
+		<view class="selectParam">
+			<uni-search-bar :focus="false" v-model="title"  @input="search" @cancel="cancel" clearButton="auto" cancelButton="none"></uni-search-bar>
+		</view>
 		<view v-for="(item, index) in list" :key="item.id" class="item">
 			<img :src="loadImgSrc(`${item.announcementImg}`)" class="avatar" />
 			<view class="info" style="height: 5em;">
 				<view class="name" @click="handleNavigate(item)">
-					{{ item.announcementTitle }}
+					标题:{{ item.announcementTitle }}
 					<view class="unread-dot" v-if="item.readType == 0"></view>
 				</view>
 			</view>
@@ -22,13 +25,19 @@ export default {
 			queryParam: {
 				pageNum: 1,
 				pageSize: 10,
+				announcementTitle: '',
 				userId: getApp().globalData.userId
 			},
 			total: null,
-			list: []
+			title:'',
+			list: [],
+			flag: true,
 		};
 	},
 	onLoad() {
+		this.queryParam.pageNum = 1
+		this.queryParam.pageSize = 10
+		this.flag=true
 		this.getAnnoList();
 	},
 	onReachBottom() {
@@ -42,16 +51,34 @@ export default {
 			return;
 		} else {
 			this.queryParam.pageNum += 1;
+			this.flag=true
 			this.getAnnoList();
 		}
 	},
 	methods: {
+		cancel(){
+			this.queryParam.pageNum = 1
+			this.queryParam.pageSize = 10
+			this.queryParam.announcementTitle = ''
+		},
+		search(){
+			this.queryParam.pageNum = 1
+			this.queryParam.pageSize = 10
+			this.queryParam.announcementTitle = this.title
+			this.flag=false
+			this.getAnnoList()
+		},
 		getAnnoList() {
-			console.log(this.queryParam)
 			getList(this.queryParam).then((res) => {
-				this.list = [...this.list,...res.rows]
-				// this.list = res.rows;
-				this.total = res.total;
+				if(this.flag){
+					this.list = [...this.list,...res.rows]
+					// this.list = res.rows;
+					this.total = res.total
+				}else{
+					this.list = res.rows
+					this.total = res.total
+				}
+
 			});
 		},
 		handleNavigate(item) {

+ 17 - 15
pages/index/index.vue

@@ -219,7 +219,9 @@
 
 <script>
 	import {
-		getListToAnnouncement,getCovers,getCarousel
+		getListToAnnouncement,
+		getCovers,
+		getCarousel
 	} from '@/api/index/index.js';
 	import {
 		governmentListData
@@ -233,11 +235,11 @@
 	export default {
 		data() {
 			return {
-				bigImg:'https://tse1-mm.cn.bing.net/th/id/OIP-C.JsghMT_u8V52I4PSHow2hAHaEG?w=332&h=186&c=7&r=0&o=5&pid=1.7',
+				bigImg: 'https://tse1-mm.cn.bing.net/th/id/OIP-C.JsghMT_u8V52I4PSHow2hAHaEG?w=332&h=186&c=7&r=0&o=5&pid=1.7',
 				// 图片轮播
 				banners: [
-						'https://tse1-mm.cn.bing.net/th/id/OIP-C.JsghMT_u8V52I4PSHow2hAHaEG?w=332&h=186&c=7&r=0&o=5&pid=1.7'
-					],
+					'https://tse1-mm.cn.bing.net/th/id/OIP-C.JsghMT_u8V52I4PSHow2hAHaEG?w=332&h=186&c=7&r=0&o=5&pid=1.7'
+				],
 				announcementList: [{
 						id: '3',
 						announcementTitle: '关于高质量推进土地整治工作赋能乡村振兴的通知'
@@ -378,18 +380,18 @@
 			goZcDetail(e) {
 				let id = e.id || ''
 				let type = 10
-			    uni.navigateTo({
-			        url: `../informationDetail/informationDetail?id=${id}&type=${type}`
-			    });
+				uni.navigateTo({
+					url: `../informationDetail/informationDetail?id=${id}&type=${type}`
+				});
 			},
 			//封面与轮播图
-			getCovers(){
-				getCovers().then(res=>{
+			getCovers() {
+				getCovers().then(res => {
 					this.bigImg = res.data
 				})
-				getCarousel().then(res=>{
+				getCarousel().then(res => {
 					this.banners = res.data
-				})	
+				})
 			},
 			// 热门知识获取数据
 			getList() {
@@ -399,7 +401,7 @@
 				}
 				popularKnowledgeList(params).then(res => {
 					if (res.code == 200) {
-						this.dataSource = res.rows
+						this.dataSource = [...this.dataSource, ...res.rows]
 						this.total = res.total
 						console.log("this.dataSource", this.dataSource)
 					}
@@ -580,7 +582,7 @@
 					relevance: "0",
 				}
 				reduceScore(params).then((res) => {
-					console.log("reduceScore",res)
+					console.log("reduceScore", res)
 				})
 			},
 			/**
@@ -594,7 +596,7 @@
 					relevance: "0",
 				}
 				addScore(params).then((res) => {
-					console.log("addScore",res)
+					console.log("addScore", res)
 				})
 			}
 		}
@@ -602,4 +604,4 @@
 </script>
 <style>
 	@import './index.css';
-</style>
+</style>

+ 1 - 1
pages/informationDetail/informationDetail.vue

@@ -6,7 +6,7 @@
             <view class="wenzhangLy">
                 <!-- 头像昵称 -->
                 <view class="txTime">
-                    <image :src="loadImgSrcLocalhost(detailInfo.headImg!=null?detailInfo.headImg:'/profile/upload/2024/03/05/abf969632ee94bd5a429c8c2dbb2f6b4 (1)_20240305092823A002.png')" style="border-radius: 50px;"></image>
+                    <image :src="loadImgSrcLocalhost(detailInfo.headImg)" style="border-radius: 50px;"></image>
                     <view class="time">
                         <p>{{detailInfo.nickName?detailInfo.nickName:'网友'}}</p>
                         <span>{{ detailInfo.createTime }}</span>

+ 1 - 1
pages/knowledge/knowledge.vue

@@ -93,7 +93,7 @@
 				}
 				list(params).then(res => {
 					if (res.code == 200) {
-						this.dataSource = res.rows
+						this.dataSource = [...this.dataSource, ...res.rows]
 						this.total = res.total
 					}
 				})

+ 1 - 1
pages/lifeServices/lifeServices.vue

@@ -96,7 +96,7 @@
 				}
 				list(params).then(res => {
 					if (res.code == 200) {
-						this.dataSource = res.rows
+						this.dataSource = [...this.dataSource, ...res.rows]
 						this.total = res.total
 					}
 				})

+ 1 - 1
pages/liveBroadcast/liveBroadcast.vue

@@ -96,7 +96,7 @@
 				}
 				list(params).then(res => {
 					if (res.code == 200) {
-						this.dataSource = res.rows
+						this.dataSource = [...this.dataSource, ...res.rows]
 						this.total = res.total
 					}
 				})

+ 9 - 6
pages/matterAll/matterAll.vue

@@ -3,7 +3,7 @@
 		<!-- <uni-list>
 			<uni-list-item  :title="item.title" v-for="(item,index) in dataList" @click="onclick(item)"></uni-list-item>
 		</uni-list> -->
-		
+
 		<view class="list" @tap.stop="onclick(item)" v-for="(item, index) in dataList" :key="item.id">
 		    <span class="listTitle">{{ item.title }}</span>
 			<view class="jlSj">
@@ -12,7 +12,7 @@
 			         <!-- <em class="iconfont icon-jifen"></em> -->
 			     </span>
 			   <!-- <view class="ck">
-			        
+
 			         <span>
 			             <em class="iconfont icon-chakan"></em>
 			             {{ item.watchNum }}
@@ -24,7 +24,7 @@
 			     </view> -->
 			 </view>
 		</view>
-		 
+
 	</view>
 </template>
 
@@ -66,7 +66,10 @@
 		},
 		methods: {
 			onclick(data){//点击详情
-				
+				uni.setStorageSync('id', data.id);
+				uni.navigateTo({
+				    url: '/pages/gridQuery/mattercontent',
+				});
 			},
 			getMatters() {
 				let _that = this
@@ -92,6 +95,6 @@
 	}
 }
 .not-favorite{
-	
+
 }
-</style>
+</style>

+ 5 - 2
pages/myPayKnow/informationDetail.vue

@@ -23,7 +23,7 @@
                     <!-- 图片轮播 -->
                     <swiper :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration" :circular="circular">
                         <block v-for="(one, index) in detailInfo.urls" :key="index">
-                            <swiper-item><image :src="loadImgSrc(one)"  style="background-size: 100% 100%;"></image></swiper-item>
+                            <swiper-item><image :src="loadImgSrcLocalhost(one)"  style="background-size: 100% 100%;"></image></swiper-item>
                         </block>
                     </swiper>
                 </view>
@@ -76,7 +76,10 @@ export default {
      * 生命周期函数--监听页面加载
      */,
     onLoad(options) {
-		 this.detailInfo = JSON.parse(options.obj)
+		const {
+				obj = {}
+			} = options;
+			this.detailInfo = JSON.parse(decodeURIComponent(obj));
 	  },
     /**
      * 生命周期函数--监听页面初次渲染完成

+ 11 - 2
pages/myPayKnow/myPayKnow.vue

@@ -67,6 +67,13 @@ export default {
 	   this.wb = [];
 	   this.getlist()
 	 },
+	 // 下拉刷新
+	 onPullDownRefresh() {
+	 	setTimeout(() => {
+	 		this.query.pageNum = 1;
+	 		this.wb = [];this.getlist()
+	 	},500)
+	 },
     onLoad(options) {
 		// this.query.createId = getApp().globalData.userId
 		this.query.createId = '1763382026214764546'
@@ -77,8 +84,10 @@ export default {
 			myPayKnow(this.query).then(res=>{
 				this.wb = [...this.wb,...res.rows]
 				this.total = res.total
+				uni.showToast({
+					title:`加载成功`
+				})
 			})
-			uni.stopPullDownRefresh();
 		},
         goSanNong() {
             uni.navigateTo({
@@ -89,7 +98,7 @@ export default {
         goDetails(item) {
 			if(item==null) return;
             uni.navigateTo({
-                url: '/pages/myPayKnow/informationDetail?obj='+ JSON.stringify(item)
+                url: '/pages/myPayKnow/informationDetail?obj='+ encodeURIComponent(JSON.stringify(item))
             });
         }
     }

+ 34 - 15
pages/toGovernmentList/toGovernmentList.vue

@@ -11,7 +11,7 @@
 				  v-model="value"
 				  placeholder="请选择排序"
 				  :localdata="range"
-				  @change="getList(value)"
+				  @change="getList(value,'加载',1)"
 			></uni-data-select>
 		</view>
 	    <view class="rnwdList">
@@ -20,16 +20,16 @@
 	            <span class="listTitle">{{ item.titleName }}</span>
 
 	            <view class="onePic" v-if="item.top != 1  ? item.urls.length == 1 : false ">
-	                <image :src="loadImgSrc(item.urls[index2])" v-for="(v, index2) in item.urls" :key="index2">
+	                <image :src="loadImgSrcLocalhost(item.urls[index2])" v-for="(v, index2) in item.urls" :key="index2">
 					</image>
 	            </view>
 	            <view class="twoPic" v-if="item.top != 1 ? item.urls.length == 2 : false">
-	                <image :src="loadImgSrc(item.urls[index2])" v-for="(v, index2) in item.urls" :key="index2">
+	                <image :src="loadImgSrcLocalhost(item.urls[index2])" v-for="(v, index2) in item.urls" :key="index2">
 					</image>
 	            </view>
 
 	            <view class="threePic" v-if="item.top != 1 ? item.urls.length == 3 : false">
-	                <image :src="loadImgSrc(item.urls[index2])" v-for="(v, index2) in item.urls" :key="index2">
+	                <image :src="loadImgSrcLocalhost(item.urls[index2])" v-for="(v, index2) in item.urls" :key="index2">
 					</image>
 	            </view>
 
@@ -91,6 +91,15 @@ export default {
 	created(){
 
 	},
+	// 下拉刷新
+	onPullDownRefresh() {
+		setTimeout(() => {
+			this.listParams.pageNum = 1;
+			this.qbwd = [];
+			let result = this.getList(this.listParams.flag,'刷新')
+		},500)
+	},
+	// 上拉加载
 	onReachBottom(){
 		let pageNum = this.listParams.pageNum
 		let pageSize = this.listParams.pageSize
@@ -102,7 +111,7 @@ export default {
 			return
 		} else {
 			this.listParams.pageNum += 1;
-			this.getList()
+			let result = this.getList(this.listParams.flag,'刷新')
 		}
 	},
 	methods:{
@@ -117,7 +126,7 @@ export default {
 			if(this.favoriteList.includes(e.id)) return
 			likeServer({
 				id:e.id,
-				type:12
+				type:10
 			}).then(e => {
 			})
 			this.favoriteList.push(e.id)
@@ -143,14 +152,29 @@ export default {
 		},
 		search(){
 			this.listParams.titleName = this.searchValue
-			this.getList()
+			this.listParams.pageNum=1
+			listWxs(this.listParams).then(res => {
+				this.qbwd = res.rows
+				this.total = res.total
+				uni.showToast({
+					title:`加载成功`
+				})
+			})
 		},
-		getList(val = null){
+		getList(val = null,toastVal = '加载',clear){
+			if(clear==1){this.listParams.pageNum=1}
 			this.listParams.flag = val || ''
-			this.qbwd = this.topList
 			listWxs(this.listParams).then(res => {
-				this.qbwd = [...this.qbwd,...res.rows]
+				if(this.listParams.pageNum==1){
+					this.qbwd = [...this.topList,...res.rows]
+				}
+				else{
+					this.qbwd = [...this.qbwd,...res.rows]
+				}
 				this.total = res.total
+				uni.showToast({
+					title:`${toastVal}成功`
+				})
 			})
 		},
 		goDetails(e) {
@@ -183,7 +207,6 @@ export default {
         isTop:1
       }).then(e => {
         this.topList = e.data
-        this.qbwd = this.topList
         this.getList()
       })
 	},
@@ -204,10 +227,6 @@ export default {
      */
     onUnload() {},
     /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh() {},
-    /**
      * 用户点击右上角分享
      */
     onShareAppMessage() {},