社区建设手机端填写

This commit is contained in:
2026-01-07 09:43:11 +08:00
parent c573620dfd
commit c153ae907f
7 changed files with 1311 additions and 2 deletions

View File

@@ -0,0 +1,398 @@
<template>
<view class="form-container">
<!-- 活动主题 -->
<view class="form-item">
<text class="label required">活动主题</text>
<input
v-model="formData.theme"
placeholder="请输入活动主题"
class="input-box"
/>
</view>
<!-- 活动概况 -->
<view class="form-item">
<text class="label required">活动概况</text>
<textarea
v-model="formData.overview"
placeholder="请输入内容"
class="textarea-box"
rows="4"
></textarea>
</view>
<!-- 参与人员类型 -->
<view class="form-item">
<text class="label required">参与人员类型</text>
<u-select
v-model="formData.participantType"
:list="participantTypeList"
mode="multiple"
placeholder="请选择参与人员类型"
border="surround"
@change="handleParticipantChange"
class="select-box"
>
<!-- 简化 slot 内容避免复杂逻辑 -->
<template #default>
<view class="selected-text">
{{ formData.participantType.length > 0
? formData.participantType.join('、')
: '请选择参与人员类型' }}
</view>
</template>
</u-select>
</view>
<!-- 主要参加人员名单 -->
<view class="form-item">
<text class="label required">主要参加人员名单</text>
<textarea
v-model="formData.participantList"
placeholder="请输入主要参加人员名单"
class="textarea-box"
rows="3"
></textarea>
</view>
<!-- 时间选择 -->
<view class="form-item">
<text class="label required">时间</text>
<uni-datetime-picker
mode="date"
v-model="formData.time"
@change="handleTimeChange"
/>
</view>
<!-- 地点 -->
<view class="form-item">
<text class="label required">地点</text>
<input
v-model="formData.address"
placeholder="请输入地点"
class="input-box"
/>
</view>
<!-- 服务学生人次步进器 -->
<view class="form-item">
<text class="label required">服务学生人次</text>
<view class="stepper-box">
<button
class="stepper-btn"
@click="handleStepperMinus"
:disabled="formData.serviceStudentNum <= 1"
>-</button>
<input
v-model="formData.serviceStudentNum"
class="stepper-input"
type="number"
/>
<button class="stepper-btn" @click="handleStepperPlus">+</button>
</view>
</view>
<!-- 活动图片上传 -->
<view class="form-item">
<text class="label required">活动图片</text>
<uni-file-picker
@select="uploadEvidence"
@delete="onDelImg"
:auto-upload="false"
limit="9"
:file-list="imageFileList"
accept="image/*"
/>
<text class="upload-tips">请上传大小不超过 0.5MB 格式为 png/jpg/jpeg 的文件</text>
</view>
<!-- 活动压缩文件上传 -->
<view class="form-item">
<text class="label required">活动压缩文件</text>
<uni-file-picker
@select="uploadCompressedFile"
@delete="onDeleteCompressedFile"
:auto-upload="false"
limit="9"
:file-list="compressedFileList"
accept=".zip,.rar,.pdf,.doc,.docx"
/>
<view class="file-list">
<view v-for="(file, index) in compressedFileList" :key="index" class="file-item">
<text class="file-name">{{ file.name }}</text>
<button class="file-action" @click="downloadFile(file)">下载</button>
<button class="file-action delete-btn" @click="onDeleteCompressedFile(index)">删除</button>
</view>
</view>
</view>
<!-- 按钮区域 -->
<view class="btn-group">
<button class="cancel-btn" @click="handleCancel">取消</button>
<button class="confirm-btn" @click="handleSubmit">确定</button>
</view>
</view>
</template>
<script>
import { OneStopCommunityConstructionAdd } from '@/api/OneStopCommunity/communityBuilding.js';
import { getAffixItems, deleteAffix, uploadFiles } from '@/api/affix.js';
export default {
data() {
return {
formData: {
theme: '', // 活动主题
overview: '', // 活动概况
participantType: [], // 参与人员类型值(数组)
participantList: '', // 主要参加人员名单
time: '', // 时间
address: '', // 地点
serviceStudentNum: 1, // 服务学生人次
imageFileList: [], // 活动图片文件列表
compressedFileList: [], // 压缩文件列表
},
participantTypeList: [
{ text: '学校领导', value: '学校领导' },
{ text: '部门/学校领导', value: '部门/学校领导' },
{ text: '辅导员', value: '辅导员' },
{ text: '专任教师', value: '专任教师' },
{ text: '行政人员', value: '行政人员' },
{ text: '其他', value: '其他' }
]
};
},
methods: {
uploadEvidence(files) {
const formData = new FormData();
files.forEach(file => {
formData.append('files', file);
});
// 调用 uploadFiles API 上传文件
uploadFiles(formData)
.then(response => {
if (response.data.code === 200) {
this.formData.imageFileList = response.data.data.map(item => ({
name: item.fileName,
url: item.url,
size: item.size,
type: item.type
}));
} else {
uni.showToast({ title: '上传失败,请重试', icon: 'none' });
}
})
.catch(error => {
console.error('上传失败:', error);
uni.showToast({ title: '网络错误,请检查连接', icon: 'none' });
});
},
uploadCompressedFile(files) {
const formData = new FormData();
files.forEach(file => {
formData.append('files', file);
});
// 调用 uploadFiles API 上传文件
uploadFiles(formData)
.then(response => {
if (response.data.code === 200) {
this.formData.compressedFileList = response.data.data.map(item => ({
name: item.fileName,
url: item.url,
size: item.size,
type: item.type
}));
} else {
uni.showToast({ title: '上传失败,请重试', icon: 'none' });
}
})
.catch(error => {
console.error('上传失败:', error);
uni.showToast({ title: '网络错误,请检查连接', icon: 'none' });
});
},
onDelImg(index) {
// 删除图片
this.formData.imageFileList.splice(index, 1);
},
onDeleteCompressedFile(index) {
// 删除压缩文件
this.formData.compressedFileList.splice(index, 1);
},
downloadFile(file) {
// 下载文件逻辑
uni.downloadFile({
url: file.url,
success: (res) => {
if (res.statusCode === 200) {
uni.saveFile({
filePath: res.tempFilePath,
success: () => {
uni.showToast({ title: '下载成功' });
}
});
}
}
});
},
handleCancel() {
// 取消操作
uni.navigateBack();
},
handleSubmit() {
// 提交表单
if (!this.formData.theme) {
uni.showToast({ title: '请输入活动主题', icon: 'none' });
return;
}
if (!this.formData.overview) {
uni.showToast({ title: '请输入活动概况', icon: 'none' });
return;
}
if (!this.formData.time) {
uni.showToast({ title: '请选择时间', icon: 'none' });
return;
}
if (!this.formData.address) {
uni.showToast({ title: '请输入地点', icon: 'none' });
return;
}
// 调用 API 提交数据
OneStopCommunityConstructionAdd(this.formData)
.then(response => {
if (response.data.code === 200) {
uni.showToast({ title: '提交成功' });
this.handleCancel(); // 提交成功后返回上一页
} else {
uni.showToast({ title: '提交失败,请重试', icon: 'none' });
}
})
.catch(error => {
console.error('提交失败:', error);
uni.showToast({ title: '网络错误,请检查连接', icon: 'none' });
});
}
}
};
</script>
<style>
.form-container {
padding: 20rpx;
background-color: #ffffff;
min-height: 100vh;
}
.form-item {
margin-bottom: 30rpx;
}
.label {
display: block;
font-size: 28rpx;
color: #333333;
margin-bottom: 10rpx;
}
.required::before {
content: '*';
color: #ff4d4f;
margin-right: 4rpx;
}
.input-box {
width: 100%;
padding: 16rpx;
border: 1px solid #e5e5e5;
border-radius: 8rpx;
font-size: 28rpx;
}
.textarea-box {
width: 100%;
padding: 16rpx;
border: 1px solid #e5e5e5;
border-radius: 8rpx;
font-size: 28rpx;
line-height: 1.5;
}
.stepper-box {
display: flex;
align-items: center;
}
.stepper-btn {
width: 60rpx;
height: 60rpx;
line-height: 60rpx;
text-align: center;
border: 1px solid #e5e5e5;
border-radius: 8rpx;
background-color: #f5f5f5;
font-size: 32rpx;
}
.stepper-input {
width: 120rpx;
height: 60rpx;
line-height: 60rpx;
text-align: center;
border-top: 1px solid #e5e5e5;
border-bottom: 1px solid #e5e5e5;
margin: 0 -1px;
font-size: 28rpx;
}
.upload-tips {
display: block;
font-size: 24rpx;
color: #999999;
margin-bottom: 10rpx;
}
.file-list {
margin-top: 10rpx;
}
.file-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10rpx 0;
border-bottom: 1px dashed #e5e5e5;
}
.file-name {
font-size: 24rpx;
color: #666666;
}
.file-action {
padding: 6rpx 12rpx;
font-size: 24rpx;
border: 1px solid #e5e5e5;
border-radius: 4rpx;
}
.delete-btn {
color: #ff4d4f;
border-color: #ff4d4f;
}
.btn-group {
display: flex;
justify-content: flex-end;
margin-top: 60rpx;
gap: 20rpx;
}
.cancel-btn {
padding: 16rpx 32rpx;
background-color: #f5f5f5;
color: #333333;
border-radius: 8rpx;
font-size: 28rpx;
}
.confirm-btn {
padding: 16rpx 32rpx;
background-color: #007aff;
color: #ffffff;
border-radius: 8rpx;
font-size: 28rpx;
}
</style>

View File

@@ -7,3 +7,11 @@ export function listOneStopCommunityConstruction(query) {
data: query
})
}
// 一站式社区模块:社区建设新增
export function OneStopCommunityConstructionAdd(data) {
return request({
url: '/staff/oneStopCommunityConstruction/add',
method: 'post',
data: data
})
}

View File

@@ -19,3 +19,93 @@ export function deleteAffix (fileId){
}
)
}
// 新增:批量上传文件
export function uploadFiles(data) {
return request({
url: '/affix/upload',
method: 'post',
data: data,
headers: {
'Content-Type': 'multipart/form-data'
}
})
}
// 新增:获取文件列表
export function getFileList(data) {
return request({
url: '/affix/list',
method: 'get',
params: data
})
}
export function downloadAll (affixId) {
let data = {affixId: affixId}
return request({
url: '/affix/downloadAll',
method: 'post',
responseType: 'arraybuffer',
data
})
}
export function commonUpload (data) {
let param = new FormData()
for (var p in data) {
param.append(p, data[p])
}
return request({
url: '/common/upload',
method: 'post',
headers: {'Content-Type':'multipart/form-data'},
data: param
})
}
export const post = (url, data) => {
data = data || {}
return request({
url: url,
method: 'post',
data
})
}
//附件上传
export function upload (data) {
let param = new FormData()
for (var p in data) {
param.append(p, data[p])
}
return request({
url: '/affix/upload',
method: 'post',
headers: {'Content-Type':'multipart/form-data'},
data: param
})
}
// 附件下载
export function download (fileId) {
let data = {id: fileId}
return request({
url: '/affix/download',
method: 'post',
responseType: 'arraybuffer',
data
})
}
// 查询附件
export function queryAffixs (affixId) {
return request({
url:'/affix/queryItems',
method: 'post',
data: {affixId: affixId}}
)
}

View File

@@ -26,6 +26,7 @@
"china-area-data": "^5.0.1",
"dompurify": "^3.2.6",
"markdown-it": "^14.1.0",
"uview-ui": "^2.0.38",
"weixin-js-sdk": "^1.6.5"
}
}

View File

@@ -1222,7 +1222,17 @@
"navigationBarBackgroundColor": "#1890FF",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/OneStopCommunity/communityBuilding/add",
"style": {
"navigationBarBackgroundColor": "#1890FF",
"enablePullDownRefresh": false,
"navigationBarTitleText": "新增社区建设",
"navigationBarTextStyle": "white"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",

View File

@@ -0,0 +1,766 @@
<template>
<view class="form-container">
<!-- 活动主题 -->
<view class="form-item">
<text class="label required">活动主题</text>
<input
v-model="formData.theme"
placeholder="请输入活动主题"
class="input-box"
/>
</view>
<!-- 活动概况 -->
<view class="form-item">
<text class="label required">活动概况</text>
<textarea
v-model="formData.overview"
placeholder="请输入内容"
class="textarea-box"
rows="4"
></textarea>
</view>
<!-- 参与人员类型 -->
<view class="form-item" @click="showParticipantModal = true">
<text class="label required">参与人员类型</text>
<view class="selected-text">
{{ formData.participantType.length > 0
? formData.participantType.join('、')
: '请选择参与人员类型' }}
</view>
<view class="picker-box">
点击选择参与人员类型
</view>
</view>
<!-- 弹出选择框 -->
<view v-if="showParticipantModal" class="modal-overlay" @click="closeParticipantModal">
<view class="modal-content" @click.stop>
<view class="popup-header">
<text class="popup-title">选择参与人员类型</text>
<view class="popup-actions">
<button class="popup-btn popup-cancel" @click="closeParticipantModal">取消</button>
<button class="popup-btn popup-confirm" @click="confirmParticipantSelection">确定</button>
</view>
</view>
<view v-for="(item, index) in participantTypeList" :key="index" class="checkbox-item" @click="toggleParticipantType(item.value)">
<view class="checkbox-wrapper">
<view
class="custom-checkbox"
:class="{ 'checkbox-checked': tempParticipantType.includes(item.value) }"
>
<text v-if="tempParticipantType.includes(item.value)" class="check-icon"></text>
</view>
<text class="checkbox-text">{{ item.text }}</text>
</view>
</view>
</view>
</view>
<!-- 主要参加人员名单 -->
<view class="form-item">
<text class="label required">主要参加人员名单</text>
<textarea
v-model="formData.participantList"
placeholder="请输入主要参加人员名单"
class="textarea-box"
rows="3"
></textarea>
</view>
<!-- 时间选择 -->
<view class="form-item">
<text class="label required">时间</text>
<uni-datetime-picker
mode="date"
v-model="formData.time"
@change="handleTimeChange"
/>
</view>
<!-- 地点 -->
<view class="form-item">
<text class="label required">地点</text>
<input
v-model="formData.address"
placeholder="请输入地点"
class="input-box"
/>
</view>
<!-- 服务学生人次步进器 -->
<view class="form-item">
<text class="label required">服务学生人次</text>
<view class="stepper-box">
<button
class="stepper-btn"
@click="handleStepperMinus"
:disabled="formData.serviceStudentNum <= 1"
>-</button>
<input
v-model="formData.serviceStudentNum"
class="stepper-input"
type="number"
/>
<button class="stepper-btn" @click="handleStepperPlus">+</button>
</view>
</view>
<!-- 活动图片上传 -->
<view class="form-img">
<text class="label required">活动图片</text>
<view class="example-body">
<uni-file-picker @select="uploadEvidence" @delete="onDelImg" :auto-upload="false"
limit="9"></uni-file-picker>
</view>
<text class="upload-tips">请上传大小不超过 0.5MB 格式为 png/jpg/jpeg 的文件</text>
</view>
<!-- 活动压缩文件上传 -->
<view class="form-item">
<text class="label required">活动压缩文件</text>
<uni-file-picker
@select="uploadCompressedFile"
@delete="onDeleteCompressedFile"
:auto-upload="false"
limit="9"
:file-list="formData.compressedFileList"
:accept="'file'"
:file-mediatype="'all'"
:list-styles="{width: '100%', height: '120rpx'}"
:del-icon="true"
/>
<view class="file-list">
<!-- <view v-for="(file, index) in formData.compressedFileList" :key="index" class="file-item">
<text class="file-name">{{ file.name }}</text>
<button class="file-action delete-btn" @click="onDeleteCompressedFile(index)">删除</button>
</view> -->
</view>
</view>
<!-- 按钮区域 -->
<view class="btn">
<button @click="handleCancel">取消</button>
<button @click="handleSubmit">确定</button>
</view>
</view>
</template>
<script>
import { OneStopCommunityConstructionAdd } from '@/api/OneStopCommunity/communityBuilding.js';
import { getAffixItems, deleteAffix, uploadFiles, download } from '@/api/affix.js';
import config from '@/config.js';
export default {
data() {
return {
formData: {
theme: '', // 活动主题
overview: '', // 活动概况
participantType: [], // 参与人员类型值(数组)
participantList: '', // 主要参加人员名单
time: '', // 时间
address: '', // 地点
serviceStudentNum: 1, // 服务学生人次
imageFileList: [], // 活动图片文件列表
compressedFileList: [], // 压缩文件列表
},
showParticipantModal: false, // 控制参与人员类型选择弹窗显示
tempParticipantType: [], // 临时存储选中的参与人员类型
participantTypeList: [
{ text: '学校领导', value: '学校领导' },
{ text: '部门/学校领导', value: '部门/学校领导' },
{ text: '辅导员', value: '辅导员' },
{ text: '专任教师', value: '专任教师' },
{ text: '行政人员', value: '行政人员' },
{ text: '其他', value: '其他' }
]
};
},
onLoad() {
// 初始化临时选择
this.tempParticipantType = [...this.formData.participantType];
},
mounted() {
// 确保初始状态下临时选择与实际选择同步
this.tempParticipantType = [...this.formData.participantType];
},
methods: {
handleParticipantChange(e) {
// 旧的方法,保留兼容性
this.tempParticipantType = e.detail.value;
},
toggleParticipantType(value) {
// 切换选中状态
const index = this.tempParticipantType.indexOf(value);
if (index > -1) {
// 如果已选中,则取消选中
this.tempParticipantType.splice(index, 1);
} else {
// 如果未选中,则添加到选中列表
this.tempParticipantType.push(value);
}
},
closeParticipantModal() {
// 关闭弹窗但不保存选择
this.showParticipantModal = false;
// 重置临时选择到之前的状态
this.tempParticipantType = [...this.formData.participantType];
},
confirmParticipantSelection() {
// 确认选择更新到formData
this.formData.participantType = [...this.tempParticipantType];
this.showParticipantModal = false;
},
handleTimeChange(value) {
this.formData.time = value;
},
handleStepperMinus() {
if (this.formData.serviceStudentNum > 1) {
this.formData.serviceStudentNum--;
}
},
handleStepperPlus() {
this.formData.serviceStudentNum++;
},
uploadEvidence(files) {
// 验证文件类型
const validExtensions = ['.png', '.jpg', '.jpeg', '.gif', '.bmp'];
const validFiles = [];
const invalidFiles = [];
for (let file of files.tempFiles) {
const fileName = file.name ? file.name.toLowerCase() : file.path.toLowerCase();
const isValidType = validExtensions.some(ext => fileName.endsWith(ext));
if (isValidType) {
validFiles.push(file);
} else {
invalidFiles.push(file.name || file.path);
}
}
if (invalidFiles.length > 0) {
uni.showToast({
title: `文件类型错误,请上传图片文件(${validExtensions.join('/')})`,
icon: 'none'
});
return;
}
// 只上传有效文件
if (validFiles.length > 0) {
// 遍历上传每个文件
validFiles.forEach(file => {
// 使用uploadFile插件上传文件
import("@/plugins/upload.js").then((module) => {
const uploadFile = module.default;
uploadFile('/common/upload', file.path).then((res) => {
try {
const response = JSON.parse(res);
if (response.code === 200) {
// 成功上传后,更新图片文件列表
// 根据/common/upload接口的实际返回数据结构处理
this.formData.imageFileList.push({
name: response.fileName,
url: response.url,
path: response.url
});
uni.showToast({ title: '图片上传成功', icon: 'success' });
} else {
uni.showToast({ title: response.msg || '上传失败', icon: 'none' });
}
} catch (e) {
console.error('解析上传响应失败:', e);
uni.showToast({ title: '响应解析失败', icon: 'none' });
}
}).catch(error => {
console.error('上传失败:', error);
uni.showToast({ title: '上传失败,请检查网络', icon: 'none' });
});
});
});
}
},
uploadCompressedFile(files) {
// 遍历上传每个文件
files.tempFiles.forEach(file => {
// 使用uploadFile插件上传文件
import("@/plugins/upload.js").then((module) => {
const uploadFile = module.default;
uploadFile('/affix/upload', file.path).then((res) => {
try {
const response = JSON.parse(res);
if (response.code === 200) {
// 成功上传后,更新压缩文件列表
// 根据affix/upload接口的实际返回数据结构处理
this.formData.compressedFileList.push({
id: response.id, // 保存返回的数字ID
name: response.trueName,
url: config.baseUrl + response.savePath, // 拼接完整URL
path: config.baseUrl + response.savePath
});
uni.showToast({ title: '文件上传成功', icon: 'success' });
} else {
uni.showToast({ title: response.msg || '上传失败', icon: 'none' });
}
} catch (e) {
console.error('解析上传响应失败:', e);
uni.showToast({ title: '响应解析失败', icon: 'none' });
}
}).catch(error => {
console.error('上传失败:', error);
uni.showToast({ title: '上传失败,请检查网络', icon: 'none' });
});
});
});
},
onDelImg(index) {
// 删除图片
this.formData.imageFileList.splice(index, 1);
},
onDeleteCompressedFile(index) {
// 删除压缩文件
this.formData.compressedFileList.splice(index, 1);
},
downloadFile(file) {
// 只允许下载压缩文件必须有id
if (!file.id) {
uni.showToast({
title: '图片文件不支持下载',
icon: 'none'
});
return;
}
// 使用API进行下载获取arraybuffer数据
download(file.id)
.then(response => {
// 将arraybuffer数据保存为临时文件
const fileName = file.name || 'downloaded_file';
const filePath = `${wx.env.USER_DATA_PATH}/${fileName}`;
// 使用微信小程序API将arraybuffer写入本地文件
const fsm = uni.getFileSystemManager();
fsm.writeFileSync(filePath, response, 'binary');
// 打开文档
uni.openDocument({
filePath: filePath,
success: (res) => {
console.log('打开文档成功', res);
uni.showToast({ title: '打开文档成功', icon: 'success' });
},
fail: (error) => {
console.error('打开文档失败:', error);
uni.showToast({ title: '无法打开文档', icon: 'none' });
}
});
})
.catch(error => {
console.error('下载失败:', error);
uni.showToast({ title: '下载失败', icon: 'none' });
});
},
handleCancel() {
// 取消操作
uni.navigateBack();
},
handleSubmit() {
// 提交表单
if (!this.formData.theme) {
uni.showToast({ title: '请输入活动主题', icon: 'none' });
return;
}
if (!this.formData.overview) {
uni.showToast({ title: '请输入活动概况', icon: 'none' });
return;
}
if (!this.formData.time) {
uni.showToast({ title: '请选择时间', icon: 'none' });
return;
}
if (!this.formData.address) {
uni.showToast({ title: '请输入地点', icon: 'none' });
return;
}
// 构建提交数据,确保字段名称和格式符合后端要求
const submitData = {
activityTheme: this.formData.theme, // 活动主题
activityProfile: this.formData.overview, // 活动概况
personnelType: Array.isArray(this.formData.participantType)
? this.formData.participantType.join(',') // 参与人员类型,转换为逗号分隔的字符串
: this.formData.participantType,
personnelList: this.formData.participantList, // 主要参加人员名单
constructTime: this.formData.time, // 时间
place: this.formData.address, // 地点
stuNumber: this.formData.serviceStudentNum, // 服务学生人次
// 处理图片文件列表,提取文件路径
activityPhoto: this.formData.imageFileList.map(file => file.url).join(','), // 活动照片使用URL
// 处理压缩文件列表,提取文件路径
activePackage: this.formData.compressedFileList.map(file => file.url).join(',') // 活动压缩文件,使用路径
};
// 调用 API 提交数据
OneStopCommunityConstructionAdd(submitData)
.then(response => {
if (response.code === 200) {
uni.showToast({ title: '提交成功' });
this.handleCancel(); // 提交成功后返回上一页
} else {
uni.showToast({ title: '提交失败,请重试', icon: 'none' });
}
})
.catch(error => {
console.error('提交失败:', error);
uni.showToast({ title: '网络错误,请检查连接', icon: 'none' });
});
}
}
};
</script>
<style scoped>
.form-container {
padding: 20rpx;
background-color: #ffffff;
min-height: 100vh;
}
.form-item {
margin-bottom: 30rpx;
}
.label {
display: block;
font-size: 28rpx;
color: #333333;
margin-bottom: 10rpx;
}
.required::before {
content: '*';
color: #ff4d4f;
margin-right: 4rpx;
}
.input-box {
width: 100%;
padding: 16rpx;
border: 1px solid #e5e5e5;
border-radius: 8rpx;
font-size: 28rpx;
color: #333333;
background-color: #ffffff;
line-height: normal;
box-sizing: border-box;
min-height: 60rpx;
}
.textarea-box {
width: 100%;
padding: 16rpx;
border: 1px solid #e5e5e5;
border-radius: 8rpx;
font-size: 28rpx;
color: #333333;
background-color: #ffffff;
line-height: 1.5;
box-sizing: border-box;
min-height: 120rpx;
}
.stepper-box {
display: flex;
align-items: center;
}
.stepper-btn {
width: 60rpx;
height: 60rpx;
line-height: 60rpx;
text-align: center;
border: 1px solid #e5e5e5;
border-radius: 8rpx;
background-color: #f5f5f5;
font-size: 32rpx;
}
.stepper-input {
width: 120rpx;
height: 60rpx;
line-height: 60rpx;
text-align: center;
border-top: 1px solid #e5e5e5;
border-bottom: 1px solid #e5e5e5;
margin: 0 -1px;
font-size: 28rpx;
color: #333333;
background-color: #ffffff;
box-sizing: border-box;
}
.example-body {
margin-top: 20rpx;
margin-bottom: 20rpx;
}
.btn {
display: flex;
justify-content: space-between;
position: fixed;
bottom: 0;
left: 0;
margin: 0 auto;
border-top: 1px solid #d6d6d6;
background: #fff;
padding: 10px;
right: 0;
}
.btn button {
width: 45%;
background-color: #4097FE;
color: white;
}
.btn button:first-child {
background-color: #fff;
color: #4097FE;
border: 1px solid #4097FE;
}
.upload-tips {
display: block;
font-size: 24rpx;
color: #999999;
margin-bottom: 10rpx;
}
.picker-box {
width: 100%;
padding: 16rpx;
border: 1px solid #e5e5e5;
border-radius: 8rpx;
font-size: 28rpx;
min-height: 60rpx;
line-height: normal;
background-color: #ffffff;
color: #333333;
box-sizing: border-box;
}
.popup-content {
background-color: #ffffff;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
overflow: hidden;
}
.popup-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 30rpx;
border-bottom: 1px solid #f0f0f0;
}
.popup-title {
font-size: 32rpx;
color: #333333;
}
.popup-actions {
display: flex;
}
.popup-btn {
padding: 10rpx 20rpx;
font-size: 28rpx;
line-height: 1;
}
.popup-cancel {
color: #666666;
background-color: transparent;
}
.popup-confirm {
color: #007aff;
background-color: transparent;
}
.checkbox-item {
display: flex;
align-items: center;
padding: 20rpx 30rpx;
border-bottom: 1px solid #f0f0f0;
}
.checkbox-item text {
margin-left: 20rpx;
font-size: 28rpx;
color: #333333;
}
.checkbox-item checkbox {
transform: scale(0.8);
}
.selected-text {
font-size: 28rpx;
color: #666666;
margin-bottom: 10rpx;
min-height: 40rpx;
line-height: 40rpx;
}
.checkbox-group-container {
width: 100%;
}
.file-list {
margin-top: 10rpx;
}
.file-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10rpx 0;
border-bottom: 1px dashed #e5e5e5;
}
.file-name {
font-size: 24rpx;
color: #666666;
}
.file-action {
padding: 6rpx 12rpx;
font-size: 24rpx;
border: 1px solid #e5e5e5;
border-radius: 4rpx;
}
.delete-btn {
color: #ff4d4f;
border-color: #ff4d4f;
}
.checkbox-group-container {
margin-top: 10rpx;
}
.checkbox-item {
display: flex;
align-items: center;
padding: 20rpx 0;
border-bottom: 1px solid #f0f0f0;
}
.checkbox-text {
margin-left: 10rpx;
font-size: 28rpx;
color: #333;
}
.checkbox-wrapper {
display: flex;
align-items: center;
}
.custom-checkbox {
width: 40rpx;
height: 40rpx;
border: 2rpx solid #ccc;
border-radius: 6rpx;
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.checkbox-checked {
border-color: #007aff;
background-color: #007aff;
}
.check-icon {
color: #fff;
font-size: 24rpx;
line-height: 1;
}
.popup-content {
background-color: #fff;
padding: 20rpx;
}
.popup-header {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 20rpx;
border-bottom: 1px solid #f0f0f0;
margin-bottom: 20rpx;
}
.popup-title {
font-size: 32rpx;
font-weight: bold;
color: #333;
}
.popup-actions {
display: flex;
gap: 20rpx;
}
.popup-btn {
padding: 10rpx 20rpx;
font-size: 28rpx;
border-radius: 8rpx;
border: none;
}
.popup-cancel {
background-color: #f5f5f5;
color: #666;
}
.popup-confirm {
background-color: #007aff;
color: #fff;
}
.modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 1000;
display: flex;
justify-content: flex-end;
align-items: flex-end;
}
.modal-content {
width: 100%;
max-height: 80%;
overflow-y: auto;
background-color: #fff;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
padding: 20rpx;
transform: translateY(0);
}
.btn-group {
display: flex;
justify-content: flex-end;
margin-top: 60rpx;
gap: 20rpx;
}
.cancel-btn {
padding: 16rpx 32rpx;
background-color: #f5f5f5;
color: #333333;
border-radius: 8rpx;
font-size: 28rpx;
}
.confirm-btn {
padding: 16rpx 32rpx;
background-color: #007aff;
color: #ffffff;
border-radius: 8rpx;
font-size: 28rpx;
}
</style>

View File

@@ -4,6 +4,23 @@
<uni-search-bar @confirm="search" cancelButton="none" @clear="onClear" v-model="queryParams.activityTheme">
</uni-search-bar>
</view>
<br />
<br />
<view class="right" @tap="toAdd">
<svg t="1723014605442" class="icon" viewBox="0 0 1024 1024" version="1.1"
xmlns="http://www.w3.org/2000/svg" p-id="1215" width="60" height="60">
<path
d="M665 81v105H369V81h296m20-80H349c-33.1 0-60 26.9-60 60v145c0 33.1 26.9 60 60 60h336c33.1 0 60-26.9 60-60V61c0-33.1-26.9-60-60-60zM298.5 689c-37.2 0-67.5-30.3-67.5-67.5s30.3-67.5 67.5-67.5 67.5 30.3 67.5 67.5-30.3 67.5-67.5 67.5z m0-80c-6.9 0-12.5 5.6-12.5 12.5s5.6 12.5 12.5 12.5 12.5-5.6 12.5-12.5-5.6-12.5-12.5-12.5zM298.5 884c-37.2 0-67.5-30.3-67.5-67.5s30.3-67.5 67.5-67.5 67.5 30.3 67.5 67.5-30.3 67.5-67.5 67.5z m0-80c-6.9 0-12.5 5.6-12.5 12.5s5.6 12.5 12.5 12.5 12.5-5.6 12.5-12.5-5.6-12.5-12.5-12.5zM642 661H477c-22.1 0-40-17.9-40-40s17.9-40 40-40h165c22.1 0 40 17.9 40 40s-17.9 40-40 40zM762 859H477c-22.1 0-40-17.9-40-40s17.9-40 40-40h285c22.1 0 40 17.9 40 40s-17.9 40-40 40zM762 469H477c-22.1 0-40-17.9-40-40s17.9-40 40-40h285c22.1 0 40 17.9 40 40s-17.9 40-40 40z"
fill="#1890FF" p-id="1216"></path>
<path
d="M863 177v767H171V177h118v9c0 44.2 35.8 80 80 80h296c44.2 0 80-35.8 80-80v-9h118m20-80H665v89H369V97H151c-33.1 0-60 26.9-60 60v807c0 33.1 26.9 60 60 60h732c33.1 0 60-26.9 60-60V157c0-33.1-26.9-60-60-60z"
fill="#1890FF" p-id="1217"></path>
<path
d="M298.8 493.6c-10.2 0-20.4-3.9-28.2-11.6l-35.8-35.6c-15.7-15.6-15.8-40.9-0.2-56.6 15.6-15.7 40.9-15.8 56.6-0.2l7.6 7.6 52-51.6c15.7-15.6 41-15.5 56.6 0.2 15.6 15.7 15.5 41-0.2 56.6L327 482c-7.8 7.7-18 11.6-28.2 11.6z"
fill="#1890FF" p-id="1218"></path>
</svg>
新增
</view>
<scroll-view class="scroll-views" scroll-y="true" @scrolltolower="scrolltolower">
<view class="list">
<view v-for="(item,index) in list" :key="index" @click="detail(item)" class="box">
@@ -114,6 +131,11 @@
this.totalPages = Math.ceil(res.total / this.queryParams.pageSize);
this.topLoading = false;
}
},
toAdd() {
uni.navigateTo({
url: "/pages/OneStopCommunity/communityBuilding/add"
})
}
},
onLoad() {},
@@ -122,7 +144,7 @@
this.queryParams.pageNum = 1;
this.list = [];
this.getlist();
},
}
}
</script>
@@ -144,6 +166,20 @@
background-color: white !important;
}
}
.right {
position: fixed;
top: 40rpx;
right: 20rpx;
z-index: 11; /* 设置比.search更高的z - index */
display: flex;
align-items: center;
.icon {
width: 20px;
height: 20px;
}
}
.scroll-views {
height: calc(100vh - 10px);