lidongyu 1 年之前
父节点
当前提交
43c4608d5a

+ 24 - 6
pages.json

@@ -126,8 +126,8 @@
 				"backgroundTextStyle": "dark",
 				"pullToRefresh": {
 					"support": true,
-					"color": "#000000", 	
-					"style": "circle" 	
+					"color": "#000000",
+					"style": "circle"
 				},
 				"navigationBarTitleText": "资讯"
 			}
@@ -163,8 +163,8 @@
 				"backgroundTextStyle": "dark",
 				"pullToRefresh": {
 					"support": true,
-					"color": "#000000", 	
-					"style": "circle" 	
+					"color": "#000000",
+					"style": "circle"
 				}
 			}
 		},
@@ -337,8 +337,8 @@
 				"backgroundTextStyle": "dark",
 				"pullToRefresh": {
 					"support": true,
-					"color": "#000000", 	
-					"style": "circle" 	
+					"color": "#000000",
+					"style": "circle"
 				},
 				"navigationBarTitleText": "法律下乡"
 
@@ -545,6 +545,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>

+ 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>