| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988 |
- <template>
- <view class="container">
-
- <scroll-view class="content" scroll-y>
- <!-- 标题 -->
- <view class="form-section">
- <view class="form-label">
- <text class="required">*</text>
- <text>标题</text>
- </view>
- <view class="form-input-wrapper">
- <textarea
- class="form-input"
- style="height: 100rpx;"
- v-model="formData.title"
- placeholder="请输入标题"
- maxlength="50"
- @input="onTitleInput"
- ></textarea>
- <view class="char-count">{{ titleLength }}/50</view>
- </view>
- </view>
-
- <!-- 摘要 -->
- <view class="form-section">
- <view class="form-label">
- <text>摘要 (选填)</text>
- </view>
- <view class="form-input-wrapper">
- <textarea
- class="form-input"
- v-model="formData.summary"
- placeholder="请输入摘要"
- maxlength="100"
- @input="onSummaryInput"
- ></textarea>
- <view class="char-count">{{ summaryLength }}/100</view>
- </view>
- </view>
-
- <!-- 项目分组 -->
- <view class="form-section">
- <view class="form-label">
- <text class="required">*</text>
- <text>项目分组</text>
- </view>
- <view class="form-select" @click="showGroupPicker = true">
- <text :class="formData.groupId ? '' : 'placeholder'">
- {{ formData.groupName || '请选择分组' }}
- </text>
- <text class="arrow-right">></text>
- </view>
- </view>
-
- <!-- 项目标签 -->
- <view class="form-section">
- <view class="form-label">
- <text class="required">*</text>
- <text>项目标签</text>
- </view>
- <view class="form-select" @click="showTagPicker = true">
- <text :class="formData.tagId ? '' : 'placeholder'">
- {{ formData.tagName || '请选择标签' }}
- </text>
- <text class="arrow-right">></text>
- </view>
- </view>
-
- <!-- 上传封面 -->
- <view class="form-section">
- <view class="form-label">
- <text class="required">*</text>
- <text>上传封面</text>
- </view>
- <view class="form-tips">仅支持jpg/png文件,单个图片不超过2M</view>
- <view class="upload-cover" @click="chooseCoverImage">
- <image class="img" v-if="formData.coverImage" :src="formData.coverImage" mode=""></image>
- <view v-else class="upload-placeholder">
- <image class="w48 h48" src="@/static/image/icon_camera1.png" mode=""></image>
- </view>
- </view>
- </view>
- <!-- 上传进度弹窗 -->
- <view class="upload-modal" v-if="showUploadModal">
- <view class="upload-modal-content">
- <view class="upload-modal-title">文件上传中</view>
- <view class="upload-progress-wrapper">
- <progress :percent="percent" stroke-width="8" show-info activeColor="#4CAF50" border-radius="10"></progress>
- </view>
- <view class="upload-modal-tips">请勿关闭页面</view>
- </view>
- </view>
- <!-- 上传附件 -->
- <view class="form-section">
- <view class="form-label">
- <text class="required">*</text>
- <text>上传附件</text>
- </view>
- <view v-if="taskType==4" class="form-tips">支持PDF等文件,单个文件不超过2M</view>
- <view v-else class="form-tips">支持MP4等文件,单个文件不超过500M</view>
- <view class="attachment-list">
- <view class="attachment-item" v-for="(item, index) in formData.attachments" :key="index">
- <text class="attachment-icon"></text>
- <view class="attachment-info" style="width: 90%;">
- <text class="attachment-name one-t" style="width: 90%;">{{ item.name }}</text>
- <text class="attachment-size">{{ item.size }}</text>
- </view>
- <text class="attachment-delete" @click="removeAttachment(index)">×</text>
- </view>
- <view class="add-attachment" @click="chooseAttachment">
- <text class="add-icon">+</text>
- <text>添加附件</text>
- </view>
- </view>
- </view>
- </scroll-view>
-
- <!-- 提交按钮 -->
- <view class="submit-box">
- <view class="submit-btn" @click="handleSubmit">提交</view>
- </view>
-
-
- <!-- 分组选择弹窗 -->
- <view class="picker-popup" v-if="showGroupPicker" @click="showGroupPicker = false">
- <view class="picker-content" @click.stop>
- <view class="picker-header">
- <view class="picker-cancel" @click="showGroupPicker = false">取消</view>
- <view class="picker-title">选择分组</view>
- <view class="picker-confirm" @click="confirmGroup">确定</view>
- </view>
- <view class="picker-body">
- <view class="picker-item"
- :class="{ active: tempGroupId === item.id }"
- v-for="(item, index) in groupOptions"
- :key="index"
- @click="tempGroupId = item.id; tempGroupName = item.projectName">
- {{ item.projectName }}
- </view>
- </view>
- </view>
- </view>
-
- <!-- 标签选择弹窗 -->
- <view class="picker-popup" v-if="showTagPicker" @click="showTagPicker = false">
- <view class="picker-content" @click.stop>
- <view class="picker-header">
- <view class="picker-cancel" @click="showTagPicker = false">取消</view>
- <view class="picker-title">选择标签</view>
- <view class="picker-confirm" @click="confirmTag">确定</view>
- </view>
- <view class="picker-body">
- <view class="picker-item"
- :class="{ active: tempTagId === item.dictValue }"
- v-for="(item, index) in tagOptions"
- :key="index"
- @click="tempTagId = item.dictValue; tempTagName = item.dictLabel">
- {{ item.dictLabel }}
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import { submitTask, getGroupOptions, getTagOptions } from '@/api/airClassroom'
- import { deleteFile, deleteBatch, checkFast, complete,postPolicy} from '@/api/common.js'
- export default {
- data() {
- return {
- percent: 0,
- showUploadModal: false, // 控制上传进度弹窗显示
- statusBarHeight: uni.getSystemInfoSync().statusBarHeight + 'px',
- taskId: '',
- taskType:null,
- isEdit: false,
- showGroupPicker: false,
- showTagPicker: false,
- tempGroupId: '',
- tempGroupName: '',
- tempTagId: '',
- tempTagName: '',
- formData: {
- title: '',
- summary: '',
- groupId: '',
- groupName: '',
- tagId: '',
- tagName: '',
- coverImage: '',
- attachments: []
- },
- groupOptions: [
- // { id: '1', name: '学术' },
- // { id: '2', name: '临床' },
- // { id: '3', name: '科研' }
- ],
- tagOptions: [
- // { id: '1', name: '长视频' },
- // { id: '2', name: '短视频' },
- // { id: '3', name: '文章' }
- ]
- }
- },
- computed: {
- titleLength() {
- return this.formData.title.length
- },
- summaryLength() {
- return this.formData.summary.length
- }
- },
- onLoad(options) {
- if (options.id) {
- this.taskId = options.id
- this.taskType = options.taskType
- }
- if (options.edit === 'true') {
- this.isEdit = true
- this.loadTaskData()
- }
- this.loadOptions()
- },
- methods: {
- goBack() {
- uni.navigateBack()
- },
- onTitleInput(e) {
- this.formData.title = e.detail.value
- },
- onSummaryInput(e) {
- this.formData.summary = e.detail.value
- },
- confirmGroup() {
- this.formData.groupId = this.tempGroupId
- this.formData.groupName = this.tempGroupName
- this.showGroupPicker = false
- },
- confirmTag() {
- this.formData.tagId = this.tempTagId
- this.formData.tagName = this.tempTagName
- this.showTagPicker = false
- },
- chooseCoverImage() {
- uni.chooseImage({
- count: 1,
- sizeType: ['compressed'],
- sourceType: ['album', 'camera'],
- success: (res) => {
- uni.showLoading({ title: '上传中...' })
- console.log('图片路径',res)
- const filePath = res.tempFilePaths[0]
- const requestPath = uni.getStorageSync('requestPath')
- const uploadTask = uni.uploadFile({
- url: `${requestPath}/app/common/uploadOSS`,
- filePath: filePath,
- name: 'file',
- formData: {},
- success: (uploadRes) => {
- uni.hideLoading()
- try {
- const result = typeof uploadRes.data === 'string' ? JSON.parse(uploadRes.data) : uploadRes.data
- if (result.code == 200) {
- this.formData.coverImage = result.url
- uni.showToast({ icon: 'success', title: '上传成功' })
- } else {
- uni.showToast({ icon: 'none', title: result.msg || '上传失败' })
- }
- } catch (e) {
- uni.hideLoading()
- console.error('解析上传结果失败', e)
- uni.showToast({ icon: 'none', title: '上传失败' })
- }
- },
- fail: (err) => {
- // this.percent = 0;
- console.error('上传失败', err)
- uni.showToast({ icon: 'none', title: '上传失败' })
- }
- })
- }
- })
- },
- chooseAttachment(){
- var vm = this;
-
- // 对更多字符编码的 url encode 格式
- var camSafeUrlEncode = function (str) {
- return encodeURIComponent(str)
- .replace(/!/g, '%21')
- .replace(/'/g, '%27')
- .replace(/\(/g, '%28')
- .replace(/\)/g, '%29')
- .replace(/\*/g, '%2A');
- };
- const requestPath = uni.getStorageSync('requestPath')
- // 获取上传路径、上传凭证
- var getUploadInfo = function (extName, callback) {
- // 传入文件后缀,让后端生成随机的 COS 对象路径,并返回上传域名、PostObject 接口要用的 policy 签名
- // 参考服务端示例:https://github.com/tencentyun/cos-demo/tree/main/server/post-policy
- uni.request({
- url: `${requestPath}/app/upload/post-policy?ext=` + extName,
- success: (res) => {
- // 确认返回格式是否正确
- //console.log(res);
- callback && callback(null, res.data);
- },
- error(err) {
- callback && callback(err);
- },
- });
- };
-
- // 发起上传请求,上传使用 PostObject 接口,使用 policy 签名保护
- // 接口文档:https://cloud.tencent.com/document/product/436/14690#.E7.AD.BE.E5.90.8D.E4.BF.9D.E6.8A.A4
- var uploadFile = function (opt, callback) {
- console.log("上传参数", opt);
- // 构建表单数据(字段名必须使用带连字符的格式,符合腾讯云 PostObject 接口要求)
- var formData = {
- key: opt.data.key, // 文件路径(必须是 key,不是 cosKey)
- policy: opt.data.policy, // policy 的 base64 字符串
- success_action_status: '200', // 成功状态码
- 'q-sign-algorithm': opt.data.qsignAlgorithm,// 签名算法(必须是 q-sign-algorithm)
- 'q-ak': opt.data.qak,
- 'q-key-time': opt.data.qkeyTime, // 密钥有效时间(必须是 q-key-time)
- 'q-signature': opt.data.qsignature // 签名(必须是 q-signature)
- };
-
- // 如果服务端用了临时密钥计算,需要传 x-cos-security-token
- if (opt.data.securityToken) {
- formData['x-cos-security-token'] = opt.data.securityToken;
- }
-
-
- console.log("上传URL", opt.data.url);
- console.log("文件路径", opt.filePath);
-
- // 显示上传进度弹窗
- vm.showUploadModal = true;
- vm.percent = 0;
-
- const uploadTask=uni.uploadFile({
- url: opt.data.url, // COS 上传域名
- filePath: opt.filePath, // 文件路径(不在 formData 中)
- name: 'file', // 文件字段名
- formData: formData, // 表单数据
- success: (res) => {
- console.log("上传响应", res);
- // 关闭上传进度弹窗
- vm.showUploadModal = false;
- vm.percent = 0;
-
- if (![200, 204].includes(res.statusCode)) {
- console.error("上传失败,状态码:", res.statusCode, res);
- return callback && callback(res);
- }
- // 构建文件访问 URL
- var fileUrl = opt.data.url + '/' + camSafeUrlEncode(opt.data.key).replace(/%2F/g, '/');
- console.log("上传成功,文件URL:", fileUrl);
- callback && callback(null, fileUrl);
- },
- fail: (err) => {
- console.error("上传失败", err);
- // 关闭上传进度弹窗
- vm.showUploadModal = false;
- vm.percent = 0;
- callback && callback(err);
- }
- });
- uploadTask.onProgressUpdate(function(res) {
- vm.percent = res.progress;
- });
- };
-
- // 根据 taskType 选择不同的文件类型
- // taskType = 4(科普文章):上传普通文档文件
- // taskType = 5 或 6:上传视频文件
-
- var taskType = vm.taskType;
- console.log('当前 taskType:', taskType);
-
- // taskType = 5 或 6,选择视频文件
- if (taskType == 5 || taskType == 6) {
- // 选择视频文件
- wx.chooseMessageFile({
- count: 3,
- type: 'video',
- success: (chooseRes) => {
- console.log('选择视频', chooseRes);
- var filePath = chooseRes.tempFiles[0].path;
- var size = chooseRes.tempFiles[0].size;
- var name = chooseRes.tempFiles[0].name;
- var lastIndex = filePath.lastIndexOf('.');
- var extName = lastIndex > -1 ? filePath.slice(lastIndex + 1) : '';
- // 获取预上传用的域名、路径、凭证
- getUploadInfo(extName, function (err, info) {
- if (err) {
- console.error('获取上传信息失败', err);
- uni.showToast({ icon: 'none', title: '获取上传信息失败' });
- return;
- }
- console.log("上传信息", info);
- info.filePath = filePath;
- // 上传文件
- uploadFile(info, function (err, fileUrl) {
- if (err) {
- console.error('上传失败', err);
- uni.showToast({ icon: 'none', title: '上传失败' });
- return;
- }
- console.log('上传成功,文件URL:', fileUrl);
- // 添加到附件列表
- vm.formData.attachments.push({
- name:name,
- size: vm.formatFileSize(size || 0),
- url: fileUrl
- });
- uni.showToast({ icon: 'success', title: '上传成功' });
- });
- });
- },
- fail: (err) => {
- if (err.errMsg && !err.errMsg.includes('cancel')) {
- console.error('选择视频失败', err);
- uni.showToast({ icon: 'none', title: '选择视频失败' });
- }
- }
- });
- return;
- }else{
- wx.chooseMessageFile({
- count: 1,
- type: 'file', // 选择文档文件(不包括视频和图片)
- success: (res) => {
- console.log('文档路径',res)
- const filePath = res.tempFiles[0].path
- const fileName = res.tempFiles[0].name
- const size = res.tempFiles[0].size;
- const requestPath = uni.getStorageSync('requestPath')
-
- // 显示上传进度弹窗
- vm.showUploadModal = true;
- vm.percent = 0;
-
- const uploadTask = uni.uploadFile({
- url: `${requestPath}/app/common/uploadOSS`,
- filePath: filePath,
- name: 'file',
- formData: {},
- success: (uploadRes) => {
- // 关闭上传进度弹窗
- vm.showUploadModal = false;
- vm.percent = 0;
-
- try {
- const result = typeof uploadRes.data === 'string' ? JSON.parse(uploadRes.data) : uploadRes.data
- if (result.code == 200) {
- //this.formData.attachmentUrl = result.url
- vm.formData.attachments.push({
- name:fileName,
- size: vm.formatFileSize(size || 0),
- url: result.url
- });
- uni.showToast({ icon: 'success', title: '上传成功' })
- } else {
- uni.showToast({ icon: 'none', title: result.msg || '上传失败' })
- }
- } catch (e) {
- console.error('解析上传结果失败', e)
- uni.showToast({ icon: 'none', title: '上传失败' })
- }
- },
- fail: (err) => {
- // 关闭上传进度弹窗
- vm.showUploadModal = false;
- vm.percent = 0;
- console.error('上传失败', err)
- uni.showToast({ icon: 'none', title: '上传失败' })
- }
- })
-
- // 监听上传进度
- uploadTask.onProgressUpdate(function(res) {
- vm.percent = res.progress;
- })
- },
- fail: (err) => {
- if (err.errMsg && !err.errMsg.includes('cancel')) {
- console.error('选择文档失败', err);
- uni.showToast({ icon: 'none', title: '选择文档失败' });
- }
- }
- });
- }
- },
- removeAttachment(index) {
- this.formData.attachments.splice(index, 1)
- },
- formatFileSize(bytes) {
- if (bytes < 1024) return bytes + 'B'
- if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(2) + 'KB'
- return (bytes / (1024 * 1024)).toFixed(2) + 'MB'
- },
- // 根据文件扩展名获取文件类型
- getFileType(fileExt) {
- const typeMap = {
- // 视频
- 'mp4': 'video',
- 'avi': 'video',
- 'mov': 'video',
- 'wmv': 'video',
- 'flv': 'video',
- 'mkv': 'video',
- // 音频
- 'mp3': 'audio',
- 'wav': 'audio',
- 'wma': 'audio',
- // 图片
- 'jpg': 'image',
- 'jpeg': 'image',
- 'png': 'image',
- 'gif': 'image',
- 'bmp': 'image',
- // 文档
- 'pdf': 'document',
- 'doc': 'document',
- 'docx': 'document',
- 'xls': 'document',
- 'xlsx': 'document',
- 'ppt': 'document',
- 'pptx': 'document',
- 'txt': 'document'
- }
- return typeMap[fileExt] || 'other'
- },
- async loadOptions() {
- try {
- const [groupRes, tagRes] = await Promise.all([
- getGroupOptions(),
- getTagOptions({dictType:'project_label'})
- ])
- if (groupRes.code === 200 && groupRes.data) {
- this.groupOptions = groupRes.data
- }
- if (tagRes.code === 200 && tagRes.data) {
- this.tagOptions = tagRes.data
- }
- } catch (e) {
- console.error('加载选项失败', e)
- }
- },
- async loadTaskData() {
- // 加载已有任务数据
- },
- async handleSubmit() {
- if (!this.formData.title) {
- uni.showToast({ icon: 'none', title: '请输入标题' })
- return
- }
- if (!this.formData.groupId) {
- uni.showToast({ icon: 'none', title: '请选择项目分组' })
- return
- }
- if (!this.formData.tagId) {
- uni.showToast({ icon: 'none', title: '请选择项目标签' })
- return
- }
- if (!this.formData.coverImage) {
- uni.showToast({ icon: 'none', title: '请上传封面' })
- return
- }
- // 附件可选,不再强制要求
- // if (this.formData.attachments.length === 0) {
- // uni.showToast({ icon: 'none', title: '请上传附件' })
- // return
- // }
-
- try {
- uni.showLoading({ title: '提交中...' })
-
- // 获取用户信息
- const userInfo = JSON.parse(uni.getStorageSync('userInfo') || '{}')
- const userId = userInfo.id || ''
-
- // 构建附件 URL(多个附件用逗号分隔,确保是字符串类型)
- const attachmentUrl = this.formData.attachments && this.formData.attachments.length > 0
- ? this.formData.attachments.map(item => item.url).filter(url => url).join(',')
- : '' // 如果没有附件,返回空字符串
-
- // 按照 API 要求的 JSON 结构构建提交数据
- const submitData = {
- attachmentUrl: attachmentUrl, // 附件 URL(多个用逗号分隔)
- content: this.formData.summary || '', // 摘要/内容
- coverImage: this.formData.coverImage, // 封面图片
- projectId: parseInt(this.formData.groupId) || 0, // 项目分组 ID
- tagIds: this.formData.tagId || '', // 标签 ID(字符串)
- taskId: parseInt(this.taskId) || 0, // 任务 ID
- title: this.formData.title, // 标题
- userId: userId, // 用户 ID
- taskType:this.taskType,
- // 以下字段为可选,设置默认值
- // deliveryName: '',
- // deliveryNo: '',
- // projectLink: '',
- // remark: '',
- // taskName: '',
- // taskType:this.taskType,
- // validViews: 0,
- // viewCount: 0
- }
-
- const res = await submitTask(submitData)
- uni.hideLoading()
- if (res.code === 200) {
- uni.navigateTo({
- url: '/pages_task/taskCompleteSuccess'
- })
- } else {
- uni.showToast({ icon: 'none', title: res.msg || '提交失败' })
- }
- } catch (e) {
- uni.hideLoading()
- console.error('提交失败', e)
- uni.showToast({ icon: 'none', title: '提交失败' })
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .container {
- min-height: 100vh;
- background: #f5f5f5;
- display: flex;
- flex-direction: column;
- }
- .status-bar {
- width: 100%;
- background: #fff;
- }
- .header {
- position: relative;
- height: 88rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- background: #fff;
- border-bottom: 1rpx solid #f0f0f0;
-
- .back-btn {
- position: absolute;
- left: 24rpx;
- width: 40rpx;
- height: 40rpx;
-
- image {
- width: 100%;
- height: 100%;
- }
- }
-
- .title {
- font-size: 36rpx;
- font-weight: bold;
- color: #333;
- }
-
- .header-right {
- position: absolute;
- right: 24rpx;
- display: flex;
- align-items: center;
- gap: 16rpx;
-
- .more-icon {
- font-size: 32rpx;
- color: #333;
- }
- }
- }
- .content {
- flex: 1;
- padding: 24rpx;
- padding-bottom: 120rpx;
- box-sizing: border-box;
- }
- .form-section {
- background: #fff;
- border-radius: 16rpx;
- padding: 24rpx;
- &:last-child{
- border-bottom: 0;
- }
- // margin-bottom: 24rpx;
-
- .form-label {
- display: flex;
- align-items: center;
- margin-bottom: 16rpx;
- font-size: 28rpx;
- color: #333;
-
- .required {
- color: #FF5030;
- margin-right: 4rpx;
- }
- }
-
- .form-tips {
- font-size: 24rpx;
- color: #999;
- margin-bottom: 16rpx;
- }
-
- .form-input-wrapper {
- position: relative;
- border-bottom: 1rpx solid #EBEDF0;
- .form-input {
- width: 100%;
- min-height: 120rpx;
- padding: 16rpx;
- font-size: 28rpx;
- color: #333;
- box-sizing: border-box;
- }
-
- .char-count {
- position: absolute;
- right: 16rpx;
- bottom: 16rpx;
- font-size: 24rpx;
- color: #999;
- }
- }
-
- .form-select {
- display: flex;
- align-items: center;
- justify-content: space-between;
- height: 80rpx;
- padding: 0 24rpx;
- border-bottom: 1rpx solid #EBEDF0;
- font-size: 28rpx;
- color: #333;
-
- .placeholder {
- color: #999;
- }
-
- .arrow-right {
- font-size: 24rpx;
- color: #999;
- }
- }
-
- .upload-cover {
- width: 200rpx;
- height: 200rpx;
- background: #f5f5f5;
- border-radius: 8rpx;
- display: flex;
- align-items: center;
- justify-content: center;
-
- .img {
- width: 100%;
- height: 100%;
- border-radius: 8rpx;
- }
-
- .upload-placeholder {
- .camera-icon {
- font-size: 60rpx;
- }
- }
- }
-
- .attachment-list {
- .attachment-item {
- display: flex;
- align-items: center;
- padding: 16rpx;
- background: #f5f5f5;
- border-radius: 8rpx;
- margin-bottom: 16rpx;
-
- .attachment-icon {
- font-size: 32rpx;
- margin-right: 16rpx;
- }
-
- .attachment-info {
- flex: 1;
- display: flex;
- flex-direction: column;
-
- .attachment-name {
- font-size: 28rpx;
- color: #333;
- margin-bottom: 4rpx;
- }
-
- .attachment-size {
- font-size: 24rpx;
- color: #999;
- }
- }
-
- .attachment-delete {
- font-size: 40rpx;
- color: #999;
- width: 40rpx;
- height: 40rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- }
-
- .add-attachment {
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 24rpx;
- background: rgba(56,139,255,0.08);
- border-radius: 12rpx 12rpx 12rpx 12rpx;
- border: 2rpx solid #388BFF;
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- color: #388BFF;
-
- .add-icon {
- font-size: 32rpx;
- margin-right: 8rpx;
- }
- }
- }
- }
- .submit-box{
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- background: #fff;
- z-index: 100;
- padding: 24rpx 32rpx;
- .submit-btn {
- height: 88rpx;
- background: #388BFF;
- border-radius: 200rpx 200rpx 200rpx 200rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 32rpx;
- color: #fff;
- font-weight: 500;
-
- }
- }
- .picker-popup {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: rgba(0, 0, 0, 0.5);
- z-index: 999;
- display: flex;
- align-items: flex-end;
- }
- .picker-content {
- width: 100%;
- background: #fff;
- border-radius: 24rpx 24rpx 0 0;
-
- .picker-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 24rpx;
- border-bottom: 1rpx solid #f0f0f0;
-
- .picker-cancel {
- font-size: 30rpx;
- color: #666;
- }
-
- .picker-title {
- font-size: 32rpx;
- font-weight: bold;
- color: #333;
- }
-
- .picker-confirm {
- font-size: 30rpx;
- color: #388BFF;
- }
- }
-
- .picker-body {
- padding: 24rpx;
- max-height: 600rpx;
- overflow-y: auto;
-
- .picker-item {
- padding: 24rpx 0;
- font-size: 30rpx;
- color: #333;
- border-bottom: 1rpx solid #f0f0f0;
-
- &:last-child {
- border-bottom: none;
- }
-
- &.active {
- color: #388BFF;
- font-weight: bold;
- }
- }
- }
- }
- // 上传进度弹窗样式
- .upload-modal {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: rgba(0, 0, 0, 0.6);
- z-index: 9999;
- display: flex;
- align-items: center;
- justify-content: center;
-
- .upload-modal-content {
- width: 560rpx;
- background: #fff;
- border-radius: 24rpx;
- padding: 48rpx 40rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
-
- .upload-modal-title {
- font-size: 32rpx;
- font-weight: bold;
- color: #333;
- margin-bottom: 40rpx;
- }
-
- .upload-progress-wrapper {
- width: 100%;
- margin-bottom: 32rpx;
- }
-
- .upload-modal-tips {
- font-size: 24rpx;
- color: #999;
- }
- }
- }
- </style>
|