feat: 部分功能,新增附件上传功能,优化登录页面,修复bug。
This commit is contained in:
@@ -84,6 +84,19 @@
|
||||
<text class="info-label">备注</text>
|
||||
<text class="info-value">{{ item.remark }}</text>
|
||||
</view>
|
||||
<view class="info-item info-item-full" v-if="parseAttachment(item.attachment).length">
|
||||
<text class="info-label">附件</text>
|
||||
<view class="attachment-list">
|
||||
<image
|
||||
v-for="(img, imgIdx) in parseAttachment(item.attachment)"
|
||||
:key="imgIdx"
|
||||
:src="img"
|
||||
class="attachment-thumb"
|
||||
mode="aspectFill"
|
||||
@click.stop="previewAttachment(parseAttachment(item.attachment), imgIdx)"
|
||||
></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -180,6 +193,7 @@ import { getDicts } from '@/api/system/dict/data.js'
|
||||
import { timeHandler } from '@/utils/common.ts'
|
||||
import {onLoad,onShow} from "@dcloudio/uni-app";
|
||||
import dayjs from 'dayjs'
|
||||
import config from '@/config'
|
||||
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
|
||||
import {reactive ,toRefs,ref,computed }from "vue";
|
||||
const pageNum = ref(1)
|
||||
@@ -409,6 +423,23 @@ function getList() {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function parseAttachment(attachment) {
|
||||
if (!attachment) return []
|
||||
// 附件是后端静态资源直链,需要用域名拼接,不能带网关前缀 prod-api
|
||||
const origin = config.baseUrl.replace(/^(https?:\/\/[^/]+).*$/, '$1')
|
||||
return attachment.split(',').filter(url => url).map(url => {
|
||||
if (url.startsWith('http')) return url
|
||||
return origin + url
|
||||
})
|
||||
}
|
||||
|
||||
function previewAttachment(urls, index) {
|
||||
uni.previewImage({
|
||||
urls: urls,
|
||||
current: urls[index]
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -489,6 +520,27 @@ function getList() {
|
||||
border: 1rpx solid rgba(19, 194, 194, 0.3);
|
||||
}
|
||||
|
||||
.attachment-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12rpx;
|
||||
margin-top: 4rpx;
|
||||
width: 100%;
|
||||
|
||||
.attachment-thumb {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 8rpx;
|
||||
background: #f5f7fa;
|
||||
box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.08);
|
||||
transition: transform 0.2s ease;
|
||||
|
||||
&:active {
|
||||
transform: scale(0.95);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== 费用汇总面板 ====================
|
||||
.summary-mask {
|
||||
position: fixed;
|
||||
|
||||
Reference in New Issue
Block a user