修改上传图片显示
parent
b7bc45a539
commit
e51a4e65d3
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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'),
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue