Explorar o código

Merge remote-tracking branch 'origin/master'

wangzhe hai 1 ano
pai
achega
dfb2366fe4

+ 8 - 1
api/handleAffairs/gridType.js

@@ -25,7 +25,14 @@ export function addGridType(data) {
     data: data
   })
 }
-
+// 查询主题事项列表
+export function listMatters(query) {
+  return request({
+    url: '/system/matter/list',
+    method: 'get',
+    params: query
+  })
+}
 // 修改网格类型配置
 export function updateGridType(data) {
   return request({

+ 20 - 11
api/handleAffairs/matter.js

@@ -9,14 +9,6 @@ export function listDept(query) {
   })
 }
 // 查询事项列表
-export function listMatters(query) {
-  return request({
-    url: '/system/matter/list',
-    method: 'get',
-    params: query
-  })
-}
-// 查询事项列表
 export function getMattersAll(query) {
   return request({
     url: '/system/matter/listAll',
@@ -40,6 +32,23 @@ export function addsc(data) {
   })
 }
 
+// 查询事项列表
+export function listMatters(query) {
+  return request({
+    url: '/system/matter/list',
+    method: 'get',
+    params: query
+  })
+}
+// 新增事项
+export function scadd(data) {
+  return request({
+    url: '/system/collect/add',
+    method: 'post',
+    data: data
+  })
+}
+
 // 查询事项收藏详细
 export function collectlist(id) {
   return request({
@@ -56,10 +65,10 @@ export function getsc(id) {
   })
 }
 
-// 删除事项
+
+// 取消收藏事项
 export function delDept(id) {
   return request({
     url: '/system/collect/delete/' + id,
     method: 'delete'
-  })}
-
+  })}

+ 3 - 3
pages/gridQuery/mattercontent.vue

@@ -9,6 +9,7 @@
 
 					<h3>{{matterlist.title }}</h3>
 				    <p>{{ matterlist.content }}</p>
+					<image class="uni-header-image" :src="'http://127.0.0.1:8080'+matterlist.picture"></image>
 					   <button @click="toggleFavorite">{{ isFavorite ? '❤️' : '🤍' }}</button>
 				</li>
 				</ul>
@@ -22,7 +23,7 @@
 
 <script>
 	import {
-		 getDept, addsc, delDept, getsc
+		 getDept, scadd, delDept, getsc
 	} from '@/api/handleAffairs/matter.js';
 
 	export default {
@@ -37,7 +38,6 @@
 
 		},
 
-
 		methods: {
 		      getList(){
 		        const _that = this;
@@ -56,7 +56,7 @@
 		        } else {
 					const userId = getApp().globalData.userId
 					const matterId = this.matterlist.id
-		         addsc({ matterId:this.matterlist.id , userId }).then(() => {
+		         scadd({ matterId:this.matterlist.id , userId }).then(() => {
 		             this.isFavorite = true;
 		         });
 		        }

+ 67 - 13
pages/handleAffairs/handleAffairs.vue

@@ -1,6 +1,6 @@
 <template>
 
-	<view>
+	<view style="background-color:#fff ;">
 		<!-- 搜索栏 -->
 		<view class="input-view_contain">
 			<view class="input-view">
@@ -12,16 +12,15 @@
 		<!-- 网格配置列表滑动 -->
 		<view>
 			<uni-swiper-dot :info="info" :current="current" field="content" :mode="mode">
-				<swiper class="swiper-box">
+				<swiper class="swiper-box" style="height: 160rpx;">
 					<swiper-item v-for="(item ,index) in gridtType" :key="index">
 						<uni-grid :column="5" :highlight="true" :showBorder="false">
 							<uni-grid-item v-for="(dataitem,dataindex) in item" :key="dataitem.id">
 								<view>
-									<image class="uni-header-image" :src="'http://127.0.0.1:8080'+dataitem.fileUrl"
+									<image class="uni-header-image" :src="loadImgSrcLocalhost(dataitem.fileUrl)"
 										@click="querygrid(dataitem)"></image>
 									<uni-title type="h5" :title="dataitem.name" align="center"></uni-title>
 								</view>
-
 							</uni-grid-item>
 						</uni-grid>
 					</swiper-item>
@@ -41,8 +40,17 @@
 		<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 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
+					class="segmented-control-item"
+					:class="activeTab == e.label ? 'highlight' : 'not-highlight' "
+					@click="changeTab(e.label)"
+					v-for="(e,idx) in switchOption"
+					:key="idx"
+					>
+					{{ e.value }}
+				</view>
 		    </view>
 
 		    <!-- 根据选中的标签显示对应的列表 -->
@@ -70,11 +78,16 @@
 		            </ul>
 		        </view>
 		    </view>
-
+			<uni-fab ref="fab" :horizontal="right" :vertical="bottom"
+			         @fabClick="goToMatterAllPage()"/>
+			<!-- <view class="add-button" @click="goToMatterAllPage">
+					<text>+</text>
+				</view> -->
 		</view>
 
 
 	</view>
+
 </template>
 
 <script>
@@ -91,7 +104,23 @@ import { listDept,collectlist } from '@/api/handleAffairs/matter.js';
 				activeTab: 'recommend', // 默认选中推荐列表
 				recommendList: [], // 推荐列表数据
 				favoriteList: [], // 收藏列表数据
+			    userList: [], // 收藏列表数据
+			    switchOption:[
+				    {
+					    value:'常办事项',
+					    label:'recommend'
+				    },
+				    {
+					    value:'我的事',
+					    label:'favorite'
+				    }
+			    ],
 				  userList: [], // 收藏列表数据
+				  //悬浮按钮右对齐
+				  right: 'right',
+				  //悬浮按钮下对齐
+				  bottom: 'bottom',
+				  color:'#8FBC8F '
 			};
 		},
 		created() {
@@ -100,6 +129,12 @@ import { listDept,collectlist } from '@/api/handleAffairs/matter.js';
 			this.getListscolle();
 		},
 		methods: {
+			  goToMatterAllPage() {
+			        // 使用 uni-app 的路由跳转方法跳转到 matterAll 页面
+			        uni.navigateTo({
+			            url: '/pages/mattersAdd/mattersAdd'
+			        });
+			    },
 			confirm(){
 				if (!this.title.trim()) {//去除前后空格,在判断是否为空
 					return
@@ -191,8 +226,16 @@ import { listDept,collectlist } from '@/api/handleAffairs/matter.js';
 	}
 </script>
 <style scoped lang="scss">
+	.not-highlight{
+		color:#ABB7C7;
+		background-color:#fff
+	}
+	.highlight{
+		color:#0CC689;
+		background-color:#fff;
+		border-bottom: 2px solid #0CC689;
+	}
 	.uni-header-image {
-
 		width: 40px;
 		height: 40px;
 		display: block;
@@ -216,6 +259,7 @@ import { listDept,collectlist } from '@/api/handleAffairs/matter.js';
 		text-indent: 9%;
 		background-color: #F1F1F1;
 		border: none !important;
+		background-color:#fff
 	}
 	.demo-uni-row button:after{
 		border: none;
@@ -223,10 +267,11 @@ import { listDept,collectlist } from '@/api/handleAffairs/matter.js';
 	.demo-uni-row::after{
 		content: '';
 		position: absolute;
-		width: 1rpx;
-		height: 90%;
+		width: 4rpx;
+		height: 46%;
 		left: 50%;
-		top: 5%;
+		top: 33%;
+		z-index: 10;
 		margin: auto;
 		background-color: #E1E1E1;
 	}
@@ -261,14 +306,23 @@ import { listDept,collectlist } from '@/api/handleAffairs/matter.js';
 		}
 	}
 	.segmented-control {
+		width: 100%;
+		height: 8vh;
 	    display: flex;
 	    justify-content: space-around;
 	    background-color: #f0f0f0;
 	}
-
+	.rnwdList{
+		min-height: 63vh;
+		background-color: #fff;
+	}
 	.segmented-control-item {
+		width: 50%;
+		height: 100%;
+		line-height: 250%;
+		text-align: center;
 	    padding: 10px;
-	    cursor: pointer;
+		font-size: 34rpx;
 	}
 
 	.segmented-control-item.active {

+ 1 - 1
pages/matterAll/matterAll.vue

@@ -76,7 +76,7 @@
 				listMatters(_that.queryForm).then(res => {
 					_that.dataList = res.rows
 					_that.total = res.total
-					console.log(res)
+
 				})
 			}
 		}

+ 1 - 1
pages/quotations/quotations.vue

@@ -189,4 +189,4 @@ export default {
 }
 
 
-</style>
+</style>

+ 42 - 7
pages/topic/dept.vue

@@ -1,7 +1,13 @@
 <template>
 	<view>
-		<view style="height: 20%;">
-			<button v-for="(item,index) in userType" @click="onclick(item)">{{item.dictLabel}}
+		<view class="btnContain">
+			<button 
+				v-for="(item,idx) in userType" 
+				@click="onclick(item,idx)"
+				:class="idx == currentIdx ? 'highlight' : 'not-highlight'"
+				:style="idx == 0 ? 'text-align:left' : 'text-align:right'"
+				>
+				{{item.dictLabel}}
 			</button>
 		</view>
 		<view>
@@ -31,7 +37,7 @@
 			return {
 				userType: [], // 初始化用户类型为空
 				dataList: [],
-
+				currentIdx:null,
 			}
 		},
 		created() {
@@ -59,8 +65,8 @@
 				})
 				
 			},
-			onclick(row) {
-				
+			onclick(row,idx) {
+				this.currentIdx = idx
 				let data = {
 					application: row.dictValue,
 					shows: "0"
@@ -89,9 +95,38 @@
 		justify-content: center;
 		height: 100vh;
 	} */
-
+	.not-highlight{
+		color:#000;
+	}
+	.highlight{
+		color:#FF673D;
+	}
+	.btnContain{
+		position: relative;
+		width: 100%;
+		display: flex;
+		height: 20%;
+		background-color: #fff;
+		justify-content: space-between;
+	}
+	.btnContain::after{
+		content: '';
+		position: absolute;
+		width: 4rpx;
+		height: 40%;
+		left: 50%;
+		top: 30%;
+		z-index: 10;
+		margin: auto;
+		background-color: #E1E1E1;
+	}
 	button {
-		margin-bottom: 10px;
+		width: 30%;
+		border: none;
+		background-color: #fff;
+	}
+	button:after{
+		border: none;
 	}
 
 	.selected {