Jelajahi Sumber

网格展示和详情

lidongyu 1 tahun lalu
induk
melakukan
647ea1b9be

+ 44 - 0
api/handleAffairs/gridType.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 根据字典类型查询字典数据信息
+export function getList(query) {
+  return request({
+    url: '/jnb/gridType/list',
+    method: 'get',
+	params:query
+  })
+}
+
+// 查询网格类型配置详细
+export function getGridType(id) {
+  return request({
+    url: '/jnb/gridType/' + id,
+    method: 'get'
+  })
+}
+
+// 新增网格类型配置
+export function addGridType(data) {
+  return request({
+    url: '/jnb/gridType',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改网格类型配置
+export function updateGridType(data) {
+  return request({
+    url: '/jnb/gridType',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除网格类型配置
+export function delGridType(id) {
+  return request({
+    url: '/jnb/gridType/' + id,
+    method: 'delete'
+  })
+}

+ 0 - 10
api/handleAffairs/handleAffairs.js

@@ -1,10 +0,0 @@
-import request from '@/utils/request'
-
-// 根据字典类型查询字典数据信息
-export function getList(query) {
-  return request({
-    url: '/dev-api/jnb/topicType/list',
-    method: 'get',
-	params:query
-  })
-}

+ 10 - 0
pages.json

@@ -132,6 +132,16 @@
 				"navigationBarTitleText": "主题配置类型"
 				
 			}
+		},
+		{
+			"path": "pages/gridQuery/gridQuery",
+			"style": {
+				"usingComponents": {},
+				"navigationBarBackgroundColor": "#07c160",
+				"navigationBarTextStyle": "white",
+				"navigationBarTitleText": "网格详情"
+				
+			}
 		}
 	],
 	"tabBar": {

+ 39 - 0
pages/gridQuery/gridQuery.vue

@@ -0,0 +1,39 @@
+<template>
+	<view>
+			<view >
+				<ul >
+					{{jobDescription}}
+				</ul>
+			</view>
+	</view>
+
+</template>
+
+<script>
+	import {
+		getGridType
+	} from '@/api/handleAffairs/gridType.js';
+
+	export default {
+		data() {
+			return {
+				jobDescription:'',
+			};
+		},
+		onLoad(option){
+			const _that = this
+			const id = uni.getStorageSync('id');
+			 getGridType(id).then(res =>{
+				 _that.jobDescription = res.data.jobDescription
+			 })
+		},
+		
+		methods: {
+		
+		}
+	}
+</script>
+<style scoped>
+
+</style>
+

+ 15 - 25
pages/handleAffairs/handleAffairs.vue

@@ -3,7 +3,7 @@
 			<view class="gpfwNav">
 				<ul >
 					<li v-for="(item,index) in gridtTypeLits" :key="index" >
-						<image :src="loadImgSrc(item.fileUrl)" @click="querygrid">{{item.name}}</image>
+						<image :src="'http://127.0.0.1:8080'+item.fileUrl" @click="querygrid(item)">{{item.name}}</image>
 					</li>
 					</ul>
 			</view>
@@ -14,7 +14,7 @@
 <script>
 	import {
 		getList
-	} from '@/api/handleAffairs/handleAffairs.js';
+	} from '@/api/handleAffairs/gridType.js';
 
 	export default {
 		data() {
@@ -26,33 +26,23 @@
 			this.getList();
 		},
 		methods: {
-			querygrid(){
-				console.log(1)
+			querygrid(item){
+				console.log(item)
+					uni.setStorageSync('id', item.id)
+				    uni.navigateTo({
+				        url: '/pages/gridQuery/gridQuery',
+					
+				    });
 			},
 			getList() {
 				const _that = this
-				// getList().then(res =>{
-				//  this.gridtTypeLits = res
-				//  console.log(res)
-				// });
-				uni.request({
-					url: 'http://localhost:88/dev-api/jnb/gridType/list',
-					header: {Authorization:"Bearer eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjNjNWZjYTQzLTYyN2ItNGYwMC04MGJlLWU0YjBkMjA3Y2U2ZiJ9.o0mAHq3FPNIyVk3cewMMzWdLZRAC5EG4eUNzKq2K8Gq_A9s5TUJYn0vWMzVtbdm0BnAUOrxnwvyEvNXcRj3f0w"},
-					data: {
-						yesOrNoShow: "0"
-					},
-					success(res) {
-						_that.gridtTypeLits = res.data.rows
-						// this.gridtTypeLits = res.data.rows
-
-					}
-				})
+				let query = {yesOrNoShow: "0"};
+				getList(query).then(res =>{
+				 _that.gridtTypeLits = res.rows
+				 console.log(res)
+				});
+				
 			},
-			// 	go() {
-			// 	uni.navigateTo({
-			// 		url: '/pages/themeType/themeType'
-			// 	});
-			// }
 		}
 	}
 </script>