修改上传图片显示

master
于肖磊 2025-07-03 18:21:48 +08:00
parent b7bc45a539
commit e51a4e65d3
5 changed files with 30 additions and 19 deletions

View File

@ -2,7 +2,7 @@
<!-- 视频 -->
<view>
<template v-if="file.length > 0">
<!-- <view class="flex-row gap-20 align-c">
<view class="flex-row gap-20 align-c">
<view class="file-title text-line-1" :style="propStyle + 'width:auto;height:100%'">
{{ file[0].original || '' }}
</view>
@ -15,7 +15,7 @@
<iconfont name="icon-download-btn" size="20rpx" />
</view>
</view>
</view> -->
</view>
</template>
<template v-else>
<view class="file-title" :style="propStyle + 'width:100%;height:100%'">暂无文件</view>

View File

@ -12,7 +12,7 @@
<!-- 左右模式 -->
<!-- <template v-if="flex_direction == 'row'"> -->
<view :class="'wh-auto ht-auto ' + (flex_direction == 'row' ? 'flex-row align-b gap-10' : 'flex-col gap-10')">
<view v-if="!['rich-text', 'auxiliary-line'].includes(item.key)" class="field-label flex-row align-c gap-10" :style="field_label_style">
<view v-if="!['rich-text', 'auxiliary-line', 'upload-attachments'].includes(item.key)" class="field-label flex-row align-c gap-10" :style="field_label_style">
<view class="flex-row align-c" :style="title_style">{{ item.com_data.title }}<view v-if="item.com_data.is_required == '1'" class="required">*</view></view>
<view v-if="item.com_data.common_config.help_is_show == '1' && !isEmpty(item.com_data.common_config.help_explain)" :data-value="item.com_data.common_config.help_explain" @tap="help_icon_event">
<iconfont name="icon-miaosha-hdgz" :size="help_icon_style" color="#999"></iconfont>

View File

@ -102,6 +102,10 @@
type: [Number, String, Array, Object],
default: '',
},
propKey: {
type: [String, Number],
default: 0,
},
},
data() {
return {
@ -128,18 +132,26 @@
}
}
},
watch: {
propKey(val) {
this.init();
}
},
mounted() {
// 80%16
const block = (sys_width * 0.8) / 16;
this.setData({
popup_width: block * 16 * 2 + 'rpx', // 16:9
popup_height: block * 9 * 2 + 'rpx', //
form_images_list: this.propData,
});
this.init();
},
created: function () {},
methods: {
init() {
// 80%16
const block = (sys_width * 0.8) / 16;
this.setData({
popup_width: block * 16 * 2 + 'rpx', // 16:9
popup_height: block * 9 * 2 + 'rpx', //
form_images_list: this.propData,
});
},
//
upload_one_by_one(img_paths, success, fail, count, length, action) {
var self = this;
@ -190,9 +202,6 @@
});
}
},
message(e) {
console.log(e);
},
//
file_upload_event(e) {
if (this.propType == 'img') {
@ -253,6 +262,8 @@
//
upload_delete_event(e) {
console.log('删除');
var self = this;
uni.showModal({
title: this.$t('common.warm_tips'),

View File

@ -1,5 +1,5 @@
<template>
<uploads :propType="propType" :propData="form_value" :propMaxNum="max_num" :propPathType="pathType" :propBorderStyle="border_style" @call-back="call_back"></uploads>
<uploads :propKey="propKey" :propType="propType" :propData="form_value" :propMaxNum="max_num" :propPathType="pathType" :propBorderStyle="border_style" @call-back="call_back"></uploads>
</template>
<script>
@ -52,7 +52,7 @@
propKey(val) {
//
this.init();
},
}
},
mounted() {
this.init();

View File

@ -52,19 +52,19 @@
//
app.globalData.page_event_onload_handle(params);
//
//
this.setData({
params: app.globalData.launch_params_handle(params),
});
//
this.get_data();
},
onShow() {
//
app.globalData.page_event_onshow_handle();
//
this.get_data();
// onshow
this.init_common();