Ver código fonte

Merge remote-tracking branch 'origin/master'

qinhouyu 1 ano atrás
pai
commit
a450b7aff9

+ 6 - 14
api/cooperative/cooperative.js

@@ -1,26 +1,18 @@
-import upload from '@/utils/upload'
 import request from '@/utils/request'
 
 // 查询合作社列表
-export function getCooperative(query) {
+export function getList(query) {
   return request({
-    url: '/system/cooperative/list',
+    url: '/high/server/cooperative/list',
     method: 'get',
-    params: query
-  })
-}
-export function getCooperative() {
-  return request({
-    url: '/system/user/listAll',
-    method: 'get'
+    params: {}
   })
 }
 
 // 查询合作社详情
-export function updateUserProfile(data) {
+export function getDetails(id) {
   return request({
-    url: '/system/user/profile',
-    method: 'put',
-    data: data
+    url: '/high/server/cooperative/' + id,
+    method: 'get'
   })
 }

+ 10 - 0
api/handleAffairs/gridType.js

@@ -17,6 +17,16 @@ export function getGridType(id) {
   })
 }
 
+// 查询事项列表
+export function getMattersAll(query) {//需要移动地方,暂时放这里
+  return request({
+    url: '/system/matter/listAll',
+    method: 'get',
+    params: query
+  })
+}
+
+
 // 新增网格类型配置
 export function addGridType(data) {
   return request({

+ 8 - 1
api/handleAffairs/matter.js

@@ -8,7 +8,14 @@ export function listDept(query) {
     params: query
   })
 }
-
+// 查询事项列表
+export function getMattersAll(query) {
+  return request({
+    url: '/system/matter/listAll',
+    method: 'get',
+    params: query
+  })
+}
 // 查询事项详细
 export function getDept(id) {
   return request({

+ 10 - 1
pages.json

@@ -277,7 +277,7 @@
 				"usingComponents": {},
 				"navigationBarBackgroundColor": "#07c160",
 				"navigationBarTextStyle": "white",
-				"navigationBarTitleText": "网格详情"
+				"navigationBarTitleText": ""
 
 			}
 		},
@@ -343,6 +343,15 @@
 				"navigationBarTextStyle": "white",
 				"navigationBarTitleText": "主题导航"
 			}
+		},
+		{
+			"path" : "pages/matterAll/matterAll",
+			"style": {
+				"usingComponents": {},
+				"navigationBarBackgroundColor": "#07c160",
+				"navigationBarTextStyle": "white",
+				"navigationBarTitleText": "事项列表"
+			}
 		}
 	],
 	"easycom": {

+ 22 - 27
pages/cooperative/cooperative.vue

@@ -1,16 +1,16 @@
 <template>
     <view class="container">
         <!-- 供销社列表 -->
-        <view class="rnwdList" @tap="goDetails" v-for="(item, index) in list" :key="index">
-            <view class="cooperativeImgBox">
-                <image :src="loadImgSrc('/snbj.png')" class="cooperativeImg" @tap="goDetails"></image>
+        <view class="rnwdList" v-for="(item, index) in list" :key="index">
+            <view @tap="goDetails(item.id)" class="cooperativeImgBox">
+                <image :src="loadImgSrc('/snbj.png')" class="cooperativeImg"></image>
             </view>
-            <view class="cooperativeBox">
+            <view @tap="goDetails(item.id)" class="cooperativeBox">
                 <view class="list">
                     <span class="listTitle">{{ item.name }}</span>
                     <view class="jlSj">
                         <span class="jf">
-                            {{ item.address }}
+                            {{ item.address?item.address:'' }}
                         </span>
                     </view>
                 </view>
@@ -21,30 +21,17 @@
 </template>
 
 <script>
+import { getList, getDetails } from '@/api/cooperative/cooperative';
 export default {
     data() {
         return {
             list: [
                 {
-                    name:"供销社1",
-                    address:"供销社地址1",
-                    chargePeople:"负责人1",
-                    chargePhone:"13103215236",
-                    imgUrl:"/profile/upload/2024/03/01/nacos_20240301145836A002.png"
-                },
-                {
-                    name:"供销社2",
-                    address:"供销社地址2",
-                    chargePeople:"负责人2",
-                    chargePhone:"09876543210",
-                    imgUrl:"/profile/upload/2024/03/01/nacos_20240301145836A002.png"
-                },
-                {
-                    name:"供销社3",
-                    address:"供销社地址3",
-                    chargePeople:"负责人3",
-                    chargePhone:"12345678910",
-                    imgUrl:"/profile/upload/2024/03/01/nacos_20240301145836A002.png"
+                    name:"-",
+                    address:"-",
+                    chargePeople:"-",
+                    chargePhone:"-",
+                    imgUrl:"-"
                 }
             ],
         };
@@ -53,12 +40,20 @@ export default {
      * 生命周期函数--监听页面加载
      */,
     onLoad(options) {
-
+        this.getList();
     },
     methods: {
-        goDetails() {
+        /** 查询列表 */
+        getList(type) {
+            this.loading = true;
+            getList().then(response => {
+                this.list = response.rows;
+            });
+        },
+        /** 查询详情 */
+        goDetails(id) {
             uni.navigateTo({
-                url: '/pages/cooperative/details'
+                url: '/pages/cooperative/details?id='+id
             });
         }
     }

+ 24 - 11
pages/cooperative/details.vue

@@ -10,7 +10,7 @@
                     {{ item.title }}:
                 </span>
                 <span>
-                    {{ item.content }}
+                    {{ item.content?item.content:'' }}
                 </span>
             </view>
         </view>
@@ -18,31 +18,32 @@
 </template>
 
 <script>
-export default {
+    import { getDetails } from '@/api/cooperative/cooperative';
+    export default {
     data() {
         return {
             list: [
                 {
                     title: "名称",
-                    content: "第十三号供销社",
+                    content: "-",
                 },
                 {
                     title: "地址",
-                    content: "十三号街区地下研究所",
+                    content: "-",
                 },
                 {
                     title: "负责人",
-                    content: "高耀",
+                    content: "-",
                 },
                 {
                     title: "负责人电话",
-                    content: "13178945612",
+                    content: "-",
                 }
             ],
             cooperative: {
-                name:"供销社1",
-                address:"供销社地址1",
-                chargePeople:"负责人1",
+                name:"第十三号供销社",
+                address:"十三号街区地下研究所",
+                chargePeople:"高耀",
                 chargePhone:"13103215236",
                 imgUrl:"/profile/upload/2024/03/01/nacos_20240301145836A002.png"
             }
@@ -52,10 +53,22 @@ export default {
      * 生命周期函数--监听页面加载
      */,
     onLoad(options) {
-        console.log(666)
+        this.getDetails(options.id);
     },
     methods: {
-
+        /** 详情 */
+        getDetails(id) {
+            getDetails(id).then(response => {
+                let details = response.data;
+                console.log(response.data)
+                let list = [];
+                list.push({ title:"名称", content:details.name });
+                list.push({ title:"地址", content:details.address });
+                list.push({ title:"负责人", content:details.chargePeople });
+                list.push({ title:"负责人电话", content:details.chargePhone });
+                this.list = list;
+            });
+        },
     }
 };
 </script>

+ 5 - 0
pages/gridQuery/gridQuery.vue

@@ -20,7 +20,12 @@
 				jobDescription:'',
 			};
 		},
+		
 		onLoad(option){
+			    uni.setNavigationBarTitle({
+			      title: option.titleText
+			    });
+			  
 			const _that = this
 			const id = uni.getStorageSync('id');
 			console.log(id)

+ 15 - 5
pages/handleAffairs/handleAffairs.vue

@@ -3,8 +3,8 @@
 	<view>
 		<!-- 搜索栏 -->
 		<view class="input-view">
-			<input confirm-type="search" class="nav-bar-input" type="text" placeholder="输入搜索关键词" @confirm="confirm" />
-			<uni-icons class="input-uni-icon" type="search" size="18" color="#999" />
+			<uni-icons type="search" size="20" class="search-icon" @tap="confirm"></uni-icons>
+			<input confirm-type="search" class="nav-bar-input" type="text" placeholder="输入搜索关键词" @confirm="confirm" v-model="title"/>
 		</view>
 		<!-- 网格配置列表滑动 -->
 		<view>
@@ -56,6 +56,7 @@
 	export default {
 		data() {
 			return {
+				title:"",
 				gridtType: [], //是一个list<map>数据 [{0,[1,2,3]}]
 			};
 		},
@@ -63,9 +64,18 @@
 			this.getList();
 		},
 		methods: {
+			confirm(){
+				if (!this.title.trim()) {//去除前后空格,在判断是否为空
+					return 
+				}
+				console.log(this.title)
+				uni.setStorageSync('data', {title:this.title})
+				uni.navigateTo({
+					url: '/pages/matterAll/matterAll',
+				});
+			},
 			//主题导航跳转
 			topic(){
-
 				uni.navigateTo({
 					url: '/pages/topic/topic',
 				});
@@ -78,8 +88,8 @@
 				console.log(item)
 				uni.setStorageSync('id', item.id)
 				uni.navigateTo({
-					url: '/pages/gridQuery/gridQuery',
-
+					url: '/pages/gridQuery/gridQuery?titleText='+item.name
+					 
 				});
 			},
 			getList() {

+ 41 - 0
pages/matterAll/matterAll.vue

@@ -0,0 +1,41 @@
+<template>
+	<view>
+		<uni-list>
+			<uni-list-item  :title="item.title" v-for="(item,index) in dataList"></uni-list-item>
+		</uni-list>
+	</view>
+</template>
+
+<script>
+	import {
+		getMattersAll
+	} from "@/api/handleAffairs/matter.js"
+	export default {
+		data() {
+			return {
+				dataList: [],
+			};
+		},
+		created() {
+
+		},
+		onLoad(option) {
+			const data = uni.getStorageSync('data');
+			this.getMatters(data)
+		},
+		methods: {
+
+			getMatters(data) {
+				let _that = this
+				getMattersAll(data).then(res => {
+					_that.dataList = res.data
+					console.log(_that.dataList)
+				})
+			}
+		}
+	}
+</script>
+
+<style>
+
+</style>